mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 14:18:16 +00:00
[Telemetry] Refactor plot to use TelemetryFormatter
Refactor plot view to use an injected telemetry formatter, instead of explicitly including moment. WTD-599.
This commit is contained in:
@ -27,7 +27,7 @@ define(
|
||||
* @param {DomainObject[]} the telemetry objects being
|
||||
* represented in this plot view
|
||||
*/
|
||||
function PlotModeOptions(telemetryObjects) {
|
||||
function PlotModeOptions(telemetryObjects, subPlotFactory) {
|
||||
var options = telemetryObjects.length > 1 ?
|
||||
[ OVERLAID, STACKED ] : [ OVERLAID ],
|
||||
mode = options[0], // Initial selection (overlaid)
|
||||
@ -44,7 +44,10 @@ define(
|
||||
getModeHandler: function () {
|
||||
// Lazily initialize
|
||||
if (!modeHandler) {
|
||||
modeHandler = mode.factory(telemetryObjects);
|
||||
modeHandler = mode.factory(
|
||||
telemetryObjects,
|
||||
subPlotFactory
|
||||
);
|
||||
}
|
||||
return modeHandler;
|
||||
},
|
||||
|
@ -11,10 +11,13 @@ define(
|
||||
* @constructor
|
||||
* @param {DomainObject[]} the domain objects to be plotted
|
||||
*/
|
||||
function PlotOverlayMode(telemetryObjects) {
|
||||
function PlotOverlayMode(telemetryObjects, subPlotFactory) {
|
||||
var domainOffset,
|
||||
panZoomStack = new PlotPanZoomStack([], []),
|
||||
subplot = new SubPlot(telemetryObjects, panZoomStack),
|
||||
subplot = subPlotFactory.createSubPlot(
|
||||
telemetryObjects,
|
||||
panZoomStack
|
||||
),
|
||||
subplots = [ subplot ];
|
||||
|
||||
function plotTelemetry(prepared) {
|
||||
|
@ -11,12 +11,12 @@ define(
|
||||
* @constructor
|
||||
* @param {DomainObject[]} the domain objects to be plotted
|
||||
*/
|
||||
function PlotStackMode(telemetryObjects) {
|
||||
function PlotStackMode(telemetryObjects, subPlotFactory) {
|
||||
var domainOffset,
|
||||
panZoomStackGroup =
|
||||
new PlotPanZoomStackGroup(telemetryObjects.length),
|
||||
subplots = telemetryObjects.map(function (telemetryObject, i) {
|
||||
return new SubPlot(
|
||||
return subPlotFactory.createSubPlot(
|
||||
[telemetryObject],
|
||||
panZoomStackGroup.getPanZoomStack(i)
|
||||
);
|
||||
|
Reference in New Issue
Block a user