mirror of
https://github.com/nasa/openmct.git
synced 2025-06-06 01:11:41 +00:00
[Plots] y-axis width fix (#3112)
* remove lodash native implementation of lodash max * remove unused lodash imports * add 'missing' semi-colon Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
This commit is contained in:
parent
f0dc928230
commit
9e5eddec9b
@ -30,8 +30,7 @@ define([
|
|||||||
'./MCTChartPointSet',
|
'./MCTChartPointSet',
|
||||||
'./MCTChartAlarmPointSet',
|
'./MCTChartAlarmPointSet',
|
||||||
'../draw/DrawLoader',
|
'../draw/DrawLoader',
|
||||||
'../lib/eventHelpers',
|
'../lib/eventHelpers'
|
||||||
'lodash'
|
|
||||||
],
|
],
|
||||||
function (
|
function (
|
||||||
MCTChartLineLinear,
|
MCTChartLineLinear,
|
||||||
@ -39,8 +38,7 @@ function (
|
|||||||
MCTChartPointSet,
|
MCTChartPointSet,
|
||||||
MCTChartAlarmPointSet,
|
MCTChartAlarmPointSet,
|
||||||
DrawLoader,
|
DrawLoader,
|
||||||
eventHelpers,
|
eventHelpers
|
||||||
_
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
var MARKER_SIZE = 6.0,
|
var MARKER_SIZE = 6.0,
|
||||||
|
@ -22,13 +22,11 @@
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'lodash',
|
|
||||||
'EventEmitter',
|
'EventEmitter',
|
||||||
'./Model',
|
'./Model',
|
||||||
'../lib/extend',
|
'../lib/extend',
|
||||||
'../lib/eventHelpers'
|
'../lib/eventHelpers'
|
||||||
], function (
|
], function (
|
||||||
_,
|
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
Model,
|
Model,
|
||||||
extend,
|
extend,
|
||||||
|
@ -22,11 +22,9 @@
|
|||||||
|
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'lodash',
|
|
||||||
'EventEmitter',
|
'EventEmitter',
|
||||||
'../lib/eventHelpers'
|
'../lib/eventHelpers'
|
||||||
], function (
|
], function (
|
||||||
_,
|
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
eventHelpers
|
eventHelpers
|
||||||
) {
|
) {
|
||||||
|
@ -22,11 +22,9 @@
|
|||||||
|
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'lodash',
|
|
||||||
'EventEmitter',
|
'EventEmitter',
|
||||||
'../lib/eventHelpers'
|
'../lib/eventHelpers'
|
||||||
], function (
|
], function (
|
||||||
_,
|
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
eventHelpers
|
eventHelpers
|
||||||
) {
|
) {
|
||||||
|
@ -23,13 +23,11 @@
|
|||||||
define([
|
define([
|
||||||
'../configuration/configStore',
|
'../configuration/configStore',
|
||||||
'../lib/eventHelpers',
|
'../lib/eventHelpers',
|
||||||
'objectUtils',
|
'objectUtils'
|
||||||
'lodash'
|
|
||||||
], function (
|
], function (
|
||||||
configStore,
|
configStore,
|
||||||
eventHelpers,
|
eventHelpers,
|
||||||
objectUtils,
|
objectUtils
|
||||||
_
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
function PlotOptionsController($scope, openmct, $timeout) {
|
function PlotOptionsController($scope, openmct, $timeout) {
|
||||||
|
@ -21,11 +21,9 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'./PlotModelFormController',
|
'./PlotModelFormController'
|
||||||
'lodash'
|
|
||||||
], function (
|
], function (
|
||||||
PlotModelFormController,
|
PlotModelFormController
|
||||||
_
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
var PlotYAxisFormController = PlotModelFormController.extend({
|
var PlotYAxisFormController = PlotModelFormController.extend({
|
||||||
|
@ -20,12 +20,7 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([], function () {
|
||||||
'lodash'
|
|
||||||
], function (
|
|
||||||
_
|
|
||||||
) {
|
|
||||||
|
|
||||||
function StackedPlotController($scope, openmct, objectService, $element, exportImageService) {
|
function StackedPlotController($scope, openmct, objectService, $element, exportImageService) {
|
||||||
var tickWidth = 0,
|
var tickWidth = 0,
|
||||||
composition,
|
composition,
|
||||||
@ -125,12 +120,13 @@ define([
|
|||||||
$scope.$watch('domainObject.getModel().composition', onCompositionChange);
|
$scope.$watch('domainObject.getModel().composition', onCompositionChange);
|
||||||
|
|
||||||
$scope.$on('plot:tickWidth', function ($e, width) {
|
$scope.$on('plot:tickWidth', function ($e, width) {
|
||||||
var plotId = $e.targetScope.domainObject.getId();
|
const plotId = $e.targetScope.domainObject.getId();
|
||||||
if (!tickWidthMap.hasOwnProperty(plotId)) {
|
if (!tickWidthMap.hasOwnProperty(plotId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tickWidthMap[plotId] = Math.max(width, tickWidthMap[plotId]);
|
tickWidthMap[plotId] = Math.max(width, tickWidthMap[plotId]);
|
||||||
var newTickWidth = _.max(tickWidthMap);
|
const newTickWidth = Math.max(...Object.values(tickWidthMap));
|
||||||
if (newTickWidth !== tickWidth || width !== tickWidth) {
|
if (newTickWidth !== tickWidth || width !== tickWidth) {
|
||||||
tickWidth = newTickWidth;
|
tickWidth = newTickWidth;
|
||||||
$scope.$broadcast('plot:tickWidth', tickWidth);
|
$scope.$broadcast('plot:tickWidth', tickWidth);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user