mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 20:58:15 +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:
40
platform/features/plot/src/SubPlotFactory.js
Normal file
40
platform/features/plot/src/SubPlotFactory.js
Normal file
@ -0,0 +1,40 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
["./SubPlot"],
|
||||
function (SubPlot) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Utility factory; wraps the SubPlot constructor and adds
|
||||
* in a reference to the telemetryFormatter, which will be
|
||||
* used to represent telemetry values (timestamps or data
|
||||
* values) as human-readable strings.
|
||||
* @constructor
|
||||
*/
|
||||
function SubPlotFactory(telemetryFormatter) {
|
||||
return {
|
||||
/**
|
||||
* Instantiate a new sub-plot.
|
||||
* @param {DomainObject[]} telemetryObjects the domain objects
|
||||
* which will be plotted in this sub-plot
|
||||
* @param {PlotPanZoomStack} panZoomStack the stack of pan-zoom
|
||||
* states which is applicable to this sub-plot
|
||||
* @returns {SubPlot} the instantiated sub-plot
|
||||
* @method
|
||||
* @memberof SubPlotFactory
|
||||
*/
|
||||
createSubPlot: function (telemetryObjects, panZoomStack) {
|
||||
return new SubPlot(
|
||||
telemetryObjects,
|
||||
panZoomStack,
|
||||
telemetryFormatter
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return SubPlotFactory;
|
||||
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user