Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

demo uat preview deploy, integrate animation draggers work in progress

Edward Platoc34dc46fe49c
diff --git a/web/js/animation/ui.js b/web/js/animation/ui.js
index 6a25d3970..62f98a2db 100644
--- a/web/js/animation/ui.js
+++ b/web/js/animation/ui.js
@@ -338,7 +338,7 @@ export function animationUi(models, ui) {
var day = new Date(self.state.playIndex);
var startDate = new Date(animModel.rangeState.startDate);
var endDate = new Date(animModel.rangeState.endDate);
- console.log(startDate, endDate);
+ // console.log(startDate, endDate);
var jsTestDate = new Date(testDate);
while (i < queueLength) {
if (self.nextDate(day) > endDate) {
diff --git a/web/js/components/layer/product-picker/measurement-row.js b/web/js/components/layer/product-picker/measurement-row.js
index 68c3281da..bc6882174 100644
--- a/web/js/components/layer/product-picker/measurement-row.js
+++ b/web/js/components/layer/product-picker/measurement-row.js
@@ -125,9 +125,9 @@ class LayerRow extends React.Component {
var matches = regExp.exec(layer.title);
orbitTitle = matches[1];
}
- OrbitSourceList.push(
- this.renderOrbitListItem(orbitTitle, measurement, layer)
- );
+ // OrbitSourceList.push(
+ // this.renderOrbitListItem(orbitTitle, measurement, layer)
+ // );
}
});
return (
diff --git a/web/js/components/range-selection/dragger-range.js b/web/js/components/range-selection/dragger-range.js
index 66bb09cc8..671cc54bf 100644
--- a/web/js/components/range-selection/dragger-range.js
+++ b/web/js/components/range-selection/dragger-range.js
@@ -227,7 +227,8 @@ class TimelineDraggerRange extends React.Component {
fillOpacity: this.props.opacity,
cursor: 'pointer'
}}
- height={this.props.height}
+ // height={this.props.height}
+ height={30}
className='dragger-range'
id={this.props.draggerID}
onClick={this.handleDraggerClick.bind(this)}
diff --git a/web/js/components/range-selection/dragger.js b/web/js/components/range-selection/dragger.js
index f333fb196..b0e48b43a 100644
--- a/web/js/components/range-selection/dragger.js
+++ b/web/js/components/range-selection/dragger.js
@@ -41,7 +41,8 @@ class TimelineDragger extends React.Component {
<React.Fragment>
<rect
width={this.props.width}
- height={this.props.height}
+ // height={this.props.height}
+ height={40}
style={{
fill: this.props.color,
visibility: visibility
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 4d8f2aba1..915ed66dc 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="45" fill={item.withinRange ? 'white' : ''} transform={`translate(${(index * gridWidth) + xOffsetAdded}, 20)`} textRendering="optimizeLegibility" clipPath="url(#textDisplay)">{dateText}</text>
+ <text className="gridText" x="0" y="35" 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 2f5b3ab72..b8b4094ba 100644
--- a/web/js/components/timeline/timeline-axis/timeline-axis.js
+++ b/web/js/components/timeline/timeline-axis/timeline-axis.js
@@ -630,12 +630,12 @@ console.log(leftOffset,axisWidth)
let animationEndDraggerLocation;
if (true || this.props.startLocationDate) {
- // animationStartLocationDate = moment.utc(this.props.startLocationDate);
- animationStartLocationDate = '2019-04-26T18:00:00Z';
+ animationStartLocationDate = this.props.animStartLocationDate;
+ // animationStartLocationDate = '2019-04-26T18:00:00Z';
animationStartDraggerLocation = Math.abs(frontDate.diff(animationStartLocationDate, timeScale, true) * gridWidth);
- // animationEndLocationDate = moment.utc(this.props.endLocationDate);
- animationEndLocationDate = '2019-05-02T00:00:00Z';
+ animationEndLocationDate = this.props.animEndLocationDate;
+ // animationEndLocationDate = '2019-05-02T00:00:00Z';
animationEndDraggerLocation = Math.abs(frontDate.diff(animationEndLocationDate, timeScale, true) * gridWidth);
}
@@ -709,6 +709,10 @@ console.log(leftOffset,axisWidth)
componentDidUpdate(prevProps, prevState) {
// console.log(prevProps.selectedDate, this.props.selectedDate, this.state.selectedDate, prevState.selectedDate)
+ // if (this.props.animStartLocationDate !== prevProps.animStartLocationDate ||
+ // this.props.animEndLocationDate !== prevProps.animEndLocationDate) {
+ // this.animationDraggerDateUpdate(this.props.animStartLocationDate, this.props.animEndLocationDate)
+ // }
if (this.props.timeScale !== prevProps.timeScale) {
this.updateScale(null, this.props.timeScale);
@@ -887,87 +891,88 @@ console.log(leftOffset,axisWidth)
let newDraggerTime = moment.utc(draggerTimeValue + (diffFactor * deltaX)).format();
// handle drag timeline
- // TODO: fix drag off current view - doesn't drag/update date of hover properly
- if (draggerPosition < -draggerWidth) { // # handle drag timeline towards PAST
- // console.log('drag off view past', deltaX, (dragSentinelCount + deltaX), -dragSentinelChangeNumber)
- let position = this.state.position - deltaX;
-
- if ((dragSentinelCount + deltaX) < -dragSentinelChangeNumber) {
- // console.log('drag off view past UNSHIFT TILES')
- let overDrag = 0;
- if ((dragSentinelCount + deltaX) < -dragSentinelChangeNumber - dragSentinelChangeNumber) {
- overDrag = Math.abs((dragSentinelCount + deltaX) - -dragSentinelChangeNumber - -dragSentinelChangeNumber);
- }
- //# NEED TO PASS NEGATIVE OF DELTAX FOR UPDATE PANEL
- let { currentDateRange,
- deque,
- currentTransformX,
- draggerVisible,
- draggerVisibleB,
- overDragGrids,
- draggerPositionRevision } = this.updatePanelDateRange(position, timeScale, -deltaX, draggerPosition, overDrag);
+ // // TODO: fix drag off current view - doesn't drag/update date of hover properly
+ // if (draggerPosition < -draggerWidth) { // # handle drag timeline towards PAST
+ // // console.log('drag off view past', deltaX, (dragSentinelCount + deltaX), -dragSentinelChangeNumber)
+ // let position = this.state.position - deltaX;
+
+ // if ((dragSentinelCount + deltaX) < -dragSentinelChangeNumber) {
+ // // console.log('drag off view past UNSHIFT TILES')
+ // let overDrag = 0;
+ // if ((dragSentinelCount + deltaX) < -dragSentinelChangeNumber - dragSentinelChangeNumber) {
+ // overDrag = Math.abs((dragSentinelCount + deltaX) - -dragSentinelChangeNumber - -dragSentinelChangeNumber);
+ // }
+ // //# NEED TO PASS NEGATIVE OF DELTAX FOR UPDATE PANEL
+ // let { currentDateRange,
+ // deque,
+ // currentTransformX,
+ // draggerVisible,
+ // draggerVisibleB,
+ // overDragGrids,
+ // draggerPositionRevision } = this.updatePanelDateRange(position, timeScale, -deltaX, draggerPosition, overDrag);
+
+ // this.setState({
+ // currentDateRange: currentDateRange,
+ // deque: deque,
+ // currentTransformX: currentTransformX,
+ // draggerPosition: -48,
+ // moved: true,
+ // position: position,
+ // dragSentinelCount: (dragSentinelCount + deltaX) - -dragSentinelChangeNumber + (overDragGrids * gridWidth),
+ // })
+ // } else {
+ // let newDragSentinelCount = dragSentinelCount > 0 ? (-dragSentinelChangeNumber + dragSentinelCount + deltaX) : dragSentinelCount + deltaX;
+
+ // // NEGATIVE DELTAX
+ // this.setState({
+ // draggerPosition: -48,
+ // moved: true,
+ // position: position,
+ // dragSentinelCount: newDragSentinelCount
+ // })
+ // }
+ // } else if (draggerPosition > axisWidth - draggerWidth) { // handle drag timeline towards FUTURE
+ // // console.log('drag off view future', deltaX)
+ // let position = this.state.position - deltaX;
+
+ // if ((dragSentinelCount + deltaX) > dragSentinelChangeNumber) {
+
+ // let overDrag = 0;
+ // if ((dragSentinelCount + deltaX) > dragSentinelChangeNumber + dragSentinelChangeNumber) {
+ // overDrag = Math.abs((dragSentinelCount + deltaX) - dragSentinelChangeNumber - dragSentinelChangeNumber);
+ // }
+ // //# NEED TO PASS NEGATIVE OF DELTAX FOR UPDATE PANEL
+ // let { currentDateRange,
+ // deque,
+ // currentTransformX,
+ // draggerVisible,
+ // draggerVisibleB,
+ // overDragGrids,
+ // draggerPositionRevision } = this.updatePanelDateRange(position, timeScale, -deltaX, draggerPosition, overDrag);
+
+ // this.setState({
+ // currentDateRange: currentDateRange,
+ // deque: deque,
+ // currentTransformX: currentTransformX,
+ // draggerPosition: axisWidth - 50,
+ // moved: true,
+ // position: position,
+ // dragSentinelCount: (dragSentinelCount + deltaX) - dragSentinelChangeNumber - (overDragGrids * gridWidth),
+ // })
+
+ // } else {
+ // let newDragSentinelCount = dragSentinelCount < 0 ? (dragSentinelChangeNumber + dragSentinelCount + deltaX) : dragSentinelCount + deltaX;
+
+ // // POSITIVE DELTAX
+ // this.setState({
+ // draggerPosition: axisWidth - 50,
+ // moved: true,
+ // position: position,
+ // dragSentinelCount: newDragSentinelCount
+ // })
+ // }
+ // } else { // handle drag within axis view
- this.setState({
- currentDateRange: currentDateRange,
- deque: deque,
- currentTransformX: currentTransformX,
- draggerPosition: -48,
- moved: true,
- position: position,
- dragSentinelCount: (dragSentinelCount + deltaX) - -dragSentinelChangeNumber + (overDragGrids * gridWidth),
- })
- } else {
- let newDragSentinelCount = dragSentinelCount > 0 ? (-dragSentinelChangeNumber + dragSentinelCount + deltaX) : dragSentinelCount + deltaX;
-
- // NEGATIVE DELTAX
- this.setState({
- draggerPosition: -48,
- moved: true,
- position: position,
- dragSentinelCount: newDragSentinelCount
- })
- }
- } else if (draggerPosition > axisWidth - draggerWidth) { // handle drag timeline towards FUTURE
- // console.log('drag off view future', deltaX)
- let position = this.state.position - deltaX;
-
- if ((dragSentinelCount + deltaX) > dragSentinelChangeNumber) {
-
- let overDrag = 0;
- if ((dragSentinelCount + deltaX) > dragSentinelChangeNumber + dragSentinelChangeNumber) {
- overDrag = Math.abs((dragSentinelCount + deltaX) - dragSentinelChangeNumber - dragSentinelChangeNumber);
- }
- //# NEED TO PASS NEGATIVE OF DELTAX FOR UPDATE PANEL
- let { currentDateRange,
- deque,
- currentTransformX,
- draggerVisible,
- draggerVisibleB,
- overDragGrids,
- draggerPositionRevision } = this.updatePanelDateRange(position, timeScale, -deltaX, draggerPosition, overDrag);
-
- this.setState({
- currentDateRange: currentDateRange,
- deque: deque,
- currentTransformX: currentTransformX,
- draggerPosition: axisWidth - 50,
- moved: true,
- position: position,
- dragSentinelCount: (dragSentinelCount + deltaX) - dragSentinelChangeNumber - (overDragGrids * gridWidth),
- })
-
- } else {
- let newDragSentinelCount = dragSentinelCount < 0 ? (dragSentinelChangeNumber + dragSentinelCount + deltaX) : dragSentinelCount + deltaX;
-
- // POSITIVE DELTAX
- this.setState({
- draggerPosition: axisWidth - 50,
- moved: true,
- position: position,
- dragSentinelCount: newDragSentinelCount
- })
- }
- } else { // handle drag within axis view
if (draggerASelected) {
// prevent function invoke on dragger click, but no date change
if (moment.utc(this.props.dateFormatted).format() !== newDraggerTime) {
@@ -987,7 +992,7 @@ console.log(leftOffset,axisWidth)
}, this.props.updateDate(newDraggerTime, 'selectedB'));
}
}
- }
+ // }
})
}
@@ -1096,6 +1101,25 @@ console.log(leftOffset,axisWidth)
})
}
+ // handle animation dragger location update and state update
+ animationDraggerDateUpdate = (animationStartLocationDate, animationEndLocationDate) => {
+ let timeScale = this.props.timeScale;
+ let gridWidth = this.state.gridWidth;
+ let position = this.state.position;
+ let frontDate = moment.utc(this.state.deque.peekFront().rawDate);
+
+ let startLocation = frontDate.diff(animationStartLocationDate, timeScale, true) * gridWidth;
+ let endLocation = frontDate.diff(animationEndLocationDate, timeScale, true) * gridWidth;
+
+ // console.log(startLocation, endLocation)
+ this.setState({
+ animationStartLocation: position - startLocation,
+ animationEndLocation: position - endLocation,
+ animationStartLocationDate: animationStartLocationDate,
+ animationEndLocationDate: animationEndLocationDate
+ })
+ }
+
render() {
let draggerTimeLeftOffest = this.props.draggerSelected === 'selected'
? this.state.draggerPosition - (this.props.hasSubdailyLayers ? 33 : 3)
@@ -1117,7 +1141,7 @@ console.log(leftOffset,axisWidth)
height={70}
viewBox={`0 0 ${this.props.axisWidth} 75`}
// style={{clipPath: 'url(#tester)'}} clipPath="url(#tester)"
- preserveAspectRatio="none">
+ preserveAspectRatio="xMinYMin slice">
<defs>
{/* clip axis grid text */}
<clipPath id="textDisplay">
@@ -1149,11 +1173,9 @@ console.log(leftOffset,axisWidth)
</Draggable>
{/* //? INSERT RANGE SELECTION HERE */}
- <TimelineRangeSelector
+ {/* <TimelineRangeSelector
startLocation={this.state.animationStartLocation}
endLocation={this.state.animationEndLocation}
- // startLocationDate={"2019-03-01T00:00:00Z"}
- // endLocationDate={"2019-04-01T00:00:00Z"}
startLocationDate={this.state.animationStartLocationDate}
endLocationDate={this.state.animationEndLocationDate}
timelineStartDateLimit={this.props.timelineStartDateLimit}
@@ -1169,7 +1191,7 @@ console.log(leftOffset,axisWidth)
startColor={"#40a9db"}
startTriangleColor={"#fff"}
endColor={"#295f92"}
- endTriangleColor={"#4b7aab"} />
+ endTriangleColor={"#4b7aab"} /> */}
{this.props.draggerSelected === 'selectedB' ?
<React.Fragment>
diff --git a/web/js/components/timeline/timeline-axis/timeline-dragger.js b/web/js/components/timeline/timeline-axis/timeline-dragger.js
index 479f56932..22cc71780 100644
--- a/web/js/components/timeline/timeline-axis/timeline-dragger.js
+++ b/web/js/components/timeline/timeline-axis/timeline-dragger.js
@@ -19,14 +19,14 @@ class Dragger extends PureComponent {
style={{ cursor: 'pointer', display: this.props.draggerVisible ? 'flex' : 'none' }}
className='gridShell dragger' transform={`translate(${transformX}, 0)`}
>
- <polygon fill='#ccc' stroke='#515151' strokeWidth='2px' points='50,25, 90,90, 10,90'></polygon>
+ <polygon fill={disabled ? '#7a7a7a' : '#ccc'} stroke='#515151' strokeWidth='2px' points='50,25, 85,85, 15,85'></polygon>
{compareModeActive
? <text
fontSize='30px'
- fontWeight='700'
+ fontWeight='400'
x='0'
y='65'
- fill='#515151'
+ fill={disabled ? '#ccc' : '#000'}
transform='translate(39, 10)'
textRendering='optimizeLegibility'
clipPath='url(#textDisplay)'>
diff --git a/web/js/components/timeline/timeline.css b/web/js/components/timeline/timeline.css
index dcf8bad73..388fea1eb 100644
--- a/web/js/components/timeline/timeline.css
+++ b/web/js/components/timeline/timeline.css
@@ -13,12 +13,12 @@ html, body {
}
#wv-timeline-axis {
- height: 60px;
+ height: 70px;
}
.inner {
/* background: rgba(0, 0, 0, 0.5); */
- height: 66px;
+ height: 70px;
display: flex;
flex-direction: row;
align-items: center;
@@ -48,7 +48,7 @@ html, body {
.grid {
color: white;
font-size: 12px;
- height: 75px;
+ height: 70px;
}
.gridText {
diff --git a/web/js/components/timeline/timeline.js b/web/js/components/timeline/timeline.js
index f16492467..0f4eba0c4 100644
--- a/web/js/components/timeline/timeline.js
+++ b/web/js/components/timeline/timeline.js
@@ -128,7 +128,9 @@ class Timeline extends React.Component {
customSelected: this.props.customSelected,
parentOffset: this.props.parentOffset,
timelineStartDateLimit: this.props.timelineStartDateLimit,
- timelineEndDateLimit: this.props.timelineEndDateLimit
+ timelineEndDateLimit: this.props.timelineEndDateLimit,
+ animStartLocationDate: this.props.animStartLocationDate,
+ animEndLocationDate: this.props.animEndLocationDate
});
}
@@ -140,7 +142,7 @@ class Timeline extends React.Component {
// }
render() {
- console.log(this.state.selectedDate, this.state.dateFormatted)
+ // console.log(this.state.selectedDate, this.state.dateFormatted)
return (
this.state.dateFormatted ?
<React.Fragment>
@@ -205,6 +207,8 @@ class Timeline extends React.Component {
timelineEndDateLimit={this.state.timelineEndDateLimit}
customIntervalModalOpen={this.state.customIntervalModalOpen}
updateAnimationRange={this.props.updateAnimationRange}
+ animStartLocationDate={this.state.animStartLocationDate}
+ animEndLocationDate={this.state.animEndLocationDate}
/>
</div>
diff --git a/web/js/date/timeline.js b/web/js/date/timeline.js
index e810e0cee..8143dc09b 100644
--- a/web/js/date/timeline.js
+++ b/web/js/date/timeline.js
@@ -483,6 +483,11 @@ export function timeline(models, config, ui) {
let customSelected = models.date.customSelected ? Boolean(models.date.customSelected) : false;
let intervalSelected = models.date.interval ? timeScaleFromNumberKey[models.date.interval] : selectedTimeScale;
+ // animation dates
+ let animStartLocationDate = models.anim.rangeState.startDate;
+ let animEndLocationDate = models.anim.rangeState.endDate;
+ // console.log(animStartLocationDate, animEndLocationDate)
+
// get separate input props
// TODO: combined props cleaner or too long?
let inputProps = getInputProps();
@@ -513,7 +518,9 @@ export function timeline(models, config, ui) {
intervalDelta: intervalDelta,
setSelectedInterval: setSelectedInterval,
customSelected: customSelected,
- updateAnimationRange: updateAnimationRange
+ updateAnimationRange: updateAnimationRange,
+ animStartLocationDate: animStartLocationDate,
+ animEndLocationDate: animEndLocationDate
};
};
@@ -617,9 +624,7 @@ export function timeline(models, config, ui) {
} else {
subdaily = models.layers.hasSubDaily();
}
-console.log(models.date.selectedZoom)
-console.log(models.date.customInterval, timeScaleFromNumberKey[models.date.customInterval], models.date.interval, timeScaleFromNumberKey[models.date.interval])
// let subdaily = models.layers.hasSubDaily();
if (!subdaily && (models.date.customInterval > 3 || models.date.interval > 3)) {
setIntervalInput(1, 'day')
@@ -640,6 +645,16 @@ console.log(models.date.customInterval, timeScaleFromNumberKey[models.date.custo
updateSubdailyState();
};
+ var onAnimationDateChange = () => {
+ let animationStartLocationDate = models.anim.rangeState.startDate;
+ let animationEndLocationDate = models.anim.rangeState.endDate;
+
+ self.reactComponent.setState({
+ animStartLocationDate: animationStartLocationDate,
+ animEndLocationDate: animationEndLocationDate
+ });
+ };
+
var init = function() {
var $timelineFooter = $('#timeline-footer');
models.layers.events.trigger('toggle-subdaily');
@@ -709,6 +724,8 @@ console.log(models.date.customInterval, timeScaleFromNumberKey[models.date.custo
models.layers.events.on('change', onLayerUpdate);
+ // models.anim.events.on('datechange', onAnimationDateChange);
+
// Determine maximum end date and move tl pick there if selected date is
// greater than the max end date
models.layers.events.on('remove', function() {
diff --git a/web/js/map/compare/compare.js b/web/js/map/compare/compare.js
index cad1cd5e8..e5e66a8a4 100644
--- a/web/js/map/compare/compare.js
+++ b/web/js/map/compare/compare.js
@@ -16,7 +16,6 @@ const MOUSE_EVENT = {
end: 'mouseup'
};
export function mapCompare(models, config) {
- console.log(models.compare)
var self = {};
var comparison = null;
var mode = 'swipe';
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index e9e998227..71de365a2 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -125,7 +125,6 @@ export function mapLayerBuilder(models, config, cache, mapUi) {
var dateArray = def.availableDates || [];
if (options.date) {
if (def.period !== 'subdaily') {
- console.log(options.date)
date = util.clearTimeUTC(new Date(options.date.getTime()));
} else {
date = options.date;