├── .babelrc ├── .editorconfig ├── .env.template ├── .eslintrc ├── .gitignore ├── .travis.yml ├── README.md ├── dist ├── bundle.js ├── main.css └── main.css.map ├── fixtures ├── dp-co2-many-resources │ ├── data │ │ ├── co2-annmean-gl.csv │ │ ├── co2-annmean-mlo.csv │ │ ├── co2-gr-gl.csv │ │ ├── co2-gr-mlo.csv │ │ ├── co2-mm-gl.csv │ │ └── co2-mm-mlo.csv │ └── datapackage.json ├── dp-inline-data │ └── datapackage.json ├── dp-vix-resource-and-view │ ├── data │ │ └── demo-resource.csv │ └── datapackage.json ├── example-geojson │ ├── README.md │ ├── data │ │ └── example.geojson │ └── datapackage.json ├── example-no-format │ ├── data │ │ └── cities-month.csv │ └── datapackage.json ├── example-topojson │ ├── data │ │ └── example.json │ └── datapackage.json └── schemas │ ├── data-package.json │ ├── fiscal-data-package.json │ ├── registry.json │ └── tabular-data-package.json ├── index.html ├── mocks ├── fileMock.js └── styleMock.js ├── package-lock.json ├── package.json ├── src ├── components │ └── dataPackageView │ │ ├── HandsOnTable.jsx │ │ ├── LeafletMap.jsx │ │ ├── PlotlyChart.jsx │ │ ├── VegaChart.jsx │ │ └── VegaLiteChart.jsx ├── containers │ └── MultiViews.jsx ├── index.jsx └── utils │ └── datapackage.js ├── tests ├── components │ └── dataPackageView │ │ ├── __snapshots__ │ │ └── reactvirtualized.test.jsx.snap │ │ ├── handsontable.test.jsx │ │ ├── leafletmap.test.jsx │ │ ├── plotly.test.jsx │ │ ├── reactvirtualized.test.jsx │ │ ├── vega.test.jsx │ │ └── vegaLite.test.jsx ├── containers │ ├── MultiViews.test.jsx │ └── __snapshots__ │ │ └── MultiViews.test.jsx.snap ├── index.test.jsx └── utils │ └── datapackage.test.js ├── tools ├── analyzeBundle.js ├── build.js ├── chalkConfig.js ├── distServer.js ├── nodeVersionCheck.js ├── removeDemo.js ├── srcServer.js ├── startMessage.js └── testSetup.js ├── vendor ├── d3 │ └── d3.min.js ├── handsontable │ ├── handsontable.full.css │ └── handsontable.full.js ├── vega-embed │ └── vega-embed.js ├── vega-lite │ ├── vega-lite.min.js │ └── vega-lite.min.js.map └── vega │ ├── vega.js │ ├── vega.js.map │ └── vega.min.js ├── webpack.config.dev.js ├── webpack.config.prod.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["latest", "react", "es2015", "stage-0"], 3 | "plugins": ["transform-runtime"], 4 | "env": { 5 | "development": { 6 | "presets": [ 7 | "react-hmre" 8 | ] 9 | }, 10 | "production": { 11 | "plugins": [ 12 | "transform-react-constant-elements", 13 | "transform-react-remove-prop-types" 14 | ] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.env.template: -------------------------------------------------------------------------------- 1 | BIT_STORE_URL= 2 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | --- 2 | extends: 3 | airbnb 4 | environment: 5 | es6 6 | env: 7 | node: true 8 | browser: true 9 | parserOptions: 10 | sourceType: module 11 | rules: 12 | quotes: 13 | - 2 14 | - single 15 | - avoid-escape 16 | semi: 17 | - 2 18 | - never 19 | comma-style: 20 | - 2 21 | - first 22 | comma-dangle: 23 | - 2 24 | - never 25 | one-var: 26 | - 1 27 | - var: always 28 | let: always 29 | const: always 30 | no-use-before-define: 31 | - 2 32 | - nofunc 33 | eqeqeq: 34 | - 1 35 | - smart 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # dist file we don't want committed 7 | dist/bundle.js.map 8 | 9 | # Runtime data 10 | pids 11 | *.pid 12 | *.seed 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # node-waf configuration 27 | .lock-wscript 28 | 29 | # Compiled binary addons (http://nodejs.org/api/addons.html) 30 | build/Release 31 | 32 | # Dependency directories 33 | node_modules 34 | jspm_packages 35 | 36 | # Optional npm cache directory 37 | .npm 38 | 39 | # Optional REPL history 40 | .node_repl_history 41 | 42 | .DS_Store 43 | .env 44 | npm-debug.log 45 | .idea/ 46 | .dist/ 47 | jest_0/ 48 | 49 | # sandbox 50 | sandbox/* 51 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '6' 4 | - '5' 5 | sudo: required 6 | dist: trusty 7 | install: 8 | - npm install 9 | script: 10 | - npm test 11 | after_script: 12 | - node --harmony_proxies node_modules/.bin/jest --coverage && cat ./coverage/lcov.info 13 | | ./node_modules/coveralls/bin/coveralls.js 14 | branches: 15 | only: 16 | - master 17 | - gh-pages 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DPR-JS 2 | [![Build Status](https://travis-ci.org/data-hq/frontend-showcase-js.svg?branch=gh-pages)](https://travis-ci.org/data-hq/frontend-showcase-js) 3 | 4 | Requirements: 5 | 6 | ``` 7 | node: ^6.2.1 8 | npm: ^3.10.6 9 | ``` 10 | 11 | ## Setup 12 | 13 | To install all dependencies: 14 | 15 | ``` 16 | $ npm install 17 | ``` 18 | 19 | To run local dev server: 20 | 21 | ``` 22 | $ npm start 23 | ``` 24 | 25 | To build production bundle.js: 26 | 27 | ``` 28 | $ npm run build 29 | ``` 30 | 31 | ## Tests 32 | 33 | To run all tests (we use Jest and Enzyme for tests): 34 | 35 | ``` 36 | $ npm test 37 | ``` 38 | 39 | To run a particular test: 40 | 41 | ``` 42 | $ npm test nameOfTest 43 | ``` 44 | -------------------------------------------------------------------------------- /dist/main.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8";/*! 2 | (The MIT License) 3 | 4 | Copyright (c) 2012-2014 Marcin Warpechowski 5 | Copyright (c) 2015 Handsoncode sp. z o.o. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | 'Software'), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | 26 | */.handsontable{position:relative}.handsontable .hide{display:none}.handsontable .relative{position:relative}.handsontable.htAutoSize{visibility:hidden;left:-99000px;position:absolute;top:-99000px}.handsontable .wtHider{width:0}.handsontable .wtSpreader{position:relative;width:0;height:auto}.handsontable div,.handsontable input,.handsontable table,.handsontable tbody,.handsontable td,.handsontable textarea,.handsontable th,.handsontable thead{box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box}.handsontable input,.handsontable textarea{min-height:0}.handsontable table.htCore{border-collapse:separate;border-spacing:0;margin:0;border-width:0;table-layout:fixed;width:0;outline-width:0;max-width:none;max-height:none}.handsontable col,.handsontable col.rowHeader{width:50px}.handsontable td,.handsontable th{border-top-width:0;border-left-width:0;border-right:1px solid #ccc;border-bottom:1px solid #ccc;height:22px;empty-cells:show;line-height:21px;padding:0 4px;background-color:#fff;vertical-align:top;overflow:hidden;outline-width:0;white-space:pre-line;background-clip:padding-box}.handsontable td.htInvalid{background-color:#ff4c42!important}.handsontable td.htNoWrap{white-space:nowrap}.handsontable th:last-child{border-right:1px solid #ccc;border-bottom:1px solid #ccc}.handsontable th.htNoFrame,.handsontable th:first-child.htNoFrame,.handsontable tr:first-child th.htNoFrame{border-left-width:0;background-color:#fff;border-color:#fff}.handsontable .htNoFrame+td,.handsontable .htNoFrame+th,.handsontable.htRowHeaders thead tr th:nth-child(2),.handsontable td:first-of-type,.handsontable th:first-child,.handsontable th:nth-child(2){border-left:1px solid #ccc}.handsontable tr:first-child td,.handsontable tr:first-child th{border-top:1px solid #ccc}.ht_master:not(.innerBorderLeft):not(.emptyColumns)~.handsontable:not(.ht_clone_top) thead tr th:first-child,.ht_master:not(.innerBorderLeft):not(.emptyColumns)~.handsontable tbody tr th{border-right-width:0}.ht_master:not(.innerBorderTop) thead tr.lastChild th,.ht_master:not(.innerBorderTop) thead tr:last-child th,.ht_master:not(.innerBorderTop)~.handsontable thead tr.lastChild th,.ht_master:not(.innerBorderTop)~.handsontable thead tr:last-child th{border-bottom-width:0}.handsontable th{background-color:#f3f3f3;color:#222;text-align:center;font-weight:400;white-space:nowrap}.handsontable thead th{padding:0}.handsontable th.active{background-color:#ccc}.handsontable thead th .relative{padding:2px 4px}.handsontable tbody th.ht__highlight,.handsontable thead th.ht__highlight{background-color:#dcdcdc}.handsontable.ht__selection--columns thead th.ht__highlight,.handsontable.ht__selection--rows tbody th.ht__highlight{background-color:#8eb0e7;color:#000}.handsontable .manualColumnResizer{position:fixed;top:0;cursor:col-resize;z-index:110;width:5px;height:25px}.handsontable .manualRowResizer{position:fixed;left:0;cursor:row-resize;z-index:110;height:5px;width:50px}.handsontable .manualColumnResizer.active,.handsontable .manualColumnResizer:hover,.handsontable .manualRowResizer.active,.handsontable .manualRowResizer:hover{background-color:#aab}.handsontable .manualColumnResizerGuide{position:fixed;right:0;top:0;background-color:#aab;display:none;width:0;border-right:1px dashed #777;margin-left:5px}.handsontable .manualRowResizerGuide{position:fixed;left:0;bottom:0;background-color:#aab;display:none;height:0;border-bottom:1px dashed #777;margin-top:5px}.handsontable .manualColumnResizerGuide.active,.handsontable .manualRowResizerGuide.active{display:block;z-index:199}.handsontable .columnSorting{position:relative}.handsontable .columnSorting:hover{text-decoration:underline;cursor:pointer}.handsontable .columnSorting.ascending:after{content:"\25B2";color:#5f5f5f;position:absolute;right:-15px}.handsontable .columnSorting.descending:after{content:"\25BC";color:#5f5f5f;position:absolute;right:-15px}.handsontable .wtBorder{position:absolute;font-size:0}.handsontable .wtBorder.hidden{display:none!important}.handsontable td.area{background:linear-gradient(180deg,rgba(181,209,255,.34) 0,rgba(181,209,255,.34));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#57b5d1ff",endColorstr="#57b5d1ff",GradientType=0);background-color:#fff}.handsontable .wtBorder.corner{font-size:0;cursor:crosshair}.handsontable .htBorder.htFillBorder{background:red;width:1px;height:1px}.handsontableInput{border:0;outline-width:0;margin:0;padding:1px 5px 0;font-family:inherit;line-height:21px;font-size:inherit;box-shadow:inset 0 0 0 2px #5292f7;resize:none;display:inline-block;color:#000;border-radius:0;background-color:#fff}.handsontableInputHolder{position:absolute;top:0;left:0;z-index:100}.htSelectEditor{-webkit-appearance:menulist-button!important;position:absolute;width:auto}.handsontable .htDimmed{color:#777}.handsontable .htSubmenu{position:relative}.handsontable .htSubmenu :after{content:"\25B6";color:#777;position:absolute;right:5px}.handsontable .htLeft{text-align:left}.handsontable .htCenter{text-align:center}.handsontable .htRight{text-align:right}.handsontable .htJustify{text-align:justify}.handsontable .htTop{vertical-align:top}.handsontable .htMiddle{vertical-align:middle}.handsontable .htBottom{vertical-align:bottom}.handsontable .htPlaceholder{color:#999}.handsontable .htAutocompleteArrow{float:right;font-size:10px;color:#eee;cursor:default;width:16px;text-align:center}.handsontable td .htAutocompleteArrow:hover{color:#777}.handsontable td.area .htAutocompleteArrow{color:#d3d3d3}.handsontable .htCheckboxRendererInput{display:inline-block;vertical-align:middle}.handsontable .htCheckboxRendererInput.noValue{opacity:.5}.handsontable .htCheckboxRendererLabel{cursor:pointer;display:inline-block;width:100%}@keyframes opacity-hide{0%{opacity:1}to{opacity:0}}@keyframes opacity-show{0%{opacity:0}to{opacity:1}}.handsontable .handsontable.ht_clone_top .wtHider{padding:0 0 5px}.handsontable .autocompleteEditor.handsontable{padding-right:17px}.handsontable .autocompleteEditor.handsontable.htMacScroll{padding-right:15px}.handsontable.listbox{margin:0}.handsontable.listbox .ht_master table{border:1px solid #ccc;border-collapse:separate;background:#fff}.handsontable.listbox td,.handsontable.listbox th,.handsontable.listbox tr:first-child td,.handsontable.listbox tr:first-child th,.handsontable.listbox tr:last-child th{border-color:transparent}.handsontable.listbox td,.handsontable.listbox th{white-space:nowrap;text-overflow:ellipsis}.handsontable.listbox td.htDimmed{cursor:default;color:inherit;font-style:inherit}.handsontable.listbox .wtBorder{visibility:hidden}.handsontable.listbox tr:hover td,.handsontable.listbox tr td.current{background:#eee}.ht_clone_top{z-index:101}.ht_clone_left{z-index:102}.ht_clone_bottom_left_corner,.ht_clone_debug,.ht_clone_top_left_corner{z-index:103}.handsontable td.htSearchResult{background:#fcedd9;color:#583707}.htBordered{border-width:1px}.htBordered.htTopBorderSolid{border-top-style:solid;border-top-color:#000}.htBordered.htRightBorderSolid{border-right-style:solid;border-right-color:#000}.htBordered.htBottomBorderSolid{border-bottom-style:solid;border-bottom-color:#000}.htBordered.htLeftBorderSolid{border-left-style:solid;border-left-color:#000}.handsontable tbody tr th:nth-last-child(2){border-right:1px solid #ccc}.handsontable thead tr:nth-last-child(2) th.htGroupIndicatorContainer{border-bottom:1px solid #ccc;padding-bottom:5px}.ht_clone_top_left_corner thead tr th:nth-last-child(2){border-right:1px solid #ccc}.htCollapseButton{width:10px;height:10px;line-height:10px;text-align:center;border-radius:5px;border:1px solid #f3f3f3;box-shadow:1px 1px 3px rgba(0,0,0,.4);cursor:pointer;margin-bottom:3px;position:relative}.htCollapseButton:after{content:"";height:300%;width:1px;display:block;background:#ccc;margin-left:4px;position:absolute;bottom:10px}thead .htCollapseButton{right:5px;position:absolute;top:5px;background:#fff}thead .htCollapseButton:after{height:1px;width:700%;right:10px;top:4px}.handsontable tr th .htExpandButton{position:absolute;width:10px;height:10px;line-height:10px;text-align:center;border-radius:5px;border:1px solid #f3f3f3;box-shadow:1px 1px 3px rgba(0,0,0,.4);cursor:pointer;top:0;display:none}.handsontable thead tr th .htExpandButton{top:5px}.handsontable tr th .htExpandButton.clickable{display:block}.collapsibleIndicator{position:absolute;top:50%;transform:translateY(-50%);right:5px;border:1px solid #a6a6a6;line-height:10px;color:#222;border-radius:10px;font-size:10px;width:10px;height:10px;cursor:pointer;box-shadow:0 0 0 6px #eee;background:#eee}.handsontable col.hidden{width:0!important}.handsontable table tr th.lightRightBorder{border-right:1px solid #e6e6e6}.handsontable tr.hidden,.handsontable tr.hidden td,.handsontable tr.hidden th{display:none}.ht_clone_bottom,.ht_clone_left,.ht_clone_top,.ht_master{overflow:hidden}.ht_master .wtHolder{overflow:auto}.ht_clone_left .wtHolder{overflow-x:hidden;overflow-y:auto}.ht_clone_bottom .wtHolder,.ht_clone_top .wtHolder{overflow-x:auto;overflow-y:hidden}.wtDebugHidden{display:none}.wtDebugVisible{display:block;-webkit-animation-duration:.5s;-webkit-animation-name:wtFadeInFromNone;animation-duration:.5s;animation-name:wtFadeInFromNone}@keyframes wtFadeInFromNone{0%{display:none;opacity:0}1%{display:block;opacity:0}to{display:block;opacity:1}}.handsontable.mobile,.handsontable.mobile .wtHolder{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-overflow-scrolling:touch}.htMobileEditorContainer{display:none;position:absolute;top:0;width:70%;height:54pt;background:#f8f8f8;border-radius:20px;border:1px solid #ebebeb;z-index:999;box-sizing:border-box;-webkit-box-sizing:border-box;-webkit-text-size-adjust:none}.topLeftSelectionHandle-HitArea:not(.ht_master .topLeftSelectionHandle-HitArea),.topLeftSelectionHandle:not(.ht_master .topLeftSelectionHandle){z-index:9999}.bottomRightSelectionHandle,.bottomRightSelectionHandle-HitArea,.topLeftSelectionHandle,.topLeftSelectionHandle-HitArea{left:-10000px;top:-10000px}.htMobileEditorContainer.active{display:block}.htMobileEditorContainer .inputs{position:absolute;right:210pt;bottom:10pt;top:10pt;left:14px;height:34pt}.htMobileEditorContainer .inputs textarea{font-size:13pt;border:1px solid #a1a1a1;-webkit-appearance:none;box-shadow:none;position:absolute;left:14px;right:14px;top:0;bottom:0;padding:7pt}.htMobileEditorContainer .cellPointer{position:absolute;top:-13pt;height:0;width:0;left:30px;border-left:13pt solid transparent;border-right:13pt solid transparent;border-bottom:13pt solid #ebebeb}.htMobileEditorContainer .cellPointer.hidden{display:none}.htMobileEditorContainer .cellPointer:before{content:"";display:block;position:absolute;top:2px;height:0;width:0;left:-13pt;border-left:13pt solid transparent;border-right:13pt solid transparent;border-bottom:13pt solid #f8f8f8}.htMobileEditorContainer .moveHandle{position:absolute;top:10pt;left:5px;width:30px;bottom:0;cursor:move;z-index:9999}.htMobileEditorContainer .moveHandle:after{content:"..\A..\A..\A..";white-space:pre;line-height:10px;font-size:20pt;display:inline-block;margin-top:-8px;color:#ebebeb}.htMobileEditorContainer .positionControls{width:205pt;position:absolute;right:5pt;top:0;bottom:0}.htMobileEditorContainer .positionControls>div{width:50pt;height:100%;float:left}.htMobileEditorContainer .positionControls>div:after{content:" ";display:block;width:15pt;height:15pt;text-align:center;line-height:50pt}.htMobileEditorContainer .downButton:after,.htMobileEditorContainer .leftButton:after,.htMobileEditorContainer .rightButton:after,.htMobileEditorContainer .upButton:after{transform-origin:5pt 5pt;-webkit-transform-origin:5pt 5pt;margin:21pt 0 0 21pt}.htMobileEditorContainer .leftButton:after{border-top:2px solid #288ffe;border-left:2px solid #288ffe;-webkit-transform:rotate(-45deg)}.htMobileEditorContainer .leftButton:active:after{border-color:#cfcfcf}.htMobileEditorContainer .rightButton:after{border-top:2px solid #288ffe;border-left:2px solid #288ffe;-webkit-transform:rotate(135deg)}.htMobileEditorContainer .rightButton:active:after{border-color:#cfcfcf}.htMobileEditorContainer .upButton:after{border-top:2px solid #288ffe;border-left:2px solid #288ffe;-webkit-transform:rotate(45deg)}.htMobileEditorContainer .upButton:active:after{border-color:#cfcfcf}.htMobileEditorContainer .downButton:after{border-top:2px solid #288ffe;border-left:2px solid #288ffe;-webkit-transform:rotate(225deg)}.htMobileEditorContainer .downButton:active:after{border-color:#cfcfcf}.handsontable.hide-tween{animation:opacity-hide .3s;animation-fill-mode:forwards;-webkit-animation-fill-mode:forwards}.handsontable.show-tween{animation:opacity-show .3s;animation-fill-mode:forwards;-webkit-animation-fill-mode:forwards}.htCommentCell{position:relative}.htCommentCell:after{content:"";position:absolute;top:0;right:0;border-left:6px solid transparent;border-top:6px solid #000}.htComments{display:none;z-index:1059;position:absolute}.htCommentTextArea{box-shadow:0 1px 3px rgba(0,0,0,.117647),0 1px 2px rgba(0,0,0,.239216);border:0;border-left:3px solid #ccc;background-color:#fff;width:215px;height:90px;font-size:12px;padding:5px;outline:0!important;-webkit-appearance:none}.htCommentTextArea:focus{box-shadow:0 1px 3px rgba(0,0,0,.117647),0 1px 2px rgba(0,0,0,.239216),inset 0 0 0 1px #5292f7;border-left:3px solid #5292f7}/*! 27 | * Handsontable ContextMenu 28 | */.htContextMenu{display:none;position:absolute;z-index:1060}.htContextMenu .ht_clone_corner,.htContextMenu .ht_clone_debug,.htContextMenu .ht_clone_left,.htContextMenu .ht_clone_top{display:none}.htContextMenu table.htCore{border:1px solid #ccc;border-bottom-width:2px;border-right-width:2px}.htContextMenu .wtBorder{visibility:hidden}.htContextMenu table tbody tr td{background:#fff;border-width:0;padding:4px 6px 0;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.htContextMenu table tbody tr td:first-child{border:0}.htContextMenu table tbody tr td.htDimmed{font-style:normal;color:#323232}.htContextMenu table tbody tr td.current,.htContextMenu table tbody tr td.zeroclipboard-is-hover{background:#f3f3f3}.htContextMenu table tbody tr td.htSeparator{border-top:1px solid #bbb;height:0;padding:0;cursor:default}.htContextMenu table tbody tr td.htDisabled{color:#999;cursor:default}.htContextMenu table tbody tr td.htDisabled:hover{background:#fff;color:#999;cursor:default}.htContextMenu table tbody tr.htHidden{display:none}.htContextMenu table tbody tr td .htItemWrapper{margin-left:10px;margin-right:6px}.htContextMenu table tbody tr td div span.selected{margin-top:-2px;position:absolute;left:4px}.htContextMenu .ht_master .wtHolder{overflow:hidden}.htRowHeaders .ht_master.innerBorderLeft~.ht_clone_left td:first-of-type,.htRowHeaders .ht_master.innerBorderLeft~.ht_clone_top_left_corner th:nth-child(2){border-left:0 none}.handsontable.ht__manualColumnMove.after-selection--columns thead th.ht__highlight{cursor:move;cursor:-webkit-grab;cursor:grab}.handsontable.ht__manualColumnMove.on-moving--columns,.handsontable.ht__manualColumnMove.on-moving--columns thead th.ht__highlight{cursor:move;cursor:-webkit-grabbing;cursor:grabbing}.handsontable.ht__manualColumnMove.on-moving--columns .manualColumnResizer{display:none}.handsontable .ht__manualColumnMove--backlight,.handsontable .ht__manualColumnMove--guideline{position:absolute;height:100%;display:none}.handsontable .ht__manualColumnMove--guideline{background:#757575;width:2px;top:0;margin-left:-1px;z-index:105}.handsontable .ht__manualColumnMove--backlight{background:#343434;background:rgba(52,52,52,.25);display:none;z-index:105;pointer-events:none}.handsontable.on-moving--columns .ht__manualColumnMove--backlight,.handsontable.on-moving--columns.show-ui .ht__manualColumnMove--guideline{display:block}.handsontable .wtHider{position:relative}.handsontable.ht__manualRowMove.after-selection--rows tbody th.ht__highlight{cursor:move;cursor:-webkit-grab;cursor:grab}.handsontable.ht__manualRowMove.on-moving--rows,.handsontable.ht__manualRowMove.on-moving--rows tbody th.ht__highlight{cursor:move;cursor:-webkit-grabbing;cursor:grabbing}.handsontable.ht__manualRowMove.on-moving--rows .manualRowResizer{display:none}.handsontable .ht__manualRowMove--backlight,.handsontable .ht__manualRowMove--guideline{position:absolute;width:100%;display:none}.handsontable .ht__manualRowMove--guideline{background:#757575;height:2px;left:0;margin-top:-1px;z-index:105}.handsontable .ht__manualRowMove--backlight{background:#343434;background:rgba(52,52,52,.25);display:none;z-index:105;pointer-events:none}/*! 29 | * Pikaday 30 | * Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/ 31 | */.handsontable.on-moving--rows .ht__manualRowMove--backlight,.handsontable.on-moving--rows.show-ui .ht__manualRowMove--guideline,.pika-single{display:block}.pika-single{z-index:9999;position:relative;color:#333;background:#fff;border:1px solid #ccc;border-bottom-color:#bbb;font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.pika-single:after,.pika-single:before{content:" ";display:table}.pika-single:after{clear:both}.pika-single{*zoom:1}.pika-single.is-hidden{display:none}.pika-single.is-bound{position:absolute;box-shadow:0 5px 15px -5px rgba(0,0,0,.5)}.pika-lendar{float:left;width:240px;margin:8px}.pika-title{position:relative;text-align:center}.pika-label{display:inline-block;*display:inline;position:relative;z-index:9999;overflow:hidden;margin:0;padding:5px 3px;font-size:14px;line-height:20px;font-weight:700;background-color:#fff}.pika-title select{cursor:pointer;position:absolute;z-index:9998;margin:0;left:0;top:5px;filter:alpha(opacity=0);opacity:0}.pika-next,.pika-prev{display:block;cursor:pointer;position:relative;outline:0;border:0;padding:0;width:20px;height:30px;text-indent:20px;white-space:nowrap;overflow:hidden;background-color:transparent;background-position:50%;background-repeat:no-repeat;background-size:75% 75%;opacity:.5;*position:absolute;*top:0}.pika-next:hover,.pika-prev:hover{opacity:1}.is-rtl .pika-next,.pika-prev{float:left;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==");*left:0}.is-rtl .pika-prev,.pika-next{float:right;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=");*right:0}.pika-next.is-disabled,.pika-prev.is-disabled{cursor:default;opacity:.2}.pika-select{display:inline-block;*display:inline}.pika-table{width:100%;border-collapse:collapse;border-spacing:0;border:0}.pika-table td,.pika-table th{width:14.285714285714286%;padding:0}.pika-table th{color:#999;font-size:12px;line-height:25px;font-weight:700;text-align:center}.pika-button{cursor:pointer;display:block;box-sizing:border-box;-moz-box-sizing:border-box;outline:0;border:0;margin:0;width:100%;padding:5px;color:#666;font-size:12px;line-height:15px;text-align:right;background:#f5f5f5}.pika-week{font-size:11px;color:#999}.is-today .pika-button{color:#3af;font-weight:700}.is-selected .pika-button{color:#fff;font-weight:700;background:#3af;box-shadow:inset 0 1px 3px #178fe5;border-radius:3px}.is-inrange .pika-button{background:#d5e9f7}.is-startrange .pika-button{color:#fff;background:#6cb31d;box-shadow:none;border-radius:3px}.is-endrange .pika-button{color:#fff;background:#3af;box-shadow:none;border-radius:3px}.is-disabled .pika-button,.is-outside-current-month .pika-button{pointer-events:none;cursor:default;color:#999;opacity:.3}.pika-button:hover{color:#fff;background:#ff8000;box-shadow:none;border-radius:3px}.pika-table abbr{border-bottom:0;cursor:help}@keyframes sk-fade-in{0%{opacity:0}50%{opacity:0}to{opacity:1}}.sk-fade-in{-webkit-animation:sk-fade-in 2s;-moz-animation:sk-fade-in 2s;-o-animation:sk-fade-in 2s;-ms-animation:sk-fade-in 2s}.sk-chasing-dots{width:27px;height:27px;position:relative;animation:sk-rotate 2s infinite linear}.sk-dot1,.sk-dot2{width:60%;height:60%;display:inline-block;position:absolute;top:0;background-color:#333;border-radius:100%;animation:sk-bounce 2s infinite ease-in-out}.sk-dot2{top:auto;bottom:0;animation-delay:-1s}@keyframes sk-rotate{to{transform:rotate(1turn);-webkit-transform:rotate(1turn)}}@keyframes sk-bounce{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}}.sk-circle-wrapper{width:22px;height:22px;position:relative}.sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-circle:before{content:"";display:block;margin:0 auto;width:20%;height:20%;background-color:#333;border-radius:100%;animation:sk-bouncedelay 1.2s infinite ease-in-out;animation-fill-mode:both}.sk-circle2{transform:rotate(30deg)}.sk-circle3{transform:rotate(60deg)}.sk-circle4{transform:rotate(90deg)}.sk-circle5{transform:rotate(120deg)}.sk-circle6{transform:rotate(150deg)}.sk-circle7{transform:rotate(180deg)}.sk-circle8{transform:rotate(210deg)}.sk-circle9{transform:rotate(240deg)}.sk-circle10{transform:rotate(270deg)}.sk-circle11{transform:rotate(300deg)}.sk-circle12{transform:rotate(330deg)}.sk-circle2:before{animation-delay:-1.1s}.sk-circle3:before{animation-delay:-1s}.sk-circle4:before{animation-delay:-.9s}.sk-circle5:before{animation-delay:-.8s}.sk-circle6:before{animation-delay:-.7s}.sk-circle7:before{animation-delay:-.6s}.sk-circle8:before{animation-delay:-.5s}.sk-circle9:before{animation-delay:-.4s}.sk-circle10:before{animation-delay:-.3s}.sk-circle11:before{animation-delay:-.2s}.sk-circle12:before{animation-delay:-.1s}@keyframes sk-bouncedelay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}.sk-cube-grid{width:27px;height:27px}.sk-cube{width:33%;height:33%;background:#333;float:left;animation:sk-scaleDelay 1.3s infinite ease-in-out}.sk-spinner .sk-cube:first-child{animation-delay:.2s}.sk-spinner .sk-cube:nth-child(2){animation-delay:.3s}.sk-spinner .sk-cube:nth-child(3){animation-delay:.4s}.sk-spinner .sk-cube:nth-child(4){animation-delay:.1s}.sk-spinner .sk-cube:nth-child(5){animation-delay:.2s}.sk-spinner .sk-cube:nth-child(6){animation-delay:.3s}.sk-spinner .sk-cube:nth-child(7){animation-delay:0s}.sk-spinner .sk-cube:nth-child(8){animation-delay:.1s}.sk-spinner .sk-cube:nth-child(9){animation-delay:.2s}@keyframes sk-scaleDelay{0%,70%,to{transform:scale3D(1,1,1)}35%{transform:scale3D(0,0,1)}}.sk-double-bounce{width:27px;height:27px;position:relative}.sk-double-bounce1,.sk-double-bounce2{width:100%;height:100%;border-radius:50%;background-color:#333;opacity:.6;position:absolute;top:0;left:0;animation:sk-bounce 2s infinite ease-in-out}.sk-double-bounce2{animation-delay:-1s}@keyframes sk-bounce{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}}.sk-folding-cube{width:27px;height:27px;position:relative;transform:rotate(45deg)}.sk-folding-cube .sk-cube{float:left;width:50%;height:50%;position:relative;transform:scale(1.1)}.sk-folding-cube .sk-cube:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#333;animation:sk-foldCubeAngle 2.4s infinite linear both;transform-origin:100% 100%}.sk-folding-cube .sk-cube2{transform:scale(1.1) rotate(90deg)}.sk-folding-cube .sk-cube3{transform:scale(1.1) rotate(180deg)}.sk-folding-cube .sk-cube4{transform:scale(1.1) rotate(270deg)}.sk-folding-cube .sk-cube2:before{animation-delay:.3s}.sk-folding-cube .sk-cube3:before{animation-delay:.6s}.sk-folding-cube .sk-cube4:before{animation-delay:.9s}@keyframes sk-foldCubeAngle{0%,10%{transform:perspective(140px) rotateX(-180deg);opacity:0}25%,75%{transform:perspective(140px) rotateX(0deg);opacity:1}90%,to{transform:perspective(140px) rotateY(180deg);opacity:0}}.sk-pulse{width:27px;height:27px;background-color:#333;border-radius:100%;animation:sk-scaleout 1s infinite ease-in-out}@keyframes sk-scaleout{0%{transform:scale(0);-webkit-transform:scale(0)}to{transform:scale(1);-webkit-transform:scale(1);opacity:0}}.sk-rotating-plane{width:27px;height:27px;background-color:#333;animation:sk-rotateplane 1.2s infinite ease-in-out}@keyframes sk-rotateplane{0%{transform:perspective(120px) rotateX(0deg) rotateY(0deg);-webkit-transform:perspective(120px) rotateX(0deg) rotateY(0deg)}50%{transform:perspective(120px) rotateX(-180.1deg) rotateY(0deg);-webkit-transform:perspective(120px) rotateX(-180.1deg) rotateY(0deg)}to{transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg);-webkit-transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg)}}.sk-three-bounce>div{width:18px;height:18px;background-color:#333;border-radius:100%;display:inline-block;animation:sk-bouncedelay 1.4s infinite ease-in-out;animation-fill-mode:both}.sk-three-bounce .sk-bounce1{animation-delay:-.32s}.sk-three-bounce .sk-bounce2{animation-delay:-.16s}@keyframes sk-bouncedelay{0%,80%,to{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}.sk-wandering-cubes{width:27px;height:27px;position:relative}.sk-cube1,.sk-cube2{background-color:#333;width:10px;height:10px;position:absolute;top:0;left:0;animation:sk-cubemove 1.8s infinite ease-in-out}.sk-cube2{animation-delay:-.9s}@keyframes sk-cubemove{25%{transform:translateX(42px) rotate(-90deg) scale(.5);-webkit-transform:translateX(42px) rotate(-90deg) scale(.5)}50%{transform:translateX(42px) translateY(42px) rotate(-179deg);-webkit-transform:translateX(42px) translateY(42px) rotate(-179deg)}50.1%{transform:translateX(42px) translateY(42px) rotate(-180deg);-webkit-transform:translateX(42px) translateY(42px) rotate(-180deg)}75%{transform:translateX(0) translateY(42px) rotate(-270deg) scale(.5);-webkit-transform:translateX(0) translateY(42px) rotate(-270deg) scale(.5)}to{transform:rotate(-1turn);-webkit-transform:rotate(-1turn)}}.sk-wave{width:50px;height:27px}.sk-wave>div{background-color:#333;height:100%;width:6px;display:inline-block;animation:sk-stretchdelay 1.2s infinite ease-in-out}.sk-wave .sk-rect2{animation-delay:-1.1s}.sk-wave .sk-rect3{animation-delay:-1s}.sk-wave .sk-rect4{animation-delay:-.9s}.sk-wave .sk-rect5{animation-delay:-.8s}@keyframes sk-stretchdelay{0%,40%,to{transform:scaleY(.4);-webkit-transform:scaleY(.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.sk-wordpress{background:#333;width:27px;height:27px;display:inline-block;border-radius:27px;position:relative;animation:sk-inner-circle 1s linear infinite}.sk-inner-circle{display:block;background:#fff;width:8px;height:8px;position:absolute;border-radius:8px;top:5px;left:5px}@keyframes sk-inner-circle{0%{transform:rotate(0);-webkit-transform:rotate(0)}to{transform:rotate(1turn);-webkit-transform:rotate(1turn)}} 32 | /*# sourceMappingURL=main.css.map*/ -------------------------------------------------------------------------------- /fixtures/dp-co2-many-resources/data/co2-annmean-gl.csv: -------------------------------------------------------------------------------- 1 | Year,Mean,Uncertainty 2 | 1980,338.80,0.10 3 | 1981,339.99,0.10 4 | 1982,340.76,0.10 5 | 1983,342.44,0.10 6 | 1984,343.98,0.10 7 | 1985,345.46,0.10 8 | 1986,346.88,0.10 9 | 1987,348.61,0.10 10 | 1988,351.14,0.10 11 | 1989,352.79,0.10 12 | 1990,353.96,0.10 13 | 1991,355.29,0.10 14 | 1992,355.99,0.10 15 | 1993,356.71,0.10 16 | 1994,358.20,0.10 17 | 1995,360.02,0.10 18 | 1996,361.79,0.10 19 | 1997,362.90,0.10 20 | 1998,365.55,0.10 21 | 1999,367.63,0.10 22 | 2000,368.81,0.10 23 | 2001,370.41,0.10 24 | 2002,372.42,0.10 25 | 2003,374.96,0.10 26 | 2004,376.78,0.10 27 | 2005,378.81,0.10 28 | 2006,380.93,0.10 29 | 2007,382.67,0.10 30 | 2008,384.78,0.10 31 | 2009,386.28,0.10 32 | 2010,388.56,0.10 33 | 2011,390.44,0.10 34 | 2012,392.45,0.10 35 | 2013,395.19,0.10 36 | 2014,397.12,0.10 37 | 2015,399.41,0.10 38 | -------------------------------------------------------------------------------- /fixtures/dp-co2-many-resources/data/co2-annmean-mlo.csv: -------------------------------------------------------------------------------- 1 | Year,Mean,Uncertainty 2 | 1959,315.97,0.12 3 | 1960,316.91,0.12 4 | 1961,317.64,0.12 5 | 1962,318.45,0.12 6 | 1963,318.99,0.12 7 | 1964,319.62,0.12 8 | 1965,320.04,0.12 9 | 1966,321.38,0.12 10 | 1967,322.16,0.12 11 | 1968,323.04,0.12 12 | 1969,324.62,0.12 13 | 1970,325.68,0.12 14 | 1971,326.32,0.12 15 | 1972,327.45,0.12 16 | 1973,329.68,0.12 17 | 1974,330.18,0.12 18 | 1975,331.08,0.12 19 | 1976,332.05,0.12 20 | 1977,333.78,0.12 21 | 1978,335.41,0.12 22 | 1979,336.78,0.12 23 | 1980,338.68,0.12 24 | 1981,340.10,0.12 25 | 1982,341.44,0.12 26 | 1983,343.03,0.12 27 | 1984,344.58,0.12 28 | 1985,346.04,0.12 29 | 1986,347.39,0.12 30 | 1987,349.16,0.12 31 | 1988,351.56,0.12 32 | 1989,353.07,0.12 33 | 1990,354.35,0.12 34 | 1991,355.57,0.12 35 | 1992,356.38,0.12 36 | 1993,357.07,0.12 37 | 1994,358.82,0.12 38 | 1995,360.80,0.12 39 | 1996,362.59,0.12 40 | 1997,363.71,0.12 41 | 1998,366.65,0.12 42 | 1999,368.33,0.12 43 | 2000,369.52,0.12 44 | 2001,371.13,0.12 45 | 2002,373.22,0.12 46 | 2003,375.77,0.12 47 | 2004,377.49,0.12 48 | 2005,379.80,0.12 49 | 2006,381.90,0.12 50 | 2007,383.76,0.12 51 | 2008,385.59,0.12 52 | 2009,387.37,0.12 53 | 2010,389.85,0.12 54 | 2011,391.63,0.12 55 | 2012,393.82,0.12 56 | 2013,396.48,0.12 57 | 2014,398.61,0.12 58 | 2015,400.83,0.12 59 | -------------------------------------------------------------------------------- /fixtures/dp-co2-many-resources/data/co2-gr-gl.csv: -------------------------------------------------------------------------------- 1 | Year,Annual Increase,Uncertainty 2 | 1959,0.96,0.31 3 | 1960,0.71,0.27 4 | 1961,0.78,0.27 5 | 1962,0.56,0.27 6 | 1963,0.57,0.28 7 | 1964,0.49,0.27 8 | 1965,1.10,0.26 9 | 1966,1.10,0.28 10 | 1967,0.61,0.34 11 | 1968,0.99,0.32 12 | 1969,1.32,0.29 13 | 1970,1.13,0.32 14 | 1971,0.73,0.30 15 | 1972,1.47,0.31 16 | 1973,1.46,0.31 17 | 1974,0.68,0.31 18 | 1975,1.23,0.27 19 | 1976,0.97,0.28 20 | 1977,1.92,0.29 21 | 1978,1.29,0.24 22 | 1979,2.14,0.26 23 | 1980,1.71,0.17 24 | 1981,1.15,0.12 25 | 1982,1.00,0.08 26 | 1983,1.84,0.09 27 | 1984,1.24,0.11 28 | 1985,1.63,0.08 29 | 1986,1.03,0.14 30 | 1987,2.69,0.09 31 | 1988,2.25,0.09 32 | 1989,1.38,0.09 33 | 1990,1.18,0.08 34 | 1991,0.73,0.09 35 | 1992,0.70,0.10 36 | 1993,1.22,0.07 37 | 1994,1.68,0.12 38 | 1995,1.95,0.11 39 | 1996,1.07,0.07 40 | 1997,1.98,0.07 41 | 1998,2.81,0.10 42 | 1999,1.34,0.07 43 | 2000,1.24,0.10 44 | 2001,1.84,0.10 45 | 2002,2.39,0.07 46 | 2003,2.27,0.10 47 | 2004,1.56,0.05 48 | 2005,2.43,0.07 49 | 2006,1.77,0.06 50 | 2007,2.09,0.07 51 | 2008,1.78,0.05 52 | 2009,1.62,0.10 53 | 2010,2.44,0.06 54 | 2011,1.69,0.09 55 | 2012,2.35,0.09 56 | 2013,2.47,0.09 57 | 2014,1.99,0.09 58 | 2015,2.96,0.09 59 | -------------------------------------------------------------------------------- /fixtures/dp-co2-many-resources/data/co2-gr-mlo.csv: -------------------------------------------------------------------------------- 1 | Year,Annual Increase,Uncertainty 2 | 1959,0.94,0.11 3 | 1960,0.54,0.11 4 | 1961,0.95,0.11 5 | 1962,0.64,0.11 6 | 1963,0.71,0.11 7 | 1964,0.28,0.11 8 | 1965,1.02,0.11 9 | 1966,1.24,0.11 10 | 1967,0.74,0.11 11 | 1968,1.03,0.11 12 | 1969,1.31,0.11 13 | 1970,1.06,0.11 14 | 1971,0.85,0.11 15 | 1972,1.69,0.11 16 | 1973,1.22,0.11 17 | 1974,0.78,0.11 18 | 1975,1.13,0.11 19 | 1976,0.84,0.11 20 | 1977,2.10,0.11 21 | 1978,1.30,0.11 22 | 1979,1.75,0.11 23 | 1980,1.73,0.11 24 | 1981,1.43,0.11 25 | 1982,0.96,0.11 26 | 1983,2.13,0.11 27 | 1984,1.36,0.11 28 | 1985,1.25,0.11 29 | 1986,1.48,0.11 30 | 1987,2.29,0.11 31 | 1988,2.13,0.11 32 | 1989,1.32,0.11 33 | 1990,1.19,0.11 34 | 1991,0.99,0.11 35 | 1992,0.48,0.11 36 | 1993,1.40,0.11 37 | 1994,1.91,0.11 38 | 1995,1.99,0.11 39 | 1996,1.25,0.11 40 | 1997,1.91,0.11 41 | 1998,2.93,0.11 42 | 1999,0.93,0.11 43 | 2000,1.62,0.11 44 | 2001,1.58,0.11 45 | 2002,2.53,0.11 46 | 2003,2.29,0.11 47 | 2004,1.56,0.11 48 | 2005,2.52,0.11 49 | 2006,1.76,0.11 50 | 2007,2.22,0.11 51 | 2008,1.60,0.11 52 | 2009,1.89,0.11 53 | 2010,2.42,0.11 54 | 2011,1.88,0.11 55 | 2012,2.61,0.11 56 | 2013,2.10,0.11 57 | 2014,2.18,0.11 58 | 2015,3.05,0.11 59 | -------------------------------------------------------------------------------- /fixtures/dp-co2-many-resources/data/co2-mm-gl.csv: -------------------------------------------------------------------------------- 1 | Date,Decimal Date,Average,Trend 2 | 1980-01,1980.042,338.45,337.82 3 | 1980-02,1980.125,339.15,338.10 4 | 1980-03,1980.208,339.47,338.13 5 | 1980-04,1980.292,339.86,338.24 6 | 1980-05,1980.375,340.30,338.78 7 | 1980-06,1980.458,339.87,339.08 8 | 1980-07,1980.542,338.34,339.19 9 | 1980-08,1980.625,337.12,339.39 10 | 1980-09,1980.708,336.95,339.34 11 | 1980-10,1980.792,337.72,339.05 12 | 1980-11,1980.875,338.83,339.16 13 | 1980-12,1980.958,339.54,339.30 14 | 1981-01,1981.042,340.09,339.46 15 | 1981-02,1981.125,340.65,339.60 16 | 1981-03,1981.208,341.28,339.93 17 | 1981-04,1981.292,341.56,339.95 18 | 1981-05,1981.375,341.29,339.76 19 | 1981-06,1981.458,340.49,339.71 20 | 1981-07,1981.542,339.10,339.94 21 | 1981-08,1981.625,337.95,340.22 22 | 1981-09,1981.708,337.86,340.24 23 | 1981-10,1981.792,338.95,340.30 24 | 1981-11,1981.875,340.06,340.38 25 | 1981-12,1981.958,340.63,340.40 26 | 1982-01,1982.042,341.27,340.65 27 | 1982-02,1982.125,341.85,340.80 28 | 1982-03,1982.208,342.13,340.75 29 | 1982-04,1982.292,342.42,340.81 30 | 1982-05,1982.375,342.27,340.74 31 | 1982-06,1982.458,341.39,340.63 32 | 1982-07,1982.542,339.66,340.51 33 | 1982-08,1982.625,338.02,340.30 34 | 1982-09,1982.708,338.08,340.45 35 | 1982-10,1982.792,339.53,340.87 36 | 1982-11,1982.875,340.86,341.19 37 | 1982-12,1982.958,341.68,341.44 38 | 1983-01,1983.042,342.27,341.61 39 | 1983-02,1983.125,342.64,341.61 40 | 1983-03,1983.208,342.93,341.60 41 | 1983-04,1983.292,343.41,341.84 42 | 1983-05,1983.375,343.74,342.22 43 | 1983-06,1983.458,343.41,342.61 44 | 1983-07,1983.542,342.06,342.82 45 | 1983-08,1983.625,340.55,342.77 46 | 1983-09,1983.708,340.46,342.87 47 | 1983-10,1983.792,341.67,343.07 48 | 1983-11,1983.875,342.73,343.08 49 | 1983-12,1983.958,343.39,343.17 50 | 1984-01,1984.042,344.22,343.57 51 | 1984-02,1984.125,344.74,343.73 52 | 1984-03,1984.208,344.86,343.51 53 | 1984-04,1984.292,345.09,343.47 54 | 1984-05,1984.375,345.24,343.70 55 | 1984-06,1984.458,344.47,343.71 56 | 1984-07,1984.542,343.11,343.92 57 | 1984-08,1984.625,342.13,344.41 58 | 1984-09,1984.708,342.04,344.48 59 | 1984-10,1984.792,342.91,344.29 60 | 1984-11,1984.875,344.08,344.39 61 | 1984-12,1984.958,344.92,344.63 62 | 1985-01,1985.042,345.27,344.58 63 | 1985-02,1985.125,345.71,344.69 64 | 1985-03,1985.208,346.55,345.24 65 | 1985-04,1985.292,346.84,345.24 66 | 1985-05,1985.375,346.68,345.11 67 | 1985-06,1985.458,346.18,345.39 68 | 1985-07,1985.542,344.86,345.68 69 | 1985-08,1985.625,343.36,345.67 70 | 1985-09,1985.708,343.30,345.75 71 | 1985-10,1985.792,344.56,345.94 72 | 1985-11,1985.875,345.69,346.02 73 | 1985-12,1985.958,346.45,346.15 74 | 1986-01,1986.042,347.01,346.32 75 | 1986-02,1986.125,347.23,346.24 76 | 1986-03,1986.208,347.61,346.29 77 | 1986-04,1986.292,348.13,346.51 78 | 1986-05,1986.375,348.23,346.66 79 | 1986-06,1986.458,347.67,346.90 80 | 1986-07,1986.542,346.21,347.05 81 | 1986-08,1986.625,344.83,347.12 82 | 1986-09,1986.708,344.76,347.17 83 | 1986-10,1986.792,345.95,347.32 84 | 1986-11,1986.875,347.22,347.55 85 | 1986-12,1986.958,347.67,347.39 86 | 1987-01,1987.042,347.92,347.14 87 | 1987-02,1987.125,348.47,347.39 88 | 1987-03,1987.208,349.20,347.78 89 | 1987-04,1987.292,349.89,348.21 90 | 1987-05,1987.375,350.17,348.60 91 | 1987-06,1987.458,349.40,348.73 92 | 1987-07,1987.542,347.83,348.81 93 | 1987-08,1987.625,346.59,348.97 94 | 1987-09,1987.708,346.64,349.09 95 | 1987-10,1987.792,347.91,349.30 96 | 1987-11,1987.875,349.19,349.52 97 | 1987-12,1987.958,350.15,349.84 98 | 1988-01,1988.042,350.87,350.07 99 | 1988-02,1988.125,351.43,350.35 100 | 1988-03,1988.208,351.81,350.35 101 | 1988-04,1988.292,352.26,350.49 102 | 1988-05,1988.375,352.43,350.80 103 | 1988-06,1988.458,351.75,351.04 104 | 1988-07,1988.542,350.27,351.24 105 | 1988-08,1988.625,349.07,351.52 106 | 1988-09,1988.708,349.27,351.78 107 | 1988-10,1988.792,350.45,351.87 108 | 1988-11,1988.875,351.63,351.98 109 | 1988-12,1988.958,352.48,352.20 110 | 1989-01,1989.042,353.03,352.21 111 | 1989-02,1989.125,353.49,352.38 112 | 1989-03,1989.208,354.04,352.61 113 | 1989-04,1989.292,354.42,352.65 114 | 1989-05,1989.375,354.23,352.55 115 | 1989-06,1989.458,353.29,352.59 116 | 1989-07,1989.542,351.58,352.60 117 | 1989-08,1989.625,350.19,352.67 118 | 1989-09,1989.708,350.52,353.05 119 | 1989-10,1989.792,351.81,353.24 120 | 1989-11,1989.875,352.98,353.33 121 | 1989-12,1989.958,353.84,353.53 122 | 1990-01,1990.042,354.39,353.65 123 | 1990-02,1990.125,354.78,353.72 124 | 1990-03,1990.208,355.08,353.68 125 | 1990-04,1990.292,355.40,353.64 126 | 1990-05,1990.375,355.31,353.64 127 | 1990-06,1990.458,354.24,353.59 128 | 1990-07,1990.542,352.63,353.70 129 | 1990-08,1990.625,351.50,354.00 130 | 1990-09,1990.708,351.71,354.23 131 | 1990-10,1990.792,353.10,354.48 132 | 1990-11,1990.875,354.34,354.62 133 | 1990-12,1990.958,355.09,354.63 134 | 1991-01,1991.042,355.66,354.90 135 | 1991-02,1991.125,356.08,354.98 136 | 1991-03,1991.208,356.57,355.16 137 | 1991-04,1991.292,357.08,355.34 138 | 1991-05,1991.375,357.00,355.37 139 | 1991-06,1991.458,356.08,355.47 140 | 1991-07,1991.542,354.44,355.53 141 | 1991-08,1991.625,352.95,355.46 142 | 1991-09,1991.708,352.82,355.34 143 | 1991-10,1991.792,353.90,355.28 144 | 1991-11,1991.875,355.06,355.30 145 | 1991-12,1991.958,355.85,355.36 146 | 1992-01,1992.042,356.42,355.63 147 | 1992-02,1992.125,356.80,355.68 148 | 1992-03,1992.208,357.16,355.71 149 | 1992-04,1992.292,357.65,355.87 150 | 1992-05,1992.375,357.73,356.09 151 | 1992-06,1992.458,356.78,356.19 152 | 1992-07,1992.542,355.09,356.22 153 | 1992-08,1992.625,353.58,356.13 154 | 1992-09,1992.708,353.49,356.05 155 | 1992-10,1992.792,354.70,356.09 156 | 1992-11,1992.875,355.87,356.11 157 | 1992-12,1992.958,356.63,356.14 158 | 1993-01,1993.042,357.09,356.25 159 | 1993-02,1993.125,357.42,356.27 160 | 1993-03,1993.208,357.83,356.40 161 | 1993-04,1993.292,358.29,356.54 162 | 1993-05,1993.375,358.24,356.59 163 | 1993-06,1993.458,357.22,356.55 164 | 1993-07,1993.542,355.62,356.63 165 | 1993-08,1993.625,354.33,356.79 166 | 1993-09,1993.708,354.35,356.93 167 | 1993-10,1993.792,355.59,357.06 168 | 1993-11,1993.875,356.83,357.17 169 | 1993-12,1993.958,357.72,357.35 170 | 1994-01,1994.042,358.34,357.49 171 | 1994-02,1994.125,358.87,357.71 172 | 1994-03,1994.208,359.22,357.78 173 | 1994-04,1994.292,359.57,357.81 174 | 1994-05,1994.375,359.61,357.93 175 | 1994-06,1994.458,358.68,357.97 176 | 1994-07,1994.542,357.16,358.14 177 | 1994-08,1994.625,355.94,358.44 178 | 1994-09,1994.708,355.90,358.55 179 | 1994-10,1994.792,357.13,358.67 180 | 1994-11,1994.875,358.57,358.92 181 | 1994-12,1994.958,359.44,359.04 182 | 1995-01,1995.042,360.00,359.16 183 | 1995-02,1995.125,360.46,359.34 184 | 1995-03,1995.208,360.89,359.53 185 | 1995-04,1995.292,361.36,359.67 186 | 1995-05,1995.375,361.32,359.69 187 | 1995-06,1995.458,360.48,359.78 188 | 1995-07,1995.542,358.84,359.83 189 | 1995-08,1995.625,357.56,360.02 190 | 1995-09,1995.708,357.90,360.49 191 | 1995-10,1995.792,359.29,360.75 192 | 1995-11,1995.875,360.62,360.90 193 | 1995-12,1995.958,361.50,361.04 194 | 1996-01,1996.042,361.99,361.06 195 | 1996-02,1996.125,362.35,361.17 196 | 1996-03,1996.208,362.67,361.26 197 | 1996-04,1996.292,363.00,361.29 198 | 1996-05,1996.375,363.14,361.54 199 | 1996-06,1996.458,362.74,362.07 200 | 1996-07,1996.542,361.43,362.46 201 | 1996-08,1996.625,359.92,362.42 202 | 1996-09,1996.708,359.55,362.17 203 | 1996-10,1996.792,360.52,362.01 204 | 1996-11,1996.875,361.63,361.93 205 | 1996-12,1996.958,362.49,362.06 206 | 1997-01,1997.042,363.13,362.19 207 | 1997-02,1997.125,363.51,362.33 208 | 1997-03,1997.208,363.87,362.47 209 | 1997-04,1997.292,364.34,362.66 210 | 1997-05,1997.375,364.38,362.81 211 | 1997-06,1997.458,363.49,362.85 212 | 1997-07,1997.542,361.81,362.84 213 | 1997-08,1997.625,360.28,362.76 214 | 1997-09,1997.708,360.27,362.87 215 | 1997-10,1997.792,361.78,363.26 216 | 1997-11,1997.875,363.46,363.74 217 | 1997-12,1997.958,364.51,364.06 218 | 1998-01,1998.042,365.07,364.14 219 | 1998-02,1998.125,365.44,364.27 220 | 1998-03,1998.208,365.82,364.43 221 | 1998-04,1998.292,366.40,364.74 222 | 1998-05,1998.375,366.71,365.17 223 | 1998-06,1998.458,366.11,365.50 224 | 1998-07,1998.542,364.68,365.72 225 | 1998-08,1998.625,363.63,366.11 226 | 1998-09,1998.708,363.86,366.45 227 | 1998-10,1998.792,365.16,366.60 228 | 1998-11,1998.875,366.42,366.67 229 | 1998-12,1998.958,367.28,366.80 230 | 1999-01,1999.042,367.95,367.02 231 | 1999-02,1999.125,368.34,367.19 232 | 1999-03,1999.208,368.73,367.35 233 | 1999-04,1999.292,369.12,367.49 234 | 1999-05,1999.375,369.03,367.52 235 | 1999-06,1999.458,368.19,367.61 236 | 1999-07,1999.542,366.53,367.56 237 | 1999-08,1999.625,365.16,367.60 238 | 1999-09,1999.708,365.27,367.82 239 | 1999-10,1999.792,366.58,368.01 240 | 1999-11,1999.875,367.89,368.13 241 | 1999-12,1999.958,368.72,368.21 242 | 2000-01,2000.042,369.21,368.30 243 | 2000-02,2000.125,369.46,368.31 244 | 2000-03,2000.208,369.78,368.40 245 | 2000-04,2000.292,370.18,368.52 246 | 2000-05,2000.375,370.08,368.56 247 | 2000-06,2000.458,369.17,368.65 248 | 2000-07,2000.542,367.79,368.92 249 | 2000-08,2000.625,366.63,369.13 250 | 2000-09,2000.708,366.56,369.11 251 | 2000-10,2000.792,367.78,369.15 252 | 2000-11,2000.875,369.12,369.30 253 | 2000-12,2000.958,369.92,369.36 254 | 2001-01,2001.042,370.52,369.63 255 | 2001-02,2001.125,371.01,369.85 256 | 2001-03,2001.208,371.41,370.00 257 | 2001-04,2001.292,371.73,370.06 258 | 2001-05,2001.375,371.63,370.11 259 | 2001-06,2001.458,370.68,370.15 260 | 2001-07,2001.542,369.29,370.40 261 | 2001-08,2001.625,368.16,370.63 262 | 2001-09,2001.708,368.20,370.72 263 | 2001-10,2001.792,369.56,370.94 264 | 2001-11,2001.875,370.88,371.10 265 | 2001-12,2001.958,371.79,371.28 266 | 2002-01,2002.042,372.34,371.38 267 | 2002-02,2002.125,372.73,371.49 268 | 2002-03,2002.208,373.21,371.69 269 | 2002-04,2002.292,373.55,371.80 270 | 2002-05,2002.375,373.53,371.95 271 | 2002-06,2002.458,372.66,372.12 272 | 2002-07,2002.542,371.25,372.38 273 | 2002-08,2002.625,370.20,372.73 274 | 2002-09,2002.708,370.52,373.14 275 | 2002-10,2002.792,371.79,373.27 276 | 2002-11,2002.875,373.12,373.40 277 | 2002-12,2002.958,374.09,373.65 278 | 2003-01,2003.042,374.79,373.79 279 | 2003-02,2003.125,375.30,374.00 280 | 2003-03,2003.208,375.73,374.16 281 | 2003-04,2003.292,376.20,374.42 282 | 2003-05,2003.375,376.33,374.73 283 | 2003-06,2003.458,375.50,374.95 284 | 2003-07,2003.542,373.98,375.11 285 | 2003-08,2003.625,372.74,375.31 286 | 2003-09,2003.708,372.92,375.59 287 | 2003-10,2003.792,374.21,375.74 288 | 2003-11,2003.875,375.50,375.83 289 | 2003-12,2003.958,376.34,375.92 290 | 2004-01,2004.042,377.02,376.05 291 | 2004-02,2004.125,377.53,376.23 292 | 2004-03,2004.208,377.96,376.37 293 | 2004-04,2004.292,378.30,376.52 294 | 2004-05,2004.375,378.24,376.65 295 | 2004-06,2004.458,377.36,376.80 296 | 2004-07,2004.542,375.82,377.00 297 | 2004-08,2004.625,374.35,376.98 298 | 2004-09,2004.708,374.23,376.90 299 | 2004-10,2004.792,375.56,377.06 300 | 2004-11,2004.875,377.03,377.33 301 | 2004-12,2004.958,377.99,377.50 302 | 2005-01,2005.042,378.56,377.59 303 | 2005-02,2005.125,379.09,377.79 304 | 2005-03,2005.208,379.70,378.10 305 | 2005-04,2005.292,380.16,378.36 306 | 2005-05,2005.375,380.27,378.65 307 | 2005-06,2005.458,379.45,378.86 308 | 2005-07,2005.542,377.78,378.93 309 | 2005-08,2005.625,376.55,379.18 310 | 2005-09,2005.708,376.58,379.28 311 | 2005-10,2005.792,377.89,379.44 312 | 2005-11,2005.875,379.36,379.69 313 | 2005-12,2005.958,380.34,379.86 314 | 2006-01,2006.042,381.09,380.09 315 | 2006-02,2006.125,381.72,380.35 316 | 2006-03,2006.208,382.11,380.49 317 | 2006-04,2006.292,382.45,380.62 318 | 2006-05,2006.375,382.41,380.75 319 | 2006-06,2006.458,381.55,380.93 320 | 2006-07,2006.542,379.88,381.07 321 | 2006-08,2006.625,378.30,381.01 322 | 2006-09,2006.708,378.42,381.19 323 | 2006-10,2006.792,379.84,381.42 324 | 2006-11,2006.875,381.21,381.53 325 | 2006-12,2006.958,382.17,381.69 326 | 2007-01,2007.042,382.81,381.80 327 | 2007-02,2007.125,383.32,381.91 328 | 2007-03,2007.208,383.78,382.13 329 | 2007-04,2007.292,384.04,382.22 330 | 2007-05,2007.375,383.91,382.28 331 | 2007-06,2007.458,383.07,382.49 332 | 2007-07,2007.542,381.36,382.61 333 | 2007-08,2007.625,380.06,382.82 334 | 2007-09,2007.708,380.45,383.22 335 | 2007-10,2007.792,381.86,383.41 336 | 2007-11,2007.875,383.20,383.48 337 | 2007-12,2007.958,384.21,383.71 338 | 2008-01,2008.042,384.98,383.97 339 | 2008-02,2008.125,385.49,384.10 340 | 2008-03,2008.208,385.89,384.27 341 | 2008-04,2008.292,386.29,384.48 342 | 2008-05,2008.375,386.26,384.63 343 | 2008-06,2008.458,385.34,384.77 344 | 2008-07,2008.542,383.86,385.18 345 | 2008-08,2008.625,382.53,385.33 346 | 2008-09,2008.708,382.30,385.05 347 | 2008-10,2008.792,383.43,384.91 348 | 2008-11,2008.875,384.92,385.16 349 | 2008-12,2008.958,386.01,385.47 350 | 2009-01,2009.042,386.80,385.76 351 | 2009-02,2009.125,387.26,385.83 352 | 2009-03,2009.208,387.49,385.84 353 | 2009-04,2009.292,387.77,385.96 354 | 2009-05,2009.375,387.74,386.14 355 | 2009-06,2009.458,386.74,386.23 356 | 2009-07,2009.542,384.80,386.20 357 | 2009-08,2009.625,383.42,386.29 358 | 2009-09,2009.708,383.72,386.45 359 | 2009-10,2009.792,385.28,386.70 360 | 2009-11,2009.875,386.74,386.93 361 | 2009-12,2009.958,387.63,387.07 362 | 2010-01,2010.042,388.42,387.40 363 | 2010-02,2010.125,389.13,387.73 364 | 2010-03,2010.208,389.47,387.83 365 | 2010-04,2010.292,389.77,387.96 366 | 2010-05,2010.375,389.74,388.14 367 | 2010-06,2010.458,388.80,388.30 368 | 2010-07,2010.542,387.16,388.54 369 | 2010-08,2010.625,386.04,388.85 370 | 2010-09,2010.708,386.51,389.21 371 | 2010-10,2010.792,388.06,389.49 372 | 2010-11,2010.875,389.44,389.62 373 | 2010-12,2010.958,390.19,389.65 374 | 2011-01,2011.042,390.74,389.69 375 | 2011-02,2011.125,391.15,389.73 376 | 2011-03,2011.208,391.46,389.83 377 | 2011-04,2011.292,391.84,390.03 378 | 2011-05,2011.375,391.87,390.25 379 | 2011-06,2011.458,390.94,390.44 380 | 2011-07,2011.542,389.00,390.37 381 | 2011-08,2011.625,387.66,390.44 382 | 2011-09,2011.708,388.08,390.79 383 | 2011-10,2011.792,389.65,391.11 384 | 2011-11,2011.875,391.00,391.21 385 | 2011-12,2011.958,391.85,391.35 386 | 2012-01,2012.042,392.42,391.37 387 | 2012-02,2012.125,393.00,391.58 388 | 2012-03,2012.208,393.53,391.90 389 | 2012-04,2012.292,393.80,392.01 390 | 2012-05,2012.375,393.68,392.08 391 | 2012-06,2012.458,392.63,392.15 392 | 2012-07,2012.542,390.80,392.23 393 | 2012-08,2012.625,389.69,392.53 394 | 2012-09,2012.708,390.36,393.06 395 | 2012-10,2012.792,391.97,393.38 396 | 2012-11,2012.875,393.37,393.53 397 | 2012-12,2012.958,394.18,393.60 398 | 2013-01,2013.042,394.86,393.81 399 | 2013-02,2013.125,395.49,394.08 400 | 2013-03,2013.208,396.07,394.44 401 | 2013-04,2013.292,396.52,394.70 402 | 2013-05,2013.375,396.53,394.91 403 | 2013-06,2013.458,395.74,395.22 404 | 2013-07,2013.542,394.27,395.65 405 | 2013-08,2013.625,393.05,395.86 406 | 2013-09,2013.708,393.01,395.69 407 | 2013-10,2013.792,394.31,395.80 408 | 2013-11,2013.875,395.76,395.99 409 | 2013-12,2013.958,396.65,396.13 410 | 2014-01,2014.042,397.28,396.22 411 | 2014-02,2014.125,397.73,396.33 412 | 2014-03,2014.208,398.03,396.39 413 | 2014-04,2014.292,398.39,396.58 414 | 2014-05,2014.375,398.46,396.83 415 | 2014-06,2014.458,397.50,396.98 416 | 2014-07,2014.542,395.91,397.29 417 | 2014-08,2014.625,394.80,397.61 418 | 2014-09,2014.708,394.89,397.57 419 | 2014-10,2014.792,396.15,397.64 420 | 2014-11,2014.875,397.63,397.85 421 | 2014-12,2014.958,398.60,398.07 422 | 2015-01,2015.042,399.31,398.25 423 | 2015-02,2015.125,399.86,398.45 424 | 2015-03,2015.208,400.30,398.66 425 | 2015-04,2015.292,400.69,398.87 426 | 2015-05,2015.375,400.64,399.01 427 | 2015-06,2015.458,399.79,399.27 428 | 2015-07,2015.542,398.12,399.50 429 | 2015-08,2015.625,396.84,399.65 430 | 2015-09,2015.708,397.15,399.83 431 | 2015-10,2015.792,398.60,400.10 432 | 2015-11,2015.875,400.15,400.37 433 | 2015-12,2015.958,401.43,400.91 434 | 2016-01,2016.042,402.39,401.34 435 | 2016-02,2016.125,402.95,401.55 436 | 2016-03,2016.208,403.52,401.88 437 | 2016-04,2016.292,404.07,402.26 438 | 2016-05,2016.375,404.19,402.55 439 | 2016-06,2016.458,403.38,402.87 440 | 2016-07,2016.542,401.72,403.10 441 | 2016-08,2016.625,400.44,403.25 442 | 2016-09,2016.708,400.72,403.40 443 | -------------------------------------------------------------------------------- /fixtures/dp-co2-many-resources/datapackage.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "co2-ppm", 3 | "title": "CO2 PPM - Trends in Atmospheric Carbon Dioxide", 4 | "description": "Data are sourced from the US Government's Earth System Research Laboratory, Global Monitoring Division. Two main series are provided: the Mauna Loa series (which has the longest continuous series since 1958) and a Global Average series (a global average over marine surface sites).", 5 | "homepage": "http://www.esrl.noaa.gov/gmd/ccgg/trends", 6 | "version": "0.1.0", 7 | "license": "ODC-PDDL-1.0", 8 | "sources": [ 9 | { 10 | "name": "Trends in Atmospheric Carbon Dioxide, Mauna Loa, Hawaii", 11 | "web": "http://www.esrl.noaa.gov/gmd/ccgg/trends/index.html" 12 | }, 13 | { 14 | "name": "Trends in Atmospheric Carbon Dioxide, Global", 15 | "web": "http://www.esrl.noaa.gov/gmd/ccgg/trends/global.html" 16 | } 17 | ], 18 | "resources": [ 19 | { 20 | "name": "co2-mm-mlo", 21 | "path": "data/co2-mm-mlo.csv", 22 | "format": "csv", 23 | "mediatype": "text/csv", 24 | "schema": { 25 | "fields": [ 26 | { 27 | "name": "Date", 28 | "type": "date", 29 | "description": "YYYY-MM" 30 | }, 31 | { 32 | "name": "Decimal Date", 33 | "type": "date", 34 | "description": "" 35 | }, 36 | { 37 | "name": "Average", 38 | "type": "number", 39 | "description": "The monthly mean CO2 mole fraction determined from daily averages. If there are missing days concentrated either early or late in the month, the monthly mean is corrected to the middle of the month using the average seasonal cycle. Missing months are denoted by -99.99." 40 | }, 41 | { 42 | "name": "Interpolated", 43 | "type": "number", 44 | "description": "Values from the average column and interpolated values where data are missing. Interpolated values are computed in two steps. First, we compute for each month the average seasonal cycle in a 7-year window around each monthly value. In this way the seasonal cycle is allowed to change slowly over time. We then determine the trend value for each month by removing the seasonal cycle; this result is shown in the trend column. Trend values are linearly interpolated for missing months. The interpolated monthly mean is then the sum of the average seasonal cycle value and the trend value for the missing month." 45 | }, 46 | { 47 | "name": "Trend", 48 | "type": "number", 49 | "description": "Seasonally corrected." 50 | }, 51 | { 52 | "name": "Number of Days", 53 | "type": "number", 54 | "description": "-1 denotes no data for number of daily averages in the month." 55 | } 56 | ] 57 | } 58 | }, 59 | { 60 | "name": "co2-annmean-mlo", 61 | "path": "data/co2-annmean-mlo.csv", 62 | "format": "csv", 63 | "mediatype": "text/csv", 64 | "schema": { 65 | "fields": [ 66 | { 67 | "name": "Year", 68 | "type": "date", 69 | "description": "" 70 | }, 71 | { 72 | "name": "Mean", 73 | "type": "number", 74 | "description": "" 75 | }, 76 | { 77 | "name": "Uncertainty", 78 | "type": "number", 79 | "description": "The estimated uncertainty in the annual mean is the standard deviation of the differences of annual mean values determined independently by NOAA/ESRL and the Scripps Institution of Oceanography." 80 | } 81 | ] 82 | } 83 | }, 84 | { 85 | "name": "co2-gr-mlo", 86 | "path": "data/co2-gr-mlo.csv", 87 | "format": "csv", 88 | "mediatype": "text/csv", 89 | "schema": { 90 | "fields": [ 91 | { 92 | "name": "Year", 93 | "type": "date", 94 | "description": "" 95 | }, 96 | { 97 | "name": "Annual Increase", 98 | "type": "number", 99 | "description": "Annual CO2 mole fraction increase (ppm) from Jan 1 through Dec 31." 100 | }, 101 | { 102 | "name": "Uncertainty", 103 | "type": "number", 104 | "description": "Estimated from the standard deviation of the differences between monthly mean values determined independently by the Scripps Institution of Oceanography and by NOAA/ESRL." 105 | } 106 | ] 107 | } 108 | }, 109 | { 110 | "name": "co2-mm-gl", 111 | "path": "data/co2-mm-gl.csv", 112 | "format": "csv", 113 | "mediatype": "text/csv", 114 | "schema": { 115 | "fields": [ 116 | { 117 | "name": "Date", 118 | "type": "date", 119 | "description": "YYYY-MM" 120 | }, 121 | { 122 | "name": "Decimal Date", 123 | "type": "date", 124 | "description": "" 125 | }, 126 | { 127 | "name": "Average", 128 | "type": "number", 129 | "description": "" 130 | }, 131 | { 132 | "name": "Trend", 133 | "type": "number", 134 | "description": "" 135 | } 136 | ] 137 | } 138 | }, 139 | { 140 | "name": "co2-annmean-gl", 141 | "path": "data/co2-annmean-gl.csv", 142 | "format": "csv", 143 | "mediatype": "text/csv", 144 | "schema": { 145 | "fields": [ 146 | { 147 | "name": "Year", 148 | "type": "date", 149 | "description": "" 150 | }, 151 | { 152 | "name": "Mean", 153 | "type": "number", 154 | "description": "" 155 | }, 156 | { 157 | "name": "Uncertainty", 158 | "type": "number", 159 | "description": "The uncertainty in the global annual mean is estimated using a monte carlo technique that computes 100 global annual averages, each time using a slightly different set of measurement records from the NOAA ESRL cooperative air sampling network. The reported uncertainty is the mean of the standard deviations for each annual average using this technique. Please see Conway et al., 1994, JGR, vol. 99, no. D11. for a complete discussion." 160 | } 161 | ] 162 | } 163 | }, 164 | { 165 | "name": "co2-gr-gl", 166 | "path": "data/co2-gr-gl.csv", 167 | "format": "csv", 168 | "mediatype": "text/csv", 169 | "schema": { 170 | "fields": [ 171 | { 172 | "name": "Year", 173 | "type": "date", 174 | "description": "" 175 | }, 176 | { 177 | "name": "Annual Increase", 178 | "type": "number", 179 | "description": "Annual CO2 mole fraction increase (ppm) from Jan 1 through Dec 31." 180 | }, 181 | { 182 | "name": "Uncertainty", 183 | "type": "number", 184 | "description": "The uncertainty in the global annual mean growth rate is estimated using a monte carlo technique that computes 100 time series of global annual growth rates, each time using measurement records from a different sampling of sites from the NOAA ESRL cooperative air sampling network. Each year has a different uncertainty. Please see Conway et al., 1994, JGR, vol. 99, no. D11. for a complete discussion. The last one or two years listed could have preliminary uncertainties set equal to the average uncertainty since 1980. Before 1980 the global growth rate has been approximated by taking the average of Mauna Loa and the South Pole, correcting for the offset between (MLO+SPO)/2 and the global Marine Boundary Layer, as described in Ballantyne et al, 2012." 185 | } 186 | ] 187 | } 188 | } 189 | ], 190 | "views": [ 191 | { 192 | "id": "graph", 193 | "label": "Graph", 194 | "type": "Graph", 195 | "state": { 196 | "group": "Date", 197 | "series": ["Interpolated", "Trend"], 198 | "graphType": "lines-and-points" 199 | } 200 | } 201 | ] 202 | } 203 | -------------------------------------------------------------------------------- /fixtures/dp-inline-data/datapackage.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Example datapackage", 3 | "resources": [ 4 | { 5 | "name": "random", 6 | "data": [ 7 | [180, 18, "Tony"], 8 | [192, 15, "Pavle"], 9 | [160, 32, "Pero"], 10 | [202, 23, "David"] 11 | ], 12 | "schema": { 13 | "fields": [ 14 | { 15 | "name": "height", 16 | "type": "integer" 17 | }, 18 | { 19 | "name": "age", 20 | "type": "integer" 21 | }, 22 | { 23 | "name": "name", 24 | "type": "string" 25 | } 26 | ] 27 | } 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /fixtures/dp-vix-resource-and-view/data/demo-resource.csv: -------------------------------------------------------------------------------- 1 | Date,DEMOOpen,DEMOHigh,DEMOLow,DEMOClose 2 | 2014-01-02,14.32,14.59,14.00,14.23 3 | 2014-01-03,14.06,14.22,13.57,13.76 4 | 2014-01-06,13.41,14.00,13.22,13.55 5 | 2014-01-07,12.38,13.28,12.16,12.92 6 | 2014-01-08,13.04,13.24,12.86,12.87 7 | 2014-01-09,12.83,13.26,12.83,12.89 8 | 2014-01-10,12.60,12.90,12.14,12.14 9 | 2014-01-13,12.18,13.65,11.82,13.28 10 | 2014-01-14,12.89,12.90,11.96,12.28 11 | 2014-01-15,12.15,12.40,11.81,12.28 12 | 2014-01-16,12.32,12.66,12.28,12.53 13 | 2014-01-17,12.34,12.93,12.04,12.44 14 | 2014-01-21,12.63,13.42,12.61,12.87 15 | 2014-01-22,12.57,13.12,12.55,12.84 16 | 2014-01-23,13.67,14.66,13.67,13.77 17 | 2014-01-24,14.95,18.14,14.92,18.14 18 | 2014-01-27,17.29,18.99,16.85,17.42 19 | 2014-01-28,17.27,17.28,15.80,15.80 20 | 2014-01-29,17.95,18.04,16.71,17.35 21 | 2014-01-30,16.37,17.39,15.96,17.29 22 | 2014-01-31,18.71,18.99,17.27,18.41 23 | 2014-02-03,18.57,21.48,18.34,21.44 24 | 2014-02-04,19.99,20.07,18.44,19.11 25 | 2014-02-05,19.59,20.72,19.13,19.95 26 | 2014-02-06,19.09,19.09,17.09,17.23 27 | 2014-02-07,16.15,16.31,15.09,15.29 28 | 2014-02-10,15.63,15.76,15.10,15.26 29 | 2014-02-11,15.29,15.29,14.08,14.51 30 | 2014-02-12,14.31,14.64,14.02,14.30 31 | 2014-02-13,15.24,15.24,13.98,14.14 32 | 2014-02-14,14.21,14.22,13.44,13.57 33 | 2014-02-18,13.95,14.51,13.77,13.87 34 | 2014-02-19,14.85,15.73,14.12,15.50 35 | 2014-02-20,15.28,15.80,14.59,14.79 36 | 2014-02-21,14.74,14.79,14.19,14.68 37 | 2014-02-24,14.83,14.83,13.97,14.23 38 | 2014-02-25,14.17,14.83,13.66,13.67 39 | 2014-02-26,13.83,14.54,13.73,14.35 40 | 2014-02-27,14.56,14.69,13.92,14.04 41 | 2014-02-28,14.22,14.79,13.49,14.00 42 | 2014-03-03,16.47,16.78,15.38,16.00 43 | 2014-03-04,14.53,14.54,14.00,14.10 44 | 2014-03-05,14.13,14.32,13.81,13.89 45 | 2014-03-06,13.82,14.42,13.73,14.21 46 | 2014-03-07,13.51,14.43,13.51,14.11 47 | 2014-03-10,14.76,15.28,14.20,14.20 48 | 2014-03-11,14.22,14.93,13.84,14.80 49 | 2014-03-12,15.37,15.64,14.43,14.47 50 | 2014-03-13,14.28,16.66,14.24,16.22 51 | 2014-03-14,16.74,18.22,16.09,17.82 52 | 2014-03-17,16.39,16.40,15.37,15.64 53 | 2014-03-18,15.42,15.47,14.16,14.52 54 | 2014-03-19,14.56,15.95,13.89,15.12 55 | 2014-03-20,15.58,15.62,14.50,14.52 56 | 2014-03-21,13.96,15.17,13.77,15.00 57 | 2014-03-24,14.70,16.07,14.56,15.09 58 | 2014-03-25,14.16,15.05,13.96,14.02 59 | 2014-03-26,13.64,15.28,13.46,14.93 60 | 2014-03-27,15.00,15.63,14.49,14.62 61 | 2014-03-28,14.15,14.86,13.73,14.41 62 | 2014-03-31,13.88,14.16,13.57,13.88 63 | 2014-04-01,13.43,13.56,13.06,13.10 64 | 2014-04-02,13.17,13.35,12.92,13.09 65 | 2014-04-03,13.02,13.70,13.02,13.37 66 | 2014-04-04,12.88,14.55,12.60,13.96 67 | 2014-04-07,14.96,16.01,14.57,15.57 68 | 2014-04-08,15.59,16.20,14.81,14.89 69 | 2014-04-09,14.58,14.94,13.70,13.82 70 | 2014-04-10,13.98,16.38,13.81,15.89 71 | 2014-04-11,16.66,17.85,15.89,17.03 72 | 2014-04-14,16.14,17.40,16.10,16.11 73 | 2014-04-15,16.14,17.50,15.47,15.61 74 | 2014-04-16,14.89,15.27,14.05,14.18 75 | 2014-04-17,14.09,14.17,13.07,13.36 76 | 2014-04-21,14.10,14.11,13.17,13.25 77 | 2014-04-22,13.13,13.26,12.90,13.19 78 | 2014-04-23,13.35,13.75,13.27,13.27 79 | 2014-04-24,13.36,14.08,13.09,13.32 80 | 2014-04-25,13.93,14.67,13.91,14.06 81 | 2014-04-28,14.27,15.28,13.82,13.97 82 | 2014-04-29,13.88,14.24,13.61,13.71 83 | 2014-04-30,14.05,14.18,13.34,13.41 84 | 2014-05-01,13.64,13.75,13.10,13.25 85 | 2014-05-02,13.15,13.50,12.83,12.91 86 | 2014-05-05,13.95,14.20,13.08,13.29 87 | 2014-05-06,13.65,13.90,13.28,13.80 88 | 2014-05-07,13.64,14.49,13.39,13.40 89 | 2014-05-08,13.69,13.88,12.92,13.43 90 | 2014-05-09,13.55,14.03,12.87,12.92 91 | 2014-05-12,12.46,12.58,11.88,12.23 92 | 2014-05-13,12.36,12.74,12.05,12.13 93 | 2014-05-14,12.42,12.51,12.03,12.17 94 | 2014-05-15,12.73,13.77,12.72,13.17 95 | 2014-05-16,13.31,13.66,12.26,12.44 96 | 2014-05-19,13.17,13.21,12.28,12.42 97 | 2014-05-20,12.69,13.30,12.32,12.96 98 | 2014-05-21,12.38,12.46,11.80,11.91 99 | 2014-05-22,11.93,12.09,11.68,12.03 100 | 2014-05-23,11.96,11.97,11.36,11.36 101 | 2014-05-27,11.69,11.84,11.50,11.51 102 | 2014-05-28,11.60,11.86,11.50,11.68 103 | 2014-05-29,11.58,11.82,11.41,11.57 104 | 2014-05-30,11.66,11.70,11.32,11.40 105 | 2014-06-02,11.69,12.17,11.29,11.58 106 | 2014-06-03,12.03,12.13,11.72,11.87 107 | 2014-06-04,12.15,12.33,11.91,12.08 108 | 2014-06-05,12.09,12.34,11.44,11.68 109 | 2014-06-06,11.32,11.39,10.73,10.73 110 | 2014-06-09,11.23,11.51,10.99,11.15 111 | 2014-06-10,11.30,11.66,10.93,10.99 112 | 2014-06-11,11.42,11.87,11.19,11.60 113 | 2014-06-12,11.81,12.81,11.71,12.56 114 | 2014-06-13,12.45,12.69,11.89,12.18 115 | 2014-06-16,12.65,12.87,12.28,12.65 116 | 2014-06-17,12.81,12.89,12.06,12.06 117 | 2014-06-18,11.80,11.91,10.57,10.61 118 | 2014-06-19,10.53,10.82,10.42,10.62 119 | 2014-06-20,10.40,11.02,10.34,10.85 120 | 2014-06-23,11.26,11.35,10.92,10.98 121 | 2014-06-24,11.02,12.27,10.87,12.13 122 | 2014-06-25,12.31,12.33,11.37,11.59 123 | 2014-06-26,11.51,12.51,11.50,11.63 124 | 2014-06-27,11.72,12.04,11.19,11.26 125 | 2014-06-30,11.75,11.81,11.30,11.57 126 | 2014-07-01,11.28,11.42,10.92,11.15 127 | 2014-07-02,11.18,11.18,10.56,10.82 128 | 2014-07-03,10.47,10.76,10.28,10.32 129 | 2014-07-07,11.15,11.54,11.01,11.33 130 | 2014-07-08,11.72,12.51,11.72,11.98 131 | 2014-07-09,11.74,12.05,11.50,11.65 132 | 2014-07-10,13.22,13.23,12.05,12.59 133 | 2014-07-11,12.50,12.68,12.07,12.08 134 | 2014-07-14,11.60,11.83,11.40,11.82 135 | 2014-07-15,11.53,12.47,11.46,11.96 136 | 2014-07-16,10.81,11.45,10.59,11.00 137 | 2014-07-17,11.35,15.38,10.85,14.54 138 | 2014-07-18,13.34,13.55,12.04,12.06 139 | 2014-07-21,12.85,13.62,12.46,12.81 140 | 2014-07-22,11.97,12.24,11.69,12.24 141 | 2014-07-23,11.54,12.16,11.41,11.52 142 | 2014-07-24,11.43,12.06,11.43,11.84 143 | 2014-07-25,12.03,12.75,12.03,12.69 144 | 2014-07-28,12.93,13.64,12.54,12.56 145 | 2014-07-29,12.35,13.35,12.12,13.28 146 | 2014-07-30,12.63,14.07,12.53,13.33 147 | 2014-07-31,14.35,17.11,14.26,16.95 148 | 2014-08-01,16.67,17.57,15.52,17.03 149 | 2014-08-04,16.64,16.80,14.69,15.12 150 | 2014-08-05,15.54,17.14,15.10,16.87 151 | 2014-08-06,17.22,17.30,15.70,16.37 152 | 2014-08-07,15.50,17.25,15.44,16.66 153 | 2014-08-08,16.43,17.09,15.53,15.77 154 | 2014-08-11,15.16,15.16,13.72,14.23 155 | 2014-08-12,14.42,14.74,13.76,14.13 156 | 2014-08-13,13.57,13.93,12.84,12.90 157 | 2014-08-14,13.05,13.13,12.42,12.42 158 | 2014-08-15,11.91,14.94,11.89,13.15 159 | 2014-08-18,12.85,12.85,12.26,12.32 160 | 2014-08-19,12.14,12.46,11.91,12.21 161 | 2014-08-20,12.23,12.24,11.60,11.78 162 | 2014-08-21,11.93,13.51,11.52,11.76 163 | 2014-08-22,11.88,12.48,11.47,11.47 164 | 2014-08-25,11.58,11.77,11.24,11.70 165 | 2014-08-26,11.33,11.93,11.33,11.63 166 | 2014-08-27,11.69,11.93,11.54,11.78 167 | 2014-08-28,12.38,12.73,12.05,12.05 168 | 2014-08-29,11.86,12.44,11.78,11.98 169 | 2014-09-02,12.32,13.41,12.23,12.25 170 | 2014-09-03,12.03,12.55,11.91,12.36 171 | 2014-09-04,12.40,12.99,11.70,12.64 172 | 2014-09-05,12.37,13.18,11.96,12.09 173 | 2014-09-08,12.64,13.09,12.40,12.66 174 | 2014-09-09,12.70,13.91,12.70,13.50 175 | 2014-09-10,13.36,14.06,12.86,12.88 176 | 2014-09-11,13.53,13.67,12.66,12.80 177 | 2014-09-12,12.85,14.27,12.85,13.31 178 | 2014-09-15,13.54,14.19,13.54,14.12 179 | 2014-09-16,14.48,14.53,12.72,12.73 180 | 2014-09-17,13.06,14.53,11.73,12.65 181 | 2014-09-18,12.55,12.58,11.98,12.03 182 | 2014-09-19,11.73,12.61,11.52,12.11 183 | 2014-09-22,13.14,13.98,13.13,13.69 184 | 2014-09-23,14.82,14.94,13.83,14.93 185 | 2014-09-24,14.62,14.93,13.24,13.27 186 | 2014-09-25,14.11,16.69,14.03,15.64 187 | 2014-09-26,15.77,15.98,14.31,14.85 188 | 2014-09-29,16.96,17.08,15.45,15.98 189 | 2014-09-30,15.49,16.43,15.18,16.31 190 | 2014-10-01,16.44,17.56,16.08,16.71 191 | 2014-10-02,16.70,17.98,15.90,16.16 192 | 2014-10-03,15.16,15.43,14.44,14.55 193 | 2014-10-06,14.46,15.77,14.05,15.46 194 | 2014-10-07,16.18,17.46,15.97,17.20 195 | 2014-10-08,17.35,18.03,14.97,15.11 196 | 2014-10-09,15.64,19.38,15.34,18.76 197 | 2014-10-10,19.11,22.06,18.14,21.24 198 | 2014-10-13,21.16,24.64,20.52,24.64 199 | 2014-10-14,23.77,24.55,21.48,22.79 200 | 2014-10-15,26.36,31.06,24.64,26.25 201 | 2014-10-16,29.26,29.41,24.61,25.20 202 | 2014-10-17,21.68,23.08,20.23,21.99 203 | 2014-10-20,22.11,22.16,18.51,18.57 204 | 2014-10-21,17.72,17.75,16.03,16.08 205 | 2014-10-22,16.06,18.43,15.56,17.87 206 | 2014-10-23,16.07,17.06,15.68,16.53 207 | 2014-10-24,16.43,18.06,16.09,16.11 208 | 2014-10-27,17.24,17.87,16.00,16.04 209 | 2014-10-28,15.69,15.78,14.39,14.39 210 | 2014-10-29,14.61,16.28,14.19,15.15 211 | 2014-10-30,15.31,15.75,14.07,14.52 212 | 2014-10-31,13.84,14.83,13.72,14.03 213 | 2014-11-03,14.41,14.99,14.23,14.73 214 | 2014-11-04,15.05,15.93,14.83,14.89 215 | 2014-11-05,14.15,14.99,14.15,14.17 216 | 2014-11-06,14.46,15.08,13.67,13.67 217 | 2014-11-07,13.71,14.16,13.01,13.12 218 | 2014-11-10,13.16,13.25,12.38,12.67 219 | 2014-11-11,12.71,13.18,12.60,12.92 220 | 2014-11-12,13.76,13.76,12.99,13.02 221 | 2014-11-13,13.33,14.31,12.87,13.79 222 | 2014-11-14,13.79,14.15,13.31,13.31 223 | 2014-11-17,14.70,14.73,13.84,13.99 224 | 2014-11-18,13.86,13.99,13.13,13.86 225 | 2014-11-19,14.01,14.78,13.83,13.96 226 | 2014-11-20,14.66,15.74,13.58,13.58 227 | 2014-11-21,13.16,13.80,12.90,12.90 228 | 2014-11-24,12.92,13.02,12.43,12.62 229 | 2014-11-25,12.55,13.02,12.23,12.25 230 | 2014-11-26,12.27,12.40,11.91,12.07 231 | 2014-11-28,12.64,13.49,12.36,13.33 232 | 2014-12-01,14.16,14.75,13.94,14.29 233 | 2014-12-02,14.10,14.17,12.85,12.85 234 | 2014-12-03,12.75,12.88,12.21,12.47 235 | 2014-12-04,12.70,13.23,12.09,12.38 236 | 2014-12-05,12.08,12.28,11.53,11.82 237 | 2014-12-08,13.05,14.67,12.55,14.21 238 | 2014-12-09,16.23,16.68,14.84,14.89 239 | 2014-12-10,15.56,18.92,15.40,18.53 240 | 2014-12-11,17.68,20.13,15.94,20.08 241 | 2014-12-12,20.51,23.06,18.34,21.08 242 | 2014-12-15,19.59,24.83,17.77,20.42 243 | 2014-12-16,23.55,25.20,19.60,23.57 244 | 2014-12-17,23.90,24.61,19.26,19.44 245 | 2014-12-18,17.14,18.51,16.07,16.81 246 | 2014-12-19,16.57,17.20,16.11,16.49 247 | 2014-12-22,16.32,16.88,15.03,15.25 248 | 2014-12-23,14.47,15.21,14.32,14.80 249 | 2014-12-24,14.52,14.54,14.01,14.37 250 | 2014-12-26,14.60,14.84,14.13,14.50 251 | 2014-12-29,16.04,16.14,15.06,15.06 252 | 2014-12-30,15.90,16.20,15.48,15.92 253 | 2014-12-31,15.91,19.91,15.86,19.20 254 | 2015-01-02,17.76,20.14,17.05,17.79 255 | 2015-01-05,19.19,21.29,19.19,19.92 256 | 2015-01-06,20.33,22.90,19.52,21.12 257 | 2015-01-07,20.15,20.72,19.04,19.31 258 | 2015-01-08,17.93,18.09,16.99,17.01 259 | 2015-01-09,16.44,18.42,16.44,17.55 260 | 2015-01-12,18.02,20.44,18.02,19.60 261 | 2015-01-13,18.21,21.58,17.65,20.56 262 | 2015-01-14,22.87,23.34,21.32,21.48 263 | 2015-01-15,21.23,23.31,20.86,22.39 264 | 2015-01-16,22.80,23.43,20.95,20.95 265 | 2015-01-20,20.07,21.37,19.58,19.89 266 | 2015-01-21,20.92,21.28,18.64,18.85 267 | 2015-01-22,17.98,19.23,16.07,16.40 268 | 2015-01-23,16.79,17.09,15.81,16.66 269 | 2015-01-26,16.96,17.43,15.52,15.52 270 | 2015-01-27,17.60,18.41,16.67,17.22 271 | 2015-01-28,16.97,20.44,16.92,20.44 272 | 2015-01-29,20.46,21.56,18.66,18.76 273 | 2015-01-30,20.23,22.18,19.24,20.97 274 | 2015-02-02,20.89,22.81,19.35,19.43 275 | 2015-02-03,18.41,18.89,17.20,17.33 276 | 2015-02-04,17.82,18.38,16.82,18.33 277 | 2015-02-05,17.29,17.43,16.67,16.85 278 | 2015-02-06,16.29,18.74,16.06,17.29 279 | 2015-02-09,19.16,19.28,18.21,18.55 280 | 2015-02-10,17.72,18.36,16.97,17.23 281 | 2015-02-11,17.43,17.81,16.82,16.96 282 | 2015-02-12,16.39,16.47,15.28,15.34 283 | 2015-02-13,15.11,15.64,14.69,14.69 284 | 2015-02-17,15.86,16.33,15.53,15.80 285 | 2015-02-18,16.74,16.74,15.44,15.45 286 | 2015-02-19,16.11,16.22,15.10,15.29 287 | 2015-02-20,15.73,16.29,14.27,14.30 288 | 2015-02-23,15.05,15.48,14.49,14.56 289 | 2015-02-24,14.50,14.63,13.53,13.69 290 | 2015-02-25,13.64,14.06,12.86,13.84 291 | 2015-02-26,13.55,14.57,13.55,13.91 292 | 2015-02-27,14.07,14.17,13.29,13.34 293 | 2015-03-02,13.90,13.90,12.87,13.04 294 | 2015-03-03,13.35,14.69,13.25,13.86 295 | 2015-03-04,14.31,15.33,14.13,14.23 296 | 2015-03-05,14.01,14.58,13.88,14.04 297 | 2015-03-06,14.61,15.83,14.18,15.20 298 | 2015-03-09,15.72,15.76,14.71,15.06 299 | 2015-03-10,16.47,16.91,16.03,16.69 300 | 2015-03-11,16.44,17.19,16.29,16.87 301 | 2015-03-12,16.45,16.45,15.30,15.42 302 | 2015-03-13,15.47,16.74,15.32,16.00 303 | 2015-03-16,15.78,15.89,15.36,15.61 304 | 2015-03-17,16.31,16.37,15.66,15.66 305 | 2015-03-18,14.60,16.29,13.38,13.97 306 | 2015-03-19,14.68,14.97,13.84,14.07 307 | 2015-03-20,13.52,13.53,12.54,13.02 308 | 2015-03-23,13.52,13.53,12.89,13.41 309 | 2015-03-24,13.36,13.68,12.59,13.62 310 | 2015-03-25,13.26,15.55,13.20,15.44 311 | 2015-03-26,16.64,17.19,15.23,15.80 312 | 2015-03-27,15.73,15.83,14.19,15.07 313 | 2015-03-30,14.76,14.76,14.08,14.51 314 | 2015-03-31,14.97,15.74,14.33,15.29 315 | 2015-04-01,15.32,16.66,15.08,15.11 316 | 2015-04-02,15.30,15.51,14.27,14.67 317 | 2015-04-06,15.75,15.76,14.04,14.74 318 | 2015-04-07,14.57,14.81,14.01,14.78 319 | 2015-04-08,14.59,14.77,13.75,13.98 320 | 2015-04-09,14.14,14.59,13.09,13.09 321 | 2015-04-10,13.20,13.26,12.51,12.58 322 | 2015-04-13,13.17,14.31,12.71,13.94 323 | 2015-04-14,14.34,14.74,13.64,13.67 324 | 2015-04-15,13.58,13.58,12.83,12.84 325 | 2015-04-16,13.27,13.35,12.50,12.60 326 | 2015-04-17,13.97,15.02,13.73,13.89 327 | 2015-04-20,13.67,13.67,12.83,13.30 328 | 2015-04-21,12.75,13.51,12.66,13.25 329 | 2015-04-22,12.97,13.80,12.57,12.71 330 | 2015-04-23,12.96,12.96,12.12,12.48 331 | 2015-04-24,12.21,13.02,12.16,12.29 332 | 2015-04-27,12.34,13.40,12.33,13.12 333 | 2015-04-28,13.26,14.23,12.41,12.41 334 | 2015-04-29,13.44,14.34,12.61,13.39 335 | 2015-04-30,13.89,15.29,12.49,14.55 336 | 2015-05-01,13.98,13.98,12.68,12.70 337 | 2015-05-04,13.12,13.18,12.10,12.85 338 | 2015-05-05,13.21,14.41,12.97,14.31 339 | 2015-05-06,13.93,16.36,13.89,15.15 340 | 2015-05-07,15.48,15.97,14.81,15.13 341 | 2015-05-08,13.36,13.42,12.70,12.86 342 | 2015-05-11,13.35,13.85,13.00,13.85 343 | 2015-05-12,14.73,15.13,13.73,13.86 344 | 2015-05-13,13.63,14.04,13.06,13.76 345 | 2015-05-14,13.14,13.29,12.72,12.74 346 | 2015-05-15,12.46,13.09,12.35,12.38 347 | 2015-05-18,13.08,13.22,12.55,12.73 348 | 2015-05-19,12.95,13.13,12.55,12.85 349 | 2015-05-20,12.90,13.27,12.62,12.88 350 | 2015-05-21,13.03,13.09,12.09,12.11 351 | 2015-05-22,12.37,12.37,11.82,12.13 352 | 2015-05-26,13.45,14.63,13.34,14.06 353 | 2015-05-27,14.16,14.41,13.05,13.27 354 | 2015-05-28,13.49,13.99,13.31,13.31 355 | 2015-05-29,13.59,14.43,13.40,13.84 356 | 2015-06-01,13.92,14.86,13.47,13.97 357 | 2015-06-02,14.72,15.05,13.59,14.24 358 | 2015-06-03,13.73,14.20,13.40,13.66 359 | 2015-06-04,14.57,15.49,13.99,14.71 360 | 2015-06-05,15.01,15.65,14.21,14.21 361 | 2015-06-08,14.84,15.50,14.67,15.29 362 | 2015-06-09,15.18,15.74,14.47,14.47 363 | 2015-06-10,14.24,14.37,12.96,13.22 364 | 2015-06-11,13.04,13.22,12.56,12.85 365 | 2015-06-12,13.31,14.02,13.30,13.78 366 | 2015-06-15,15.48,15.57,14.91,15.39 367 | 2015-06-16,15.62,15.62,14.81,14.81 368 | 2015-06-17,14.66,15.49,14.07,14.50 369 | 2015-06-18,14.03,14.03,12.54,13.19 370 | 2015-06-19,13.35,14.00,12.96,13.96 371 | 2015-06-22,13.42,13.46,12.43,12.74 372 | 2015-06-23,12.50,12.68,11.93,12.11 373 | 2015-06-24,12.57,13.33,12.01,13.26 374 | 2015-06-25,12.96,14.16,12.92,14.01 375 | 2015-06-26,14.13,14.91,13.64,14.02 376 | 2015-06-29,16.70,19.50,15.82,18.85 377 | 2015-06-30,17.60,19.80,17.49,18.23 378 | 2015-07-01,16.63,17.26,15.65,16.09 379 | 2015-07-02,15.43,17.48,15.39,16.79 380 | 2015-07-06,18.65,18.95,16.57,17.01 381 | 2015-07-07,17.22,19.20,15.93,16.09 382 | 2015-07-08,17.38,19.76,16.94,19.66 383 | 2015-07-09,17.46,20.05,17.20,19.97 384 | 2015-07-10,17.45,18.17,16.60,16.83 385 | 2015-07-13,15.29,15.36,13.82,13.90 386 | 2015-07-14,13.91,13.95,12.90,13.37 387 | 2015-07-15,13.35,13.97,12.81,13.23 388 | 2015-07-16,12.59,12.61,11.87,12.11 389 | 2015-07-17,11.77,12.22,11.77,11.95 390 | 2015-07-20,12.25,12.37,11.71,12.25 391 | 2015-07-21,12.42,12.79,12.21,12.22 392 | 2015-07-22,12.77,12.83,12.05,12.12 393 | 2015-07-23,12.06,13.08,11.73,12.64 394 | 2015-07-24,12.87,14.73,12.86,13.74 395 | 2015-07-27,15.60,16.27,15.03,15.60 396 | 2015-07-28,14.87,15.62,13.32,13.44 397 | 2015-07-29,13.57,13.59,11.85,12.50 398 | 2015-07-30,12.72,13.42,12.09,12.13 399 | 2015-07-31,12.03,12.63,11.82,12.12 400 | 2015-08-03,12.85,13.55,12.32,12.56 401 | 2015-08-04,12.66,13.22,12.29,13.00 402 | 2015-08-05,12.02,12.72,10.88,12.51 403 | 2015-08-06,12.20,14.25,12.16,13.77 404 | 2015-08-07,13.57,14.58,13.29,13.39 405 | 2015-08-10,12.73,12.78,12.18,12.23 406 | 2015-08-11,13.24,14.33,13.02,13.71 407 | 2015-08-12,15.19,16.28,13.45,13.61 408 | 2015-08-13,13.87,14.33,13.06,13.49 409 | 2015-08-14,13.69,13.87,12.80,12.83 410 | 2015-08-17,14.32,14.52,13.01,13.02 411 | 2015-08-18,13.41,13.94,13.17,13.79 412 | 2015-08-19,14.84,15.96,13.73,15.25 413 | 2015-08-20,16.55,19.24,16.13,19.14 414 | 2015-08-21,22.55,28.38,20.80,28.03 415 | 2015-08-24,28.03,53.29,28.03,40.74 416 | 2015-08-25,31.13,38.06,28.08,36.02 417 | 2015-08-26,31.13,35.62,28.67,30.32 418 | 2015-08-27,27.11,29.90,24.49,26.10 419 | 2015-08-28,26.69,29.20,25.77,26.05 420 | 2015-08-31,27.03,29.37,26.63,28.43 421 | 2015-09-01,31.91,33.82,29.91,31.40 422 | 2015-09-02,29.14,30.45,24.77,26.09 423 | 2015-09-03,25.21,26.31,23.45,25.61 424 | 2015-09-04,27.43,29.47,25.68,27.80 425 | 2015-09-08,25.05,26.25,24.13,24.90 426 | 2015-09-09,22.39,26.82,21.51,26.23 427 | 2015-09-10,26.87,27.22,23.53,24.37 428 | 2015-09-11,25.38,25.81,23.15,23.20 429 | 2015-09-14,24.03,25.32,23.64,24.25 430 | 2015-09-15,23.28,23.77,22.13,22.54 431 | 2015-09-16,22.57,22.94,21.09,21.35 432 | 2015-09-17,21.54,23.33,17.87,21.14 433 | 2015-09-18,23.07,23.99,20.98,22.28 434 | 2015-09-21,21.97,22.48,20.05,20.14 435 | 2015-09-22,22.97,26.29,22.25,22.44 436 | 2015-09-23,22.09,23.20,21.14,22.13 437 | 2015-09-24,23.53,25.30,21.81,23.47 438 | 2015-09-25,21.12,24.29,20.81,23.62 439 | 2015-09-28,25.02,28.33,24.94,27.63 440 | 2015-09-29,26.57,28.20,25.76,26.83 441 | 2015-09-30,24.64,25.88,23.25,24.50 442 | 2015-10-01,23.14,25.23,22.55,22.55 443 | 2015-10-02,23.99,24.47,20.35,20.94 444 | 2015-10-05,20.31,20.42,19.14,19.54 445 | 2015-10-06,19.54,20.32,18.82,19.40 446 | 2015-10-07,18.96,19.73,18.33,18.40 447 | 2015-10-08,18.62,19.02,16.34,17.42 448 | 2015-10-09,17.15,18.20,16.89,17.08 449 | 2015-10-12,17.68,17.81,16.15,16.17 450 | 2015-10-13,17.08,17.70,16.14,17.67 451 | 2015-10-14,17.67,18.78,17.30,18.03 452 | 2015-10-15,17.62,17.85,16.04,16.05 453 | 2015-10-16,15.64,16.86,15.05,15.05 454 | 2015-10-19,15.68,16.23,14.82,14.98 455 | 2015-10-20,15.17,16.34,14.72,15.75 456 | 2015-10-21,14.98,16.70,14.41,16.70 457 | 2015-10-22,15.02,15.92,14.45,14.45 458 | 2015-10-23,13.46,15.12,13.24,14.46 459 | 2015-10-26,14.76,15.43,14.68,15.29 460 | 2015-10-27,15.75,15.99,14.78,15.43 461 | 2015-10-28,15.14,15.73,12.80,14.33 462 | 2015-10-29,14.80,15.46,14.33,14.61 463 | 2015-10-30,14.60,15.39,14.00,15.07 464 | 2015-11-02,15.41,15.51,13.67,14.15 465 | 2015-11-03,14.33,14.73,13.81,14.54 466 | 2015-11-04,14.04,15.88,13.96,15.51 467 | 2015-11-05,15.39,16.39,15.00,15.05 468 | 2015-11-06,14.91,16.00,14.32,14.33 469 | 2015-11-09,15.34,17.09,15.14,16.52 470 | 2015-11-10,16.69,16.96,15.24,15.29 471 | 2015-11-11,15.07,16.15,15.02,16.06 472 | 2015-11-12,17.06,18.50,16.65,18.37 473 | 2015-11-13,18.68,20.67,18.20,20.08 474 | 2015-11-16,20.51,20.55,17.25,18.16 475 | 2015-11-17,17.82,19.59,16.86,18.84 476 | 2015-11-18,19.01,19.45,16.80,16.85 477 | 2015-11-19,16.25,18.26,16.00,16.99 478 | 2015-11-20,16.13,16.38,15.47,15.47 479 | 2015-11-23,16.15,16.74,15.38,15.62 480 | 2015-11-24,16.53,17.21,15.48,15.93 481 | 2015-11-25,15.55,15.89,15.05,15.19 482 | 2015-11-27,15.31,16.09,15.12,15.12 483 | 2015-11-30,15.55,16.57,15.52,16.13 484 | 2015-12-01,15.61,16.34,14.63,14.67 485 | 2015-12-02,15.04,16.49,14.71,15.91 486 | 2015-12-03,15.87,19.35,15.86,18.11 487 | 2015-12-04,17.43,17.65,14.69,14.81 488 | 2015-12-07,15.65,17.18,15.58,15.84 489 | 2015-12-08,17.69,18.33,16.52,17.60 490 | 2015-12-09,18.05,20.13,15.72,19.61 491 | 2015-12-10,19.25,19.72,18.13,19.34 492 | 2015-12-11,21.36,25.27,20.88,24.39 493 | 2015-12-14,24.70,26.81,21.47,22.73 494 | 2015-12-15,20.76,21.62,20.02,20.95 495 | 2015-12-16,19.25,20.24,17.12,17.86 496 | 2015-12-17,16.18,19.05,16.13,18.94 497 | 2015-12-18,19.34,23.30,18.75,20.70 498 | 2015-12-21,19.64,20.21,18.70,18.70 499 | 2015-12-22,17.61,18.22,16.60,16.60 500 | 2015-12-23,15.86,16.25,15.33,15.57 501 | 2015-12-24,15.44,15.88,14.45,15.74 502 | 2015-12-28,17.65,18.13,16.88,16.91 503 | 2015-12-29,15.91,16.48,15.63,16.08 504 | 2015-12-30,16.50,17.42,16.50,17.29 505 | 2015-12-31,17.97,20.39,17.51,18.21 506 | 2016-01-04,22.48,23.36,20.67,20.70 507 | 2016-01-05,20.75,21.06,19.25,19.34 508 | 2016-01-06,21.67,21.86,19.80,20.59 509 | 2016-01-07,23.22,25.86,22.40,24.99 510 | 2016-01-08,22.96,27.08,22.48,27.01 511 | 2016-01-11,25.58,27.39,23.83,24.30 512 | 2016-01-12,22.97,23.93,21.91,22.47 513 | 2016-01-13,21.72,26.11,21.44,25.22 514 | 2016-01-14,24.75,26.28,23.07,23.95 515 | 2016-01-15,28.96,30.95,26.67,27.02 516 | 2016-01-19,25.40,27.59,25.21,26.05 517 | 2016-01-20,27.78,32.09,26.59,27.59 518 | 2016-01-21,27.79,28.43,25.01,26.69 519 | 2016-01-22,24.21,24.55,22.22,22.34 520 | 2016-01-25,23.30,24.31,22.38,24.15 521 | 2016-01-26,23.75,24.02,22.33,22.50 522 | 2016-01-27,22.88,27.22,20.42,23.11 523 | 2016-01-28,22.15,23.81,21.90,22.42 524 | 2016-01-29,21.59,21.74,19.50,20.20 525 | 2016-02-01,21.32,23.66,19.61,19.98 526 | 2016-02-02,21.34,22.42,21.06,21.98 527 | 2016-02-03,21.49,27.70,21.42,21.65 528 | 2016-02-04,22.29,23.14,21.24,21.84 529 | 2016-02-05,22.09,24.11,21.91,23.38 530 | 2016-02-08,25.89,27.72,25.56,26.00 531 | 2016-02-09,28.30,28.31,25.99,26.54 532 | 2016-02-10,25.75,26.60,24.47,26.29 533 | 2016-02-11,29.01,30.90,26.67,28.14 534 | 2016-02-12,27.16,27.57,24.92,25.40 535 | 2016-02-16,24.96,25.52,23.32,24.11 536 | 2016-02-17,23.40,24.16,21.83,22.31 537 | 2016-02-18,22.16,22.53,21.29,21.64 538 | 2016-02-19,22.39,23.44,20.52,20.53 539 | 2016-02-22,20.14,20.35,19.02,19.38 540 | 2016-02-23,19.75,21.16,19.54,20.98 541 | 2016-02-24,22.28,22.87,20.26,20.72 542 | 2016-02-25,20.54,21.26,19.10,19.11 543 | 2016-02-26,18.89,20.13,18.46,19.81 544 | 2016-02-29,20.49,20.81,18.38,20.55 545 | 2016-03-01,19.84,20.17,17.66,17.70 546 | 2016-03-02,17.98,18.41,16.78,17.09 547 | 2016-03-03,17.25,17.56,16.32,16.70 548 | 2016-03-04,16.48,17.35,16.05,16.86 549 | 2016-03-07,17.98,18.04,16.87,17.35 550 | 2016-03-08,18.38,18.89,17.82,18.67 551 | 2016-03-09,18.56,19.11,18.31,18.34 552 | 2016-03-10,18.17,19.59,17.06,18.05 553 | 2016-03-11,17.09,17.27,16.28,16.50 554 | 2016-03-14,17.01,17.67,16.69,16.92 555 | 2016-03-15,17.60,17.85,16.84,16.84 556 | 2016-03-16,15.96,16.33,14.89,14.99 557 | 2016-03-17,15.34,15.38,13.82,14.44 558 | 2016-03-18,14.05,14.36,13.75,14.02 559 | 2016-03-21,14.57,14.73,13.79,13.79 560 | 2016-03-22,14.57,14.76,13.75,14.17 561 | 2016-03-23,14.57,15.03,14.33,14.94 562 | 2016-03-24,16.30,16.44,14.71,14.74 563 | 2016-03-28,15.65,16.04,14.89,15.24 564 | 2016-03-29,15.74,15.89,13.79,13.82 565 | 2016-03-30,13.69,13.89,13.06,13.56 566 | 2016-03-31,13.73,14.28,13.49,13.95 567 | 2016-04-01,15.23,15.28,13.00,13.10 568 | 2016-04-04,13.88,14.24,13.66,14.12 569 | 2016-04-05,15.39,15.72,14.93,15.42 570 | 2016-04-06,15.61,15.98,14.00,14.09 571 | 2016-04-07,15.14,16.77,14.68,16.16 572 | 2016-04-08,15.34,15.93,14.84,15.36 573 | 2016-04-11,15.34,16.26,14.83,16.26 574 | 2016-04-12,15.98,16.57,14.84,14.85 575 | 2016-04-13,14.49,14.53,13.60,13.84 576 | 2016-04-14,13.90,14.12,13.38,13.72 577 | 2016-04-15,13.77,14.19,13.58,13.62 578 | 2016-04-18,14.87,14.94,13.23,13.35 579 | 2016-04-19,13.18,13.88,12.98,13.24 580 | 2016-04-20,13.39,13.50,12.50,13.28 581 | 2016-04-21,13.20,14.14,13.16,13.95 582 | 2016-04-22,13.70,14.19,13.15,13.22 583 | 2016-04-25,14.07,14.76,13.86,14.08 584 | 2016-04-26,14.01,14.43,13.66,13.96 585 | 2016-04-27,14.15,14.95,13.50,13.77 586 | 2016-04-28,14.53,15.61,13.30,15.22 587 | 2016-04-29,15.21,17.09,14.91,15.70 588 | 2016-05-02,16.33,16.50,14.48,14.68 589 | 2016-05-03,14.92,16.42,14.91,15.60 590 | 2016-05-04,15.47,16.85,15.39,16.05 591 | 2016-05-05,15.54,16.45,15.22,15.91 592 | 2016-05-06,16.20,16.58,14.71,14.72 593 | 2016-05-09,15.20,15.39,14.17,14.57 594 | 2016-05-10,13.98,14.35,13.55,13.63 595 | 2016-05-11,13.92,14.69,13.29,14.69 596 | 2016-05-12,14.55,15.42,13.95,14.41 597 | 2016-05-13,15.15,15.47,13.97,15.04 598 | 2016-05-16,15.72,15.98,14.28,14.68 599 | 2016-05-17,14.57,16.12,14.48,15.57 600 | 2016-05-18,15.72,16.47,14.86,15.95 601 | 2016-05-19,16.37,17.65,16.28,16.33 602 | 2016-05-20,16.13,16.30,15.11,15.20 603 | 2016-05-23,16.33,16.47,15.40,15.82 604 | 2016-05-24,16.03,16.06,14.36,14.42 605 | 2016-05-25,14.19,14.33,13.64,13.90 606 | 2016-05-26,13.80,14.11,13.43,13.43 607 | 2016-05-27,13.49,13.76,13.04,13.12 608 | 2016-05-31,13.94,15.00,13.45,14.19 609 | 2016-06-01,14.45,15.25,14.18,14.20 610 | 2016-06-02,14.42,14.92,13.62,13.63 611 | 2016-06-03,13.78,14.66,12.90,13.47 612 | 2016-06-06,13.84,14.27,13.42,13.65 613 | 2016-06-07,12.77,14.05,12.72,14.05 614 | 2016-06-08,13.84,14.27,13.70,14.08 615 | 2016-06-09,14.01,14.85,13.99,14.64 616 | 2016-06-10,14.89,17.33,14.85,17.03 617 | 2016-06-13,18.24,21.01,17.89,20.97 618 | 2016-06-14,21.28,22.16,20.27,20.50 619 | 2016-06-15,20.25,20.45,18.63,20.14 620 | 2016-06-16,20.80,22.89,19.24,19.37 621 | 2016-06-17,19.42,20.03,18.71,19.41 622 | 2016-06-20,17.42,18.55,16.59,18.37 623 | 2016-06-21,17.67,18.96,16.91,18.48 624 | 2016-06-22,18.26,21.22,17.83,21.17 625 | 2016-06-23,19.54,19.79,17.25,17.25 626 | 2016-06-24,26.06,26.24,19.48,25.76 627 | 2016-06-27,24.38,26.72,22.93,23.85 628 | 2016-06-28,21.76,22.07,18.75,18.75 629 | 2016-06-29,18.12,18.27,16.48,16.64 630 | 2016-06-30,16.91,16.99,15.29,15.63 631 | 2016-07-01,15.59,15.86,14.61,14.77 632 | 2016-07-05,16.05,16.62,15.49,15.58 633 | 2016-07-06,15.87,17.04,14.96,14.96 634 | 2016-07-07,14.80,15.98,14.33,14.76 635 | 2016-07-08,14.64,14.75,13.19,13.20 636 | 2016-07-11,13.25,13.67,13.00,13.54 637 | 2016-07-12,12.93,13.93,12.75,13.55 638 | 2016-07-13,13.32,13.79,12.92,13.04 639 | 2016-07-14,12.50,13.37,12.14,12.82 640 | 2016-07-15,13.12,13.22,12.27,12.67 641 | 2016-07-18,12.75,13.12,12.33,12.44 642 | 2016-07-19,12.53,12.83,11.94,11.97 643 | 2016-07-20,11.94,11.97,11.40,11.77 644 | 2016-07-21,11.80,13.06,11.69,12.74 645 | 2016-07-22,12.80,12.88,11.97,12.02 646 | 2016-07-25,12.64,13.72,12.39,12.87 647 | 2016-07-26,12.88,13.50,12.80,13.05 648 | 2016-07-27,12.61,13.74,12.50,12.83 649 | 2016-07-28,12.51,13.52,12.36,12.72 650 | 2016-07-29,12.85,12.90,11.77,11.87 651 | 2016-08-01,11.89,12.98,11.86,12.44 652 | 2016-08-02,12.39,14.24,12.35,13.37 653 | -------------------------------------------------------------------------------- /fixtures/dp-vix-resource-and-view/datapackage.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-package", 3 | "title": "DEMO - CBOE Volatility Index", 4 | "homepage": "http://www.cboe.com/micro/VIX/", 5 | "version": "0.1.0", 6 | "license": "PDDL-1.0", 7 | "sources": [{ 8 | "name": "CBOE VIX Page", 9 | "web": "http://www.cboe.com/micro/vix/historical.aspx" 10 | }], 11 | "resources": [ 12 | { 13 | "name": "demo-resource", 14 | "path": "data/demo-resource.csv", 15 | "format": "csv", 16 | "mediatype": "text/csv", 17 | "schema": { 18 | "fields": [ 19 | { 20 | "name": "Date", 21 | "type": "date", 22 | "description": "" 23 | }, 24 | { 25 | "name": "DEMOOpen", 26 | "type": "number", 27 | "description": "" 28 | }, 29 | { 30 | "name": "DEMOHigh", 31 | "type": "number", 32 | "description": "" 33 | }, 34 | { 35 | "name": "DEMOLow", 36 | "type": "number", 37 | "description": "" 38 | }, 39 | { 40 | "name": "DEMOClose", 41 | "type": "number", 42 | "description": "" 43 | } 44 | ], 45 | "primaryKey": "Date" 46 | } 47 | } 48 | ], 49 | "views": [ 50 | { 51 | "id": "Graph", 52 | "type": "Graph", 53 | "state": { 54 | "graphType": "lines", 55 | "group": "Date", 56 | "series": [ "DEMOClose" ] 57 | } 58 | } 59 | ] 60 | } 61 | -------------------------------------------------------------------------------- /fixtures/example-geojson/README.md: -------------------------------------------------------------------------------- 1 | Example Geo [Data Package][] showing how to package up GeoJSON data. 2 | 3 | For more example, visit the [example-data-packages](https://github.com/frictionlessdata/example-data-packages) repository. 4 | 5 | [Data Package]: http://data.okfn.org/doc/data-package 6 | 7 | -------------------------------------------------------------------------------- /fixtures/example-geojson/data/example.geojson: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "features": [ 4 | { "type": "Feature", "properties": { "scalerank": 1, "featurecla": "Admin-0 country", "labelrank": 2.0, "sovereignt": "United Kingdom", "sov_a3": "GB1", "adm0_dif": 1.0, "level": 2.0, "type": "Country", "admin": "United Kingdom", "adm0_a3": "GBR", "geou_dif": 0.0, "geounit": "United Kingdom", "gu_a3": "GBR", "su_dif": 0.0, "subunit": "United Kingdom", "su_a3": "GBR", "brk_diff": 0.0, "name": "United Kingdom", "name_long": "United Kingdom", "brk_a3": "GBR", "brk_name": "United Kingdom", "brk_group": null, "abbrev": "U.K.", "postal": "GB", "formal_en": "United Kingdom of Great Britain and Northern Ireland", "formal_fr": null, "note_adm0": null, "note_brk": null, "name_sort": "United Kingdom", "name_alt": null, "mapcolor7": 6.0, "mapcolor8": 6.0, "mapcolor9": 6.0, "mapcolor13": 3.0, "pop_est": 62262000.0, "gdp_md_est": 1977704.0, "pop_year": 0.0, "lastcensus": 2011.0, "gdp_year": 2009.0, "economy": "1. Developed region: G7", "income_grp": "1. High income: OECD", "wikipedia": -99.0, "fips_10": null, "iso_a2": "GB", "iso_a3": "GBR", "iso_n3": "826", "un_a3": "826", "wb_a2": "GB", "wb_a3": "GBR", "woe_id": -99.0, "adm0_a3_is": "GBR", "adm0_a3_us": "GBR", "adm0_a3_un": -99.0, "adm0_a3_wb": -99.0, "continent": "Europe", "region_un": "Europe", "subregion": "Northern Europe", "region_wb": "Europe & Central Asia", "name_len": 14.0, "long_len": 14.0, "abbrev_len": 4.0, "tiny": -99.0, "homepart": 1.0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -5.661948614921897, 54.554603176483852 ], [ -6.197884894220977, 53.867565009163343 ], [ -6.953730231137996, 54.073702297575636 ], [ -7.572167934591079, 54.059956366585993 ], [ -7.366030646178785, 54.595840969452695 ], [ -7.572167934591079, 55.131622219454897 ], [ -6.733847011736145, 55.172860012423797 ], [ -5.661948614921897, 54.554603176483852 ] ] ], [ [ [ -3.005004848635281, 58.635000108466329 ], [ -4.073828497728016, 57.553024807355257 ], [ -3.055001796877661, 57.69001902936094 ], [ -1.959280564776918, 57.684799709699519 ], [ -2.219988165689301, 56.870017401753529 ], [ -3.119003058271119, 55.973793036515474 ], [ -2.085009324543023, 55.909998480851272 ], [ -2.005675679673857, 55.804902850350231 ], [ -1.11499101399221, 54.624986477265395 ], [ -0.4304849918542, 54.464376125702159 ], [ 0.184981316742039, 53.325014146531032 ], [ 0.469976840831777, 52.929999498091973 ], [ 1.681530795914739, 52.739520168664001 ], [ 1.559987827164377, 52.099998480836007 ], [ 1.050561557630914, 51.806760565795685 ], [ 1.449865349950301, 51.289427802121963 ], [ 0.550333693045502, 50.765738837275876 ], [ -0.78751746255864, 50.77498891865622 ], [ -2.489997524414377, 50.500018622431242 ], [ -2.956273972984036, 50.696879991247016 ], [ -3.617448085942328, 50.228355617872722 ], [ -4.542507900399244, 50.341837063185665 ], [ -5.245023159191135, 49.959999904981089 ], [ -5.776566941745301, 50.159677639356829 ], [ -4.309989793301838, 51.210001125689161 ], [ -3.414850633142123, 51.42600861266925 ], [ -3.422719467108323, 51.426848167406092 ], [ -4.984367234710874, 51.593466091510976 ], [ -5.267295701508885, 51.991400458374585 ], [ -4.222346564134853, 52.301355699261364 ], [ -4.770013393564113, 52.840004991255626 ], [ -4.579999152026915, 53.495003770555172 ], [ -3.093830673788659, 53.404547400669685 ], [ -3.092079637047107, 53.404440822963551 ], [ -2.945008510744344, 53.984999701546684 ], [ -3.614700825433033, 54.600936773292574 ], [ -3.630005458989331, 54.615012925833014 ], [ -4.844169073903004, 54.790971177786844 ], [ -5.082526617849226, 55.061600653699372 ], [ -4.719112107756644, 55.508472601943481 ], [ -5.047980922862109, 55.78398550070753 ], [ -5.58639767091114, 55.311146145236819 ], [ -5.644998745130181, 56.275014960344805 ], [ -6.149980841486354, 56.785009670633542 ], [ -5.786824713555291, 57.818848375064647 ], [ -5.009998745127575, 58.630013332750053 ], [ -4.211494513353557, 58.550845038479167 ], [ -3.005004848635281, 58.635000108466329 ] ] ] ] } }, 5 | 6 | { "type": "Feature", "properties": { "scalerank": 1, "featurecla": "Admin-0 country", "labelrank": 2.0, "sovereignt": "United Kingdom", "sov_a3": "GB1", "adm0_dif": 1.0, "level": 2.0, "type": "Country", "admin": "United Kingdom", "adm0_a3": "GBR", "geou_dif": 0.0, "geounit": "United Kingdom", "gu_a3": "GBR", "su_dif": 0.0, "subunit": "United Kingdom", "su_a3": "GBR", "brk_diff": 0.0, "name": "United Kingdom", "name_long": "United Kingdom", "brk_a3": "GBR", "brk_name": "United Kingdom", "brk_group": null, "abbrev": "U.K.", "postal": "GB", "formal_en": "United Kingdom of Great Britain and Northern Ireland", "formal_fr": null, "note_adm0": null, "note_brk": null, "name_sort": "United Kingdom", "name_alt": null, "mapcolor7": 6.0, "mapcolor8": 6.0, "mapcolor9": 6.0, "mapcolor13": 3.0, "pop_est": 62262000.0, "gdp_md_est": 1977704.0, "pop_year": 0.0, "lastcensus": 2011.0, "gdp_year": 2009.0, "economy": "1. Developed region: G7", "income_grp": "1. High income: OECD", "wikipedia": -99.0, "fips_10": null, "iso_a2": "GB", "iso_a3": "GBR", "iso_n3": "826", "un_a3": "826", "wb_a2": "GB", "wb_a3": "GBR", "woe_id": -99.0, "adm0_a3_is": "GBR", "adm0_a3_us": "GBR", "adm0_a3_un": -99.0, "adm0_a3_wb": -99.0, "continent": "Europe", "region_un": "Europe", "subregion": "Northern Europe", "region_wb": "Europe & Central Asia", "name_len": 14.0, "long_len": 14.0, "abbrev_len": 4.0, "tiny": -99.0, "homepart": 1.0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -5.661948614921897, 54.554603176483852 ], [ -6.197884894220977, 53.867565009163343 ], [ -6.953730231137996, 54.073702297575636 ], [ -7.572167934591079, 54.059956366585993 ], [ -7.366030646178785, 54.595840969452695 ], [ -7.572167934591079, 55.131622219454897 ], [ -6.733847011736145, 55.172860012423797 ], [ -5.661948614921897, 54.554603176483852 ] ] ], [ [ [ -3.005004848635281, 58.635000108466329 ], [ -4.073828497728016, 57.553024807355257 ], [ -3.055001796877661, 57.69001902936094 ], [ -1.959280564776918, 57.684799709699519 ], [ -2.219988165689301, 56.870017401753529 ], [ -3.119003058271119, 55.973793036515474 ], [ -2.085009324543023, 55.909998480851272 ], [ -2.005675679673857, 55.804902850350231 ], [ -1.11499101399221, 54.624986477265395 ], [ -0.4304849918542, 54.464376125702159 ], [ 0.184981316742039, 53.325014146531032 ], [ 0.469976840831777, 52.929999498091973 ], [ 1.681530795914739, 52.739520168664001 ], [ 1.559987827164377, 52.099998480836007 ], [ 1.050561557630914, 51.806760565795685 ], [ 1.449865349950301, 51.289427802121963 ], [ 0.550333693045502, 50.765738837275876 ], [ -0.78751746255864, 50.77498891865622 ], [ -2.489997524414377, 50.500018622431242 ], [ -2.956273972984036, 50.696879991247016 ], [ -3.617448085942328, 50.228355617872722 ], [ -4.542507900399244, 50.341837063185665 ], [ -5.245023159191135, 49.959999904981089 ], [ -5.776566941745301, 50.159677639356829 ], [ -4.309989793301838, 51.210001125689161 ], [ -3.414850633142123, 51.42600861266925 ], [ -3.422719467108323, 51.426848167406092 ], [ -4.984367234710874, 51.593466091510976 ], [ -5.267295701508885, 51.991400458374585 ], [ -4.222346564134853, 52.301355699261364 ], [ -4.770013393564113, 52.840004991255626 ], [ -4.579999152026915, 53.495003770555172 ], [ -3.093830673788659, 53.404547400669685 ], [ -3.092079637047107, 53.404440822963551 ], [ -2.945008510744344, 53.984999701546684 ], [ -3.614700825433033, 54.600936773292574 ], [ -3.630005458989331, 54.615012925833014 ], [ -4.844169073903004, 54.790971177786844 ], [ -5.082526617849226, 55.061600653699372 ], [ -4.719112107756644, 55.508472601943481 ], [ -5.047980922862109, 55.78398550070753 ], [ -5.58639767091114, 55.311146145236819 ], [ -5.644998745130181, 56.275014960344805 ], [ -6.149980841486354, 56.785009670633542 ], [ -5.786824713555291, 57.818848375064647 ], [ -5.009998745127575, 58.630013332750053 ], [ -4.211494513353557, 58.550845038479167 ], [ -3.005004848635281, 58.635000108466329 ] ] ] ] } }, 7 | { 8 | "type": "Feature", 9 | "geometry": { 10 | "type": "Point", 11 | "coordinates": [ 12 | 20.522875, 13 | 51.070292 14 | ] 15 | }, 16 | "properties": { 17 | "id": 1, 18 | "marker-size": "small", 19 | "marker-color": "#f5a91a", 20 | "marker-symbol": "b" 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /fixtures/example-geojson/datapackage.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ex-geojson", 3 | "title": "Example Geo (JSON) Data Package", 4 | "version": "0.1.0", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/datasets/ex-geojson.git" 8 | }, 9 | "license": "PDDL-1.0", 10 | "resources": [ 11 | { 12 | "name": "example", 13 | "path": "data/example.geojson", 14 | "format": "geojson", 15 | "mediatype": "application/json" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /fixtures/example-no-format/data/cities-month.csv: -------------------------------------------------------------------------------- 1 | Date,AZ-Phoenix,CA-Los Angeles,CA-San Diego,CA-San Francisco,CO-Denver,DC-Washington,FL-Miami,FL-Tampa,GA-Atlanta,IL-Chicago,MA-Boston,MI-Detroit,MN-Minneapolis,NC-Charlotte,NV-Las Vegas,NY-New York,OH-Cleveland,OR-Portland,TX-Dallas,WA-Seattle,Composite-10,Composite-20,National-US 2 | 1987-01-01,,59.33,54.67,46.61,50.2,64.11,68.5,77.33,,53.55,70.04,,,63.39,66.36,74.42,53.53,41.05,,,62.82,,63.75 3 | 1987-02-01,,59.65,54.89,46.87,49.96,64.77,68.76,77.93,,54.64,70.08,,,63.94,67.03,75.43,53.5,41.28,,,63.39,,64.15 4 | 1987-03-01,,59.99,55.16,47.32,50.15,65.71,69.23,77.76,,54.8,70.0,,,64.17,67.34,76.25,53.68,41.06,,,63.87,,64.49 5 | 1987-04-01,,60.81,55.85,47.69,50.55,66.4,69.2,77.56,,54.88,70.7,,,64.81,67.88,77.34,53.75,40.96,,,64.57,,64.99 6 | 1987-05-01,,61.67,56.35,48.31,50.63,67.27,69.46,77.85,,55.43,71.51,,,65.18,67.9,79.16,54.71,41.24,,,65.56,,65.57 7 | 1987-06-01,,62.71,56.86,48.83,50.5,68.7,69.31,78.71,,56.39,72.32,,,65.55,66.48,80.84,55.12,41.45,,,66.59,,66.24 8 | 1987-07-01,,63.66,57.26,49.49,50.28,69.79,69.7,79.11,,57.54,73.09,,,65.76,65.43,82.22,55.74,41.82,,,67.54,,66.8 9 | 1987-08-01,,64.56,57.69,49.94,50.38,70.62,70.16,79.14,,58.37,73.79,,,66.08,65.14,83.01,56.1,41.9,,,68.25,,67.29 10 | 1987-09-01,,65.38,58.14,50.69,50.18,71.79,70.95,79.24,,58.85,74.39,,,66.47,65.85,83.44,56.51,41.8,,,68.87,,67.64 11 | -------------------------------------------------------------------------------- /fixtures/example-no-format/datapackage.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "house-prices-us", 3 | "title": "US House Price Index (Case-Shiller)", 4 | "licenses": [ 5 | { 6 | "url": "http://opendatacommons.org/licenses/pddl/1.0/", 7 | "name": "Public Domain Dedication and License" 8 | } 9 | ], 10 | "sources": [{ 11 | "name": "Standard and Poors Case-Shiller Indices", 12 | "web": "http://www.spindices.com/indices/real-estate/sp-case-shiller-us-national-home-price-index" 13 | }], 14 | "keywords": ["Indicator", "House Prices", "US"], 15 | "resources": [ 16 | { 17 | "name": "cities", 18 | "path": "data/cities-month.csv", 19 | "description": "Case-Shiller US home price index levels at national and city level. Monthly.", 20 | "periodicity": "month", 21 | "sources": [{ 22 | "name": "Home Price Index Levels", 23 | "web": "http://www.spindices.com/documents/additionalinfo/20140826-107542/107542_cshomeprice-history-0826.xls?force_download=true" 24 | }], 25 | "schema": { 26 | "fields": [ 27 | { 28 | "name": "Date", 29 | "type": "date" 30 | }, 31 | { 32 | "name": "AZ-Phoenix", 33 | "type": "number" 34 | }, 35 | { 36 | "name": "CA-Los Angeles", 37 | "type": "number" 38 | }, 39 | { 40 | "name": "CA-San Diego", 41 | "type": "number" 42 | }, 43 | { 44 | "name": "CA-San Francisco", 45 | "type": "number" 46 | }, 47 | { 48 | "name": "CO-Denver", 49 | "type": "number" 50 | }, 51 | { 52 | "name": "DC-Washington", 53 | "type": "number" 54 | }, 55 | { 56 | "name": "FL-Miami", 57 | "type": "number" 58 | }, 59 | { 60 | "name": "FL-Tampa", 61 | "type": "number" 62 | }, 63 | { 64 | "name": "GA-Atlanta", 65 | "type": "number" 66 | }, 67 | { 68 | "name": "IL-Chicago", 69 | "type": "number" 70 | }, 71 | { 72 | "name": "MA-Boston", 73 | "type": "number" 74 | }, 75 | { 76 | "name": "MI-Detroit", 77 | "type": "number" 78 | }, 79 | { 80 | "name": "MN-Minneapolis", 81 | "type": "number" 82 | }, 83 | { 84 | "name": "NC-Charlotte", 85 | "type": "number" 86 | }, 87 | { 88 | "name": "NV-Las Vegas", 89 | "type": "number" 90 | }, 91 | { 92 | "name": "NY-New York", 93 | "type": "number" 94 | }, 95 | { 96 | "name": "OH-Cleveland", 97 | "type": "number" 98 | }, 99 | { 100 | "name": "OR-Portland", 101 | "type": "number" 102 | }, 103 | { 104 | "name": "TX-Dallas", 105 | "type": "number" 106 | }, 107 | { 108 | "name": "WA-Seattle", 109 | "type": "number" 110 | }, 111 | { 112 | "name": "Composite-10", 113 | "type": "number" 114 | }, 115 | { 116 | "name": "Composite-20", 117 | "type": "number" 118 | }, 119 | { 120 | "name": "National-US", 121 | "type": "number" 122 | } 123 | ] 124 | } 125 | } 126 | ], 127 | "views": [ 128 | { 129 | "id": "Graph", 130 | "type": "Graph", 131 | "state": { 132 | "graphType": "lines-and-points", 133 | "group": "Date", 134 | "series": [ "National-US" ] 135 | } 136 | } 137 | ] 138 | } 139 | -------------------------------------------------------------------------------- /fixtures/example-topojson/datapackage.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "topojson", 3 | "title": "Example TopoJSON Data Package", 4 | "resources": [ 5 | { 6 | "name": "example", 7 | "path": "data/example.json", 8 | "format": "topojson", 9 | "mediatype": "application/json" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /fixtures/schemas/data-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "Data Package", 4 | "description": "Data Package is a simple specification for data access and delivery.", 5 | "type": "object", 6 | "required": [ "name", "resources" ], 7 | "properties": { 8 | "name": { 9 | "$ref": "definitions.json#/define/name", 10 | "propertyOrder": 10 11 | }, 12 | "title": { 13 | "$ref": "definitions.json#/define/title", 14 | "propertyOrder": 20 15 | }, 16 | "description": { 17 | "$ref": "definitions.json#/define/description", 18 | "format": "textarea", 19 | "propertyOrder": 30 20 | }, 21 | "homepage": { 22 | "$ref": "definitions.json#/define/homepage", 23 | "propertyOrder": 40 24 | }, 25 | "version": { 26 | "$ref": "definitions.json#/define/version", 27 | "propertyOrder": 50 28 | }, 29 | "license": { 30 | "$ref": "definitions.json#/define/license", 31 | "propertyOrder": 60 32 | }, 33 | "author": { 34 | "$ref": "definitions.json#/define/author", 35 | "propertyOrder": 70 36 | }, 37 | "contributors": { 38 | "$ref": "definitions.json#/define/contributors", 39 | "propertyOrder": 80, 40 | "options": { "hidden": true } 41 | }, 42 | "resources": { 43 | "title": "Resources", 44 | "description": "The data resources that this package describes.", 45 | "type": "array", 46 | "propertyOrder": 90, 47 | "minItems": 0, 48 | "items": { 49 | "type": "object", 50 | "properties": { 51 | "name": { 52 | "$ref": "definitions.json#/define/name", 53 | "propertyOrder": 10 54 | }, 55 | "title": { 56 | "$ref": "definitions.json#/define/title", 57 | "propertyOrder": 20 58 | }, 59 | "description": { 60 | "$ref": "definitions.json#/define/description", 61 | "propertyOrder": 30, 62 | "format": "textarea" 63 | }, 64 | "schema": { 65 | "$ref": "definitions.json#/define/schema", 66 | "propertyOrder": 40 67 | }, 68 | "url": { 69 | "$ref": "definitions.json#/define/url", 70 | "propertyOrder": 50 71 | }, 72 | "path": { 73 | "$ref": "definitions.json#/define/path", 74 | "propertyOrder": 60 75 | }, 76 | "data": { 77 | "$ref": "definitions.json#/define/data", 78 | "propertyOrder": 70 79 | }, 80 | "format": { 81 | "$ref": "definitions.json#/define/format", 82 | "propertyOrder": 80 83 | }, 84 | "mediatype": { 85 | "$ref": "definitions.json#/define/mediatype", 86 | "propertyOrder": 90 87 | }, 88 | "encoding": { 89 | "$ref": "definitions.json#/define/encoding", 90 | "propertyOrder": 100 91 | }, 92 | "bytes": { 93 | "$ref": "definitions.json#/define/bytes", 94 | "propertyOrder": 110, 95 | "options": { "hidden": true } 96 | }, 97 | "hash": { 98 | "$ref": "definitions.json#/define/hash", 99 | "propertyOrder": 120, 100 | "options": { "hidden": true } 101 | }, 102 | "dialect": { 103 | "$ref": "definitions.json#/define/dialect", 104 | "propertyOrder": 130, 105 | "options": { "hidden": true } 106 | }, 107 | "sources": { 108 | "$ref": "definitions.json#/define/sources", 109 | "propertyOrder": 140, 110 | "options": { "hidden": true } 111 | }, 112 | "license": { 113 | "$ref": "definitions.json#/define/license", 114 | "description": "The license under which the resource is published.", 115 | "propertyOrder": 150, 116 | "options": { "hidden": true } 117 | } 118 | }, 119 | "anyOf": [ 120 | { "title": "url required", "required": ["url"] }, 121 | { "title": "path required", "required": ["path"] }, 122 | { "title": "data required", "required": ["data"] } 123 | ] 124 | } 125 | }, 126 | "keywords": { 127 | "$ref": "definitions.json#/define/keywords", 128 | "propertyOrder": 100 129 | }, 130 | "sources": { 131 | "$ref": "definitions.json#/define/sources", 132 | "propertyOrder": 110, 133 | "options": { "hidden": true } 134 | }, 135 | "image": { 136 | "$ref": "definitions.json#/define/image", 137 | "propertyOrder": 120, 138 | "options": { "hidden": true } 139 | }, 140 | "dataDependencies": { 141 | "$ref": "definitions.json#/define/dataDependencies", 142 | "propertyOrder": 140, 143 | "options": { "hidden": true } 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /fixtures/schemas/fiscal-data-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "Fiscal Data Package", 4 | "description": "Fiscal Data Package is a simple specification for data access and delivery of fiscal data.", 5 | "type": "object", 6 | "required": [ "name", "title", "resources", "model" ], 7 | "properties": { 8 | "name": { 9 | "$ref": "definitions.json#/define/name", 10 | "propertyOrder": 10 11 | }, 12 | "title": { 13 | "$ref": "definitions.json#/define/title", 14 | "propertyOrder": 20 15 | }, 16 | "description": { 17 | "$ref": "definitions.json#/define/description", 18 | "format": "textarea", 19 | "propertyOrder": 30 20 | }, 21 | "homepage": { 22 | "$ref": "definitions.json#/define/homepage", 23 | "propertyOrder": 40 24 | }, 25 | "version": { 26 | "$ref": "definitions.json#/define/version", 27 | "propertyOrder": 50 28 | }, 29 | "license": { 30 | "$ref": "definitions.json#/define/license", 31 | "propertyOrder": 60 32 | }, 33 | "author": { 34 | "$ref": "definitions.json#/define/author", 35 | "propertyOrder": 70 36 | }, 37 | "contributors": { 38 | "$ref": "definitions.json#/define/contributors", 39 | "propertyOrder": 80, 40 | "options": { "hidden": true } 41 | }, 42 | "resources": { 43 | "title": "Resources", 44 | "description": "The data resources that this package describes.", 45 | "type": "array", 46 | "propertyOrder": 90, 47 | "minItems": 0, 48 | "items": { 49 | "type": "object", 50 | "properties": { 51 | "name": { 52 | "$ref": "definitions.json#/define/name", 53 | "propertyOrder": 10 54 | }, 55 | "title": { 56 | "$ref": "definitions.json#/define/title", 57 | "propertyOrder": 20 58 | }, 59 | "description": { 60 | "$ref": "definitions.json#/define/description", 61 | "propertyOrder": 30, 62 | "format": "textarea" 63 | }, 64 | "schema": { 65 | "$ref": "definitions.json#/define/schema", 66 | "propertyOrder": 40 67 | }, 68 | "url": { 69 | "$ref": "definitions.json#/define/url", 70 | "propertyOrder": 50 71 | }, 72 | "path": { 73 | "$ref": "definitions.json#/define/path", 74 | "propertyOrder": 60 75 | }, 76 | "data": { 77 | "$ref": "definitions.json#/define/data", 78 | "propertyOrder": 70 79 | }, 80 | "format": { 81 | "$ref": "definitions.json#/define/format", 82 | "propertyOrder": 80 83 | }, 84 | "mediatype": { 85 | "$ref": "definitions.json#/define/mediatype", 86 | "propertyOrder": 90 87 | }, 88 | "encoding": { 89 | "$ref": "definitions.json#/define/encoding", 90 | "propertyOrder": 100 91 | }, 92 | "bytes": { 93 | "$ref": "definitions.json#/define/bytes", 94 | "propertyOrder": 110, 95 | "options": { "hidden": true } 96 | }, 97 | "hash": { 98 | "$ref": "definitions.json#/define/hash", 99 | "propertyOrder": 120, 100 | "options": { "hidden": true } 101 | }, 102 | "dialect": { 103 | "$ref": "definitions.json#/define/dialect", 104 | "propertyOrder": 130, 105 | "options": { "hidden": true } 106 | }, 107 | "sources": { 108 | "$ref": "definitions.json#/define/sources", 109 | "propertyOrder": 140, 110 | "options": { "hidden": true } 111 | }, 112 | "license": { 113 | "$ref": "definitions.json#/define/license", 114 | "description": "The license under which the resource is published.", 115 | "propertyOrder": 150, 116 | "options": { "hidden": true } 117 | } 118 | }, 119 | "anyOf": [ 120 | { "title": "url required", "required": ["url"] }, 121 | { "title": "path required", "required": ["path"] }, 122 | { "title": "data required", "required": ["data"] } 123 | ] 124 | } 125 | }, 126 | "keywords": { 127 | "$ref": "definitions.json#/define/keywords", 128 | "propertyOrder": 100 129 | }, 130 | "sources": { 131 | "$ref": "definitions.json#/define/sources", 132 | "propertyOrder": 110, 133 | "options": { "hidden": true } 134 | }, 135 | "image": { 136 | "$ref": "definitions.json#/define/image", 137 | "propertyOrder": 120, 138 | "options": { "hidden": true } 139 | }, 140 | "base": { 141 | "$ref": "definitions.json#/define/base", 142 | "propertyOrder": 130, 143 | "options": { "hidden": true } 144 | }, 145 | "dataDependencies": { 146 | "$ref": "definitions.json#/define/dataDependencies", 147 | "propertyOrder": 140, 148 | "options": { "hidden": true } 149 | }, 150 | "countryCode": { "$ref": "definitions.json#/define/countryCode" }, 151 | "granularity": { 152 | "title": "Granularity of resources", 153 | "description": "A keyword that represents the type of spend data, eiter aggregated or transactional", 154 | "type": "string", 155 | "enum": ["aggregated", "transactional"] 156 | }, 157 | "fiscalPeriod": { 158 | "title": "Fiscal period for the budget", 159 | "description": "The fiscal period of the dataset", 160 | "type": "object", 161 | "properties": { 162 | "start": { 163 | "type": "string", 164 | "pattern": "^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12]\\d|3[01])" 165 | }, 166 | "end": { 167 | "type": "string", 168 | "pattern": "^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12]\\d|3[01])" 169 | } 170 | }, 171 | "required": ["start"] 172 | }, 173 | "model": { 174 | "title": "Model", 175 | "description": "The 'logical model' for the data", 176 | "type": "object", 177 | "properties": { 178 | "measures": { 179 | "title": "Measures", 180 | "description": "Measures are numerical and correspond to financial amounts in the source data.", 181 | "type": "object", 182 | "patternProperties": { 183 | "^\\w+": { 184 | "type": "object", 185 | "properties": { 186 | "source": { "type": "string" }, 187 | "resource": { "type": "string" }, 188 | "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }, 189 | "factor": { "type": "number" }, 190 | "direction": { 191 | "title": "Direction of the spending", 192 | "description": "A keyword that represents the direction of the spend, either expenditure or revenue.", 193 | "type": "string", 194 | "enum": [ "expenditure", "revenue" ] 195 | }, 196 | "phase": { 197 | "title": "Budget phase", 198 | "description": "A keyword that represents the phase of the data, can be proposed for a budget proposal, approved for an approved budget, adjusted for modified budget or executed for the enacted budget", 199 | "type": "string", 200 | "enum": ["proposed", "approved", "adjusted", "executed"] 201 | } 202 | }, 203 | "required": [ "source", "currency" ] 204 | } 205 | } 206 | }, 207 | "dimensions": { 208 | "title": "Dimensions", 209 | "description": "Dimensions are groups of related fields. Dimensions cover all items other than the measure.", 210 | "type": "object", 211 | "patternProperties": { 212 | "^\\w+": { 213 | "type": "object", 214 | "properties": { 215 | "attributes": { 216 | "title": "Attributes", 217 | "description": "Attribute objects that make up the dimension", 218 | "type": "object", 219 | "minItems": 1, 220 | "patternProperties": { 221 | "^\\w+": { 222 | "type": "object", 223 | "properties": { 224 | "source": { "type": "string" }, 225 | "resource": { "type": "string" }, 226 | "constant": { 227 | "oneOf": [ 228 | { "type": "string" }, 229 | { "type": "number" } 230 | ] 231 | }, 232 | "parent": { "type": "string" }, 233 | "labelfor": { "type": "string" } 234 | }, 235 | "required": [ "source" ] 236 | } 237 | } 238 | }, 239 | "primaryKey": { 240 | "title": "Primary Key", 241 | "description": "Either an array of strings corresponding to the name attributes in a set of field objects in the fields array or a single string corresponding to one of these names. The value of primaryKey indicates the primary key or primary keys for the dimension.", 242 | "oneOf": [ 243 | { "type": "string" }, 244 | { 245 | "type": "array", 246 | "minItems": 1, 247 | "items": { "type": "string" } 248 | } 249 | ] 250 | }, 251 | "dimensionType": { 252 | "title": "Dimension Type", 253 | "description": "Describes what kind of a dimension it is.", 254 | "type": "string", 255 | "enum": [ 256 | "datetime", 257 | "entity", 258 | "classification", 259 | "activity", 260 | "fact", 261 | "location", 262 | "other" 263 | ] 264 | }, 265 | "classificationType": { 266 | "title": "Classification Type", 267 | "description": "The type of the classification.", 268 | "enum": [ "functional", "administrative", "economic" ] 269 | } 270 | }, 271 | "required": [ "attributes", "primaryKey" ] 272 | } 273 | } 274 | } 275 | }, 276 | "required": [ "measures", "dimensions" ] 277 | } 278 | } 279 | } 280 | -------------------------------------------------------------------------------- /fixtures/schemas/registry.json: -------------------------------------------------------------------------------- 1 | { 2 | "datapackage": { 3 | "title": "Data Package", 4 | "schema": "http://schemas.datapackages.org/data-package.json", 5 | "schema_path": "data-package.json", 6 | "specification": "http://dataprotocols.org/data-packages" 7 | }, 8 | "tabular-datapackage": { 9 | "title": "Tabular Data Package", 10 | "schema": "http://schemas.datapackages.org/tabular-data-package.json", 11 | "schema_path": "tabular-data-package.json", 12 | "specification": "http://dataprotocols.org/tabular-data-package/" 13 | }, 14 | "fiscal-datapackage": { 15 | "title": "Fiscal Data Package", 16 | "schema": "http://schemas.datapackages.org/fiscal-data-package.json", 17 | "schema_path": "fiscal-data-package.json", 18 | "specification": "http://fiscal.dataprotocols.org/spec/" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /fixtures/schemas/tabular-data-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "Tabular Data Package", 4 | "description": "Tabular Data Package is a simple specification for data access and delivery of tabular data.", 5 | "type": "object", 6 | "required": [ "name", "resources" ], 7 | "properties": { 8 | "name": { 9 | "$ref": "definitions.json#/define/name", 10 | "propertyOrder": 10 11 | }, 12 | "title": { 13 | "$ref": "definitions.json#/define/title", 14 | "propertyOrder": 20 15 | }, 16 | "description": { 17 | "$ref": "definitions.json#/define/description", 18 | "format": "textarea", 19 | "propertyOrder": 30 20 | }, 21 | "homepage": { 22 | "$ref": "definitions.json#/define/homepage", 23 | "propertyOrder": 40 24 | }, 25 | "version": { 26 | "$ref": "definitions.json#/define/version", 27 | "propertyOrder": 50 28 | }, 29 | "license": { 30 | "$ref": "definitions.json#/define/license", 31 | "propertyOrder": 60 32 | }, 33 | "author": { 34 | "$ref": "definitions.json#/define/author", 35 | "propertyOrder": 70 36 | }, 37 | "contributors": { 38 | "$ref": "definitions.json#/define/contributors", 39 | "propertyOrder": 80, 40 | "options": { "hidden": true } 41 | }, 42 | "resources": { 43 | "title": "Resources", 44 | "description": "The data resources that this package describes.", 45 | "type": "array", 46 | "propertyOrder": 90, 47 | "minItems": 0, 48 | "items": { 49 | "type": "object", 50 | "properties": { 51 | "name": { 52 | "$ref": "definitions.json#/define/name", 53 | "propertyOrder": 10 54 | }, 55 | "title": { 56 | "$ref": "definitions.json#/define/title", 57 | "propertyOrder": 20 58 | }, 59 | "description": { 60 | "$ref": "definitions.json#/define/description", 61 | "propertyOrder": 30, 62 | "format": "textarea" 63 | }, 64 | "schema": { 65 | "$ref": "definitions.json#/define/schema", 66 | "propertyOrder": 40 67 | }, 68 | "url": { 69 | "$ref": "definitions.json#/define/url", 70 | "propertyOrder": 50 71 | }, 72 | "path": { 73 | "$ref": "definitions.json#/define/path", 74 | "propertyOrder": 60 75 | }, 76 | "data": { 77 | "$ref": "definitions.json#/define/data", 78 | "propertyOrder": 70 79 | }, 80 | "format": { 81 | "$ref": "definitions.json#/define/format", 82 | "propertyOrder": 80 83 | }, 84 | "mediatype": { 85 | "$ref": "definitions.json#/define/mediatype", 86 | "propertyOrder": 90 87 | }, 88 | "encoding": { 89 | "$ref": "definitions.json#/define/encoding", 90 | "propertyOrder": 100 91 | }, 92 | "bytes": { 93 | "$ref": "definitions.json#/define/bytes", 94 | "propertyOrder": 110, 95 | "options": { "hidden": true } 96 | }, 97 | "hash": { 98 | "$ref": "definitions.json#/define/hash", 99 | "propertyOrder": 120, 100 | "options": { "hidden": true } 101 | }, 102 | "dialect": { 103 | "$ref": "definitions.json#/define/dialect", 104 | "propertyOrder": 130, 105 | "options": { "hidden": true } 106 | }, 107 | "sources": { 108 | "$ref": "definitions.json#/define/sources", 109 | "propertyOrder": 140, 110 | "options": { "hidden": true } 111 | }, 112 | "license": { 113 | "$ref": "definitions.json#/define/license", 114 | "description": "The license under which the resource is published.", 115 | "propertyOrder": 150, 116 | "options": { "hidden": true } 117 | } 118 | }, 119 | "anyOf": [ 120 | { "title": "url required", "required": ["url"] }, 121 | { "title": "path required", "required": ["path"] }, 122 | { "title": "data required", "required": ["data"] } 123 | ], 124 | "required": [ "schema" ] 125 | } 126 | }, 127 | "keywords": { 128 | "$ref": "definitions.json#/define/keywords", 129 | "propertyOrder": 100 130 | }, 131 | "sources": { 132 | "$ref": "definitions.json#/define/sources", 133 | "propertyOrder": 110, 134 | "options": { "hidden": true } 135 | }, 136 | "image": { 137 | "$ref": "definitions.json#/define/image", 138 | "propertyOrder": 120, 139 | "options": { "hidden": true } 140 | }, 141 | "dataDependencies": { 142 | "$ref": "definitions.json#/define/dataDependencies", 143 | "propertyOrder": 140, 144 | "options": { "hidden": true } 145 | } 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 17 |
18 | 20 |
21 |
22 |
23 | 27 | 28 | -------------------------------------------------------------------------------- /mocks/fileMock.js: -------------------------------------------------------------------------------- 1 | module.exports = 'test-file-stub'; 2 | -------------------------------------------------------------------------------- /mocks/styleMock.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dpr-js", 3 | "version": "1.0.0", 4 | "description": "Steps:", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "babel-node tools/build.js", 8 | "open:src": "babel-node tools/srcServer.js", 9 | "lint": "esw webpack.config.* src tools --color", 10 | "lint:watch": "npm run lint -- --watch", 11 | "test": "node_modules/.bin/jest", 12 | "test:travis": "npm run test && cat ./coverage/lcov.info | node_modules/coveralls/bin/coveralls.js", 13 | "test:watch": "npm run test -- --watch", 14 | "start": "npm-run-all --parallel open:src lint:watch" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git+https://github.com/anuveyatsu/dpr-js.git" 19 | }, 20 | "author": "", 21 | "license": "ISC", 22 | "jest": { 23 | "moduleNameMapper": { 24 | "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/mocks/fileMock.js", 25 | "\\.(css|less)$": "/mocks/styleMock.js" 26 | }, 27 | "transform": { 28 | ".*": "/node_modules/babel-jest" 29 | }, 30 | "moduleFileExtensions": [ 31 | "es6", 32 | "js", 33 | "jsx" 34 | ], 35 | "collectCoverage": true, 36 | "verbose": true, 37 | "testRegex": "(/tests/.*).jsx?$", 38 | "globals": { 39 | "DP_ID": "" 40 | }, 41 | "unmockedModulePathPatterns": [ 42 | "react", 43 | "plotly.js" 44 | ] 45 | }, 46 | "bugs": { 47 | "url": "https://github.com/anuveyatsu/dpr-js/issues" 48 | }, 49 | "homepage": "https://github.com/anuveyatsu/dpr-js#readme", 50 | "devDependencies": { 51 | "autoprefixer": "6.5.4", 52 | "babel-cli": "6.18.0", 53 | "babel-core": "^6.20.0", 54 | "babel-eslint": "7.1.1", 55 | "babel-jest": "^20.0.3", 56 | "babel-loader": "^6.2.9", 57 | "babel-plugin-react-display-name": "2.0.0", 58 | "babel-plugin-react-transform": "2.0.0", 59 | "babel-plugin-transform-async-to-generator": "^6.16.0", 60 | "babel-plugin-transform-react-constant-elements": "6.9.1", 61 | "babel-plugin-transform-react-remove-prop-types": "0.2.11", 62 | "babel-plugin-transform-runtime": "6.4.3", 63 | "babel-polyfill": "^6.20.0", 64 | "babel-preset-es2015": "^6.18.0", 65 | "babel-preset-latest": "6.16.0", 66 | "babel-preset-react": "^6.16.0", 67 | "babel-preset-react-hmre": "1.1.1", 68 | "babel-preset-stage-0": "^6.17.0", 69 | "browser-sync": "2.18.5", 70 | "chalk": "1.1.3", 71 | "connect-history-api-fallback": "1.3.0", 72 | "coveralls": "2.11.15", 73 | "cross-env": "3.1.3", 74 | "css-loader": "0.26.1", 75 | "dotenv": "4.0.0", 76 | "enzyme": "^2.7.0", 77 | "enzyme-to-json": "^1.5.0", 78 | "eslint": "3.12.2", 79 | "eslint-config-airbnb": "14.1.0", 80 | "eslint-plugin-import": "2.2.0", 81 | "eslint-plugin-jsx-a11y": "3.0.2", 82 | "eslint-plugin-react": "6.8.0", 83 | "eslint-watch": "2.1.14", 84 | "extract-text-webpack-plugin": "1.0.1", 85 | "file-loader": "0.9.0", 86 | "html-webpack-plugin": "2.24.1", 87 | "isparta": "4.0.0", 88 | "istanbul": "0.4.5", 89 | "jest": "^20.0.4", 90 | "json-loader": "^0.5.4", 91 | "moment-timezone": "0.5.11", 92 | "nock": "^9.0.2", 93 | "npm-run-all": "3.1.2", 94 | "postcss-loader": "1.2.1", 95 | "react-addons-test-utils": "^15.4.1", 96 | "react-test-renderer": "^15.4.1", 97 | "replace": "0.3.0", 98 | "sinon": "^1.17.7", 99 | "style-loader": "0.13.1", 100 | "webpack": "^1.14.0", 101 | "webpack-bundle-analyzer": "2.1.1", 102 | "webpack-dev-middleware": "1.9.0", 103 | "webpack-hot-middleware": "2.13.2", 104 | "webpack-md5-hash": "0.0.5" 105 | }, 106 | "dependencies": { 107 | "datapackage": "^1.1.0", 108 | "datapackage-render": "git+https://github.com/frictionlessdata/datapackage-render-js.git", 109 | "handsontable": "^0.29.2", 110 | "isomorphic-fetch": "2.2.1", 111 | "leaflet": "^1.3.3", 112 | "lodash": "^4.0.0", 113 | "plotly.js": "^1.21.2", 114 | "react": "^16.2.0", 115 | "react-copy-to-clipboard": "^5.0.1", 116 | "react-dom": "16.0.0", 117 | "react-hover": "^1.3.2", 118 | "react-spinkit": "^2.1.1", 119 | "tableschema": "1.7.0", 120 | "vega": "^3.0.5", 121 | "vega-embed": "^2.2.0", 122 | "vega-lite": "^1.3.1" 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /src/components/dataPackageView/HandsOnTable.jsx: -------------------------------------------------------------------------------- 1 | import urllib from 'url' 2 | 3 | import React, { PropTypes } from 'react' 4 | import Handsontable from 'handsontable' 5 | const Spinner = require('react-spinkit') 6 | import {CopyToClipboard} from 'react-copy-to-clipboard' 7 | import ReactHover from 'react-hover' 8 | 9 | class HandsOnTable extends React.Component { 10 | 11 | constructor(props) { 12 | super(props) 13 | this.state = { 14 | hot: null, 15 | hoverText: 'Copy to clipboard' 16 | } 17 | } 18 | 19 | componentDidMount() { 20 | // Create and bind Handsontable when the container component triggers update 21 | let hot = new Handsontable(document.getElementById(`hTable${this.props.idx}`), this.props.spec) 22 | this.setState({ 23 | hot: hot 24 | }) 25 | } 26 | 27 | componentWillUpdate(nextProps) { 28 | // Update Handsontable when new props are received 29 | if(this.state.hot) { 30 | this.state.hot.updateSettings(nextProps.spec) 31 | } 32 | } 33 | 34 | copied() { 35 | this.setState({ 36 | hoverText: 'Copied!' 37 | }) 38 | setTimeout(() => { 39 | this.setState({ 40 | hoverText: 'Copy to clipboard' 41 | }) 42 | }, 1500) 43 | } 44 | 45 | render() { 46 | const divId = `hTable${this.props.idx}` 47 | const windowHref = window.location.href 48 | const windowHrefParts = urllib.parse(windowHref) 49 | const baseUrl = windowHrefParts.protocol + '//' + windowHrefParts.host 50 | + windowHrefParts.path.split('/').slice(0,3).join('/') + '/' 51 | const viewPath = `r/${this.props.idx - 1}.html` 52 | let sharedUrl = urllib.resolve(baseUrl, viewPath) 53 | // If base url is a full URL (with /v/ revision number) then convert it to params: 54 | if (windowHref.match(/\/[^/]+\/[^/]+\/v\/[0-9]+/)) { 55 | const revision = parseInt(windowHrefParts.path.split('/')[4]) 56 | sharedUrl += `?v=${revision}` 57 | } 58 | const iframe = `` 59 | const tracker = `watermark-${baseUrl}` 60 | const homePagePath = `https://datahub.io?source=${tracker}` 61 | const optionsCursorTrueWithMargin = { 62 | followCursor: true, 63 | shiftX: -5, 64 | shiftY: 20 65 | } 66 | 67 | return ( 68 |
69 | { this.props.spec.viewTitle &&

{this.props.spec.viewTitle}

} 70 |
71 | 72 | Share: 73 | 74 | 75 | 76 | this.copied()}> 78 | 81 | 82 | 83 | 84 | {this.state.hoverText} 85 | 86 | 87 | 88 | Embed: 89 | 90 | 91 | 92 | this.copied()}> 94 | 97 | 98 | 99 | 100 | {this.state.hoverText} 101 | 102 | 103 | 104 |
105 |
106 | { !this.props.spec.data && } 107 |
108 |
109 | Powered by ❒ 110 | 111 | DataHub 112 | 113 |
114 |
115 | ) 116 | } 117 | } 118 | // HandsOnTable.propTypes = { 119 | // idx: PropTypes.string.required, 120 | // spec: PropTypes.object 121 | // }; 122 | 123 | export default HandsOnTable 124 | -------------------------------------------------------------------------------- /src/components/dataPackageView/LeafletMap.jsx: -------------------------------------------------------------------------------- 1 | import urllib from 'url' 2 | 3 | import React from 'react' 4 | import Leaf, { geoJSON } from 'leaflet' 5 | import {CopyToClipboard} from 'react-copy-to-clipboard' 6 | import ReactHover from 'react-hover' 7 | 8 | class LeafletMap extends React.Component { 9 | 10 | constructor(props) { 11 | super(props) 12 | this.state = { 13 | hoverText: 'Copy to clipboard' 14 | } 15 | } 16 | 17 | componentWillUpdate(nextProps) { 18 | // update the plot with new props 19 | this.render_map(nextProps.featureCollection) 20 | } 21 | 22 | componentDidMount() { 23 | this.render_map(this.props.featureCollection) 24 | } 25 | 26 | render_map(collection){ 27 | if ( collection !== undefined) { 28 | const map = Leaf.map(document.getElementById(`leaflet${this.props.idx}`) 29 | , { layers: new Leaf.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png') 30 | } 31 | ) 32 | const geojson = Leaf.geoJSON(collection) 33 | // Find the bound of the geojson return LatLngBounds 34 | const bounds = geojson.getBounds() 35 | // Find the center of the LatLngBounds returns LatLng 36 | const center = bounds.getCenter() 37 | // Change the map's view 38 | map.setView(center, 4) 39 | geojson.addTo(map) 40 | } 41 | } 42 | 43 | copied() { 44 | this.setState({ 45 | hoverText: 'Copied!' 46 | }) 47 | setTimeout(() => { 48 | this.setState({ 49 | hoverText: 'Copy to clipboard' 50 | }) 51 | }, 1500) 52 | } 53 | 54 | render() { 55 | const divId = `leaflet${this.props.idx}` 56 | const windowHref = window.location.href 57 | const windowHrefParts = urllib.parse(windowHref) 58 | const baseUrl = windowHrefParts.protocol + '//' + windowHrefParts.host 59 | + windowHrefParts.path.split('/').slice(0,3).join('/') + '/' 60 | const viewPath = `r/${this.props.idx - 1}.html` 61 | let sharedUrl = urllib.resolve(baseUrl, viewPath) 62 | // If base url is a full URL (with /v/ revision number) then convert it to params: 63 | if (windowHref.match(/\/[^/]+\/[^/]+\/v\/[0-9]+/)) { 64 | const revision = parseInt(windowHrefParts.path.split('/')[4]) 65 | sharedUrl += `?v=${revision}` 66 | } 67 | const iframe = `` 68 | const tracker = `watermark-${baseUrl}` 69 | const homePagePath = `https://datahub.io?source=${tracker}` 70 | const optionsCursorTrueWithMargin = { 71 | followCursor: true, 72 | shiftX: -5, 73 | shiftY: 20 74 | } 75 | 76 | return ( 77 |
78 |
79 | 80 | Share: 81 | 82 | 83 | 84 | this.copied()}> 86 | 89 | 90 | 91 | 92 | {this.state.hoverText} 93 | 94 | 95 | 96 | Embed: 97 | 98 | 99 | 100 | this.copied()}> 102 | 105 | 106 | 107 | 108 | {this.state.hoverText} 109 | 110 | 111 | 112 |
113 |
114 |
115 | Powered by ❒ 116 | 117 | DataHub 118 | 119 |
120 |
121 | ) 122 | } 123 | } 124 | 125 | 126 | export default LeafletMap 127 | -------------------------------------------------------------------------------- /src/components/dataPackageView/PlotlyChart.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Plotly from 'plotly.js/lib/core' 3 | const Spinner = require('react-spinkit') 4 | 5 | Plotly.register([ 6 | require('plotly.js/lib/bar') 7 | ]) 8 | 9 | class PlotlyChart extends React.Component { 10 | 11 | constructor(props) { 12 | super(props) 13 | } 14 | 15 | componentDidMount() { 16 | // draw a plot with initial data and layout 17 | Plotly.newPlot(`plotly${this.props.idx}`, this.props.data, this.props.layout) 18 | } 19 | 20 | componentDidUpdate() { 21 | // update the plot with new props 22 | Plotly.newPlot(`plotly${this.props.idx}`, this.props.data, this.props.layout) 23 | } 24 | 25 | render() { 26 | const divId = `plotly${this.props.idx}` 27 | return ( 28 |
29 | { !this.props.data && } 30 |
31 | ) 32 | } 33 | 34 | } 35 | 36 | export default PlotlyChart 37 | -------------------------------------------------------------------------------- /src/components/dataPackageView/VegaChart.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | const vega = require('vega') 3 | const Spinner = require('react-spinkit') 4 | 5 | class VegaChart extends React.Component { 6 | 7 | constructor(props) { 8 | super(props) 9 | } 10 | 11 | componentDidMount() { 12 | // draw a vega chart with initial data and spec 13 | if(this.props.spec) { 14 | const runtime = vega.parse(this.props.spec) 15 | const view = new vega.View(runtime) 16 | .logLevel(vega.Warn) 17 | .initialize(document.querySelector(`#vega${this.props.idx}`)) 18 | .renderer('svg') 19 | .hover() 20 | .run() 21 | } 22 | } 23 | 24 | componentDidUpdate() { 25 | // update the vega chart with new props 26 | if(this.props.spec) { 27 | const runtime = vega.parse(this.props.spec) 28 | const view = new vega.View(runtime) 29 | .logLevel(vega.Warn) 30 | .initialize(document.querySelector(`#vega${this.props.idx}`)) 31 | .renderer('svg') 32 | .hover() 33 | .run() 34 | } 35 | } 36 | 37 | render() { 38 | const divId = `vega${this.props.idx}` 39 | return ( 40 |
41 | { !this.props.spec && } 42 |
43 | ) 44 | } 45 | 46 | } 47 | 48 | export default VegaChart 49 | -------------------------------------------------------------------------------- /src/components/dataPackageView/VegaLiteChart.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import embed from 'vega-embed' 3 | 4 | class VegaLiteChart extends React.Component { 5 | 6 | constructor(props) { 7 | super(props) 8 | } 9 | 10 | componentDidMount() { 11 | embed( 12 | `#vega${this.props.idx}`, 13 | { 14 | mode: 'vega-lite' 15 | , spec: this.props.vlSpec 16 | , actions: false 17 | } 18 | ) 19 | } 20 | 21 | render() { 22 | const divId = `vega${this.props.idx}` 23 | return ( 24 |
25 | ) 26 | } 27 | } 28 | 29 | export default VegaLiteChart 30 | -------------------------------------------------------------------------------- /src/containers/MultiViews.jsx: -------------------------------------------------------------------------------- 1 | import urllib from 'url' 2 | 3 | import React, { PropTypes } from 'react' 4 | import {CopyToClipboard} from 'react-copy-to-clipboard' 5 | import ReactHover from 'react-hover' 6 | 7 | import * as dprender from 'datapackage-render' 8 | import PlotlyChart from '../components/dataPackageView/PlotlyChart' 9 | import VegaChart from '../components/dataPackageView/VegaChart' 10 | import HandsOnTable from '../components/dataPackageView/HandsOnTable' 11 | 12 | export class MultiViews extends React.Component { 13 | constructor(props) { 14 | super(props) 15 | // TODO: what is the point of state? Why not just use props? 16 | this.state = { 17 | // we stub some basic fields to ensure render works ... 18 | dataPackage: this.props.dataPackage, 19 | hoverText: 'Copy to clipboard', 20 | index: this.props.idx 21 | } 22 | } 23 | 24 | copied() { 25 | this.setState({ 26 | hoverText: 'Copied!' 27 | }) 28 | setTimeout(() => { 29 | this.setState({ 30 | hoverText: 'Copy to clipboard' 31 | }) 32 | }, 1500) 33 | } 34 | 35 | 36 | render() { 37 | let dp = this.state.dataPackage 38 | let viewComponents 39 | if(dp.views) { 40 | viewComponents = dp.views.map((view, idx) => { 41 | // check if the view is not a preview 42 | if (!view.datahub || !(view.datahub.type === 'preview')) { 43 | // first let's fix up recline views ... 44 | if (view.type == 'Graph') { // it's a recline view 45 | view = dprender.convertReclineToSimple(view) 46 | } 47 | let compiledView = dprender.compileView(view, dp) 48 | let readyView 49 | let firstValue = {} 50 | let lastValue = {} 51 | let change, changeInPercentage 52 | let period = typeof(PERIOD) === 'undefined' ? 'CHANGE' : PERIOD 53 | if(compiledView.resources[0]._values) { 54 | firstValue = compiledView.resources[0]._values[0] 55 | lastValue = compiledView.resources[0]._values[compiledView.resources[0]._values.length-1] 56 | change = ((lastValue.value || lastValue[1]) - (firstValue.value || firstValue[1])).toFixed(2) 57 | changeInPercentage = (change / (firstValue.value || firstValue[1]) * 100).toFixed(2) 58 | } 59 | switch (view.specType) { 60 | case 'simple': // convert to plotly then render 61 | let spec = {} 62 | if(compiledView.resources[0]._values) { 63 | spec = dprender.simpleToPlotly(compiledView) 64 | } 65 | readyView = 66 | break 67 | case 'vega': // render VegaChart 68 | let vegaSpec = dprender.vegaToVega(compiledView) 69 | readyView = 70 | break 71 | case 'table': // render handsontable 72 | let htSpec = dprender.handsOnTableToHandsOnTable(compiledView) 73 | return 74 | } 75 | const windowHref = window.location.href 76 | const windowHrefParts = urllib.parse(windowHref) 77 | const baseUrl = windowHrefParts.protocol + '//' + windowHrefParts.host 78 | + windowHrefParts.path.split('/').slice(0,3).join('/') + '/' 79 | const viewPath = `view/${idx}` 80 | let sharedUrl = urllib.resolve(baseUrl, viewPath) 81 | // If base url is a full URL (with /v/ revision number) then convert it to params: 82 | if (windowHref.match(/\/[^/]+\/[^/]+\/v\/[0-9]+/)) { 83 | const revision = parseInt(windowHrefParts.path.split('/')[4]) 84 | sharedUrl += `?v=${revision}` 85 | } 86 | const iframe = `` 87 | let pathToDataset = dp.datahub ? `https://datahub.io/${dp.datahub.owner}/${dp.name}` : 'https://datahub.io' 88 | const tracker = `watermark-${baseUrl}` 89 | pathToDataset += `?source=${tracker}` 90 | const homePagePath = `https://datahub.io?source=${tracker}` 91 | const optionsCursorTrueWithMargin = { 92 | followCursor: true, 93 | shiftX: -5, 94 | shiftY: 20 95 | } 96 | 97 | return ( 98 |
99 |
100 |
101 |
102 |

{lastValue.value || lastValue[1]}

103 |

{"GLOBAL CO₂ LEVEL"}

104 |
105 |
106 |

{change}

107 |

{period}

108 |
109 |
110 |

{changeInPercentage + '%'}

111 |

{period + " (%)"}

112 |
113 |
114 |
115 | {readyView} 116 |
117 | 118 | {dp.name} 119 | 120 | powered by ❒ 121 | 122 | DataHub 123 | 124 |
125 |
126 | 127 | Share: 128 | 129 | 130 | 131 | this.copied()}> 133 | 136 | 137 | 138 | 139 | {this.state.hoverText} 140 | 141 | 142 | 143 | Embed: 144 | 145 | 146 | 147 | this.copied()}> 149 | 152 | 153 | 154 | 155 | {this.state.hoverText} 156 | 157 | 158 | 159 |
160 |
161 | ) 162 | } 163 | }) 164 | } 165 | return
{viewComponents}
166 | } 167 | } 168 | 169 | export default MultiViews 170 | -------------------------------------------------------------------------------- /src/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import lodash from 'lodash' 4 | import {Package, Resource} from 'datapackage' 5 | import '../node_modules/handsontable/dist/handsontable.full.min.css' 6 | import HandsOnTable from './components/dataPackageView/HandsOnTable' 7 | import MultiViews from "./containers/MultiViews"; // eslint-disable-line 8 | import LeafletMap from './components/dataPackageView/LeafletMap' 9 | import * as dputils from './utils/datapackage' 10 | import * as dprender from 'datapackage-render' 11 | 12 | 13 | /** 14 | * From the back-end we expect a template to have div elements with specific 15 | * class, data-type and data-resource attributes: 16 | * 17 | * - To tell a front-end that a given div element is for React component, it 18 | * should have class=react-me. 19 | * - To tell a front-end which component to render in that div element, it 20 | * should provide data-type attribute - resource-preview for HandsOnTable and 21 | * data-views for the graphs. 22 | * - To tell a front-end which resource to render, it should provide 23 | * data-resource attirbute with index of resource or name. 24 | * - Also any properties can be passed from the back-end using data-* prefix. 25 | */ 26 | 27 | let dpObj 28 | 29 | const divElements = document.querySelectorAll('.react-me') 30 | const divElementsForViews = [] 31 | const divElementsForPreviews = [] 32 | const normalViews = [] 33 | const previewViews = [] 34 | divElements.forEach(element => { 35 | if (element.dataset.type === 'data-views') { 36 | divElementsForViews.push(element) 37 | } else if (element.dataset.type === 'resource-preview') { 38 | divElementsForPreviews.push(element) 39 | } 40 | }) 41 | 42 | fetchDpAndResourcesAndRenderViews(DP_ID, divElements) 43 | 44 | async function fetchDpAndResourcesAndRenderViews(dataPackageIdentifier, divElements) { 45 | let basePath 46 | if (lodash.isString(dataPackageIdentifier)) { 47 | basePath = dataPackageIdentifier.replace('datapackage.json', '') 48 | } else if (lodash.isPlainObject(dataPackageIdentifier)) { 49 | basePath = dataPackageIdentifier.path 50 | } 51 | dpObj = await Package.load(dataPackageIdentifier, {basePath, strict: false}) 52 | 53 | dpObj.descriptor.resources = dpObj.resources.map(resource => resource.descriptor) 54 | // Split out normal and preview views 55 | if (dpObj.descriptor.views) { 56 | dpObj.descriptor.views.forEach(view => { 57 | if (!view.datahub) { 58 | normalViews.push(view) 59 | } else if (view.datahub.type === 'preview') { 60 | previewViews.push(view) 61 | } 62 | }) 63 | } 64 | // Identify which resources are needed for normal views 65 | const resourcesForNormalViews = [] 66 | const resourcesForPreviewViews = [] 67 | normalViews.forEach(view => { 68 | if (view.resources) { 69 | view.resources.forEach(res => { 70 | let resourceForView, idx 71 | if (lodash.isString(res)) { 72 | resourceForView = dprender.findResourceByNameOrIndex(dpObj.descriptor, res) 73 | idx = dpObj.descriptor.resources.indexOf(resourceForView) 74 | } else if (lodash.isPlainObject(res)) { 75 | resourceForView = dprender.findResourceByNameOrIndex(dpObj.descriptor, res.name) 76 | idx = dpObj.descriptor.resources.indexOf(resourceForView) 77 | } else if (lodash.isNumber(res)) { 78 | idx = res 79 | } 80 | resourcesForNormalViews.push(idx) 81 | }) 82 | } else { 83 | resourcesForNormalViews.push(0) 84 | } 85 | }) 86 | // Render preview views for which derived/preview versions exist. 87 | // If not exist then identify corresponding normal resource. 88 | previewViews.forEach(view => { 89 | let previewResourceFound = false 90 | const resourceForPreview = dprender.findResourceByNameOrIndex(dpObj.descriptor, view.resources[0]) 91 | const idx = dpObj.descriptor.resources.indexOf(resourceForPreview) 92 | if (resourceForPreview.alternates) { 93 | resourceForPreview.alternates.forEach(async res => { 94 | if (res.datahub.type === 'derived/preview') { 95 | previewResourceFound = true 96 | res = await Resource.load(res) 97 | res.descriptor._values = await dputils.fetchDataOnly(res) 98 | renderView(view, res.descriptor, idx, dpObj.descriptor) 99 | } 100 | }) 101 | } 102 | if (!previewResourceFound) { 103 | resourcesForPreviewViews.push(idx) 104 | } 105 | }) 106 | // Also add resources that have 'geojson' format to 'resourcesForPreviewViews' list: 107 | dpObj.descriptor.resources.forEach((res, idx) => { 108 | if (res.format === 'geojson') { 109 | resourcesForPreviewViews.push(idx) 110 | } 111 | }) 112 | // Concatenate required resources for normal and preview views. 113 | // Get only unique values. 114 | let requiredResources = resourcesForNormalViews.concat(resourcesForPreviewViews) 115 | requiredResources = [...new Set(requiredResources)] // Unique values 116 | // Load required resources and render views 117 | await Promise.all(requiredResources.map(async idx => { 118 | dpObj.resources[idx].descriptor._values = await dputils.fetchDataOnly(dpObj.resources[idx]) 119 | if (resourcesForNormalViews.includes(idx)) { 120 | renderView('view', dpObj.resources[idx].descriptor, null, dpObj.descriptor) 121 | } 122 | if (resourcesForPreviewViews.includes(idx)) { 123 | renderView('preview', dpObj.resources[idx].descriptor, idx, dpObj.descriptor) 124 | } 125 | })) 126 | } 127 | 128 | function renderView (view, resource, idx, dp) { 129 | if (view === 'preview' || (view.datahub && view.datahub.type === 'preview')) { 130 | if (resource.format === 'geojson') { 131 | ReactDOM.render(, divElementsForPreviews[idx]) 132 | } else if (resource.format !== 'topojson') { 133 | let compiledViewSpec = { 134 | resources: [resource], 135 | specType: 'handsontable' 136 | } 137 | let spec = dprender.handsOnTableToHandsOnTable(compiledViewSpec) 138 | ReactDOM.render(, divElementsForPreviews[idx]); 139 | } 140 | } else { 141 | if (divElementsForViews.length > 1) { 142 | // Render each view in a specific div element. A view index should be 143 | // equal to div element index: 144 | normalViews.forEach((view, index) => { 145 | dp.views = [view].concat(previewViews) 146 | ReactDOM.render(, divElementsForViews[index]) 147 | }) 148 | } else { 149 | // We'll render all graphs in the single div element: 150 | ReactDOM.render(, divElementsForViews[0]) 151 | } 152 | } 153 | } 154 | 155 | exports.renderView = renderView 156 | exports.fetchDpAndResourcesAndRenderViews = fetchDpAndResourcesAndRenderViews 157 | -------------------------------------------------------------------------------- /src/utils/datapackage.js: -------------------------------------------------------------------------------- 1 | import fetch from 'isomorphic-fetch' 2 | const Datapackage = require('datapackage').Datapackage 3 | const {Table} = require('tableschema') 4 | const {cloneDeep} = require('lodash') 5 | 6 | 7 | export async function fetchDataOnly(resource) { 8 | if (resource.descriptor.format && resource.descriptor.format.includes('json')) { 9 | if (resource.inline) { 10 | return resource.descriptor.data 11 | } else { 12 | const response = await fetch(resource.source) 13 | return await response.json() 14 | } 15 | } else { 16 | // Check if data is inlined - this helps us to resolve unavailable in browser functions 17 | let source 18 | if (resource.inline) { 19 | source = resource.descriptor.data 20 | } else { 21 | source = resource.source 22 | } 23 | // Instantiate table object and return rows as arrays 24 | // Don't cast values for 'array', 'object' and 'yearmonth' types because 25 | // we want to render them as raw values + casted values rendered incorrectly: 26 | const tempSchema = cloneDeep(resource.descriptor.schema) 27 | tempSchema.fields.map(field => { 28 | const dateType = ['array', 'object', 'yearmonth'] 29 | if (dateType.includes(field.type)) { 30 | field.type = 'string' 31 | } 32 | return field 33 | }) 34 | const table = await Table.load(source, {schema: tempSchema}) 35 | return await table.read() 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/components/dataPackageView/__snapshots__/reactvirtualized.test.jsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`ReactVirtualized component should match the snapshot - with data 1`] = ` 4 | 28 | 40 | 52 | 64 |
65 | `; 66 | 67 | exports[`ReactVirtualized component should match the snapshot - without data 1`] = ` 68 | 92 | 104 | 116 | 128 |
129 | `; 130 | -------------------------------------------------------------------------------- /tests/components/dataPackageView/handsontable.test.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { shallow } from 'enzyme' 3 | import HandsOnTable from '../../../src/components/dataPackageView/HandsOnTable' 4 | 5 | const mockSpec = { 6 | data: [ 7 | ['', 'Ford', 'Volvo', 'Toyota', 'Honda'] 8 | , ['2016', 10, 11, 12, 13] 9 | , ['2017', 20, 11, 14, 13] 10 | , ['2018', 30, 15, 12, 13] 11 | ] 12 | , colHeaders: true 13 | } 14 | 15 | describe('handsontable component', () => { 16 | it('should receive correct props and render div with specific id', () => { 17 | const idx = 0 18 | const wrapper = shallow() 19 | expect(wrapper.instance().props.idx).toEqual(0) 20 | expect(wrapper.instance().props.spec.data[0][1]).toEqual('Ford') 21 | expect(wrapper.html()).toEqual(`
`) 22 | }) 23 | }) 24 | -------------------------------------------------------------------------------- /tests/components/dataPackageView/leafletmap.test.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { shallow } from 'enzyme' 3 | import LeafletMap from '../../../src/components/dataPackageView/LeafletMap' 4 | 5 | const mockSpec = { 6 | features: [ 7 | { 8 | type: 'Feature' 9 | , geometry: { 10 | type: 'Point' 11 | , coordinates: [ 12 | 20.522875 13 | , 51.070292 14 | ] 15 | } 16 | , properties: { 17 | id: 1 18 | , 'marker-size': 'small' 19 | , 'marker-color': '#f5a91a' 20 | , 'marker-symbol': 'b' 21 | } 22 | } 23 | ] 24 | , type: 'FeatureCollection' 25 | } 26 | 27 | describe('leafletmap component', () => { 28 | it('should receive correct props and render div with specific id', () => { 29 | const idx = 0 30 | const wrapper = shallow() 31 | expect(wrapper.instance().props.idx).toEqual(0) 32 | expect(wrapper.html()).toEqual(`
`) 33 | }) 34 | }) 35 | -------------------------------------------------------------------------------- /tests/components/dataPackageView/plotly.test.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { shallow, mount } from 'enzyme' 3 | import PlotlyChart from '../../../src/components/dataPackageView/PlotlyChart' 4 | import sinon from 'sinon' 5 | import Plotly from 'plotly.js/lib/core' 6 | 7 | Plotly.newPlot = jest.fn() 8 | 9 | const mockData = [{ 10 | x: [ 11 | '2014-01-01T18:00:00.000Z' 12 | , '2014-01-02T18:00:00.000Z' 13 | , '2014-01-05T18:00:00.000Z' 14 | ] 15 | , y: [14.23, 13.76, 13.55] 16 | , mode: 'lines' 17 | , name: 'DEMOClose' 18 | }] 19 | 20 | const mockLayout = { layout: { xaxis: { title: 'Date' } } } 21 | 22 | describe('plotly chart module', () => { 23 | it('should receive correct props and render div with specific id', () => { 24 | const idx = 0 25 | const wrapper = shallow() 26 | expect(wrapper.instance().props.idx).toEqual(0) 27 | expect(wrapper.instance().props.data).toEqual(mockData) 28 | expect(wrapper.instance().props.layout).toEqual(mockLayout) 29 | 30 | expect(wrapper.html()).toEqual(`
`) 31 | }) 32 | }) 33 | 34 | describe('how plotly mounts and updates', () => { 35 | it('should call didMount and didUpdate methods after the component renders and re-renders', () => { 36 | const didMount = sinon.spy(PlotlyChart.prototype, 'componentDidMount') 37 | const didUpdate = sinon.spy(PlotlyChart.prototype, 'componentDidUpdate') 38 | const render = sinon.spy(PlotlyChart.prototype, 'render') 39 | let data, layout = undefined 40 | const idx = 0 41 | const wrapper = mount() 42 | expect(didMount.calledAfter(render)).toBeTruthy() 43 | expect(didMount.calledOnce).toBeTruthy() 44 | expect(didUpdate.calledOnce).toBeFalsy() 45 | 46 | wrapper.setProps({ data: mockData, layout: mockLayout }) 47 | expect(didUpdate.calledAfter(render)).toBeTruthy() 48 | expect(didUpdate.calledOnce).toBeTruthy() 49 | expect(wrapper.props().data[0].y[0]).toEqual(14.23) 50 | }) 51 | }) 52 | -------------------------------------------------------------------------------- /tests/components/dataPackageView/reactvirtualized.test.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { shallow } from 'enzyme' 3 | import toJson from 'enzyme-to-json' 4 | 5 | import ReactVirtualized from '../../../src/components/dataPackageView/ReactVirtualized' 6 | 7 | const mockSpec = { 8 | data: [ 9 | { 10 | "Date": "2014-01-01", 11 | "High": 14.59, 12 | "Open": 14.32 13 | }, 14 | { 15 | "Date": "2014-01-02", 16 | "High": 14.22, 17 | "Open": 14.06 18 | }, 19 | { 20 | "Date": "2014-01-05", 21 | "High": 14, 22 | "Open": 13.41 23 | } 24 | ] 25 | , headers: [ 26 | 'Date' 27 | , 'Open' 28 | , 'High' 29 | ] 30 | , width: 1136 31 | , height: 30 * 3 + 20 32 | , headerHeight: 20 33 | , rowHeight: 30 34 | , rowCount: 3 35 | , "columnWidth": 378.6666666666667 36 | } 37 | 38 | const mockSpecNoData = { 39 | data: undefined 40 | , headers: [ 41 | 'Date' 42 | , 'Open' 43 | , 'High' 44 | ] 45 | , width: 1136 46 | , height: 20 47 | , headerHeight: 20 48 | , rowHeight: 30 49 | , rowCount: 0 50 | , "columnWidth": 378.6666666666667 51 | } 52 | 53 | describe('ReactVirtualized component', () => { 54 | it('should match the snapshot - with data', () => { 55 | const wrapper = shallow() 56 | expect(toJson(wrapper)).toMatchSnapshot() 57 | }) 58 | 59 | it('should match the snapshot - without data', () => { 60 | const wrapper = shallow() 61 | expect(toJson(wrapper)).toMatchSnapshot() 62 | }) 63 | }) 64 | -------------------------------------------------------------------------------- /tests/components/dataPackageView/vega.test.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { shallow, mount } from 'enzyme' 3 | import toJson from 'enzyme-to-json' 4 | import VegaChart from '../../../src/components/dataPackageView/VegaChart' 5 | import sinon from 'sinon' 6 | import vg from 'vega' 7 | 8 | vg.parse.spec = jest.fn() 9 | 10 | const mockSpec = { 11 | "width": 400, 12 | "height": 200, 13 | "axes": [], 14 | "marks": [], 15 | "scales": [], 16 | "data": [ 17 | { 18 | "name": "demo-resource", 19 | "values": [ 20 | { 21 | "Date": "2014-01-01", 22 | "High": 14.59, 23 | "Open": 14.32, 24 | }, 25 | { 26 | "Date": "2014-01-02", 27 | "High": 14.22, 28 | "Open": 14.06, 29 | }, 30 | { 31 | "Date": "2014-01-05", 32 | "High": 14, 33 | "Open": 13.41, 34 | }, 35 | ], 36 | }, 37 | ] 38 | } 39 | 40 | describe('vega chart component', () => { 41 | it('should receive correct props and render div with specific id', () => { 42 | const idx = 0 43 | const wrapper = shallow() 44 | expect(wrapper.instance().props.idx).toEqual(0) 45 | expect(wrapper.instance().props.spec).toEqual(mockSpec) 46 | 47 | expect(wrapper.html()).toEqual(`
`) 48 | }) 49 | }) 50 | 51 | describe('how vega mounts and updates', () => { 52 | 53 | it('should call didMount and didUpdate methods after the component renders and re-renders', () => { 54 | const didMount = sinon.spy(VegaChart.prototype, 'componentDidMount') 55 | const didUpdate = sinon.spy(VegaChart.prototype, 'componentDidUpdate') 56 | const render = sinon.spy(VegaChart.prototype, 'render') 57 | delete mockSpec.data[0].values 58 | const idx = 0 59 | const wrapper = mount() 60 | expect(didMount.calledAfter(render)).toBeTruthy() 61 | expect(didMount.calledOnce).toBeTruthy() 62 | expect(didUpdate.calledOnce).toBeFalsy() 63 | mockSpec.data[0].values = [ 64 | { 65 | "Date": "2014-01-01", 66 | "High": 14.59, 67 | "Open": 14.32, 68 | }, 69 | { 70 | "Date": "2014-01-02", 71 | "High": 14.22, 72 | "Open": 14.06, 73 | }, 74 | { 75 | "Date": "2014-01-05", 76 | "High": 14, 77 | "Open": 13.41, 78 | }, 79 | ] 80 | wrapper.setProps({ spec: mockSpec }) 81 | expect(didUpdate.calledAfter(render)).toBeTruthy() 82 | expect(didUpdate.calledOnce).toBeTruthy() 83 | expect(wrapper.props().spec.data[0].values[0]["High"]).toEqual(14.59) 84 | }) 85 | 86 | }) 87 | -------------------------------------------------------------------------------- /tests/components/dataPackageView/vegaLite.test.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { mount } from 'enzyme' 3 | import sinon from 'sinon' 4 | import VegaLiteChart from '../../../src/components/dataPackageView/VegaLiteChart' 5 | 6 | const mockSpec = { 7 | data: { 8 | values: [ 9 | { 10 | Date: '2014-01-01T18:00:00.000Z' 11 | , DEMOOpen: 14.32 12 | , DEMOHigh: 14.59 13 | , DEMOLow: 14 14 | , DEMOClose: 14.23 15 | } 16 | , { 17 | Date: '2014-01-02T18:00:00.000Z' 18 | , DEMOOpen: 14.06 19 | , DEMOHigh: 14.22 20 | , DEMOLow: 13.57 21 | , DEMOClose: 13.76 22 | } 23 | ] 24 | } 25 | , layers: [ 26 | { 27 | mark: 'line' 28 | , encoding: { 29 | x: { field: 'Date', type: 'temporal' } 30 | , y: { field: 'DEMOClose', type: 'quantitative' } 31 | } 32 | } 33 | ] 34 | } 35 | 36 | describe('vegaLite chart module', () => { 37 | it('should receive correct props and render div with specific id', () => { 38 | const idx = 0 39 | const spy = sinon.spy(VegaLiteChart.prototype, 'componentDidMount') 40 | const wrapper = mount() 41 | expect(spy.calledOnce).toEqual(true) 42 | expect(wrapper.html()).toEqual(`
`) 43 | expect(wrapper.prop('idx')).toEqual(0) 44 | expect(wrapper.prop('vlSpec')).toEqual(mockSpec) 45 | }) 46 | }) 47 | -------------------------------------------------------------------------------- /tests/containers/MultiViews.test.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { shallow } from 'enzyme' 3 | import toJson from 'enzyme-to-json' 4 | 5 | import { MultiViews } from '../../src/containers/MultiViews' 6 | 7 | const mockDescriptor = { 8 | name: 'demo-package' 9 | , resources: [ 10 | { 11 | name: 'demo-resource' 12 | , path: 'data/demo-resource.csv' 13 | , format: 'csv' 14 | , mediatype: 'text/csv' 15 | , schema: { 16 | fields: [ 17 | { 18 | name: 'Date' 19 | , type: 'date' 20 | , description: '' 21 | } 22 | , { 23 | name: 'Open' 24 | , type: 'number' 25 | , description: '' 26 | } 27 | , { 28 | name: 'High' 29 | , type: 'number' 30 | , description: '' 31 | } 32 | ] 33 | , primaryKey: 'Date' 34 | } 35 | , _values: [ 36 | ['2014-01-01', 14.32, 14.59] 37 | , ['2014-01-02', 14.06, 14.22] 38 | , ['2014-01-05', 13.41, 14.00] 39 | ] 40 | } 41 | ] 42 | , views: [ 43 | { 44 | id: 'Graph' 45 | , type: 'Graph' 46 | , state: { 47 | graphType: 'lines' 48 | , group: 'Date' 49 | , series: ['High'] 50 | } 51 | } 52 | , { 53 | name: 'graph' 54 | , specType: 'simple' 55 | , spec: { 56 | type: 'line' 57 | , group: 'Date' 58 | , series: ['High'] 59 | } 60 | } 61 | , { 62 | name: 'vega-graph' 63 | , specType: 'vega' 64 | , spec: { 65 | width: 400 66 | , height: 200 67 | , scales: [] 68 | , axes: [] 69 | , marks: [] 70 | } 71 | } 72 | , { 73 | name: 'table' 74 | , specType: 'table' 75 | } 76 | ] 77 | } 78 | 79 | describe('MultiViews Container', () => { 80 | it('should render 3 charts + 1 table', () => { 81 | const wrapper = shallow() 82 | expect(toJson(wrapper)).toMatchSnapshot() 83 | }) 84 | 85 | it('should render 2 PlotlyChart components and 1 VegaChart component', () => { 86 | mockDescriptor.views.splice(-1, 1) 87 | const wrapper = shallow() 88 | expect(toJson(wrapper)).toMatchSnapshot() 89 | }) 90 | 91 | it('should render empty PlotlyChart / VegaChart if there is no data yet', () => { 92 | delete mockDescriptor.resources[0]._values 93 | const wrapper = shallow() 94 | expect(toJson(wrapper)).toMatchSnapshot() 95 | }) 96 | 97 | it('should NOT render PlotlyChart / VegaChart if there is no views given', () => { 98 | delete mockDescriptor.views 99 | const wrapper = shallow() 100 | expect(toJson(wrapper)).toMatchSnapshot() 101 | }) 102 | }) 103 | -------------------------------------------------------------------------------- /tests/containers/__snapshots__/MultiViews.test.jsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`MultiViews Container should NOT render PlotlyChart / VegaChart if there is no views given 1`] = `
`; 4 | 5 | exports[`MultiViews Container should render 2 PlotlyChart components and 1 VegaChart component 1`] = ` 6 |
7 | 47 | 87 | 121 |
122 | `; 123 | 124 | exports[`MultiViews Container should render 3 charts + 1 table 1`] = ` 125 |
126 | 166 | 206 | 240 | 288 |
289 | `; 290 | 291 | exports[`MultiViews Container should render empty PlotlyChart / VegaChart if there is no data yet 1`] = ` 292 |
293 | 296 | 299 | 302 |
303 | `; 304 | -------------------------------------------------------------------------------- /tests/index.test.jsx: -------------------------------------------------------------------------------- 1 | import index from '../src/index' 2 | import ReactDOM from 'react-dom' 3 | import MultiViews from '../src/containers/MultiViews' 4 | import HandsOnTable from '../src/components/dataPackageView/HandsOnTable' 5 | import LeafletMap from '../src/components/dataPackageView/LeafletMap' 6 | import nock from 'nock' 7 | import * as dprender from 'datapackage-render' 8 | 9 | 10 | const mock = nock('https://dp-vix-resource-and-view.com/_v/latest') 11 | .persist() 12 | .get('/datapackage.json') 13 | .replyWithFile(200, './fixtures/dp-vix-resource-and-view/datapackage.json') 14 | .get('/data/demo-resource.csv') 15 | .replyWithFile(200, './fixtures/dp-vix-resource-and-view/data/demo-resource.csv') 16 | 17 | const mock1 = nock('https://example-geojson.com/_v/latest') 18 | .persist() 19 | .get('/datapackage.json') 20 | .replyWithFile(200, './fixtures/example-geojson/datapackage.json') 21 | .get('/data/example.geojson') 22 | .replyWithFile(200, './fixtures/example-geojson/data/example.geojson') 23 | 24 | 25 | describe('how renderView method works', () => { 26 | ReactDOM.render = jest.fn() 27 | afterEach(() => { 28 | ReactDOM.render.mockClear() 29 | }) 30 | 31 | it('should render MultiViews if view/datahub/type is not preview', () => { 32 | const view = {name: 'normal-view'} 33 | const resource = {} 34 | const idx = null 35 | const dp = {name: 'test'} 36 | index.renderView(view, resource, idx, dp) 37 | expect(ReactDOM.render.mock.calls[0][0].type).toEqual(MultiViews) 38 | expect(ReactDOM.render.mock.calls[0][0].props).toEqual({"dataPackage": {"name": "test"}}) 39 | }) 40 | 41 | it('should render HandsOnTable if view/datahub/type is preview', () => { 42 | dprender.handsOnTableToHandsOnTable = jest.fn(() => 'hTspec') 43 | const view = {name: 'preview', datahub: {type: 'preview'}} 44 | const resource = {} 45 | const idx = 1 46 | const dp = {} 47 | index.renderView(view, resource, idx, dp) 48 | expect(ReactDOM.render.mock.calls[0][0].type).toEqual(HandsOnTable) 49 | expect(ReactDOM.render.mock.calls[0][0].props).toEqual({"idx": 1, "spec": "hTspec"}) 50 | }) 51 | 52 | // it('should render LeafletMap if element data-type=resource-preview and format=geojson', () => { 53 | // dprender.findResourceByNameOrIndex = jest.fn(() => { 54 | // return {format: 'geojson', _values: 'values'} 55 | // }) 56 | // const divForResourcePreview = {dataset: {type: "resource-preview", resource: "0"}} 57 | // index.renderComponentInElement(divForResourcePreview) 58 | // expect(ReactDOM.render.mock.calls.length).toEqual(3) 59 | // expect(ReactDOM.render.mock.calls[2][0].type).toEqual(LeafletMap) 60 | // expect(ReactDOM.render.mock.calls[2][0].props).toEqual({featureCollection: 'values', idx: 0}) 61 | // expect(ReactDOM.render.mock.calls[2][1]).toEqual(divForResourcePreview) 62 | // }) 63 | }) 64 | 65 | // describe('how incrementally loading happens', () => { 66 | // it('should render first time after dp is fetched and second time when data is fetched', async () => { 67 | // index.renderComponentInElement = jest.fn() 68 | // const dpUrl = 'https://dp-vix-resource-and-view.com/_v/latest/datapackage.json' 69 | // const divForDataView = {dataset: {type: "view"}} 70 | // const divForResourcePreview = {dataset: {type: "resource"}} 71 | // await index.fetchDataPackageAndDataIncrementally(dpUrl, [divForDataView, divForResourcePreview]) 72 | // // there are 1 view and 1 resource - each one renders twice 73 | // expect(index.renderComponentInElement.mock.calls.length).toEqual(4) 74 | // expect(index.renderComponentInElement.mock.calls[0][0]).toEqual(divForDataView) 75 | // expect(index.renderComponentInElement.mock.calls[1][0]).toEqual(divForResourcePreview) 76 | // expect(index.renderComponentInElement.mock.calls[2][0]).toEqual(divForDataView) 77 | // expect(index.renderComponentInElement.mock.calls[3][0]).toEqual(divForResourcePreview) 78 | // }) 79 | // }) 80 | // 81 | // describe('render page for geojson data package', () => { 82 | // it('should render if no view component in datapackage', async () => { 83 | // index.renderComponentInElement = jest.fn() 84 | // const dpUrl = 'https://example-geojson.com/_v/latest/datapackage.json' 85 | // const divForDataView = {dataset: {type: "view"}} 86 | // const divForResourcePreview = {dataset: {type: "resource"}} 87 | // await index.fetchDataPackageAndDataIncrementally(dpUrl, [divForDataView, divForResourcePreview]) 88 | // // there are only 1 resource - this one renders twice and render blank view div once 89 | // expect(index.renderComponentInElement.mock.calls.length).toEqual(4) 90 | // expect(index.renderComponentInElement.mock.calls[0][0]).toEqual(divForDataView) 91 | // expect(index.renderComponentInElement.mock.calls[1][0]).toEqual(divForResourcePreview) 92 | // expect(index.renderComponentInElement.mock.calls[2][0]).toEqual(divForDataView) 93 | // expect(index.renderComponentInElement.mock.calls[3][0]).toEqual(divForResourcePreview) 94 | // }) 95 | // }) 96 | -------------------------------------------------------------------------------- /tests/utils/datapackage.test.js: -------------------------------------------------------------------------------- 1 | import moment from 'moment-timezone' 2 | import nock from 'nock' 3 | 4 | import * as utils from '../../src/utils/datapackage' 5 | 6 | const Datapackage = require('datapackage').Datapackage 7 | 8 | 9 | const mock1 = nock('http://bit.do/datapackage-json') 10 | .persist() 11 | .get('') 12 | .replyWithFile(200, './fixtures/dp-inline-data/datapackage.json') 13 | 14 | const mock2 = nock('https://dp-vix-resource-and-view.com') 15 | .persist() 16 | .get('/datapackage.json') 17 | .replyWithFile(200, './fixtures/dp-vix-resource-and-view/datapackage.json') 18 | .get('/data/demo-resource.csv') 19 | .replyWithFile(200, './fixtures/dp-vix-resource-and-view/data/demo-resource.csv') 20 | 21 | const mock3 = nock('http://schemas.datapackages.org') 22 | .persist() 23 | .get('/registry.json') 24 | .replyWithFile(200, './fixtures/schemas/registry.json') 25 | .get('/data-package.json') 26 | .replyWithFile(200, './fixtures/schemas/data-package.json') 27 | .get('/tabular-data-package.json') 28 | .replyWithFile(200, './fixtures/schemas/tabular-data-package.json') 29 | .get('/fiscal-data-package.json') 30 | .replyWithFile(200, './fixtures/schemas/fiscal-data-package.json') 31 | 32 | const mock4 = nock('https://geo-json-resource-and-view.com') 33 | .persist() 34 | .get('/datapackage.json') 35 | .replyWithFile(200, './fixtures/example-geojson/datapackage.json') 36 | .get('/data/example.geojson') 37 | .replyWithFile(200, './fixtures/example-geojson/data/example.geojson') 38 | 39 | const mock5 = nock('https://topo-json-resource-and-view.com') 40 | .persist() 41 | .get('/datapackage.json') 42 | .replyWithFile(200, './fixtures/example-topojson/datapackage.json') 43 | .get('/data/example.json') 44 | .replyWithFile(200, './fixtures/example-topojson/data/example.json') 45 | 46 | const mock6 = nock('https://dp-resource-with-no-format.com') 47 | .persist() 48 | .get('/datapackage.json') 49 | .replyWithFile(200, './fixtures/example-no-format/datapackage.json') 50 | .get('/data/cities-month.csv') 51 | .replyWithFile(200, './fixtures/example-no-format/data/cities-month.csv') 52 | 53 | 54 | describe('fetch data only', () => { 55 | it('takes a resource and fetches data', async () => { 56 | const descriptor = 'https://dp-vix-resource-and-view.com/datapackage.json' 57 | const dp = await new Datapackage(descriptor) 58 | const resource = dp.resources[0] 59 | const values = await utils.fetchDataOnly(resource) 60 | expect(values[0][1]).toEqual(14.32) 61 | }) 62 | 63 | it('should get topojson data', async () => { 64 | const dpUrl = 'https://topo-json-resource-and-view.com/datapackage.json' 65 | const dp = await new Datapackage(dpUrl) 66 | const resource = dp.resources[0] 67 | const values = await utils.fetchDataOnly(resource) 68 | expect(dp.descriptor.title).toEqual('Example TopoJSON Data Package') 69 | expect(dp.resources.length).toEqual(1) 70 | expect(values.type).toEqual("Topology") 71 | }) 72 | 73 | it('if there is no format it should assume it is a tabular data', async () => { 74 | const descriptor = 'https://dp-resource-with-no-format.com/datapackage.json' 75 | const dp = await new Datapackage(descriptor) 76 | const resource = dp.resources[0] 77 | const values = await utils.fetchDataOnly(resource) 78 | expect(dp.resources[0]._descriptor.schema.fields.length).toEqual(24) 79 | }) 80 | }) 81 | -------------------------------------------------------------------------------- /tools/analyzeBundle.js: -------------------------------------------------------------------------------- 1 | import webpack from 'webpack' 2 | import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' 3 | import config from '../webpack.config.prod' 4 | 5 | config.plugins.push(new BundleAnalyzerPlugin()) 6 | 7 | const compiler = webpack(config) 8 | 9 | compiler.run((error, stats) => { 10 | if (error) { 11 | throw new Error(error) 12 | } 13 | 14 | console.log(stats) // eslint-disable-line no-console 15 | }) 16 | -------------------------------------------------------------------------------- /tools/build.js: -------------------------------------------------------------------------------- 1 | // More info on Webpack's Node API here: https://webpack.github.io/docs/node.js-api.html 2 | // Allowing console calls below since this is a build file. 3 | /* eslint-disable no-console */ 4 | import webpack from 'webpack' 5 | import config from '../webpack.config.prod' 6 | import { chalkError, chalkSuccess, chalkWarning, chalkProcessing } from './chalkConfig' 7 | 8 | process.env.NODE_ENV = 'production' // this assures React is built in prod mode and that the Babel dev config doesn't apply. 9 | 10 | console.log(chalkProcessing('Generating minified bundle. This will take a moment...')) 11 | 12 | webpack(config).run((error, stats) => { 13 | if (error) { // so a fatal error occurred. Stop here. 14 | console.log(chalkError(error)) 15 | return 1 16 | } 17 | 18 | const jsonStats = stats.toJson() 19 | 20 | if (jsonStats.hasErrors) { 21 | return jsonStats.errors.map(error => console.log(chalkError(error))) 22 | } 23 | 24 | if (jsonStats.hasWarnings) { 25 | console.log(chalkWarning('Webpack generated the following warnings: ')) 26 | jsonStats.warnings.map(warning => console.log(chalkWarning(warning))) 27 | } 28 | 29 | console.log(`Webpack stats: ${stats}`) 30 | 31 | // if we got this far, the build succeeded. 32 | console.log(chalkSuccess('Your app is compiled in production mode in /dist. It\'s ready to roll!')) 33 | 34 | return 0 35 | }) 36 | -------------------------------------------------------------------------------- /tools/chalkConfig.js: -------------------------------------------------------------------------------- 1 | // Centralized configuration for chalk, which is used to add color to console.log statements. 2 | import chalk from 'chalk' 3 | export const chalkError = chalk.red 4 | export const chalkSuccess = chalk.green 5 | export const chalkWarning = chalk.yellow 6 | export const chalkProcessing = chalk.blue 7 | -------------------------------------------------------------------------------- /tools/distServer.js: -------------------------------------------------------------------------------- 1 | // This file configures a web server for testing the production build 2 | // on your local machine. 3 | 4 | import browserSync from 'browser-sync'; 5 | import historyApiFallback from 'connect-history-api-fallback'; 6 | import {chalkProcessing} from './chalkConfig'; 7 | 8 | /* eslint-disable no-console */ 9 | 10 | console.log(chalkProcessing('Opening production build...')); 11 | 12 | // Run Browsersync 13 | browserSync({ 14 | port: 4000, 15 | ui: { 16 | port: 4001 17 | }, 18 | server: { 19 | baseDir: 'dist' 20 | }, 21 | 22 | files: [ 23 | 'src/*.html' 24 | ], 25 | 26 | middleware: [historyApiFallback()] 27 | }); 28 | -------------------------------------------------------------------------------- /tools/nodeVersionCheck.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var exec = require('child_process').exec; 3 | 4 | exec('node -v', function (err, stdout) { 5 | if (err) throw err; 6 | 7 | if (parseFloat(stdout.slice(1)) < 4) { 8 | throw new Error('React Slingshot requires node 4.0 or greater.'); 9 | } 10 | }); -------------------------------------------------------------------------------- /tools/removeDemo.js: -------------------------------------------------------------------------------- 1 | // This script removes demo app files 2 | import rimraf from 'rimraf' 3 | import fs from 'fs' 4 | import { chalkSuccess } from './chalkConfig' 5 | 6 | /* eslint-disable no-console */ 7 | 8 | const pathsToRemove = [ 9 | './src/actions/*' 10 | , './src/utils' 11 | , './src/components/*' 12 | , './src/constants/*' 13 | , './src/containers/*' 14 | , './src/images' 15 | , './src/reducers/*' 16 | , './src/store/store.spec.js' 17 | , './src/styles' 18 | , './src/routes.js' 19 | , './src/index.js' 20 | , './tools/removeDemo.js' 21 | ] 22 | 23 | const filesToCreate = [ 24 | { 25 | path: './src/components/emptyTest.spec.js' 26 | , content: '// Must have at least one test file in this directory or Mocha will throw an error.' 27 | } 28 | , { 29 | path: './src/index.js' 30 | , content: '// Set up your application entry point here...' 31 | } 32 | , { 33 | path: './src/reducers/index.js' 34 | , content: '// Set up your root reducer here...\n import { combineReducers } from \'redux\';\n export default combineReducers;' 35 | } 36 | ] 37 | 38 | function removePath(path, callback) { 39 | rimraf(path, (error) => { 40 | if (error) throw new Error(error) 41 | callback() 42 | }) 43 | } 44 | 45 | function createFile(file) { 46 | fs.writeFile(file.path, file.content, (error) => { 47 | if (error) throw new Error(error) 48 | }) 49 | } 50 | 51 | function removePackageJsonScriptEntry(scriptName) { 52 | const packageJsonPath = './package.json' 53 | const fileData = fs.readFileSync(packageJsonPath) 54 | const content = JSON.parse(fileData) 55 | delete content.scripts[scriptName] 56 | fs.writeFileSync(packageJsonPath, 57 | `${JSON.stringify(content, null, 2)}\n`) 58 | } 59 | 60 | let numPathsRemoved = 0 61 | pathsToRemove.map((path) => { 62 | removePath(path, () => { 63 | numPathsRemoved++ 64 | if (numPathsRemoved === pathsToRemove.length) { // All paths have been processed 65 | // Now we can create files since we're done deleting. 66 | filesToCreate.map(file => createFile(file)) 67 | } 68 | }) 69 | }) 70 | 71 | removePackageJsonScriptEntry('remove-demo') 72 | 73 | console.log(chalkSuccess('Demo app removed.')) 74 | -------------------------------------------------------------------------------- /tools/srcServer.js: -------------------------------------------------------------------------------- 1 | // This file configures the development web server 2 | // which supports hot reloading and synchronized testing. 3 | 4 | // Require Browsersync along with webpack and middleware for it 5 | import browserSync from 'browser-sync' 6 | // Required for react-router browserHistory 7 | // see https://github.com/BrowserSync/browser-sync/issues/204#issuecomment-102623643 8 | import historyApiFallback from 'connect-history-api-fallback' 9 | import webpack from 'webpack' 10 | import webpackDevMiddleware from 'webpack-dev-middleware' 11 | import webpackHotMiddleware from 'webpack-hot-middleware' 12 | import config from '../webpack.config.dev' 13 | 14 | const bundler = webpack(config) 15 | 16 | // Run Browsersync and use middleware for Hot Module Replacement 17 | browserSync({ 18 | port: 3000 19 | , ui: { 20 | port: 3001 21 | } 22 | , server: { 23 | baseDir: 'src' 24 | 25 | , middleware: [ 26 | historyApiFallback() 27 | 28 | , webpackDevMiddleware(bundler, { 29 | // Dev middleware can't access config, so we provide publicPath 30 | publicPath: config.output.publicPath 31 | 32 | // These settings suppress noisy webpack output so only errors are displayed to the console. 33 | , noInfo: false 34 | , quiet: false 35 | , stats: { 36 | assets: false 37 | , colors: true 38 | , version: false 39 | , hash: false 40 | , timings: false 41 | , chunks: false 42 | , chunkModules: false 43 | } 44 | 45 | // for other settings see 46 | // http://webpack.github.io/docs/webpack-dev-middleware.html 47 | }) 48 | 49 | // bundler should be the same as above 50 | , webpackHotMiddleware(bundler) 51 | ] 52 | } 53 | 54 | // no need to watch '*.js' here, webpack will take care of it for us, 55 | // including full page reloads if HMR won't work 56 | , files: [ 57 | 'src/*.html' 58 | ] 59 | }) 60 | -------------------------------------------------------------------------------- /tools/startMessage.js: -------------------------------------------------------------------------------- 1 | import { chalkSuccess } from './chalkConfig' 2 | 3 | /* eslint-disable no-console */ 4 | 5 | console.log(chalkSuccess('Starting app in dev mode...')) 6 | -------------------------------------------------------------------------------- /tools/testSetup.js: -------------------------------------------------------------------------------- 1 | // Tests are placed alongside files under test. 2 | // This file does the following: 3 | // 1. Sets the environment to 'test' so that 4 | // dev-specific babel config in .babelrc doesn't run. 5 | // 2. Disables Webpack-specific features that Mocha doesn't understand. 6 | // 3. Registers babel for transpiling our code for testing. 7 | 8 | // This assures the .babelrc dev config (which includes 9 | // hot module reloading code) doesn't apply for tests. 10 | // Setting NODE_ENV to test instead of production because setting 11 | // it to production will suppress error messaging 12 | // and propType validation warnings. 13 | process.env.NODE_ENV = 'test'; 14 | 15 | // Disable webpack-specific features for tests since 16 | // Mocha doesn't know what to do with them. 17 | ['.css', '.scss', '.png', '.jpg'].forEach((ext) => { 18 | require.extensions[ext] = () => null 19 | }) 20 | 21 | // Register babel so that it will transpile ES6 to ES5 22 | // before our tests run. 23 | require('babel-register')() 24 | 25 | // Configure JSDOM and set global variables 26 | // to simulate a browser environment for tests. 27 | const jsdom = require('jsdom').jsdom 28 | 29 | const exposedProperties = ['window', 'navigator', 'document'] 30 | 31 | global.document = jsdom('') 32 | global.window = document.defaultView 33 | Object.keys(document.defaultView).forEach((property) => { 34 | if (typeof global[property] === 'undefined') { 35 | exposedProperties.push(property) 36 | global[property] = document.defaultView[property] 37 | } 38 | }) 39 | 40 | global.navigator = { 41 | userAgent: 'node.js' 42 | } 43 | 44 | documentRef = document // eslint-disable-line no-undef 45 | -------------------------------------------------------------------------------- /webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | import webpack from 'webpack' 2 | import HtmlWebpackPlugin from 'html-webpack-plugin' 3 | import autoprefixer from 'autoprefixer' 4 | import path from 'path' 5 | 6 | export default { 7 | resolveLoader: { 8 | root: path.join(__dirname, 'node_modules') 9 | } 10 | , resolve: { 11 | extensions: ['', '.js', '.jsx', '.json'] 12 | , alias: { 13 | handsontable: path.join(__dirname, 'node_modules/handsontable/dist/handsontable.full.js') 14 | } 15 | } 16 | , node: { 17 | fs: 'empty' 18 | } 19 | , debug: true 20 | , devtool: 'eval-source-map' // more info:https://webpack.github.io/docs/build-performance.html#sourcemaps and https://webpack.github.io/docs/configuration.html#devtool 21 | , noInfo: true // set to false to see a list of every file being bundled. 22 | , entry: [ 23 | 'babel-polyfill' 24 | // must be first entry to properly set public path 25 | , 'webpack-hot-middleware/client?reload=true' 26 | , path.resolve(__dirname, 'src/index.jsx') // Defining path seems necessary for this to work consistently on Windows machines. 27 | ] 28 | , target: 'web' // necessary per https://webpack.github.io/docs/testing.html#compile-and-test 29 | , output: { 30 | path: path.resolve(__dirname, 'app') // Note: Physical files are only output by the production build task `npm run build`. 31 | , publicPath: '/' 32 | , filename: 'static/dpr-js/dist/bundle.js' 33 | } 34 | , plugins: [ 35 | new webpack.DefinePlugin({ 36 | 'process.env.NODE_ENV': JSON.stringify('development') // Tells React to build in either dev or prod modes. https://facebook.github.io/react/downloads.html (See bottom) 37 | , __DEV__: true 38 | }) 39 | , new webpack.HotModuleReplacementPlugin() 40 | , new webpack.NoErrorsPlugin() 41 | , new HtmlWebpackPlugin({ 42 | template: 'index.html' 43 | , minify: { 44 | removeComments: true 45 | , collapseWhitespace: true 46 | } 47 | , inject: true 48 | }) 49 | ] 50 | , module: { 51 | loaders: [ 52 | { test: /\.jsx?$/, exclude: /node_modules/, loaders: ['babel'] } 53 | , { test: /\.css$/, loaders: ['style', 'css?sourceMap', 'postcss'] } 54 | , { test: /\.json$/, loader: 'json' } 55 | ] 56 | , noParse: [path.join(__dirname, 'node_modules/handsontable/dist/handsontable.full.js')] 57 | } 58 | , postcss: () => [autoprefixer] 59 | } 60 | -------------------------------------------------------------------------------- /webpack.config.prod.js: -------------------------------------------------------------------------------- 1 | // For info about this file refer to webpack and webpack-hot-middleware documentation 2 | // For info on how we're generating bundles with hashed filenames for cache busting: https://medium.com/@okonetchnikov/long-term-caching-of-static-assets-with-webpack-1ecb139adb95#.w99i89nsz 3 | import webpack from 'webpack' 4 | import ExtractTextPlugin from 'extract-text-webpack-plugin' 5 | import WebpackMd5Hash from 'webpack-md5-hash' 6 | import HtmlWebpackPlugin from 'html-webpack-plugin' 7 | import autoprefixer from 'autoprefixer' 8 | import path from 'path' 9 | 10 | require('dotenv').config() 11 | require('babel-polyfill') 12 | 13 | const GLOBALS = { 14 | 'process.env.NODE_ENV': JSON.stringify('production') 15 | , __DEV__: false 16 | } 17 | 18 | const SCRIPTS_PATH = 'dist' 19 | 20 | export default { 21 | resolve: { 22 | extensions: ['', '.js', '.jsx', '.json'] 23 | , alias: { 24 | handsontable: path.join(__dirname, 'node_modules/handsontable/dist/handsontable.full.js') 25 | } 26 | } 27 | , node: { 28 | fs: 'empty' 29 | } 30 | , debug: true 31 | , devtool: 'source-map' // more info:https://webpack.github.io/docs/build-performance.html#sourcemaps and https://webpack.github.io/docs/configuration.html#devtool 32 | , noInfo: true // set to false to see a list of every file being bundled. 33 | , entry: ['babel-polyfill', path.resolve(__dirname, 'src/index')] 34 | , target: 'web' // necessary per https://webpack.github.io/docs/testing.html#compile-and-test 35 | , output: { 36 | path: path.resolve(__dirname, SCRIPTS_PATH) 37 | , publicPath: '/static/dpr-js/dist' 38 | , pathInfo: true 39 | , filename: 'bundle.js' 40 | } 41 | , plugins: [ 42 | // Hash the files using MD5 so that their names change when the content changes. 43 | new WebpackMd5Hash() 44 | 45 | // Optimize the order that items are bundled. This assures the hash is deterministic. 46 | , new webpack.optimize.OccurenceOrderPlugin() 47 | 48 | // Tells React to build in prod mode. https://facebook.github.io/react/downloads.html 49 | , new webpack.DefinePlugin(GLOBALS) 50 | 51 | // Generate an external css file with a hash in the filename 52 | , new ExtractTextPlugin('[name].css') 53 | 54 | // Eliminate duplicate packages when generating bundle 55 | , new webpack.optimize.DedupePlugin() 56 | 57 | // Minify JS 58 | , new webpack.optimize.UglifyJsPlugin() 59 | ] 60 | , module: { 61 | loaders: [ 62 | { test: /\.jsx?$/, exclude: /node_modules/, loaders: ['babel'] } 63 | , { test: /\.css$/, loader: ExtractTextPlugin.extract('css?sourceMap!postcss?sourceMap') } 64 | , { test: /\.json$/, loader: 'json' } 65 | ] 66 | , noParse: [path.join(__dirname, 'node_modules/handsontable/dist/handsontable.full.js')] 67 | } 68 | , postcss: () => [autoprefixer] 69 | } 70 | --------------------------------------------------------------------------------