Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Merge branch 'wvmergetimeline' of https://github.com/nasa-gibs/worldview into redux-merge-with-timeline2

Benjamin Kingbe58691a3fb0
diff --cc package-lock.json
index 517e2dfd5,e5fd7249b..c09bec2ac
--- a/package-lock.json
+++ b/package-lock.json
@@@ -5261,9 -5234,14 +5234,14 @@@
"integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
"dev": true,
"requires": {
- "is-obj": "^1.0.0"
+ "is-obj": "1.0.1"
}
},
+ "double-ended-queue": {
+ "version": "2.1.0-0",
+ "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz",
+ "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw="
+ },
"duplexer": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
@@@ -5993,6 -5971,38 +5971,38 @@@
"ms": "0.7.2"
}
},
+ "finalhandler": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz",
+ "integrity": "sha1-AHrqM9Gk0+QgF/YkhIrVjSEvgU8=",
+ "dev": true,
+ "requires": {
+ "debug": "2.6.9",
- "encodeurl": "~1.0.1",
- "escape-html": "~1.0.3",
- "on-finished": "~2.3.0",
- "parseurl": "~1.3.2",
- "statuses": "~1.3.1",
- "unpipe": "~1.0.0"
++ "encodeurl": "1.0.2",
++ "escape-html": "1.0.3",
++ "on-finished": "2.3.0",
++ "parseurl": "1.3.2",
++ "statuses": "1.3.1",
++ "unpipe": "1.0.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
+ }
+ },
"ms": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz",
@@@ -6239,28 -6249,13 +6249,13 @@@
"integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==",
"dev": true,
"requires": {
- "is-number": "^2.1.0",
- "isobject": "^2.0.0",
- "randomatic": "^3.0.0",
- "repeat-element": "^1.1.2",
- "repeat-string": "^1.5.2"
+ "is-number": "2.1.0",
+ "isobject": "2.1.0",
+ "randomatic": "3.1.1",
+ "repeat-element": "1.1.3",
+ "repeat-string": "1.6.1"
}
},
- "finalhandler": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz",
- "integrity": "sha1-AHrqM9Gk0+QgF/YkhIrVjSEvgU8=",
- "dev": true,
- "requires": {
- "debug": "2.6.9",
- "encodeurl": "1.0.2",
- "escape-html": "1.0.3",
- "on-finished": "2.3.0",
- "parseurl": "1.3.2",
- "statuses": "1.3.1",
- "unpipe": "1.0.0"
- }
- },
"find-cache-dir": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz",
@@@ -6678,9 -6673,20 +6673,20 @@@
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
"dev": true,
"requires": {
- "asynckit": "^0.4.0",
- "combined-stream": "^1.0.6",
- "mime-types": "^2.1.12"
+ "asynckit": "0.4.0",
- "combined-stream": "1.0.7",
++ "combined-stream": "1.0.8",
+ "mime-types": "2.1.22"
+ },
+ "dependencies": {
+ "combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dev": true,
+ "requires": {
- "delayed-stream": "~1.0.0"
++ "delayed-stream": "1.0.0"
+ }
+ }
}
},
"formatio": {
@@@ -9671,9 -9696,69 +9677,69 @@@
"integrity": "sha1-BWp5UrP+pROsYqFAosNox52eYCM=",
"dev": true,
"requires": {
- "jest-mock": "^23.2.0",
- "jest-util": "^23.4.0",
- "jsdom": "^11.5.1"
+ "jest-mock": "23.2.0",
+ "jest-util": "23.4.0",
+ "jsdom": "11.12.0"
+ },
+ "dependencies": {
+ "acorn-globals": {
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.2.tgz",
+ "integrity": "sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ==",
+ "dev": true,
+ "requires": {
- "acorn": "^6.0.1",
- "acorn-walk": "^6.0.1"
++ "acorn": "6.1.1",
++ "acorn-walk": "6.1.1"
+ },
+ "dependencies": {
+ "acorn": {
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz",
+ "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==",
+ "dev": true
+ }
+ }
+ },
+ "jsdom": {
+ "version": "11.12.0",
+ "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz",
+ "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==",
+ "dev": true,
+ "requires": {
- "abab": "^2.0.0",
- "acorn": "^5.5.3",
- "acorn-globals": "^4.1.0",
- "array-equal": "^1.0.0",
- "cssom": ">= 0.3.2 < 0.4.0",
- "cssstyle": "^1.0.0",
- "data-urls": "^1.0.0",
- "domexception": "^1.0.1",
- "escodegen": "^1.9.1",
- "html-encoding-sniffer": "^1.0.2",
- "left-pad": "^1.3.0",
- "nwsapi": "^2.0.7",
++ "abab": "2.0.0",
++ "acorn": "5.7.3",
++ "acorn-globals": "4.3.2",
++ "array-equal": "1.0.0",
++ "cssom": "0.3.6",
++ "cssstyle": "1.2.1",
++ "data-urls": "1.1.0",
++ "domexception": "1.0.1",
++ "escodegen": "1.11.1",
++ "html-encoding-sniffer": "1.0.2",
++ "left-pad": "1.3.0",
++ "nwsapi": "2.1.1",
+ "parse5": "4.0.0",
- "pn": "^1.1.0",
- "request": "^2.87.0",
- "request-promise-native": "^1.0.5",
- "sax": "^1.2.4",
- "symbol-tree": "^3.2.2",
- "tough-cookie": "^2.3.4",
- "w3c-hr-time": "^1.0.1",
- "webidl-conversions": "^4.0.2",
- "whatwg-encoding": "^1.0.3",
- "whatwg-mimetype": "^2.1.0",
- "whatwg-url": "^6.4.1",
- "ws": "^5.2.0",
- "xml-name-validator": "^3.0.0"
++ "pn": "1.1.0",
++ "request": "2.88.0",
++ "request-promise-native": "1.0.7",
++ "sax": "1.2.4",
++ "symbol-tree": "3.2.2",
++ "tough-cookie": "2.5.0",
++ "w3c-hr-time": "1.0.1",
++ "webidl-conversions": "4.0.2",
++ "whatwg-encoding": "1.0.5",
++ "whatwg-mimetype": "2.3.0",
++ "whatwg-url": "6.5.0",
++ "ws": "5.2.2",
++ "xml-name-validator": "3.0.0"
+ }
+ },
+ "parse5": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz",
+ "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==",
+ "dev": true
+ }
}
},
"jest-environment-node": {
@@@ -9988,51 -10073,9 +10054,9 @@@
"resolved": "https://registry.npmjs.org/jscrollpane/-/jscrollpane-2.2.1.tgz",
"integrity": "sha512-F1Ao3mcR4vNzyB0LTpirfp+8joUlmqWAo/VL9Ha7vPmYBadI9QahpvddQY2LgTGEeoz41GYDNZdCsBVGyPSFjA==",
"requires": {
- "jquery": "3.x"
+ "jquery": "3.3.1"
}
},
- "jsdom": {
- "version": "11.12.0",
- "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz",
- "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==",
- "dev": true,
- "requires": {
- "abab": "2.0.0",
- "acorn": "5.7.3",
- "acorn-globals": "4.3.0",
- "array-equal": "1.0.0",
- "cssom": "0.3.6",
- "cssstyle": "1.2.1",
- "data-urls": "1.1.0",
- "domexception": "1.0.1",
- "escodegen": "1.11.1",
- "html-encoding-sniffer": "1.0.2",
- "left-pad": "1.3.0",
- "nwsapi": "2.1.1",
- "parse5": "4.0.0",
- "pn": "1.1.0",
- "request": "2.88.0",
- "request-promise-native": "1.0.7",
- "sax": "1.2.4",
- "symbol-tree": "3.2.2",
- "tough-cookie": "2.5.0",
- "w3c-hr-time": "1.0.1",
- "webidl-conversions": "4.0.2",
- "whatwg-encoding": "1.0.5",
- "whatwg-mimetype": "2.3.0",
- "whatwg-url": "6.5.0",
- "ws": "5.2.2",
- "xml-name-validator": "3.0.0"
- },
- "dependencies": {
- "parse5": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz",
- "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==",
- "dev": true
- }
- }
- },
"jsesc": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
@@@ -16994,12 -17037,12 +17018,10 @@@
}
},
"redux-location-state": {
-- "version": "2.4.0",
-- "resolved": "https://registry.npmjs.org/redux-location-state/-/redux-location-state-2.4.0.tgz",
-- "integrity": "sha512-uPcGNDbMz7Mnm0gfEkgOswc2OrXKSsNKhKYisHtEzx0mTUxnYPfLRWm7zNNHSerTAA5jhwoWiUxuW7Qn11MDcA==",
++ "version": "github:Benjaki2/redux-location-state#050ab73d5c76fa4a859a97bdf3911b773d90c4ea",
"dev": true,
"requires": {
- "lodash": "^4.13.1"
+ "lodash": "4.17.11"
}
},
"redux-logger": {
@@@ -17247,26 -17290,26 +17269,26 @@@
"integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
"dev": true,
"requires": {
- "aws-sign2": "~0.7.0",
- "aws4": "^1.8.0",
- "caseless": "~0.12.0",
- "combined-stream": "~1.0.6",
- "extend": "~3.0.2",
- "forever-agent": "~0.6.1",
- "form-data": "~2.3.2",
- "har-validator": "~5.1.0",
- "http-signature": "~1.2.0",
- "is-typedarray": "~1.0.0",
- "isstream": "~0.1.2",
- "json-stringify-safe": "~5.0.1",
- "mime-types": "~2.1.19",
- "oauth-sign": "~0.9.0",
- "performance-now": "^2.1.0",
- "qs": "~6.5.2",
- "safe-buffer": "^5.1.2",
- "tough-cookie": "~2.4.3",
- "tunnel-agent": "^0.6.0",
- "uuid": "^3.3.2"
+ "aws-sign2": "0.7.0",
+ "aws4": "1.8.0",
+ "caseless": "0.12.0",
- "combined-stream": "1.0.7",
++ "combined-stream": "1.0.8",
+ "extend": "3.0.2",
+ "forever-agent": "0.6.1",
+ "form-data": "2.3.3",
+ "har-validator": "5.1.3",
+ "http-signature": "1.2.0",
+ "is-typedarray": "1.0.0",
+ "isstream": "0.1.2",
+ "json-stringify-safe": "5.0.1",
+ "mime-types": "2.1.22",
+ "oauth-sign": "0.9.0",
+ "performance-now": "2.1.0",
+ "qs": "6.5.2",
+ "safe-buffer": "5.1.2",
+ "tough-cookie": "2.4.3",
+ "tunnel-agent": "0.6.0",
+ "uuid": "3.3.2"
},
"dependencies": {
"caseless": {
@@@ -17275,6 -17318,15 +17297,15 @@@
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
"dev": true
},
+ "combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "dev": true,
+ "requires": {
- "delayed-stream": "~1.0.0"
++ "delayed-stream": "1.0.0"
+ }
+ },
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
@@@ -23498,7 -23550,19 +23529,19 @@@
"integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==",
"dev": true,
"requires": {
- "async-limiter": "~1.0.0"
+ "async-limiter": "1.0.0"
+ },
+ "dependencies": {
+ "commander": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz",
+ "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E="
+ },
+ "nan": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/nan/-/nan-1.0.0.tgz",
+ "integrity": "sha1-riT4hQgY1mL8q1rPfzuVv6oszzg="
+ }
}
},
"x-is-string": {
diff --cc web/js/app.js
index 3388e691a,3711aea59..0c94873f7
--- a/web/js/app.js
+++ b/web/js/app.js
@@@ -17,15 -18,6 +19,15 @@@ import Brand from './brand'
// Crutch between state systems
import { updateLegacyInitComplete } from './modules/migration/actions';
+
+// actions
+// import { screenResize } from './modules/browser/actions';
+import { calculateResponsiveState } from 'redux-responsive';
+import Tour from './containers/tour';
- import AnimationWidget from './containers/animation-widget';
++// import AnimationWidget from './containers/animation-widget';
+import ErrorBoundary from './containers/error-boundary';
+import Debug from './components/util/debug';
+
// Dependency CSS
import '../../node_modules/bootstrap/dist/css/bootstrap.css';
import '../../node_modules/jquery-ui-bundle/jquery-ui.structure.css';
@@@ -85,7 -77,6 +87,7 @@@ class App extends React.Component
this.onload();
}
render() {
- const { config } = this.props;
++ // const { config } = this.props;
return (
<div className="wv-content" id="wv-content" data-role="content">
<Toolbar />
@@@ -104,100 -94,9 +106,15 @@@
id="timeline"
className="timeline-inner clearfix"
style={{ display: 'none' }}
- >
- <div id="timeline-header">
- <div id="date-selector-main" />
- <div id="zoom-buttons-group">
- <div id="zoom-btn-container">
- <span
- id="current-zoom"
- className="zoom-btn zoom-btn-active"
- data-zoom="3"
- >
- Days
- </span>
- <div className="wv-tooltip">
- <div id="timeline-zoom" className="timeline-zoom">
- <span
- id="zoom-years"
- className="zoom-btn zoom-btn-inactive zoom-years"
- data-zoom="1"
- >
- Years
- </span>
- <span
- id="zoom-months"
- className="zoom-btn zoom-btn-inactive zoom-months"
- data-zoom="2"
- >
- Months
- </span>
- <span
- id="zoom-days"
- className="zoom-btn zoom-btn-inactive zoom-days"
- data-zoom="3"
- >
- Days
- </span>
- <span
- id="zoom-minutes"
- className="zoom-btn zoom-btn-inactive zoom-minutes"
- data-zoom="4"
- >
- Minutes
- </span>
- </div>
- </div>
- </div>
- <div
- className="button-action-group"
- id="left-arrow-group"
- title="Click and hold to animate backwards"
- >
- <svg id="timeline-svg" width="24" height="30">
- <path
- d="M 10.240764,0 24,15 10.240764,30 0,30 13.759236,15 0,0 10.240764,0 z"
- className="arrow"
- />
- </svg>
- </div>
- <div
- className="button-action-group"
- id="right-arrow-group"
- title="Click and hold to animate forwards"
- >
- <svg width="24" height="30">
- <path
- d="M 10.240764,0 24,15 10.240764,30 0,30 13.759236,15 0,0 10.240764,0 z"
- className="arrow"
- />
- </svg>
- </div>
- </div>
- <div
- className="button-action-group animate-button"
- id="animate-button"
- title="Set up animation"
- >
- <i id="wv-animate" className="fas fa-video wv-animate" />
- </div>
- </div>
- <div id="timeline-footer">
- <div id="wv-animation-widet-case">
- {config.features.animation ? <AnimationWidget /> : ''}
- </div>
- </div>
- <div id="timeline-hide">
- <svg className="hamburger" width="10" height="9">
- <path d="M 0,0 0,1 10,1 10,0 0,0 z M 0,4 0,5 10,5 10,4 0,4 z M 0,8 0,9 10,9 10,8 0,8 z" />
- </svg>
- </div>
- </section>
- ></section>
++ />
<OlCoordinates mouseEvents={this.props.mapMouseEvents} />
++ <div id="wv-animation-widet-case">
++ {/* {config.features.animation ? <AnimationWidget /> : ''} */}
++ </div>
<Modal />
+ <ErrorBoundary>
+ <Debug parameters={this.props.parameters} />
+ </ErrorBoundary>
</div>
);
}
diff --cc web/js/combine-ui.js
index 22a1a93d8,072de9b3b..a0a6d7f25
--- a/web/js/combine-ui.js
+++ b/web/js/combine-ui.js
@@@ -1,25 -1,42 +1,14 @@@
import util from './util/util';
import { dateLabel } from './date/label';
--// compare
- // import { compareUi } from './compare/ui';
-import { compareUi } from './compare/ui';
-import { alertUi } from './alert/ui';
// Timeline
import dateWheels from './date/wheels';
import { timeline } from './date/timeline';
- import { timelineData } from './date/timeline-data';
- import { timelineConfig } from './date/config';
- import { timelineZoom } from './date/timeline-zoom';
- import { timelineTicks } from './date/timeline-ticks';
- import { timelinePick } from './date/timeline-pick';
- import { timelinePan } from './date/timeline-pan';
- import { timelineInput } from './date/timeline-input';
- import { timelineCompare } from './date/compare-picks';
-// import { timelineData } from './date/timeline-data';
-// import { timelineConfig } from './date/config';
-// import { timelineZoom } from './date/timeline-zoom';
-// import { timelineTicks } from './date/timeline-ticks';
-// import { timelinePick } from './date/timeline-pick';
-// import { timelinePan } from './date/timeline-pan';
-// import { timelineInput } from './date/timeline-input';
-// import { timelineCompare } from './date/compare-picks';
-// Tour
-import { tourUi } from './tour/ui';
-import { layersModal } from './layers/modal';
--import { layersActive } from './layers/active';
-import { layersOptions } from './layers/options';
-import { sidebarUi } from './sidebar/ui';
import { mapui } from './map/ui';
-import { MapRotate } from './map/rotation';
-import { MapRunningData } from './map/runningdata';
-import { mapLayerBuilder } from './map/layerbuilder';
-import { mapDateLineBuilder } from './map/datelinebuilder';
-import { mapPrecacheTile } from './map/precachetile';
import { mapAnimate } from './map/animate';
-import { dataUi } from './data/ui';
-import { animationUi } from './animation/ui';
-import { animationWidget } from './animation/widget';
-import { animationRangeSelect } from './animation/range-select';
-import { animationGif } from './animation/gif';
-// NaturalEvents
-import naturalEventsUI from './natural-events/ui';
-import naturalEventsRequest from './natural-events/request';
import { debugLayers } from './debug';
+import { dataUi } from './map/data/ui';
+import naturalEventsUI from './map/natural-events/ui';
/**
* Legacy UI Rendering
@@@ -53,22 -78,22 +42,22 @@@ export function combineUi(models, confi
}
function timelineInit() {
ui.timeline = timeline(models, config, ui);
- ui.timeline.data = timelineData(models, config, ui);
- ui.timeline.zoom = timelineZoom(models, config, ui);
- ui.timeline.ticks = timelineTicks(models, config, ui);
- ui.timeline.pick = timelinePick(models, config, ui);
- ui.timeline.pan = timelinePan(models, config, ui);
- ui.timeline.input = timelineInput(models, config, ui, store);
- ui.timeline.config = timelineConfig(models, config, ui);
+ // ui.timeline.data = timelineData(models, config, ui);
+ // ui.timeline.zoom = timelineZoom(models, config, ui);
+ // ui.timeline.ticks = timelineTicks(models, config, ui);
+ // ui.timeline.pick = timelinePick(models, config, ui);
+ // ui.timeline.pan = timelinePan(models, config, ui);
+ // ui.timeline.input = timelineInput(models, config, ui);
+ // ui.timeline.config = timelineConfig(models, config, ui);
if (config.features.animation) {
- ui.anim = {};
- ui.anim.rangeselect = animationRangeSelect(models, config, ui); // SETS STATE: NEEDS TO LOAD BEFORE ANIMATION WIDGET
- ui.anim.widget = animationWidget(models, config, ui);
- ui.anim.gif = animationGif(models, config, ui);
- ui.anim.ui = animationUi(models, ui);
+ // ui.anim = {};
+ // ui.anim.rangeselect = animationRangeSelect(models, config, ui); // SETS STATE: NEEDS TO LOAD BEFORE ANIMATION WIDGET
+ // ui.anim.widget = animationWidget(models, config, ui);
+ // ui.anim.gif = animationGif(models, config, ui);
+ // ui.anim.ui = animationUi(models, ui);
}
if (config.features.compare) {
- ui.timeline.compare = timelineCompare(models, config, ui);
+ // ui.timeline.compare = timelineCompare(models, config, ui);
}
ui.dateLabel = dateLabel(models);
diff --cc web/js/components/timeline/timeline.js
index 000000000,969ffe533..5d8fb5867
mode 000000,100644..100644
--- a/web/js/components/timeline/timeline.js
+++ b/web/js/components/timeline/timeline.js
@@@ -1,0 -1,323 +1,377 @@@
+ import React from 'react';
+ import PropTypes from 'prop-types';
+
+ import moment from 'moment';
+
+ import TimeScaleIntervalChange from './timeline-controls/interval-timescale-change';
+ import './timeline.css';
+ import TimelineAxis from './timeline-axis/timeline-axis';
+ import CustomIntervalSelectorWidget from './interval-selector/interval-selector';
+
+ import DateSelector from '../date-selector/date-selector';
+ import DateChangeArrows from './timeline-controls/date-change-arrows';
+ import AnimationButton from './timeline-controls/animation-button';
+
+ import AxisTimeScaleChange from './timeline-controls/axis-timescale-change';
+
+ // const timeUnitAbbreviations = {
+ // year: 'year',
+ // month: 'mon',
+ // day: 'day',
+ // hour: 'hour',
+ // minute: 'min'
+ // };
+
+ const timeScaleFromNumberKey = {
+ '0': 'custom',
+ '1': 'year',
+ '2': 'month',
+ '3': 'day',
+ '4': 'hour',
+ '5': 'minute'
+ };
+
+ const timeScaleToNumberKey = {
- 'custom': '0',
- 'year': '1',
- 'month': '2',
- 'day': '3',
- 'hour': '4',
- 'minute': '5'
++ custom: '0',
++ year: '1',
++ month: '2',
++ day: '3',
++ hour: '4',
++ minute: '5'
+ };
+
+ class Timeline extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ customSelected: '',
+ compareModeActive: '',
+ dateFormatted: '',
+ dateFormattedB: '',
+ axisWidth: '',
+ selectedDate: '',
+ changeDate: '',
+ timeScale: '',
+ incrementDate: '',
+ timeScaleChangeUnit: '',
+ intervalText: '',
+ customIntervalValue: '',
+ customIntervalZoomLevel: '',
+ intervalChangeAmt: '',
+ hasSubdailyLayers: '',
+ customIntervalModalOpen: false,
+ timelineHidden: false,
+ parentOffset: '',
+ timelineStartDateLimit: '',
+ timelineEndDateLimit: '',
+ leftArrowDisabled: '',
+ rightArrowDisabled: ''
+ };
+ }
+
+ updateDate = (date, selectionStr) => {
+ // console.log(date,selectionStr)
+ this.props.updateDate(date, selectionStr);
- }
++ };
+
+ // show/hide custom interval modal
+ toggleCustomIntervalModal = () => {
+ this.setState(prevState => ({
+ customIntervalModalOpen: !prevState.customIntervalModalOpen
+ }));
- }
++ };
+
+ // Change the timescale parent state
- changeTimeScale = (timeScaleNumber) => {
++ changeTimeScale = timeScaleNumber => {
+ if (this.state.timeScale !== timeScaleFromNumberKey[timeScaleNumber]) {
+ this.props.changeTimeScale(timeScaleNumber);
+ }
- }
++ };
+
+ // handle SET of custom time scale panel
+ setIntervalChangeUnit = (intervalValue, zoomLevel) => {
- this.props.setIntervalInput(intervalValue, zoomLevel)
- }
++ this.props.setIntervalInput(intervalValue, zoomLevel);
++ };
+
+ // handle SELECT of LEFT/RIGHT interval selection
- setTimeScaleIntervalChangeUnit = (intervalSelected, customSelected, openDialog) => {
++ setTimeScaleIntervalChangeUnit = (
++ intervalSelected,
++ customSelected,
++ openDialog
++ ) => {
+ let intervalChangeAmt;
+ if (intervalSelected === 'custom') {
+ intervalSelected = this.state.customIntervalZoomLevel;
+ intervalChangeAmt = this.state.customIntervalValue;
+ } else {
+ intervalChangeAmt = 1;
+ }
- this.props.setSelectedInterval(intervalSelected, intervalChangeAmt, customSelected, openDialog);
- }
++ this.props.setSelectedInterval(
++ intervalSelected,
++ intervalChangeAmt,
++ customSelected,
++ openDialog
++ );
++ };
+
+ // left/right arrows increment date
- incrementDate = (multiplier) => {
++ incrementDate = multiplier => {
+ let delta = this.state.customSelected ? this.state.intervalChangeAmt : 1;
- this.props.incrementDate(Number(delta * multiplier), this.state.timeScaleChangeUnit)
- }
++ this.props.incrementDate(
++ Number(delta * multiplier),
++ this.state.timeScaleChangeUnit
++ );
++ };
+
+ // checkLeftArrowDisabled
+ checkLeftArrowDisabled = () => {
- let { draggerSelected,
- dateFormatted,
- dateFormattedB,
- intervalChangeAmt,
- timeScaleChangeUnit,
- timelineStartDateLimit } = this.state;
++ let {
++ draggerSelected,
++ dateFormatted,
++ dateFormattedB,
++ intervalChangeAmt,
++ timeScaleChangeUnit,
++ timelineStartDateLimit
++ } = this.state;
+ let previousIncrementDate;
+ if (intervalChangeAmt && timeScaleChangeUnit) {
+ if (draggerSelected === 'selected') {
- previousIncrementDate = moment.utc(dateFormatted).subtract(intervalChangeAmt, timeScaleChangeUnit);
++ previousIncrementDate = moment
++ .utc(dateFormatted)
++ .subtract(intervalChangeAmt, timeScaleChangeUnit);
+ } else {
- previousIncrementDate = moment.utc(dateFormattedB).subtract(intervalChangeAmt, timeScaleChangeUnit);
++ previousIncrementDate = moment
++ .utc(dateFormattedB)
++ .subtract(intervalChangeAmt, timeScaleChangeUnit);
+ }
+ this.setState({
- leftArrowDisabled: previousIncrementDate.isSameOrBefore(timelineStartDateLimit)
- })
++ leftArrowDisabled: previousIncrementDate.isSameOrBefore(
++ timelineStartDateLimit
++ )
++ });
+ }
- }
++ };
+
+ // checkRightArrowDisabled
+ checkRightArrowDisabled = () => {
- let { draggerSelected,
++ let {
++ draggerSelected,
+ dateFormatted,
+ dateFormattedB,
+ intervalChangeAmt,
+ timeScaleChangeUnit,
- timelineEndDateLimit } = this.state;
++ timelineEndDateLimit
++ } = this.state;
+ let nextIncrementDate;
+ if (intervalChangeAmt && timeScaleChangeUnit) {
+ if (draggerSelected === 'selected') {
- nextIncrementDate = moment.utc(dateFormatted).add(intervalChangeAmt, timeScaleChangeUnit);
++ nextIncrementDate = moment
++ .utc(dateFormatted)
++ .add(intervalChangeAmt, timeScaleChangeUnit);
+ } else {
- nextIncrementDate = moment.utc(dateFormattedB).add(intervalChangeAmt, timeScaleChangeUnit);
++ nextIncrementDate = moment
++ .utc(dateFormattedB)
++ .add(intervalChangeAmt, timeScaleChangeUnit);
+ }
+ this.setState({
- rightArrowDisabled: nextIncrementDate.isSameOrAfter(timelineEndDateLimit)
- })
++ rightArrowDisabled: nextIncrementDate.isSameOrAfter(
++ timelineEndDateLimit
++ )
++ });
+ }
- }
++ };
+
+ // open animation dialog
+ clickAnimationButton = () => {
+ this.props.clickAnimationButton();
- }
++ };
+
+ // toggle hide timeline
+ toggleHideTimeline = () => {
- this.setState({
- timelineHidden: !this.state.timelineHidden
- }, this.props.toggleHideTimeline());
- }
++ this.setState(
++ {
++ timelineHidden: !this.state.timelineHidden
++ },
++ this.props.toggleHideTimeline()
++ );
++ };
+
+ componentDidMount() {
+ this.init();
+ }
+
+ init = () => {
+ // let timeScaleChangeUnitString = `${this.props.intervalDelta} ${timeUnitAbbreviations[this.props.intervalTimeScale]}`;
+ this.setState({
+ dateFormatted: this.props.selectedDate.toISOString(),
- dateFormattedB: this.props.selectedDateB ? this.props.selectedDateB.toISOString() : null,
++ dateFormattedB: this.props.selectedDateB
++ ? this.props.selectedDateB.toISOString()
++ : null,
+ draggerSelected: this.props.draggerSelected,
+ axisWidth: this.props.axisWidth,
+ selectedDate: this.props.selectedDate.toISOString(),
+ changeDate: this.props.changeDate,
+ timeScale: this.props.timeScale,
+ incrementDate: this.props.incrementDate,
+ timeScaleChangeUnit: this.props.intervalTimeScale,
+ customIntervalValue: this.props.intervalDelta,
+ intervalChangeAmt: this.props.intervalDelta,
+ customIntervalZoomLevel: this.props.customIntervalZoomLevel,
+ hasSubdailyLayers: this.props.hasSubdailyLayers,
+ intervalText: this.props.timeScale,
+ compareModeActive: this.props.compareModeActive,
+ customSelected: this.props.customSelected,
+ parentOffset: this.props.parentOffset,
+ timelineStartDateLimit: this.props.timelineStartDateLimit,
+ timelineEndDateLimit: this.props.timelineEndDateLimit,
+ animStartLocationDate: this.props.animStartLocationDate,
+ animEndLocationDate: this.props.animEndLocationDate,
+ isAnimationWidgetOpen: this.props.isAnimationWidgetOpen,
+ leftArrowDisabled: this.checkLeftArrowDisabled(),
+ rightArrowDisabled: this.checkRightArrowDisabled()
+ });
- }
++ };
+
+ // shouldComponentUpdate(nextProps, nextState) {
+ // return true;
+ // }
+
+ componentDidUpdate(prevProps, prevState) {
- let { intervalChangeAmt, timeScaleChangeUnit, draggerSelected, dateFormatted, dateFormattedB } = this.state;
- if ((intervalChangeAmt !== prevState.intervalChangeAmt || timeScaleChangeUnit !== prevState.timeScaleChangeUnit)
- || (draggerSelected === 'selected' && dateFormatted !== prevState.dateFormatted)
- || (draggerSelected === 'selectedB' && dateFormattedB !== prevState.dateFormattedB)
- || (draggerSelected !== prevState.draggerSelected)) {
- this.checkLeftArrowDisabled();
- this.checkRightArrowDisabled();
++ let {
++ intervalChangeAmt,
++ timeScaleChangeUnit,
++ draggerSelected,
++ dateFormatted,
++ dateFormattedB
++ } = this.state;
++ if (
++ intervalChangeAmt !== prevState.intervalChangeAmt ||
++ timeScaleChangeUnit !== prevState.timeScaleChangeUnit ||
++ (draggerSelected === 'selected' &&
++ dateFormatted !== prevState.dateFormatted) ||
++ (draggerSelected === 'selectedB' &&
++ dateFormattedB !== prevState.dateFormattedB) ||
++ draggerSelected !== prevState.draggerSelected
++ ) {
++ this.checkLeftArrowDisabled();
++ this.checkRightArrowDisabled();
+ }
+ }
+
+ render() {
+ // console.log(this.state.selectedDate, this.state.dateFormatted)
- return (
- this.state.dateFormatted ?
++ return this.state.dateFormatted ? (
+ <React.Fragment>
- <div id="timeline-header" className={this.state.hasSubdailyLayers ? 'subdaily' : ''}>
++ <div
++ id="timeline-header"
++ className={this.state.hasSubdailyLayers ? 'subdaily' : ''}
++ >
+ <div id="date-selector-main">
+ <DateSelector
+ {...this.props}
+ onDateChange={this.updateDate}
+ date={new Date(this.state.dateFormatted)}
+ dateB={new Date(this.state.dateFormattedB)}
+ hasSubdailyLayers={this.state.hasSubdailyLayers}
+ draggerSelected={this.state.draggerSelected}
+ />
+ </div>
+ <div id="zoom-buttons-group">
+ <TimeScaleIntervalChange
- setTimeScaleIntervalChangeUnit={this.setTimeScaleIntervalChangeUnit}
++ setTimeScaleIntervalChangeUnit={
++ this.setTimeScaleIntervalChangeUnit
++ }
+ customIntervalZoomLevel={this.state.customIntervalZoomLevel}
+ customSelected={this.state.customSelected}
+ customIntervalValue={this.state.customIntervalValue}
+ timeScaleChangeUnit={this.state.timeScaleChangeUnit}
+ />
+
+ <DateChangeArrows
+ leftArrowDown={() => this.incrementDate(-1)}
+ leftArrowUp={this.props.stopper}
+ leftArrowDisabled={this.state.leftArrowDisabled}
+ rightArrowDown={() => this.incrementDate(1)}
+ rightArrowUp={this.props.stopper}
+ rightArrowDisabled={this.state.rightArrowDisabled}
+ />
+ </div>
+
- <AnimationButton
- clickAnimationButton={this.clickAnimationButton}
- />
++ <AnimationButton clickAnimationButton={this.clickAnimationButton} />
+ </div>
+ <div id="timeline-footer">
+ <div id="wv-animation-widet-case"> </div>
+ {/* Timeline */}
+ <TimelineAxis
+ {...this.state}
+ axisWidth={this.state.axisWidth}
+ selectedDate={this.state.dateFormatted}
+ selectedDateB={this.state.dateFormattedB}
+ updateDate={this.updateDate}
+ hasSubdailyLayers={this.state.hasSubdailyLayers}
+ parentOffset={this.state.parentOffset}
+ changeTimeScale={this.changeTimeScale}
+ compareModeActive={this.state.compareModeActive}
+ draggerSelected={this.state.draggerSelected}
+ onChangeSelectedDragger={this.props.onChangeSelectedDragger}
+ timelineStartDateLimit={this.state.timelineStartDateLimit}
+ timelineEndDateLimit={this.state.timelineEndDateLimit}
+ customIntervalModalOpen={this.state.customIntervalModalOpen}
+ updateAnimationRange={this.props.updateAnimationRange}
+ animStartLocationDate={this.state.animStartLocationDate}
+ animEndLocationDate={this.state.animEndLocationDate}
+ isAnimationWidgetOpen={this.state.isAnimationWidgetOpen}
+ />
+
- {/* custom interval selector */}
- <CustomIntervalSelectorWidget
- customIntervalValue={this.state.customIntervalValue}
- customIntervalZoomLevel={this.state.customIntervalZoomLevel}
- toggleCustomIntervalModal={this.toggleCustomIntervalModal}
- customIntervalModalOpen={this.state.customIntervalModalOpen}
- setIntervalChangeUnit={this.setIntervalChangeUnit}
- hasSubdailyLayers={this.state.hasSubdailyLayers}
- />
++ {/* custom interval selector */}
++ <CustomIntervalSelectorWidget
++ customIntervalValue={this.state.customIntervalValue}
++ customIntervalZoomLevel={this.state.customIntervalZoomLevel}
++ toggleCustomIntervalModal={this.toggleCustomIntervalModal}
++ customIntervalModalOpen={this.state.customIntervalModalOpen}
++ setIntervalChangeUnit={this.setIntervalChangeUnit}
++ hasSubdailyLayers={this.state.hasSubdailyLayers}
++ />
+ </div>
+
+ {/* Zoom Level Change */}
- <div className="zoom-level-change" style={{ width: '75px', display: this.state.timelineHidden ? 'none' : 'block'}}>
++ <div
++ className="zoom-level-change"
++ style={{
++ width: '75px',
++ display: this.state.timelineHidden ? 'none' : 'block'
++ }}
++ >
+ <AxisTimeScaleChange
- timeScale={this.state.timeScale}
- changeTimeScale={this.changeTimeScale}
- hasSubdailyLayers={this.state.hasSubdailyLayers}
++ timeScale={this.state.timeScale}
++ changeTimeScale={this.changeTimeScale}
++ hasSubdailyLayers={this.state.hasSubdailyLayers}
+ />
+ </div>
+
+ {/* 🍔 Open/Close Chevron 🍔 */}
+ <div id="timeline-hide" onClick={this.toggleHideTimeline}>
+ {/* {this.state.timelineHidden ? */}
- <div className={`wv-timeline-hide wv-timeline-hide-double-chevron-${this.state.timelineHidden ? 'left' : 'right'}`}></div>
++ <div
++ className={`wv-timeline-hide wv-timeline-hide-double-chevron-${
++ this.state.timelineHidden ? 'left' : 'right'
++ }`}
++ />
+ {/* : */}
+ {/* <div className="wv-timeline-hide wv-timeline-hide-double-chevron-right"></div> */}
+ {/* } */}
+ </div>
+ </React.Fragment>
- :
- null
- );
++ ) : null;
+ }
+ }
+ // Timeline.defaultProps = {
+ // };
+ // Timeline.propTypes = {
+ // width: PropTypes.number,
+ // drawContainers: PropTypes.func,
+ // changeDate: PropTypes.func,
+ // selectedDate: PropTypes.instanceOf(Date)
+ // };
+
+ export default Timeline;
diff --cc web/js/components/tour/modal-tour-start.js
index 075a54891,dcebcb341..77047fbba
--- a/web/js/components/tour/modal-tour-start.js
+++ b/web/js/components/tour/modal-tour-start.js
@@@ -1,16 -1,9 +1,17 @@@
import React from 'react';
import PropTypes from 'prop-types';
-import { Modal, ModalHeader, ModalBody, ModalFooter, InputGroup, InputGroupText, Input } from 'reactstrap';
+import {
+ Modal,
+ ModalHeader,
+ ModalBody,
+ ModalFooter,
+ InputGroup,
+ InputGroupText,
+ Input
+} from 'reactstrap';
import TourIntro from './content-intro';
import TourBoxes from './tour-boxes';
+ import util from '../../util/util';
class ModalStart extends React.Component {
constructor(props) {
@@@ -70,28 -62,13 +70,29 @@@
render() {
return (
- <Modal isOpen={this.props.modalStart} toggle={this.props.toggleModalStart} onClosed={this.props.showTourAlert} wrapClassName='tour tour-start' className={this.props.className} backdrop={true} fade={false} keyboard={false} innerRef={this.setWrapperRef}>
- <ModalHeader toggle={this.props.toggleModalStart} charCode="">Welcome to Worldview!</ModalHeader>
+ <Modal
+ isOpen={this.props.modalStart}
+ toggle={this.props.endTour}
+ onClosed={this.props.showTourAlert}
+ wrapClassName="tour tour-start"
+ className={this.props.className}
+ backdrop={true}
+ fade={false}
+ keyboard={false}
+ innerRef={this.setWrapperRef}
+ >
+ <ModalHeader toggle={this.props.endTour} charCode="">
+ Welcome to Worldview!
+ </ModalHeader>
<ModalBody>
- <TourIntro toggleModalStart={this.props.toggleModalStart}></TourIntro>
- <TourBoxes stories={this.props.stories} storyOrder={this.props.storyOrder} selectTour={this.props.selectTour}></TourBoxes>
+ <TourIntro toggleModalStart={this.props.toggleModalStart} />
+ <TourBoxes
+ stories={this.props.stories}
+ storyOrder={this.props.storyOrder}
+ selectTour={this.props.selectTour}
+ />
</ModalBody>
+ {util.browser.localStorage &&
<ModalFooter>
<InputGroup>
<InputGroupText className="w-100">
diff --cc web/js/containers/animation-widget.js
index 76b19178a,000000000..82991bb64
mode 100644,000000..100644
--- a/web/js/containers/animation-widget.js
+++ b/web/js/containers/animation-widget.js
@@@ -1,307 -1,0 +1,306 @@@
+import React from 'react';
+import { connect } from 'react-redux';
+import { without as lodashWithout } from 'lodash';
+import ErrorBoundary from './error-boundary';
+import PropTypes from 'prop-types';
+import Slider, { Handle } from 'rc-slider';
+import TimeSelector from '../components/date-selector/date-selector';
+import LoopButton from '../components/animation-widget/loop-button';
+import PlayButton from '../components/animation-widget/play-button';
+import AnimWidgetHeader from '../components/animation-widget/header';
+import googleTagManager from 'googleTagManager';
+import { hasSubDaily as hasSubDailySelector } from '../modules/layers/selectors';
+import {
+ play,
+ onClose,
+ stop,
+ toggleLooping,
+ changeFrameRate,
+ changeStartDate,
+ changeEndDate
+} from '../modules/animation/actions';
+
+const timeScaleFromNumberKey = {
+ '0': 'custom',
+ '1': 'year',
+ '2': 'month',
+ '3': 'day',
+ '4': 'hour',
+ '5': 'minute'
+};
+
+const RangeHandle = props => {
+ const { value, offset, dragging, ...restProps } = props;
+
+ const positionStyle = {
+ position: 'absolute',
+ left: `${(offset - 5).toFixed(2)}%`
+ };
+
+ return (
+ <React.Fragment>
+ <span className="anim-frame-rate-label" style={positionStyle}>
+ {value < 10 ? value.toFixed(1) : value}
+ </span>
+ <Handle
+ dragging={dragging.toString()}
+ value={value}
+ offset={offset}
+ {...restProps}
+ />
+ </React.Fragment>
+ );
+};
+/*
+ * A react component, Builds a rather specific
+ * interactive widget
+ *
+ * @class AnimationWidget
+ * @extends React.Component
+ */
+class AnimationWidget extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ speed: props.speed,
+ isSliding: false
+ };
+ }
+ static getDerivedStateFromProps(props, state) {
+ if (props.speed !== state.speed && !state.isSliding) {
+ return { speed: props.speed };
+ } else return null;
+ }
+ /*
+ * Sets a new state to say whether or not
+ * the animation should loop
+ *
+ * @method onLoop
+ *
+ * @param {Object} component - slider react
+ * component
+ * @param {number} value - Value of the slider
+ * selection
+ *
+ * @return {void}
+ */
+ onLoop() {
+ var loop = true;
+ if (this.state.looping) {
+ loop = false;
+ }
+ this.props.onPushLoop(loop);
+ }
+ onDateChange(date, id) {
+ const { onUpdateStartDate, onUpdateEndDate } = this.props;
+ googleTagManager.pushEvent({
+ event: 'GIF_animation_date_case'
+ });
+ if (id === 'start') {
+ onUpdateStartDate(date);
+ } else {
+ onUpdateEndDate(date);
+ }
+ }
+ render() {
+ const {
+ hasSubdailyLayers,
+ increment,
+ onZoomSelect,
+ incrementArray,
+ looping,
+ isPlaying,
+ maxDate,
+ minDate,
+ sliderLabel,
+ startDate,
+ endDate,
+ onPushPlay,
+ onPushPause
+ } = this.props;
+ return (
+ <ErrorBoundary>
+ <div
+ id="wv-animation-widget"
+ className={
+ 'wv-animation-widget' + (hasSubdailyLayers ? ' subdaily' : '')
+ }
+ >
+ <AnimWidgetHeader
+ text={increment}
+ toolTipTextArray={incrementArray}
+ onClick={onZoomSelect}
+ />
+
+ <PlayButton
+ playing={isPlaying}
+ play={onPushPlay}
+ pause={onPushPause}
+ />
+ <LoopButton looping={looping} onLoop={this.onLoop.bind(this)} />
+ <div className="wv-slider-case">
+ <Slider
+ className="input-range"
+ step={0.5}
+ max={10}
+ min={0.5}
+ value={this.state.speed}
+ onChange={num => this.setState({ speed: num })}
+ handle={RangeHandle}
+ onBeforeChange={() => this.setState({ isSliding: true })}
+ onAfterChange={() => {
+ this.setState({ isSliding: false });
+ this.props.onSlide(this.state.speed);
+ }}
+ />
+ <span className="wv-slider-label">{sliderLabel}</span>
+ </div>
+
+ <a
+ href="javascript:void(null)"
+ title="Create Animated GIF"
+ className="wv-icon-case"
+ onClick={this.props.onPushGIF}
+ >
+ <i
+ id="wv-animation-widget-file-video-icon"
+ className="fas fa-file-video wv-animation-widget-icon"
+ />
+ </a>
+ <div className="wv-anim-dates-case">
+ <TimeSelector
+ width="120"
+ height="30"
+ date={startDate}
+ id="start"
+ idSuffix="animation-widget-start"
+ onDateChange={this.onDateChange.bind(this)}
+ maxDate={endDate}
+ minDate={minDate}
+ hasSubdailyLayers={hasSubdailyLayers}
+ />
+ <div className="thru-label">To</div>
+ <TimeSelector
+ width="120"
+ height="30"
+ date={endDate}
+ id="end"
+ idSuffix="animation-widget-end"
+ onDateChange={this.onDateChange.bind(this)}
+ maxDate={maxDate}
+ minDate={startDate}
+ hasSubdailyLayers={hasSubdailyLayers}
+ />
+ </div>
+ <i className="fa fa-times wv-close" onClick={this.props.onClose} />
+ </div>
+ </ErrorBoundary>
+ );
+ }
+}
+function mapStateToProps(state) {
- const { legacy, layers, compare, animation, models } = state;
++ const { legacy, layers, compare, animation, date } = state;
+ const { startDate, endDate, speed, loop, isPlaying } = animation;
++ const { minDate, maxDate } = date;
+ const activeStr = compare.activeString;
+ const hasSubdailyLayers = hasSubDailySelector(layers[activeStr]);
+ const zoomObj = getZoomObject(legacy.date, hasSubdailyLayers);
- const minDate = models.date.minDate();
- const maxDate = models.date.maxDate();
+
+ return {
+ startDate,
+ endDate,
+ minDate,
+ maxDate,
+ hasSubdailyLayers,
+ incrementArray: zoomObj.array,
+ increment: zoomObj.increment,
+ sliderLabel: 'Frames Per Second',
+ speed,
+ isPlaying,
+ looping: loop
+ };
+}
+const mapDispatchToProps = dispatch => ({
+ onClose: () => {
+ dispatch(onClose());
+ },
+ onPushPlay: () => {
+ dispatch(play());
+ },
+ onPushPause: () => {
+ dispatch(stop());
+ },
+ onPushLoop: () => {
+ dispatch(toggleLooping());
+ },
+ onPushGIF: () => {
+ // dispatch(onPushGIF());
+ },
+ onSlide: num => {
+ dispatch(changeFrameRate(num));
+ },
+ onZoomSelect: num => {
+ // dispatch(onZoomSelect(num));
+ },
+ onUpdateStartDate(date) {
+ dispatch(changeStartDate(date));
+ },
+ onUpdateEndDate(date) {
+ dispatch(changeEndDate(date));
+ }
+});
+
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(AnimationWidget);
+
+AnimationWidget.propTypes = {
+ speed: PropTypes.number,
+ looping: PropTypes.bool,
+ startDate: PropTypes.object,
+ endDate: PropTypes.object,
+ incrementArray: PropTypes.array,
+ increment: PropTypes.string,
+ onSlide: PropTypes.func,
+ onPushPlay: PropTypes.func,
+ onPushPause: PropTypes.func,
+ onPushLoop: PropTypes.func,
+ onDateChange: PropTypes.func,
+ onZoomSelect: PropTypes.func,
+ sliderLabel: PropTypes.string,
+ onPushGIF: PropTypes.func,
+ minDate: PropTypes.object,
+ maxDate: PropTypes.object,
+ hasSubdailyLayers: PropTypes.bool,
+ onClose: PropTypes.func,
+ isPlaying: PropTypes.bool
+};
+
+const getZoomObject = function(dateModel, hasSubDaily) {
+ let zooms = [];
+ let headerText = '';
+ const customText =
+ dateModel.customDelta && dateModel.customInterval
+ ? `${dateModel.customDelta} ${
+ timeScaleFromNumberKey[dateModel.customInterval]
+ }`
+ : 'custom';
+ if (hasSubDaily) {
+ zooms = [customText, 'yearly', 'monthly', 'daily', 'hourly', 'minutely'];
+ } else {
+ zooms = [customText, 'yearly', 'monthly', 'daily'];
+ }
+ if (dateModel.customSelected) {
+ headerText = zooms[0];
+ } else {
+ let interval = dateModel.interval
+ ? dateModel.interval
+ : dateModel.selectedZoom - 1;
+ headerText = zooms[interval];
+ }
+ return {
+ increment: headerText,
+ array: lodashWithout(zooms, headerText)
+ };
+};
diff --cc web/js/date/timeline-input.js
index 818d5e237,b29d4ddda..900cad235
--- a/web/js/date/timeline-input.js
+++ b/web/js/date/timeline-input.js
@@@ -28,35 -27,11 +30,36 @@@ export function timelineInput(models, c
var $incrementBtn = $('#right-arrow-group');
var $decrementBtn = $('#left-arrow-group');
+ /**
+ * Subscribe to redux store and listen for
+ * specific action types
+ */
+ const subscribeToStore = function() {
+ const state = store.getState();
+ const action = state.lastAction;
+ if (action.type === INIT_SECOND_LAYER_GROUP) {
+ model.initCompare();
+ } else if (action.type === LOCATION_POP_ACTION) {
+ const newState = util.fromQueryString(action.payload.search);
+ const selected = lodashGet(action, 'payload.query.legacy.date.selected');
+ const selectedB = lodashGet(
+ action,
+ 'payload.query.legacy.date.selectedB'
+ );
+ if (newState.t && selected) {
+ model.select(selected, 'selected');
+ }
+ if (newState.t1 && selectedB) {
+ model.select(selectedB, 'selectedB');
+ }
+ }
+ };
var init = function() {
models.layers.events.on('subdaily-updated', updateMaxZoom);
+ store.subscribe(subscribeToStore);
$incrementBtn
.mousedown(function(e) {
+ console.log(self.delta, self.interval)
e.preventDefault();
switch (ui.timeline.config.currentZoom) {
case 1:
diff --cc web/js/map/layerbuilder.js
index 48e61407f,71de365a2..e32366588
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@@ -44,9 -38,10 +44,10 @@@ export function mapLayerBuilder(models
options = options || {};
group = options.group || null;
date = self.closestDate(def, options);
- key = self.layerKey(def, options, group);
- proj = models.proj.selected;
+ key = self.layerKey(def, options, state);
+ proj = state.proj.selected;
layer = cache.getItem(key);
+
if (!layer) {
// layer is not in the cache
if (!date) date = options.date || models.date[models.date.activeDate];
@@@ -60,14 -55,12 +61,15 @@@
};
def = lodashCloneDeep(def);
lodashMerge(def, def.projections[proj.id]);
+
if (def.type === 'wmts') {
- layer = createLayerWMTS(def, options);
- if (proj.id === 'geographic' && (def.wrapadjacentdays === true || def.wrapX)) {
- layerNext = createLayerWMTS(def, options, 1);
- layerPrior = createLayerWMTS(def, options, -1);
+ layer = createLayerWMTS(def, options, null, state);
+ if (
+ proj.id === 'geographic' &&
+ (def.wrapadjacentdays === true || def.wrapX)
+ ) {
+ layerNext = createLayerWMTS(def, options, 1, state);
+ layerPrior = createLayerWMTS(def, options, -1, state);
layer.wv = attributes;
layerPrior.wv = attributes;