From 202d05550946412461b67e943583d4cdf6d332ff Mon Sep 17 00:00:00 2001 From: xsalonx Date: Fri, 8 Nov 2024 09:43:15 +0100 Subject: [PATCH] clenaup --- .../common/chart/rendering/ChartRenderer.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/public/components/common/chart/rendering/ChartRenderer.js b/lib/public/components/common/chart/rendering/ChartRenderer.js index 4257cb9136..becf1e8d43 100644 --- a/lib/public/components/common/chart/rendering/ChartRenderer.js +++ b/lib/public/components/common/chart/rendering/ChartRenderer.js @@ -109,36 +109,36 @@ export class ChartRenderer { height: 0, }; - const dependentVariable = this.isXIndexAxis ? Y_AXIS_NAME : X_AXIS_NAME; - const { [dependentVariable]: { - min: dependetnVarMin, - max: dependentVarMax, + const valueAxis = this.isXIndexAxis ? Y_AXIS_NAME : X_AXIS_NAME; + const { [valueAxis]: { + min: valueAxisMin, + max: valueAxisMax, } } = this.getAxisConfiguration(); const indexAxisScaleFactory = new EnumerableBasedScaleFactory({ point: this.isPoint }); - const dependentAxisScaleFactoryConfiguration = { forceRange: { min: dependetnVarMin, max: dependentVarMax } }; + const valueAxisScaleFactoryConfiguration = { forceRange: { min: valueAxisMin, max: valueAxisMax } }; if (this._forceZero) { - dependentAxisScaleFactoryConfiguration.minimalRange = { min: 0, max: 0 }; + valueAxisScaleFactoryConfiguration.minimalRange = { min: 0, max: 0 }; } - const dependantAxisScaleFactory = new RangeBasedScaleFactory(dependentAxisScaleFactoryConfiguration); + const valueAxisScaleFactory = new RangeBasedScaleFactory(valueAxisScaleFactoryConfiguration); for (const point of data) { indexAxisScaleFactory.processValue?.(point[indexAxis]); - if (Array.isArray(point[dependentVariable])) { - for (const value of point[dependentVariable]) { - dependantAxisScaleFactory.processValue?.(value); + if (Array.isArray(point[valueAxis])) { + for (const value of point[valueAxis]) { + valueAxisScaleFactory.processValue?.(value); } } else { - dependantAxisScaleFactory.processValue?.(point[dependentVariable]); + valueAxisScaleFactory.processValue?.(point[valueAxis]); } } if (indexAxis === 'x') { this._xAxisScaleFactory = indexAxisScaleFactory; - this._yAxisScaleFactory = dependantAxisScaleFactory; + this._yAxisScaleFactory = valueAxisScaleFactory; } else { - this._xAxisScaleFactory = dependantAxisScaleFactory; + this._xAxisScaleFactory = valueAxisScaleFactory; this._yAxisScaleFactory = indexAxisScaleFactory; } @@ -311,7 +311,7 @@ export class ChartRenderer { } /** - * States whether x is independnet variable + * States whether x is index variable * * @return {boolean} true if x is index axis, false otherwise */