diff --git a/platform/features/plot/res/templates/plot.html b/platform/features/plot/res/templates/plot.html index 4f94fde285..7d348826d3 100644 --- a/platform/features/plot/res/templates/plot.html +++ b/platform/features/plot/res/templates/plot.html @@ -63,7 +63,7 @@ + ng-mouseup="subplot.endMarquee($event); plot.update()"> diff --git a/platform/features/plot/src/PlotController.js b/platform/features/plot/src/PlotController.js index 841dc95726..53793f7530 100644 --- a/platform/features/plot/src/PlotController.js +++ b/platform/features/plot/src/PlotController.js @@ -90,6 +90,10 @@ define( modeOptions.getModeHandler().plotTelemetry(prepared); } + function updateSubplot(subplot) { + subplot.update(); + } + function setupModes(telemetryObjects) { modeOptions = new PlotModeOptions(telemetryObjects || []); } @@ -159,6 +163,14 @@ define( */ getSubPlots: function () { return modeOptions.getModeHandler().getSubPlots(); + }, + /** + * Explicitly update all plots. + */ + update: function () { + modeOptions.getModeHandler() + .getSubPlots() + .forEach(updateSubplot); } }; diff --git a/platform/features/plot/src/elements/PlotPanZoomStackGroup.js b/platform/features/plot/src/elements/PlotPanZoomStackGroup.js index 1f37b8ef63..b10ec2723a 100644 --- a/platform/features/plot/src/elements/PlotPanZoomStackGroup.js +++ b/platform/features/plot/src/elements/PlotPanZoomStackGroup.js @@ -63,15 +63,13 @@ define( return { popPanZoom: popPanZoom, clearPanZoom: clearPanZoom, + setBasePanZoom: setBasePanZoom, getDepth: function () { return stacks.length > 0 ? stacks[0].getDepth() : 0; }, getPanZoomStack: function (index) { return decoratedStacks[index]; - }, - getPanZoomStacks: function () { - return decoratedStacks; } }; diff --git a/platform/features/plot/src/modes/PlotStackMode.js b/platform/features/plot/src/modes/PlotStackMode.js index 78abc16d50..77ebb94c41 100644 --- a/platform/features/plot/src/modes/PlotStackMode.js +++ b/platform/features/plot/src/modes/PlotStackMode.js @@ -37,12 +37,10 @@ define( function plotTelemetry(prepared) { // Fit to the boundaries of the data, but don't // override any user-initiated pan-zoom changes. - panZoomStackGroup.getPanZoomStacks().forEach(function (stack) { - stack.setBasePanZoom( - prepared.getOrigin(), - prepared.getDimensions() - ); - }); + panZoomStackGroup.setBasePanZoom( + prepared.getOrigin(), + prepared.getDimensions() + ); subplots.forEach(function (subplot, index) { plotTelemetryTo(subplot, prepared, index);