From eb90a3eebaf52e5518170168418fef1c4c935356 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 10 Dec 2014 20:04:10 -0800 Subject: [PATCH] [Plot] Fix refactoring issues Fix issues related to refactoring of view-level to subplot-level behavior, such that previous functionality is restored. This refactoring supports introduction of a stacked-plot mode, for WTD-625. --- platform/features/plot/src/SubPlot.js | 5 ++++- platform/features/plot/src/modes/PlotModeOptions.js | 4 ++-- platform/features/plot/src/modes/PlotOverlayMode.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/platform/features/plot/src/SubPlot.js b/platform/features/plot/src/SubPlot.js index 298aa3cfbc..0bc7df84aa 100644 --- a/platform/features/plot/src/SubPlot.js +++ b/platform/features/plot/src/SubPlot.js @@ -1,7 +1,7 @@ /*global define*/ define( - ['elements/PlotPosition', 'elements/PlotFormatter', 'elements/PlotTickGenerator'], + ['./elements/PlotPosition', './elements/PlotFormatter', './elements/PlotTickGenerator'], function (PlotPosition, PlotFormatter, PlotTickGenerator) { "use strict"; @@ -191,6 +191,9 @@ define( updateDrawingBounds(); updateMarqueeBox(); updateTicks(); + }, + setDomainOffset: function (value) { + domainOffset = value; } }; } diff --git a/platform/features/plot/src/modes/PlotModeOptions.js b/platform/features/plot/src/modes/PlotModeOptions.js index 6fbcc31d91..dcae8cff59 100644 --- a/platform/features/plot/src/modes/PlotModeOptions.js +++ b/platform/features/plot/src/modes/PlotModeOptions.js @@ -1,7 +1,7 @@ /*global define*/ define( - [], + ["./PlotOverlayMode"], function (PlotOverlayMode, PlotStackedMode) { "use strict"; @@ -15,7 +15,7 @@ define( key: "overlaid", name: "Overlaid", glyph: "6", - factory: PlotStackedMode + factory: PlotOverlayMode }; function PlotModeOptions(telemetryObjects) { diff --git a/platform/features/plot/src/modes/PlotOverlayMode.js b/platform/features/plot/src/modes/PlotOverlayMode.js index 3df9c9cb9f..7653818696 100644 --- a/platform/features/plot/src/modes/PlotOverlayMode.js +++ b/platform/features/plot/src/modes/PlotOverlayMode.js @@ -22,7 +22,7 @@ define( // Track the domain offset, used to bias domain values // to minimize loss of precision when converted to 32-bit // floating point values for display. - domainOffset = prepared.getDomainOffset(); + subplot.setDomainOffset(prepared.getDomainOffset()); // Draw the buffers. Select color by index. subplot.getDrawingObject().lines = prepared.getBuffers().map(function (buf, i) {