mdt-charts 1.27.3 → 1.27.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,7 +37,7 @@ export class ScaleModel {
37
37
  getScaleSecondaryLinear(dataRows, configReader) {
38
38
  var _a;
39
39
  return {
40
- domain: getScaleLinearDomain(this.options.axis.value.domain, dataRows, this.options, "secondary"),
40
+ domain: getScaleLinearDomain(this.options.axis.valueSecondary.domain, dataRows, this.options, "secondary"),
41
41
  range: {
42
42
  start: 0,
43
43
  end: getScaleValueRangePeek(this.options.orientation, this.canvasModel)
@@ -56,13 +56,13 @@ export class TwoDimMarginModel {
56
56
  }
57
57
  else {
58
58
  const scaleModel = new ScaleModel(this.configReader.options, modelInstance.canvasModel).getScaleLinear(modelInstance.dataModel.repository.getRawRows(), this.configReader);
59
- labelsTexts = this.getValueAxisLabels(scaleModel, modelInstance).map((v) => this.configReader.getAxisLabelFormatter()(v).toString());
59
+ labelsTexts = this.getValueAxisLabels(scaleModel).map((v) => this.configReader.getAxisLabelFormatter()(v).toString());
60
60
  }
61
61
  return AxisModel.getLabelSize(this.designerConfig.canvas.axisLabel.maxSize.main, labelsTexts);
62
62
  }
63
63
  getMaxLabelSizeSecondary(modelInstance) {
64
64
  const scaleModel = new ScaleModel(this.configReader.options, modelInstance.canvasModel).getScaleSecondaryLinear(modelInstance.dataModel.repository.getRawRows(), this.configReader);
65
- const labelsTexts = this.getValueAxisLabels(scaleModel, modelInstance).map((v) => this.configReader.getSecondaryAxisLabelFormatter()(v).toString());
65
+ const labelsTexts = this.getValueAxisLabels(scaleModel).map((v) => this.configReader.getSecondaryAxisLabelFormatter()(v).toString());
66
66
  return AxisModel.getLabelSize(this.designerConfig.canvas.axisLabel.maxSize.main, labelsTexts);
67
67
  }
68
68
  recalcVerticalMarginByAxisLabelHeight(labelHeight, canvasModel) {
@@ -112,16 +112,14 @@ export class TwoDimMarginModel {
112
112
  };
113
113
  canvasModel.increaseMarginSide(axisMarginMapping[keyAxisOrient], valueLabelFontSize + OFFSET_SIZE_PX);
114
114
  }
115
- getValueAxisLabels(scaleModel, modelInstance) {
115
+ getValueAxisLabels(scaleModel) {
116
116
  const scale = Scale.getScaleValue(scaleModel);
117
117
  const ticksPolicy = AxisModel.getTickAmountPolicy(this.configReader.options.orientation, this.configReader.options.axis.value, scaleModel);
118
- let outputValues;
118
+ let outputValues = [];
119
119
  if (ticksPolicy.type === "constant")
120
120
  outputValues = ticksPolicy.values;
121
121
  else if (ticksPolicy.type === "amount")
122
122
  outputValues = scale.ticks(ticksPolicy.amount);
123
- else
124
- outputValues = this.configReader.getBiggestValueAndDecremented(modelInstance.dataModel.repository);
125
123
  return outputValues;
126
124
  }
127
125
  }
@@ -1,6 +1,5 @@
1
1
  import { AxisLabelFormatter, MdtChartsConfig, MdtChartsField, MdtChartsFieldName, MdtChartsTwoDimensionalOptions, TwoDimensionalChartType, TwoDimensionalValueGroup, ValueLabelsFormatter } from "../../config/config";
2
2
  import { DesignerConfig } from "../../designer/designerConfig";
3
- import { DataRepositoryModel } from "../../model/modelInstance/dataModel/dataRepository";
4
3
  import { ValueLabelsStyleModel } from "../model";
5
4
  interface BaseConfigReader {
6
5
  getValueFields(): MdtChartsField[];
@@ -11,8 +10,6 @@ export declare class TwoDimConfigReader implements BaseConfigReader {
11
10
  readonly options: MdtChartsTwoDimensionalOptions;
12
11
  constructor(config: MdtChartsConfig, designerConfig: DesignerConfig);
13
12
  getValueFields(): MdtChartsField[];
14
- getBiggestValueAndDecremented(repository: DataRepositoryModel): number[];
15
- getBiggestValueAndDecrementedSecondary(repository: DataRepositoryModel): number[];
16
13
  getFieldsBySegments(valueGroup: TwoDimensionalValueGroup): MdtChartsFieldName[][];
17
14
  getAxisLabelFormatter(): AxisLabelFormatter;
18
15
  getSecondaryAxisLabelFormatter(): AxisLabelFormatter;
@@ -26,7 +23,6 @@ export declare class TwoDimConfigReader implements BaseConfigReader {
26
23
  areValueLabelsOn(): boolean;
27
24
  areValueLabelsNeedIncreaseMargin(): boolean;
28
25
  getValueLabelsStyleModel(): ValueLabelsStyleModel;
29
- private calculateBiggestValueAndDecremented;
30
26
  private calculateAxisLabelFormatter;
31
27
  }
32
28
  export declare class PolarConfigReader implements BaseConfigReader {
@@ -1,4 +1,3 @@
1
- import { getResolvedDomain } from "../../model/featuresModel/scaleModel/scaleDomainService";
2
1
  export function getConfigReader(config, designerConfig) {
3
2
  if (config.options.type === "2d")
4
3
  return new TwoDimConfigReader(config, designerConfig);
@@ -18,12 +17,6 @@ export class TwoDimConfigReader {
18
17
  });
19
18
  return fields;
20
19
  }
21
- getBiggestValueAndDecremented(repository) {
22
- return this.calculateBiggestValueAndDecremented(repository, this.options.axis.value.domain, this.getFieldsBySegments("main"));
23
- }
24
- getBiggestValueAndDecrementedSecondary(repository) {
25
- return this.calculateBiggestValueAndDecremented(repository, this.options.axis.valueSecondary.domain, this.getFieldsBySegments("secondary"));
26
- }
27
20
  getFieldsBySegments(valueGroup) {
28
21
  const segments = [];
29
22
  const valueGroupCharts = this.options.charts.filter((chart) => { var _a; return ((_a = chart.data.valueGroup) !== null && _a !== void 0 ? _a : "main") === valueGroup; });
@@ -90,13 +83,6 @@ export class TwoDimConfigReader {
90
83
  cssClassName: (_h = (_g = this.options.valueLabels) === null || _g === void 0 ? void 0 : _g.style) === null || _h === void 0 ? void 0 : _h.cssClassName
91
84
  };
92
85
  }
93
- calculateBiggestValueAndDecremented(repository, domain, fields) {
94
- const resolvedDomain = getResolvedDomain(domain, repository.getRawRows());
95
- if (resolvedDomain && resolvedDomain.end !== -1) {
96
- return [resolvedDomain.end, resolvedDomain.end - 1];
97
- }
98
- return repository.getBiggestValueAndDecremented(fields);
99
- }
100
86
  calculateAxisLabelFormatter(axisValue) {
101
87
  var _a, _b;
102
88
  if ((_a = axisValue.labels) === null || _a === void 0 ? void 0 : _a.format)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdt-charts",
3
- "version": "1.27.3",
3
+ "version": "1.27.4",
4
4
  "description": "",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {