mirror of
https://github.com/nasa/openmct.git
synced 2025-06-22 17:08:57 +00:00
[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:
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user