From 2a14cf2dfcde1cdb9a5eb3437e0b0a419fd6a929 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 11 Sep 2015 11:31:12 -0700 Subject: [PATCH] [Time Controller] Only listen for display-bounds changes ...from plot. WTD-1515 --- platform/features/plot/src/PlotController.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/platform/features/plot/src/PlotController.js b/platform/features/plot/src/PlotController.js index 3b846d33b8..47cf1f31c6 100644 --- a/platform/features/plot/src/PlotController.js +++ b/platform/features/plot/src/PlotController.js @@ -66,6 +66,7 @@ define( cachedObjects = [], updater, lastBounds, + throttledRequery, handle; // Populate the scope with axis information (specifically, options @@ -96,7 +97,7 @@ define( } // Change the displayable bounds - function setBasePanZoom(unused, bounds) { + function setBasePanZoom(bounds) { var start = bounds.start, end = bounds.end; if (updater) { @@ -121,7 +122,7 @@ define( ); // Keep any externally-provided bounds if (lastBounds) { - setBasePanZoom({}, lastBounds); + setBasePanZoom(lastBounds); } } @@ -181,14 +182,17 @@ define( } } - // Initiate a new query for data because query bounds changed - function requery() { + // Respond to a display bounds change (requery for data) + function changeDisplayBounds(event, bounds) { + setBasePanZoom(bounds); if (handle) { recreateUpdater(); - requestTelemetry(); + throttledRequery(); } } + throttledRequery = throttle(requestTelemetry, 250); + this.modeOptions = new PlotModeOptions([], subPlotFactory); this.updateValues = updateValues; @@ -202,10 +206,7 @@ define( $scope.$watch('domainObject', subscribe); // Respond to external bounds changes - $scope.$on("telemetry:display:bounds", setBasePanZoom); - - // Respond to external query range changes - $scope.$on("telemetry:query:bounds", throttle(requery, 250)); + $scope.$on("telemetry:display:bounds", changeDisplayBounds); // Unsubscribe when the plot is destroyed $scope.$on("$destroy", releaseSubscription);