Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

revise custom interval selector panel by removing arrows and fitting under sidebar, allow up down arrow key events to change dates in input, add focus and escape to panel, also revise timescale select

Edward Plato356d975859a4
diff --git a/web/css/sidebar.css b/web/css/sidebar.css
index 279023542..64750ec84 100644
--- a/web/css/sidebar.css
+++ b/web/css/sidebar.css
@@ -35,7 +35,6 @@
}
#productsHolder > .tab-content {
background: rgba(40, 40, 40, 0.85);
- margin-top: 10px;
border: 1px solid #333;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
diff --git a/web/js/components/range-selection/dragger-range.js b/web/js/components/range-selection/dragger-range.js
index 68a6d222c..b8fb4a5f8 100644
--- a/web/js/components/range-selection/dragger-range.js
+++ b/web/js/components/range-selection/dragger-range.js
@@ -228,7 +228,7 @@ class TimelineDraggerRange extends React.Component {
cursor: 'pointer'
}}
// height={this.props.height}
- height={65}
+ height={63}
className='dragger-range'
id={this.props.draggerID}
onClick={this.handleDraggerClick.bind(this)}
diff --git a/web/js/components/timeline/interval-selector/interval-input.js b/web/js/components/timeline/interval-selector/interval-input.js
index 0ae845c2e..372df877a 100644
--- a/web/js/components/timeline/interval-selector/interval-input.js
+++ b/web/js/components/timeline/interval-selector/interval-input.js
@@ -8,50 +8,71 @@ import PropTypes from 'prop-types';
*
* @class TimelineRangeSelector
*/
+const regex = /^[0-9\b]+$/;
+
+
class IntervalInput extends PureComponent {
onKeyInput = (e) => {
- const regex = /^[0-9\b]+$/;
- const value = e.target.value;
+ let value = e.target.value;
if (value === '' || regex.test(value)) {
- this.props.changeInterval(Number(value));
+ value = Number(value);
+ if (value <= 1000) {
+ this.props.changeInterval(value);
+ }
}
}
- onClickUp = () => {
- let value = this.props.intervalValue;
- if (value < 1000) {
- this.props.changeInterval(value + 1);
+ handleKeyPress = (e) => {
+ let value = e.target.value;
+ if (value === '' || regex.test(value)) {
+ value = Number(value);
+ if (e.key === 'ArrowUp') {
+ if (value < 1000) {
+ this.props.changeInterval(value + 1);
+ }
+ } else if (e.key === 'ArrowDown') {
+ if (value > 1) {
+ this.props.changeInterval(value - 1);
+ }
+ }
}
}
+ // onClickUp = () => {
+ // let value = this.props.intervalValue;
+ // if (value < 1000) {
+ // this.props.changeInterval(value + 1);
+ // }
+ // }
- onClickDown = () => {
- let value = this.props.intervalValue;
- if (value > 1) {
- 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>
+ // <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}
+ onKeyDown={this.handleKeyPress}
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>
+ // <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>
);
}
diff --git a/web/js/components/timeline/interval-selector/interval-selector.js b/web/js/components/timeline/interval-selector/interval-selector.js
index 4ec72f59d..9b205bf1c 100644
--- a/web/js/components/timeline/interval-selector/interval-selector.js
+++ b/web/js/components/timeline/interval-selector/interval-selector.js
@@ -42,11 +42,13 @@ class CustomIntervalSelectorWidget extends PureComponent {
}
handleKeyPress = (e) => {
- if (e.key == 'Enter') {
- const value = this.state.intervalValue;
+ const value = this.state.intervalValue;
+ if (e.key === 'Enter') {
if (value > 0) {
this.setIntervalChangeUnit();
}
+ } else if (e.key === 'Escape') {
+ this.props.toggleCustomIntervalModal();
}
}
@@ -58,6 +60,11 @@ class CustomIntervalSelectorWidget extends PureComponent {
}
componentDidUpdate(prevProps) {
+ // handle focus widget on opening
+ if (this.props.customIntervalModalOpen && !prevProps.customIntervalModalOpen) {
+ this.customIntervalWidget.focus();
+ }
+ // update if higher state changed
if (prevProps.customIntervalValue !== this.props.customIntervalValue
|| prevProps.zoomLevel !== this.props.zoomLevel) {
this.setState({
@@ -73,14 +80,13 @@ class CustomIntervalSelectorWidget extends PureComponent {
id="wv-animation-widget-custom-interval"
onKeyDown={this.handleKeyPress}
className='wv-animation-widget-custom-interval'
- // style={{display: this.props.customIntervalModalOpen ? 'block' : 'none',
- // left: this.props.hasSubdailyLayers ? '-258px' : '-153px'}}
style={{display: this.props.customIntervalModalOpen ? 'block' : 'none'}}
- // left: this.props.hasSubdailyLayers ? '-258px' : '-153px'}}
+ tabIndex={0}
+ ref={(customIntervalWidget) => { this.customIntervalWidget = customIntervalWidget; }}
>
<div>Custom Interval Selector</div>
- <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', marginTop: '10px' }}>
+ <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
<div style={{display: 'flex', flexDirection: 'row' }}>
<IntervalInput
intervalValue={Number(this.state.intervalValue)}
diff --git a/web/js/components/timeline/timeline-axis/grid-range/grid-range.js b/web/js/components/timeline/timeline-axis/grid-range/grid-range.js
index 690858541..8b4063667 100644
--- a/web/js/components/timeline/timeline-axis/grid-range/grid-range.js
+++ b/web/js/components/timeline/timeline-axis/grid-range/grid-range.js
@@ -4,13 +4,13 @@ import moment from 'moment';
import TileRect from './tile-rect';
import TileText from './tile-text';
-//# PureComponent performs a shallow comparison of props and state - may not need shouldComponentUpdate
+// # PureComponent performs a shallow comparison of props and state - may not need shouldComponentUpdate
class GridRange extends PureComponent {
constructor(props) {
super(props);
this.state = {
// hoverLinePosition: 0
- }
+ };
}
// showHover = (e, itemDate, nextDate, index) => {
@@ -53,7 +53,7 @@ class GridRange extends PureComponent {
stroke="blue" strokeWidth="2" strokeOpacity="0.48" x1="0" x2="0" y1="0" y2="63"
transform={`translate(${this.state.hoverLinePosition + 1}, 0)`} shapeRendering="optimizeSpeed"/> */}
</g>
- )
+ );
}
}
@@ -84,7 +84,7 @@ const tileTextConditionOptions = {
let timeScaleUnit = itemDateObject.years;
return timeScaleUnit % 10 === 0;
}
-}
+};
class TileHolder extends PureComponent {
render() {
@@ -94,29 +94,29 @@ class TileHolder extends PureComponent {
<React.Fragment>
{this.props.dateArray.map((item, index) => {
return (
- item.withinRange ?
- <React.Fragment key={index}>
- <TileRect
- item={item}
- index={index}
- gridWidth={this.props.gridWidth}
- showHover={this.props.showHover}
- />
- {tileTextCondition(item.dateObject) ?
- <TileText
- item={item}
- index={index}
- gridWidth={this.props.gridWidth}
- />
- : null }
- </React.Fragment>
- : null
- )
+ item.withinRange
+ ? <React.Fragment key={index}>
+ <TileRect
+ item={item}
+ index={index}
+ gridWidth={this.props.gridWidth}
+ showHover={this.props.showHover}
+ />
+ {tileTextCondition(item.dateObject)
+ ? <TileText
+ item={item}
+ index={index}
+ gridWidth={this.props.gridWidth}
+ />
+ : null }
+ </React.Fragment>
+ : null
+ );
}
)}
</React.Fragment>
- )
+ );
}
}
-export default GridRange;
\ No newline at end of file
+export default GridRange;
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 16a20718a..76180a992 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
@@ -6,19 +6,20 @@ const axisScaleGridElement = {
let lineLengthY = timeScaleUnit === 0 ||
timeScaleUnit === 15 ||
timeScaleUnit === 30 ||
- timeScaleUnit === 45 ? 58 : timeScaleUnit % 5 === 0 ? 20 : 10;
+ timeScaleUnit === 45 ? 62 : timeScaleUnit % 5 === 0 ? 20 : 10;
let whiteLineStrokeWidth = lineLengthY !== 10 ? 2 : 1;
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>
<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="#555" strokeWidth={1} x1="0" x2={gridWidth} y1="46" y2="46" transform={`translate(${index * gridWidth + 1}, 0)`} shapeRendering="optimizeSpeed" />
<line stroke="white" strokeLinecap="round" strokeWidth={whiteLineStrokeWidth} x1="0" x2="0" y1="0" y2={lineLengthY} transform={`translate(${index * gridWidth + 1}, 0)`} />
</React.Fragment>
)
},
hour: (gridWidth, index, item) => {
let timeScaleUnit = item.dateObject.hours;
- let lineLengthY = timeScaleUnit === 0 ? 58 :
+ let lineLengthY = timeScaleUnit === 0 ? 62 :
timeScaleUnit === 6 ||
timeScaleUnit === 12 ||
timeScaleUnit === 18 ? 22 : 10;
@@ -27,42 +28,46 @@ const axisScaleGridElement = {
<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>
<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="#555" strokeWidth={1} x1="0" x2={gridWidth} y1="46" y2="46" transform={`translate(${index * gridWidth + 1}, 0)`} shapeRendering="optimizeSpeed" />
<line stroke="white" strokeLinecap="round" strokeWidth={whiteLineStrokeWidth} x1="0" x2="0" y1="0" y2={lineLengthY} transform={`translate(${index * gridWidth + 1}, 0)`} />
</React.Fragment>
)
},
day: (gridWidth, index, item) => {
let dayOfWeek = item.dayOfWeek;
- let lineLengthY = item.dateObject.date === 1 ? 58 : dayOfWeek === 0 ? 22 : 10;
+ let lineLengthY = item.dateObject.date === 1 ? 62 : dayOfWeek === 0 ? 22 : 10;
let whiteLineStrokeWidth = lineLengthY !== 10 ? 2 : 1;
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>
<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="#555" strokeWidth={1} x1="0" x2={gridWidth} y1="46" y2="46" transform={`translate(${index * gridWidth + 1}, 0)`} shapeRendering="optimizeSpeed" />
<line stroke="white" strokeLinecap="round" strokeWidth={whiteLineStrokeWidth} x1="0" x2="0" y1="0" y2={lineLengthY} transform={`translate(${index * gridWidth + 1}, 0)`} />
</React.Fragment>
)
},
month: (gridWidth, index, item) => {
let timeScaleUnit = item.dateObject.months;
- let lineLengthY = timeScaleUnit === 0 ? 58 : timeScaleUnit % 3 === 0 ? 22 : 10;
+ let lineLengthY = timeScaleUnit === 0 ? 62 : timeScaleUnit % 3 === 0 ? 22 : 10;
let whiteLineStrokeWidth = lineLengthY !== 10 ? 2 : 1;
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>
<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="#555" strokeWidth={1} x1="0" x2={gridWidth} y1="46" y2="46" transform={`translate(${index * gridWidth + 1}, 0)`} shapeRendering="optimizeSpeed" />
<line stroke="white" strokeLinecap="round" strokeWidth={whiteLineStrokeWidth} x1="0" x2="0" y1="0" y2={lineLengthY} transform={`translate(${index * gridWidth + 1}, 0)`} />
</React.Fragment>
)
},
year: (gridWidth, index, item) => {
let timeScaleUnit = item.dateObject.years;
- let lineLengthY = timeScaleUnit % 10 === 0 ? 58 : timeScaleUnit % 5 === 0 ? 22 : 10;
+ let lineLengthY = timeScaleUnit % 10 === 0 ? 62 : timeScaleUnit % 5 === 0 ? 22 : 10;
let whiteLineStrokeWidth = lineLengthY !== 10 ? 2 : 1;
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>
<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="#555" strokeWidth={1} x1="0" x2={gridWidth} y1="46" y2="46" transform={`translate(${index * gridWidth + 1}, 0)`} shapeRendering="optimizeSpeed" />
<line stroke="white" strokeLinecap="round" strokeWidth={whiteLineStrokeWidth} 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/grid-range/tile-text.js b/web/js/components/timeline/timeline-axis/grid-range/tile-text.js
index 915ed66dc..094e1f6ef 100644
--- a/web/js/components/timeline/timeline-axis/grid-range/tile-text.js
+++ b/web/js/components/timeline/timeline-axis/grid-range/tile-text.js
@@ -74,7 +74,7 @@ const axisScaleTextElementWrapper = (gridWidth, index, item) => {
return (
<React.Fragment>
<g>
- <text className="gridText" x="0" y="35" fill={item.withinRange ? 'white' : ''} transform={`translate(${(index * gridWidth) + xOffsetAdded}, 20)`} textRendering="optimizeLegibility" clipPath="url(#textDisplay)">{dateText}</text>
+ <text className="gridText" x="0" y="42" fill={item.withinRange ? 'white' : ''} transform={`translate(${(index * gridWidth) + xOffsetAdded}, 20)`} textRendering="optimizeLegibility" clipPath="url(#textDisplay)">{dateText}</text>
</g>
</React.Fragment>
);
diff --git a/web/js/components/timeline/timeline-axis/timeline-axis.js b/web/js/components/timeline/timeline-axis/timeline-axis.js
index e1f27418b..3d237ae7e 100644
--- a/web/js/components/timeline/timeline-axis/timeline-axis.js
+++ b/web/js/components/timeline/timeline-axis/timeline-axis.js
@@ -415,10 +415,10 @@ class TimelineAxis extends React.Component {
let backDate = moment.utc(dateArray[dateArray.length - 1].rawDate);
let midTileDate = moment.utc(dateArray[Math.floor(dateArray.length / 2)].rawDate);
- console.log(midTileDate)
+ // console.log(midTileDate)
let timelineEndDateLimit = this.props.timelineEndDateLimit;
let diff = midTileDate.diff(timelineEndDateLimit, timeScale);
- console.log(diff)
+ // console.log(diff)
let draggerPositionRevision = draggerPosition;
let draggerPositionRevisionB = draggerPositionB;
@@ -526,13 +526,13 @@ class TimelineAxis extends React.Component {
timeScale,
this.props.timelineStartDateLimit,
this.props.timelineEndDateLimit);
- console.log(dateArray.outOfRangeFutureDateCount)
+ // console.log(dateArray.outOfRangeFutureDateCount)
return dateArray;
}
// move dragger on axis click
setLineTime = (e) => {
- console.log(e, this.state.hoverTime)
+ // console.log(e, this.state.hoverTime)
e.preventDefault();
e.stopPropagation();
//TODO: handle stop bubbling up to parent wv-timeline-axis to prevent invoking on clicking draggers
@@ -592,10 +592,10 @@ class TimelineAxis extends React.Component {
// let diff = time.diff(currentDate, timeScale);
// console.log(diff)
// }
- console.log(timelineStartDateLimit, timelineEndDateLimit)
+ // console.log(timelineStartDateLimit, timelineEndDateLimit)
let diff = time.diff(timelineEndDateLimit, timeScale);
- console.log(diff)
+ // console.log(diff)
// format to strings
time = time.format();
@@ -633,7 +633,7 @@ class TimelineAxis extends React.Component {
let gridsToSubtract = Math.floor(gridNumber/2) + offSetGridsDiff;
let gridsToAdd = Math.floor(gridNumber/2) - offSetGridsDiff;
- console.log(offSetGrids, offSetGridsDiff, gridsToSubtract, gridsToAdd)
+ // console.log(offSetGrids, offSetGridsDiff, gridsToSubtract, gridsToAdd)
//# get midPoint for position based on # of tiles and gridWidth
let midPoint = -((gridWidth * gridNumber) / 2) + (numberOfVisibleTiles / 2 * gridWidth);
@@ -809,7 +809,6 @@ class TimelineAxis extends React.Component {
this.setDraggerToTime(this.props.selectedDate);
} else {
if (this.props.draggerSelected === 'selected') {
- debugger;
let leftOffsetFixedCoeff = newDraggerDate.newDraggerDiff > 5 ? 0.5 : newDraggerDate.newDateInThePast ? 0.25 : 0.75;
this.updateScale(this.props.selectedDate, this.props.timeScale, null, leftOffsetFixedCoeff);
}
@@ -892,7 +891,7 @@ class TimelineAxis extends React.Component {
// let time = moment.utc(this.props.selectedDate);
let currentDateRangeLength = this.state.deque.length;
let midTileDate = moment.utc(this.state.deque.get(Math.floor(currentDateRangeLength / 2)).rawDate);
- console.log(midTileDate)
+ // console.log(midTileDate)
let time = moment.utc(new Date());
let timelineEndDateLimit = this.props.timelineEndDateLimit;
let diff = midTileDate.diff(timelineEndDateLimit, timeScale);
@@ -908,11 +907,11 @@ class TimelineAxis extends React.Component {
let leftBound = (diff * gridWidth)
if (Math.abs(diff) < Math.floor(currentDateRangeLength / 2)) {
- console.log('hit')
+ // console.log('hit')
leftBound = midPoint
}
- console.log(diff, leftBound, Math.floor(currentDateRangeLength / 2), ((diff * gridWidth)))
+ // console.log(diff, leftBound, Math.floor(currentDateRangeLength / 2), ((diff * gridWidth)))
this.setState({
leftBound: leftBound,
moved: moved,
@@ -930,8 +929,10 @@ class TimelineAxis extends React.Component {
requestAnimationFrame(() => {
var deltaX = d.deltaX;
- let gridWidth = this.state.gridWidth;
let timeScale = this.props.timeScale;
+ let options = timeScaleOptions[timeScale].timeAxis;
+ let gridWidth = options.gridWidth;
+
let axisWidth = this.props.axisWidth;
let dragSentinelChangeNumber = this.state.dragSentinelChangeNumber;
let dragSentinelCount = this.state.dragSentinelCount;
@@ -949,11 +950,20 @@ class TimelineAxis extends React.Component {
// update draggerTime based on deltaX from state draggerTime
// TODO: test consistency throught timescales, currently seems off 0.5 on ocassion
+ // month appears to be off from large deltas, this makes sense since the current diffZeroValues false condition is comparing the next
+ // zero value vs the final
+ // ! OPTIONS
+ // sub conditional that tracks if delta is greater than gridwith?
+ // track final location with delta added
+
let draggerTime = moment.utc(time);
let draggerTimeValue = draggerTime.valueOf();
// only need to calculate difference in time unit for varying timescales - month and year
- let diffZeroValues = timeScaleOptions[timeScale].timeAxis.scaleMs;
+ let diffZeroValues = options.scaleMs;
if (!diffZeroValues) {
+ let frontDate = moment.utc(this.state.deque.peekFront().rawDate);
+
+
let draggerTimeZero = draggerTime.clone().startOf(timeScale);
let draggerTimeNextZero = draggerTimeZero.clone().add(1, timeScale);
@@ -961,8 +971,10 @@ class TimelineAxis extends React.Component {
let draggerTimeNextZeroValue = draggerTimeNextZero.valueOf();
diffZeroValues = draggerTimeNextZeroValue - draggerTimeZeroValue;
+ console.log(deltaX)
}
let diffFactor = diffZeroValues / gridWidth;
+ console.log(diffFactor)
let newDraggerTime = moment.utc(draggerTimeValue + (diffFactor * deltaX));
if (newDraggerTime.isAfter(this.props.timelineEndDateLimit, timeScale) ||
@@ -1230,9 +1242,9 @@ class TimelineAxis extends React.Component {
render() {
let draggerTimeLeftOffest = this.props.draggerSelected === 'selected'
- ? this.state.draggerPosition - (this.props.hasSubdailyLayers ? 44 : 8)
- : this.state.draggerPositionB - (this.props.hasSubdailyLayers ? 44 : 8);
- let hoverTimeLeftOffset = this.props.hasSubdailyLayers ? this.state.leftOffset - 93 : this.state.leftOffset - 57;
+ ? this.state.draggerPosition - (this.props.hasSubdailyLayers ? 64 : 8)
+ : this.state.draggerPositionB - (this.props.hasSubdailyLayers ? 64 : 8);
+ let hoverTimeLeftOffset = this.props.hasSubdailyLayers ? this.state.leftOffset - 113 : this.state.leftOffset - 57;
return (
<React.Fragment>
<div id="wv-timeline-axis"
@@ -1370,7 +1382,7 @@ class TimelineAxis extends React.Component {
transform: `translate(${draggerTimeLeftOffest}px, -100px)`,
display: this.state.showDraggerTime && this.state.draggerTimeState ? 'block' : 'none',
// opacity: this.state.showDraggerTime && this.state.draggerTimeState ? '1' : '0',
- width: this.props.hasSubdailyLayers ? '185px' : '115px'
+ width: this.props.hasSubdailyLayers ? '220px' : '115px'
}}
>
{ this.state.showDraggerTime && this.state.draggerTimeState
@@ -1388,7 +1400,7 @@ class TimelineAxis extends React.Component {
transform: `translate(${hoverTimeLeftOffset}px, -100px)`,
display: !this.state.showDraggerTime && this.state.showHoverLine ? 'block' : 'none',
// opacity: !this.state.showDraggerTime && this.state.showHoverLine ? '1' : '0',
- width: this.props.hasSubdailyLayers ? '185px' : '115px'
+ width: this.props.hasSubdailyLayers ? '220px' : '115px'
}}
>
{ !this.state.showDraggerTime && this.state.hoverTime
diff --git a/web/js/components/timeline/timeline-axis/timeline-dragger.js b/web/js/components/timeline/timeline-axis/timeline-dragger.js
index 22cc71780..785cc98b7 100644
--- a/web/js/components/timeline/timeline-axis/timeline-dragger.js
+++ b/web/js/components/timeline/timeline-axis/timeline-dragger.js
@@ -10,7 +10,7 @@ class Dragger extends PureComponent {
axis='x'
onMouseDown={selectDragger.bind(this, draggerName)}
onDrag={handleDragDragger.bind(this, draggerName)}
- position={{ x: draggerPosition, y: -25 }}
+ position={{ x: draggerPosition - 12, y: -20 }}
onStart={() => toggleShowDraggerTime(true)}
onStop={() => toggleShowDraggerTime(false)}
disabled={disabled}
@@ -19,7 +19,7 @@ class Dragger extends PureComponent {
style={{ cursor: 'pointer', display: this.props.draggerVisible ? 'flex' : 'none' }}
className='gridShell dragger' transform={`translate(${transformX}, 0)`}
>
- <polygon fill={disabled ? '#7a7a7a' : '#ccc'} stroke='#515151' strokeWidth='2px' points='50,25, 85,85, 15,85'></polygon>
+ <polygon fill={disabled ? '#7a7a7a' : '#ccc'} stroke='#333' strokeWidth='1px' points='60,20, 95,65, 25,65'></polygon>
{compareModeActive
? <text
fontSize='30px'
@@ -33,9 +33,9 @@ class Dragger extends PureComponent {
{draggerLetter}
</text>
: <React.Fragment>
- <rect pointerEvents="none" fill='#515151' width='4' height='20' x='41' y='55'></rect>
- <rect pointerEvents="none" fill='#515151' width='4' height='20' x='48' y='55'></rect>
- <rect pointerEvents="none" fill='#515151' width='4' height='20' x='55' y='55'></rect>
+ <rect pointerEvents="none" fill='#515151' width='3' height='20' x='52' y='39'></rect>
+ <rect pointerEvents="none" fill='#515151' width='3' height='20' x='58' y='39'></rect>
+ <rect pointerEvents="none" fill='#515151' width='3' height='20' x='64' y='39'></rect>
</React.Fragment>
}
</g>
diff --git a/web/js/components/timeline/timeline-controls/axis-timescale-change-controls.js b/web/js/components/timeline/timeline-controls/axis-timescale-change-controls.js
index 174db0506..ce1c8b4c5 100644
--- a/web/js/components/timeline/timeline-controls/axis-timescale-change-controls.js
+++ b/web/js/components/timeline/timeline-controls/axis-timescale-change-controls.js
@@ -19,6 +19,12 @@ class AxisTimeScaleChangeControls extends PureComponent {
render() {
return (
<div className="zoom-level-change-arrows">
+ <AxisTimeScaleChangeTooltip
+ timeScale={this.props.timeScale}
+ toolTipHovered={this.props.toolTipHovered}
+ changeTimeScale={this.props.changeTimeScale}
+ hasSubdailyLayers={this.props.hasSubdailyLayers}
+ />
<div
onClick={this.onClickUp}
className="date-arrows date-arrow-up"
@@ -27,12 +33,6 @@ class AxisTimeScaleChangeControls extends PureComponent {
<path d="M 12.5,0 25,8 0,8 z" className="uparrow" />
</svg>
</div>
- <AxisTimeScaleChangeTooltip
- timeScale={this.props.timeScale}
- toolTipHovered={this.props.toolTipHovered}
- changeTimeScale={this.props.changeTimeScale}
- hasSubdailyLayers={this.props.hasSubdailyLayers}
- />
<div
onClick={this.onClickDown}
className="date-arrows date-arrow-down"
diff --git a/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js b/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js
index 0d7ee59ec..a49d4d1ef 100644
--- a/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js
+++ b/web/js/components/timeline/timeline-controls/axis-timescale-change-tooltip.js
@@ -24,7 +24,8 @@ class AxisTimeScaleChangeTooltip extends PureComponent {
id="current-zoom"
className={'zoom-btn zoom-level-display-text'}
>
- {timeUnitAbbreviations[this.props.timeScale]}
+ {/* {timeUnitAbbreviations[this.props.timeScale]} */}
+ {this.props.timeScale}
</span>
<div className="wv-zoom-tooltip"
style={{ display: this.props.toolTipHovered ? 'block' : 'none' }}
diff --git a/web/js/components/timeline/timeline.css b/web/js/components/timeline/timeline.css
index 53419b9c8..69ec52f58 100644
--- a/web/js/components/timeline/timeline.css
+++ b/web/js/components/timeline/timeline.css
@@ -13,13 +13,13 @@ html, body {
}
#wv-timeline-axis {
- height: 70px;
+ height: 65px;
border-top: 1.5px solid white;
}
.inner {
/* background: rgba(0, 0, 0, 0.5); */
- height: 70px;
+ height: 64px;
display: flex;
flex-direction: row;
align-items: center;
@@ -33,6 +33,7 @@ html, body {
color: #fff;
border: thin solid #666;
font-size: 18px;
+ font-family: 'Roboto Mono', monospace;
text-align: center;
border-radius: 5px;
width: 115px;
@@ -51,11 +52,11 @@ html, body {
.grid {
color: white;
font-size: 12px;
- height: 70px;
+ height: 63px;
}
.gridText {
- font-size: 24px;
+ font-size: 18px;
font-weight: 500;
font-family: 'Roboto Mono', monospace;
color: white;
@@ -126,11 +127,15 @@ form select {
background: #999;
}
+#zoom-btn-container-axis {
+ margin-bottom: 5px;
+}
+
.zoom-level-display-text {
color: white;
font-family: 'Roboto Mono', monospace;
text-align: center;
- font-size: 20px;
+ font-size: 12px;
line-height: 1.2em;
vertical-align: baseline;
box-sizing: border-box;
@@ -149,15 +154,15 @@ form select {
box-sizing: border-box;
-webkit-box-sizing: border-box;
width: 55px;
- padding-top: 7px;
+ /* padding-top: 7px; */
}
.interval-input {
width: 80px;
- height: 40px;
+ height: 24px;
color: #7890cd;
opacity: 1;
- font-size: 24px;
+ font-size: 18px;
background: transparent;
border: 0;
font-family: 'Roboto Mono', monospace;
@@ -169,7 +174,7 @@ form select {
padding: 0;
text-align: center;
border: thin solid #fff;
- margin: 5px 0 5px 0;
+ /* margin: 5px 0 5px 0; */
}
.interval-timescale-select {
@@ -177,7 +182,7 @@ form select {
height: 40px;
color: #7890cd;
opacity: 1;
- font-size: 20px;
+ font-size: 18px;
background: transparent;
border: 0;
font-family: 'Roboto Mono', monospace;
@@ -186,7 +191,7 @@ form select {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
- padding: 15px;
+ /* padding: 15px; */
text-align: center;
}
@@ -194,10 +199,11 @@ form select {
padding: 0;
background: #212121;
color: #7890cd;
- height: 40px;
+ height: 24px;
+ font-size: 18px;
width: 118px;
border: thin solid #fff;
- margin-top: 1px;
+ /* margin-top: 1px; */
}
.custom-interval-text {
@@ -263,17 +269,17 @@ form select {
}
.wv-animation-widget-custom-interval {
- height: 110px;
+ height: 57px;
width: 225px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
background: #212121;
position: absolute;
- top: -111px;
+ top: -58px;
left: 0;
display: none;
color: #fff;
- border-bottom: 2px solid #444;
+ border-bottom: 1px solid #444;
}
.wv-animation-widget-custom-interval i.wv-close {
diff --git a/web/js/date/timeline.js b/web/js/date/timeline.js
index 0414a5a6b..f7bf55a05 100644
--- a/web/js/date/timeline.js
+++ b/web/js/date/timeline.js
@@ -485,9 +485,9 @@ export function timeline(models, config, ui) {
let animStartLocationDate = models.anim.rangeState.startDate;
let animEndLocationDate = models.anim.rangeState.endDate;
let isAnimationWidgetOpen = models.anim.rangeState.state === 'on';
- console.log(animStartLocationDate, animEndLocationDate)
+ // console.log(animStartLocationDate, animEndLocationDate)
- console.log(models.anim.rangeState.state)
+ // console.log(models.anim.rangeState.state)
// get separate input props
// TODO: combined props cleaner or too long?
@@ -627,9 +627,9 @@ export function timeline(models, config, ui) {
subdaily = models.layers.hasSubDaily();
}
- // let subdaily = models.layers.hasSubDaily();
- if (!subdaily && (models.date.customInterval > 3 || models.date.interval > 3)) {
- setIntervalInput(1, 'day')
+ // handle state updating and resetting to DAY if in subdaily interval/zoom
+ if (!subdaily && (models.date.selectedZoom > 3 || models.date.customInterval > 3 || models.date.interval > 3)) {
+ setIntervalInput(1, 'day');
self.reactComponent.setState({
hasSubdailyLayers: subdaily
}, changeTimeScale('day'));