@orbcharts/plugins-basic 3.0.0-alpha.79 → 3.0.0-beta.10
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/LICENSE +200 -200
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBars.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBarsTriangle.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseDots.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseGroupAxis.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLegend.d.ts +1 -1
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLineAreas.d.ts +3 -3
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLines.d.ts +3 -3
- package/dist/{src/base/BaseBarStack.d.ts → orbcharts-plugins-basic/src/base/BaseStackedBar.d.ts} +6 -6
- package/dist/orbcharts-plugins-basic/src/base/BaseTooltip.d.ts +14 -0
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseValueAxis.d.ts +3 -2
- package/dist/{src → orbcharts-plugins-basic/src}/grid/defaults.d.ts +6 -5
- package/dist/{src → orbcharts-plugins-basic/src}/grid/gridObservables.d.ts +5 -5
- package/dist/{src → orbcharts-plugins-basic/src}/grid/index.d.ts +4 -3
- package/dist/orbcharts-plugins-basic/src/grid/plugins/GridTooltip.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/grid/plugins/GridZoom.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedBar.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedValueAxis.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/index.d.ts +7 -0
- package/dist/orbcharts-plugins-basic/src/multiGrid/defaults.d.ts +15 -0
- package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/index.d.ts +4 -3
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiGridTooltip.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedBar.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedValueAxis.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/OverlappingStackedValueAxes.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/defaults.d.ts +9 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/index.d.ts +8 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/multiValueObservables.d.ts +33 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueLegend.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueTooltip.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/Scatter.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/ScatterBubbles.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAux.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAxes.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYZoom.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/noneData/index.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/relationship/defaults.d.ts +6 -0
- package/dist/orbcharts-plugins-basic/src/relationship/index.d.ts +5 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirected.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirectedBubbles.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipLegend.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipTooltip.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/relationship/relationshipObservables.d.ts +1 -0
- package/dist/{src → orbcharts-plugins-basic/src}/series/defaults.d.ts +2 -1
- package/dist/{src → orbcharts-plugins-basic/src}/series/index.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/series/plugins/SeriesTooltip.d.ts +1 -0
- package/dist/{src → orbcharts-plugins-basic/src}/series/seriesObservables.d.ts +3 -3
- package/dist/orbcharts-plugins-basic/src/tree/defaults.d.ts +5 -0
- package/dist/{src → orbcharts-plugins-basic/src}/tree/index.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/tree/plugins/TreeTooltip.d.ts +1 -0
- package/dist/{src → orbcharts-plugins-basic/src}/utils/commonUtils.d.ts +1 -1
- package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Utils.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/utils/observables.d.ts +1 -1
- package/dist/{src → orbcharts-plugins-basic/src}/utils/orbchartsUtils.d.ts +3 -3
- package/dist/orbcharts-plugins-basic.es.js +13490 -10057
- package/dist/orbcharts-plugins-basic.umd.js +179 -24
- package/dist/src/index.d.ts +1 -5
- package/lib/core-types.ts +7 -7
- package/lib/core.ts +6 -6
- package/lib/plugins-basic-types.ts +6 -6
- package/package.json +44 -44
- package/src/base/BaseBars.ts +765 -765
- package/src/base/BaseBarsTriangle.ts +676 -674
- package/src/base/BaseDots.ts +464 -515
- package/src/base/BaseGroupAxis.ts +679 -679
- package/src/base/BaseLegend.ts +684 -644
- package/src/base/BaseLineAreas.ts +629 -629
- package/src/base/BaseLines.ts +706 -706
- package/src/base/{BaseBarStack.ts → BaseStackedBar.ts} +782 -780
- package/src/base/BaseTooltip.ts +386 -0
- package/src/base/BaseValueAxis.ts +583 -580
- package/src/base/types.ts +2 -2
- package/src/const.ts +30 -30
- package/src/grid/defaults.ts +247 -128
- package/src/grid/gridObservables.ts +554 -545
- package/src/grid/index.ts +16 -15
- package/src/grid/plugins/Bars.ts +69 -69
- package/src/grid/plugins/BarsPN.ts +66 -66
- package/src/grid/plugins/BarsTriangle.ts +73 -73
- package/src/grid/plugins/Dots.ts +68 -68
- package/src/grid/plugins/GridLegend.ts +107 -96
- package/src/grid/plugins/GridTooltip.ts +66 -0
- package/src/grid/plugins/{ScalingArea.ts → GridZoom.ts} +218 -218
- package/src/grid/plugins/GroupAux.ts +1103 -1098
- package/src/grid/plugins/GroupAxis.ts +97 -97
- package/src/grid/plugins/LineAreas.ts +65 -65
- package/src/grid/plugins/Lines.ts +59 -59
- package/src/grid/plugins/{BarStack.ts → StackedBar.ts} +64 -64
- package/src/grid/plugins/{ValueStackAxis.ts → StackedValueAxis.ts} +96 -95
- package/src/grid/plugins/ValueAxis.ts +94 -93
- package/src/index.ts +6 -9
- package/src/multiGrid/defaults.ts +225 -159
- package/src/multiGrid/index.ts +15 -14
- package/src/multiGrid/multiGridObservables.ts +49 -49
- package/src/multiGrid/plugins/MultiBars.ts +108 -108
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +114 -114
- package/src/multiGrid/plugins/MultiDots.ts +102 -102
- package/src/multiGrid/plugins/MultiGridLegend.ts +159 -148
- package/src/multiGrid/plugins/MultiGridTooltip.ts +66 -0
- package/src/multiGrid/plugins/MultiGroupAxis.ts +137 -137
- package/src/multiGrid/plugins/MultiLineAreas.ts +107 -107
- package/src/multiGrid/plugins/MultiLines.ts +101 -101
- package/src/multiGrid/plugins/{MultiBarStack.ts → MultiStackedBar.ts} +106 -106
- package/src/multiGrid/plugins/{MultiValueStackAxis.ts → MultiStackedValueAxis.ts} +134 -133
- package/src/multiGrid/plugins/MultiValueAxis.ts +134 -133
- package/src/multiGrid/plugins/{OverlappingValueStackAxes.ts → OverlappingStackedValueAxes.ts} +299 -298
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +300 -299
- package/src/multiValue/defaults.ts +167 -0
- package/src/multiValue/index.ts +9 -0
- package/src/multiValue/multiValueObservables.ts +297 -0
- package/src/multiValue/plugins/MultiValueLegend.ts +107 -0
- package/src/multiValue/plugins/MultiValueTooltip.ts +66 -0
- package/src/multiValue/plugins/Scatter.ts +426 -0
- package/src/multiValue/plugins/ScatterBubbles.ts +554 -0
- package/src/multiValue/plugins/XYAux.ts +682 -0
- package/src/multiValue/plugins/XYAxes.ts +685 -0
- package/src/multiValue/plugins/XYZoom.ts +300 -0
- package/src/noneData/defaults.ts +102 -102
- package/src/noneData/index.ts +4 -4
- package/src/noneData/plugins/Container.ts +28 -28
- package/src/noneData/plugins/Tooltip.ts +374 -374
- package/src/relationship/defaults.ts +196 -0
- package/src/relationship/index.ts +5 -0
- package/src/relationship/plugins/ForceDirected.ts +1167 -0
- package/src/relationship/plugins/ForceDirectedBubbles.ts +1391 -0
- package/src/relationship/plugins/RelationshipLegend.ts +100 -0
- package/src/relationship/plugins/RelationshipTooltip.ts +66 -0
- package/src/relationship/relationshipObservables.ts +50 -0
- package/src/series/defaults.ts +207 -149
- package/src/series/index.ts +10 -9
- package/src/series/plugins/Bubbles.ts +606 -603
- package/src/series/plugins/Pie.ts +623 -623
- package/src/series/plugins/PieEventTexts.ts +284 -283
- package/src/series/plugins/PieLabels.ts +640 -640
- package/src/series/plugins/Rose.ts +516 -516
- package/src/series/plugins/RoseLabels.ts +600 -600
- package/src/series/plugins/SeriesLegend.ts +107 -96
- package/src/series/plugins/SeriesTooltip.ts +66 -0
- package/src/series/seriesObservables.ts +145 -145
- package/src/series/seriesUtils.ts +51 -51
- package/src/tree/defaults.ts +79 -23
- package/src/tree/index.ts +5 -4
- package/src/tree/plugins/TreeLegend.ts +100 -96
- package/src/tree/plugins/TreeMap.ts +333 -333
- package/src/tree/plugins/TreeTooltip.ts +66 -0
- package/src/utils/commonUtils.ts +21 -21
- package/src/utils/d3Graphics.ts +174 -174
- package/src/utils/d3Utils.ts +74 -73
- package/src/utils/observables.ts +14 -14
- package/src/utils/orbchartsUtils.ts +116 -100
- package/tsconfig.base.json +13 -13
- package/tsconfig.json +2 -2
- package/vite.config.js +22 -22
- package/dist/src/grid/plugins/BarStack.d.ts +0 -1
- package/dist/src/grid/plugins/ScalingArea.d.ts +0 -1
- package/dist/src/grid/plugins/ValueStackAxis.d.ts +0 -1
- package/dist/src/multiGrid/defaults.d.ts +0 -14
- package/dist/src/multiGrid/plugins/MultiBarStack.d.ts +0 -1
- package/dist/src/multiGrid/plugins/MultiValueStackAxis.d.ts +0 -1
- package/dist/src/multiGrid/plugins/OverlappingValueStackAxes.d.ts +0 -1
- package/dist/src/multiValue/plugins/Scatter.d.ts +0 -0
- package/dist/src/multiValue/plugins/ScatterAxes.d.ts +0 -0
- package/dist/src/noneData/index.d.ts +0 -2
- package/dist/src/noneData/plugins/Container.d.ts +0 -1
- package/dist/src/noneData/plugins/Tooltip.d.ts +0 -3
- package/dist/src/relationship/index.d.ts +0 -0
- package/dist/src/relationship/plugins/Relationship.d.ts +0 -0
- package/dist/src/tree/defaults.d.ts +0 -4
- package/src/base/BaseGroupArea.ts +0 -0
- package/src/multiValue/plugins/ScatterAxes.ts +0 -0
- package/src/relationship/plugins/Relationship.ts +0 -0
- /package/dist/{lib → orbcharts-plugins-basic/lib}/core-types.d.ts +0 -0
- /package/dist/{lib → orbcharts-plugins-basic/lib}/core.d.ts +0 -0
- /package/dist/{lib → orbcharts-plugins-basic/lib}/plugins-basic-types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/base/types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/const.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Bars.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarsPN.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarsTriangle.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Dots.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GroupAux.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GroupAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/LineAreas.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Lines.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/ValueAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/multiGridObservables.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBars.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBarsTriangle.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiDots.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGridLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGroupAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiLineAreas.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiLines.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiValueAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/OverlappingValueAxes.d.ts +0 -0
- /package/dist/{src/grid → orbcharts-plugins-basic/src/multiValue}/plugins/Ranking.d.ts +0 -0
- /package/dist/{src/grid → orbcharts-plugins-basic/src/multiValue}/plugins/RankingAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/noneData/defaults.d.ts +0 -0
- /package/dist/{src/base/BaseGroupArea.d.ts → orbcharts-plugins-basic/src/noneData/plugins/Container.d.ts} +0 -0
- /package/dist/{src/multiValue/index.d.ts → orbcharts-plugins-basic/src/noneData/plugins/Tooltip.d.ts} +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Bubbles.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Pie.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/PieEventTexts.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/PieLabels.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Rose.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/RoseLabels.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/SeriesLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Waffle.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/seriesUtils.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeMap.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Graphics.d.ts +0 -0
- /package/dist/{vite.config.d.ts → orbcharts-plugins-basic/vite.config.d.ts} +0 -0
- /package/src/{grid → multiValue}/plugins/Ranking.ts +0 -0
- /package/src/{grid → multiValue}/plugins/RankingAxis.ts +0 -0
package/src/base/types.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export interface BasePluginFn<Context> {
|
2
|
-
(pluginName: string, context: Context): () => void // return unsubscribe function
|
1
|
+
export interface BasePluginFn<Context> {
|
2
|
+
(pluginName: string, context: Context): () => void // return unsubscribe function
|
3
3
|
}
|
package/src/const.ts
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
|
2
|
-
// 圖層索引 - 底層(無圖型)
|
3
|
-
export const LAYER_INDEX_OF_ROOT = 0
|
4
|
-
|
5
|
-
// 圖層索引 - 背景 *預留
|
6
|
-
export const LAYER_INDEX_OF_BG = 1
|
7
|
-
|
8
|
-
// 圖層索引 - 圖軸
|
9
|
-
export const LAYER_INDEX_OF_AXIS = 2
|
10
|
-
|
11
|
-
// 圖層索引 - 輔助線、圖軸的輔助資訊
|
12
|
-
export const LAYER_INDEX_OF_AUX = 3
|
13
|
-
|
14
|
-
// 圖層索引 - 底層圖型
|
15
|
-
export const LAYER_INDEX_OF_GRAPHIC_GROUND = 4
|
16
|
-
|
17
|
-
// 圖層索引 - 一般圖型
|
18
|
-
export const LAYER_INDEX_OF_GRAPHIC = 5
|
19
|
-
|
20
|
-
// 圖層索引 - 覆蓋圖型
|
21
|
-
export const LAYER_INDEX_OF_GRAPHIC_COVER = 6
|
22
|
-
|
23
|
-
// 圖層索引 - 圖型上的標籤文字
|
24
|
-
export const LAYER_INDEX_OF_LABEL = 7
|
25
|
-
|
26
|
-
// 圖層索引 - 圖例、圖表上的文字
|
27
|
-
export const LAYER_INDEX_OF_INFO = 8
|
28
|
-
|
29
|
-
// 圖層索引 - Tooltip、事件觸發的覆蓋圖型
|
30
|
-
export const LAYER_INDEX_OF_TOOLTIP = 9
|
1
|
+
|
2
|
+
// 圖層索引 - 底層(無圖型)
|
3
|
+
export const LAYER_INDEX_OF_ROOT = 0
|
4
|
+
|
5
|
+
// 圖層索引 - 背景 *預留
|
6
|
+
export const LAYER_INDEX_OF_BG = 1
|
7
|
+
|
8
|
+
// 圖層索引 - 圖軸
|
9
|
+
export const LAYER_INDEX_OF_AXIS = 2
|
10
|
+
|
11
|
+
// 圖層索引 - 輔助線、圖軸的輔助資訊
|
12
|
+
export const LAYER_INDEX_OF_AUX = 3
|
13
|
+
|
14
|
+
// 圖層索引 - 底層圖型
|
15
|
+
export const LAYER_INDEX_OF_GRAPHIC_GROUND = 4
|
16
|
+
|
17
|
+
// 圖層索引 - 一般圖型
|
18
|
+
export const LAYER_INDEX_OF_GRAPHIC = 5
|
19
|
+
|
20
|
+
// 圖層索引 - 覆蓋圖型
|
21
|
+
export const LAYER_INDEX_OF_GRAPHIC_COVER = 6
|
22
|
+
|
23
|
+
// 圖層索引 - 圖型上的標籤文字
|
24
|
+
export const LAYER_INDEX_OF_LABEL = 7
|
25
|
+
|
26
|
+
// 圖層索引 - 圖例、圖表上的文字
|
27
|
+
export const LAYER_INDEX_OF_INFO = 8
|
28
|
+
|
29
|
+
// 圖層索引 - Tooltip、事件觸發的覆蓋圖型
|
30
|
+
export const LAYER_INDEX_OF_TOOLTIP = 9
|
package/src/grid/defaults.ts
CHANGED
@@ -1,128 +1,247 @@
|
|
1
|
-
import type {
|
2
|
-
LinesParams,
|
3
|
-
LineAreasParams,
|
4
|
-
GroupAuxParams,
|
5
|
-
DotsParams,
|
6
|
-
BarsParams,
|
7
|
-
|
8
|
-
BarsTriangleParams,
|
9
|
-
GroupAxisParams,
|
10
|
-
ValueAxisParams,
|
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
|
-
|
1
|
+
import type {
|
2
|
+
LinesParams,
|
3
|
+
LineAreasParams,
|
4
|
+
GroupAuxParams,
|
5
|
+
DotsParams,
|
6
|
+
BarsParams,
|
7
|
+
StackedBarParams,
|
8
|
+
BarsTriangleParams,
|
9
|
+
GroupAxisParams,
|
10
|
+
ValueAxisParams,
|
11
|
+
StackedValueAxisParams,
|
12
|
+
GridTooltipParams,
|
13
|
+
GridZoomParams,
|
14
|
+
GridLegendParams
|
15
|
+
} from '../../lib/plugins-basic-types'
|
16
|
+
// import { measureTextWidth } from '../utils/commonUtils'
|
17
|
+
|
18
|
+
export const DEFAULT_LINES_PARAMS: LinesParams = {
|
19
|
+
lineCurve: 'curveLinear',
|
20
|
+
lineWidth: 2
|
21
|
+
}
|
22
|
+
|
23
|
+
export const DEFAULT_LINE_AREAS_PARAMS: LineAreasParams = {
|
24
|
+
lineCurve: 'curveLinear',
|
25
|
+
linearGradientOpacity: [1, 0]
|
26
|
+
}
|
27
|
+
|
28
|
+
export const DEFAULT_DOTS_PARAMS: DotsParams = {
|
29
|
+
radius: 4,
|
30
|
+
fillColorType: 'white',
|
31
|
+
strokeColorType: 'label',
|
32
|
+
strokeWidth: 2,
|
33
|
+
// strokeWidthWhileHighlight: 3,
|
34
|
+
onlyShowHighlighted: false
|
35
|
+
}
|
36
|
+
|
37
|
+
export const DEFAULT_GROUP_AUX_PARAMS: GroupAuxParams = {
|
38
|
+
showLine: true,
|
39
|
+
showLabel: true,
|
40
|
+
lineDashArray: '3, 3',
|
41
|
+
lineColorType: 'primary',
|
42
|
+
labelColorType: 'primary',
|
43
|
+
labelTextColorType: 'background',
|
44
|
+
labelTextFormat: text => text,
|
45
|
+
labelPadding: 20,
|
46
|
+
labelRotate: 0
|
47
|
+
}
|
48
|
+
DEFAULT_GROUP_AUX_PARAMS.labelTextFormat.toString = () => `text => text`
|
49
|
+
|
50
|
+
export const DEFAULT_BARS_PARAMS: BarsParams = {
|
51
|
+
// barType: 'rect',
|
52
|
+
barWidth: 0,
|
53
|
+
barPadding: 1,
|
54
|
+
barGroupPadding: 40,
|
55
|
+
barRadius: false,
|
56
|
+
}
|
57
|
+
|
58
|
+
export const DEFAULT_BARS_DIVERGING_PARAMS: BarsParams = {
|
59
|
+
...DEFAULT_BARS_PARAMS
|
60
|
+
}
|
61
|
+
|
62
|
+
export const DEFAULT_STACKED_BAR_PARAMS: StackedBarParams = {
|
63
|
+
barWidth: 0,
|
64
|
+
barGroupPadding: 10,
|
65
|
+
barRadius: false,
|
66
|
+
}
|
67
|
+
|
68
|
+
export const DEFAULT_BARS_TRIANGLE_PARAMS: BarsTriangleParams = {
|
69
|
+
barWidth: 0,
|
70
|
+
barPadding: 1,
|
71
|
+
barGroupPadding: 20,
|
72
|
+
linearGradientOpacity: [1, 0]
|
73
|
+
}
|
74
|
+
|
75
|
+
export const DEFAULT_GROUP_AXIS_PARAMS: GroupAxisParams = {
|
76
|
+
// labelAnchor: 'start',
|
77
|
+
labelOffset: [0, 0],
|
78
|
+
labelColorType: 'primary',
|
79
|
+
axisLineVisible: true,
|
80
|
+
axisLineColorType: 'primary',
|
81
|
+
ticks: 'all',
|
82
|
+
tickFormat: text => text,
|
83
|
+
tickLineVisible: true,
|
84
|
+
tickPadding: 20,
|
85
|
+
tickFullLine: false,
|
86
|
+
tickFullLineDasharray: 'none',
|
87
|
+
tickColorType: 'secondary',
|
88
|
+
tickTextRotate: 0,
|
89
|
+
tickTextColorType: 'primary',
|
90
|
+
}
|
91
|
+
DEFAULT_GROUP_AXIS_PARAMS.tickFormat.toString = () => `text => text`
|
92
|
+
|
93
|
+
export const DEFAULT_VALUE_AXIS_PARAMS: ValueAxisParams = {
|
94
|
+
// labelAnchor: 'end',
|
95
|
+
labelOffset: [0, 0],
|
96
|
+
labelColorType: 'primary',
|
97
|
+
axisLineVisible: false,
|
98
|
+
axisLineColorType: 'primary',
|
99
|
+
ticks: null,
|
100
|
+
// tickFormat: ',.0f',
|
101
|
+
tickFormat: v => v,
|
102
|
+
tickLineVisible: true,
|
103
|
+
tickPadding: 20,
|
104
|
+
tickFullLine: true,
|
105
|
+
tickFullLineDasharray: 'none',
|
106
|
+
tickColorType: 'secondary',
|
107
|
+
tickTextRotate: 0,
|
108
|
+
tickTextColorType: 'primary'
|
109
|
+
}
|
110
|
+
DEFAULT_VALUE_AXIS_PARAMS.tickFormat.toString = () => 'v => v'
|
111
|
+
|
112
|
+
export const DEFAULT_STACKED_VALUE_AXIS_PARAMS: StackedValueAxisParams = {
|
113
|
+
...DEFAULT_VALUE_AXIS_PARAMS
|
114
|
+
}
|
115
|
+
|
116
|
+
export const DEFAULT_GRID_ZOOM_PARAMS: GridZoomParams = {
|
117
|
+
|
118
|
+
}
|
119
|
+
|
120
|
+
export const DEFAULT_GRID_LEGEND_PARAMS: GridLegendParams = {
|
121
|
+
// position: 'right',
|
122
|
+
// justify: 'end',
|
123
|
+
placement: 'bottom',
|
124
|
+
padding: 28,
|
125
|
+
// offset: [0, 0],
|
126
|
+
backgroundFill: 'none',
|
127
|
+
backgroundStroke: 'none',
|
128
|
+
gap: 10,
|
129
|
+
listRectWidth: 14,
|
130
|
+
listRectHeight: 14,
|
131
|
+
listRectRadius: 0,
|
132
|
+
// highlightEvent: false
|
133
|
+
textColorType: 'primary'
|
134
|
+
}
|
135
|
+
|
136
|
+
export const DEFAULT_GRID_TOOLTIP_PARAMS: GridTooltipParams = {
|
137
|
+
backgroundColorType: 'background',
|
138
|
+
strokeColorType: 'primary',
|
139
|
+
backgroundOpacity: 0.8,
|
140
|
+
textColorType: 'primary',
|
141
|
+
offset: [20, 5],
|
142
|
+
padding: 10,
|
143
|
+
// renderFn: (eventData, { styles }) => {
|
144
|
+
// const bulletWidth = styles.textSizePx * 0.7
|
145
|
+
// const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
|
146
|
+
// if (eventData.highlightTarget === 'group') {
|
147
|
+
// const titleSvg = `<g><text dominant-baseline="hanging" font-size="${styles.textSizePx}">${eventData.groupLabel}</text></g>`
|
148
|
+
// const maxLengthText = eventData.groups.reduce((acc, group) => {
|
149
|
+
// const text = `${group.seriesLabel}${group.value}`
|
150
|
+
// return text.length > acc.length ? text : acc
|
151
|
+
// }, '')
|
152
|
+
// const maxTextWidth = measureTextWidth(maxLengthText, styles.textSizePx)
|
153
|
+
// const lineEndX = maxTextWidth + styles.textSizePx * 2
|
154
|
+
// const contentSvg = eventData.groups
|
155
|
+
// .map((group, i) => {
|
156
|
+
// const y = i * styles.textSizePx * 1.5
|
157
|
+
// return `<g transform="translate(0, ${styles.textSizePx * 2})">
|
158
|
+
// <rect width="${bulletWidth}" height="${bulletWidth}" x="${offset}" y="${y + offset}" rx="${bulletWidth / 2}" fill="${group.color}"></rect>
|
159
|
+
// <text x="${styles.textSizePx * 1.5}" y="${y}" font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">
|
160
|
+
// <tspan>${group.seriesLabel}</tspan>
|
161
|
+
// <tspan font-weight="bold" text-anchor="end" x="${lineEndX}">${group.value}</tspan>
|
162
|
+
// </text>
|
163
|
+
// </g>`
|
164
|
+
// })
|
165
|
+
// .join('')
|
166
|
+
// return `${titleSvg}
|
167
|
+
// ${contentSvg}`
|
168
|
+
// } else if (eventData.highlightTarget === 'series') {
|
169
|
+
// const titleSvg = `<g><text dominant-baseline="hanging" font-size="${styles.textSizePx}">${eventData.groupLabel}</text></g>`
|
170
|
+
// const textWidth = measureTextWidth(`${eventData.seriesLabel}${eventData.datum.value}`, styles.textSizePx)
|
171
|
+
// const lineEndX = textWidth + styles.textSizePx * 2
|
172
|
+
// const contentSvg = `<g transform="translate(0, ${styles.textSizePx * 2})">
|
173
|
+
// <rect width="${bulletWidth}" height="${bulletWidth}" x="${offset}" y="${offset}" rx="${bulletWidth / 2}" fill="${eventData.datum.color}"></rect>
|
174
|
+
// <text x="${styles.textSizePx * 1.5}" font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">
|
175
|
+
// <tspan>${eventData.seriesLabel}</tspan>
|
176
|
+
// <tspan font-weight="bold" text-anchor="end" x="${lineEndX}">${eventData.datum.value}</tspan>
|
177
|
+
// </text>
|
178
|
+
// </g>`
|
179
|
+
// return `${titleSvg}
|
180
|
+
// ${contentSvg}`
|
181
|
+
// } else {
|
182
|
+
// const textWidth = measureTextWidth(`${eventData.datum.label}${eventData.datum.value}`, styles.textSizePx)
|
183
|
+
// const lineEndX = textWidth + styles.textSizePx * 2
|
184
|
+
// return `<g>
|
185
|
+
// <rect width="${bulletWidth}" height="${bulletWidth}" x="${offset}" y="${offset}" rx="${bulletWidth / 2}" fill="${eventData.datum.color}"></rect>
|
186
|
+
// <text x="${styles.textSizePx * 1.5}" font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">
|
187
|
+
// <tspan>${eventData.datum.label}</tspan>
|
188
|
+
// <tspan font-weight="bold" text-anchor="end" x="${lineEndX}">${eventData.datum.value}</tspan>
|
189
|
+
// </text>
|
190
|
+
// </g>`
|
191
|
+
// }
|
192
|
+
// },
|
193
|
+
renderFn: (eventData, { styles, utils }) => {
|
194
|
+
const bulletWidth = styles.textSizePx * 0.7
|
195
|
+
const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
|
196
|
+
|
197
|
+
const titleSvg = `<g><text dominant-baseline="hanging" font-size="${styles.textSizePx}">${eventData.groupLabel}</text></g>`
|
198
|
+
const maxLengthText = eventData.groups.reduce((acc, group) => {
|
199
|
+
const text = `${group.seriesLabel}${group.value}`
|
200
|
+
return text.length > acc.length ? text : acc
|
201
|
+
}, '')
|
202
|
+
const maxTextWidth = utils.measureTextWidth(maxLengthText, styles.textSizePx)
|
203
|
+
const lineEndX = maxTextWidth + styles.textSizePx * 2
|
204
|
+
const contentSvg = eventData.groups
|
205
|
+
.map((group, i) => {
|
206
|
+
const y = i * styles.textSizePx * 1.5
|
207
|
+
const isHighlight = group.id === (eventData.datum && eventData.datum.id)
|
208
|
+
return `<g transform="translate(0, ${styles.textSizePx * 2})">
|
209
|
+
<rect width="${bulletWidth}" height="${bulletWidth}" x="${offset}" y="${y + offset}" rx="${bulletWidth / 2}" fill="${group.color}"></rect>
|
210
|
+
<text x="${styles.textSizePx * 1.5}" y="${y}" font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">
|
211
|
+
<tspan font-weight="${isHighlight ? 'bold' : ''}">${group.seriesLabel}</tspan>
|
212
|
+
<tspan font-weight="bold" text-anchor="end" x="${lineEndX}">${group.value}</tspan>
|
213
|
+
</text>
|
214
|
+
</g>`
|
215
|
+
})
|
216
|
+
.join('')
|
217
|
+
return `${titleSvg}
|
218
|
+
${contentSvg}`
|
219
|
+
}
|
220
|
+
}
|
221
|
+
DEFAULT_GRID_TOOLTIP_PARAMS.renderFn.toString = () => `(eventData, { styles, utils }) => {
|
222
|
+
const bulletWidth = styles.textSizePx * 0.7
|
223
|
+
const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
|
224
|
+
|
225
|
+
const titleSvg = \`<g><text dominant-baseline="hanging" font-size="\${styles.textSizePx}">\${eventData.groupLabel}</text></g>\`
|
226
|
+
const maxLengthText = eventData.groups.reduce((acc, group) => {
|
227
|
+
const text = \`\${group.seriesLabel}\${group.value}\`
|
228
|
+
return text.length > acc.length ? text : acc
|
229
|
+
}, '')
|
230
|
+
const maxTextWidth = utils.measureTextWidth(maxLengthText, styles.textSizePx)
|
231
|
+
const lineEndX = maxTextWidth + styles.textSizePx * 2
|
232
|
+
const contentSvg = eventData.groups
|
233
|
+
.map((group, i) => {
|
234
|
+
const y = i * styles.textSizePx * 1.5
|
235
|
+
const isHighlight = group.id === (eventData.datum && eventData.datum.id)
|
236
|
+
return \`<g transform="translate(0, \${styles.textSizePx * 2})">
|
237
|
+
<rect width="\${bulletWidth}" height="\${bulletWidth}" x="\${offset}" y="\${y + offset}" rx="\${bulletWidth / 2}" fill="\${group.color}"></rect>
|
238
|
+
<text x="\${styles.textSizePx * 1.5}" y="\${y}" font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
239
|
+
<tspan font-weight="\${isHighlight ? 'bold' : ''}">\${group.seriesLabel}</tspan>
|
240
|
+
<tspan font-weight="bold" text-anchor="end" x="\${lineEndX}">\${group.value}</tspan>
|
241
|
+
</text>
|
242
|
+
</g>\`
|
243
|
+
})
|
244
|
+
.join('')
|
245
|
+
return \`\${titleSvg}
|
246
|
+
\${contentSvg}\`
|
247
|
+
}`
|