mirror of
https://github.com/nasa/openmct.git
synced 2025-06-10 19:31:42 +00:00
[Plot] Use ColorService for plot colors
This commit is contained in:
parent
48f345a46b
commit
a0dc3da8fb
@ -53,12 +53,12 @@
|
|||||||
{
|
{
|
||||||
"key": "PlotController",
|
"key": "PlotController",
|
||||||
"implementation": "controllers/PlotController.js",
|
"implementation": "controllers/PlotController.js",
|
||||||
"depends": [ "$scope", "telemetryFormatter", "telemetryHandler" ]
|
"depends": [ "$scope", "colorService"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "StackedPlotController",
|
"key": "StackedPlotController",
|
||||||
"implementation": "controllers/StackedPlotController.js",
|
"implementation": "controllers/StackedPlotController.js",
|
||||||
"depends": [ "$scope", "telemetryFormatter", "telemetryHandler" ]
|
"depends": [ "$scope" ]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"types": [
|
"types": [
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
|
|
||||||
define(
|
define(
|
||||||
['../ColorPalette.js'],
|
[],
|
||||||
function (ColorPalette) {
|
function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// TODO: Store this in more accessible locations / retrieve from
|
// TODO: Store this in more accessible locations / retrieve from
|
||||||
// domainObject metadata.
|
// domainObject metadata.
|
||||||
var DOMAIN_INTERVAL = 1 * 60 * 1000; // One minute.
|
var DOMAIN_INTERVAL = 1 * 60 * 1000; // One minute.
|
||||||
|
|
||||||
function PlotController($scope) {
|
function PlotController($scope, colorService) {
|
||||||
var plotHistory = [];
|
var plotHistory = [];
|
||||||
var isLive = true;
|
var isLive = true;
|
||||||
var maxDomain = +new Date();
|
var maxDomain = +new Date();
|
||||||
var subscriptions = [];
|
var subscriptions = [];
|
||||||
var palette = new ColorPalette();
|
var palette = new colorService.ColorPalette();
|
||||||
var setToDefaultViewport = function() {
|
var setToDefaultViewport = function() {
|
||||||
// TODO: We shouldn't set the viewport until we have received data or something has given us a reasonable viewport.
|
// TODO: We shouldn't set the viewport until we have received data or something has given us a reasonable viewport.
|
||||||
$scope.viewport = {
|
$scope.viewport = {
|
||||||
@ -65,7 +65,7 @@ define(
|
|||||||
var series = {
|
var series = {
|
||||||
name: model.name,
|
name: model.name,
|
||||||
// TODO: Bring back PlotPalette.
|
// TODO: Bring back PlotPalette.
|
||||||
color: palette.getColor(),
|
color: palette.getColor($scope.series.length),
|
||||||
data: []
|
data: []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user