@orbcharts/plugins-basic 3.0.0-beta.15 → 3.0.0-beta.17
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/orbcharts-plugins-basic.es.js +11839 -10485
- package/dist/orbcharts-plugins-basic.umd.js +231 -171
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseBars.d.ts +3 -3
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseBarsTriangle.d.ts +3 -3
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseDots.d.ts +3 -3
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseLineAreas.d.ts +3 -3
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseLines.d.ts +3 -3
- package/dist/src/base/BaseRacingBars.d.ts +23 -0
- package/dist/src/base/BaseRacingLabels.d.ts +20 -0
- package/dist/src/base/BaseRacingValueLabels.d.ts +20 -0
- package/dist/{orbcharts-plugins-basic/src/base/BaseStackedBar.d.ts → src/base/BaseStackedBars.d.ts} +7 -7
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseValueAxis.d.ts +4 -7
- package/dist/src/base/BaseXAxis.d.ts +20 -0
- package/dist/src/base/BaseYAxis.d.ts +18 -0
- package/dist/{orbcharts-plugins-basic/src → src}/grid/defaults.d.ts +3 -3
- package/dist/{orbcharts-plugins-basic/src → src}/grid/gridObservables.d.ts +8 -1
- package/dist/{orbcharts-plugins-basic/src → src}/grid/index.d.ts +2 -2
- package/dist/src/grid/plugins/GroupZoom.d.ts +1 -0
- package/dist/src/grid/plugins/StackedBars.d.ts +1 -0
- package/dist/src/index.d.ts +7 -1
- package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/defaults.d.ts +2 -2
- package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/index.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiStackedBars.d.ts +1 -0
- package/dist/src/multiValue/defaults.d.ts +13 -0
- package/dist/{orbcharts-plugins-basic/src → src}/multiValue/index.d.ts +5 -1
- package/dist/src/multiValue/multiValueObservables.d.ts +56 -0
- package/dist/src/multiValue/plugins/RacingBars.d.ts +1 -0
- package/dist/src/multiValue/plugins/RacingCounterTexts.d.ts +3 -0
- package/dist/src/multiValue/plugins/RacingValueAxis.d.ts +1 -0
- package/dist/src/multiValue/plugins/XAxis.d.ts +1 -0
- package/dist/src/multiValue/plugins/XYAxes.d.ts +1 -0
- package/dist/src/multiValue/plugins/XZoom.d.ts +1 -0
- package/dist/{orbcharts-plugins-basic/src → src}/utils/commonUtils.d.ts +1 -0
- package/dist/{orbcharts-plugins-basic/src → src}/utils/d3Graphics.d.ts +2 -1
- 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 -676
- package/src/base/BaseDots.ts +464 -464
- package/src/base/BaseGroupAxis.ts +691 -679
- package/src/base/BaseLegend.ts +684 -684
- package/src/base/BaseLineAreas.ts +629 -629
- package/src/base/BaseLines.ts +706 -706
- package/src/base/BaseRacingBars.ts +552 -0
- package/src/base/BaseRacingLabels.ts +396 -0
- package/src/base/BaseRacingValueLabels.ts +403 -0
- package/src/base/{BaseStackedBar.ts → BaseStackedBars.ts} +782 -782
- package/src/base/BaseTooltip.ts +386 -385
- package/src/base/BaseValueAxis.ts +600 -583
- package/src/base/BaseXAxis.ts +427 -0
- package/src/base/BaseYAxis.ts +389 -0
- package/src/base/types.ts +2 -2
- package/src/const.ts +30 -30
- package/src/grid/defaults.ts +213 -250
- package/src/grid/gridObservables.ts +612 -554
- package/src/grid/index.ts +16 -16
- 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 -107
- package/src/grid/plugins/GridTooltip.ts +66 -66
- package/src/grid/plugins/GroupAux.ts +1120 -1103
- package/src/grid/plugins/GroupAxis.ts +73 -97
- package/src/grid/plugins/{GridZoom.ts → GroupZoom.ts} +218 -218
- package/src/grid/plugins/LineAreas.ts +65 -65
- package/src/grid/plugins/Lines.ts +59 -59
- package/src/grid/plugins/{StackedBar.ts → StackedBars.ts} +64 -64
- package/src/grid/plugins/StackedValueAxis.ts +96 -96
- package/src/grid/plugins/ValueAxis.ts +94 -94
- package/src/index.ts +6 -6
- package/src/multiGrid/defaults.ts +244 -228
- package/src/multiGrid/index.ts +14 -14
- package/src/multiGrid/multiGridObservables.ts +50 -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 +169 -159
- package/src/multiGrid/plugins/MultiGridTooltip.ts +66 -66
- 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/{MultiStackedBar.ts → MultiStackedBars.ts} +106 -106
- package/src/multiGrid/plugins/MultiStackedValueAxis.ts +134 -134
- package/src/multiGrid/plugins/MultiValueAxis.ts +134 -134
- package/src/multiGrid/plugins/OverlappingStackedValueAxes.ts +300 -299
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +300 -300
- package/src/multiValue/defaults.ts +388 -166
- package/src/multiValue/index.ts +13 -9
- package/src/multiValue/multiValueObservables.ts +667 -297
- package/src/multiValue/plugins/MultiValueLegend.ts +107 -107
- package/src/multiValue/plugins/MultiValueTooltip.ts +66 -66
- package/src/multiValue/plugins/OrdinalBubbles.ts +0 -0
- package/src/multiValue/plugins/OrdinalXAxis.ts +0 -0
- package/src/multiValue/plugins/RacingBars.ts +373 -0
- package/src/multiValue/plugins/RacingCounterAxis.ts +0 -0
- package/src/multiValue/plugins/RacingCounterTexts.ts +300 -0
- package/src/multiValue/plugins/RacingValueAxis.ts +115 -0
- package/src/multiValue/plugins/RankingAxis_legacy.ts +109 -0
- package/src/multiValue/plugins/Scatter.ts +426 -426
- package/src/multiValue/plugins/ScatterBubbles.ts +554 -554
- package/src/multiValue/plugins/XAxis.ts +108 -0
- package/src/multiValue/plugins/XYAux.ts +682 -681
- package/src/multiValue/plugins/XYAxes.ts +194 -684
- package/src/multiValue/plugins/XYAxes_legacy.ts +684 -0
- package/src/multiValue/plugins/{XYZoom.ts → XZoom.ts} +299 -299
- package/src/noneData/defaults.ts +102 -102
- package/src/noneData/index.ts +3 -3
- package/src/noneData/plugins/Container.ts +27 -27
- package/src/noneData/plugins/Tooltip.ts +373 -373
- package/src/relationship/defaults.ts +220 -218
- package/src/relationship/index.ts +5 -5
- package/src/relationship/plugins/ForceDirected.ts +1168 -1168
- package/src/relationship/plugins/ForceDirectedBubbles.ts +1403 -1403
- package/src/relationship/plugins/RelationshipLegend.ts +100 -100
- package/src/relationship/plugins/RelationshipTooltip.ts +66 -66
- package/src/relationship/relationshipObservables.ts +49 -49
- package/src/series/defaults.ts +221 -230
- package/src/series/index.ts +9 -9
- package/src/series/plugins/Bubbles.ts +636 -620
- package/src/series/plugins/Pie.ts +623 -623
- package/src/series/plugins/PieEventTexts.ts +284 -284
- 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 -107
- package/src/series/plugins/SeriesTooltip.ts +66 -66
- package/src/series/seriesObservables.ts +145 -145
- package/src/series/seriesUtils.ts +51 -51
- package/src/tree/defaults.ts +102 -100
- package/src/tree/index.ts +4 -4
- package/src/tree/plugins/TreeLegend.ts +100 -100
- package/src/tree/plugins/TreeMap.ts +341 -341
- package/src/tree/plugins/TreeTooltip.ts +66 -66
- package/src/utils/commonUtils.ts +31 -22
- package/src/utils/d3Graphics.ts +176 -174
- package/src/utils/d3Utils.ts +92 -92
- package/src/utils/observables.ts +14 -14
- package/src/utils/orbchartsUtils.ts +129 -129
- package/tsconfig.base.json +13 -13
- package/tsconfig.json +2 -2
- package/vite.config.js +22 -22
- package/dist/orbcharts-plugins-basic/src/grid/plugins/GridZoom.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedBar.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/index.d.ts +0 -7
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedBar.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiValue/defaults.d.ts +0 -9
- package/dist/orbcharts-plugins-basic/src/multiValue/multiValueObservables.d.ts +0 -33
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYZoom.d.ts +0 -1
- /package/dist/{orbcharts-plugins-basic/lib → lib}/core-types.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/lib → lib}/core.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/lib → lib}/plugins-basic-types.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/base/BaseGroupAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/base/BaseLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/base/BaseTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/base/types.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/const.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/Bars.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/BarsPN.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/BarsTriangle.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/Dots.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GridLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GridTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GroupAux.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GroupAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/LineAreas.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/Lines.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/StackedValueAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/ValueAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/multiGridObservables.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiBars.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiBarsTriangle.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiDots.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiGridLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiGridTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiGroupAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiLineAreas.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiLines.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiStackedValueAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiValueAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/OverlappingStackedValueAxes.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/OverlappingValueAxes.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/MultiValueLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/MultiValueTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src/multiValue/plugins/Ranking.d.ts → src/multiValue/plugins/OrdinalBubbles.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src/multiValue/plugins/RankingAxis.d.ts → src/multiValue/plugins/OrdinalXAxis.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src/noneData/plugins/Container.d.ts → src/multiValue/plugins/RacingCounterAxis.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src/noneData/plugins/Tooltip.d.ts → src/multiValue/plugins/RankingAxis_legacy.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/Scatter.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/ScatterBubbles.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/XYAux.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src/multiValue/plugins/XYAxes.d.ts → src/multiValue/plugins/XYAxes_legacy.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/noneData/defaults.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/noneData/index.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src/series/plugins/Waffle.d.ts → src/noneData/plugins/Container.d.ts} +0 -0
- /package/{src/multiValue/plugins/Ranking.ts → dist/src/noneData/plugins/Tooltip.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/defaults.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/index.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/ForceDirected.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/ForceDirectedBubbles.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/RelationshipLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/RelationshipTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/relationshipObservables.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/defaults.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/index.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/Bubbles.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/Pie.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/PieEventTexts.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/PieLabels.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/Rose.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/RoseLabels.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/SeriesLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/SeriesTooltip.d.ts +0 -0
- /package/{src/multiValue/plugins/RankingAxis.ts → dist/src/series/plugins/Waffle.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/seriesObservables.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/seriesUtils.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/tree/defaults.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/tree/index.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/tree/plugins/TreeLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/tree/plugins/TreeMap.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/tree/plugins/TreeTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/utils/d3Utils.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/utils/observables.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/utils/orbchartsUtils.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/vite.config.d.ts → vite.config.d.ts} +0 -0
@@ -1,167 +1,389 @@
|
|
1
|
-
import type {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
-
const
|
47
|
-
? `<
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
${
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
const
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
</text>\`
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
}
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
}
|
89
|
-
|
90
|
-
export const
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
//
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
1
|
+
import type { ComputedDataTypeMap } from '../../lib/core-types'
|
2
|
+
import type {
|
3
|
+
MultiValueLegendParams,
|
4
|
+
MultiValueTooltipParams,
|
5
|
+
RacingBarsParams,
|
6
|
+
RacingCounterTextsParams,
|
7
|
+
RacingValueAxisParams,
|
8
|
+
ScatterParams,
|
9
|
+
ScatterBubblesParams,
|
10
|
+
XAxisParams,
|
11
|
+
XYAuxParams,
|
12
|
+
XYAxesParams,
|
13
|
+
XZoomParams
|
14
|
+
} from '../../lib/plugins-basic-types'
|
15
|
+
|
16
|
+
|
17
|
+
export const DEFAULT_MULTI_VALUE_LEGEND_PARAMS: MultiValueLegendParams = {
|
18
|
+
// position: 'right',
|
19
|
+
// justify: 'end',
|
20
|
+
placement: 'bottom',
|
21
|
+
padding: 28,
|
22
|
+
// offset: [0, 0],
|
23
|
+
backgroundFill: 'none',
|
24
|
+
backgroundStroke: 'none',
|
25
|
+
gap: 10,
|
26
|
+
listRectWidth: 14,
|
27
|
+
listRectHeight: 14,
|
28
|
+
listRectRadius: 0,
|
29
|
+
// highlightEvent: false
|
30
|
+
textColorType: 'primary'
|
31
|
+
}
|
32
|
+
|
33
|
+
export const DEFAULT_MULTI_VALUE_TOOLTIP_PARAMS: MultiValueTooltipParams = {
|
34
|
+
backgroundColorType: 'background',
|
35
|
+
strokeColorType: 'primary',
|
36
|
+
backgroundOpacity: 0.8,
|
37
|
+
textColorType: 'primary',
|
38
|
+
offset: [20, 5],
|
39
|
+
padding: 10,
|
40
|
+
renderFn: (eventData, { styles, utils }) => {
|
41
|
+
const hasCategoryLabel = eventData.categoryLabel === '' ? false : true
|
42
|
+
const hasDatumLabel = eventData.datum.label.slice(0, 11) === 'multiValue_' ? false : true
|
43
|
+
const valueText = eventData.datum._visibleValue.map(d => utils.toCurrency(d))
|
44
|
+
const bulletWidth = styles.textSizePx * 0.7
|
45
|
+
const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
|
46
|
+
const categorySvg = hasCategoryLabel
|
47
|
+
? `<rect width="${bulletWidth}" height="${bulletWidth}" x="${offset}" y="${offset - 1}" rx="${bulletWidth / 2}" fill="${eventData.datum.color}"></rect>
|
48
|
+
<text x="${styles.textSizePx * 1.5}" font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">
|
49
|
+
<tspan>${eventData.categoryLabel}</tspan>
|
50
|
+
</text>`
|
51
|
+
: ''
|
52
|
+
const datumLabelSvg = hasDatumLabel
|
53
|
+
? `<tspan>${eventData.datum.label}</tspan> `
|
54
|
+
: ''
|
55
|
+
const datumSvg = `<text font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">
|
56
|
+
${datumLabelSvg}<tspan font-weight="bold">${valueText}</tspan>
|
57
|
+
</text>`
|
58
|
+
|
59
|
+
return `${categorySvg}
|
60
|
+
<g ${hasCategoryLabel ? `transform="translate(0, ${styles.textSizePx * 2})"` : ''}>
|
61
|
+
${datumSvg}
|
62
|
+
</g>`
|
63
|
+
},
|
64
|
+
}
|
65
|
+
DEFAULT_MULTI_VALUE_TOOLTIP_PARAMS.renderFn.toString = () => `(eventData, { styles, utils }) => {
|
66
|
+
const hasCategoryLabel = eventData.categoryLabel === '' ? false : true
|
67
|
+
const hasDatumLabel = eventData.datum.label.slice(0, 11) === 'multiValue_' ? false : true
|
68
|
+
const valueText = eventData.datum._visibleValue.map(d => utils.toCurrency(d))
|
69
|
+
const bulletWidth = styles.textSizePx * 0.7
|
70
|
+
const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
|
71
|
+
const categorySvg = hasCategoryLabel
|
72
|
+
? \`<rect width="\${bulletWidth}" height="\${bulletWidth}" x="\${offset}" y="\${offset - 1}" rx="\${bulletWidth / 2}" fill="\${eventData.datum.color}"></rect>
|
73
|
+
<text x="\${styles.textSizePx * 1.5}" font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
74
|
+
<tspan>\${eventData.categoryLabel}</tspan>
|
75
|
+
</text>\`
|
76
|
+
: ''
|
77
|
+
const datumLabelSvg = hasDatumLabel
|
78
|
+
? \`<tspan>\${eventData.datum.label}</tspan> \`
|
79
|
+
: ''
|
80
|
+
const datumSvg = \`<text font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
81
|
+
\${datumLabelSvg}<tspan font-weight="bold">\${valueText}</tspan>
|
82
|
+
</text>\`
|
83
|
+
|
84
|
+
return \`\${categorySvg}
|
85
|
+
<g \${hasCategoryLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
|
86
|
+
\${datumSvg}
|
87
|
+
</g>\`
|
88
|
+
}`
|
89
|
+
|
90
|
+
// export const DEFAULT_RANKING_AXIS_PARAMS: RacingAxisParams = {
|
91
|
+
// labelOffset: [0, 0],
|
92
|
+
// labelColorType: 'primary',
|
93
|
+
// axisLineVisible: false,
|
94
|
+
// axisLineColorType: 'primary',
|
95
|
+
// // ticks: null,
|
96
|
+
// // tickFormat: v => v,
|
97
|
+
// tickLineVisible: true,
|
98
|
+
// tickPadding: 20,
|
99
|
+
// // tickFullLine: true,
|
100
|
+
// // tickFullLineDasharray: 'none',
|
101
|
+
// tickColorType: 'secondary',
|
102
|
+
// tickTextRotate: 0,
|
103
|
+
// tickTextColorType: 'primary'
|
104
|
+
// }
|
105
|
+
|
106
|
+
export const DEFAULT_RACING_BARS_PARAMS: RacingBarsParams = {
|
107
|
+
bar: {
|
108
|
+
barWidth: 0,
|
109
|
+
barPadding: 8,
|
110
|
+
barRadius: false,
|
111
|
+
},
|
112
|
+
barLabel: {
|
113
|
+
position: 'inside',
|
114
|
+
padding: 20,
|
115
|
+
rotate: 0,
|
116
|
+
colorType: 'labelContrast'
|
117
|
+
},
|
118
|
+
valueLabel: {
|
119
|
+
padding: 20,
|
120
|
+
colorType: 'primary',
|
121
|
+
// format: num => {
|
122
|
+
// if (num === null || Number.isNaN(num) == true) {
|
123
|
+
// return num || 0
|
124
|
+
// }
|
125
|
+
// var parts = num.toString().split('.')
|
126
|
+
// parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
127
|
+
// return parts.join('.')
|
128
|
+
// }
|
129
|
+
format: v => v
|
130
|
+
},
|
131
|
+
axisLabel: {
|
132
|
+
offset: [0, 0],
|
133
|
+
colorType: 'primary'
|
134
|
+
},
|
135
|
+
// rankingAmount: 'auto'
|
136
|
+
rankingAmount: 10,
|
137
|
+
autorun: false,
|
138
|
+
loop: false
|
139
|
+
}
|
140
|
+
// DEFAULT_RACING_BARS_PARAMS.valueLabel.format.toString = () => `num => {
|
141
|
+
// if (num === null || Number.isNaN(num) == true) {
|
142
|
+
// return num || 0
|
143
|
+
// }
|
144
|
+
// var parts = num.toString().split('.')
|
145
|
+
// parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
146
|
+
// return parts.join('.')
|
147
|
+
// }
|
148
|
+
// }`
|
149
|
+
DEFAULT_RACING_BARS_PARAMS.valueLabel.format.toString = () => `v => v`
|
150
|
+
|
151
|
+
export const DEFAULT_RACING_COUNTER_TEXTS_PARAMS: RacingCounterTextsParams = {
|
152
|
+
renderFn: (valueLabel: string, valueIndex: number, data: ComputedDataTypeMap<'multiValue'>) => {
|
153
|
+
return valueLabel
|
154
|
+
},
|
155
|
+
textAttrs: [
|
156
|
+
{
|
157
|
+
"transform": "translate(0, 0)"
|
158
|
+
}
|
159
|
+
],
|
160
|
+
textStyles: [
|
161
|
+
{
|
162
|
+
"font-weight": "bold",
|
163
|
+
"text-anchor": "end",
|
164
|
+
"pointer-events": "none",
|
165
|
+
"dominant-baseline": "auto",
|
166
|
+
"font-size": 64,
|
167
|
+
"fill": "#bebebe"
|
168
|
+
},
|
169
|
+
{
|
170
|
+
"text-anchor": "end",
|
171
|
+
"pointer-events": "none",
|
172
|
+
"dominant-baseline": "auto",
|
173
|
+
"font-size": 24,
|
174
|
+
"fill": "#bebebe"
|
175
|
+
},
|
176
|
+
],
|
177
|
+
paddingRight: 0,
|
178
|
+
paddingBottom: 0
|
179
|
+
}
|
180
|
+
|
181
|
+
export const DEFAULT_RACING_VALUE_AXIS_PARAMS: RacingValueAxisParams = {
|
182
|
+
labelOffset: [0, 0],
|
183
|
+
labelColorType: 'primary',
|
184
|
+
axisLineVisible: false,
|
185
|
+
axisLineColorType: 'secondary',
|
186
|
+
ticks: null,
|
187
|
+
// tickFormat: ',.0f',
|
188
|
+
// tickFormat: v => v,
|
189
|
+
tickFormat: num => {
|
190
|
+
if (num === null || Number.isNaN(num) == true) {
|
191
|
+
return num || 0
|
192
|
+
}
|
193
|
+
var parts = num.toString().split('.')
|
194
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
195
|
+
return parts.join('.')
|
196
|
+
},
|
197
|
+
tickLineVisible: true,
|
198
|
+
tickPadding: 20,
|
199
|
+
tickFullLine: true,
|
200
|
+
tickFullLineDasharray: 'none',
|
201
|
+
tickColorType: 'secondary',
|
202
|
+
tickTextColorType: 'primary'
|
203
|
+
}
|
204
|
+
DEFAULT_RACING_VALUE_AXIS_PARAMS.tickFormat.toString = () => `num => {
|
205
|
+
if (num === null || Number.isNaN(num) == true) {
|
206
|
+
return num || 0
|
207
|
+
}
|
208
|
+
var parts = num.toString().split('.')
|
209
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
210
|
+
return parts.join('.')
|
211
|
+
}`
|
212
|
+
|
213
|
+
export const DEFAULT_SCATTER_PARAMS: ScatterParams = {
|
214
|
+
radius: 5,
|
215
|
+
fillColorType: 'label',
|
216
|
+
strokeColorType: 'label',
|
217
|
+
strokeWidth: 0,
|
218
|
+
}
|
219
|
+
|
220
|
+
export const DEFAULT_SCATTER_BUBBLES_PARAMS: ScatterBubblesParams = {
|
221
|
+
// radius: 5,
|
222
|
+
fillColorType: 'label',
|
223
|
+
strokeColorType: 'label',
|
224
|
+
strokeWidth: 0,
|
225
|
+
valueLinearOpacity: [0.8, 0.8],
|
226
|
+
arcScaleType: 'area',
|
227
|
+
sizeAdjust: 0.5
|
228
|
+
}
|
229
|
+
|
230
|
+
export const DEFAULT_X_AXIS_PARAMS: XAxisParams = {
|
231
|
+
labelOffset: [0, 0],
|
232
|
+
labelColorType: 'primary',
|
233
|
+
axisLineVisible: false,
|
234
|
+
axisLineColorType: 'secondary',
|
235
|
+
ticks: null,
|
236
|
+
// tickFormat: ',.0f',
|
237
|
+
// tickFormat: v => v,
|
238
|
+
tickFormat: num => {
|
239
|
+
if (num === null || Number.isNaN(num) == true) {
|
240
|
+
return num || 0
|
241
|
+
}
|
242
|
+
var parts = num.toString().split('.')
|
243
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
244
|
+
return parts.join('.')
|
245
|
+
},
|
246
|
+
tickLineVisible: true,
|
247
|
+
tickPadding: 20,
|
248
|
+
tickFullLine: true,
|
249
|
+
tickFullLineDasharray: 'none',
|
250
|
+
tickColorType: 'secondary',
|
251
|
+
tickTextColorType: 'primary'
|
252
|
+
}
|
253
|
+
DEFAULT_X_AXIS_PARAMS.tickFormat.toString = () => `num => {
|
254
|
+
if (num === null || Number.isNaN(num) == true) {
|
255
|
+
return num || 0
|
256
|
+
}
|
257
|
+
var parts = num.toString().split('.')
|
258
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
259
|
+
return parts.join('.')
|
260
|
+
}`
|
261
|
+
|
262
|
+
export const DEFAULT_X_Y_AUX_PARAMS: XYAuxParams = {
|
263
|
+
xAxis: {
|
264
|
+
showLine: true,
|
265
|
+
showLabel: true,
|
266
|
+
lineDashArray: '3, 3',
|
267
|
+
lineColorType: 'primary',
|
268
|
+
labelColorType: 'primary',
|
269
|
+
labelTextColorType: 'background',
|
270
|
+
// labelTextFormat: text => text,
|
271
|
+
// labelTextFormat: (value: number) => String(Math.round(value)),
|
272
|
+
labelTextFormat: num => {
|
273
|
+
if (num === null || Number.isNaN(num) == true) {
|
274
|
+
return num || 0
|
275
|
+
}
|
276
|
+
var parts = num.toString().split('.')
|
277
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
278
|
+
return parts.join('.')
|
279
|
+
},
|
280
|
+
labelPadding: 20,
|
281
|
+
// labelRotate: 0
|
282
|
+
},
|
283
|
+
yAxis: {
|
284
|
+
showLine: true,
|
285
|
+
showLabel: true,
|
286
|
+
lineDashArray: '3, 3',
|
287
|
+
lineColorType: 'primary',
|
288
|
+
labelColorType: 'primary',
|
289
|
+
labelTextColorType: 'background',
|
290
|
+
// labelTextFormat: text => text,
|
291
|
+
// labelTextFormat: (value: number) => String(Math.round(value)),
|
292
|
+
labelTextFormat: num => {
|
293
|
+
if (num === null || Number.isNaN(num) == true) {
|
294
|
+
return num || 0
|
295
|
+
}
|
296
|
+
var parts = num.toString().split('.')
|
297
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
298
|
+
return parts.join('.')
|
299
|
+
},
|
300
|
+
labelPadding: 20,
|
301
|
+
// labelRotate: 0
|
302
|
+
}
|
303
|
+
}
|
304
|
+
DEFAULT_X_Y_AUX_PARAMS.xAxis.labelTextFormat.toString = () => `num => {
|
305
|
+
if (num === null || Number.isNaN(num) == true) {
|
306
|
+
return num || 0
|
307
|
+
}
|
308
|
+
var parts = num.toString().split('.')
|
309
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
310
|
+
return parts.join('.')
|
311
|
+
}`
|
312
|
+
DEFAULT_X_Y_AUX_PARAMS.yAxis.labelTextFormat.toString = () => `num => {
|
313
|
+
if (num === null || Number.isNaN(num) == true) {
|
314
|
+
return num || 0
|
315
|
+
}
|
316
|
+
var parts = num.toString().split('.')
|
317
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
318
|
+
return parts.join('.')
|
319
|
+
}`
|
320
|
+
|
321
|
+
|
322
|
+
export const DEFAULT_X_Y_AXES_PARAMS: XYAxesParams = {
|
323
|
+
xAxis: {
|
324
|
+
labelOffset: [0, 0],
|
325
|
+
labelColorType: 'primary',
|
326
|
+
axisLineVisible: false,
|
327
|
+
axisLineColorType: 'primary',
|
328
|
+
ticks: null,
|
329
|
+
// tickFormat: ',.0f',
|
330
|
+
// tickFormat: v => v,
|
331
|
+
tickFormat: num => {
|
332
|
+
if (num === null || Number.isNaN(num) == true) {
|
333
|
+
return num || 0
|
334
|
+
}
|
335
|
+
var parts = num.toString().split('.')
|
336
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
337
|
+
return parts.join('.')
|
338
|
+
},
|
339
|
+
tickLineVisible: true,
|
340
|
+
tickPadding: 20,
|
341
|
+
tickFullLine: true,
|
342
|
+
tickFullLineDasharray: 'none',
|
343
|
+
tickColorType: 'secondary',
|
344
|
+
tickTextColorType: 'primary'
|
345
|
+
},
|
346
|
+
yAxis: {
|
347
|
+
labelOffset: [0, 0],
|
348
|
+
labelColorType: 'primary',
|
349
|
+
axisLineVisible: false,
|
350
|
+
axisLineColorType: 'primary',
|
351
|
+
ticks: null,
|
352
|
+
// tickFormat: ',.0f',
|
353
|
+
// tickFormat: v => v,
|
354
|
+
tickFormat: num => {
|
355
|
+
if (num === null || Number.isNaN(num) == true) {
|
356
|
+
return num || 0
|
357
|
+
}
|
358
|
+
var parts = num.toString().split('.')
|
359
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
360
|
+
return parts.join('.')
|
361
|
+
},
|
362
|
+
tickLineVisible: true,
|
363
|
+
tickPadding: 20,
|
364
|
+
tickFullLine: true,
|
365
|
+
tickFullLineDasharray: 'none',
|
366
|
+
tickColorType: 'secondary',
|
367
|
+
tickTextColorType: 'primary'
|
368
|
+
}
|
369
|
+
}
|
370
|
+
DEFAULT_X_Y_AXES_PARAMS.xAxis.tickFormat.toString = () => `num => {
|
371
|
+
if (num === null || Number.isNaN(num) == true) {
|
372
|
+
return num || 0
|
373
|
+
}
|
374
|
+
var parts = num.toString().split('.')
|
375
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
376
|
+
return parts.join('.')
|
377
|
+
}`
|
378
|
+
DEFAULT_X_Y_AXES_PARAMS.yAxis.tickFormat.toString = () => `num => {
|
379
|
+
if (num === null || Number.isNaN(num) == true) {
|
380
|
+
return num || 0
|
381
|
+
}
|
382
|
+
var parts = num.toString().split('.')
|
383
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
384
|
+
return parts.join('.')
|
385
|
+
}`
|
386
|
+
|
387
|
+
export const DEFAULT_X_Y_ZOOM_PARAMS: XZoomParams = {
|
388
|
+
|
167
389
|
}
|
package/src/multiValue/index.ts
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
export * from './defaults'
|
2
|
-
// export * from './types'
|
3
|
-
export { MultiValueLegend } from './plugins/MultiValueLegend'
|
4
|
-
export { MultiValueTooltip } from './plugins/MultiValueTooltip'
|
5
|
-
export {
|
6
|
-
export {
|
7
|
-
export {
|
8
|
-
export {
|
9
|
-
export {
|
1
|
+
export * from './defaults'
|
2
|
+
// export * from './types'
|
3
|
+
export { MultiValueLegend } from './plugins/MultiValueLegend'
|
4
|
+
export { MultiValueTooltip } from './plugins/MultiValueTooltip'
|
5
|
+
export { RacingBars } from './plugins/RacingBars'
|
6
|
+
export { RacingCounterTexts } from './plugins/RacingCounterTexts'
|
7
|
+
export { RacingValueAxis } from './plugins/RacingValueAxis'
|
8
|
+
export { Scatter } from './plugins/Scatter'
|
9
|
+
export { ScatterBubbles } from './plugins/ScatterBubbles'
|
10
|
+
export { XAxis } from './plugins/XAxis'
|
11
|
+
export { XYAux } from './plugins/XYAux'
|
12
|
+
export { XYAxes } from './plugins/XYAxes'
|
13
|
+
export { XZoom } from './plugins/XZoom'
|