mdt-charts 1.29.0 → 1.30.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.
Files changed (257) hide show
  1. package/lib/config/config.d.ts +170 -178
  2. package/lib/designer/designerConfig.d.ts +59 -62
  3. package/lib/engine/block/block.d.ts +16 -22
  4. package/lib/engine/block/block.js +51 -51
  5. package/lib/engine/block/blockHelper.d.ts +6 -6
  6. package/lib/engine/block/blockHelper.js +16 -16
  7. package/lib/engine/block/blockHtml.d.ts +8 -8
  8. package/lib/engine/block/blockHtml.js +15 -15
  9. package/lib/engine/block/blockSvg.d.ts +20 -20
  10. package/lib/engine/block/blockSvg.js +66 -65
  11. package/lib/engine/block/defs/LinearGradientDef.d.ts +2 -2
  12. package/lib/engine/block/defs/LinearGradientDef.js +27 -27
  13. package/lib/engine/block/defs/hatchPattern.d.ts +4 -4
  14. package/lib/engine/block/defs/hatchPattern.js +9 -9
  15. package/lib/engine/colorReader/colorReader.d.ts +5 -5
  16. package/lib/engine/colorReader/colorReader.js +18 -18
  17. package/lib/engine/contentManager/contentManager.d.ts +7 -6
  18. package/lib/engine/contentManager/contentManager.js +15 -15
  19. package/lib/engine/contentManager/contentManagerFactory.d.ts +7 -7
  20. package/lib/engine/contentManager/contentManagerFactory.js +12 -12
  21. package/lib/engine/elementHighlighter/elementHighlighter.d.ts +22 -70
  22. package/lib/engine/elementHighlighter/elementHighlighter.js +181 -230
  23. package/lib/engine/elementHighlighter/selectHighlighter.d.ts +4 -29
  24. package/lib/engine/elementHighlighter/selectHighlighter.js +87 -189
  25. package/lib/engine/engine.d.ts +17 -17
  26. package/lib/engine/engine.js +62 -87
  27. package/lib/engine/features/aggregator/aggregator.d.ts +17 -24
  28. package/lib/engine/features/aggregator/aggregator.js +102 -113
  29. package/lib/engine/features/axis/axis.d.ts +9 -22
  30. package/lib/engine/features/axis/axis.js +150 -159
  31. package/lib/engine/features/axis/axisDomHelper.d.ts +2 -7
  32. package/lib/engine/features/axis/axisDomHelper.js +20 -19
  33. package/lib/engine/features/axis/axisHelper.d.ts +5 -9
  34. package/lib/engine/features/axis/axisHelper.js +33 -28
  35. package/lib/engine/features/axis/axisLabelDomHelper.d.ts +11 -26
  36. package/lib/engine/features/axis/axisLabelDomHelper.js +152 -156
  37. package/lib/engine/features/axis/axisLabelsEventManager.d.ts +2 -2
  38. package/lib/engine/features/axis/axisLabelsEventManager.js +32 -32
  39. package/lib/engine/features/embeddedLabels/embeddedLabels.d.ts +16 -51
  40. package/lib/engine/features/embeddedLabels/embeddedLabels.js +134 -234
  41. package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.d.ts +2 -13
  42. package/lib/engine/features/embeddedLabels/embeddedLabelsDomHelper.js +23 -20
  43. package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.d.ts +15 -32
  44. package/lib/engine/features/embeddedLabels/embeddedLabelsHelper.js +63 -56
  45. package/lib/engine/features/gridLine/gidLineHelper.d.ts +7 -13
  46. package/lib/engine/features/gridLine/gidLineHelper.js +49 -42
  47. package/lib/engine/features/gridLine/gridLine.d.ts +5 -19
  48. package/lib/engine/features/gridLine/gridLine.js +36 -35
  49. package/lib/engine/features/legend/legend.d.ts +28 -38
  50. package/lib/engine/features/legend/legend.js +92 -118
  51. package/lib/engine/features/legend/legendDomHelper.d.ts +6 -13
  52. package/lib/engine/features/legend/legendDomHelper.js +62 -63
  53. package/lib/engine/features/legend/legendEventsManager.d.ts +8 -13
  54. package/lib/engine/features/legend/legendEventsManager.js +47 -48
  55. package/lib/engine/features/legend/legendHelper.d.ts +14 -39
  56. package/lib/engine/features/legend/legendHelper.js +92 -98
  57. package/lib/engine/features/legend/legendHelperService.d.ts +6 -13
  58. package/lib/engine/features/legend/legendHelperService.js +25 -24
  59. package/lib/engine/features/legend/legendMarkerCreator.d.ts +9 -18
  60. package/lib/engine/features/legend/legendMarkerCreator.js +76 -79
  61. package/lib/engine/features/legend/legendWidthCalculator.d.ts +7 -7
  62. package/lib/engine/features/legend/legendWidthCalculator.js +122 -126
  63. package/lib/engine/features/markDots/markDot.d.ts +15 -42
  64. package/lib/engine/features/markDots/markDot.js +70 -101
  65. package/lib/engine/features/markDots/markDotsHelper.d.ts +1 -8
  66. package/lib/engine/features/markDots/markDotsHelper.js +12 -13
  67. package/lib/engine/features/recordOverflowAlert/recordOverflowAlertCore.d.ts +5 -23
  68. package/lib/engine/features/recordOverflowAlert/recordOverflowAlertCore.js +34 -42
  69. package/lib/engine/features/scale/scale.d.ts +12 -17
  70. package/lib/engine/features/scale/scale.js +69 -76
  71. package/lib/engine/features/tipBox/tipBox.d.ts +5 -9
  72. package/lib/engine/features/tipBox/tipBox.js +24 -24
  73. package/lib/engine/features/tipBox/tipBoxHelper.d.ts +9 -16
  74. package/lib/engine/features/tipBox/tipBoxHelper.js +45 -60
  75. package/lib/engine/features/title/title.d.ts +6 -6
  76. package/lib/engine/features/title/title.js +35 -34
  77. package/lib/engine/features/tolltip/newTooltip/newTooltip.d.ts +11 -15
  78. package/lib/engine/features/tolltip/newTooltip/newTooltip.js +21 -21
  79. package/lib/engine/features/tolltip/newTooltip/newTooltipService.d.ts +8 -13
  80. package/lib/engine/features/tolltip/newTooltip/newTooltipService.js +23 -26
  81. package/lib/engine/features/tolltip/tooltip.d.ts +11 -17
  82. package/lib/engine/features/tolltip/tooltip.js +142 -296
  83. package/lib/engine/features/tolltip/tooltipComponentsManager.d.ts +10 -21
  84. package/lib/engine/features/tolltip/tooltipComponentsManager.js +114 -113
  85. package/lib/engine/features/tolltip/tooltipDomHelper.d.ts +21 -43
  86. package/lib/engine/features/tolltip/tooltipDomHelper.js +120 -144
  87. package/lib/engine/features/tolltip/tooltipHelper.d.ts +9 -39
  88. package/lib/engine/features/tolltip/tooltipHelper.js +91 -114
  89. package/lib/engine/features/valueLabels/valueLabels.d.ts +38 -58
  90. package/lib/engine/features/valueLabels/valueLabels.js +170 -205
  91. package/lib/engine/features/valueLabels/valueLabelsHelper.d.ts +1 -7
  92. package/lib/engine/features/valueLabels/valueLabelsHelper.js +18 -23
  93. package/lib/engine/features/valueLabelsCollision/valueLabelsCollision.d.ts +15 -18
  94. package/lib/engine/features/valueLabelsCollision/valueLabelsCollision.js +47 -46
  95. package/lib/engine/features/valueLabelsCollision/valueLabelsCollisionHelper.d.ts +3 -6
  96. package/lib/engine/features/valueLabelsCollision/valueLabelsCollisionHelper.js +45 -49
  97. package/lib/engine/filterManager/filterEventManager.d.ts +30 -37
  98. package/lib/engine/filterManager/filterEventManager.js +131 -174
  99. package/lib/engine/helpers/domHelper.d.ts +20 -45
  100. package/lib/engine/helpers/domHelper.js +61 -62
  101. package/lib/engine/helpers/fontResizer/fontResizer.d.ts +10 -10
  102. package/lib/engine/helpers/fontResizer/fontResizer.js +16 -21
  103. package/lib/engine/helpers/fontResizer/fontResizerService.d.ts +1 -1
  104. package/lib/engine/helpers/fontResizer/fontResizerService.js +10 -9
  105. package/lib/engine/helpers/helper.d.ts +27 -27
  106. package/lib/engine/helpers/helper.js +92 -91
  107. package/lib/engine/helpers/namesHelper.d.ts +3 -3
  108. package/lib/engine/helpers/namesHelper.js +6 -6
  109. package/lib/engine/helpers/pipeline/Pipeline.d.ts +5 -5
  110. package/lib/engine/helpers/pipeline/Pipeline.js +33 -33
  111. package/lib/engine/polarNotation/donut/DonutHelper.d.ts +11 -25
  112. package/lib/engine/polarNotation/donut/DonutHelper.js +70 -71
  113. package/lib/engine/polarNotation/donut/donut.d.ts +23 -38
  114. package/lib/engine/polarNotation/donut/donut.js +99 -109
  115. package/lib/engine/polarNotation/polarManager.d.ts +6 -6
  116. package/lib/engine/polarNotation/polarManager.js +47 -67
  117. package/lib/engine/transitionManager.d.ts +14 -13
  118. package/lib/engine/transitionManager.js +49 -48
  119. package/lib/engine/twoDimensionalNotation/area/area.d.ts +28 -44
  120. package/lib/engine/twoDimensionalNotation/area/area.js +238 -272
  121. package/lib/engine/twoDimensionalNotation/area/areaGenerator.d.ts +5 -13
  122. package/lib/engine/twoDimensionalNotation/area/areaGenerator.js +13 -13
  123. package/lib/engine/twoDimensionalNotation/area/areaHelper.d.ts +4 -4
  124. package/lib/engine/twoDimensionalNotation/area/areaHelper.js +41 -57
  125. package/lib/engine/twoDimensionalNotation/bar/bar.d.ts +29 -54
  126. package/lib/engine/twoDimensionalNotation/bar/bar.js +224 -362
  127. package/lib/engine/twoDimensionalNotation/bar/barHelper.d.ts +32 -71
  128. package/lib/engine/twoDimensionalNotation/bar/barHelper.js +126 -162
  129. package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStacker.d.ts +6 -6
  130. package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStacker.js +24 -24
  131. package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStackerService.d.ts +2 -2
  132. package/lib/engine/twoDimensionalNotation/bar/stackedData/dataStackerService.js +17 -16
  133. package/lib/engine/twoDimensionalNotation/dot/dotChart.d.ts +23 -23
  134. package/lib/engine/twoDimensionalNotation/dot/dotChart.js +114 -135
  135. package/lib/engine/twoDimensionalNotation/line/line.d.ts +16 -37
  136. package/lib/engine/twoDimensionalNotation/line/line.js +132 -162
  137. package/lib/engine/twoDimensionalNotation/line/lineBuilder.d.ts +11 -14
  138. package/lib/engine/twoDimensionalNotation/line/lineBuilder.js +48 -47
  139. package/lib/engine/twoDimensionalNotation/line/lineGenerator.d.ts +4 -4
  140. package/lib/engine/twoDimensionalNotation/line/lineGenerator.js +8 -8
  141. package/lib/engine/twoDimensionalNotation/line/lineHelper.d.ts +6 -12
  142. package/lib/engine/twoDimensionalNotation/line/lineHelper.js +60 -76
  143. package/lib/engine/twoDimensionalNotation/lineLike/generatorFactory/lineLikeGeneratorFactory.d.ts +6 -6
  144. package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorCurveMiddleware.d.ts +5 -5
  145. package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorCurveMiddleware.js +17 -16
  146. package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware.d.ts +10 -11
  147. package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorDefineMiddleware.js +7 -9
  148. package/lib/engine/twoDimensionalNotation/lineLike/generatorMiddleware/lineLikeGeneratorMiddleware.d.ts +1 -3
  149. package/lib/engine/twoDimensionalNotation/twoDimensionalManager.d.ts +10 -10
  150. package/lib/engine/twoDimensionalNotation/twoDimensionalManager.js +138 -253
  151. package/lib/engine/valueFormatter.d.ts +3 -3
  152. package/lib/engine/valueFormatter.js +6 -6
  153. package/lib/main.d.ts +79 -82
  154. package/lib/main.js +84 -79
  155. package/lib/model/EventEmitter.d.ts +8 -8
  156. package/lib/model/EventEmitter.js +24 -24
  157. package/lib/model/chartStyleModel/chartStyleModel.d.ts +5 -5
  158. package/lib/model/chartStyleModel/chartStyleModel.js +25 -27
  159. package/lib/model/chartStyleModel/colorRange.d.ts +3 -3
  160. package/lib/model/chartStyleModel/colorRange.js +24 -19
  161. package/lib/model/chartStyleModel/twoDimensionalChartStyleModel.d.ts +12 -22
  162. package/lib/model/chartStyleModel/twoDimensionalChartStyleModel.js +60 -69
  163. package/lib/model/configsValidator/configValidator.d.ts +1 -1
  164. package/lib/model/configsValidator/configValidator.js +4 -4
  165. package/lib/model/dataManagerModel/dataManagerModel.d.ts +26 -36
  166. package/lib/model/dataManagerModel/dataManagerModel.js +128 -179
  167. package/lib/model/dataManagerModel/dataManagerModelService.d.ts +2 -2
  168. package/lib/model/dataManagerModel/dataManagerModelService.js +26 -25
  169. package/lib/model/featuresModel/axisModel.d.ts +18 -69
  170. package/lib/model/featuresModel/axisModel.js +169 -224
  171. package/lib/model/featuresModel/axisModelService.d.ts +6 -10
  172. package/lib/model/featuresModel/axisModelService.js +27 -27
  173. package/lib/model/featuresModel/legendModel/legendCanvasModel.d.ts +11 -16
  174. package/lib/model/featuresModel/legendModel/legendCanvasModel.js +59 -55
  175. package/lib/model/featuresModel/legendModel/legendModel.d.ts +3 -7
  176. package/lib/model/featuresModel/legendModel/legendModel.js +41 -59
  177. package/lib/model/featuresModel/legendModel/polarMarginCalculator.d.ts +3 -8
  178. package/lib/model/featuresModel/legendModel/polarMarginCalculator.js +20 -18
  179. package/lib/model/featuresModel/legendModel/twoDimLegendModel.d.ts +4 -8
  180. package/lib/model/featuresModel/legendModel/twoDimLegendModel.js +27 -40
  181. package/lib/model/featuresModel/otherComponents.d.ts +4 -7
  182. package/lib/model/featuresModel/otherComponents.js +9 -9
  183. package/lib/model/featuresModel/recordOverflowModel/recordOverflowModel.d.ts +4 -0
  184. package/lib/model/featuresModel/recordOverflowModel/recordOverflowModel.js +33 -0
  185. package/lib/model/featuresModel/scaleModel/scaleAxisRecalcer.d.ts +6 -6
  186. package/lib/model/featuresModel/scaleModel/scaleAxisRecalcer.js +23 -27
  187. package/lib/model/featuresModel/scaleModel/scaleDomainService.d.ts +5 -19
  188. package/lib/model/featuresModel/scaleModel/scaleDomainService.js +55 -44
  189. package/lib/model/featuresModel/scaleModel/scaleModel.d.ts +10 -10
  190. package/lib/model/featuresModel/scaleModel/scaleModel.js +50 -61
  191. package/lib/model/featuresModel/scaleModel/scaleModelServices.js +22 -15
  192. package/lib/model/featuresModel/titleModel.d.ts +1 -1
  193. package/lib/model/featuresModel/titleModel.js +14 -14
  194. package/lib/model/featuresModel/tooltipModel.d.ts +1 -1
  195. package/lib/model/featuresModel/tooltipModel.js +5 -5
  196. package/lib/model/featuresModel/valueLabelsModel/valueLabelsModel.d.ts +11 -23
  197. package/lib/model/featuresModel/valueLabelsModel/valueLabelsModel.js +51 -53
  198. package/lib/model/helpers/modelHelper.d.ts +7 -7
  199. package/lib/model/helpers/modelHelper.js +42 -38
  200. package/lib/model/helpers/twoDimensionalModelHelper.d.ts +9 -37
  201. package/lib/model/helpers/twoDimensionalModelHelper.js +125 -147
  202. package/lib/model/helpers/unitsFromConfigReader.js +4 -4
  203. package/lib/model/helpers/unitsReader.d.ts +2 -2
  204. package/lib/model/helpers/unitsReader.js +13 -11
  205. package/lib/model/margin/marginModel.d.ts +7 -7
  206. package/lib/model/margin/marginModel.js +20 -23
  207. package/lib/model/margin/twoDim/twoDimMarginModel.d.ts +13 -13
  208. package/lib/model/margin/twoDim/twoDimMarginModel.js +113 -184
  209. package/lib/model/model.d.ts +281 -315
  210. package/lib/model/model.js +4 -4
  211. package/lib/model/modelBuilder.d.ts +18 -27
  212. package/lib/model/modelBuilder.js +79 -85
  213. package/lib/model/modelInstance/canvasModel/canvasModel.d.ts +17 -17
  214. package/lib/model/modelInstance/canvasModel/canvasModel.js +43 -42
  215. package/lib/model/modelInstance/canvasModel/canvasSizesModel/canvasMarginModel.d.ts +7 -7
  216. package/lib/model/modelInstance/canvasModel/canvasSizesModel/canvasSizeModel.d.ts +2 -2
  217. package/lib/model/modelInstance/canvasModel/canvasSizesModel/marginModelService.d.ts +6 -6
  218. package/lib/model/modelInstance/canvasModel/canvasSizesModel/marginModelService.js +24 -24
  219. package/lib/model/modelInstance/canvasModel/legendCanvasModel.d.ts +4 -4
  220. package/lib/model/modelInstance/canvasModel/legendCanvasModel.js +11 -11
  221. package/lib/model/modelInstance/canvasModel/titleCanvas.d.ts +4 -4
  222. package/lib/model/modelInstance/canvasModel/titleCanvas.js +9 -9
  223. package/lib/model/modelInstance/chartBlockVersion/chartBlockVersion.d.ts +3 -3
  224. package/lib/model/modelInstance/chartBlockVersion/chartBlockVersion.js +6 -6
  225. package/lib/model/modelInstance/configReader.d.ts +23 -32
  226. package/lib/model/modelInstance/configReader.js +94 -125
  227. package/lib/model/modelInstance/dataModel/dataModel.d.ts +10 -10
  228. package/lib/model/modelInstance/dataModel/dataModel.js +25 -25
  229. package/lib/model/modelInstance/dataModel/dataRepository.d.ts +14 -14
  230. package/lib/model/modelInstance/dataModel/dataRepository.js +42 -42
  231. package/lib/model/modelInstance/modelInstance.d.ts +6 -11
  232. package/lib/model/modelInstance/modelInstance.js +16 -16
  233. package/lib/model/modelInstance/titleConfigReader.d.ts +8 -8
  234. package/lib/model/modelInstance/titleConfigReader.js +30 -37
  235. package/lib/model/notations/polar/donut/donutAggregatorService.d.ts +6 -9
  236. package/lib/model/notations/polar/donut/donutAggregatorService.js +37 -40
  237. package/lib/model/notations/polar/donut/donutModel.d.ts +5 -9
  238. package/lib/model/notations/polar/donut/donutModel.js +28 -28
  239. package/lib/model/notations/polar/donut/donutThicknessService.d.ts +3 -3
  240. package/lib/model/notations/polar/donut/donutThicknessService.js +15 -13
  241. package/lib/model/notations/polar/polarModel.d.ts +7 -18
  242. package/lib/model/notations/polar/polarModel.js +72 -79
  243. package/lib/model/notations/twoDimensional/styles.d.ts +7 -44
  244. package/lib/model/notations/twoDimensional/styles.js +125 -234
  245. package/lib/model/notations/twoDimensionalModel.d.ts +13 -23
  246. package/lib/model/notations/twoDimensionalModel.js +170 -330
  247. package/lib/optionsServices/publicOptionsService.d.ts +1 -1
  248. package/lib/optionsServices/publicOptionsService.js +4 -4
  249. package/lib/optionsServices/validators/sizeValidator.d.ts +2 -2
  250. package/lib/optionsServices/validators/sizeValidator.js +11 -10
  251. package/lib/style/charts-main.css +151 -150
  252. package/lib/style/charts-main.less +151 -150
  253. package/package.json +5 -5
  254. package/lib/engine/polarNotation/extenders/polarRecordOverflowAlert.d.ts +0 -15
  255. package/lib/engine/polarNotation/extenders/polarRecordOverflowAlert.js +0 -40
  256. package/lib/engine/twoDimensionalNotation/extenders/twoDimRecordOverflowAlert.d.ts +0 -15
  257. package/lib/engine/twoDimensionalNotation/extenders/twoDimRecordOverflowAlert.js +0 -32
@@ -1,40 +1,33 @@
1
1
  import { ModelHelper } from "../helpers/modelHelper";
2
2
  export class TitleConfigReader {
3
- constructor(config, dataGetter, defaultCssUnitReader) {
4
- this.config = config;
5
- this.dataGetter = dataGetter;
6
- this.defaultCssUnitReader = defaultCssUnitReader;
7
- }
8
- static create(config, modelInstance) {
9
- return new TitleConfigReader(
10
- config,
11
- () => modelInstance.dataModel.repository.getRawRows(),
12
- () => ModelHelper.getFontSizeCssValue("--chart-title-font-size", 16)
13
- );
14
- }
15
- getTextContent() {
16
- return this.getResolvedTitle();
17
- }
18
- getFontSize() {
19
- var _a;
20
- return typeof this.config === "object"
21
- ? (_a = this.config.fontSize) !== null && _a !== void 0
22
- ? _a
23
- : this.defaultCssUnitReader()
24
- : this.defaultCssUnitReader();
25
- }
26
- getResolvedTitle() {
27
- switch (typeof this.config) {
28
- case "string":
29
- return this.config;
30
- case "function":
31
- return this.config({ data: this.dataGetter() });
32
- case "object":
33
- return typeof this.config.text === "function"
34
- ? this.config.text({ data: this.dataGetter() })
35
- : this.config.text;
36
- default:
37
- return "";
38
- }
39
- }
3
+ constructor(config, dataGetter, defaultCssUnitReader) {
4
+ this.config = config;
5
+ this.dataGetter = dataGetter;
6
+ this.defaultCssUnitReader = defaultCssUnitReader;
7
+ }
8
+ static create(config, modelInstance) {
9
+ return new TitleConfigReader(config, () => modelInstance.dataModel.repository.getRawRows(), () => ModelHelper.getFontSizeCssValue("--chart-title-font-size", 16));
10
+ }
11
+ getTextContent() {
12
+ return this.getResolvedTitle();
13
+ }
14
+ getFontSize() {
15
+ var _a;
16
+ return typeof this.config === "object"
17
+ ? (_a = this.config.fontSize) !== null && _a !== void 0 ? _a : this.defaultCssUnitReader() : this.defaultCssUnitReader();
18
+ }
19
+ getResolvedTitle() {
20
+ switch (typeof this.config) {
21
+ case "string":
22
+ return this.config;
23
+ case "function":
24
+ return this.config({ data: this.dataGetter() });
25
+ case "object":
26
+ return typeof this.config.text === "function"
27
+ ? this.config.text({ data: this.dataGetter() })
28
+ : this.config.text;
29
+ default:
30
+ return "";
31
+ }
32
+ }
40
33
  }
@@ -2,15 +2,12 @@ import { MdtChartsDataRow, MdtChartsDonutAggregator } from "../../../../config/c
2
2
  import { DonutAggregatorContent } from "../../../model";
3
3
  export declare const AGGREGATOR_DEFAULT_TITLE = "\u0421\u0443\u043C\u043C\u0430";
4
4
  export interface AggregatorServiceDataOptions {
5
- rows: MdtChartsDataRow[];
6
- valueFieldName: string;
5
+ rows: MdtChartsDataRow[];
6
+ valueFieldName: string;
7
7
  }
8
8
  export declare class DonutAggregatorService {
9
- getContent(
10
- aggregatorOptions: MdtChartsDonutAggregator,
11
- dataOptions: AggregatorServiceDataOptions
12
- ): DonutAggregatorContent;
13
- private doesValueExist;
14
- private generateDefaultContent;
15
- private getDefaultValue;
9
+ getContent(aggregatorOptions: MdtChartsDonutAggregator, dataOptions: AggregatorServiceDataOptions): DonutAggregatorContent;
10
+ private doesValueExist;
11
+ private generateDefaultContent;
12
+ private getDefaultValue;
16
13
  }
@@ -1,43 +1,40 @@
1
1
  export const AGGREGATOR_DEFAULT_TITLE = "Сумма";
2
2
  export class DonutAggregatorService {
3
- getContent(aggregatorOptions, dataOptions) {
4
- if (
5
- !(aggregatorOptions === null || aggregatorOptions === void 0 ? void 0 : aggregatorOptions.content) ||
6
- !dataOptions.rows
7
- )
8
- return this.generateDefaultContent(dataOptions);
9
- const content = aggregatorOptions.content({ data: dataOptions.rows });
10
- if (!content || (!this.doesValueExist(content.value) && !content.title))
11
- return this.generateDefaultContent(dataOptions);
12
- if (this.doesValueExist(content.value) && content.title) {
13
- return {
14
- title: content.title,
15
- value: content.value
16
- };
17
- }
18
- if (!content.title && this.doesValueExist(content.value))
19
- return {
20
- value: content.value,
21
- title: AGGREGATOR_DEFAULT_TITLE
22
- };
23
- if (!this.doesValueExist(content.value) && content.title) {
24
- return {
25
- value: this.getDefaultValue(dataOptions),
26
- title: content.title
27
- };
28
- }
29
- }
30
- doesValueExist(content) {
31
- return content != null;
32
- }
33
- generateDefaultContent(dataOptions) {
34
- return {
35
- title: AGGREGATOR_DEFAULT_TITLE,
36
- value: dataOptions.rows ? this.getDefaultValue(dataOptions) : 0
37
- };
38
- }
39
- getDefaultValue(dataOptions) {
40
- const totalSumOfValues = dataOptions.rows.reduce((acc, row) => acc + row[dataOptions.valueFieldName], 0);
41
- return totalSumOfValues;
42
- }
3
+ getContent(aggregatorOptions, dataOptions) {
4
+ if (!(aggregatorOptions === null || aggregatorOptions === void 0 ? void 0 : aggregatorOptions.content) || !dataOptions.rows)
5
+ return this.generateDefaultContent(dataOptions);
6
+ const content = aggregatorOptions.content({ data: dataOptions.rows });
7
+ if (!content || (!this.doesValueExist(content.value) && !content.title))
8
+ return this.generateDefaultContent(dataOptions);
9
+ if (this.doesValueExist(content.value) && content.title) {
10
+ return {
11
+ title: content.title,
12
+ value: content.value
13
+ };
14
+ }
15
+ if (!content.title && this.doesValueExist(content.value))
16
+ return {
17
+ value: content.value,
18
+ title: AGGREGATOR_DEFAULT_TITLE
19
+ };
20
+ if (!this.doesValueExist(content.value) && content.title) {
21
+ return {
22
+ value: this.getDefaultValue(dataOptions),
23
+ title: content.title
24
+ };
25
+ }
26
+ }
27
+ doesValueExist(content) {
28
+ return content != null;
29
+ }
30
+ generateDefaultContent(dataOptions) {
31
+ return {
32
+ title: AGGREGATOR_DEFAULT_TITLE,
33
+ value: dataOptions.rows ? this.getDefaultValue(dataOptions) : 0
34
+ };
35
+ }
36
+ getDefaultValue(dataOptions) {
37
+ const totalSumOfValues = dataOptions.rows.reduce((acc, row) => acc + row[dataOptions.valueFieldName], 0);
38
+ return totalSumOfValues;
39
+ }
43
40
  }
@@ -2,13 +2,9 @@ import { MdtChartsDataRow, PolarChart } from "../../../../config/config";
2
2
  import { DonutOptionsCanvas } from "../../../../designer/designerConfig";
3
3
  import { DonutChartSettings } from "../../../model";
4
4
  export declare class DonutModel {
5
- private thicknessService;
6
- private aggregatorService;
7
- getSettings(
8
- settingsFromConfig: DonutOptionsCanvas,
9
- chartOptions: PolarChart,
10
- rawDataRows: MdtChartsDataRow[]
11
- ): DonutChartSettings;
12
- private getThicknessOptions;
13
- private getAggregatorOptions;
5
+ private thicknessService;
6
+ private aggregatorService;
7
+ getSettings(settingsFromConfig: DonutOptionsCanvas, chartOptions: PolarChart, rawDataRows: MdtChartsDataRow[]): DonutChartSettings;
8
+ private getThicknessOptions;
9
+ private getAggregatorOptions;
14
10
  }
@@ -1,32 +1,32 @@
1
1
  import { DonutAggregatorService } from "./donutAggregatorService";
2
2
  import { DonutThicknessService } from "./donutThicknessService";
3
3
  export class DonutModel {
4
- constructor() {
5
- this.thicknessService = new DonutThicknessService();
6
- this.aggregatorService = new DonutAggregatorService();
7
- }
8
- getSettings(settingsFromConfig, chartOptions, rawDataRows) {
9
- return {
10
- padAngle: settingsFromConfig.padAngle,
11
- thickness: this.getThicknessOptions(settingsFromConfig.thickness),
12
- aggregator: this.getAggregatorOptions(settingsFromConfig, chartOptions, rawDataRows)
13
- };
14
- }
15
- getThicknessOptions(settingsFromConfig) {
16
- return {
17
- unit: this.thicknessService.getUnit(settingsFromConfig),
18
- max: this.thicknessService.valueToNumber(settingsFromConfig.max),
19
- min: this.thicknessService.valueToNumber(settingsFromConfig.min),
20
- value: this.thicknessService.valueToNumber(settingsFromConfig.value)
21
- };
22
- }
23
- getAggregatorOptions(settingsFromConfig, chartOptions, rawDataRows) {
24
- return {
25
- margin: settingsFromConfig.aggregatorPad,
26
- content: this.aggregatorService.getContent(chartOptions.aggregator, {
27
- rows: rawDataRows,
28
- valueFieldName: chartOptions.data.valueField.name
29
- })
30
- };
31
- }
4
+ constructor() {
5
+ this.thicknessService = new DonutThicknessService();
6
+ this.aggregatorService = new DonutAggregatorService();
7
+ }
8
+ getSettings(settingsFromConfig, chartOptions, rawDataRows) {
9
+ return {
10
+ padAngle: settingsFromConfig.padAngle,
11
+ thickness: this.getThicknessOptions(settingsFromConfig.thickness),
12
+ aggregator: this.getAggregatorOptions(settingsFromConfig, chartOptions, rawDataRows)
13
+ };
14
+ }
15
+ getThicknessOptions(settingsFromConfig) {
16
+ return {
17
+ unit: this.thicknessService.getUnit(settingsFromConfig),
18
+ max: this.thicknessService.valueToNumber(settingsFromConfig.max),
19
+ min: this.thicknessService.valueToNumber(settingsFromConfig.min),
20
+ value: this.thicknessService.valueToNumber(settingsFromConfig.value)
21
+ };
22
+ }
23
+ getAggregatorOptions(settingsFromConfig, chartOptions, rawDataRows) {
24
+ return {
25
+ margin: settingsFromConfig.aggregatorPad,
26
+ content: this.aggregatorService.getContent(chartOptions.aggregator, {
27
+ rows: rawDataRows,
28
+ valueFieldName: chartOptions.data.valueField.name
29
+ })
30
+ };
31
+ }
32
32
  }
@@ -1,7 +1,7 @@
1
1
  import { MdtChartsDonutThicknessOptions } from "../../../../designer/designerConfig";
2
2
  import { DonutThicknessUnit } from "../../../model";
3
3
  export declare class DonutThicknessService {
4
- private defaultUnit;
5
- getUnit(settingsFromConfig: MdtChartsDonutThicknessOptions): DonutThicknessUnit;
6
- valueToNumber(value: string | number): number;
4
+ private defaultUnit;
5
+ getUnit(settingsFromConfig: MdtChartsDonutThicknessOptions): DonutThicknessUnit;
6
+ valueToNumber(value: string | number): number;
7
7
  }
@@ -1,16 +1,18 @@
1
1
  import { getPxPercentUnitByValue } from "../../../helpers/unitsFromConfigReader";
2
2
  export class DonutThicknessService {
3
- constructor() {
4
- this.defaultUnit = "px";
5
- }
6
- getUnit(settingsFromConfig) {
7
- if (settingsFromConfig.value) return getPxPercentUnitByValue(settingsFromConfig.value);
8
- const minUnit = getPxPercentUnitByValue(settingsFromConfig.min);
9
- const maxUnit = getPxPercentUnitByValue(settingsFromConfig.max);
10
- return minUnit === maxUnit ? minUnit : this.defaultUnit;
11
- }
12
- valueToNumber(value) {
13
- if (typeof value === "number") return value;
14
- return parseInt(value);
15
- }
3
+ constructor() {
4
+ this.defaultUnit = "px";
5
+ }
6
+ getUnit(settingsFromConfig) {
7
+ if (settingsFromConfig.value)
8
+ return getPxPercentUnitByValue(settingsFromConfig.value);
9
+ const minUnit = getPxPercentUnitByValue(settingsFromConfig.min);
10
+ const maxUnit = getPxPercentUnitByValue(settingsFromConfig.max);
11
+ return minUnit === maxUnit ? minUnit : this.defaultUnit;
12
+ }
13
+ valueToNumber(value) {
14
+ if (typeof value === "number")
15
+ return value;
16
+ return parseInt(value);
17
+ }
16
18
  }
@@ -5,22 +5,11 @@ import { CanvasModel } from "../../modelInstance/canvasModel/canvasModel";
5
5
  import { ModelInstance } from "../../modelInstance/modelInstance";
6
6
  export declare const MIN_DONUT_BLOCK_SIZE = 120;
7
7
  export declare class PolarModel {
8
- private static donutModel;
9
- static getOptions(
10
- options: MdtChartsPolarOptions,
11
- designerConfig: DesignerConfig,
12
- modelInstance: ModelInstance
13
- ): PolarOptionsModel;
14
- static getLegendPositionByBlockSize(canvasModel: CanvasModel): "bottom" | "right";
15
- static doesChartBlockHasEnoughWidthForContainsLegend(
16
- chartBlockWidth: number,
17
- legendWidth: number,
18
- legendCoordinate: LegendCoordinate
19
- ): boolean;
20
- static doesChartBlockHasEnoughHeightForContainsLegend(
21
- chartBlockHeight: number,
22
- legendCoordinate: LegendCoordinate
23
- ): boolean;
24
- private static getDonutSettings;
25
- private static getChartsModel;
8
+ private static donutModel;
9
+ static getOptions(options: MdtChartsPolarOptions, designerConfig: DesignerConfig, modelInstance: ModelInstance): PolarOptionsModel;
10
+ static getLegendPositionByBlockSize(canvasModel: CanvasModel): "bottom" | "right";
11
+ static doesChartBlockHasEnoughWidthForContainsLegend(chartBlockWidth: number, legendWidth: number, legendCoordinate: LegendCoordinate): boolean;
12
+ static doesChartBlockHasEnoughHeightForContainsLegend(chartBlockHeight: number, legendCoordinate: LegendCoordinate): boolean;
13
+ private static getDonutSettings;
14
+ private static getChartsModel;
26
15
  }
@@ -1,86 +1,79 @@
1
1
  import { ChartStyleModelService } from "../../chartStyleModel/chartStyleModel";
2
2
  import { DonutModel } from "./donut/donutModel";
3
3
  import { TitleConfigReader } from "../../modelInstance/titleConfigReader";
4
+ import { createRecordOverflowModel } from "../../featuresModel/recordOverflowModel/recordOverflowModel";
4
5
  export const MIN_DONUT_BLOCK_SIZE = 120;
5
6
  export class PolarModel {
6
- static getOptions(options, designerConfig, modelInstance) {
7
- const titleConfig = TitleConfigReader.create(options.title, modelInstance);
8
- return {
9
- type: options.type,
10
- selectable: !!options.selectable,
11
- title: {
12
- textContent: titleConfig.getTextContent(),
13
- fontSize: titleConfig.getFontSize()
14
- },
15
- data: Object.assign({}, options.data),
16
- charts: this.getChartsModel(
17
- options.chart,
18
- modelInstance.dataModel.repository.getScopedRows().length,
19
- designerConfig.chartStyle
20
- ),
21
- legend: modelInstance.canvasModel.legendCanvas.getModel(),
22
- tooltip: options.tooltip,
23
- chartCanvas: this.getDonutSettings(
24
- designerConfig.canvas.chartOptions.donut,
25
- options.chart,
26
- modelInstance.dataModel.repository.getRawRows()
27
- ),
28
- defs: { gradients: [] }
29
- };
30
- }
31
- //TODO: type for returned value
32
- static getLegendPositionByBlockSize(canvasModel) {
33
- const widthCoefficientWhenLegendShouldInBottom = 1.5;
34
- const avgLegendWidth = 100;
35
- const blockWidth = canvasModel.getBlockSize().width;
36
- const blockHeight = canvasModel.getBlockSize().height;
37
- return canvasModel.getChartBlockWidth() < MIN_DONUT_BLOCK_SIZE + avgLegendWidth &&
38
- blockWidth * widthCoefficientWhenLegendShouldInBottom < blockHeight
39
- ? "bottom"
40
- : "right";
41
- }
42
- static doesChartBlockHasEnoughWidthForContainsLegend(chartBlockWidth, legendWidth, legendCoordinate) {
43
- const rightLegendMargin = legendCoordinate.right.margin;
44
- return chartBlockWidth - legendWidth - rightLegendMargin.left - rightLegendMargin.right >= MIN_DONUT_BLOCK_SIZE;
45
- }
46
- static doesChartBlockHasEnoughHeightForContainsLegend(chartBlockHeight, legendCoordinate) {
47
- const minHeightForLegend = 30;
48
- const bottomLegendMargin = legendCoordinate.bottom.margin;
49
- const heightForLegend =
50
- chartBlockHeight - bottomLegendMargin.bottom - bottomLegendMargin.top - MIN_DONUT_BLOCK_SIZE;
51
- return heightForLegend >= minHeightForLegend;
52
- }
53
- static getDonutSettings(settings, chartOptions, dataRows) {
54
- return this.donutModel.getSettings(settings, chartOptions, dataRows);
55
- }
56
- static getChartsModel(chart, dataLength, chartStyleConfig) {
57
- const chartsModel = [];
58
- chartsModel.push({
59
- type: chart.type,
60
- data: Object.assign({}, chart.data),
61
- tooltip: { show: true },
62
- cssClasses: ChartStyleModelService.getCssClasses(0),
63
- style: ChartStyleModelService.getChartStyle(dataLength, chartStyleConfig),
64
- legend: {
65
- markerShape: "default",
66
- barViewOptions: {
67
- hatch: { on: false },
68
- borderRadius: {
69
- topLeft: 0,
70
- topRight: 0,
71
- bottomLeft: 0,
72
- bottomRight: 0
73
- },
74
- width: 0
75
- },
76
- lineViewOptions: {
77
- dashedStyles: { on: false, dashSize: 0, gapSize: 0 },
78
- strokeWidth: 0,
79
- length: 0
80
- }
81
- }
82
- });
83
- return chartsModel;
84
- }
7
+ static getOptions(options, designerConfig, modelInstance) {
8
+ const titleConfig = TitleConfigReader.create(options.title, modelInstance);
9
+ return {
10
+ type: options.type,
11
+ selectable: !!options.selectable,
12
+ title: {
13
+ textContent: titleConfig.getTextContent(),
14
+ fontSize: titleConfig.getFontSize()
15
+ },
16
+ data: Object.assign({}, options.data),
17
+ charts: this.getChartsModel(options.chart, modelInstance.dataModel.repository.getScopedRows().length, designerConfig.chartStyle),
18
+ legend: modelInstance.canvasModel.legendCanvas.getModel(),
19
+ tooltip: options.tooltip,
20
+ chartCanvas: this.getDonutSettings(designerConfig.canvas.chartOptions.donut, options.chart, modelInstance.dataModel.repository.getRawRows()),
21
+ defs: { gradients: [] },
22
+ recordOverflowAlert: createRecordOverflowModel(modelInstance.dataModel.getScope().hidedRecordsAmount, {
23
+ one: "категория",
24
+ twoToFour: "категории",
25
+ tenToTwenty: "категорий",
26
+ other: "категорий"
27
+ }, options.recordOverflowAlert)
28
+ };
29
+ }
30
+ //TODO: type for returned value
31
+ static getLegendPositionByBlockSize(canvasModel) {
32
+ const widthCoefficientWhenLegendShouldInBottom = 1.5;
33
+ const avgLegendWidth = 100;
34
+ const blockWidth = canvasModel.getBlockSize().width;
35
+ const blockHeight = canvasModel.getBlockSize().height;
36
+ return canvasModel.getChartBlockWidth() < MIN_DONUT_BLOCK_SIZE + avgLegendWidth &&
37
+ blockWidth * widthCoefficientWhenLegendShouldInBottom < blockHeight
38
+ ? "bottom"
39
+ : "right";
40
+ }
41
+ static doesChartBlockHasEnoughWidthForContainsLegend(chartBlockWidth, legendWidth, legendCoordinate) {
42
+ const rightLegendMargin = legendCoordinate.right.margin;
43
+ return chartBlockWidth - legendWidth - rightLegendMargin.left - rightLegendMargin.right >= MIN_DONUT_BLOCK_SIZE;
44
+ }
45
+ static doesChartBlockHasEnoughHeightForContainsLegend(chartBlockHeight, legendCoordinate) {
46
+ const minHeightForLegend = 30;
47
+ const bottomLegendMargin = legendCoordinate.bottom.margin;
48
+ const heightForLegend = chartBlockHeight - bottomLegendMargin.bottom - bottomLegendMargin.top - MIN_DONUT_BLOCK_SIZE;
49
+ return heightForLegend >= minHeightForLegend;
50
+ }
51
+ static getDonutSettings(settings, chartOptions, dataRows) {
52
+ return this.donutModel.getSettings(settings, chartOptions, dataRows);
53
+ }
54
+ static getChartsModel(chart, dataLength, chartStyleConfig) {
55
+ const chartsModel = [];
56
+ chartsModel.push({
57
+ type: chart.type,
58
+ data: Object.assign({}, chart.data),
59
+ tooltip: { show: true },
60
+ cssClasses: ChartStyleModelService.getCssClasses(0),
61
+ style: ChartStyleModelService.getChartStyle(dataLength, chartStyleConfig),
62
+ legend: {
63
+ markerShape: "default",
64
+ barViewOptions: {
65
+ hatch: { on: false },
66
+ borderRadius: { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0 },
67
+ width: 0
68
+ },
69
+ lineViewOptions: {
70
+ dashedStyles: { on: false, dashSize: 0, gapSize: 0 },
71
+ strokeWidth: 0,
72
+ length: 0
73
+ }
74
+ }
75
+ });
76
+ return chartsModel;
77
+ }
85
78
  }
86
79
  PolarModel.donutModel = new DonutModel();
@@ -1,51 +1,14 @@
1
- import {
2
- AreaChartViewOptions,
3
- BarBorderRadius,
4
- ChartLegendModel,
5
- ChartStyle,
6
- GradientId,
7
- LineLikeChartDashOptions,
8
- LineLikeChartShapeOptions,
9
- Orient,
10
- TwoDimensionalBarLikeChartViewModel,
11
- TwoDimensionalChartLegendLineModel
12
- } from "../../model";
13
- import {
14
- ChartOrientation,
15
- MdtChartsLineLikeChartDashedStyles,
16
- MdtChartsTwoDimensionalChart,
17
- TwoDimensionalChartType
18
- } from "../../../config/config";
1
+ import { AreaChartViewOptions, BarBorderRadius, ChartLegendModel, ChartStyle, GradientId, LineLikeChartDashOptions, LineLikeChartShapeOptions, Orient, TwoDimensionalBarLikeChartViewModel, TwoDimensionalChartLegendLineModel } from "../../model";
2
+ import { ChartOrientation, MdtChartsLineLikeChartDashedStyles, MdtChartsTwoDimensionalChart, TwoDimensionalChartType } from "../../../config/config";
19
3
  import { MdtChartsLineLikeChartShape } from "../../../designer/designerConfig";
20
4
  export declare const LINE_CHART_DEFAULT_WIDTH = 2;
21
- export declare function parseShape(
22
- chartOrientation: ChartOrientation,
23
- configOptions?: MdtChartsLineLikeChartShape
24
- ): LineLikeChartShapeOptions;
5
+ export declare function parseShape(chartOrientation: ChartOrientation, configOptions?: MdtChartsLineLikeChartShape): LineLikeChartShapeOptions;
25
6
  export declare function parseDashStyles(configOptions?: MdtChartsLineLikeChartDashedStyles): LineLikeChartDashOptions;
26
- export declare function getBarViewOptions(
27
- chart: MdtChartsTwoDimensionalChart,
28
- keyAxisOrient: Orient,
29
- barIndexes: number[]
30
- ): TwoDimensionalBarLikeChartViewModel;
31
- export declare function calculateBarIndexes(
32
- allCharts: Pick<MdtChartsTwoDimensionalChart, "isSegmented" | "data" | "type">[],
33
- currentChart: Pick<MdtChartsTwoDimensionalChart, "isSegmented" | "data" | "type">,
34
- currentChartIndex: number
35
- ): number[];
36
- export declare function getSegmentedRadiusValues(
37
- segmentsLength: number,
38
- segmentIndex: number,
39
- keyAxisOrient: Orient,
40
- defaultRadius: number
41
- ): BarBorderRadius;
7
+ export declare function getBarViewOptions(chart: MdtChartsTwoDimensionalChart, keyAxisOrient: Orient, barIndexes: number[]): TwoDimensionalBarLikeChartViewModel;
8
+ export declare function calculateBarIndexes(allCharts: Pick<MdtChartsTwoDimensionalChart, "isSegmented" | "data" | "type">[], currentChart: Pick<MdtChartsTwoDimensionalChart, "isSegmented" | "data" | "type">, currentChartIndex: number): number[];
9
+ export declare function getSegmentedRadiusValues(segmentsLength: number, segmentIndex: number, keyAxisOrient: Orient, defaultRadius: number): BarBorderRadius;
42
10
  export declare function getLegendMarkerOptions(chart: MdtChartsTwoDimensionalChart): ChartLegendModel;
43
11
  export declare function getLineViewOptions(chart: MdtChartsTwoDimensionalChart): TwoDimensionalChartLegendLineModel;
44
12
  export declare function getWidthOfLegendMarkerByType(chartType: TwoDimensionalChartType): number;
45
- export declare function getAreaViewOptions(
46
- chart: MdtChartsTwoDimensionalChart,
47
- chartIndex: number,
48
- style: ChartStyle,
49
- chartBlockId: number
50
- ): AreaChartViewOptions;
13
+ export declare function getAreaViewOptions(chart: MdtChartsTwoDimensionalChart, chartIndex: number, style: ChartStyle, chartBlockId: number): AreaChartViewOptions;
51
14
  export declare function getGradientId(chartIndex: number, subIndex: number, chartBlockId: number): GradientId;