[Plot] Begin refactoring for stacked plots

Begin refactoring Plot view to support stacked plots;
separate out behavior which needs to occur per-plot
from area which should occur per-view, and add a
handler for the Overlay mode. WTD-625.
This commit is contained in:
Victor Woeltjen
2014-12-10 19:51:27 -08:00
parent 1c3d2d923f
commit 784b2b6186
5 changed files with 307 additions and 202 deletions

View File

@ -8,21 +8,30 @@ define(
var STACKED = {
key: "stacked",
name: "Stacked",
glyph: "8"
glyph: "8",
factory: PlotOverlayMode
},
OVERLAID = {
key: "overlaid",
name: "Overlaid",
glyph: "6"
glyph: "6",
factory: PlotStackedMode
};
function PlotModeOptions(telemetryObjects) {
var options = telemetryObjects.length > 1 ?
[ OVERLAID, STACKED ] : [ OVERLAID ],
mode = options[0];
mode = options[0],
modeHandler;
return {
getModeHandler: function () {
if (!modeHandler) {
modeHandler = mode.factory(telemetryObjects);
}
return modeHandler;
},
getModeOptions: function () {
return options;
},
@ -30,7 +39,10 @@ define(
return mode;
},
setMode: function (option) {
mode = option;
if (mode !== option) {
mode = option;
modeHandler = undefined;
}
}
};
}