├── .eslintrc ├── .gitignore ├── CODEOWNERS ├── LICENSE ├── Makefile ├── README.md ├── SUMMARY.md ├── bin ├── unbundle_dist.js └── unbundle_django.js ├── book.json ├── demo ├── api │ └── README.md ├── css │ ├── client.css │ └── editor.css ├── fonts │ ├── bootstrap │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── kraftwerk.ttf │ └── kraftwerk2.ttf ├── img │ ├── eq-red.gif │ ├── favicon.ico │ ├── icons │ │ ├── danger.png │ │ ├── disallowed.png │ │ ├── doubleColumn-disabled.png │ │ ├── doubleColumn.png │ │ ├── singleColumn-disabled.png │ │ └── singleColumn.png │ ├── loader.gif │ ├── spinner.gif │ └── tdmn.png ├── index.html ├── js │ ├── client.js │ ├── client.js.map │ ├── editor.js │ └── editor.js.map └── test-api.json ├── dist ├── css │ ├── client.css │ └── editor.css ├── fonts │ ├── bootstrap │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── kraftwerk.ttf │ └── kraftwerk2.ttf ├── img │ ├── eq-red.gif │ ├── favicon.ico │ ├── icons │ │ ├── danger.png │ │ ├── disallowed.png │ │ ├── doubleColumn-disabled.png │ │ ├── doubleColumn.png │ │ ├── singleColumn-disabled.png │ │ └── singleColumn.png │ ├── loader.gif │ ├── spinner.gif │ └── tdmn.png ├── index.html ├── js │ ├── client.js │ ├── client.js.map │ ├── editor.js │ └── editor.js.map └── test-api.json ├── docs ├── api │ ├── axes.md │ ├── data.md │ ├── datamap.md │ ├── embed.md │ ├── margins.md │ ├── scripts.md │ ├── template.md │ ├── text.md │ └── ui.md ├── chartwerk-api.md ├── chartwerk-backend.md ├── chartwerk_api.md ├── developing.md ├── embedding.md ├── how-chartwerk-makes-charts.md ├── img │ ├── datamap │ │ ├── base.png │ │ ├── data_series.png │ │ ├── scale.png │ │ └── value.png │ ├── how-chartwerk-makes-charts.png │ └── screenshots │ │ ├── api_tree.png │ │ ├── base_axis_date.png │ │ ├── color_legend.png │ │ ├── color_scale.png │ │ ├── color_scheme.png │ │ ├── data_classify.png │ │ ├── dependencies.png │ │ ├── double_wide.png │ │ ├── editor_full.png │ │ ├── free_annotations.png │ │ ├── margins.png │ │ ├── raw_data.png │ │ ├── save_chart.png │ │ ├── screenshot.png │ │ ├── scripr_editor_select.png │ │ ├── script_editor.png │ │ ├── shaded_regions.png │ │ ├── single_wide.png │ │ ├── size_select.png │ │ ├── tabs.png │ │ ├── template.png │ │ ├── template_datamap.png │ │ ├── template_tags.png │ │ ├── template_text.png │ │ ├── text.png │ │ └── value_axis.png ├── introduction.md ├── logo.png └── template-basics.md ├── gulp ├── index.js ├── server │ └── server.js └── tasks │ ├── api.js │ ├── dev.js │ ├── nunjucks.js │ └── production.js ├── gulpfile.js ├── misc ├── datamap.svg ├── logo.svg └── swag.svg ├── package.json ├── postcss.config.js ├── src ├── js │ ├── actions │ │ ├── api.js │ │ ├── axis.js │ │ ├── data.js │ │ ├── embed.js │ │ ├── index.js │ │ ├── margin.js │ │ ├── script.js │ │ ├── template.js │ │ ├── text.js │ │ └── ui.js │ ├── client.js │ ├── client │ │ ├── annotations.js │ │ ├── index.js │ │ ├── legend.js │ │ ├── size.js │ │ └── text.js │ ├── components │ │ ├── annotations │ │ │ ├── ColorPicker.jsx │ │ │ ├── Editor.jsx │ │ │ ├── Legend.jsx │ │ │ ├── LegendDisplay.jsx │ │ │ └── LegendKeys.jsx │ │ ├── axes │ │ │ ├── BaseAxis.jsx │ │ │ ├── DateFormat.jsx │ │ │ ├── NumericFormat.jsx │ │ │ ├── ScaleAxis.jsx │ │ │ ├── ShadedRegions.jsx │ │ │ └── ValueAxis.jsx │ │ ├── code │ │ │ ├── ApiExplorer.jsx │ │ │ ├── Dependencies.jsx │ │ │ └── Editor.jsx │ │ ├── data │ │ │ ├── BaseTypePicker.jsx │ │ │ ├── ColorPicker.jsx │ │ │ ├── ColorScheme.jsx │ │ │ ├── DataInput.jsx │ │ │ ├── DataSelect.jsx │ │ │ ├── Quantizer.jsx │ │ │ ├── QuantizerViz-d3.js │ │ │ └── QuantizerViz.jsx │ │ ├── layout │ │ │ ├── Margin.jsx │ │ │ ├── MarginViz-d3.js │ │ │ └── MarginViz.jsx │ │ ├── preview │ │ │ └── SizeSwitch.jsx │ │ ├── publish │ │ │ ├── DatamapOpts.jsx │ │ │ ├── EmbedCode.jsx │ │ │ ├── MDEditor.jsx │ │ │ └── Publish.jsx │ │ └── text │ │ │ └── Inputs.jsx │ ├── constants │ │ ├── actions.js │ │ ├── colors.js │ │ ├── datamap.js │ │ └── datetime.js │ ├── containers │ │ ├── App.jsx │ │ ├── panes │ │ │ ├── Editor.jsx │ │ │ └── Preview.jsx │ │ └── tabs │ │ │ ├── Annotations.jsx │ │ │ ├── Axes.jsx │ │ │ ├── Code.jsx │ │ │ ├── Data.jsx │ │ │ ├── Layout.jsx │ │ │ ├── Nav.jsx │ │ │ ├── Publish.jsx │ │ │ ├── Text.jsx │ │ │ └── index.jsx │ ├── editor.jsx │ ├── misc │ │ ├── api.js │ │ ├── config.js │ │ └── utils.js │ ├── reducers │ │ ├── axis.js │ │ ├── data.js │ │ ├── datamap.js │ │ ├── embed.js │ │ ├── index.js │ │ ├── margin.js │ │ ├── script.js │ │ ├── template.js │ │ ├── text.js │ │ └── ui.js │ └── stores │ │ └── index.js ├── scss │ ├── _annotations.scss │ ├── _bootstrap.scss │ ├── _chartwerkReset.scss │ ├── _colors.scss │ ├── _editor.scss │ ├── _fonts.scss │ ├── _form-controls.scss │ ├── _header.scss │ ├── _legend.scss │ ├── _nav.scss │ ├── _preview.scss │ ├── _styles.scss │ ├── _toggle.scss │ ├── _variables.scss │ ├── client.scss │ ├── editor.scss │ ├── modals │ │ ├── _data-help.scss │ │ ├── _data-preview.scss │ │ └── _loading.scss │ └── tabs │ │ ├── annotations │ │ └── _editor.scss │ │ ├── axes │ │ └── _base.scss │ │ ├── code │ │ └── _editor.scss │ │ ├── data │ │ ├── _color-picker.scss │ │ ├── _color-scheme.scss │ │ ├── _data-input.scss │ │ ├── _data-select.scss │ │ └── _quantizer.scss │ │ ├── layout │ │ └── _margin.scss │ │ ├── publish │ │ └── _publish.scss │ │ └── text │ │ ├── _inputs.scss │ │ └── _legend.scss └── templates │ ├── base.html │ ├── django-chartwerk-editor.html │ └── index.html ├── styles └── website.css ├── test └── reducers │ ├── axis-test.js │ └── datamap-test.js ├── webpack-dev.config.js ├── webpack-prod.config.js └── yarn.lock /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "airbnb", 3 | "rules": { 4 | "no-unsafe-finally": 0, 5 | "no-useless-computed-key": 0, 6 | "react/forbid-prop-types": 0, 7 | "react/require-render-return": 0, 8 | "react/jsx-first-prop-new-line": 0, 9 | "jsx-a11y/no-noninteractive-element-interactions": 0, 10 | "no-console": 0, 11 | "react/prefer-es6-class": 0, 12 | "no-eval": 0, 13 | "react/jsx-no-bind": 0, 14 | "react/sort-comp": 0 15 | }, 16 | "env": { 17 | "browser": true 18 | }, 19 | "globals": { 20 | "$": false 21 | }, 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # node-waf configuration 21 | .lock-wscript 22 | 23 | # Compiled binary addons (http://nodejs.org/api/addons.html) 24 | build/Release 25 | 26 | # Dependency directories 27 | node_modules 28 | bower_components 29 | jspm_packages 30 | 31 | # Optional npm cache directory 32 | .npm 33 | 34 | # Optional REPL history 35 | .node_repl_history 36 | 37 | .bowerrc 38 | 39 | # File used to divert post-install task 40 | installed 41 | 42 | .DS_Store 43 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @hobbes7878 @achavez 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | copydemo: 2 | cp -rp ./dist/js/* ./demo/js 3 | cp -rp ./dist/css/* ./demo/css 4 | cp -rp ./dist/fonts/* ./demo/fonts 5 | cp -rp ./dist/img/* ./demo/img 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 2 | 3 | 4 | A [React](https://facebook.github.io/react/)/[Redux](http://redux.js.org/)-based live editor for Chartwerk charts. 5 | 6 | This repository contains the chart editor. For the deployable Chartwerk app, see [django-chartwerk](https://github.com/DallasMorningNews/django-chartwerk/). 7 | 8 | See a demo of the editor [here](http://dallasmorningnews.github.io/chartwerk-editor/). 9 | 10 | Documentation hosted [on gitbook](https://the-dallas-morning-news.gitbooks.io/chartwerk-editor/content/docs/introduction.html). 11 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [README](README.md) 4 | * [Introduction](docs/introduction.md) 5 | * [How Chartwerk makes charts](docs/how-chartwerk-makes-charts.md) 6 | * [Chart template basics](docs/template-basics.md) 7 | * [Chartwerk's API](docs/chartwerk-api.md) 8 | * [Data](docs/api/data.md) 9 | * [Datamap](docs/api/datamap.md) 10 | * [Axes](docs/api/axes.md) 11 | * [Margins](docs/api/margins.md) 12 | * [Text](docs/api/text.md) 13 | * [Scripts](docs/api/scripts.md) 14 | * [Template](docs/api/template.md) 15 | * [UI](docs/api/ui.md) 16 | * [Embed](docs/api/embed.md) 17 | * [Integrating with a backend](docs/chartwerk-backend.md) 18 | * [Embedding Chartwerk charts](docs/embedding.md) 19 | * [Developing](docs/developing.md) 20 | 21 | -------------------------------------------------------------------------------- /bin/unbundle_dist.js: -------------------------------------------------------------------------------- 1 | const vfs = require('vinyl-fs'); 2 | const path = require('path'); 3 | 4 | // Change working directory to lib 5 | process.chdir(path.join(__dirname, '/../')); 6 | 7 | vfs.src('./dist/**/*').pipe(vfs.dest('./../../dist/')); 8 | -------------------------------------------------------------------------------- /bin/unbundle_django.js: -------------------------------------------------------------------------------- 1 | const vfs = require('vinyl-fs'); 2 | const path = require('path'); 3 | 4 | // Change working directory to lib 5 | process.chdir(path.join(__dirname, '/../')); 6 | 7 | vfs.src('./dist/js/**/*').pipe(vfs.dest('./../../../static/chartwerk/js')); 8 | vfs.src('./dist/css/**/*').pipe(vfs.dest('./../../../static/chartwerk/css')); 9 | vfs.src('./dist/img/**/*').pipe(vfs.dest('./../../../static/chartwerk/img')); 10 | vfs.src('./dist/fonts/**/*').pipe(vfs.dest('./../../../static/chartwerk/fonts')); 11 | vfs.src(['./src/templates/**/*.html', '!./**/index.html', '!./**/base.html']) 12 | .pipe(vfs.dest('./../../../templates/chartwerk')); 13 | -------------------------------------------------------------------------------- /book.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "github" 4 | ], 5 | "pluginsConfig": { 6 | "github": { 7 | "url": "https://github.com/DallasMorningNews/chartwerk-editor" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /demo/api/README.md: -------------------------------------------------------------------------------- 1 | The API data for this demo is hosted on Amazon Web Services S3 and rendered RESTfully through AWS Lambda and API Gateway. 2 | -------------------------------------------------------------------------------- /demo/fonts/bootstrap/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/fonts/bootstrap/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /demo/fonts/bootstrap/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/fonts/bootstrap/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /demo/fonts/bootstrap/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/fonts/bootstrap/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /demo/fonts/bootstrap/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/fonts/bootstrap/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /demo/fonts/kraftwerk.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/fonts/kraftwerk.ttf -------------------------------------------------------------------------------- /demo/fonts/kraftwerk2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/fonts/kraftwerk2.ttf -------------------------------------------------------------------------------- /demo/img/eq-red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/eq-red.gif -------------------------------------------------------------------------------- /demo/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/favicon.ico -------------------------------------------------------------------------------- /demo/img/icons/danger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/icons/danger.png -------------------------------------------------------------------------------- /demo/img/icons/disallowed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/icons/disallowed.png -------------------------------------------------------------------------------- /demo/img/icons/doubleColumn-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/icons/doubleColumn-disabled.png -------------------------------------------------------------------------------- /demo/img/icons/doubleColumn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/icons/doubleColumn.png -------------------------------------------------------------------------------- /demo/img/icons/singleColumn-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/icons/singleColumn-disabled.png -------------------------------------------------------------------------------- /demo/img/icons/singleColumn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/icons/singleColumn.png -------------------------------------------------------------------------------- /demo/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/loader.gif -------------------------------------------------------------------------------- /demo/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/spinner.gif -------------------------------------------------------------------------------- /demo/img/tdmn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/demo/img/tdmn.png -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Chartwerk 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |

31 | Chartwerk 32 | 33 | Start 34 | Browse 35 | MyWerk 36 | 37 |

38 |
39 | 40 |
41 | 42 | 43 | 44 | 45 | 46 |
47 |
48 |
Loading
49 |
50 | 51 | 63 | 64 | 65 | 66 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /dist/fonts/bootstrap/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/fonts/bootstrap/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /dist/fonts/bootstrap/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/fonts/bootstrap/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /dist/fonts/bootstrap/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/fonts/bootstrap/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /dist/fonts/bootstrap/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/fonts/bootstrap/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /dist/fonts/kraftwerk.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/fonts/kraftwerk.ttf -------------------------------------------------------------------------------- /dist/fonts/kraftwerk2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/fonts/kraftwerk2.ttf -------------------------------------------------------------------------------- /dist/img/eq-red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/eq-red.gif -------------------------------------------------------------------------------- /dist/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/favicon.ico -------------------------------------------------------------------------------- /dist/img/icons/danger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/icons/danger.png -------------------------------------------------------------------------------- /dist/img/icons/disallowed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/icons/disallowed.png -------------------------------------------------------------------------------- /dist/img/icons/doubleColumn-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/icons/doubleColumn-disabled.png -------------------------------------------------------------------------------- /dist/img/icons/doubleColumn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/icons/doubleColumn.png -------------------------------------------------------------------------------- /dist/img/icons/singleColumn-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/icons/singleColumn-disabled.png -------------------------------------------------------------------------------- /dist/img/icons/singleColumn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/icons/singleColumn.png -------------------------------------------------------------------------------- /dist/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/loader.gif -------------------------------------------------------------------------------- /dist/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/spinner.gif -------------------------------------------------------------------------------- /dist/img/tdmn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DallasMorningNews/chartwerk-editor/86f7a9d5db3ee980307ca6a84d3b3e53fe8a7751/dist/img/tdmn.png -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Chartwerk 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |

31 | Chartwerk 32 | 33 | Start 34 | Browse 35 | MyWerk 36 | 37 |

38 |
39 | 40 |
41 | 42 | 43 | 44 | 45 | 46 |
47 |
48 |
Loading
49 |
50 | 51 | 52 | 53 | 54 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /docs/api/data.md: -------------------------------------------------------------------------------- 1 | # chartwerk.data 2 | 3 | An array of parsed data pasted into the editor by the chart creator. This is how every chart begins. 4 | 5 | 6 | 7 | For example, the stock data in the above image would be converted to an array that looks like this: 8 | 9 | ```javascript 10 | [ 11 | { 12 | Date: '2015-08-24', 13 | CBM: 45.47, 14 | GQS: 32.84 15 | } 16 | ] 17 | ``` -------------------------------------------------------------------------------- /docs/api/embed.md: -------------------------------------------------------------------------------- 1 | # chartwerk.embed 2 | 3 | Properties used to specify an embed code for a chart. 4 | 5 | - [embed.dimensions](#embed) 6 | 7 | #### embed.dimensions {#embed} 8 | 9 | The dimensions in pixels of the chart at both the single and double-wide size. 10 | 11 | These are queried in the DOM while saving a chart in the editor. They are used in a child embed script to set the dimensions of the iframe and are passed to the client when using the oEmbed endpoint for chart embeds. 12 | 13 | ```JSON 14 | { 15 | single: { 16 | width: 270, 17 | height: 527 18 | }, 19 | double: { 20 | width: 560, 21 | height: 436 22 | } 23 | } 24 | ``` -------------------------------------------------------------------------------- /docs/api/margins.md: -------------------------------------------------------------------------------- 1 | # chartwerk.margins 2 | 3 | The margins around a chart. 4 | 5 | - [margins.{single|double}](#margins) 6 | 7 | 8 | 9 | #### margins.{single|double} {#margins} 10 | 11 | Margin dimensions expressed as a percentage of the chart container width. 12 | 13 | ```JSON 14 | { 15 | top: 0.05, 16 | right: 0.1, 17 | bottom: 0.05, 18 | left: 0.1 19 | } 20 | ``` -------------------------------------------------------------------------------- /docs/api/scripts.md: -------------------------------------------------------------------------------- 1 | # chartwerk.scripts 2 | 3 | Chartwerk scripts are the custom code that underlies every template in Chartwerk. They are completely customizable JS/CSS/HTML scripts and dependency files. 4 | 5 | - [scripts.draw](#scripts-draw) 6 | - [scripts.helper](#scripts-helper) 7 | - [scripts.styles](#scripts-styles) 8 | - [scripts.html](#scripts-html) 9 | - [scripts.dependencies](#scripts-dependencies) 10 | 11 | 12 | 13 | #### scripts.draw {#scripts-draw} 14 | 15 | Contains a single javascript function which **must** be named `draw`. This function is called by Chartwerk to render your chart whenever a user chooses or changes an option in the editor. 16 | 17 | ```javascript 18 | draw(){ 19 | var werk = window.chartwerk; 20 | 21 | var svg = d3.select("#chart") 22 | .append("svg"); 23 | 24 | // etc. 25 | } 26 | ``` 27 | 28 | #### scripts.helper {#scripts-helper} 29 | 30 | You may create an object with methods to help draw your chart. This object can be useful for removing boilerplate code used to parse UI options, keeping your draw function cleaner and easier to work with. 31 | 32 | The object will be accessible in the global scope. 33 | 34 | ```javascript 35 | var werkHelper = { 36 | 37 | parseAxes: function(werk){ 38 | // Do a thing... 39 | }, 40 | 41 | parseScales: function(werk){ 42 | // Do another... 43 | }, 44 | 45 | build: function(werk){ 46 | parseAxes(werk); 47 | parseScales(werk); 48 | // ... 49 | return werk; 50 | } 51 | 52 | } 53 | ``` 54 | 55 | #### scripts.style {#scripts-style} 56 | 57 | CSS style rules. These are injected **below** any dependency stylesheets. 58 | 59 | #### scripts.html {#scripts-html} 60 | 61 | Any HTML elements specified here are appended to the element, `div#chartwerk`. 62 | 63 | **Important:** Chartwerk expects certain elements will be present to inject data from the editor into, specifically text elements. These elements are selected by their `id` property. At minimum the following elements should be present, though they need not _necessarily_ be structured this way: 64 | 65 | ```html 66 |
67 |

68 |
69 |
70 |
71 |
72 | 77 | ``` 78 | 79 | #### scripts.dependencies {#scripts-dependencies} 80 | 81 | An object containing arrays of URLs for scripts and stylesheets used as dependencies by a chart template. 82 | 83 | Only valid URL references to `.js` and `.css` files are allowed. These are injected into the page in the order given. 84 | 85 | ```js 86 | { 87 | scripts: [ 88 | 'https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js', 89 | 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js' 90 | ], 91 | styles: [ 92 | 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css' 93 | ] 94 | } 95 | ``` 96 | -------------------------------------------------------------------------------- /docs/api/template.md: -------------------------------------------------------------------------------- 1 | # chartwerk.template 2 | 3 | Meta data for the template. Remember, a template is just a chart. 4 | 5 | - [template.title](#title) 6 | - [template.description](#description) 7 | - [template.icon](#icon) 8 | - [template.tags](#tags) 9 | 10 | #### template.title {#title} 11 | 12 | Title of the template. 13 | 14 | 15 | 16 | 17 | #### template.description {#description} 18 | 19 | A description of the template. 20 | 21 | #### template.icon {#icon} 22 | 23 | The URL path to an icon image for the template. There is currently no input for this field in the editor. We expect the backend to supply this data. 24 | 25 | #### template.tags {#tags} 26 | 27 | An array of tags that describe the template. These can be used to create a chart type finder in the backend application. Chartwerk queries a separate API endpoint for available tags. 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/api/ui.md: -------------------------------------------------------------------------------- 1 | # chartwerk.ui 2 | 3 | UI properties represent state in the editor. Generally, they are not used to draw the chart. 4 | 5 | - [ui.rawData](#raw) 6 | - [ui.size](#size) 7 | - [ui.datamap](#datamap) 8 | 9 | #### ui.rawData {#raw} 10 | 11 | A string of the raw data pasted into the editor by a chart creator. 12 | 13 | #### ui.size {#size} 14 | 15 | The size of chart to render in the preview window. Either `single` or `double`. 16 | 17 | #### ui.datamap {#datamap} 18 | 19 | The datamap classification options with their aliases and availability (i.e., whether they are visible in the dropdown). 20 | 21 | ```javascript 22 | [ 23 | { 24 | class: "base", 25 | alias: "X axis", 26 | available: true 27 | } 28 | ] 29 | ``` -------------------------------------------------------------------------------- /docs/chartwerk-api.md: -------------------------------------------------------------------------------- 1 | # Chartwerk's API 2 | 3 | The Chartwerk API is a complete JSON representation of every chart Chartwerk makes, from the raw data a user pastes into the Editor to the individual options she chooses for things like colors and text labels to the template code that parses those options to create the chart. 4 | 5 | The entire UI state in the Editor is also represented in the API's JSON, making charts extremely portable. 6 | 7 | In the Editor, the API is accessed via the `chartwerk` global object. When you write template code, you'll get chart data and options through that object. For example: 8 | 9 | ```javascript 10 | var myChartData = chartwerk.data; 11 | ``` 12 | 13 | Chart creators will likely never see the API, but template developers will interact with it directly, as it contains all the key information necessary to build a chart. 14 | 15 | Most chart templates will only use a portion of the data and options specified in the API, but in its entirety, the spec is robust enough to build dozens of chart types. 16 | 17 | #### Learning the API 18 | 19 | Complete documentation for the API is included here, but **the best way to understand how the API works is to observe it in the Editor.** 20 | 21 | Open the full screen JavaScript editor on the Code tab and check out the API tree chart. There you can see the API populated with real data parsed by the template and how those properties change with user input in the Editor. 22 | 23 | -------------------------------------------------------------------------------- /docs/chartwerk-backend.md: -------------------------------------------------------------------------------- 1 | # Integrating chartwerk-editor with a backend 2 | 3 | Chartwerk-editor is simply an interface for creating and editing charts and templates. It needs a backend, which manages the logic of saving and storing charts and templates, managing user charts and baking charts as flat files to AWS or another hosting service, among other important functions. 4 | 5 | These docs are not meant to be an exhaustive guide to how to build a backend for Chartwerk. They simply explain the basic assumptions chartwerk-editor makes about the backend and what it does. 6 | 7 | We'll make mention of [django-chartwerk](https://github.com/DallasMorningNews/django-chartwerk/), a Django-based backend for Chartwerk, in a couple places by way of example, not as a way to describe how the backend _must_ behave. 8 | 9 | - [Backend API](#api) 10 | - [Context supplied to chartwerk-editor](#context) 11 | - [Baking Chartwerk charts](#baking) 12 | 13 | ### Backend API {#api} 14 | 15 | Chartwerk-editor presumes your backend provides a RESTful API. Specifically, you'll need endpoints for charts, templates and template tags. For example: 16 | 17 | Charts 18 | > `api/charts//` 19 | 20 | Templates 21 | > `api/templates/