Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add mobile date picker, WIP mobile and tablet drag handling

Edward Plato9e0cf0fe58c1
diff --git a/package-lock.json b/package-lock.json
index efb619bc2..c4224f203 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -24,6 +24,11 @@
"js-tokens": "^4.0.0"
}
},
+ "@babel/preset-stage-0": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/preset-stage-0/-/preset-stage-0-7.0.0.tgz",
+ "integrity": "sha512-FBMd0IiARPtH5aaOFUVki6evHiJQiY0pFy7fizyRF7dtwc+el3nwpzvhb9qBNzceG1OIJModG1xpE0DDFjPXwA=="
+ },
"@babel/runtime": {
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.4.tgz",
@@ -1524,6 +1529,12 @@
"integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=",
"dev": true
},
+ "babel-plugin-syntax-class-constructor-call": {
+ "version": "6.18.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz",
+ "integrity": "sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY=",
+ "dev": true
+ },
"babel-plugin-syntax-class-properties": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz",
@@ -1536,6 +1547,12 @@
"integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=",
"dev": true
},
+ "babel-plugin-syntax-do-expressions": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz",
+ "integrity": "sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0=",
+ "dev": true
+ },
"babel-plugin-syntax-dynamic-import": {
"version": "6.18.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz",
@@ -1548,12 +1565,24 @@
"integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=",
"dev": true
},
+ "babel-plugin-syntax-export-extensions": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz",
+ "integrity": "sha1-cKFITw+QiaToStRLrDU8lbmxJyE=",
+ "dev": true
+ },
"babel-plugin-syntax-flow": {
"version": "6.18.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz",
"integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=",
"dev": true
},
+ "babel-plugin-syntax-function-bind": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz",
+ "integrity": "sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y=",
+ "dev": true
+ },
"babel-plugin-syntax-jsx": {
"version": "6.18.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz",
@@ -1594,6 +1623,17 @@
"babel-runtime": "^6.22.0"
}
},
+ "babel-plugin-transform-class-constructor-call": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz",
+ "integrity": "sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-class-constructor-call": "^6.18.0",
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
+ }
+ },
"babel-plugin-transform-class-properties": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz",
@@ -1619,6 +1659,16 @@
"babel-types": "^6.24.1"
}
},
+ "babel-plugin-transform-do-expressions": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz",
+ "integrity": "sha1-KMyvkoEtlJws0SgfaQyP3EaK6bs=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-do-expressions": "^6.8.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
"babel-plugin-transform-es2015-arrow-functions": {
"version": "6.22.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz",
@@ -1864,6 +1914,16 @@
"babel-runtime": "^6.22.0"
}
},
+ "babel-plugin-transform-export-extensions": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz",
+ "integrity": "sha1-U3OLR+deghhYnuqUbLvTkQm75lM=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-export-extensions": "^6.8.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
"babel-plugin-transform-flow-strip-types": {
"version": "6.22.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz",
@@ -1874,6 +1934,16 @@
"babel-runtime": "^6.22.0"
}
},
+ "babel-plugin-transform-function-bind": {
+ "version": "6.22.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz",
+ "integrity": "sha1-xvuOlqwpajELjPjqQBRiQH3fapc=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-syntax-function-bind": "^6.8.0",
+ "babel-runtime": "^6.22.0"
+ }
+ },
"babel-plugin-transform-inline-consecutive-adds": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz",
@@ -2090,6 +2160,38 @@
}
}
},
+ "babel-preset-es2015": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz",
+ "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-check-es2015-constants": "^6.22.0",
+ "babel-plugin-transform-es2015-arrow-functions": "^6.22.0",
+ "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0",
+ "babel-plugin-transform-es2015-block-scoping": "^6.24.1",
+ "babel-plugin-transform-es2015-classes": "^6.24.1",
+ "babel-plugin-transform-es2015-computed-properties": "^6.24.1",
+ "babel-plugin-transform-es2015-destructuring": "^6.22.0",
+ "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1",
+ "babel-plugin-transform-es2015-for-of": "^6.22.0",
+ "babel-plugin-transform-es2015-function-name": "^6.24.1",
+ "babel-plugin-transform-es2015-literals": "^6.22.0",
+ "babel-plugin-transform-es2015-modules-amd": "^6.24.1",
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
+ "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1",
+ "babel-plugin-transform-es2015-modules-umd": "^6.24.1",
+ "babel-plugin-transform-es2015-object-super": "^6.24.1",
+ "babel-plugin-transform-es2015-parameters": "^6.24.1",
+ "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1",
+ "babel-plugin-transform-es2015-spread": "^6.22.0",
+ "babel-plugin-transform-es2015-sticky-regex": "^6.24.1",
+ "babel-plugin-transform-es2015-template-literals": "^6.22.0",
+ "babel-plugin-transform-es2015-typeof-symbol": "^6.22.0",
+ "babel-plugin-transform-es2015-unicode-regex": "^6.24.1",
+ "babel-plugin-transform-regenerator": "^6.24.1"
+ }
+ },
"babel-preset-flow": {
"version": "6.23.0",
"resolved": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz",
@@ -2154,6 +2256,28 @@
"babel-preset-flow": "^6.23.0"
}
},
+ "babel-preset-stage-0": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz",
+ "integrity": "sha1-VkLRUEL5E4TX5a+LyIsduVsDnmo=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-do-expressions": "^6.22.0",
+ "babel-plugin-transform-function-bind": "^6.22.0",
+ "babel-preset-stage-1": "^6.24.1"
+ }
+ },
+ "babel-preset-stage-1": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz",
+ "integrity": "sha1-dpLNfc1oSZB+auSgqFWJz7niv7A=",
+ "dev": true,
+ "requires": {
+ "babel-plugin-transform-class-constructor-call": "^6.24.1",
+ "babel-plugin-transform-export-extensions": "^6.22.0",
+ "babel-preset-stage-2": "^6.24.1"
+ }
+ },
"babel-preset-stage-2": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz",
@@ -5253,11 +5377,6 @@
"is-obj": "^1.0.0"
}
},
- "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",
@@ -6811,7 +6930,8 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"aproba": {
"version": "1.2.0",
@@ -6835,13 +6955,15 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
+ "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -6858,19 +6980,22 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"console-control-strings": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -7001,7 +7126,8 @@
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"ini": {
"version": "1.3.5",
@@ -7015,6 +7141,7 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -7031,6 +7158,7 @@
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
+ "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -7039,13 +7167,15 @@
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"minipass": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz",
"integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
"dev": true,
+ "optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -7066,6 +7196,7 @@
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
+ "optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -7154,7 +7285,8 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -7168,6 +7300,7 @@
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
+ "optional": true,
"requires": {
"wrappy": "1"
}
@@ -7263,7 +7396,8 @@
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
- "dev": true
+ "dev": true,
+ "optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -7305,6 +7439,7 @@
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -7326,6 +7461,7 @@
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
+ "optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -7374,13 +7510,15 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
- "dev": true
+ "dev": true,
+ "optional": true
},
"yallist": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
"integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
- "dev": true
+ "dev": true,
+ "optional": true
}
}
},
@@ -16525,6 +16663,11 @@
"prop-types": "^15.5.8"
}
},
+ "react-mobile-datepicker": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/react-mobile-datepicker/-/react-mobile-datepicker-4.0.1.tgz",
+ "integrity": "sha512-g1PjupD/JwTBbDlBpjU8+xj37HZ5FexcjzyBRWJjPs2obUjiGnBeOMilfcMFrX+ScYmIICrDfAxZ6dmmou4MuQ=="
+ },
"react-motion": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/react-motion/-/react-motion-0.5.2.tgz",
diff --git a/package.json b/package.json
index 4a300a6af..31e79334d 100644
--- a/package.json
+++ b/package.json
@@ -75,8 +75,10 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-polyfill": "^6.16.0",
"babel-preset-env": "^1.7.0",
+ "babel-preset-es2015": "^6.24.1",
"babel-preset-minify": "^0.4.3",
"babel-preset-react": "^6.24.1",
+ "babel-preset-stage-0": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"babelify": "^7.3.0",
"browserstack-capabilities": "^0.4.0",
@@ -184,6 +186,7 @@
"react-image-crop": "^6.0.11",
"react-loader": "^2.4.5",
"react-masonry-component": "^6.2.1",
+ "react-mobile-datepicker": "^4.0.1",
"react-portal": "^4.2.0",
"react-redux": "^6.0.0",
"reactstrap": "^7.0.0",
diff --git a/web/js/app.js b/web/js/app.js
index 810320883..5f8eefcf6 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -68,6 +68,7 @@ import '../css/sidebar.css';
import '../css/layers.css';
import '../css/scrollbar.css';
import '../css/timeline.css';
+import './components/timeline/timeline.css';
import '../css/anim.widget.css';
import '../css/dateselector.css';
import '../css/tooltip.css';
@@ -104,8 +105,6 @@ class App extends React.Component {
<div id="eventsHolder" />
<div id="imagedownload" />
<div id="dlMap" />
-
- <div id="timewheels" style={{ display: 'none' }} />
<Timeline />
<div id="wv-animation-widet-case">
{ isAnimationWidgetActive ? <AnimationWidget /> : null }
diff --git a/web/js/components/timeline/mobile-date-picker.js b/web/js/components/timeline/mobile-date-picker.js
new file mode 100644
index 000000000..6532e8fec
--- /dev/null
+++ b/web/js/components/timeline/mobile-date-picker.js
@@ -0,0 +1,160 @@
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
+import DatePicker from 'react-mobile-datepicker';
+
+// https://www.npmjs.com/package/react-mobile-datepicker
+// configs for date order, caption, and date step
+const defaultDateConfig = {
+ 'year': {
+ format: 'YYYY',
+ caption: 'Year',
+ step: 1
+ },
+ 'month': {
+ format: 'MM',
+ caption: 'Month',
+ step: 1
+ },
+ 'date': {
+ format: 'DD',
+ caption: 'Day',
+ step: 1
+ }
+};
+
+const subDailyDateConfig = {
+ 'year': {
+ format: 'YYYY',
+ caption: 'Year',
+ step: 1
+ },
+ 'month': {
+ format: 'MM',
+ caption: 'Mon',
+ step: 1
+ },
+ 'date': {
+ format: 'DD',
+ caption: 'Day',
+ step: 1
+ },
+ 'hour': {
+ format: 'hh',
+ caption: 'Hour',
+ step: 1
+ },
+ 'minute': {
+ format: 'mm',
+ caption: 'Min',
+ step: 1
+ }
+};
+
+class MobileDatePicker extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ time: '',
+ minDate: '',
+ maxDate: '',
+ isOpen: false
+ };
+ }
+
+ handleClickDateButton = () => {
+ this.setState({
+ isOpen: true
+ });
+ }
+
+ handleCancel = () => {
+ this.setState({
+ isOpen: false
+ });
+ }
+
+ handleSelect = (time) => {
+ this.setState({
+ time,
+ isOpen: false
+ });
+ // convert date back to local time
+ let date = this.convertToLocalDateObject(time).toISOString();
+ this.props.changeDate(date);
+ }
+
+ // used for init mount
+ setInitDates = () => {
+ this.setState({
+ time: this.convertToUTCDateObject(this.props.date),
+ minDate: this.convertToUTCDateObject(this.props.startDateLimit),
+ maxDate: this.convertToUTCDateObject(this.props.endDateLimit)
+ });
+ }
+
+ // change to UTC offset time for date picker controls
+ convertToUTCDateObject = (dateString) => {
+ let date = new Date(dateString);
+ let dateUTC = new Date(date.getTime() + (date.getTimezoneOffset() * 60000));
+ return dateUTC;
+ }
+
+ // change to offset time used in parent component date setting functions
+ convertToLocalDateObject = (date) => {
+ let dateLocal = new Date(date.getTime() - (date.getTimezoneOffset() * 60000));
+ return dateLocal;
+ }
+
+ componentDidMount() {
+ this.setInitDates();
+ }
+
+ render() {
+ let {
+ time,
+ minDate,
+ maxDate,
+ isOpen
+ } = this.state;
+ let {
+ date,
+ hasSubdailyLayers
+ } = this.props;
+ // display date as '2000-10-28' for default or '2000-10-28 20:28Z' for subdaily
+ let displayDate = hasSubdailyLayers ? date.split('T').join(' ').split(':', 2).join(':') + 'Z' : date.split('T')[0];
+ return (
+ time
+ ? <React.Fragment>
+ <div
+ className="mobile-date-picker-select-btn"
+ onClick={this.handleClickDateButton}>
+ {displayDate}
+ </div>
+ <DatePicker
+ dateConfig={hasSubdailyLayers ? subDailyDateConfig : defaultDateConfig}
+ showCaption={true}
+ theme={'android-dark'}
+ headerFormat={hasSubdailyLayers ? 'YYYY-MM-DD hh:mmZ' : 'YYYY-MM-DD'}
+ confirmText={'OK'}
+ cancelText={'CANCEL'}
+ min={minDate}
+ max={maxDate}
+ value={time}
+ isOpen={isOpen}
+ onSelect={this.handleSelect}
+ onCancel={this.handleCancel} />
+ </React.Fragment>
+ : null
+ );
+ }
+}
+
+MobileDatePicker.propTypes = {
+ changeDate: PropTypes.func,
+ date: PropTypes.string,
+ startDateLimit: PropTypes.string,
+ endDateLimit: PropTypes.string,
+ hasSubdailyLayers: PropTypes.bool
+};
+
+export default MobileDatePicker;
diff --git a/web/js/components/timeline/timeline-axis/grid-range/tile-rect.js b/web/js/components/timeline/timeline-axis/grid-range/tile-rect.js
index d7f6e157f..874c0eddc 100644
--- a/web/js/components/timeline/timeline-axis/grid-range/tile-rect.js
+++ b/web/js/components/timeline/timeline-axis/grid-range/tile-rect.js
@@ -67,6 +67,13 @@ class TileRect extends PureComponent {
this.props.showHover(e, item.rawDate, item.rawNextDate, index);
}
+ showTouch = (e) => {
+ let { item, index } = this.props;
+ let touch = e.changedTouches[0];
+ console.log(e.type, touch.pageX, touch.pageY);
+ this.props.showHover(e, item.rawDate, item.rawNextDate, index);
+ }
+
render() {
let { item, gridWidth, index, timeScale } = this.props;
let tileOptions = tileRectTimeScaleOptions[timeScale]();
diff --git a/web/js/components/timeline/timeline-axis/timeline-axis.js b/web/js/components/timeline/timeline-axis/timeline-axis.js
index 1d78b1ed3..aad01cd70 100644
--- a/web/js/components/timeline/timeline-axis/timeline-axis.js
+++ b/web/js/components/timeline/timeline-axis/timeline-axis.js
@@ -359,106 +359,6 @@ class TimelineAxis extends Component {
}
componentDidMount() {
- // let axisWidth = this.props.axisWidth;
- // let timeScale = this.props.timeScale;
- // let timelineStartDateLimit = this.props.timelineStartDateLimit;
- // let timelineEndDateLimit = this.props.timelineEndDateLimit;
-
- // // get dateA time and relative from start/end limits
- // let time = this.props.draggerSelected === 'selected' ? this.props.dateA : this.props.dateB;
- // time = moment.utc(time);
- // let diffFromEndDateLimit = time.diff(timelineEndDateLimit, timeScale);
- // let diffFromStartDateLimit = time.diff(timelineStartDateLimit, timeScale);
- // // format to strings
- // time = time.format();
-
- // let draggerTimeStateB;
- // if (this.props.dateB) {
- // draggerTimeStateB = moment.utc(this.props.dateB).format();
- // }
-
- // // get timeScale specifics based on props
- // let options = timeScaleOptions[timeScale].timeAxis;
- // let gridWidth = options.gridWidth;
-
- // // calculate number of grids viewable based on axisWidth and gridWidth of timeScale
- // let numberOfVisibleTiles = Number((axisWidth / gridWidth).toFixed(8));
- // // let leftOffset = axisWidth * 0.90;
- // // let draggerPosition = tilesTillSelectedDAte * gridWidth - draggerWidth; //# CENTER DRAGGER A
- // let draggerVisible = true;
- // let draggerVisibleB = false;
- // if (this.props.compareModeActive) {
- // draggerVisibleB = true;
- // }
-
- // // times 1.5 is cutting it close (down to 1 grid at leading edge - will continue to test)
- // let gridNumber = Math.floor(numberOfVisibleTiles * 1.5);
- // let dragSentinelChangeNumber = gridWidth * (Math.floor(numberOfVisibleTiles * 0.25) + 1);
-
- // //! offset grids needed since each zoom in won't be centered
- // // let offSetGrids = Math.floor(leftOffset / gridWidth);
- // // let offSetGridsDiff = offSetGrids - Math.floor(numberOfVisibleTiles / 2);
-
- // // let gridsToSubtract = Math.floor(gridNumber/2) + offSetGridsDiff;
- // // let gridsToAdd = Math.floor(gridNumber/2) - offSetGridsDiff;
-
- // // get midPoint for position based on # of tiles and gridWidth
- // let midPoint = -((gridWidth * gridNumber) / 2) + (numberOfVisibleTiles / 2 * gridWidth);
-
- // let draggerTime = moment.utc(time);
- // // let draggerTimeZero = moment.utc(time).startOf(timeScale);
- // // let draggerTimeNextZero = moment.utc(draggerTime).startOf(timeScale).add(1, timeScale);
-
- // // let draggerTimeValue = moment.utc(draggerTime).valueOf();
- // // let draggerTimeZeroValue = moment.utc(draggerTimeZero).valueOf();
- // // let draggerTimeNextZeroValue = moment.utc(draggerTimeNextZero).valueOf();
-
- // // let diffZeroValues = draggerTimeNextZeroValue - draggerTimeZeroValue;
- // // let diffFactor = diffZeroValues / gridWidth;
- // // let diffStartAndZeroed = draggerTimeValue - draggerTimeZeroValue;
-
- // // handle date array creation
- // let timeRange = this.getTimeRangeArray(Math.floor(gridNumber / 2), Math.floor(gridNumber / 2), time);
-
- // let frontDate = moment.utc(timeRange[0].rawDate);
- // let draggerPosition = Math.abs(frontDate.diff(draggerTime, timeScale, true) * gridWidth);
- // let draggerPositionB = Math.abs(frontDate.diff(moment.utc(draggerTimeStateB), timeScale, true) * gridWidth);
-
- // // animation dragger positioning
- // let animationStartDraggerLocation;
- // let animationEndDraggerLocation;
-
- // if (this.props.animStartLocationDate) {
- // animationStartDraggerLocation = Math.abs(frontDate.diff(this.props.animStartLocationDate, timeScale, true) * gridWidth);
- // animationEndDraggerLocation = Math.abs(frontDate.diff(this.props.animEndLocationDate, timeScale, true) * gridWidth);
- // }
-
- // // get axis bounds
- // let leftBound = (diffFromEndDateLimit * gridWidth) + midPoint;
- // let rightBound = (diffFromStartDateLimit * gridWidth) + midPoint;
-
- // if (timeScale === 'year') {
- // leftBound = -midPoint * 10;
- // rightBound = midPoint * 10;
- // }
-
- // let animationStartLocation = animationStartDraggerLocation + midPoint;
- // let animationEndLocation = animationEndDraggerLocation + midPoint;
-
- // this.setState({
- // // init: true,
- // // numberOfVisibleTiles: numberOfVisibleTiles,
- // // dragSentinelChangeNumber: dragSentinelChangeNumber,
- // // currentTimeRange: timeRange,
- // // gridWidth,
- // // hoverTime: time,
- // // midPoint,
- // // leftBound,
- // // rightBound
-
- // }, function() {
- // this.updateScale(time, timeScale, this.props.axisWidth, 0.80);
- // });
let time = this.props.draggerSelected === 'selected' ? this.props.dateA : this.props.dateB;
this.updateScale(time, this.props.timeScale, this.props.axisWidth, 0.80);
}
@@ -644,9 +544,11 @@ class TimelineAxis extends Component {
setLineTime = (e) => {
e.preventDefault();
e.stopPropagation();
+ console.log(e)
if (e.target.className.animVal !== 'grid') {
return;
}
+ console.log(!this.props.isAnimationDraggerDragging ,!this.props.moved ,this.state.mouseDown)
if (!this.props.isAnimationDraggerDragging && !this.props.moved && this.state.mouseDown) {
let {
currentTimeRange
@@ -658,7 +560,7 @@ class TimelineAxis extends Component {
draggerTimeStateB,
hoverTime
} = this.props;
-
+console.log(hoverTime)
// get front and back dates
let frontDate = currentTimeRange[0].rawDate;
let backDate = currentTimeRange[currentTimeRange.length - 1].rawDate;
@@ -687,6 +589,7 @@ class TimelineAxis extends Component {
// drag axis - will update date range if dragged into past/future past dragSentinelChangeNumber
handleDrag = (e, d) => {
+ console.log(e, d)
e.stopPropagation();
e.preventDefault();
let {
@@ -704,6 +607,7 @@ class TimelineAxis extends Component {
} = this.props;
let deltaX = d.deltaX;
+ console.log(deltaX, d, dragSentinelCount + deltaX)
position = position + deltaX;
draggerPosition = draggerPosition + deltaX;
draggerPositionB = draggerPositionB + deltaX;
@@ -895,6 +799,7 @@ class TimelineAxis extends Component {
// handle stop drag of axis
// moved === false means an axis click
handleStopDrag = (e, d) => {
+ console.log(e,d)
let {
midPoint,
leftBound,
@@ -1042,18 +947,21 @@ class TimelineAxis extends Component {
// ! WINDOW.MOMENT FOR DEV DEBUG ONLY
window.moment = moment;
+ // console.log(this.props)
return (
<React.Fragment>
- <div id='wv-timeline-axis'
+ <div className='timeline-axis-container'
style={{ width: `${axisWidth}px` }}
onMouseDown={this.handleMouseDown}
onMouseUp={this.setLineTime}
onWheel={this.wheelZoom}
onMouseOver={this.props.showHoverOn}
onMouseLeave={this.props.showHoverOff}
+ onTouchStart={this.handleMouseDown}
+ onTouchEnd={this.setLineTime}
>
{currentTimeRange
- ? <svg className='inner'
+ ? <svg className='timeline-axis-svg'
id='timeline-footer-svg'
width={axisWidth}
height={70}
@@ -1075,6 +983,8 @@ class TimelineAxis extends Component {
position={{ x: position, y: 0 }}
onStart={this.handleStartDrag}
onStop={this.handleStopDrag}
+ onTouchStart={this.handleStartDrag}
+ onTouchEnd={this.handleStopDrag}
bounds={{ left: leftBound, top: 0, bottom: 0, right: rightBound }}
>
<g>
@@ -1095,8 +1005,6 @@ class TimelineAxis extends Component {
}
}
-TimelineAxis.defaultProps = {
-};
TimelineAxis.propTypes = {
animEndLocationDate: PropTypes.object,
animStartLocationDate: PropTypes.object,
diff --git a/web/js/components/timeline/timeline.css b/web/js/components/timeline/timeline.css
index 85df3d6b7..496616c64 100644
--- a/web/js/components/timeline/timeline.css
+++ b/web/js/components/timeline/timeline.css
@@ -11,17 +11,16 @@ html, body {
bottom: -24px;
}
-#wv-timeline-axis {
+.timeline-axis-container {
height: 65px;
border-top: 1.5px solid white;
}
-.inner {
+.timeline-axis-svg {
height: 64px;
display: flex;
flex-direction: row;
align-items: center;
- /* border-top: 1.5px solid white; */
/* -webkit-clip-path: url('#timelineBoundary');
clip-path: url('#timelineBoundary'); */
}
@@ -288,4 +287,48 @@ line {
.timeline-hover-line {
display: 'block';
+}
+
+/* Mobile date picker */
+.mobile-date-picker-select-btn {
+ position: absolute;
+ left: 10px;
+ bottom: 10px;
+ background: rgba(40, 40, 40, 0.85);
+ color: #fff;
+ border: thin solid #333;
+ font-size: 17px;
+ font-family: 'Open Sans', sans-serif;
+ padding: 3px;
+ border-radius: 5px;
+ line-height: 25px;
+ white-space: nowrap;
+ cursor: pointer;
+}
+
+.datepicker-header,
+.datepicker-navbar-btn {
+ font-weight: 700;
+}
+
+.datepicker.android-dark .datepicker-header {
+ color: #fff !important;
+ border-bottom: 2px solid #00457b !important;
+}
+
+.datepicker.android-dark .datepicker-wheel {
+ border-top: 2px solid #00457b !important;
+ border-bottom: 2px solid #00457b !important;
+}
+
+.datepicker.android-dark .datepicker-scroll li {
+ color: #fff !important;
+}
+
+.datepicker.android-dark .datepicker-scroll li.disabled {
+ color: rgb(88, 88, 88) !important;
+}
+
+.datepicker-navbar-btn:hover {
+ background: #fff;
}
\ No newline at end of file
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index b3f0a3677..5533cb8ed 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -4,7 +4,7 @@ import { connect } from 'react-redux';
import moment from 'moment';
import ErrorBoundary from '../../containers/error-boundary';
import TimeScaleIntervalChange from '../../components/timeline/timeline-controls/interval-timescale-change';
-import '../../components/timeline/timeline.css';
+// import '../../components/timeline/timeline.css';
import TimelineAxis from '../../components/timeline/timeline-axis/timeline-axis';
import TimelineRangeSelector from '../../components/range-selection/range-selection';
import DraggerContainer from '../../components/timeline/timeline-axis/dragger-container';
@@ -13,6 +13,7 @@ import DateToolTip from '../../components/timeline/timeline-axis/date-tooltips';
import CustomIntervalSelectorWidget from '../../components/timeline/interval-selector/interval-selector';
import util from '../../util/util';
import DateSelector from '../../components/date-selector/date-selector';
+import MobileDatePicker from '../../components/timeline/mobile-date-picker';
import DateChangeArrows from '../../components/timeline/timeline-controls/date-change-arrows';
import AnimationButton from '../../components/timeline/timeline-controls/animation-button';
@@ -103,16 +104,18 @@ class Timeline extends React.Component {
// ! HOVER TIME
// display date based on hover grid tile
displayDate = (date, leftOffset) => {
- requestAnimationFrame(() => {
+ console.log(date, leftOffset)
+ // requestAnimationFrame(() => {
this.setState({
hoverTime: date,
leftOffset: leftOffset - this.props.parentOffset // relative location from parent bounding box of mouse hover position (i.e. BLUE LINE)
});
- });
+ // });
}
// show hover line
showHoverOn = (e) => {
+ console.log(e)
if (!this.state.isAnimationDraggerDragging && !this.state.showDraggerTime && !this.state.isTimelineDragging) {
if (e.target.className.animVal === 'grid') {
if (this.state.showHoverLine !== true) {
@@ -144,6 +147,7 @@ class Timeline extends React.Component {
// handle svg blue line hover
showHover = (e, itemDate, nextDate, index) => {
+ console.log(e, e.type, itemDate, nextDate, index)
e.preventDefault();
e.stopPropagation();
e.persist();
@@ -171,10 +175,24 @@ class Timeline extends React.Component {
let isBetweenValidTimeline = getIsBetween(displayDateValue, this.props.timelineStartDateLimit, this.props.timelineEndDateLimit);
if (isBetweenValidTimeline) {
let displayDateFormat = getISODateFormatted(displayDateValue);
- this.displayDate(displayDateFormat, clientX);
- this.setState({
- hoverLinePosition: index * gridWidth + xHoverPositionInCurrentGrid + transformX + position
- });
+ if (e.type === 'touchstart') {
+ // this.setState({
+ // hoverTime: date,
+ // leftOffset: leftOffset - this.props.parentOffset // relative location from parent bounding box of mouse hover position (i.e. BLUE LINE)
+ // });
+ // this.displayDate(displayDateFormat, clientX);
+ this.setState({
+ hoverTime: displayDateFormat,
+ leftOffset: clientX - this.props.parentOffset,
+ hoverLinePosition: index * gridWidth + xHoverPositionInCurrentGrid + transformX + position
+ });
+ this.changeDate(displayDateFormat);
+ } else {
+ this.displayDate(displayDateFormat, clientX);
+ this.setState({
+ hoverLinePosition: index * gridWidth + xHoverPositionInCurrentGrid + transformX + position
+ });
+ }
}
});
}
@@ -454,7 +472,6 @@ class Timeline extends React.Component {
// handle draggerTimeState updates if date changes
if (this.props.dateA !== prevProps.dateA && this.props.dateA !== this.state.draggerTimeState) {
- console.log(this.props.dateA ,prevProps.dateA ,this.state.draggerTimeState)
this.setState({
draggerTimeState: this.props.dateA
});
@@ -513,6 +530,7 @@ class Timeline extends React.Component {
let selectedDate = draggerSelected === 'selected' ? this.state.draggerTimeState : this.state.draggerTimeStateB;
return this.state.initialLoadComplete ? (
<ErrorBoundary>
+<<<<<<< HEAD
<section id="timeline" className="timeline-inner clearfix">
<div id="timeline-header"
className={hasSubdailyLayers ? 'subdaily' : ''}
@@ -641,74 +659,210 @@ class Timeline extends React.Component {
timelineStartDateLimit={timelineStartDateLimit}
timelineEndDateLimit={timelineEndDateLimit}
timeScale={timeScale}
+=======
+ {this.props.isSmallScreen
+ ? <MobileDatePicker
+ date={selectedDate}
+ startDateLimit={timelineStartDateLimit}
+ endDateLimit={timelineEndDateLimit}
+ hasSubdailyLayers={this.props.hasSubdailyLayers}
+ changeDate={this.changeDate}
+ />
+ : <section id="timeline" className="timeline-inner clearfix">
+ <div id="timeline-header"
+ className={hasSubdailyLayers ? 'subdaily' : ''}
+ >
+ <div id="date-selector-main">
+ <DateSelector
+ onDateChange={this.changeDate}
+ date={new Date(selectedDate)}
+ hasSubdailyLayers={hasSubdailyLayers}
+ draggerSelected={draggerSelected}
+ maxDate={new Date(timelineEndDateLimit)}
+ minDate={new Date(timelineStartDateLimit)}
+ fontSize={24}
+ />
+ </div>
+ <div id="zoom-buttons-group">
+ <TimeScaleIntervalChange
+ setTimeScaleIntervalChangeUnit={this.setTimeScaleIntervalChangeUnit}
+ customIntervalZoomLevel={timeScaleFromNumberKey[customIntervalZoomLevel]}
+ customSelected={customSelected}
+ customDelta={customIntervalValue}
+ timeScaleChangeUnit={timeScaleChangeUnit}
+ />
+ <DateChangeArrows
+ leftArrowDown={this.decrementDate}
+ leftArrowUp={this.stopper}
+ leftArrowDisabled={leftArrowDisabled}
+ rightArrowDown={this.incrementDate}
+ rightArrowUp={this.stopper}
+ rightArrowDisabled={rightArrowDisabled}
+ />
+ </div>
+ <AnimationButton
+ disabled={animationDisabled}
+ clickAnimationButton={this.clickAnimationButton}
+ />
+ </div>
+ <div id="timeline-footer"
+ style={{
+ display:
+ this.state.timelineHidden || hideTimeline ? 'none' : 'block'
+ }}
+ >
+ {/* Timeline */}
+ <TimelineAxis
+>>>>>>> add mobile date picker, WIP mobile and tablet drag handling
frontDate={this.state.frontDate}
backDate={this.state.backDate}
+ isTimelineDragging={this.state.isTimelineDragging}
+ moved={this.state.moved}
+ axisWidth={axisWidth}
+ dateA={dateA}
+ dateB={dateB}
+ hasSubdailyLayers={hasSubdailyLayers}
+ changeTimeScale={this.changeTimeScale}
+ compareModeActive={compareModeActive}
draggerSelected={draggerSelected}
- transformX={this.state.transformX}
- width={axisWidth}
- setDraggerVisibility={this.setDraggerVisibility}
- toggleShowDraggerTime={this.toggleShowDraggerTime}
onChangeSelectedDragger={this.onChangeSelectedDragger}
+ timelineStartDateLimit={timelineStartDateLimit}
+ timelineEndDateLimit={timelineEndDateLimit}
+ animStartLocationDate={animStartLocationDate}
+ animEndLocationDate={animEndLocationDate}
+ isAnimationDraggerDragging={this.state.isAnimationDraggerDragging}
updateDraggerDatePosition={this.updateDraggerDatePosition}
- compareModeActive={compareModeActive}
- // draggerTimeState={dateA}
- // draggerTimeStateB={dateB}
draggerTimeState={this.state.draggerTimeState}
draggerTimeStateB={this.state.draggerTimeStateB}
+ // draggerTimeState={dateA}
+ // draggerTimeStateB={dateB}
draggerPosition={this.state.draggerPosition}
draggerPositionB={this.state.draggerPositionB}
draggerVisible={this.state.draggerVisible}
draggerVisibleB={this.state.draggerVisibleB}
+ transformX={this.state.transformX}
+ updatePositioning={this.updatePositioning}
+ position={this.state.position}
+ animationStartLocation={this.state.animationStartLocation}
+ animationEndLocation={this.state.animationEndLocation}
+ timeScale={timeScale}
+ showHoverOn={this.showHoverOn}
+ showHoverOff={this.showHoverOff}
+ showHover={this.showHover}
+ leftOffset={this.state.leftOffset}
+ hoverTime={this.state.hoverTime}
isDraggerDragging={this.state.isDraggerDragging}
/>
- : null }
- {!this.state.isTimelineDragging
- ? <DateToolTip
- draggerSelected={draggerSelected}
- draggerPosition={this.state.draggerPosition}
- draggerPositionB={this.state.draggerPositionB}
- hasSubdailyLayers={hasSubdailyLayers}
- leftOffset={this.state.leftOffset}
- showDraggerTime={this.state.showDraggerTime}
- draggerTimeState={this.state.draggerTimeState}
- draggerTimeStateB={this.state.draggerTimeStateB}
- hoverTime={this.state.hoverTime}
+ <HoverLine
+ width={axisWidth}
+ isTimelineDragging={this.state.isTimelineDragging}
showHoverLine={this.state.showHoverLine}
- axisWidth={axisWidth}
+ hoverLinePosition={this.state.hoverLinePosition}
/>
- : null
- }
- {/* custom interval selector */}
- <CustomIntervalSelectorWidget
- customDelta={customIntervalValue}
- customIntervalZoomLevel={customIntervalZoomLevel}
- toggleCustomIntervalModal={this.toggleCustomIntervalModal}
- customIntervalModalOpen={this.state.customIntervalModalOpen}
- changeCustomInterval={this.changeCustomInterval}
- hasSubdailyLayers={hasSubdailyLayers}
- />
- </div>
+ {isAnimationWidgetOpen
+ ? <TimelineRangeSelector
+ position={this.state.position}
+ frontDate={this.state.frontDate}
+ isAnimationDraggerDragging={this.state.isAnimationDraggerDragging}
+ timeScale={timeScale}
+ startLocation={this.state.animationStartLocation}
+ endLocation={this.state.animationEndLocation}
+ startLocationDate={this.state.animationStartLocationDate}
+ endLocationDate={this.state.animationEndLocationDate}
+ timelineStartDateLimit={timelineStartDateLimit}
+ timelineEndDateLimit={timelineEndDateLimit}
+ updateAnimationDateAndLocation={this.updateAnimationDateAndLocation}
+ animationDraggerDateUpdate={this.animationDraggerDateUpdate}
+ max={this.state.rangeSelectorMax}
+ pinWidth={5}
+ width={axisWidth}
+ transformX={this.state.transformX}
+ rangeOpacity={0.3}
+ rangeColor={'#45bdff'}
+ startColor={'#40a9db'}
+ startTriangleColor={'#fff'}
+ endColor={'#295f92'}
+ endTriangleColor={'#4b7aab'} />
+ : null
+ }
- {/* Zoom Level Change */}
- <AxisTimeScaleChange
- isDraggerDragging={this.state.isDraggerDragging}
- timelineHidden={this.state.timelineHidden}
- timeScale={this.props.timeScale}
- changeTimeScale={this.changeTimeScale}
- hasSubdailyLayers={this.props.hasSubdailyLayers}
- />
+ {this.state.frontDate
+ ? <DraggerContainer
+ position={this.state.position}
+ timelineStartDateLimit={timelineStartDateLimit}
+ timelineEndDateLimit={timelineEndDateLimit}
+ timeScale={timeScale}
+ frontDate={this.state.frontDate}
+ backDate={this.state.backDate}
+ draggerSelected={draggerSelected}
+ transformX={this.state.transformX}
+ width={axisWidth}
+ setDraggerVisibility={this.setDraggerVisibility}
+ toggleShowDraggerTime={this.toggleShowDraggerTime}
+ onChangeSelectedDragger={this.onChangeSelectedDragger}
+ updateDraggerDatePosition={this.updateDraggerDatePosition}
+ compareModeActive={compareModeActive}
+ // draggerTimeState={dateA}
+ // draggerTimeStateB={dateB}
+ draggerTimeState={this.state.draggerTimeState}
+ draggerTimeStateB={this.state.draggerTimeStateB}
+ draggerPosition={this.state.draggerPosition}
+ draggerPositionB={this.state.draggerPositionB}
+ draggerVisible={this.state.draggerVisible}
+ draggerVisibleB={this.state.draggerVisibleB}
+ isDraggerDragging={this.state.isDraggerDragging}
+ />
+ : null }
+
+ {!this.state.isTimelineDragging
+ ? <DateToolTip
+ draggerSelected={draggerSelected}
+ draggerPosition={this.state.draggerPosition}
+ draggerPositionB={this.state.draggerPositionB}
+ hasSubdailyLayers={hasSubdailyLayers}
+ leftOffset={this.state.leftOffset}
+ showDraggerTime={this.state.showDraggerTime}
+ draggerTimeState={this.state.draggerTimeState}
+ draggerTimeStateB={this.state.draggerTimeStateB}
+ hoverTime={this.state.hoverTime}
+ showHoverLine={this.state.showHoverLine}
+ axisWidth={axisWidth}
+ />
+ : null
+ }
+
+ {/* custom interval selector */}
+ <CustomIntervalSelectorWidget
+ customDelta={customIntervalValue}
+ customIntervalZoomLevel={customIntervalZoomLevel}
+ toggleCustomIntervalModal={this.toggleCustomIntervalModal}
+ customIntervalModalOpen={this.state.customIntervalModalOpen}
+ changeCustomInterval={this.changeCustomInterval}
+ hasSubdailyLayers={hasSubdailyLayers}
+ />
+ </div>
- {/* πŸ” Open/Close Chevron πŸ” */}
- <div id="timeline-hide" onClick={this.toggleHideTimeline}>
- <div
- className={`wv-timeline-hide wv-timeline-hide-double-chevron-${
- this.state.timelineHidden ? 'left' : 'right'
- }`}
+ {/* Zoom Level Change */}
+ <AxisTimeScaleChange
+ isDraggerDragging={this.state.isDraggerDragging}
+ timelineHidden={this.state.timelineHidden}
+ timeScale={this.props.timeScale}
+ changeTimeScale={this.changeTimeScale}
+ hasSubdailyLayers={this.props.hasSubdailyLayers}
/>
- </div>
- </section>
+
+ {/* πŸ” Open/Close Chevron πŸ” */}
+ <div id="timeline-hide" onClick={this.toggleHideTimeline}>
+ <div
+ className={`wv-timeline-hide wv-timeline-hide-double-chevron-${
+ this.state.timelineHidden ? 'left' : 'right'
+ }`}
+ />
+ </div>
+ </section>
+ }
</ErrorBoundary>
) : null;
}
@@ -735,9 +889,10 @@ function mapStateToProps(state) {
customInterval,
customDelta
} = date;
- const { screenWidth } = browser;
+ const { screenWidth, lessThan } = browser;
const { isCompareA, activeString } = compare;
const compareModeActive = compare.active;
+ const isSmallScreen = lessThan.medium;
let hasSubdailyLayers = hasSubDaily(layers[compare.activeString]);
customSelected = Boolean(customSelected);
@@ -792,6 +947,7 @@ function mapStateToProps(state) {
timelineEndDateLimit
);
return {
+ isSmallScreen,
draggerSelected: isCompareA ? 'selected' : 'selectedB', // ! will work for dragger?
hasSubdailyLayers,
customSelected,