mdt-charts 1.29.0 → 1.29.1
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 +167 -177
- package/lib/designer/designerConfig.d.ts +59 -62
- package/lib/engine/block/block.d.ts +16 -22
- package/lib/engine/block/block.js +51 -51
- package/lib/engine/block/blockHelper.d.ts +6 -6
- package/lib/engine/block/blockHelper.js +16 -16
- package/lib/engine/block/blockHtml.d.ts +8 -8
- package/lib/engine/block/blockHtml.js +15 -15
- package/lib/engine/block/blockSvg.d.ts +20 -20
- package/lib/engine/block/blockSvg.js +66 -65
- package/lib/engine/block/defs/LinearGradientDef.d.ts +2 -2
- package/lib/engine/block/defs/LinearGradientDef.js +27 -27
- package/lib/engine/block/defs/hatchPattern.d.ts +4 -4
- package/lib/engine/block/defs/hatchPattern.js +9 -9
- package/lib/engine/colorReader/colorReader.d.ts +5 -5
- package/lib/engine/colorReader/colorReader.js +18 -18
- package/lib/engine/contentManager/contentManager.d.ts +7 -6
- package/lib/engine/contentManager/contentManager.js +15 -15
- package/lib/engine/contentManager/contentManagerFactory.d.ts +7 -7
- package/lib/engine/contentManager/contentManagerFactory.js +12 -12
- package/lib/engine/elementHighlighter/elementHighlighter.d.ts +22 -70
- package/lib/engine/elementHighlighter/elementHighlighter.js +181 -230
- package/lib/engine/elementHighlighter/selectHighlighter.d.ts +4 -29
- package/lib/engine/elementHighlighter/selectHighlighter.js +87 -189
- package/lib/engine/engine.d.ts +17 -17
- package/lib/engine/engine.js +62 -87
- package/lib/engine/features/aggregator/aggregator.d.ts +17 -24
- package/lib/engine/features/aggregator/aggregator.js +102 -113
- package/lib/engine/features/axis/axis.d.ts +9 -22
- package/lib/engine/features/axis/axis.js +150 -159
- package/lib/engine/features/axis/axisDomHelper.d.ts +2 -7
- package/lib/engine/features/axis/axisDomHelper.js +20 -19
- package/lib/engine/features/axis/axisHelper.d.ts +5 -9
- package/lib/engine/features/axis/axisHelper.js +33 -28
- package/lib/engine/features/axis/axisLabelDomHelper.d.ts +11 -26
- package/lib/engine/features/axis/axisLabelDomHelper.js +152 -156
- package/lib/engine/features/axis/axisLabelsEventManager.d.ts +2 -2
- package/lib/engine/features/axis/axisLabelsEventManager.js +32 -32
- package/lib/engine/features/embeddedLabels/embeddedLabels.d.ts +16 -51
- package/lib/engine/features/embeddedLabels/embeddedLabels.js +134 -234
- package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.d.ts +2 -13
- package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.js +23 -20
- package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.d.ts +15 -32
- package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.js +63 -56
- package/lib/engine/features/gridLine/gidLineHelper.d.ts +7 -13
- package/lib/engine/features/gridLine/gidLineHelper.js +49 -42
- package/lib/engine/features/gridLine/gridLine.d.ts +5 -19
- package/lib/engine/features/gridLine/gridLine.js +36 -35
- package/lib/engine/features/legend/legend.d.ts +28 -38
- package/lib/engine/features/legend/legend.js +92 -118
- package/lib/engine/features/legend/legendDomHelper.d.ts +6 -13
- package/lib/engine/features/legend/legendDomHelper.js +62 -63
- package/lib/engine/features/legend/legendEventsManager.d.ts +8 -13
- package/lib/engine/features/legend/legendEventsManager.js +47 -48
- package/lib/engine/features/legend/legendHelper.d.ts +14 -39
- package/lib/engine/features/legend/legendHelper.js +92 -98
- package/lib/engine/features/legend/legendHelperService.d.ts +6 -13
- package/lib/engine/features/legend/legendHelperService.js +25 -24
- package/lib/engine/features/legend/legendMarkerCreator.d.ts +9 -18
- package/lib/engine/features/legend/legendMarkerCreator.js +76 -79
- package/lib/engine/features/legend/legendWidthCalculator.d.ts +7 -7
- package/lib/engine/features/legend/legendWidthCalculator.js +122 -126
- package/lib/engine/features/markDots/markDot.d.ts +15 -42
- package/lib/engine/features/markDots/markDot.js +70 -101
- package/lib/engine/features/markDots/markDotsHelper.d.ts +1 -8
- package/lib/engine/features/markDots/markDotsHelper.js +12 -13
- package/lib/engine/features/recordOverflowAlert/recordOverflowAlertCore.d.ts +5 -23
- package/lib/engine/features/recordOverflowAlert/recordOverflowAlertCore.js +34 -42
- package/lib/engine/features/scale/scale.d.ts +12 -17
- package/lib/engine/features/scale/scale.js +69 -76
- package/lib/engine/features/tipBox/tipBox.d.ts +5 -9
- package/lib/engine/features/tipBox/tipBox.js +24 -24
- package/lib/engine/features/tipBox/tipBoxHelper.d.ts +9 -16
- package/lib/engine/features/tipBox/tipBoxHelper.js +45 -60
- package/lib/engine/features/title/title.d.ts +6 -6
- package/lib/engine/features/title/title.js +35 -34
- package/lib/engine/features/tolltip/newTooltip/newTooltip.d.ts +11 -15
- package/lib/engine/features/tolltip/newTooltip/newTooltip.js +21 -21
- package/lib/engine/features/tolltip/newTooltip/newTooltipService.d.ts +8 -13
- package/lib/engine/features/tolltip/newTooltip/newTooltipService.js +23 -26
- package/lib/engine/features/tolltip/tooltip.d.ts +11 -17
- package/lib/engine/features/tolltip/tooltip.js +142 -296
- package/lib/engine/features/tolltip/tooltipComponentsManager.d.ts +10 -21
- package/lib/engine/features/tolltip/tooltipComponentsManager.js +114 -113
- package/lib/engine/features/tolltip/tooltipDomHelper.d.ts +21 -43
- package/lib/engine/features/tolltip/tooltipDomHelper.js +120 -144
- package/lib/engine/features/tolltip/tooltipHelper.d.ts +9 -39
- package/lib/engine/features/tolltip/tooltipHelper.js +91 -114
- package/lib/engine/features/valueLabels/valueLabels.d.ts +38 -58
- package/lib/engine/features/valueLabels/valueLabels.js +169 -205
- package/lib/engine/features/valueLabels/valueLabelsHelper.d.ts +1 -7
- package/lib/engine/features/valueLabels/valueLabelsHelper.js +18 -23
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollision.d.ts +15 -18
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollision.js +47 -46
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollisionHelper.d.ts +3 -6
- package/lib/engine/features/valueLabelsCollision/valueLabelsCollisionHelper.js +45 -49
- package/lib/engine/filterManager/filterEventManager.d.ts +30 -37
- package/lib/engine/filterManager/filterEventManager.js +131 -174
- package/lib/engine/helpers/domHelper.d.ts +20 -45
- package/lib/engine/helpers/domHelper.js +61 -62
- package/lib/engine/helpers/fontResizer/fontResizer.d.ts +10 -10
- package/lib/engine/helpers/fontResizer/fontResizer.js +16 -21
- package/lib/engine/helpers/fontResizer/fontResizerService.d.ts +1 -1
- package/lib/engine/helpers/fontResizer/fontResizerService.js +10 -9
- package/lib/engine/helpers/helper.d.ts +27 -27
- package/lib/engine/helpers/helper.js +92 -91
- package/lib/engine/helpers/namesHelper.d.ts +3 -3
- package/lib/engine/helpers/namesHelper.js +6 -6
- package/lib/engine/helpers/pipeline/Pipeline.d.ts +5 -5
- package/lib/engine/helpers/pipeline/Pipeline.js +33 -33
- package/lib/engine/polarNotation/donut/DonutHelper.d.ts +11 -25
- package/lib/engine/polarNotation/donut/DonutHelper.js +70 -71
- package/lib/engine/polarNotation/donut/donut.d.ts +23 -38
- package/lib/engine/polarNotation/donut/donut.js +99 -109
- package/lib/engine/polarNotation/polarManager.d.ts +6 -6
- package/lib/engine/polarNotation/polarManager.js +47 -67
- package/lib/engine/transitionManager.d.ts +14 -13
- package/lib/engine/transitionManager.js +49 -48
- package/lib/engine/twoDimensionalNotation/area/area.d.ts +28 -44
- package/lib/engine/twoDimensionalNotation/area/area.js +238 -272
- package/lib/engine/twoDimensionalNotation/area/areaGenerator.d.ts +5 -13
- package/lib/engine/twoDimensionalNotation/area/areaGenerator.js +13 -13
- package/lib/engine/twoDimensionalNotation/area/areaHelper.d.ts +4 -4
- package/lib/engine/twoDimensionalNotation/area/areaHelper.js +41 -57
- package/lib/engine/twoDimensionalNotation/bar/bar.d.ts +29 -54
- package/lib/engine/twoDimensionalNotation/bar/bar.js +224 -362
- package/lib/engine/twoDimensionalNotation/bar/barHelper.d.ts +32 -71
- package/lib/engine/twoDimensionalNotation/bar/barHelper.js +126 -162
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStacker.d.ts +6 -6
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStacker.js +24 -24
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStackerService.d.ts +2 -2
- package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStackerService.js +17 -16
- package/lib/engine/twoDimensionalNotation/dot/dotChart.d.ts +23 -23
- package/lib/engine/twoDimensionalNotation/dot/dotChart.js +114 -135
- package/lib/engine/twoDimensionalNotation/line/line.d.ts +16 -37
- package/lib/engine/twoDimensionalNotation/line/line.js +132 -162
- package/lib/engine/twoDimensionalNotation/line/lineBuilder.d.ts +11 -14
- package/lib/engine/twoDimensionalNotation/line/lineBuilder.js +48 -47
- package/lib/engine/twoDimensionalNotation/line/lineGenerator.d.ts +4 -4
- package/lib/engine/twoDimensionalNotation/line/lineGenerator.js +8 -8
- package/lib/engine/twoDimensionalNotation/line/lineHelper.d.ts +6 -12
- package/lib/engine/twoDimensionalNotation/line/lineHelper.js +60 -76
- package/lib/engine/twoDimensionalNotation/lineLike/generatorFactory/lineLikeGeneratorFactory.d.ts +6 -6
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorCurveMiddleware.d.ts +5 -5
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorCurveMiddleware.js +17 -16
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware.d.ts +10 -11
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware.js +7 -9
- package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorMiddleware.d.ts +1 -3
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.d.ts +10 -10
- package/lib/engine/twoDimensionalNotation/twoDimensionalManager.js +138 -253
- package/lib/engine/valueFormatter.d.ts +3 -3
- package/lib/engine/valueFormatter.js +6 -6
- package/lib/main.d.ts +79 -82
- package/lib/main.js +84 -79
- package/lib/model/EventEmitter.d.ts +8 -8
- package/lib/model/EventEmitter.js +24 -24
- package/lib/model/chartStyleModel/chartStyleModel.d.ts +5 -5
- package/lib/model/chartStyleModel/chartStyleModel.js +25 -27
- package/lib/model/chartStyleModel/colorRange.d.ts +3 -3
- package/lib/model/chartStyleModel/colorRange.js +24 -19
- package/lib/model/chartStyleModel/twoDimensionalChartStyleModel.d.ts +12 -22
- package/lib/model/chartStyleModel/twoDimensionalChartStyleModel.js +60 -69
- package/lib/model/configsValidator/configValidator.d.ts +1 -1
- package/lib/model/configsValidator/configValidator.js +4 -4
- package/lib/model/dataManagerModel/dataManagerModel.d.ts +26 -36
- package/lib/model/dataManagerModel/dataManagerModel.js +128 -179
- package/lib/model/dataManagerModel/dataManagerModelService.d.ts +2 -2
- package/lib/model/dataManagerModel/dataManagerModelService.js +26 -25
- package/lib/model/featuresModel/axisModel.d.ts +18 -69
- package/lib/model/featuresModel/axisModel.js +169 -224
- package/lib/model/featuresModel/axisModelService.d.ts +6 -10
- package/lib/model/featuresModel/axisModelService.js +27 -27
- package/lib/model/featuresModel/legendModel/legendCanvasModel.d.ts +11 -16
- package/lib/model/featuresModel/legendModel/legendCanvasModel.js +59 -55
- package/lib/model/featuresModel/legendModel/legendModel.d.ts +3 -7
- package/lib/model/featuresModel/legendModel/legendModel.js +41 -59
- package/lib/model/featuresModel/legendModel/polarMarginCalculator.d.ts +3 -8
- package/lib/model/featuresModel/legendModel/polarMarginCalculator.js +20 -18
- package/lib/model/featuresModel/legendModel/twoDimLegendModel.d.ts +4 -8
- package/lib/model/featuresModel/legendModel/twoDimLegendModel.js +27 -40
- package/lib/model/featuresModel/otherComponents.d.ts +4 -7
- package/lib/model/featuresModel/otherComponents.js +9 -9
- package/lib/model/featuresModel/recordOverflowModel/recordOverflowModel.d.ts +4 -0
- package/lib/model/featuresModel/recordOverflowModel/recordOverflowModel.js +33 -0
- package/lib/model/featuresModel/scaleModel/scaleAxisRecalcer.d.ts +6 -6
- package/lib/model/featuresModel/scaleModel/scaleAxisRecalcer.js +23 -27
- package/lib/model/featuresModel/scaleModel/scaleDomainService.d.ts +5 -19
- package/lib/model/featuresModel/scaleModel/scaleDomainService.js +55 -44
- package/lib/model/featuresModel/scaleModel/scaleModel.d.ts +10 -10
- package/lib/model/featuresModel/scaleModel/scaleModel.js +50 -61
- package/lib/model/featuresModel/scaleModel/scaleModelServices.js +22 -15
- package/lib/model/featuresModel/titleModel.d.ts +1 -1
- package/lib/model/featuresModel/titleModel.js +14 -14
- package/lib/model/featuresModel/tooltipModel.d.ts +1 -1
- package/lib/model/featuresModel/tooltipModel.js +5 -5
- package/lib/model/featuresModel/valueLabelsModel/valueLabelsModel.d.ts +11 -23
- package/lib/model/featuresModel/valueLabelsModel/valueLabelsModel.js +51 -53
- package/lib/model/helpers/modelHelper.d.ts +7 -7
- package/lib/model/helpers/modelHelper.js +42 -38
- package/lib/model/helpers/twoDimensionalModelHelper.d.ts +9 -37
- package/lib/model/helpers/twoDimensionalModelHelper.js +125 -147
- package/lib/model/helpers/unitsFromConfigReader.js +4 -4
- package/lib/model/helpers/unitsReader.d.ts +2 -2
- package/lib/model/helpers/unitsReader.js +13 -11
- package/lib/model/margin/marginModel.d.ts +7 -7
- package/lib/model/margin/marginModel.js +20 -23
- package/lib/model/margin/twoDim/twoDimMarginModel.d.ts +13 -13
- package/lib/model/margin/twoDim/twoDimMarginModel.js +113 -184
- package/lib/model/model.d.ts +284 -315
- package/lib/model/model.js +4 -4
- package/lib/model/modelBuilder.d.ts +18 -27
- package/lib/model/modelBuilder.js +79 -85
- package/lib/model/modelInstance/canvasModel/canvasModel.d.ts +17 -17
- package/lib/model/modelInstance/canvasModel/canvasModel.js +43 -42
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/canvasMarginModel.d.ts +7 -7
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/canvasSizeModel.d.ts +2 -2
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/marginModelService.d.ts +6 -6
- package/lib/model/modelInstance/canvasModel/canvasSizesModel/marginModelService.js +24 -24
- package/lib/model/modelInstance/canvasModel/legendCanvasModel.d.ts +4 -4
- package/lib/model/modelInstance/canvasModel/legendCanvasModel.js +11 -11
- package/lib/model/modelInstance/canvasModel/titleCanvas.d.ts +4 -4
- package/lib/model/modelInstance/canvasModel/titleCanvas.js +9 -9
- package/lib/model/modelInstance/chartBlockVersion/chartBlockVersion.d.ts +3 -3
- package/lib/model/modelInstance/chartBlockVersion/chartBlockVersion.js +6 -6
- package/lib/model/modelInstance/configReader.d.ts +23 -32
- package/lib/model/modelInstance/configReader.js +94 -125
- package/lib/model/modelInstance/dataModel/dataModel.d.ts +10 -10
- package/lib/model/modelInstance/dataModel/dataModel.js +25 -25
- package/lib/model/modelInstance/dataModel/dataRepository.d.ts +14 -14
- package/lib/model/modelInstance/dataModel/dataRepository.js +42 -42
- package/lib/model/modelInstance/modelInstance.d.ts +6 -11
- package/lib/model/modelInstance/modelInstance.js +16 -16
- package/lib/model/modelInstance/titleConfigReader.d.ts +8 -8
- package/lib/model/modelInstance/titleConfigReader.js +30 -37
- package/lib/model/notations/polar/donut/donutAggregatorService.d.ts +6 -9
- package/lib/model/notations/polar/donut/donutAggregatorService.js +37 -40
- package/lib/model/notations/polar/donut/donutModel.d.ts +5 -9
- package/lib/model/notations/polar/donut/donutModel.js +28 -28
- package/lib/model/notations/polar/donut/donutThicknessService.d.ts +3 -3
- package/lib/model/notations/polar/donut/donutThicknessService.js +15 -13
- package/lib/model/notations/polar/polarModel.d.ts +7 -18
- package/lib/model/notations/polar/polarModel.js +72 -79
- package/lib/model/notations/twoDimensional/styles.d.ts +7 -44
- package/lib/model/notations/twoDimensional/styles.js +125 -234
- package/lib/model/notations/twoDimensionalModel.d.ts +13 -23
- package/lib/model/notations/twoDimensionalModel.js +170 -330
- package/lib/optionsServices/publicOptionsService.d.ts +1 -1
- package/lib/optionsServices/publicOptionsService.js +4 -4
- package/lib/optionsServices/validators/sizeValidator.d.ts +2 -2
- package/lib/optionsServices/validators/sizeValidator.js +11 -10
- package/lib/style/charts-main.css +151 -150
- package/lib/style/charts-main.less +151 -150
- package/package.json +1 -1
- package/lib/engine/polarNotation/extenders/polarRecordOverflowAlert.d.ts +0 -15
- package/lib/engine/polarNotation/extenders/polarRecordOverflowAlert.js +0 -40
- package/lib/engine/twoDimensionalNotation/extenders/twoDimRecordOverflowAlert.d.ts +0 -15
- package/lib/engine/twoDimensionalNotation/extenders/twoDimRecordOverflowAlert.js +0 -32
|
@@ -9,229 +9,174 @@ export const MINIMAL_HORIZONTAL_STEP_SIZE = 100;
|
|
|
9
9
|
export const LABEL_ELEMENT_HEIGHT_PX = 17;
|
|
10
10
|
const DEFAULT_AXIS_LINE_VISIBLE = true;
|
|
11
11
|
export class AxisModel {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const sign = Math.sign(value);
|
|
182
|
-
if (absValue < 10) return value;
|
|
183
|
-
if (absValue < 100) return sign * Math.floor(absValue / 10) * 10;
|
|
184
|
-
const valueStr = absValue.toString();
|
|
185
|
-
const firstTwoDigits = Math.floor(absValue / Math.pow(10, valueStr.length - 2));
|
|
186
|
-
const roundedFirstTwoDigits = firstTwoDigits < 10 ? firstTwoDigits : Math.floor(firstTwoDigits / 5) * 5;
|
|
187
|
-
const roundedNumber = roundedFirstTwoDigits * Math.pow(10, valueStr.length - 2);
|
|
188
|
-
return sign * roundedNumber;
|
|
189
|
-
}
|
|
190
|
-
static getTickAmountPolicy(orient, axisConfig, scaleInfo) {
|
|
191
|
-
const axisLength = scaleInfo.range.end - scaleInfo.range.start;
|
|
192
|
-
const linearTickStep = this.getTickStep(orient, axisConfig);
|
|
193
|
-
let tickAmountPolicy;
|
|
194
|
-
if (Math.floor(axisLength / linearTickStep) > 2) {
|
|
195
|
-
tickAmountPolicy = {
|
|
196
|
-
type: "amount",
|
|
197
|
-
amount: Math.floor(axisLength / linearTickStep)
|
|
198
|
-
};
|
|
199
|
-
} else {
|
|
200
|
-
const roundedMaxValue = this.getRoundValue(max(scaleInfo.domain));
|
|
201
|
-
tickAmountPolicy = {
|
|
202
|
-
type: "constant",
|
|
203
|
-
values: [min(scaleInfo.domain), roundedMaxValue]
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
return tickAmountPolicy;
|
|
207
|
-
}
|
|
208
|
-
static getKeyAxisTranslateModel(chartOrientation, axisPosition, canvasModel, getZeroCoordinate) {
|
|
209
|
-
let translateY;
|
|
210
|
-
let translateX;
|
|
211
|
-
if (chartOrientation === "vertical") {
|
|
212
|
-
translateY = getZeroCoordinate
|
|
213
|
-
? getZeroCoordinate() + canvasModel.getMarginSide("top")
|
|
214
|
-
: AxisModel.getAxisTranslateY(AxisType.Key, chartOrientation, axisPosition, canvasModel);
|
|
215
|
-
translateX = AxisModel.getAxisTranslateX(AxisType.Key, chartOrientation, axisPosition, canvasModel);
|
|
216
|
-
} else {
|
|
217
|
-
translateX = getZeroCoordinate
|
|
218
|
-
? getZeroCoordinate() + canvasModel.getMarginSide("left")
|
|
219
|
-
: AxisModel.getAxisTranslateX(AxisType.Key, chartOrientation, axisPosition, canvasModel);
|
|
220
|
-
translateY = AxisModel.getAxisTranslateY(AxisType.Key, chartOrientation, axisPosition, canvasModel);
|
|
221
|
-
}
|
|
222
|
-
return {
|
|
223
|
-
translateX,
|
|
224
|
-
translateY
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
static getTickStep(orient, axisConfig) {
|
|
228
|
-
var _a, _b;
|
|
229
|
-
return (_b = (_a = axisConfig.labels) === null || _a === void 0 ? void 0 : _a.stepSize) !== null &&
|
|
230
|
-
_b !== void 0
|
|
231
|
-
? _b
|
|
232
|
-
: orient === "horizontal"
|
|
233
|
-
? MINIMAL_HORIZONTAL_STEP_SIZE
|
|
234
|
-
: MINIMAL_VERTICAL_STEP_SIZE;
|
|
235
|
-
}
|
|
12
|
+
static getKeyAxis(options, data, labelConfig, canvasModel, tooltipSettings, getZeroCoordinate) {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
const { charts, orientation, data: dataOptions } = options;
|
|
15
|
+
const axisConfig = options.axis.key;
|
|
16
|
+
const translate = this.getKeyAxisTranslateModel(orientation, axisConfig.position, canvasModel, getZeroCoordinate);
|
|
17
|
+
const tickCalculator = new AxisModelTickCalculator(data[dataOptions.dataSource], (_a = options.axis.key.labels) === null || _a === void 0 ? void 0 : _a.showRule);
|
|
18
|
+
return {
|
|
19
|
+
type: "key",
|
|
20
|
+
orient: AxisModel.getAxisOrient(AxisType.Key, orientation, axisConfig.position),
|
|
21
|
+
translate,
|
|
22
|
+
cssClass: "key-axis",
|
|
23
|
+
ticks: axisConfig.ticks,
|
|
24
|
+
labels: {
|
|
25
|
+
maxSize: AxisModel.getLabelSize(labelConfig.maxSize.main, data[dataOptions.dataSource].map((d) => d[dataOptions.keyField.name])).width,
|
|
26
|
+
position: AxisModel.getKeyAxisLabelPosition(canvasModel, DataManagerModel.getDataValuesByKeyField(data, dataOptions.dataSource, dataOptions.keyField.name)
|
|
27
|
+
.length, axisConfig),
|
|
28
|
+
visible: !TwoDimensionalModel.getChartsEmbeddedLabelsFlag(charts, orientation),
|
|
29
|
+
defaultTooltip: tooltipSettings.position === "fixed",
|
|
30
|
+
showTick: tickCalculator.createFunctionCalculator(this.getAxisLength(orientation, canvasModel)),
|
|
31
|
+
linearTickStep: MINIMAL_HORIZONTAL_STEP_SIZE,
|
|
32
|
+
tickAmountSettings: {
|
|
33
|
+
policy: { type: "auto" }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
visibility: axisConfig.visibility,
|
|
37
|
+
line: {
|
|
38
|
+
visible: (_c = (_b = axisConfig.line) === null || _b === void 0 ? void 0 : _b.visible) !== null && _c !== void 0 ? _c : DEFAULT_AXIS_LINE_VISIBLE
|
|
39
|
+
},
|
|
40
|
+
browserTooltip: {
|
|
41
|
+
format: (value) => value
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static getMainValueAxis(defaultFormatter, orient, position, axisConfig, labelConfig, canvasModel, scaleInfo) {
|
|
46
|
+
return this.getValueAxis(defaultFormatter, orient, position, "value-axis", axisConfig, labelConfig, canvasModel, scaleInfo);
|
|
47
|
+
}
|
|
48
|
+
static getSecondaryValueAxis(defaultFormatter, orient, mainAxisPosition, axisConfig, labelConfig, canvasModel, scaleInfo) {
|
|
49
|
+
return this.getValueAxis(defaultFormatter, orient, mainAxisPosition === "start" ? "end" : "start", "value-secondary-axis", axisConfig, labelConfig, canvasModel, scaleInfo);
|
|
50
|
+
}
|
|
51
|
+
static getValueAxis(defaultFormatter, orient, position, cssClass, axisConfig, labelConfig, canvasModel, scaleInfo) {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
return {
|
|
54
|
+
type: "value",
|
|
55
|
+
orient: AxisModel.getAxisOrient(AxisType.Value, orient, position),
|
|
56
|
+
translate: {
|
|
57
|
+
translateX: AxisModel.getAxisTranslateX(AxisType.Value, orient, position, canvasModel),
|
|
58
|
+
translateY: AxisModel.getAxisTranslateY(AxisType.Value, orient, position, canvasModel)
|
|
59
|
+
},
|
|
60
|
+
cssClass,
|
|
61
|
+
ticks: axisConfig.ticks,
|
|
62
|
+
labels: {
|
|
63
|
+
maxSize: labelConfig.maxSize.main,
|
|
64
|
+
position: "straight",
|
|
65
|
+
visible: true,
|
|
66
|
+
defaultTooltip: true,
|
|
67
|
+
showTick: showAllTicks,
|
|
68
|
+
linearTickStep: this.getTickStep(orient, axisConfig),
|
|
69
|
+
tickAmountSettings: {
|
|
70
|
+
policy: this.getTickAmountPolicy(orient, axisConfig, scaleInfo)
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
visibility: axisConfig.visibility,
|
|
74
|
+
line: {
|
|
75
|
+
visible: (_b = (_a = axisConfig.line) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : DEFAULT_AXIS_LINE_VISIBLE
|
|
76
|
+
},
|
|
77
|
+
browserTooltip: {
|
|
78
|
+
format: (value) => defaultFormatter(value)
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
static getAxisLength(chartOrientation, canvasModel) {
|
|
83
|
+
if (chartOrientation === "horizontal") {
|
|
84
|
+
return canvasModel.getChartBlockHeight();
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return canvasModel.getChartBlockWidth();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
static getAxisOrient(axisType, chartOrientation, axisPosition) {
|
|
91
|
+
if (chartOrientation === "vertical") {
|
|
92
|
+
if (axisPosition === "start")
|
|
93
|
+
return axisType === AxisType.Key ? "top" : "left";
|
|
94
|
+
return axisType === AxisType.Key ? "bottom" : "right";
|
|
95
|
+
}
|
|
96
|
+
if (axisPosition === "start")
|
|
97
|
+
return axisType === AxisType.Key ? "left" : "top";
|
|
98
|
+
return axisType === AxisType.Key ? "right" : "bottom";
|
|
99
|
+
}
|
|
100
|
+
static getAxisTranslateX(axisType, chartOrientation, axisPosition, canvasModel) {
|
|
101
|
+
const orient = AxisModel.getAxisOrient(axisType, chartOrientation, axisPosition);
|
|
102
|
+
if (orient === "top" || orient === "left")
|
|
103
|
+
return canvasModel.getMarginSide("left");
|
|
104
|
+
else if (orient === "bottom")
|
|
105
|
+
return canvasModel.getMarginSide("left");
|
|
106
|
+
return canvasModel.getBlockSize().width - canvasModel.getMarginSide("right");
|
|
107
|
+
}
|
|
108
|
+
static getAxisTranslateY(axisType, chartOrientation, axisPosition, canvasModel) {
|
|
109
|
+
const orient = AxisModel.getAxisOrient(axisType, chartOrientation, axisPosition);
|
|
110
|
+
if (orient === "top" || orient === "left")
|
|
111
|
+
return canvasModel.getMarginSide("top");
|
|
112
|
+
else if (orient === "bottom")
|
|
113
|
+
return canvasModel.getBlockSize().height - canvasModel.getMarginSide("bottom");
|
|
114
|
+
return canvasModel.getMarginSide("top");
|
|
115
|
+
}
|
|
116
|
+
static getKeyAxisLabelPosition(canvasModel, scopedDataLength, axisConfig) {
|
|
117
|
+
var _a;
|
|
118
|
+
return this.service.getKeyAxisLabelPosition(canvasModel.getChartBlockWidth(), scopedDataLength, (_a = axisConfig === null || axisConfig === void 0 ? void 0 : axisConfig.labels) === null || _a === void 0 ? void 0 : _a.position);
|
|
119
|
+
}
|
|
120
|
+
static getLabelSize(labelMaxWidth, labelTexts) {
|
|
121
|
+
const ONE_UPPER_SYMBOL_WIDTH_PX = 8;
|
|
122
|
+
const longestLabelLength = labelTexts.length
|
|
123
|
+
? Math.max(...labelTexts.map((t) => ModelHelper.getStringScore(t)))
|
|
124
|
+
: 0;
|
|
125
|
+
const longestLabelWidth = ONE_UPPER_SYMBOL_WIDTH_PX * longestLabelLength;
|
|
126
|
+
return {
|
|
127
|
+
height: LABEL_ELEMENT_HEIGHT_PX,
|
|
128
|
+
width: longestLabelWidth > labelMaxWidth ? labelMaxWidth : longestLabelWidth
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
static getRoundValue(value) {
|
|
132
|
+
const absValue = Math.abs(value);
|
|
133
|
+
const sign = Math.sign(value);
|
|
134
|
+
if (absValue < 10)
|
|
135
|
+
return value;
|
|
136
|
+
if (absValue < 100)
|
|
137
|
+
return sign * Math.floor(absValue / 10) * 10;
|
|
138
|
+
const valueStr = absValue.toString();
|
|
139
|
+
const firstTwoDigits = Math.floor(absValue / Math.pow(10, valueStr.length - 2));
|
|
140
|
+
const roundedFirstTwoDigits = firstTwoDigits < 10 ? firstTwoDigits : Math.floor(firstTwoDigits / 5) * 5;
|
|
141
|
+
const roundedNumber = roundedFirstTwoDigits * Math.pow(10, valueStr.length - 2);
|
|
142
|
+
return sign * roundedNumber;
|
|
143
|
+
}
|
|
144
|
+
static getTickAmountPolicy(orient, axisConfig, scaleInfo) {
|
|
145
|
+
const axisLength = scaleInfo.range.end - scaleInfo.range.start;
|
|
146
|
+
const linearTickStep = this.getTickStep(orient, axisConfig);
|
|
147
|
+
let tickAmountPolicy;
|
|
148
|
+
if (Math.floor(axisLength / linearTickStep) > 2) {
|
|
149
|
+
tickAmountPolicy = { type: "amount", amount: Math.floor(axisLength / linearTickStep) };
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
const roundedMaxValue = this.getRoundValue(max(scaleInfo.domain));
|
|
153
|
+
tickAmountPolicy = { type: "constant", values: [min(scaleInfo.domain), roundedMaxValue] };
|
|
154
|
+
}
|
|
155
|
+
return tickAmountPolicy;
|
|
156
|
+
}
|
|
157
|
+
static getKeyAxisTranslateModel(chartOrientation, axisPosition, canvasModel, getZeroCoordinate) {
|
|
158
|
+
let translateY;
|
|
159
|
+
let translateX;
|
|
160
|
+
if (chartOrientation === "vertical") {
|
|
161
|
+
translateY = getZeroCoordinate
|
|
162
|
+
? getZeroCoordinate() + canvasModel.getMarginSide("top")
|
|
163
|
+
: AxisModel.getAxisTranslateY(AxisType.Key, chartOrientation, axisPosition, canvasModel);
|
|
164
|
+
translateX = AxisModel.getAxisTranslateX(AxisType.Key, chartOrientation, axisPosition, canvasModel);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
translateX = getZeroCoordinate
|
|
168
|
+
? getZeroCoordinate() + canvasModel.getMarginSide("left")
|
|
169
|
+
: AxisModel.getAxisTranslateX(AxisType.Key, chartOrientation, axisPosition, canvasModel);
|
|
170
|
+
translateY = AxisModel.getAxisTranslateY(AxisType.Key, chartOrientation, axisPosition, canvasModel);
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
translateX,
|
|
174
|
+
translateY
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
static getTickStep(orient, axisConfig) {
|
|
178
|
+
var _a, _b;
|
|
179
|
+
return ((_b = (_a = axisConfig.labels) === null || _a === void 0 ? void 0 : _a.stepSize) !== null && _b !== void 0 ? _b : (orient === "horizontal" ? MINIMAL_HORIZONTAL_STEP_SIZE : MINIMAL_VERTICAL_STEP_SIZE));
|
|
180
|
+
}
|
|
236
181
|
}
|
|
237
182
|
AxisModel.service = new AxisModelService();
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { AxisLabelPosition, MdtChartsDataRow, MdtChartsShowAxisLabelRule, ShowTickFn } from "../../config/config";
|
|
2
2
|
export declare const showAllTicks: ShowTickFn;
|
|
3
3
|
export declare class AxisModelService {
|
|
4
|
-
|
|
5
|
-
chartBlockWidth: number,
|
|
6
|
-
scopedDataLength: number,
|
|
7
|
-
positionFromConfig?: AxisLabelPosition
|
|
8
|
-
): AxisLabelPosition;
|
|
4
|
+
getKeyAxisLabelPosition(chartBlockWidth: number, scopedDataLength: number, positionFromConfig?: AxisLabelPosition): AxisLabelPosition;
|
|
9
5
|
}
|
|
10
6
|
export declare class AxisModelTickCalculator {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
private readonly dataRows;
|
|
8
|
+
private readonly rule?;
|
|
9
|
+
private readonly defaultTickSpace;
|
|
10
|
+
constructor(dataRows: MdtChartsDataRow[], rule?: MdtChartsShowAxisLabelRule);
|
|
11
|
+
createFunctionCalculator(axisSize: number): ShowTickFn;
|
|
16
12
|
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
export const showAllTicks = (d) => d;
|
|
2
2
|
export class AxisModelService {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
getKeyAxisLabelPosition(chartBlockWidth, scopedDataLength, positionFromConfig) {
|
|
4
|
+
if (positionFromConfig === "rotated" || positionFromConfig === "straight") {
|
|
5
|
+
return positionFromConfig;
|
|
6
|
+
}
|
|
7
|
+
const minBandSize = 50;
|
|
8
|
+
if (chartBlockWidth / scopedDataLength < minBandSize)
|
|
9
|
+
return "rotated";
|
|
10
|
+
return "straight";
|
|
11
|
+
}
|
|
11
12
|
}
|
|
12
13
|
export class AxisModelTickCalculator {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
14
|
+
constructor(dataRows, rule) {
|
|
15
|
+
this.dataRows = dataRows;
|
|
16
|
+
this.rule = rule;
|
|
17
|
+
this.defaultTickSpace = 20;
|
|
18
|
+
}
|
|
19
|
+
createFunctionCalculator(axisSize) {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
if ((_a = this.rule) === null || _a === void 0 ? void 0 : _a.showTickFn)
|
|
22
|
+
return this.rule.showTickFn;
|
|
23
|
+
const tickSpace = (_c = (_b = this.rule) === null || _b === void 0 ? void 0 : _b.spaceForOneLabel) !== null && _c !== void 0 ? _c : this.defaultTickSpace;
|
|
24
|
+
const allowedKeysAmount = Math.floor(axisSize / tickSpace);
|
|
25
|
+
if (allowedKeysAmount >= this.dataRows.length)
|
|
26
|
+
return showAllTicks;
|
|
27
|
+
let divider = Math.ceil(this.dataRows.length / allowedKeysAmount);
|
|
28
|
+
return (d, i) => {
|
|
29
|
+
return i % divider === 0 ? d : undefined;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
32
|
}
|
|
@@ -2,22 +2,17 @@ import { DataLegendParams } from "../../dataManagerModel/dataManagerModel";
|
|
|
2
2
|
import { LegendPosition } from "../../model";
|
|
3
3
|
export declare type LegendItemsDirection = "row" | "column";
|
|
4
4
|
export interface LegendItemContentOptions {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
text: string;
|
|
6
|
+
markerSize: {
|
|
7
|
+
widthPx: number;
|
|
8
|
+
heightPx: number;
|
|
9
|
+
marginRightPx: number;
|
|
10
|
+
};
|
|
11
|
+
wrapperSize: {
|
|
12
|
+
marginRightPx: number;
|
|
13
|
+
};
|
|
14
14
|
}
|
|
15
15
|
export declare class LegendCanvasModel {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
position: LegendPosition,
|
|
19
|
-
legendBlockWidth: number,
|
|
20
|
-
legendBlockHeight: number
|
|
21
|
-
): DataLegendParams;
|
|
22
|
-
private static getLegendWrapperEl;
|
|
16
|
+
static findElementsAmountByLegendSize(items: LegendItemContentOptions[], position: LegendPosition, legendBlockWidth: number, legendBlockHeight: number): DataLegendParams;
|
|
17
|
+
private static getLegendWrapperEl;
|
|
23
18
|
}
|