Interactive interface for browsing global, full-resolution satellite imagery
clean up dev ui for demo
Edward Plato6e947539206b
diff --git a/config/default/common/config/wv.json/layerOrder.json b/config/default/common/config/wv.json/layerOrder.jsonindex f4c2003d6..dbeb3402f 100644--- a/config/default/common/config/wv.json/layerOrder.json+++ b/config/default/common/config/wv.json/layerOrder.json@@ -870,7 +870,8 @@"OrbitTracks_Terra_Ascending","OrbitTracks_Terra_Descending",- "GOES16_Air_Mass_v0_STD"+ "GOES16_Air_Mass_v0_STD",+ "GOES16_Band13_Clean_Infrared_v0_STD"],"layerOrderExceptions": ["SCAR_Land_Mask",diff --git a/config/default/common/config/wv.json/layers/goes/GOES16_Band13_Clean_Infrared_v0_STD.json b/config/default/common/config/wv.json/layers/goes/GOES16_Band13_Clean_Infrared_v0_STD.jsonnew file mode 100644index 000000000..64da908f2--- /dev/null+++ b/config/default/common/config/wv.json/layers/goes/GOES16_Band13_Clean_Infrared_v0_STD.json@@ -0,0 +1,16 @@+{+ "layers": {+ "GOES16_Band13_Clean_Infrared_v0_STD": {+ "id": "GOES16_Band13_Clean_Infrared_v0_STD",+ "title": "Clean Infrared (Band 13, 10.3 µm, GOES-16)",+ "subtitle": "GOES",+ "description": "goes/GOES16_Band13_Clean_Infrared_v0_STD",+ "group": "baselayers",+ "tags": "goes",+ "layergroup": [+ "goes"+ ],+ "wrapadjacentdays": true+ }+ }+}diff --git a/web/css/anim.widget.css b/web/css/anim.widget.cssindex 370c408ae..7121a40fc 100644--- a/web/css/anim.widget.css+++ b/web/css/anim.widget.css@@ -13,7 +13,7 @@}.wv-animation-widget.subdaily {- width: 402px;+ width: 460px;}.wv-animation-widget .wv-slider-case {padding-right: 3px;diff --git a/web/css/dateselector.css b/web/css/dateselector.cssindex ce2e3ffdf..2bb1615fa 100644--- a/web/css/dateselector.css+++ b/web/css/dateselector.css@@ -1,4 +1,4 @@-.wv-date-selector-widget .input-wrapper {+.wv-date-selector-widget .input-wrapper, .date-arrow-wrapper {background: transparent;border: 1px solid transparent;vertical-align: middle;@@ -82,26 +82,26 @@display: inline-block;}-.wv-date-selector-widget .date-arrows {+.wv-date-selector-widget .date-arrows, .date-arrows {display: block;height: 10px;}-.wv-date-selector-widget .date-arrows svg {+.wv-date-selector-widget .date-arrows svg, .date-arrows svg {vertical-align: top;display: block;margin: 0 auto;}-.wv-date-selector-widget .date-arrows svg path {+.wv-date-selector-widget .date-arrows svg path, .date-arrows svg path {fill: #444;}-.wv-date-selector-widget .input-wrapper:hover .date-arrows:hover svg path {+.wv-date-selector-widget .input-wrapper:hover .date-arrows:hover svg path, .date-arrows:hover svg path {fill: #1a1a1a;}-.wv-date-selector-widget .date-arrow-down {+.wv-date-selector-widget .date-arrow-down, .date-arrow-down {-webkit-transform: scaleY(-1);transform: scaleY(-1);-webkit-filter: FlipV;diff --git a/web/js/animation/ui.js b/web/js/animation/ui.jsindex a961944f1..7c1ec52e3 100644--- a/web/js/animation/ui.js+++ b/web/js/animation/ui.js@@ -200,7 +200,7 @@ export function animationUi(models, ui) {**/- // # need to change subdaily argument for custom intervals - rework for all zoom levels presumably+ // # need to change subdaily argument for custom intervals - rework for all zoom levels presumablyself.nextDate = function (date) {if (models.date.selectedZoom === 4) {return util.dateAdd(date, self.getInterval(), 15);diff --git a/web/js/app.js b/web/js/app.jsindex 83b8abfeb..02c8acc69 100644--- a/web/js/app.js+++ b/web/js/app.js@@ -234,6 +234,14 @@ class App extends React.Component {>Minutes</span>+ <span+ id="zoom-custom"+ className="zoom-btn zoom-btn-inactive zoom-custom"+ data-zoom="custom"+ style={{color: '#7890cd'}}+ >+ Custom+ </span></div></div></div>diff --git a/web/js/components/date-selector/date-selector.js b/web/js/components/date-selector/date-selector.jsindex e13971215..94429141d 100644--- a/web/js/components/date-selector/date-selector.js+++ b/web/js/components/date-selector/date-selector.js@@ -126,6 +126,7 @@ class DateSelector extends React.Component {}}render() {+ // console.log(this.props.date)return (<div className="wv-date-selector-widget"><DateInputColumndiff --git a/web/js/components/timeline/custom-interval-selector.js b/web/js/components/timeline/custom-interval-selector.jsindex 69fd68103..86600cba7 100644--- a/web/js/components/timeline/custom-interval-selector.js+++ b/web/js/components/timeline/custom-interval-selector.js@@ -132,11 +132,12 @@ class CustomIntervalSelectorWidget extends React.Component {render() {return (<div- id="wv-animation-widget"+ id="wv-animation-widget-custom-interval"// className={// 'wv-animation-widget' + (this.state.maxZoom >= 4 ? ' subdaily' : '')// }className='wv-animation-widget'+ style={{display: }}>{/* <AnimWidgetHeadertext={this.state.increment}diff --git a/web/js/components/timeline/interval-selector/interval-input.js b/web/js/components/timeline/interval-selector/interval-input.jsnew file mode 100644index 000000000..ae712613e--- /dev/null+++ b/web/js/components/timeline/interval-selector/interval-input.js@@ -0,0 +1,77 @@+import React, { PureComponent } from 'react';+import PropTypes from 'prop-types';+// import util from '../../util/util';++/*+ * A react component, is a draggable svg+ * group. It is a parent component that+ * rerenders when child elements are dragged+ *+ * @class TimelineRangeSelector+ */+class IntervalInput extends PureComponent {+ onKeyInput = (e) => {+ const regex = /^[0-9\b]+$/;+ const value = e.target.value;+ if (value === '' || regex.test(value)) {+ this.props.changeInterval(value);+ }+ }++ onClickUp = () => {+ let value = this.props.intervalValue;+ this.props.changeInterval(value + 1);+ }++ onClickDown = () => {+ let value = this.props.intervalValue;+ if (value > 1) {+ this.props.changeInterval(value - 1);+ }+ }+ render() {+ return (+ <div className="date-arrow-wrapper">+ <div+ onClick={this.onClickUp}+ className="date-arrows date-arrow-up"+ >+ <svg width="25" height="8">+ <path d="M 12.5,0 25,8 0,8 z" className="uparrow" />+ </svg>+ </div>+ <input className="interval-input" type="text" min="1" step="1" value={this.props.intervalValue} onChange={this.onKeyInput} />+ <div+ onClick={this.onClickDown}+ className="date-arrows date-arrow-down"+ >+ <svg width="25" height="8">+ <path d="M 12.5,0 25,8 0,8 z" className="downarrow" />+ </svg>+ </div>+ </div>++ );+ }+}++// IntervalInput.propTypes = {+// value: PropTypes.node,+// focused: PropTypes.bool,+// tabIndex: PropTypes.number,+// step: PropTypes.number,+// type: PropTypes.string,+// updateDate: PropTypes.func,+// date: PropTypes.object,+// minDate: PropTypes.object,+// maxDate: PropTypes.object,+// maxZoom: PropTypes.number,+// blur: PropTypes.func,+// setFocusedTab: PropTypes.func,+// changeTab: PropTypes.func,+// height: PropTypes.string,+// inputId: PropTypes.string,+// fontSize: PropTypes.number+// };++export default IntervalInput;diff --git a/web/js/components/timeline/interval-selector/interval-selector.js b/web/js/components/timeline/interval-selector/interval-selector.jsnew file mode 100644index 000000000..9df3e7e3f--- /dev/null+++ b/web/js/components/timeline/interval-selector/interval-selector.js@@ -0,0 +1,102 @@+import React from 'react';+import PropTypes from 'prop-types';+import IntervalInput from './interval-input';+import TimeScaleSelect from './timescale-select';+import Button from '../../util/button';++/*+ * A react component, Builds a rather specific+ * interactive widget+ *+ * @class AnimationWidget+ * @extends React.Component+ */+class CustomIntervalSelectorWidget extends React.Component {+ constructor(props) {+ super(props);+ this.state = {+ intervalValue: 1,+ zoomLevel: 'day'+ };+ }++ changeInterval = (value) => {+ this.setState({+ intervalValue: value+ })+ }++ changeZoomLevel = (value) => {+ this.setState({+ zoomLevel: value+ })+ }++ reset = () => {+ this.setState({+ intervalValue: 1,+ zoomLevel: this.props.customIntervalZoomLevel+ })+ }++ componentDidMount() {+ this.setState({+ intervalValue: this.props.customIntervalValue,+ zoomLevel: this.props.customIntervalZoomLevel+ })+ }++ render() {+ return (+ <div+ id="wv-animation-widget-custom-interval"+ // className={+ // 'wv-animation-widget' + (this.state.maxZoom >= 4 ? ' subdaily' : '')+ // }+ className='wv-animation-widget'+ style={{display: this.props.customIntervalModalOpen ? 'block' : 'none', height: '110px'}}+ >++ <div>Custom Interval Selector</div>+ <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', marginTop: '10px' }}>+ <div style={{display: 'flex', flexDirection: 'row' }}>+ <IntervalInput+ intervalValue={this.state.intervalValue}+ changeInterval={this.changeInterval}+ />+ <TimeScaleSelect+ zoomLevel={this.state.zoomLevel}+ changeZoomLevel={this.changeZoomLevel}+ />+ </div>++ <div style={{display: 'flex', flexDirection: 'column' }} className="custom-interval-buttons">+ <Button+ onClick={() => this.props.setInterval(this.state.intervalValue, this.state.zoomLevel)}+ id='set-interval-button'+ text='Set'+ className='red'+ style={{marginBottom: '10px'}}+ />+ <Button+ onClick={() => this.reset()}+ id='reset-interval-button'+ text='Reset'+ />+ </div>+ </div>++ <i className="fa fa-times wv-close" onClick={this.props.toggleCustomIntervalModal}/>+ </div>+ );+ }+}++CustomIntervalSelectorWidget.propTypes = {+ setInterval: PropTypes.func,+ toggleCustomIntervalModal: PropTypes.func,+ customIntervalValue: PropTypes.number,+ customIntervalZoomLevel: PropTypes.string+};++export default CustomIntervalSelectorWidget;diff --git a/web/js/components/timeline/interval-selector/timescale-select.js b/web/js/components/timeline/interval-selector/timescale-select.jsnew file mode 100644index 000000000..befca7fc1--- /dev/null+++ b/web/js/components/timeline/interval-selector/timescale-select.js@@ -0,0 +1,30 @@+import React, { PureComponent } from 'react';++class TimeScaleSelect extends PureComponent {+ handleChangeZoomLevel = (e) => {+ let zoomLevel = e.target.value;+ this.props.changeZoomLevel(zoomLevel);+ }++ handleSubmit = (e) => {+ e.preventDefault();+ }++ render() {+ return (+ <form className="interval-timescale-select" onSubmit={this.handleSubmit}>+ <label>+ <select value={this.props.zoomLevel} onChange={this.handleChangeZoomLevel}>+ <option value="year">year</option>+ <option value="month">month</option>+ <option value="day">day</option>+ <option value="hour">hour</option>+ <option value="minute">minute</option>+ </select>+ </label>+ </form>+ );+ }+}++export default TimeScaleSelect;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.jsindex 29b9c7281..525d691e6 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@@ -36,7 +36,8 @@ const axisScaleGridElement = {return (<React.Fragment>{/* <rect className="grid" width={gridWidth} height={100} transform={`translate(${index * gridWidth}, 0)`} fill={item.withinRange ? 'rgba(0,0,0,0)' : 'black'} shapeRendering="optimizeSpeed"></rect> */}- <rect className="grid" width={gridWidth} height={100} transform={`translate(${index * gridWidth}, 0)`} fill={midTile ? 'yellow' : 'rgba(0,0,0,0)'} shapeRendering="optimizeSpeed"></rect>+ {/* <rect className="grid" width={gridWidth} height={100} transform={`translate(${index * gridWidth}, 0)`} fill={midTile ? 'yellow' : 'rgba(0,0,0,0)'} shapeRendering="optimizeSpeed"></rect> */}+ <rect className="grid" width={gridWidth} height={100} transform={`translate(${index * gridWidth}, 0)`} fill='rgba(0,0,0,0)' shapeRendering="optimizeSpeed"></rect><line stroke="black" strokeLinecap="round" strokeWidth="0.2" x1="0" x2="0" y1="0" y2={lineLengthY} transform={`translate(${index * gridWidth + 2.2}, 0)`} /><line stroke="white" strokeLinecap="round" strokeWidth="2" x1="0" x2="0" y1="0" y2={lineLengthY} transform={`translate(${index * gridWidth + 1}, 0)`} /></React.Fragment>diff --git a/web/js/components/timeline/timeline-axis/timeline-axis.js b/web/js/components/timeline/timeline-axis/timeline-axis.jsindex 6507d6011..dbffc3c06 100644--- a/web/js/components/timeline/timeline-axis/timeline-axis.js+++ b/web/js/components/timeline/timeline-axis/timeline-axis.js@@ -119,7 +119,7 @@ class TimelineAxis extends React.Component {let hoverTime = moment.utc(this.state.hoverTime);hoverTime = inputDate ? moment.utc(inputDate) : hoverTime;- console.log(hoverTime.format())+ // console.log(hoverTime.format())let hoverTimeZero;let hoverTimeNextZero;@@ -349,6 +349,7 @@ class TimelineAxis extends React.Component {draggerPositionB: draggerPositionB,draggerVisibleB: draggerVisibleB,position: position,+ showHoverLine: false}));} else {// reset dragSentinelCount on direction change to remaining distance to dragSentinelChangeNumber@@ -357,7 +358,8 @@ class TimelineAxis extends React.Component {draggerPosition: draggerPosition,draggerPositionB: draggerPositionB,position: position,- dragSentinelCount: newDragSentinelCount+ dragSentinelCount: newDragSentinelCount,+ showHoverLine: false}));}} else if (deltaX < 0) { // dragging left - exposing future dates@@ -392,6 +394,7 @@ class TimelineAxis extends React.Component {draggerPositionB: draggerPositionB,draggerVisibleB: draggerVisibleB,position: position,+ showHoverLine: false}));} else {// reset dragSentinelCount on direction change to remaining distance to dragSentinelChangeNumber@@ -400,7 +403,8 @@ class TimelineAxis extends React.Component {draggerPosition: draggerPosition,draggerPositionB: draggerPositionB,position: position,- dragSentinelCount: newDragSentinelCount+ dragSentinelCount: newDragSentinelCount,+ showHoverLine: false}));}}@@ -457,7 +461,7 @@ class TimelineAxis extends React.Component {if (draggerVisible === false) {// draggerPositionRevision = Math.abs(frontDate.diff(draggerDateActual, timeScale, true) * gridWidth);draggerPositionRevision = Math.abs(frontDate.diff(draggerDateActual, timeScale, true) * gridWidth) + position + transform - 50;- console.log('NOW VISIBLE', draggerPositionRevision)+ // console.log('NOW VISIBLE', draggerPositionRevision)}draggerVisible = true;} else {@@ -569,7 +573,7 @@ class TimelineAxis extends React.Component {// if (this.state.leftOffset === this.state.redLineClick) {// console.log(!this.state.moved && !this.state.timeScaleChange)if (!this.state.moved) {- console.log('inner')+ // console.log('inner')// let draggerTimeState = this.showTime(this.state.leftOffsetRelativeToInnerParent);// this.handleDragDragger(null, {'deltaX': this.state.leftOffset})let draggerPosition = this.state.draggerSelected ? this.state.leftOffset - 49 : this.state.draggerPosition;@@ -593,7 +597,7 @@ class TimelineAxis extends React.Component {let axisWidth = this.props.width;let timeScale = this.state.timeScale;this.updateScale(null, timeScale, axisWidth);- console.log('resize')+ // console.log('resize')this.setState({axisWidth: axisWidth}, function() {@@ -613,7 +617,7 @@ class TimelineAxis extends React.Component {let time = moment.utc(this.props.selectedDate).format() //'1941-01-01T12:00:00Z';// time = moment.utc(time.toISOString());- console.log(time)+ // console.log(time)// let draggerTimeStateBDraggerBTest = '1941-01-03T12:00:00Z';let draggerTimeStateBDraggerBTest = moment.utc(time).add(7, timeScale).format();@@ -755,9 +759,9 @@ class TimelineAxis extends React.Component {// console.log(newSelectedDate.format(), frontDate.format(), manualTimeScaleChangeUnit, gridWidth)// console.log(moment.utc(this.props.selectedDate).format(), moment.utc(prevProps.selectedDate).format())let newDraggerPosition = this.getDraggerPosition(newSelectedDate, frontDate, manualTimeScaleChangeUnit, gridWidth)- console.log(this.state.draggerPosition, newDraggerPosition)-+ // console.log(this.state.draggerPosition, newDraggerPosition)+ // console.log(this.props, newSelectedDate, moment.utc(this.props.selectedDate).format())this.setDraggerToTime(this.props.selectedDate)// if (this.props.changeAmt !== null) {// console.log('hit')@@ -782,7 +786,7 @@ class TimelineAxis extends React.Component {// move red line forward one timeScale unit and update timesetDraggerToTime = (inputTime) => {- console.log(inputTime)+ // console.log(inputTime)// let timeScaleSelected = manualTimeScaleChangeUnit ? manualTimeScaleChangeUnit : this.state.timeScaleSelectValue;let frontDate = moment.utc(this.state.deque.peekFront().rawDate);let backDate = moment.utc(this.state.deque.peekBack().rawDate);@@ -821,10 +825,12 @@ class TimelineAxis extends React.Component {// TODO: may need to restrict based on zoom levels, year zoom adding 7 minutes does nothing for example// move red line forward one timeScale unit and update timeaddTimeUnit = (manualTimeScaleChangeUnit, manualIncrementAmount) => {- let timeScaleSelected = manualTimeScaleChangeUnit ? manualTimeScaleChangeUnit : this.state.timeScaleSelectValue;+ // let timeScaleSelected = manualTimeScaleChangeUnit ? manualTimeScaleChangeUnit : this.state.timeScaleSelectValue;+ let timeScaleSelected = this.props.customIntervalZoomLevel;let frontDate = moment.utc(this.state.deque.peekFront().rawDate);let backDate = moment.utc(this.state.deque.peekBack().rawDate);- let increment = manualIncrementAmount ? manualIncrementAmount : this.state.increment;+ // let increment = manualIncrementAmount ? manualIncrementAmount : this.state.increment;+ let increment = this.props.customIntervalValue;let draggerTimeState = moment.utc(this.state.draggerTimeState, 'YYYY-MM-DDTHH:mm:ss.SSSZ');let draggerTimeStateAdded = draggerTimeState.clone().add(increment, timeScaleSelected);@@ -857,10 +863,12 @@ class TimelineAxis extends React.Component {// move red line backward one timeScale unit and update timeminusTimeUnit = (manualTimeScaleChangeUnit, manualIncrementAmount) => {- let timeScaleSelected = manualTimeScaleChangeUnit ? manualTimeScaleChangeUnit : this.state.timeScaleSelectValue;+ // let timeScaleSelected = manualTimeScaleChangeUnit ? manualTimeScaleChangeUnit : this.state.timeScaleSelectValue;+ let timeScaleSelected = this.props.customIntervalZoomLevel;let frontDate = moment.utc(this.state.deque.peekFront().rawDate);let backDate = moment.utc(this.state.deque.peekBack().rawDate);- let increment = manualIncrementAmount ? manualIncrementAmount : this.state.increment;+ // let increment = manualIncrementAmount ? manualIncrementAmount : this.state.increment;+ let increment = this.props.customIntervalValue;let draggerTimeState = moment.utc(this.state.draggerTimeState, 'YYYY-MM-DDTHH:mm:ss.SSSZ');let draggerTimeStateSubtracted = draggerTimeState.clone().subtract(increment, timeScaleSelected);@@ -1136,7 +1144,7 @@ handleDragDragger = (draggerName, e, d) => {window.moment = moment;return (<div>- <div style={{display: 'flex', position: 'relative', left: (window.innerWidth * 0.05)}}>+ {/* <div style={{display: 'flex', position: 'relative', left: (window.innerWidth * 0.05)}}><div style={{display: 'flex', background: '#999', border: '1px solid black', width: '155px', height: '100px'}}><form onSubmit={this.handleSubmit.bind(this)}><label>@@ -1166,7 +1174,7 @@ handleDragDragger = (draggerName, e, d) => {<div><button onClick={(e) => this.toggleCompareMode(e)}>Compare Mode</button></div>- </div>+ </div> */}<div id="wv-timeline-axis"// ref={this.timelineRef} //# REFstyle={{width: `${this.state.axisWidth}px`}}@@ -1241,7 +1249,7 @@ handleDragDragger = (draggerName, e, d) => {<div className="dateToolTip" style={{transform: `translate(${this.state.leftOffset - 52}px, -100px)`, display: !this.state.showDraggerTime && this.state.showHoverLine ? 'block' : 'none'}}>{!this.state.showDraggerTime && this.state.hoverTime ? this.state.hoverTime : null}</div></div>- <div style={{ display: 'flex', marginTop: 10 }}>+ {/* <div style={{ display: 'flex', marginTop: 10 }}><div className="dateTempHolderTextBlock" style={{borderColor: 'blue'}}><h4 style={{marginTop: 5, marginBottom: 5}}>HOVER TIME</h4><p style={{marginTop: 5, marginBottom: 0, fontSize: 20}}>{this.state.hoverTime ? this.state.hoverTime : null}</p>@@ -1258,7 +1266,7 @@ handleDragDragger = (draggerName, e, d) => {<h4 style={{marginTop: 5, marginBottom: 5}}>TIMESCALE ZOOM</h4><p style={{marginTop: 5, marginBottom: 0, fontSize: 20}}>{this.state.timeScale ? this.state.timeScale.toUpperCase() : null}</p></div>- </div>+ </div> */}</div>);}diff --git a/web/js/components/timeline/timeline-axis/timeline-dragger.js b/web/js/components/timeline/timeline-axis/timeline-dragger.jsindex 0c999c264..9008a13e0 100644--- a/web/js/components/timeline/timeline-axis/timeline-dragger.js+++ b/web/js/components/timeline/timeline-axis/timeline-dragger.js@@ -18,7 +18,8 @@ class Dragger extends PureComponent {// }}><g style={{cursor: 'pointer', display: this.props.draggerVisible ? 'flex' : 'none'}} className='gridShell dragger' transform={`translate(${transformX}, 0)`}>- <polygon fill='#ccc' stroke={this.props.draggerSelected ? 'yellow' : '#515151'} strokeWidth='2px' points='50,25, 90,90, 10,90'></polygon>+ {/* <polygon fill='#ccc' stroke={this.props.draggerSelected ? 'yellow' : '#515151'} strokeWidth='2px' points='50,25, 90,90, 10,90'></polygon> */}+ <polygon fill='#ccc' stroke='#515151' strokeWidth='2px' points='50,25, 90,90, 10,90'></polygon>{compareOn ?<text fontSize='30px' fontWeight='700' x='0' y='65' fill='#515151' transform='translate(39, 10)' textRendering='optimizeLegibility' clipPath='url(#textDisplay)'>{draggerName}</text>:diff --git a/web/js/components/timeline/timeline-controls/date-change-controls.js b/web/js/components/timeline/timeline-controls/date-change-controls.jsindex d011769a8..ab99951f9 100644--- a/web/js/components/timeline/timeline-controls/date-change-controls.js+++ b/web/js/components/timeline/timeline-controls/date-change-controls.js@@ -54,8 +54,8 @@ class DateChangeControls extends React.Component {<DateSelector{...mockDateSelectorProps}/>- <DateZoomChange />- <DateChangeArrows />+ {/* <DateZoomChange />+ <DateChangeArrows /> */}{/* animation button */}{/* <divdiff --git a/web/js/components/timeline/timeline-controls/date-zoom-change.js b/web/js/components/timeline/timeline-controls/date-zoom-change.jsindex 20682b64b..0a2298927 100644--- a/web/js/components/timeline/timeline-controls/date-zoom-change.js+++ b/web/js/components/timeline/timeline-controls/date-zoom-change.js@@ -5,18 +5,18 @@ class DateZoomChange extends PureComponent {return (<div>- {/* <div id="zoom-btn-container"> */}+ <div id="zoom-btn-container">{/* timeScale display */}- {/* <span+ <spanid="current-zoom"className="zoom-btn zoom-btn-active"data-zoom="3">Days- </span> */}+ </span>{/* hover timeScale unit dialog / entry point to Custom selector */}- {/* <div className="wv-tooltip">+ <div className="wv-tooltip"><div id="timeline-zoom" className="timeline-zoom"><spanid="zoom-years"@@ -46,9 +46,16 @@ class DateZoomChange extends PureComponent {>Minutes</span>+ <span+ id="zoom-custom"+ className="zoom-btn zoom-btn-inactive zoom-custom"+ data-zoom="5"+ >+ Custom+ </span></div></div>- </div> */}+ </div></div>);diff --git a/web/js/components/timeline/timeline.css b/web/js/components/timeline/timeline.cssindex af284528e..d203b10a1 100644--- a/web/js/components/timeline/timeline.css+++ b/web/js/components/timeline/timeline.css@@ -11,12 +11,14 @@ html, body {/* margin-top: 200px;background: yellow; */position: absolute;- top: 200px;+ /* top: 200px; */+ bottom: -24px;+ left: 416px;}#wv-timeline-axis {/* margin: 0 20px 0 0; */- margin-left: 25%;+ /* margin-left: 25%; */width: 800px;height: 100px;/* position: absolute;@@ -31,7 +33,7 @@ html, body {.inner {background: rgba(0, 0, 0, 0.5);- height: 71px;+ height: 66px;display: flex;flex-direction: row;align-items: center;@@ -134,4 +136,95 @@ form select {#timelineContainer > div:nth-child(1) > div.wv-date-selector-widget {background: #999;-}\ No newline at end of file+}++.interval-input {+ width: 80px;+ height: 40px;+ color: #7890cd;+ opacity: 1;+ font-size: 24px;+ background: transparent;+ border: 0;+ font-family: 'Roboto Mono', monospace;+ line-height: 1.2em;+ vertical-align: baseline;+ box-sizing: border-box;+ -moz-box-sizing: border-box;+ -webkit-box-sizing: border-box;+ padding: 0;+ text-align: center;+ border: 1px solid #fff;+ margin: 5px 0 5px 0;+}++.interval-timescale-select {+ width: 70px;+ height: 40px;+ color: #7890cd;+ opacity: 1;+ font-size: 24px;+ background: transparent;+ border: 0;+ font-family: 'Roboto Mono', monospace;+ line-height: 1.2em;+ vertical-align: baseline;+ box-sizing: border-box;+ -moz-box-sizing: border-box;+ -webkit-box-sizing: border-box;+ padding: 15px;+ text-align: center;+}++.interval-timescale-select select {+ padding: 0;+ background: #212121;+ color: #7890cd;+ height: 40px;+ width: 130px;+ border: 1px solid #fff;+ margin-top: 1px;+}++.custom-interval-buttons {+ margin-right: 15px;+}++#set-interval-button {+}++#reset-interval-button {++}++/* DEMO DOM CLEANUP */++#timeline-footer-svg {+ opacity: 0;+ display: none;+}++#timeline-header {+ background: rgba(0, 0, 0, 0.8) !important;+}++.timeline-inner {+ background: rgba(0, 0, 0, 0.5) !important;+}++#wv-animation-widget-custom-interval {+ left: -180px;+}++#timeline-hide {+ opacity: 0;+}++#timeline-footer {+ margin-right: 0px !important;+}++#wv-animation-widget {+ margin-left: 500px;+}+diff --git a/web/js/components/timeline/timeline.js b/web/js/components/timeline/timeline.jsindex b3d0cfc5a..fa5b180cd 100644--- a/web/js/components/timeline/timeline.js+++ b/web/js/components/timeline/timeline.js@@ -5,6 +5,7 @@ import DateChangeControls from './timeline-controls/date-change-controls';import './timeline.css';// import TimelineAxis from './timeline-axis';import TimelineAxisContainer from './timeline-axis/timeline-axis-container';+import IntervalSelectorWidget from './interval-selector/interval-selector';class Timeline extends React.Component {constructor(props) {@@ -18,24 +19,27 @@ class Timeline extends React.Component {incrementDate: '',timeScaleChangeUnit: '',changeAmt: '',+ customIntervalValue: '',+ customIntervalZoomLevel: '',+ customIntervalModalOpen: false};}//# may not be necessary if incrementing doesn't matter for performance- dateChange = (date, id, type, amt) => {- // console.log(date, id, type, amt)- let dateFormatted = date.toISOString();- console.log(dateFormatted)- this.setState({- selectedDate: date.toISOString(),- timeScaleChangeUnit: type,- changeAmt: amt,- dateFormatted: dateFormatted- })- }+ // dateChange = (date, id, type, amt) => {+ // // console.log(date, id, type, amt)+ // let dateFormatted = date.toISOString();+ // console.log(dateFormatted)+ // this.setState({+ // selectedDate: date.toISOString(),+ // timeScaleChangeUnit: type,+ // changeAmt: amt,+ // dateFormatted: dateFormatted+ // })+ // }updateDate = (date) => {- console.log(date)+ // console.log(date)this.props.updateDate(date);let dateFormatted = new Date(date).toISOString();// this.setState({@@ -44,8 +48,14 @@ class Timeline extends React.Component {// })}+ toggleCustomIntervalModal = () => {+ this.setState(prevState => ({+ customIntervalModalOpen: !prevState.customIntervalModalOpen+ }))+ }+componentDidUpdate() {- console.log('CDU', this.state)+ // console.log('CDU', this.state, this.props)}componentDidMount() {@@ -61,17 +71,26 @@ class Timeline extends React.Component {timeScale: this.props.timeScale,incrementDate: this.props.incrementDate,timeScaleChangeUnit: this.props.timeScaleChangeUnit,- changeAmt: 1+ changeAmt: 1,+ customIntervalValue: 1,+ customIntervalZoomLevel: this.props.timeScale})}+ setInterval = (intervalValue, zoomLevel) => {+ this.setState({+ customIntervalValue: intervalValue,+ customIntervalZoomLevel: zoomLevel+ }, this.props.setIntervalInput(intervalValue, zoomLevel))+ }+shouldComponentUpdate(nextProps, nextState) {// console.log(this.props, nextProps, this.state, nextState)return true;}render() {- console.log(this.props.selectedDate, this.state.dateFormatted)+ // console.log(this.props.selectedDate, this.state.dateFormatted)// let dateFormatted = this.state.selectedDate.toISOString();// let tempStyle = {// position: 'absolute',@@ -93,12 +112,23 @@ class Timeline extends React.Component {return (this.state.dateFormatted ?<React.Fragment>- <DateChangeControls selectedDate={this.state.dateFormatted} dateChange={this.updateDate} />+ {/* <DateChangeControls+ toggleCustomIntervalModal={this.toggleCustomIntervalModal}+ selectedDate={this.state.dateFormatted}+ dateChange={this.updateDate} /> */}{/* <TimelineAxis {...this.state} selectedDate={dateFormatted}/> */}{/* new modular version - currently a shell */}<TimelineAxisContainer {...this.state} selectedDate={this.state.dateFormatted} updateDate={this.updateDate} />+ {/* custom interval selector */}+ <IntervalSelectorWidget+ setInterval={this.setInterval}+ customIntervalValue={1}+ customIntervalZoomLevel={this.props.timeScale}+ toggleCustomIntervalModal={this.toggleCustomIntervalModal}+ customIntervalModalOpen={this.state.customIntervalModalOpen} />+{/* hammmmmmmmmmmburger 🍔 */}{/* <div id="timeline-hide"><svg className="hamburger" width="10" height="9">diff --git a/web/js/date/config.js b/web/js/date/config.jsindex 646a0d984..eedac360b 100644--- a/web/js/date/config.js+++ b/web/js/date/config.js@@ -1135,6 +1135,7 @@ export function timelineConfig(models, config, ui) {});$('.zoom-btn-inactive').on('click', function(d) {var dataZoom = $(this).attr('data-zoom');+ console.log(dataZoom)switch (dataZoom) {case '1':self.zoom(1);@@ -1145,6 +1146,9 @@ export function timelineConfig(models, config, ui) {case '4':self.zoom(4);break;+ case 'custom':+ // self.zoom(4);+ break;default:self.zoom(3);break;diff --git a/web/js/date/timeline-input.js b/web/js/date/timeline-input.jsindex 11676e81b..08230c628 100644--- a/web/js/date/timeline-input.js+++ b/web/js/date/timeline-input.js@@ -31,22 +31,23 @@ export function timelineInput(models, config, ui) {models.layers.events.on('subdaily-updated', updateMaxZoom);$incrementBtn.mousedown(function(e) {+ console.log(self.delta)e.preventDefault();switch (ui.timeline.config.currentZoom) {case 1:- self.animateByIncrement(1, 'year');+ self.animateByIncrement(self.delta, 'year');break;case 2:- self.animateByIncrement(1, 'month');+ self.animateByIncrement(self.delta, 'month');break;case 3:- self.animateByIncrement(1, 'day');+ self.animateByIncrement(self.delta, 'day');break;case 4:- self.animateByIncrement(1, 'minute');+ self.animateByIncrement(self.delta, 'minute');break;default:- self.animateByIncrement(1, 'day');+ self.animateByIncrement(self.delta, 'day');}}).mouseup(stopper);@@ -56,19 +57,19 @@ export function timelineInput(models, config, ui) {e.preventDefault();switch (ui.timeline.config.currentZoom) {case 1:- self.animateByIncrement(-1, 'year');+ self.animateByIncrement(-self.delta, 'year');break;case 2:- self.animateByIncrement(-1, 'month');+ self.animateByIncrement(-self.delta, 'month');break;case 3:- self.animateByIncrement(-1, 'day');+ self.animateByIncrement(-self.delta, 'day');break;case 4:- self.animateByIncrement(-1, 'minute');+ self.animateByIncrement(-self.delta, 'minute');break;default:- self.animateByIncrement(-1, 'day');+ self.animateByIncrement(-self.delta, 'day');}}).mouseup(stopper);@@ -83,32 +84,32 @@ export function timelineInput(models, config, ui) {case util.key.LEFT:switch (models.date.selectedZoom) {case 1:- self.animateByIncrement(-1, 'year');+ self.animateByIncrement(-self.delta, 'year');break;case 2:- self.animateByIncrement(-1, 'month');+ self.animateByIncrement(-self.delta, 'month');break;case 3:- self.animateByIncrement(-1, 'day');+ self.animateByIncrement(-self.delta, 'day');break;case 4:- self.animateByIncrement(-1, 'minute');+ self.animateByIncrement(-self.delta, 'minute');break;}break;case util.key.RIGHT:switch (models.date.selectedZoom) {case 1:- self.animateByIncrement(1, 'year');+ self.animateByIncrement(self.delta, 'year');break;case 2:- self.animateByIncrement(1, 'month');+ self.animateByIncrement(self.delta, 'month');break;case 3:- self.animateByIncrement(1, 'day');+ self.animateByIncrement(self.delta, 'day');break;case 4:- self.animateByIncrement(1, 'minute');+ self.animateByIncrement(self.delta, 'minute');break;}event.preventDefault();@@ -217,7 +218,6 @@ export function timelineInput(models, config, ui) {animationInProcess = false;// # invokes when mouse over < > and date selector arrows/boxes// # sticks on new timeline date selector- console.log('STOPPPPPPPP')clearInterval(animator);animator = 0;}diff --git a/web/js/date/timeline.js b/web/js/date/timeline.jsindex e68cdc006..13581b1f9 100644--- a/web/js/date/timeline.js+++ b/web/js/date/timeline.js@@ -138,9 +138,9 @@ export function timeline(models, config, ui) {}, 50);};- var changeDate = (date) => {- self.reactComponent.setState({ selectedDate: date });- };+ // var changeDate = (date) => {+ // self.reactComponent.setState({ selectedDate: date });+ // };var incrementDate = (timeScale, increment) => {// self.expand(true);@@ -155,21 +155,32 @@ export function timeline(models, config, ui) {// console.log(models)// self.input.update(updatedDate);// models.date.setActiveDate(updatedDate);-console.log('updateDate', updatedDate)+// console.log('updateDate', date, updatedDate)//# ALLOWS UPDATE OF MODELS DATE WHICH LAYERS IS CONNECTED TOmodels.date.select(updatedDate);};- var getInitialProps = () => {+ var setIntervalInput = (intervalValue, zoomLevel) => {+ // console.log(self.input.delta)+ self.input.delta = intervalValue;+ self.input.interval = zoomLevel;++ let zoomCustomText = document.querySelector('#zoom-custom');+ zoomCustomText.textContent = `${intervalValue} ${zoomLevel.toUpperCase().substr(0, 3)}`;console.log(self)+ }++ var getInitialProps = () => {+ // console.log(self)return {width: self.width,height: self.height,selectedDate: models.date[models.date.activeDate],- changeDate: changeDate,+ // changeDate: changeDate,timeScale: 'day',incrementDate: incrementDate,- updateDate: updateDate+ updateDate: updateDate,+ setIntervalInput: setIntervalInput};};@@ -244,8 +255,10 @@ console.log('updateDate', updatedDate)};var updateReactTimelineDate = function() {+ // debugger;let selectedDate = models.date[models.date.activeDate];- console.log(selectedDate, new Date(selectedDate).toISOString())+ // console.log(selectedDate, new Date(selectedDate).toISOString())+ // console.log(selectedDate);self.reactComponent.setState({selectedDate: selectedDate,dateFormatted: new Date(selectedDate).toISOString()@@ -279,6 +292,12 @@ console.log('updateDate', updatedDate)e.stopPropagation();});+ $('#zoom-custom').on('click', function() {+ self.reactComponent.setState({+ customIntervalModalOpen: true+ });+ });+if (!models.anim) {// Hack: margin if anim is present$('#animate-button').hide();diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.jsindex b076b22e3..797de9180 100644--- a/web/js/map/layerbuilder.js+++ b/web/js/map/layerbuilder.js@@ -37,10 +37,14 @@ export function mapLayerBuilder(models, config, cache, mapUi) {var date, key, group, proj, layer, layerNext, layerPrior, attributes;options = options || {};group = options.group || null;+ console.log(date, models.date[models.date.activeDate])date = self.closestDate(def, options);+ console.log(date, models.date[models.date.activeDate])key = self.layerKey(def, options, group);proj = models.proj.selected;layer = cache.getItem(key);+ // console.log(def, options, group, date, key, proj, layer)+ // console.log(def.period)if (!layer) {// layer is not in the cacheif (!date) date = options.date || models.date[models.date.activeDate];@@ -115,7 +119,9 @@ export function mapLayerBuilder(models, config, cache, mapUi) {* @return {object} Closest date*/self.closestDate = function(def, options) {- console.log(def)+ // console.log(cache)+ // console.log(def)+ // console.log(def.period)var date;var animRange;if (models.anim) {@@ -125,11 +131,15 @@ export function mapLayerBuilder(models, config, cache, mapUi) {if (options.date) {date = options.date;} else {- date = models.date[models.date.activeDate];+ // # mutation of models date causing overwrite issue for SUBDAILY vs NON-SUBDAILY+ date = new Date(models.date[models.date.activeDate]);// If this not a subdaily layer, truncate the selected time to// UTC midnight+ console.log(def.period, date)if (def.period !== 'subdaily') {date = util.clearTimeUTC(date);++ console.log(def, def.period, date)}}// Perform extensive checks before finding closest datediff --git a/web/js/util/util.js b/web/js/util/util.jsindex f522e899b..5e90c04e9 100644--- a/web/js/util/util.js+++ b/web/js/util/util.js@@ -364,6 +364,7 @@ export default (function (self) {timeToReturn.setMilliseconds(Math.round(timeToReturn.getMilliseconds() / 1000) * 1000);timeToReturn.setSeconds(Math.round(timeToReturn.getSeconds() / 60) * 60);timeToReturn.setMinutes(Math.round(timeToReturn.getMinutes()));+ // console.log('roundTimeOneMinute', time, timeToReturn);return timeToReturn;};@@ -373,6 +374,7 @@ export default (function (self) {timeToReturn.setMilliseconds(Math.round(timeToReturn.getMilliseconds() / 1000) * 1000);timeToReturn.setSeconds(Math.round(timeToReturn.getSeconds() / 60) * 60);timeToReturn.setMinutes(Math.round(timeToReturn.getMinutes() / 10) * 10);+ // console.log('roundTimeTenMinute', time, timeToReturn);return timeToReturn;};@@ -390,6 +392,7 @@ export default (function (self) {date.setUTCMinutes(0);date.setUTCSeconds(0);date.setUTCMilliseconds(0);+return date;};