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
|
@@ -7,139 +7,118 @@ import { BarHelper, DotChartSettingsStore } from "../bar/barHelper";
|
|
|
7
7
|
* @alpha experimental feature. Need to refactor.
|
|
8
8
|
*/
|
|
9
9
|
export class CanvasDotChart {
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
if (this.options.canvas.keyAxisOrient === "bottom") {
|
|
126
|
-
attrs.y1 = (d) => scales.value(Math.max(d[field.name], 0)) + margin.top;
|
|
127
|
-
attrs.y2 = (d) => scales.value(Math.max(d[field.name], 0)) + margin.top;
|
|
128
|
-
}
|
|
129
|
-
if (this.options.canvas.keyAxisOrient === "left") {
|
|
130
|
-
attrs.x1 = (d) =>
|
|
131
|
-
scales.value(Math.min(d[field.name], 0)) +
|
|
132
|
-
margin.left +
|
|
133
|
-
BarHelper.getBandItemValueStretch(scales.value, field.name)(d);
|
|
134
|
-
attrs.x2 = (d) =>
|
|
135
|
-
scales.value(Math.min(d[field.name], 0)) +
|
|
136
|
-
margin.left +
|
|
137
|
-
BarHelper.getBandItemValueStretch(scales.value, field.name)(d);
|
|
138
|
-
}
|
|
139
|
-
if (this.options.canvas.keyAxisOrient === "right") {
|
|
140
|
-
attrs.x1 = (d) => scales.value(Math.max(d[field.name], 0)) + margin.left;
|
|
141
|
-
attrs.x2 = (d) => scales.value(Math.max(d[field.name], 0)) + margin.left;
|
|
142
|
-
}
|
|
143
|
-
return attrs;
|
|
144
|
-
}
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.options = options;
|
|
12
|
+
this.dotChartItemClass = NamesHelper.getClassName("dot-chart-item");
|
|
13
|
+
this.renderedChart = undefined;
|
|
14
|
+
}
|
|
15
|
+
render(scales, chart, records, margin) {
|
|
16
|
+
if (this.renderedChart)
|
|
17
|
+
return;
|
|
18
|
+
const valueFieldIndex = 0;
|
|
19
|
+
const elements = this.options.elementAccessors
|
|
20
|
+
.getBlock()
|
|
21
|
+
.svg.getChartGroup(chart.index)
|
|
22
|
+
.selectAll(`.${this.dotChartItemClass}${Helper.getCssClassesLine(chart.cssClasses)}${Helper.getCssClassesLine(Helper.getCssClassesWithElementIndex(chart.cssClasses, valueFieldIndex))}`)
|
|
23
|
+
.data(records)
|
|
24
|
+
.enter()
|
|
25
|
+
.append("line")
|
|
26
|
+
.style("stroke-width", chart.dotViewOptions.shape.width)
|
|
27
|
+
.attr("class", this.dotChartItemClass);
|
|
28
|
+
const attrs = this.getAttrs(scales, chart, chart.data.valueFields[0], margin);
|
|
29
|
+
elements
|
|
30
|
+
.attr("x1", (d) => attrs.x1(d))
|
|
31
|
+
.attr("y1", (d) => attrs.y1(d))
|
|
32
|
+
.attr("x2", (d) => attrs.x2(d))
|
|
33
|
+
.attr("y2", (d) => attrs.y2(d));
|
|
34
|
+
DomHelper.setCssClasses(elements, Helper.getCssClassesWithElementIndex(chart.cssClasses, valueFieldIndex));
|
|
35
|
+
DomHelper.setChartStyle(elements, chart.style, valueFieldIndex, "stroke");
|
|
36
|
+
this.renderedChart = chart;
|
|
37
|
+
}
|
|
38
|
+
update(scales, newRecords, margin) {
|
|
39
|
+
if (!this.renderedChart)
|
|
40
|
+
return;
|
|
41
|
+
const valueFieldIndex = 0;
|
|
42
|
+
const elements = this.options.elementAccessors
|
|
43
|
+
.getBlock()
|
|
44
|
+
.svg.getChartGroup(this.renderedChart.index)
|
|
45
|
+
.selectAll(`.${this.dotChartItemClass}${Helper.getCssClassesLine(this.renderedChart.cssClasses)}${Helper.getCssClassesLine(Helper.getCssClassesWithElementIndex(this.renderedChart.cssClasses, valueFieldIndex))}`)
|
|
46
|
+
.data(newRecords);
|
|
47
|
+
elements.exit().remove();
|
|
48
|
+
const newElements = elements
|
|
49
|
+
.enter()
|
|
50
|
+
.append("line")
|
|
51
|
+
.style("stroke-width", this.renderedChart.dotViewOptions.shape.width)
|
|
52
|
+
.attr("class", this.dotChartItemClass);
|
|
53
|
+
const attrs = this.getAttrs(scales, this.renderedChart, this.renderedChart.data.valueFields[0], margin);
|
|
54
|
+
newElements
|
|
55
|
+
.attr("x1", (d) => attrs.x1(d))
|
|
56
|
+
.attr("y1", (d) => attrs.y1(d))
|
|
57
|
+
.attr("x2", (d) => attrs.x2(d))
|
|
58
|
+
.attr("y2", (d) => attrs.y2(d));
|
|
59
|
+
DomHelper.setCssClasses(newElements, Helper.getCssClassesWithElementIndex(this.renderedChart.cssClasses, valueFieldIndex));
|
|
60
|
+
DomHelper.setChartStyle(newElements, this.renderedChart.style, valueFieldIndex, "stroke");
|
|
61
|
+
return [
|
|
62
|
+
new Promise((resolve) => {
|
|
63
|
+
elements
|
|
64
|
+
.interrupt()
|
|
65
|
+
.transition()
|
|
66
|
+
.duration(this.options.elementAccessors.getBlock().transitionManager.durations.chartUpdate)
|
|
67
|
+
.attr("x1", (d) => attrs.x1(d))
|
|
68
|
+
.attr("y1", (d) => attrs.y1(d))
|
|
69
|
+
.attr("x2", (d) => attrs.x2(d))
|
|
70
|
+
.attr("y2", (d) => attrs.y2(d))
|
|
71
|
+
.on("end", () => resolve());
|
|
72
|
+
})
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
getAttrs(scales, chart, field, margin) {
|
|
76
|
+
const attrs = {
|
|
77
|
+
x1: null,
|
|
78
|
+
y1: null,
|
|
79
|
+
x2: null,
|
|
80
|
+
y2: null
|
|
81
|
+
};
|
|
82
|
+
const settingsStore = new DotChartSettingsStore({ scaleBandWidth: Scale.getScaleBandWidth(scales.key) });
|
|
83
|
+
// TODO: refactor
|
|
84
|
+
if (this.options.canvas.keyAxisOrient === "top" || this.options.canvas.keyAxisOrient === "bottom") {
|
|
85
|
+
const handleBase = (d) => scales.key(Helper.getKeyFieldValue(d, this.options.dataOptions.keyFieldName, false)) +
|
|
86
|
+
margin.left +
|
|
87
|
+
settingsStore.getBandItemPad();
|
|
88
|
+
attrs.x1 = (d) => chart.dotViewOptions.shape.handleStartCoordinate(handleBase(d));
|
|
89
|
+
attrs.x2 = (d) => chart.dotViewOptions.shape.handleEndCoordinate(handleBase(d) + settingsStore.getBandItemSize());
|
|
90
|
+
}
|
|
91
|
+
if (this.options.canvas.keyAxisOrient === "left" || this.options.canvas.keyAxisOrient === "right") {
|
|
92
|
+
const handleBase = (d) => scales.key(Helper.getKeyFieldValue(d, this.options.dataOptions.keyFieldName, false)) +
|
|
93
|
+
margin.top +
|
|
94
|
+
settingsStore.getBandItemPad();
|
|
95
|
+
attrs.y1 = (d) => chart.dotViewOptions.shape.handleStartCoordinate(handleBase(d));
|
|
96
|
+
attrs.y2 = (d) => chart.dotViewOptions.shape.handleEndCoordinate(handleBase(d) + settingsStore.getBandItemSize());
|
|
97
|
+
}
|
|
98
|
+
if (this.options.canvas.keyAxisOrient === "top") {
|
|
99
|
+
attrs.y1 = (d) => scales.value(Math.min(d[field.name], 0)) +
|
|
100
|
+
margin.top +
|
|
101
|
+
BarHelper.getBandItemValueStretch(scales.value, field.name)(d);
|
|
102
|
+
attrs.y2 = (d) => scales.value(Math.min(d[field.name], 0)) +
|
|
103
|
+
margin.top +
|
|
104
|
+
BarHelper.getBandItemValueStretch(scales.value, field.name)(d);
|
|
105
|
+
}
|
|
106
|
+
if (this.options.canvas.keyAxisOrient === "bottom") {
|
|
107
|
+
attrs.y1 = (d) => scales.value(Math.max(d[field.name], 0)) + margin.top;
|
|
108
|
+
attrs.y2 = (d) => scales.value(Math.max(d[field.name], 0)) + margin.top;
|
|
109
|
+
}
|
|
110
|
+
if (this.options.canvas.keyAxisOrient === "left") {
|
|
111
|
+
attrs.x1 = (d) => scales.value(Math.min(d[field.name], 0)) +
|
|
112
|
+
margin.left +
|
|
113
|
+
BarHelper.getBandItemValueStretch(scales.value, field.name)(d);
|
|
114
|
+
attrs.x2 = (d) => scales.value(Math.min(d[field.name], 0)) +
|
|
115
|
+
margin.left +
|
|
116
|
+
BarHelper.getBandItemValueStretch(scales.value, field.name)(d);
|
|
117
|
+
}
|
|
118
|
+
if (this.options.canvas.keyAxisOrient === "right") {
|
|
119
|
+
attrs.x1 = (d) => scales.value(Math.max(d[field.name], 0)) + margin.left;
|
|
120
|
+
attrs.x2 = (d) => scales.value(Math.max(d[field.name], 0)) + margin.left;
|
|
121
|
+
}
|
|
122
|
+
return attrs;
|
|
123
|
+
}
|
|
145
124
|
}
|
|
@@ -6,44 +6,23 @@ import { Block } from "../../block/block";
|
|
|
6
6
|
import { MdtChartsDataRow } from "../../../config/config";
|
|
7
7
|
import { Pipeline } from "../../helpers/pipeline/Pipeline";
|
|
8
8
|
interface LineChartOptions {
|
|
9
|
-
|
|
9
|
+
staticSettings: LineLikeChartSettings;
|
|
10
10
|
}
|
|
11
11
|
export declare class Line {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
update(
|
|
28
|
-
block: Block,
|
|
29
|
-
scales: Scales,
|
|
30
|
-
newData: MdtChartsDataRow[],
|
|
31
|
-
keyField: Field,
|
|
32
|
-
margin: BlockMargin,
|
|
33
|
-
keyAxisOrient: Orient,
|
|
34
|
-
chart: TwoDimensionalChartModel
|
|
35
|
-
): Promise<any>[];
|
|
36
|
-
updateColors(block: Block, chart: TwoDimensionalChartModel): void;
|
|
37
|
-
private renderGrouped;
|
|
38
|
-
private renderSegmented;
|
|
39
|
-
private updateGrouped;
|
|
40
|
-
private updateSegmented;
|
|
41
|
-
static updateGroupedPath(
|
|
42
|
-
block: Block,
|
|
43
|
-
lineObject: Selection<BaseType, any, BaseType, any>,
|
|
44
|
-
lineGenerator: ILine<MdtChartsDataRow>,
|
|
45
|
-
newData: MdtChartsDataRow[]
|
|
46
|
-
): Promise<any>;
|
|
47
|
-
private createLineGeneratorFactory;
|
|
12
|
+
private options;
|
|
13
|
+
static readonly lineChartClass = "line";
|
|
14
|
+
readonly creatingPipeline: Pipeline<Selection<SVGPathElement, any, BaseType, any>, TwoDimensionalChartModel>;
|
|
15
|
+
private readonly lineChartClass;
|
|
16
|
+
static get(options: LineChartOptions): Line;
|
|
17
|
+
constructor(options: LineChartOptions);
|
|
18
|
+
render(block: Block, scales: Scales, data: MdtChartsDataRow[], keyField: Field, margin: BlockMargin, keyAxisOrient: Orient, chart: TwoDimensionalChartModel): void;
|
|
19
|
+
update(block: Block, scales: Scales, newData: MdtChartsDataRow[], keyField: Field, margin: BlockMargin, keyAxisOrient: Orient, chart: TwoDimensionalChartModel): Promise<any>[];
|
|
20
|
+
updateColors(block: Block, chart: TwoDimensionalChartModel): void;
|
|
21
|
+
private renderGrouped;
|
|
22
|
+
private renderSegmented;
|
|
23
|
+
private updateGrouped;
|
|
24
|
+
private updateSegmented;
|
|
25
|
+
static updateGroupedPath(block: Block, lineObject: Selection<BaseType, any, BaseType, any>, lineGenerator: ILine<MdtChartsDataRow>, newData: MdtChartsDataRow[]): Promise<any>;
|
|
26
|
+
private createLineGeneratorFactory;
|
|
48
27
|
}
|
|
49
28
|
export {};
|
|
@@ -6,167 +6,137 @@ import { Helper } from "../../helpers/helper";
|
|
|
6
6
|
import { Pipeline } from "../../helpers/pipeline/Pipeline";
|
|
7
7
|
import { LineBuilder } from "../../../engine/twoDimensionalNotation/line/lineBuilder";
|
|
8
8
|
export class Line {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
return [prom];
|
|
143
|
-
}
|
|
144
|
-
static updateGroupedPath(block, lineObject, lineGenerator, newData) {
|
|
145
|
-
return new Promise((resolve) => {
|
|
146
|
-
if (lineObject.size() === 0) {
|
|
147
|
-
resolve("");
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
let lineHandler = lineObject;
|
|
151
|
-
if (block.transitionManager.durations.chartUpdate > 0)
|
|
152
|
-
lineHandler = lineHandler
|
|
153
|
-
.interrupt()
|
|
154
|
-
.transition()
|
|
155
|
-
.duration(block.transitionManager.durations.chartUpdate)
|
|
156
|
-
.on("end", () => resolve(""));
|
|
157
|
-
lineHandler.attr("d", lineGenerator(newData));
|
|
158
|
-
if (block.transitionManager.durations.chartUpdate <= 0) resolve("");
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
createLineGeneratorFactory(chart, scales, margin, keyAxisOrient, keyField) {
|
|
162
|
-
return new LineGeneratorFactory({
|
|
163
|
-
keyAxisOrient,
|
|
164
|
-
scales,
|
|
165
|
-
keyFieldName: keyField.name,
|
|
166
|
-
margin,
|
|
167
|
-
shouldRender: chart.lineLikeViewOptions.renderForKey,
|
|
168
|
-
curve: this.options.staticSettings.shape.curve.type
|
|
169
|
-
});
|
|
170
|
-
}
|
|
9
|
+
constructor(options) {
|
|
10
|
+
this.options = options;
|
|
11
|
+
this.creatingPipeline = new Pipeline();
|
|
12
|
+
this.lineChartClass = Line.lineChartClass; //TODO: remove after refactor
|
|
13
|
+
onLineChartInit(this.creatingPipeline);
|
|
14
|
+
}
|
|
15
|
+
static get(options) {
|
|
16
|
+
return new Line(options);
|
|
17
|
+
}
|
|
18
|
+
render(block, scales, data, keyField, margin, keyAxisOrient, chart) {
|
|
19
|
+
if (chart.isSegmented)
|
|
20
|
+
this.renderSegmented(block, scales, data, keyField, margin, keyAxisOrient, chart);
|
|
21
|
+
else
|
|
22
|
+
this.renderGrouped(block, scales, data, keyField, margin, keyAxisOrient, chart);
|
|
23
|
+
}
|
|
24
|
+
update(block, scales, newData, keyField, margin, keyAxisOrient, chart) {
|
|
25
|
+
let promises;
|
|
26
|
+
if (chart.isSegmented) {
|
|
27
|
+
promises = this.updateSegmented(block, scales, newData, keyField, margin, keyAxisOrient, chart);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
promises = this.updateGrouped(block, scales, newData, keyField, margin, keyAxisOrient, chart);
|
|
31
|
+
}
|
|
32
|
+
return promises;
|
|
33
|
+
}
|
|
34
|
+
updateColors(block, chart) {
|
|
35
|
+
chart.data.valueFields.forEach((_vf, valueIndex) => {
|
|
36
|
+
const path = block.svg
|
|
37
|
+
.getChartGroup(chart.index)
|
|
38
|
+
.select(`.${this.lineChartClass}${Helper.getCssClassesLine(chart.cssClasses)}.chart-element-${valueIndex}`);
|
|
39
|
+
DomHelper.setChartStyle(path, chart.style, valueIndex, "stroke");
|
|
40
|
+
MarkDot.updateColors(block, chart, valueIndex);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
renderGrouped(block, scales, data, keyField, margin, keyAxisOrient, chart) {
|
|
44
|
+
const generatorFactory = new LineGeneratorFactory({
|
|
45
|
+
keyAxisOrient,
|
|
46
|
+
scales,
|
|
47
|
+
keyFieldName: keyField.name,
|
|
48
|
+
margin,
|
|
49
|
+
curve: this.options.staticSettings.shape.curve.type,
|
|
50
|
+
shouldRender: chart.lineLikeViewOptions.renderForKey
|
|
51
|
+
});
|
|
52
|
+
chart.data.valueFields.forEach((valueField, valueIndex) => {
|
|
53
|
+
const lineGenerator = generatorFactory.getLineGenerator(valueField.name);
|
|
54
|
+
let path = block.svg
|
|
55
|
+
.getChartGroup(chart.index)
|
|
56
|
+
.append("path")
|
|
57
|
+
.attr("d", lineGenerator(data))
|
|
58
|
+
.attr("class", this.lineChartClass)
|
|
59
|
+
.style("fill", "none")
|
|
60
|
+
.style("clip-path", `url(#${block.svg.getClipPathId()})`)
|
|
61
|
+
.style("pointer-events", "none");
|
|
62
|
+
path = this.creatingPipeline.execute(path, chart);
|
|
63
|
+
DomHelper.setCssClasses(path, Helper.getCssClassesWithElementIndex(chart.cssClasses, valueIndex));
|
|
64
|
+
DomHelper.setChartStyle(path, chart.style, valueIndex, "stroke");
|
|
65
|
+
MarkDot.render(block, data, keyAxisOrient, scales, margin, keyField.name, valueIndex, valueField.name, chart);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
renderSegmented(block, scales, data, keyField, margin, keyAxisOrient, chart) {
|
|
69
|
+
let stackedData = getStackedData(data, chart);
|
|
70
|
+
const generatorFactory = this.createLineGeneratorFactory(chart, scales, margin, keyAxisOrient, keyField);
|
|
71
|
+
const lineGenerator = generatorFactory.getSegmentedLineGenerator();
|
|
72
|
+
const lineBuilder = new LineBuilder({
|
|
73
|
+
elementAccessors: { getBlock: () => block }
|
|
74
|
+
}, chart, lineGenerator);
|
|
75
|
+
let lines = lineBuilder.renderSegmented(stackedData, Line.lineChartClass);
|
|
76
|
+
lines = this.creatingPipeline.execute(lines, chart);
|
|
77
|
+
lineBuilder.setSegmentColor(lines, chart.style.elementColors);
|
|
78
|
+
lines.each(function (_, i) {
|
|
79
|
+
DomHelper.setCssClasses(select(this), Helper.getCssClassesWithElementIndex(chart.cssClasses, i));
|
|
80
|
+
});
|
|
81
|
+
stackedData.forEach((dataset, stackIndex) => {
|
|
82
|
+
MarkDot.render(block, dataset, keyAxisOrient, scales, margin, keyField.name, stackIndex, "1", chart);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
updateGrouped(block, scales, newData, keyField, margin, keyAxisOrient, chart) {
|
|
86
|
+
const promises = [];
|
|
87
|
+
const generatorFactory = this.createLineGeneratorFactory(chart, scales, margin, keyAxisOrient, keyField);
|
|
88
|
+
chart.data.valueFields.forEach((valueField, valueFieldIndex) => {
|
|
89
|
+
const lineGenerator = generatorFactory.getLineGenerator(valueField.name);
|
|
90
|
+
const lineObject = block.svg
|
|
91
|
+
.getChartGroup(chart.index)
|
|
92
|
+
.select(`.${this.lineChartClass}${Helper.getCssClassesLine(chart.cssClasses)}.chart-element-${valueFieldIndex}`);
|
|
93
|
+
const prom = Line.updateGroupedPath(block, lineObject, lineGenerator, newData);
|
|
94
|
+
promises.push(prom);
|
|
95
|
+
MarkDot.update(block, newData, keyAxisOrient, scales, margin, keyField.name, valueFieldIndex, valueField.name, chart);
|
|
96
|
+
});
|
|
97
|
+
return promises;
|
|
98
|
+
}
|
|
99
|
+
updateSegmented(block, scales, newData, keyField, margin, keyAxisOrient, chart) {
|
|
100
|
+
let stackedData = getStackedData(newData, chart);
|
|
101
|
+
const generatorFactory = this.createLineGeneratorFactory(chart, scales, margin, keyAxisOrient, keyField);
|
|
102
|
+
const lineGenerator = generatorFactory.getSegmentedLineGenerator();
|
|
103
|
+
const lineBuilder = new LineBuilder({
|
|
104
|
+
elementAccessors: { getBlock: () => block }
|
|
105
|
+
}, chart, lineGenerator);
|
|
106
|
+
let lines = lineBuilder.getAllLinesWithNewData(stackedData, Line.lineChartClass);
|
|
107
|
+
const prom = lineBuilder.updateSegmentedPath(lines);
|
|
108
|
+
lines.each((dataset, index) => {
|
|
109
|
+
MarkDot.update(block, dataset, keyAxisOrient, scales, margin, keyField.name, index, "1", chart);
|
|
110
|
+
});
|
|
111
|
+
return [prom];
|
|
112
|
+
}
|
|
113
|
+
static updateGroupedPath(block, lineObject, lineGenerator, newData) {
|
|
114
|
+
return new Promise((resolve) => {
|
|
115
|
+
if (lineObject.size() === 0) {
|
|
116
|
+
resolve("");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
let lineHandler = lineObject;
|
|
120
|
+
if (block.transitionManager.durations.chartUpdate > 0)
|
|
121
|
+
lineHandler = lineHandler
|
|
122
|
+
.interrupt()
|
|
123
|
+
.transition()
|
|
124
|
+
.duration(block.transitionManager.durations.chartUpdate)
|
|
125
|
+
.on("end", () => resolve(""));
|
|
126
|
+
lineHandler.attr("d", lineGenerator(newData));
|
|
127
|
+
if (block.transitionManager.durations.chartUpdate <= 0)
|
|
128
|
+
resolve("");
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
createLineGeneratorFactory(chart, scales, margin, keyAxisOrient, keyField) {
|
|
132
|
+
return new LineGeneratorFactory({
|
|
133
|
+
keyAxisOrient,
|
|
134
|
+
scales,
|
|
135
|
+
keyFieldName: keyField.name,
|
|
136
|
+
margin,
|
|
137
|
+
shouldRender: chart.lineLikeViewOptions.renderForKey,
|
|
138
|
+
curve: this.options.staticSettings.shape.curve.type
|
|
139
|
+
});
|
|
140
|
+
}
|
|
171
141
|
}
|
|
172
142
|
Line.lineChartClass = "line";
|