Files
openmct/platform/features/plot/src/modes/PlotModeOptions.js
Victor Woeltjen 01f1a92d09 [Plot] Get/set from overlay switcher
Get/set mode from the plot mode switcher; only show
the switcher if there is more than one mode available
(which should only occur when there is more than one
telemetry object in the plot.) WTD-625.
2014-12-10 18:38:42 -08:00

40 lines
955 B
JavaScript

/*global define*/
define(
[],
function (PlotOverlayMode, PlotStackedMode) {
"use strict";
var STACKED = {
key: "stacked",
name: "Stacked",
glyph: "8"
},
OVERLAID = {
key: "overlaid",
name: "Overlaid",
glyph: "6"
};
function PlotModeOptions(telemetryObjects) {
var options = telemetryObjects.length > 1 ?
[ OVERLAID, STACKED ] : [ OVERLAID ],
mode = options[0];
return {
getModeOptions: function () {
return options;
},
getMode: function () {
return mode;
},
setMode: function (option) {
mode = option;
}
};
}
return PlotModeOptions;
}
);