mdt-charts 1.20.0 → 1.21.0
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.
- package/lib/config/config.d.ts +25 -0
- package/lib/engine/block/blockSvg.d.ts +1 -1
- package/lib/engine/block/blockSvg.js +1 -1
- package/lib/engine/block/defs/LinearGradientDef.d.ts +6 -0
- package/lib/engine/block/defs/LinearGradientDef.js +28 -0
- package/lib/engine/elementHighlighter/elementHighlighter.d.ts +0 -1
- package/lib/engine/elementHighlighter/elementHighlighter.js +5 -8
- package/lib/engine/elementHighlighter/selectHighlighter.js +11 -10
- package/lib/engine/features/legend/legendMarkerCreator.js +1 -1
- package/lib/engine/features/markDots/markDot.d.ts +11 -3
- package/lib/engine/features/markDots/markDot.js +21 -10
- package/lib/engine/features/tolltip/tooltip.js +5 -4
- package/lib/engine/features/valueLabels/valueLabels.d.ts +45 -0
- package/lib/engine/features/valueLabels/valueLabels.js +139 -0
- package/lib/engine/features/valueLabels/valueLabelsHelper.d.ts +6 -0
- package/lib/engine/features/valueLabels/valueLabelsHelper.js +21 -0
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollision.d.ts +23 -0
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollision.js +24 -0
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollisionHelper.d.ts +5 -0
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollisionHelper.js +47 -0
- package/lib/engine/helpers/domHelper.d.ts +1 -0
- package/lib/engine/helpers/domHelper.js +4 -0
- package/lib/engine/twoDimensionalNotation/area/area.d.ts +26 -11
- package/lib/engine/twoDimensionalNotation/area/area.js +100 -34
- package/lib/engine/twoDimensionalNotation/area/areaGenerator.d.ts +14 -0
- package/lib/engine/twoDimensionalNotation/area/areaGenerator.js +22 -0
- package/lib/engine/twoDimensionalNotation/area/areaHelper.d.ts +7 -7
- package/lib/engine/twoDimensionalNotation/area/areaHelper.js +30 -31
- package/lib/engine/twoDimensionalNotation/bar/barHelper.js +1 -1
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStacker.d.ts +4 -2
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStacker.js +2 -5
- package/lib/engine/twoDimensionalNotation/line/line.d.ts +2 -7
- package/lib/engine/twoDimensionalNotation/line/line.js +6 -6
- package/lib/engine/twoDimensionalNotation/line/lineGenerator.d.ts +4 -7
- package/lib/engine/twoDimensionalNotation/line/lineGenerator.js +2 -16
- package/lib/engine/twoDimensionalNotation/line/lineHelper.d.ts +4 -13
- package/lib/engine/twoDimensionalNotation/line/lineHelper.js +22 -10
- package/lib/engine/twoDimensionalNotation/lineLike/generatorFactory/lineLikeGeneratorFactory.d.ts +12 -0
- package/lib/engine/twoDimensionalNotation/lineLike/generatorFactory/lineLikeGeneratorFactory.js +1 -0
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorCurveMiddleware.d.ts +14 -0
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorCurveMiddleware.js +21 -0
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware.d.ts +20 -0
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware.js +9 -0
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorMiddleware.d.ts +5 -0
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorMiddleware.js +1 -0
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.d.ts +2 -0
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.js +26 -3
- package/lib/model/chartStyleModel/twoDimensionalChartStyleModel.js +5 -1
- package/lib/model/featuresModel/axisModel.js +3 -1
- package/lib/model/featuresModel/valueLabelsModel/valueLabelsModel.d.ts +9 -0
- package/lib/model/featuresModel/valueLabelsModel/valueLabelsModel.js +33 -0
- package/lib/model/helpers/modelHelper.d.ts +1 -0
- package/lib/model/helpers/modelHelper.js +3 -2
- package/lib/model/helpers/twoDimensionalModelHelper.d.ts +8 -0
- package/lib/model/helpers/twoDimensionalModelHelper.js +56 -0
- package/lib/model/model.d.ts +66 -6
- package/lib/model/modelInstance/configReader.d.ts +2 -1
- package/lib/model/modelInstance/configReader.js +17 -0
- package/lib/model/notations/polar/polarModel.js +2 -1
- package/lib/model/notations/twoDimensional/styles.d.ts +3 -1
- package/lib/model/notations/twoDimensional/styles.js +20 -0
- package/lib/model/notations/twoDimensionalModel.js +30 -25
- package/lib/style/charts-main.css +17 -2
- package/lib/style/charts-main.less +17 -2
- package/package.json +2 -2
- package/lib/style/css-vars.css +0 -3
- /package/lib/engine/block/{defs.d.ts → defs/hatchPattern.d.ts} +0 -0
- /package/lib/engine/block/{defs.js → defs/hatchPattern.js} +0 -0
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import { Line as ILine } from 'd3-shape';
|
|
2
2
|
import { MdtChartsDataRow } from '../../../config/config';
|
|
3
|
-
import {
|
|
4
|
-
import { Scales } from "../../features/scale/scale";
|
|
3
|
+
import { TwoDimensionalChartModel } from "../../../model/model";
|
|
5
4
|
import { Pipeline } from '../../helpers/pipeline/Pipeline';
|
|
6
5
|
import { BaseType, Selection } from 'd3-selection';
|
|
7
|
-
import { Segment } from '
|
|
8
|
-
|
|
9
|
-
keyAxisOrient: Orient;
|
|
10
|
-
scales: Scales;
|
|
11
|
-
keyFieldName: string;
|
|
12
|
-
margin: BlockMargin;
|
|
13
|
-
curve: LineCurveType;
|
|
14
|
-
shouldRenderLine: LineLikeChartRenderOptions;
|
|
15
|
-
}
|
|
6
|
+
import { Segment } from '../lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware';
|
|
7
|
+
import { LineLikeGeneratorFactoryOptions } from '../lineLike/generatorFactory/lineLikeGeneratorFactory';
|
|
16
8
|
export declare class LineGeneratorFactory {
|
|
17
9
|
private options;
|
|
18
|
-
constructor(options:
|
|
10
|
+
constructor(options: LineLikeGeneratorFactoryOptions);
|
|
19
11
|
getLineGenerator(valueFieldName: string): ILine<MdtChartsDataRow>;
|
|
20
12
|
getSegmentedLineGenerator(): ILine<MdtChartsDataRow>;
|
|
21
13
|
}
|
|
22
14
|
export declare function onLineChartInit(creatingPipeline: Pipeline<Selection<SVGElement, any, BaseType, any>, TwoDimensionalChartModel>): void;
|
|
23
15
|
export declare function applyLineDash(lineSelection: Selection<SVGElement, any, BaseType, any>, dashSize: number, gapSize: number): Selection<SVGElement, any, BaseType, any>;
|
|
24
16
|
export declare function getStackedData(data: MdtChartsDataRow[], chart: TwoDimensionalChartModel): Segment[][];
|
|
25
|
-
export {};
|
|
@@ -1,35 +1,47 @@
|
|
|
1
1
|
import { stack } from 'd3-shape';
|
|
2
2
|
import { Scale } from "../../features/scale/scale";
|
|
3
3
|
import { LineGenerator } from './lineGenerator';
|
|
4
|
+
import { LineLikeGeneratorCurveMiddleware } from '../lineLike/generatorMiddleware/lineLikeGeneratorCurveMiddleware';
|
|
5
|
+
import { LineLikeGeneratorDefinedMiddleware } from '../lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware';
|
|
4
6
|
export class LineGeneratorFactory {
|
|
5
7
|
constructor(options) {
|
|
6
8
|
this.options = options;
|
|
7
9
|
}
|
|
8
10
|
getLineGenerator(valueFieldName) {
|
|
9
|
-
const { keyAxisOrient, scales, keyFieldName, margin,
|
|
10
|
-
const generator = new LineGenerator({
|
|
11
|
+
const { keyAxisOrient, scales, keyFieldName, margin, shouldRender } = this.options;
|
|
12
|
+
const generator = new LineGenerator({
|
|
13
|
+
middlewares: [
|
|
14
|
+
new LineLikeGeneratorCurveMiddleware({ curve: this.options.curve }),
|
|
15
|
+
new LineLikeGeneratorDefinedMiddleware({ definedFn: shouldRender, valueFieldNameGetter: () => valueFieldName, dataRowGetter: (d) => d })
|
|
16
|
+
]
|
|
17
|
+
});
|
|
11
18
|
if (keyAxisOrient === 'bottom' || keyAxisOrient === 'top') {
|
|
12
|
-
return generator.get(d => Scale.getScaledValue(scales.key, d[keyFieldName]) + margin.left, d => scales.value(d[valueFieldName]) + margin.top)
|
|
19
|
+
return generator.get(d => Scale.getScaledValue(scales.key, d[keyFieldName]) + margin.left, d => scales.value(d[valueFieldName]) + margin.top);
|
|
13
20
|
}
|
|
14
21
|
if (keyAxisOrient === 'left' || keyAxisOrient === 'right') {
|
|
15
|
-
return generator.get(d => scales.value(d[valueFieldName]) + margin.left, d => Scale.getScaledValue(scales.key, d[keyFieldName]) + margin.top)
|
|
22
|
+
return generator.get(d => scales.value(d[valueFieldName]) + margin.left, d => Scale.getScaledValue(scales.key, d[keyFieldName]) + margin.top);
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
getSegmentedLineGenerator() {
|
|
19
|
-
const { keyAxisOrient, scales, keyFieldName, margin,
|
|
20
|
-
const generator = new LineGenerator({
|
|
26
|
+
const { keyAxisOrient, scales, keyFieldName, margin, shouldRender } = this.options;
|
|
27
|
+
const generator = new LineGenerator({
|
|
28
|
+
middlewares: [
|
|
29
|
+
new LineLikeGeneratorCurveMiddleware({ curve: this.options.curve }),
|
|
30
|
+
new LineLikeGeneratorDefinedMiddleware({ definedFn: shouldRender, valueFieldNameGetter: (d) => d.fieldName, dataRowGetter: (d) => d.data })
|
|
31
|
+
]
|
|
32
|
+
});
|
|
21
33
|
if (keyAxisOrient === 'bottom' || keyAxisOrient === 'top') {
|
|
22
|
-
return generator.get(d => Scale.getScaledValue(scales.key, d.data[keyFieldName]) + margin.left, d => scales.value(d[1]) + margin.top)
|
|
34
|
+
return generator.get(d => Scale.getScaledValue(scales.key, d.data[keyFieldName]) + margin.left, d => scales.value(d[1]) + margin.top);
|
|
23
35
|
}
|
|
24
36
|
if (keyAxisOrient === 'left' || keyAxisOrient === 'right') {
|
|
25
|
-
return generator.get(d => scales.value(d[1]) + margin.left, d => Scale.getScaledValue(scales.key, d.data[keyFieldName]) + margin.top)
|
|
37
|
+
return generator.get(d => scales.value(d[1]) + margin.left, d => Scale.getScaledValue(scales.key, d.data[keyFieldName]) + margin.top);
|
|
26
38
|
}
|
|
27
39
|
}
|
|
28
40
|
}
|
|
29
41
|
export function onLineChartInit(creatingPipeline) {
|
|
30
42
|
creatingPipeline.push((path, chart) => {
|
|
31
|
-
if (chart.
|
|
32
|
-
return applyLineDash(path, chart.
|
|
43
|
+
if (chart.lineLikeViewOptions.dashedStyles.on) {
|
|
44
|
+
return applyLineDash(path, chart.lineLikeViewOptions.dashedStyles.dashSize, chart.lineLikeViewOptions.dashedStyles.gapSize);
|
|
33
45
|
}
|
|
34
46
|
return path;
|
|
35
47
|
});
|
package/lib/engine/twoDimensionalNotation/lineLike/generatorFactory/lineLikeGeneratorFactory.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MdtChartsDataRow } from "../../../../config/config";
|
|
2
|
+
import { BlockMargin, LineCurveType, LineLikeChartRenderFn, Orient } from "../../../../model/model";
|
|
3
|
+
import { Scales } from "../../../features/scale/scale";
|
|
4
|
+
export declare type CoordinateGetter = (dataRow: MdtChartsDataRow) => number;
|
|
5
|
+
export interface LineLikeGeneratorFactoryOptions {
|
|
6
|
+
keyAxisOrient: Orient;
|
|
7
|
+
scales: Scales;
|
|
8
|
+
keyFieldName: string;
|
|
9
|
+
margin: BlockMargin;
|
|
10
|
+
curve: LineCurveType;
|
|
11
|
+
shouldRender: LineLikeChartRenderFn;
|
|
12
|
+
}
|
package/lib/engine/twoDimensionalNotation/lineLike/generatorFactory/lineLikeGeneratorFactory.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Area, Line } from "d3-shape";
|
|
2
|
+
import { LineCurveType } from "../../../../model/model";
|
|
3
|
+
import { LineLikeGeneratorMiddleware } from "./lineLikeGeneratorMiddleware";
|
|
4
|
+
import { MdtChartsDataRow } from "../../../../main";
|
|
5
|
+
interface LineLikeGeneratorCurveMiddlewareOptions {
|
|
6
|
+
curve?: LineCurveType;
|
|
7
|
+
}
|
|
8
|
+
export declare class LineLikeGeneratorCurveMiddleware implements LineLikeGeneratorMiddleware {
|
|
9
|
+
private options;
|
|
10
|
+
private readonly curvies;
|
|
11
|
+
constructor(options: LineLikeGeneratorCurveMiddlewareOptions);
|
|
12
|
+
handle(generator: Line<MdtChartsDataRow> | Area<MdtChartsDataRow>): Line<MdtChartsDataRow> | Area<MdtChartsDataRow>;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { curveBasis, curveMonotoneX, curveMonotoneY } from "d3-shape";
|
|
2
|
+
import { LineCurveType } from "../../../../model/model";
|
|
3
|
+
export class LineLikeGeneratorCurveMiddleware {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
this.options = options;
|
|
6
|
+
this.curvies = {
|
|
7
|
+
[LineCurveType.monotoneX]: curveMonotoneX,
|
|
8
|
+
[LineCurveType.monotoneY]: curveMonotoneY,
|
|
9
|
+
[LineCurveType.basis]: curveBasis,
|
|
10
|
+
[LineCurveType.none]: undefined
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
handle(generator) {
|
|
14
|
+
if (this.options.curve != null) {
|
|
15
|
+
const curve = this.curvies[this.options.curve];
|
|
16
|
+
if (curve)
|
|
17
|
+
generator.curve(curve);
|
|
18
|
+
}
|
|
19
|
+
return generator;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Area, Line, SeriesPoint } from "d3-shape";
|
|
2
|
+
import { LineLikeGeneratorMiddleware } from "./lineLikeGeneratorMiddleware";
|
|
3
|
+
import { MdtChartsDataRow } from "../../../../config/config";
|
|
4
|
+
import { LineLikeChartRenderFn } from "../../../../model/model";
|
|
5
|
+
import { SegmentWithFieldName } from "../../bar/stackedData/dataStacker";
|
|
6
|
+
interface LineLikeGeneratorDefinedMiddlewareOptions {
|
|
7
|
+
definedFn: LineLikeChartRenderFn;
|
|
8
|
+
valueFieldNameGetter: (d: MdtChartsDataRow | Segment) => string;
|
|
9
|
+
dataRowGetter: (d: MdtChartsDataRow | Segment) => MdtChartsDataRow;
|
|
10
|
+
}
|
|
11
|
+
export interface Segment extends SeriesPoint<{
|
|
12
|
+
[p: string]: number;
|
|
13
|
+
}>, SegmentWithFieldName {
|
|
14
|
+
}
|
|
15
|
+
export declare class LineLikeGeneratorDefinedMiddleware implements LineLikeGeneratorMiddleware {
|
|
16
|
+
private readonly options;
|
|
17
|
+
constructor(options: LineLikeGeneratorDefinedMiddlewareOptions);
|
|
18
|
+
handle(generator: Line<MdtChartsDataRow> | Area<MdtChartsDataRow>): Line<MdtChartsDataRow> | Area<MdtChartsDataRow>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class LineLikeGeneratorDefinedMiddleware {
|
|
2
|
+
constructor(options) {
|
|
3
|
+
this.options = options;
|
|
4
|
+
}
|
|
5
|
+
handle(generator) {
|
|
6
|
+
generator.defined(d => this.options.definedFn(this.options.dataRowGetter(d), this.options.valueFieldNameGetter(d)));
|
|
7
|
+
return generator;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Line as ILine, Area as IArea } from "d3-shape";
|
|
2
|
+
import { MdtChartsDataRow } from "../../../../config/config";
|
|
3
|
+
export interface LineLikeGeneratorMiddleware {
|
|
4
|
+
handle(generator: ILine<MdtChartsDataRow> | IArea<MdtChartsDataRow>): ILine<MdtChartsDataRow> | IArea<MdtChartsDataRow>;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,6 +4,8 @@ import { Block } from "../block/block";
|
|
|
4
4
|
import { ChartContentManager } from "../contentManager/contentManagerFactory";
|
|
5
5
|
import { Engine } from "../engine";
|
|
6
6
|
export declare class TwoDimensionalManager implements ChartContentManager {
|
|
7
|
+
private canvasValueLabels?;
|
|
8
|
+
private linearGradientDef?;
|
|
7
9
|
render(engine: Engine, model: Model<TwoDimensionalOptionsModel>): void;
|
|
8
10
|
updateData(block: Block, model: Model<TwoDimensionalOptionsModel>, data: MdtChartsDataSource): void;
|
|
9
11
|
updateColors(block: Block, model: Model<TwoDimensionalOptionsModel>): void;
|
|
@@ -13,6 +13,8 @@ import { Bar } from "./bar/bar";
|
|
|
13
13
|
import { BarHelper } from "./bar/barHelper";
|
|
14
14
|
import { TwoDimRecordOverflowAlert } from "./extenders/twoDimRecordOverflowAlert";
|
|
15
15
|
import { Line } from "./line/line";
|
|
16
|
+
import { CanvasValueLabels } from "../../engine/features/valueLabels/valueLabels";
|
|
17
|
+
import { LinearGradientDef } from "../../engine/block/defs/LinearGradientDef";
|
|
16
18
|
export class TwoDimensionalManager {
|
|
17
19
|
render(engine, model) {
|
|
18
20
|
const options = model.options;
|
|
@@ -38,6 +40,23 @@ export class TwoDimensionalManager {
|
|
|
38
40
|
if (e.target === engine.block.getSvg().node())
|
|
39
41
|
engine.block.filterEventManager.clearKeysFor2D(options);
|
|
40
42
|
});
|
|
43
|
+
this.canvasValueLabels = new CanvasValueLabels({
|
|
44
|
+
elementAccessors: {
|
|
45
|
+
getBlock: () => engine.block,
|
|
46
|
+
},
|
|
47
|
+
data: {
|
|
48
|
+
keyFieldName: options.data.keyField.name
|
|
49
|
+
},
|
|
50
|
+
canvas: {
|
|
51
|
+
keyAxisOrient: options.axis.key.orient,
|
|
52
|
+
valueLabels: options.valueLabels,
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
this.canvasValueLabels.render(scales, options.charts, engine.data, options.data);
|
|
56
|
+
if (options.defs) {
|
|
57
|
+
this.linearGradientDef = new LinearGradientDef();
|
|
58
|
+
this.linearGradientDef.render(engine.block.svg.ensureDefsRendered(), options.defs.gradients);
|
|
59
|
+
}
|
|
41
60
|
}
|
|
42
61
|
updateData(block, model, data) {
|
|
43
62
|
block.transitionManager.interruptTransitions();
|
|
@@ -63,16 +82,20 @@ export class TwoDimensionalManager {
|
|
|
63
82
|
hidedRecordsAmount: model.dataSettings.scope.hidedRecordsAmount,
|
|
64
83
|
chartOrientation: options.orient
|
|
65
84
|
});
|
|
85
|
+
if (this.canvasValueLabels)
|
|
86
|
+
this.canvasValueLabels.update(scales, options.charts, data, model.options.data);
|
|
66
87
|
}
|
|
67
88
|
updateColors(block, model) {
|
|
89
|
+
var _a;
|
|
68
90
|
Legend.get().updateColors(block, model.options);
|
|
91
|
+
(_a = this.linearGradientDef) === null || _a === void 0 ? void 0 : _a.updateColors(block.svg.ensureDefsRendered(), model.options.defs.gradients);
|
|
69
92
|
model.options.charts.forEach(chart => {
|
|
70
93
|
if (chart.type === 'bar')
|
|
71
94
|
Bar.get().updateColors(block, chart);
|
|
72
95
|
else if (chart.type === 'line')
|
|
73
96
|
Line.get({ staticSettings: model.options.chartSettings.lineLike }).updateColors(block, chart);
|
|
74
97
|
else if (chart.type === 'area')
|
|
75
|
-
Area.updateColors(block, chart);
|
|
98
|
+
Area.get({ staticSettings: model.options.chartSettings.lineLike }).updateColors(block, chart);
|
|
76
99
|
});
|
|
77
100
|
}
|
|
78
101
|
renderCharts(block, charts, scales, data, dataOptions, margin, keyAxisOrient, chartSettings, blockSize) {
|
|
@@ -86,7 +109,7 @@ export class TwoDimensionalManager {
|
|
|
86
109
|
else if (chart.type === 'line')
|
|
87
110
|
Line.get({ staticSettings: chartSettings.lineLike }).render(block, chartScales, data[dataOptions.dataSource], dataOptions.keyField, margin, keyAxisOrient, chart);
|
|
88
111
|
else if (chart.type === 'area')
|
|
89
|
-
Area.render(block, chartScales, data[dataOptions.dataSource], dataOptions.keyField, margin, keyAxisOrient, chart, blockSize);
|
|
112
|
+
Area.get({ staticSettings: chartSettings.lineLike }).render(block, chartScales, data[dataOptions.dataSource], dataOptions.keyField, margin, keyAxisOrient, chart, blockSize);
|
|
90
113
|
});
|
|
91
114
|
EmbeddedLabels.raiseGroups(block);
|
|
92
115
|
}
|
|
@@ -103,7 +126,7 @@ export class TwoDimensionalManager {
|
|
|
103
126
|
proms = Line.get({ staticSettings: chartSettings.lineLike }).update(block, chartScales, data[dataOptions.dataSource], dataOptions.keyField, margin, keyAxisOrient, chart);
|
|
104
127
|
}
|
|
105
128
|
else if (chart.type === 'area') {
|
|
106
|
-
proms = Area.update(block, chartScales, data[dataOptions.dataSource], dataOptions.keyField, margin, chart, keyAxisOrient, blockSize);
|
|
129
|
+
proms = Area.get({ staticSettings: chartSettings.lineLike }).update(block, chartScales, data[dataOptions.dataSource], dataOptions.keyField, margin, chart, keyAxisOrient, blockSize);
|
|
107
130
|
}
|
|
108
131
|
promises.push(...proms);
|
|
109
132
|
});
|
|
@@ -8,10 +8,14 @@ export class TwoDimensionalChartStyleModel {
|
|
|
8
8
|
this.service = new TwoDimensionalChartStyleService();
|
|
9
9
|
}
|
|
10
10
|
getChartStyle(chart, chartIndex) {
|
|
11
|
+
var _a, _b;
|
|
11
12
|
const fieldsAmounts = this.getChartsValueFieldsAmounts();
|
|
13
|
+
const opacity = chart.type === 'area' && ((_b = (_a = chart.areaStyles) === null || _a === void 0 ? void 0 : _a.gradient) === null || _b === void 0 ? void 0 : _b.on)
|
|
14
|
+
? 1
|
|
15
|
+
: this.service.getChartOpacity(this.charts.length, chart.type, fieldsAmounts[chartIndex], chart.isSegmented);
|
|
12
16
|
return {
|
|
13
17
|
elementColors: this.service.getChartColors(chart, this.chartStyleConfig, fieldsAmounts, chartIndex),
|
|
14
|
-
opacity
|
|
18
|
+
opacity,
|
|
15
19
|
};
|
|
16
20
|
}
|
|
17
21
|
getChartsValueFieldsAmounts() {
|
|
@@ -19,7 +19,7 @@ export class AxisModel {
|
|
|
19
19
|
cssClass: 'key-axis',
|
|
20
20
|
ticks: axisConfig.ticks,
|
|
21
21
|
labels: {
|
|
22
|
-
maxSize: AxisModel.
|
|
22
|
+
maxSize: AxisModel.getLabelSize(labelConfig.maxSize.main, data[dataOptions.dataSource].map(d => d[dataOptions.keyField.name])).width,
|
|
23
23
|
position: AxisModel.getKeyAxisLabelPosition(canvasModel, DataManagerModel.getDataValuesByKeyField(data, dataOptions.dataSource, dataOptions.keyField.name).length, axisConfig),
|
|
24
24
|
visible: !TwoDimensionalModel.getChartsEmbeddedLabelsFlag(charts, orientation),
|
|
25
25
|
defaultTooltip: tooltipSettings.position === 'fixed',
|
|
@@ -137,6 +137,8 @@ export class AxisModel {
|
|
|
137
137
|
const sign = Math.sign(value);
|
|
138
138
|
if (absValue < 10)
|
|
139
139
|
return value;
|
|
140
|
+
if (absValue < 100)
|
|
141
|
+
return sign * Math.floor(absValue / 10) * 10;
|
|
140
142
|
const valueStr = absValue.toString();
|
|
141
143
|
const firstTwoDigits = Math.floor(absValue / Math.pow(10, valueStr.length - 2));
|
|
142
144
|
const roundedFirstTwoDigits = firstTwoDigits < 10 ? firstTwoDigits : Math.floor(firstTwoDigits / 5) * 5;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BlockMargin, Orient, ValueLabelAnchor, ValueLabelDominantBaseline } from "../../model";
|
|
2
|
+
interface ValueLabelAlignment {
|
|
3
|
+
dominantBaseline: ValueLabelDominantBaseline;
|
|
4
|
+
textAnchor: ValueLabelAnchor;
|
|
5
|
+
}
|
|
6
|
+
export declare function getValueLabelY(scaledValue: number, keyAxisOrient: Orient, margin: BlockMargin): number;
|
|
7
|
+
export declare function getValueLabelX(scaledValue: number, keyAxisOrient: Orient, margin: BlockMargin): number;
|
|
8
|
+
export declare function calculateValueLabelAlignment(keyAxisOrient: Orient): ValueLabelAlignment;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const OFFSET_SIZE_PX = 10;
|
|
2
|
+
export function getValueLabelY(scaledValue, keyAxisOrient, margin) {
|
|
3
|
+
switch (keyAxisOrient) {
|
|
4
|
+
case 'bottom':
|
|
5
|
+
return scaledValue - OFFSET_SIZE_PX + margin.top;
|
|
6
|
+
case 'top':
|
|
7
|
+
return scaledValue + OFFSET_SIZE_PX + margin.top;
|
|
8
|
+
default:
|
|
9
|
+
return scaledValue + margin.top;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function getValueLabelX(scaledValue, keyAxisOrient, margin) {
|
|
13
|
+
switch (keyAxisOrient) {
|
|
14
|
+
case 'right':
|
|
15
|
+
return scaledValue - OFFSET_SIZE_PX + margin.left;
|
|
16
|
+
case 'left':
|
|
17
|
+
return scaledValue + OFFSET_SIZE_PX + margin.left;
|
|
18
|
+
default:
|
|
19
|
+
return scaledValue + margin.left;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function calculateValueLabelAlignment(keyAxisOrient) {
|
|
23
|
+
switch (keyAxisOrient) {
|
|
24
|
+
case 'top':
|
|
25
|
+
return { dominantBaseline: "hanging", textAnchor: "middle" };
|
|
26
|
+
case "bottom":
|
|
27
|
+
return { dominantBaseline: "auto", textAnchor: "middle" };
|
|
28
|
+
case "left":
|
|
29
|
+
return { dominantBaseline: "middle", textAnchor: "start" };
|
|
30
|
+
case "right":
|
|
31
|
+
return { dominantBaseline: "middle", textAnchor: "end" };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -3,7 +3,7 @@ export class ModelHelper {
|
|
|
3
3
|
static getBaseFontSize() {
|
|
4
4
|
if (!this.baseFontSize)
|
|
5
5
|
this.baseFontSize = parseInt(DomHelper.getCssPropertyValue(document.documentElement, '--chart-base-font-size'));
|
|
6
|
-
return this.baseFontSize;
|
|
6
|
+
return (!this.baseFontSize || isNaN(this.baseFontSize)) ? this.defaultBaseFontSize : this.baseFontSize;
|
|
7
7
|
}
|
|
8
8
|
static getSum(items) {
|
|
9
9
|
return items.reduce((acc, item) => acc + item, 0);
|
|
@@ -17,7 +17,7 @@ export class ModelHelper {
|
|
|
17
17
|
// Number width == lower case letter width
|
|
18
18
|
const fontSize = this.getBaseFontSize();
|
|
19
19
|
let score = 0;
|
|
20
|
-
const upperLetterScore = fontSize /
|
|
20
|
+
const upperLetterScore = fontSize / 10;
|
|
21
21
|
const lowerLetterScore = fontSize / 15;
|
|
22
22
|
const digitScore = fontSize / 15;
|
|
23
23
|
const otherSymbolScore = fontSize / 23;
|
|
@@ -37,3 +37,4 @@ export class ModelHelper {
|
|
|
37
37
|
return score;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
ModelHelper.defaultBaseFontSize = 13;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChartOrientation, MdtChartsDataRow, MdtChartsTwoDimensionalChart } from "../../config/config";
|
|
2
|
+
import { GradientDef, MarkDotDatumItem, Orient, TwoDimensionalChartModel } from "../model";
|
|
3
|
+
export declare class TwoDimensionalModelHelper {
|
|
4
|
+
static shouldMarkerShow(chart: MdtChartsTwoDimensionalChart, dataRows: MdtChartsDataRow[], valueFieldName: string, currentRow: MarkDotDatumItem, keyFieldName: string): boolean;
|
|
5
|
+
static getGradientDefs(charts: TwoDimensionalChartModel[], keyAxisOrient: Orient, chartOrient: ChartOrientation): GradientDef[];
|
|
6
|
+
private static getGradientItems;
|
|
7
|
+
private static calculateOpacityItem;
|
|
8
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { getGradientId } from "../../model/notations/twoDimensional/styles";
|
|
2
|
+
export class TwoDimensionalModelHelper {
|
|
3
|
+
static shouldMarkerShow(chart, dataRows, valueFieldName, currentRow, keyFieldName) {
|
|
4
|
+
if (chart.markers.show || dataRows.length === 1)
|
|
5
|
+
return true;
|
|
6
|
+
const rowIndex = dataRows.findIndex(row => row[keyFieldName] === currentRow[keyFieldName]);
|
|
7
|
+
if (rowIndex === -1)
|
|
8
|
+
return false;
|
|
9
|
+
const isFirst = rowIndex === 0;
|
|
10
|
+
const isLast = rowIndex === dataRows.length - 1;
|
|
11
|
+
const previousRow = dataRows[rowIndex - 1];
|
|
12
|
+
const nextRow = dataRows[rowIndex + 1];
|
|
13
|
+
const hasNullNeighborsRows = !isFirst && !isLast &&
|
|
14
|
+
(previousRow === null || previousRow === void 0 ? void 0 : previousRow[valueFieldName]) === null && (nextRow === null || nextRow === void 0 ? void 0 : nextRow[valueFieldName]) === null;
|
|
15
|
+
return (isFirst && (nextRow === null || nextRow === void 0 ? void 0 : nextRow[valueFieldName]) === null) || (isLast && (previousRow === null || previousRow === void 0 ? void 0 : previousRow[valueFieldName]) === null) || hasNullNeighborsRows;
|
|
16
|
+
}
|
|
17
|
+
static getGradientDefs(charts, keyAxisOrient, chartOrient) {
|
|
18
|
+
let gradients = [];
|
|
19
|
+
charts.forEach((chart) => {
|
|
20
|
+
var _a;
|
|
21
|
+
if (chart.type === 'area' && chart.areaViewOptions.fill.type === 'gradient') {
|
|
22
|
+
(_a = chart.style.elementColors) === null || _a === void 0 ? void 0 : _a.forEach((elementColor, subIndex) => {
|
|
23
|
+
const gradientId = getGradientId(chart.index, subIndex);
|
|
24
|
+
gradients.push({
|
|
25
|
+
id: gradientId,
|
|
26
|
+
position: {
|
|
27
|
+
x1: 0,
|
|
28
|
+
y1: 0,
|
|
29
|
+
x2: chartOrient === 'horizontal' ? 1 : 0,
|
|
30
|
+
y2: chartOrient === 'horizontal' ? 0 : 1,
|
|
31
|
+
},
|
|
32
|
+
items: this.getGradientItems(gradientId, elementColor, keyAxisOrient),
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return gradients;
|
|
38
|
+
}
|
|
39
|
+
static getGradientItems(gradientId, elementColor, keyAxisOrient) {
|
|
40
|
+
return [0, 1].map(indexItem => ({
|
|
41
|
+
id: gradientId + `-item-${indexItem}`,
|
|
42
|
+
color: elementColor,
|
|
43
|
+
offset: indexItem,
|
|
44
|
+
opacity: this.calculateOpacityItem(indexItem, keyAxisOrient)
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
static calculateOpacityItem(indexItem, orientation) {
|
|
48
|
+
const maxOpacity = 0.3;
|
|
49
|
+
const minOpacity = 0;
|
|
50
|
+
if (orientation === 'bottom' || orientation === 'right')
|
|
51
|
+
return indexItem === 0 ? maxOpacity : minOpacity;
|
|
52
|
+
else
|
|
53
|
+
return indexItem === 0 ? minOpacity : maxOpacity;
|
|
54
|
+
}
|
|
55
|
+
;
|
|
56
|
+
}
|
package/lib/model/model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartOrientation, MdtChartsColorField, IntervalChartType, PolarChartType, Size, TooltipOptions, TwoDimensionalChartType, AxisLabelPosition, ShowTickFn, MdtChartsDataRow, TwoDimensionalValueGroup } from "../config/config";
|
|
1
|
+
import { ChartOrientation, MdtChartsColorField, IntervalChartType, PolarChartType, Size, TooltipOptions, TwoDimensionalChartType, AxisLabelPosition, ShowTickFn, MdtChartsDataRow, TwoDimensionalValueGroup, ValueLabelsCollision } from "../config/config";
|
|
2
2
|
import { DataType, DonutOptionsCanvas, Formatter, StaticLegendBlockCanvas, TooltipSettings, Transitions } from "../designer/designerConfig";
|
|
3
3
|
declare type AxisType = "key" | "value";
|
|
4
4
|
export declare type Orient = "top" | "bottom" | "left" | "right";
|
|
@@ -10,6 +10,9 @@ export declare type DataOptions = {
|
|
|
10
10
|
[option: string]: any;
|
|
11
11
|
};
|
|
12
12
|
export declare type UnitsFromConfig = "%" | "px";
|
|
13
|
+
export declare type ValueLabelAnchor = "start" | "middle" | "end";
|
|
14
|
+
export declare type ValueLabelDominantBaseline = "hanging" | "middle" | "auto";
|
|
15
|
+
export declare type GradientId = string;
|
|
13
16
|
export declare type OptionsModel = TwoDimensionalOptionsModel | PolarOptionsModel | IntervalOptionsModel;
|
|
14
17
|
export interface Model<O = OptionsModel> {
|
|
15
18
|
blockCanvas: BlockCanvas;
|
|
@@ -40,6 +43,7 @@ interface GraphicNotationOptionsModel extends BasicOptionsModel {
|
|
|
40
43
|
data: OptionsModelData;
|
|
41
44
|
title: string;
|
|
42
45
|
selectable: boolean;
|
|
46
|
+
defs: OptionsModelGradients;
|
|
43
47
|
}
|
|
44
48
|
export interface TwoDimensionalOptionsModel extends GraphicNotationOptionsModel {
|
|
45
49
|
type: "2d";
|
|
@@ -49,6 +53,7 @@ export interface TwoDimensionalOptionsModel extends GraphicNotationOptionsModel
|
|
|
49
53
|
additionalElements: AdditionalElementsOptions;
|
|
50
54
|
orient: ChartOrientation;
|
|
51
55
|
chartSettings: TwoDimChartElementsSettings;
|
|
56
|
+
valueLabels: TwoDimensionalValueLabels;
|
|
52
57
|
}
|
|
53
58
|
export interface PolarOptionsModel extends GraphicNotationOptionsModel {
|
|
54
59
|
type: "polar";
|
|
@@ -77,6 +82,24 @@ export interface Field {
|
|
|
77
82
|
name: string;
|
|
78
83
|
format: DataType;
|
|
79
84
|
}
|
|
85
|
+
export interface OptionsModelGradients {
|
|
86
|
+
gradients: GradientDef[];
|
|
87
|
+
}
|
|
88
|
+
export interface GradientDef {
|
|
89
|
+
id: GradientId;
|
|
90
|
+
position: {
|
|
91
|
+
x1: number;
|
|
92
|
+
x2: number;
|
|
93
|
+
y1: number;
|
|
94
|
+
y2: number;
|
|
95
|
+
};
|
|
96
|
+
items: {
|
|
97
|
+
id: string;
|
|
98
|
+
color: string;
|
|
99
|
+
offset: number;
|
|
100
|
+
opacity: number;
|
|
101
|
+
}[];
|
|
102
|
+
}
|
|
80
103
|
export interface IScaleModel {
|
|
81
104
|
key: ScaleKeyModel;
|
|
82
105
|
value: ScaleValueModel;
|
|
@@ -171,6 +194,9 @@ interface LineLikeChartCurveOptions {
|
|
|
171
194
|
interface BarLikeChartHatchOptions {
|
|
172
195
|
on: boolean;
|
|
173
196
|
}
|
|
197
|
+
export interface TwoDimensionalValueLabels {
|
|
198
|
+
collision: ValueLabelsCollision;
|
|
199
|
+
}
|
|
174
200
|
export interface DonutChartSettings extends Omit<DonutOptionsCanvas, "aggregatorPad" | "thickness"> {
|
|
175
201
|
aggregator: DonutAggregatorModel;
|
|
176
202
|
thickness: DonutThicknessOptions;
|
|
@@ -215,27 +241,45 @@ export interface TwoDimensionalChartLegendLineModel extends Omit<TwoDimensionalL
|
|
|
215
241
|
width: number;
|
|
216
242
|
}
|
|
217
243
|
interface TwoDimensionalLineLikeChartModel {
|
|
218
|
-
|
|
244
|
+
lineLikeViewOptions: TwoDimensionalLineLikeChartViewModel;
|
|
219
245
|
markersOptions: MarkersOptions;
|
|
220
246
|
}
|
|
221
247
|
interface TwoDimensionalLineLikeChartViewModel {
|
|
222
248
|
dashedStyles: LineLikeChartDashOptions;
|
|
223
|
-
renderForKey:
|
|
249
|
+
renderForKey: LineLikeChartRenderFn;
|
|
224
250
|
}
|
|
225
|
-
export declare type
|
|
251
|
+
export declare type LineLikeChartRenderFn = (dataRow: MdtChartsDataRow, valueFieldName: string) => boolean;
|
|
226
252
|
interface TwoDimensionalBarLikeChartModel {
|
|
227
253
|
barViewOptions: TwoDimensionalBarLikeChartViewModel;
|
|
228
254
|
}
|
|
229
255
|
interface TwoDimensionalBarLikeChartViewModel {
|
|
230
256
|
hatch: BarLikeChartHatchOptions;
|
|
231
257
|
}
|
|
232
|
-
|
|
258
|
+
interface TwoDimensionalAreaChartModel {
|
|
259
|
+
areaViewOptions: AreaChartViewOptions;
|
|
260
|
+
}
|
|
261
|
+
export interface AreaChartViewOptions {
|
|
262
|
+
fill: AreaViewFill;
|
|
263
|
+
borderLine: AreaViewBorderLine;
|
|
264
|
+
}
|
|
265
|
+
export declare type AreaViewFill = {
|
|
266
|
+
type: "paletteColor";
|
|
267
|
+
} | {
|
|
268
|
+
type: "gradient";
|
|
269
|
+
ids: GradientId[];
|
|
270
|
+
};
|
|
271
|
+
export interface AreaViewBorderLine {
|
|
272
|
+
on: boolean;
|
|
273
|
+
colorStyle: ChartStyle;
|
|
274
|
+
}
|
|
275
|
+
export interface TwoDimensionalChartModel extends ChartModel, TwoDimensionalLineLikeChartModel, TwoDimensionalBarLikeChartModel, TwoDimensionalAreaChartModel {
|
|
233
276
|
type: TwoDimensionalChartType;
|
|
234
277
|
data: TwoDimensionalChartDataModel;
|
|
235
278
|
index: number;
|
|
236
279
|
embeddedLabels: EmbeddedLabelTypeModel;
|
|
237
280
|
isSegmented: boolean;
|
|
238
281
|
legend: ChartLegendModel;
|
|
282
|
+
valueLabels?: TwoDimChartValueLabelsOptions;
|
|
239
283
|
}
|
|
240
284
|
export interface IntervalChartModel extends Omit<ChartModel, "legend"> {
|
|
241
285
|
type: IntervalChartType;
|
|
@@ -253,10 +297,26 @@ export interface TwoDimensionalChartDataModel {
|
|
|
253
297
|
export interface ValueField extends Field {
|
|
254
298
|
title: string;
|
|
255
299
|
}
|
|
256
|
-
export interface
|
|
300
|
+
export interface TwoDimChartValueLabelsOptions {
|
|
257
301
|
show: boolean;
|
|
302
|
+
handleX: (scaledValue: number) => number;
|
|
303
|
+
handleY: (scaledValue: number) => number;
|
|
304
|
+
textAnchor: ValueLabelAnchor;
|
|
305
|
+
dominantBaseline: ValueLabelDominantBaseline;
|
|
306
|
+
format: ValueLabelsFormatter;
|
|
307
|
+
}
|
|
308
|
+
export declare type ValueLabelsFormatter = (value: number) => string;
|
|
309
|
+
export interface MarkersOptions {
|
|
310
|
+
show: MarkersOptionsShow;
|
|
258
311
|
styles: MarkersStyleOptions;
|
|
259
312
|
}
|
|
313
|
+
export declare type MarkDotDatumItem = MdtChartsDataRow | {
|
|
314
|
+
"1": any;
|
|
315
|
+
} & Array<number>;
|
|
316
|
+
export declare type MarkersOptionsShow = (options: {
|
|
317
|
+
row: MarkDotDatumItem;
|
|
318
|
+
valueFieldName: string;
|
|
319
|
+
}) => boolean;
|
|
260
320
|
export interface MarkersStyleOptions {
|
|
261
321
|
highlighted: MarkerStyle;
|
|
262
322
|
normal: MarkerStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxisLabelFormatter, MdtChartsConfig, MdtChartsField, MdtChartsFieldName, MdtChartsTwoDimensionalOptions, TwoDimensionalChartType, TwoDimensionalValueGroup } from "../../config/config";
|
|
1
|
+
import { AxisLabelFormatter, MdtChartsConfig, MdtChartsField, MdtChartsFieldName, MdtChartsTwoDimensionalOptions, TwoDimensionalChartType, TwoDimensionalValueGroup, ValueLabelsFormatter } from "../../config/config";
|
|
2
2
|
import { DesignerConfig } from "../../designer/designerConfig";
|
|
3
3
|
import { DataRepositoryModel } from "../../model/modelInstance/dataModel/dataRepository";
|
|
4
4
|
interface BaseConfigReader {
|
|
@@ -20,6 +20,7 @@ export declare class TwoDimConfigReader implements BaseConfigReader {
|
|
|
20
20
|
chartType: TwoDimensionalChartType;
|
|
21
21
|
}[];
|
|
22
22
|
containsSecondaryAxis(): boolean;
|
|
23
|
+
getValueLabelFormatterForChart(chartIndex: number): ValueLabelsFormatter;
|
|
23
24
|
private calculateBiggestValueAndDecremented;
|
|
24
25
|
private calculateAxisLabelFormatter;
|
|
25
26
|
}
|
|
@@ -54,6 +54,23 @@ export class TwoDimConfigReader {
|
|
|
54
54
|
containsSecondaryAxis() {
|
|
55
55
|
return !!this.options.axis.valueSecondary && this.options.charts.some(chart => chart.data.valueGroup === 'secondary');
|
|
56
56
|
}
|
|
57
|
+
getValueLabelFormatterForChart(chartIndex) {
|
|
58
|
+
var _a, _b, _c;
|
|
59
|
+
const chart = this.options.charts[chartIndex];
|
|
60
|
+
const axis = this.options.axis;
|
|
61
|
+
if (chart.valueLabels.format)
|
|
62
|
+
return chart.valueLabels.format;
|
|
63
|
+
if (chart.data.valueGroup === "secondary") {
|
|
64
|
+
if ((_a = axis.valueSecondary.labels) === null || _a === void 0 ? void 0 : _a.format)
|
|
65
|
+
return axis.valueSecondary.labels.format;
|
|
66
|
+
else if ((_b = axis.value.labels) === null || _b === void 0 ? void 0 : _b.format)
|
|
67
|
+
return axis.value.labels.format;
|
|
68
|
+
}
|
|
69
|
+
else if ((_c = axis.value.labels) === null || _c === void 0 ? void 0 : _c.format)
|
|
70
|
+
return axis.value.labels.format;
|
|
71
|
+
const valueFieldFormat = chart.data.valueFields[0].format;
|
|
72
|
+
return (v) => this.designerConfig.dataFormat.formatters(v, { type: valueFieldFormat });
|
|
73
|
+
}
|
|
57
74
|
calculateBiggestValueAndDecremented(repository, domain, fields) {
|
|
58
75
|
const resolvedDomain = getResolvedDomain(domain, repository.getRawRows());
|
|
59
76
|
if (resolvedDomain && resolvedDomain.end !== -1) {
|
|
@@ -14,7 +14,8 @@ export class PolarModel {
|
|
|
14
14
|
charts: this.getChartsModel(options.chart, modelInstance.dataModel.repository.getScopedRows().length, designerConfig.chartStyle),
|
|
15
15
|
legend: modelInstance.canvasModel.legendCanvas.getModel(),
|
|
16
16
|
tooltip: options.tooltip,
|
|
17
|
-
chartCanvas: this.getDonutSettings(designerConfig.canvas.chartOptions.donut, options.chart, modelInstance.dataModel.repository.getRawRows())
|
|
17
|
+
chartCanvas: this.getDonutSettings(designerConfig.canvas.chartOptions.donut, options.chart, modelInstance.dataModel.repository.getRawRows()),
|
|
18
|
+
defs: { gradients: [] },
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
//TODO: type for returned value
|