mirror of
https://github.com/nasa/openmct.git
synced 2025-06-07 09:51:41 +00:00
Plot uses ColorPalette to allocate colors
This commit is contained in:
parent
52b8720d37
commit
cb41be7922
@ -4,7 +4,7 @@
|
|||||||
<span class="plot-legend-item"
|
<span class="plot-legend-item"
|
||||||
ng-repeat="series in series">
|
ng-repeat="series in series">
|
||||||
<span class="plot-color-swatch"
|
<span class="plot-color-swatch"
|
||||||
ng-style="{ 'background-color': series.color }">
|
ng-style="{ 'background-color': series.color.asHexString() }">
|
||||||
</span>
|
</span>
|
||||||
<span class="title-label">{{ series.name }}</span>
|
<span class="title-label">{{ series.name }}</span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
|
|
||||||
define(
|
define(
|
||||||
function () {
|
['../ColorPalette.js'],
|
||||||
|
function (ColorPalette) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// TODO: Store this in more accessible locations / retrieve from
|
// TODO: Store this in more accessible locations / retrieve from
|
||||||
@ -13,6 +14,7 @@ define(
|
|||||||
var isLive = true;
|
var isLive = true;
|
||||||
var maxDomain = +new Date();
|
var maxDomain = +new Date();
|
||||||
var subscriptions = [];
|
var subscriptions = [];
|
||||||
|
var palette = new 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 = {
|
||||||
@ -63,7 +65,7 @@ define(
|
|||||||
var series = {
|
var series = {
|
||||||
name: model.name,
|
name: model.name,
|
||||||
// TODO: Bring back PlotPalette.
|
// TODO: Bring back PlotPalette.
|
||||||
color: [0.12549019607843137, 0.6980392156862745, 0.6666666666666666, 1],
|
color: palette.getColor(),
|
||||||
data: []
|
data: []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ define(
|
|||||||
lines.forEach(function(line) {
|
lines.forEach(function(line) {
|
||||||
drawAPI.drawLine(
|
drawAPI.drawLine(
|
||||||
line.buffer,
|
line.buffer,
|
||||||
line.color,
|
line.color.asRGBAArray(),
|
||||||
line.pointCount
|
line.pointCount
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user