Interactive interface for browsing global, full-resolution satellite imagery
debug perfomance and minor cleanup
Edward Plato082e80be3473
diff --git a/web/js/components/timeline/timeline-axis/timeline-axis.js b/web/js/components/timeline/timeline-axis/timeline-axis.jsindex aad01cd70..2816e42b5 100644--- a/web/js/components/timeline/timeline-axis/timeline-axis.js+++ b/web/js/components/timeline/timeline-axis/timeline-axis.js@@ -10,7 +10,6 @@ import {timeScaleOptions,timeScaleToNumberKey} from '../../../modules/date/constants';-import {getIsBetween,removeBackMultipleInPlace,@@ -173,11 +172,6 @@ class TimelineAxis extends Component {draggerPosition = draggerPosition - pixelsToAdd + position - this.state.draggerWidth;draggerPositionB = draggerPositionB - pixelsToAdd + position - this.state.draggerWidth;- // let init = false;- // if (this.state.init === true) {- // init = false- // }-let updatePositioningArguments = {moved: false,isTimelineDragging: false,@@ -373,8 +367,7 @@ class TimelineAxis extends Component {axisWidth,compareModeActive,draggerTimeState,- draggerTimeStateB,- hasSubdailyLayers+ draggerTimeStateB} = this.props;// update timescale axis focus@@ -405,26 +398,6 @@ class TimelineAxis extends Component {this.updateScale(draggerDate, timeScale, axisWidth);}- // if (compareModeActive !== prevProps.compareModeActive) {- // // TURN ON COMPARE MODE- // if (compareModeActive) {- // this.updateScale(draggerDate, timeScale, axisWidth);- // } else {- // // TURN OFF COMPARE MODE- // if (draggerSelected === 'selected') {- // this.props.setDraggerVisibility(true, false);- // // this.setState({- // // draggerVisibleB: false- // // });- // } else {- // this.props.setDraggerVisibility(false, true);- // // this.setState({- // // draggerVisible: false- // // });- // }- // }- // }-// handle switching A/B dragger axis focus if switched from A/B sidebar tabsif (compareModeActive && (draggerSelected !== prevProps.draggerSelected)) {if (draggerSelected === 'selected') {@@ -445,9 +418,7 @@ class TimelineAxis extends Component {if (draggerTimeState !== dateA) {// check if draggerCheck will be within acceptable visible axis widthlet draggerCheck = this.checkDraggerMoveOrUpdateScale(dateA);- if (draggerCheck.withinRange) {- // this.setDraggerToTime(dateA);- } else {+ if (!draggerCheck.withinRange) {this.updateScaleWithOffset(dateA, timeScale, draggerCheck);}}@@ -456,9 +427,7 @@ class TimelineAxis extends Component {if (draggerTimeStateB !== dateB) {// check if draggerCheck will be within acceptable visible axis widthlet draggerCheck = this.checkDraggerMoveOrUpdateScale(dateB, true);- if (draggerCheck.withinRange) {- // this.setDraggerToTime(dateB, true);- } else {+ if (!draggerCheck.withinRange) {this.updateScaleWithOffset(dateB, timeScale, draggerCheck);}}@@ -864,7 +833,6 @@ console.log(hoverTime)timeScale,compareModeActive,hasSubdailyLayers,- // parentOffset,timelineEndDateLimit,transformX,frontDate,@@ -879,7 +847,6 @@ console.log(hoverTime)nextProps.timeScale === timeScale &&nextProps.compareModeActive === compareModeActive &&nextProps.hasSubdailyLayers === hasSubdailyLayers &&- // nextProps.parentOffset === parentOffset &&nextProps.timelineEndDateLimit === timelineEndDateLimit &&nextProps.transformX === transformX &&nextProps.frontDate === frontDate &&@@ -887,42 +854,29 @@ console.log(hoverTime));let {- // currentTimeRange,dragSentinelChangeNumber,dragSentinelCount,gridNumber,gridWidth,- // hoverLinePosition,- // hoverTime,- // isAnimationDraggerDragging,- // isDraggerDragging,- // isTimelineDragging,leftBound,- // leftOffset,midPoint,- // moved,numberOfVisibleTiles,rightBound,- // showDraggerTime,- // showHoverLine,wheelZoom} = this.state;let checkForStateUpdates = (- // currentTimeRange[0].rawDate === nextState.currentTimeRange[0].rawDate &&dragSentinelChangeNumber === nextState.dragSentinelChangeNumber &&dragSentinelCount === nextState.dragSentinelCount &&gridNumber === nextState.gridNumber &&gridWidth === nextState.gridWidth &&leftBound === nextState.leftBound &&midPoint === nextState.midPoint &&- // moved === nextState.moved &&numberOfVisibleTiles === nextState.numberOfVisibleTiles &&rightBound === nextState.rightBound &&wheelZoom === nextState.wheelZoom);-if (checkForPropsUpdates && checkForStateUpdates) {return false;}diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.jsindex 9983f2ff2..16afeda75 100644--- a/web/js/containers/timeline/timeline.js+++ b/web/js/containers/timeline/timeline.js@@ -105,12 +105,12 @@ class Timeline extends React.Component {// display date based on hover grid tiledisplayDate = (date, leftOffset) => {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)+ 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