@orbcharts/plugins-basic 3.0.0-alpha.44 → 3.0.0-alpha.45
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +200 -200
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBarStack.d.ts +6 -4
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBars.d.ts +6 -4
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBarsTriangle.d.ts +7 -4
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseDots.d.ts +5 -3
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseGroupAxis.d.ts +3 -3
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLineAreas.d.ts +6 -3
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLines.d.ts +6 -3
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseValueAxis.d.ts +3 -3
- package/dist/{src → orbcharts-plugins-basic/src}/grid/gridObservables.d.ts +4 -4
- package/dist/orbcharts-plugins-basic/src/index.d.ts +5 -0
- package/dist/orbcharts-plugins-basic/src/multiGrid/multiGridObservables.d.ts +8 -0
- package/dist/orbcharts-plugins-basic/src/series/plugins/PieEventTexts.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/series/seriesObservables.d.ts +21 -0
- package/dist/{src → orbcharts-plugins-basic/src}/series/seriesUtils.d.ts +3 -3
- package/dist/orbcharts-plugins-basic.es.js +7696 -7529
- package/dist/orbcharts-plugins-basic.umd.js +8 -8
- package/dist/src/index.d.ts +1 -5
- package/package.json +42 -42
- package/src/base/BaseBarStack.ts +778 -881
- package/src/base/BaseBars.ts +764 -750
- package/src/base/BaseBarsTriangle.ts +672 -659
- package/src/base/BaseDots.ts +502 -639
- package/src/base/BaseGroupAxis.ts +496 -496
- package/src/base/BaseLegend.ts +641 -641
- package/src/base/BaseLineAreas.ts +625 -621
- package/src/base/BaseLines.ts +699 -692
- package/src/base/BaseValueAxis.ts +478 -479
- package/src/base/types.ts +2 -2
- package/src/grid/defaults.ts +121 -121
- package/src/grid/gridObservables.ts +247 -263
- package/src/grid/index.ts +15 -15
- package/src/grid/plugins/BarStack.ts +50 -37
- package/src/grid/plugins/Bars.ts +51 -37
- package/src/grid/plugins/BarsDiverging.ts +41 -39
- package/src/grid/plugins/BarsTriangle.ts +50 -34
- package/src/grid/plugins/Dots.ts +37 -35
- package/src/grid/plugins/GridLegend.ts +59 -59
- package/src/grid/plugins/GroupAux.ts +645 -646
- package/src/grid/plugins/GroupAxis.ts +42 -30
- package/src/grid/plugins/LineAreas.ts +39 -36
- package/src/grid/plugins/Lines.ts +38 -35
- package/src/grid/plugins/ScalingArea.ts +173 -174
- package/src/grid/plugins/ValueAxis.ts +43 -31
- package/src/grid/plugins/ValueStackAxis.ts +79 -70
- package/src/grid/types.ts +120 -120
- package/src/index.ts +9 -9
- package/src/multiGrid/defaults.ts +147 -147
- package/src/multiGrid/index.ts +11 -11
- package/src/multiGrid/multiGridObservables.ts +42 -289
- package/src/multiGrid/plugins/MultiBarStack.ts +74 -60
- package/src/multiGrid/plugins/MultiBars.ts +73 -59
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +73 -58
- package/src/multiGrid/plugins/MultiDots.ts +60 -58
- package/src/multiGrid/plugins/MultiGridLegend.ts +89 -89
- package/src/multiGrid/plugins/MultiGroupAxis.ts +65 -53
- package/src/multiGrid/plugins/MultiLineAreas.ts +62 -59
- package/src/multiGrid/plugins/MultiLines.ts +61 -58
- package/src/multiGrid/plugins/MultiValueAxis.ts +65 -53
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +169 -164
- package/src/multiGrid/types.ts +67 -67
- package/src/noneData/defaults.ts +64 -61
- package/src/noneData/index.ts +3 -3
- package/src/noneData/plugins/Container.ts +10 -10
- package/src/noneData/plugins/Tooltip.ts +310 -310
- package/src/noneData/types.ts +26 -26
- package/src/series/defaults.ts +109 -99
- package/src/series/index.ts +6 -6
- package/src/series/plugins/Bubbles.ts +571 -551
- package/src/series/plugins/Pie.ts +548 -600
- package/src/series/plugins/PieEventTexts.ts +258 -194
- package/src/series/plugins/PieLabels.ts +335 -288
- package/src/series/plugins/SeriesLegend.ts +59 -59
- package/src/series/seriesObservables.ts +145 -0
- package/src/series/seriesUtils.ts +50 -50
- package/src/series/types.ts +67 -67
- package/src/tree/defaults.ts +22 -22
- package/src/tree/index.ts +3 -3
- package/src/tree/plugins/TreeLegend.ts +59 -59
- package/src/tree/plugins/TreeMap.ts +305 -305
- package/src/tree/types.ts +23 -23
- package/src/utils/commonUtils.ts +21 -21
- package/src/utils/d3Graphics.ts +124 -124
- package/src/utils/d3Utils.ts +73 -73
- package/src/utils/observables.ts +14 -14
- package/src/utils/orbchartsUtils.ts +100 -100
- package/tsconfig.dev.json +16 -16
- package/tsconfig.json +16 -13
- package/tsconfig.prod.json +13 -13
- package/vite.config.js +49 -49
- package/dist/src/multiGrid/multiGridObservables.d.ts +0 -12
- package/dist/src/series/plugins/PieEventTexts.d.ts +0 -1
- /package/dist/{src → orbcharts-plugins-basic/src}/base/BaseGroupArea.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/base/types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/index.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarStack.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/BarsDiverging.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/Ranking.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/RankingAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/ScalingArea.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}/grid/plugins/ValueStackAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/index.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBarStack.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 → orbcharts-plugins-basic/src}/multiGrid/types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiValue/index.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiValue/plugins/Scatter.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiValue/plugins/ScatterAxes.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/noneData/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/noneData/index.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/noneData/plugins/Container.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/noneData/plugins/Tooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/noneData/types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/relationship/index.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/relationship/plugins/Relationship.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/index.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/PieLabels.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/types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/index.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}/tree/types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/utils/commonUtils.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Graphics.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Utils.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/utils/observables.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/utils/orbchartsUtils.d.ts +0 -0
- /package/dist/{vite.config.d.ts → orbcharts-plugins-basic/vite.config.d.ts} +0 -0
@@ -1,147 +1,147 @@
|
|
1
|
-
import type {
|
2
|
-
MultiGridLegendParams,
|
3
|
-
MultiBarsParams,
|
4
|
-
MultiBarStackParams,
|
5
|
-
MultiBarsTriangleParams,
|
6
|
-
MultiLinesParams,
|
7
|
-
MultiLineAreasParams,
|
8
|
-
MultiDotsParams,
|
9
|
-
MultiGroupAxisParams,
|
10
|
-
MultiValueAxisParams,
|
11
|
-
OverlappingValueAxesParams
|
12
|
-
} from './types'
|
13
|
-
|
14
|
-
export const DEFAULT_MULTI_GRID_LEGEND_PARAMS: MultiGridLegendParams = {
|
15
|
-
position: 'right',
|
16
|
-
justify: 'end',
|
17
|
-
padding: 28,
|
18
|
-
backgroundFill: 'none',
|
19
|
-
backgroundStroke: 'none',
|
20
|
-
gap: 10,
|
21
|
-
listRectWidth: 14,
|
22
|
-
listRectHeight: 14,
|
23
|
-
listRectRadius: 0,
|
24
|
-
gridList: [
|
25
|
-
{
|
26
|
-
listRectWidth: 14,
|
27
|
-
listRectHeight: 14,
|
28
|
-
listRectRadius: 0,
|
29
|
-
}
|
30
|
-
],
|
31
|
-
textColorType: 'primary'
|
32
|
-
}
|
33
|
-
|
34
|
-
export const DEFAULT_MULTI_GROUP_AXIS_PARAMS: MultiGroupAxisParams = {
|
35
|
-
// labelAnchor: 'start',
|
36
|
-
labelOffset: [0, 0],
|
37
|
-
labelColorType: 'primary',
|
38
|
-
axisLineVisible: true,
|
39
|
-
axisLineColorType: 'primary',
|
40
|
-
tickFormat: text => text,
|
41
|
-
tickLineVisible: true,
|
42
|
-
tickPadding: 20,
|
43
|
-
tickFullLine: false,
|
44
|
-
tickFullLineDasharray: 'none',
|
45
|
-
tickColorType: 'secondary',
|
46
|
-
tickTextRotate: 0,
|
47
|
-
tickTextColorType: 'primary',
|
48
|
-
gridIndexes: [0]
|
49
|
-
}
|
50
|
-
|
51
|
-
export const DEFAULT_MULTI_VALUE_AXIS_PARAMS: MultiValueAxisParams = {
|
52
|
-
// labelAnchor: 'end',
|
53
|
-
labelOffset: [0, 0],
|
54
|
-
labelColorType: 'primary',
|
55
|
-
axisLineVisible: false,
|
56
|
-
axisLineColorType: 'primary',
|
57
|
-
ticks: 4,
|
58
|
-
tickFormat: ',.0f',
|
59
|
-
tickLineVisible: true,
|
60
|
-
tickPadding: 20,
|
61
|
-
tickFullLine: true,
|
62
|
-
tickFullLineDasharray: 'none',
|
63
|
-
tickColorType: 'secondary',
|
64
|
-
tickTextRotate: 0,
|
65
|
-
tickTextColorType: 'primary',
|
66
|
-
gridIndexes: [0]
|
67
|
-
}
|
68
|
-
|
69
|
-
export const DEFAULT_MULTI_BARS_PARAMS: MultiBarsParams = {
|
70
|
-
barWidth: 0,
|
71
|
-
barPadding: 1,
|
72
|
-
barGroupPadding: 40,
|
73
|
-
barRadius: false,
|
74
|
-
gridIndexes: [0]
|
75
|
-
}
|
76
|
-
|
77
|
-
export const DEFAULT_MULTI_BAR_STACK_PARAMS: MultiBarStackParams = {
|
78
|
-
barWidth: 0,
|
79
|
-
barGroupPadding: 10,
|
80
|
-
barRadius: false,
|
81
|
-
gridIndexes: [0]
|
82
|
-
}
|
83
|
-
|
84
|
-
export const DEFAULT_MULTI_BARS_TRIANGLE_PARAMS: MultiBarsTriangleParams = {
|
85
|
-
barWidth: 0,
|
86
|
-
barPadding: 1,
|
87
|
-
barGroupPadding: 20,
|
88
|
-
linearGradientOpacity: [1, 0],
|
89
|
-
gridIndexes: [0]
|
90
|
-
}
|
91
|
-
|
92
|
-
export const DEFAULT_MULTI_LINES_PARAMS: MultiLinesParams = {
|
93
|
-
lineCurve: 'curveLinear',
|
94
|
-
lineWidth: 2,
|
95
|
-
gridIndexes: [1]
|
96
|
-
}
|
97
|
-
|
98
|
-
export const DEFAULT_MULTI_LINE_AREAS_PARAMS: MultiLineAreasParams = {
|
99
|
-
lineCurve: 'curveLinear',
|
100
|
-
linearGradientOpacity: [1, 0],
|
101
|
-
gridIndexes: [1]
|
102
|
-
}
|
103
|
-
|
104
|
-
export const DEFAULT_MULTI_DOTS_PARAMS: MultiDotsParams = {
|
105
|
-
radius: 4,
|
106
|
-
fillColorType: 'white',
|
107
|
-
strokeColorType: 'series',
|
108
|
-
strokeWidth: 2,
|
109
|
-
onlyShowHighlighted: false,
|
110
|
-
gridIndexes: [1]
|
111
|
-
}
|
112
|
-
|
113
|
-
export const DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS: OverlappingValueAxesParams = {
|
114
|
-
firstAxis: {
|
115
|
-
// labelAnchor: 'end',
|
116
|
-
labelOffset: [0, 0],
|
117
|
-
labelColorType: 'primary',
|
118
|
-
axisLineVisible: false,
|
119
|
-
axisLineColorType: 'primary',
|
120
|
-
ticks: 4,
|
121
|
-
tickFormat: ',.0f',
|
122
|
-
tickLineVisible: true,
|
123
|
-
tickPadding: 20,
|
124
|
-
tickFullLine: true,
|
125
|
-
tickFullLineDasharray: 'none',
|
126
|
-
tickColorType: 'secondary',
|
127
|
-
tickTextRotate: 0,
|
128
|
-
tickTextColorType: 'primary',
|
129
|
-
},
|
130
|
-
secondAxis: {
|
131
|
-
// labelAnchor: 'end',
|
132
|
-
labelOffset: [0, 0],
|
133
|
-
labelColorType: 'primary',
|
134
|
-
axisLineVisible: false,
|
135
|
-
axisLineColorType: 'primary',
|
136
|
-
ticks: 4,
|
137
|
-
tickFormat: ',.0f',
|
138
|
-
tickLineVisible: true,
|
139
|
-
tickPadding: 20,
|
140
|
-
tickFullLine: true,
|
141
|
-
tickFullLineDasharray: 'none',
|
142
|
-
tickColorType: 'secondary',
|
143
|
-
tickTextRotate: 0,
|
144
|
-
tickTextColorType: 'primary',
|
145
|
-
},
|
146
|
-
gridIndexes: [0, 1]
|
147
|
-
}
|
1
|
+
import type {
|
2
|
+
MultiGridLegendParams,
|
3
|
+
MultiBarsParams,
|
4
|
+
MultiBarStackParams,
|
5
|
+
MultiBarsTriangleParams,
|
6
|
+
MultiLinesParams,
|
7
|
+
MultiLineAreasParams,
|
8
|
+
MultiDotsParams,
|
9
|
+
MultiGroupAxisParams,
|
10
|
+
MultiValueAxisParams,
|
11
|
+
OverlappingValueAxesParams
|
12
|
+
} from './types'
|
13
|
+
|
14
|
+
export const DEFAULT_MULTI_GRID_LEGEND_PARAMS: MultiGridLegendParams = {
|
15
|
+
position: 'right',
|
16
|
+
justify: 'end',
|
17
|
+
padding: 28,
|
18
|
+
backgroundFill: 'none',
|
19
|
+
backgroundStroke: 'none',
|
20
|
+
gap: 10,
|
21
|
+
listRectWidth: 14,
|
22
|
+
listRectHeight: 14,
|
23
|
+
listRectRadius: 0,
|
24
|
+
gridList: [
|
25
|
+
{
|
26
|
+
listRectWidth: 14,
|
27
|
+
listRectHeight: 14,
|
28
|
+
listRectRadius: 0,
|
29
|
+
}
|
30
|
+
],
|
31
|
+
textColorType: 'primary'
|
32
|
+
}
|
33
|
+
|
34
|
+
export const DEFAULT_MULTI_GROUP_AXIS_PARAMS: MultiGroupAxisParams = {
|
35
|
+
// labelAnchor: 'start',
|
36
|
+
labelOffset: [0, 0],
|
37
|
+
labelColorType: 'primary',
|
38
|
+
axisLineVisible: true,
|
39
|
+
axisLineColorType: 'primary',
|
40
|
+
tickFormat: text => text,
|
41
|
+
tickLineVisible: true,
|
42
|
+
tickPadding: 20,
|
43
|
+
tickFullLine: false,
|
44
|
+
tickFullLineDasharray: 'none',
|
45
|
+
tickColorType: 'secondary',
|
46
|
+
tickTextRotate: 0,
|
47
|
+
tickTextColorType: 'primary',
|
48
|
+
gridIndexes: [0]
|
49
|
+
}
|
50
|
+
|
51
|
+
export const DEFAULT_MULTI_VALUE_AXIS_PARAMS: MultiValueAxisParams = {
|
52
|
+
// labelAnchor: 'end',
|
53
|
+
labelOffset: [0, 0],
|
54
|
+
labelColorType: 'primary',
|
55
|
+
axisLineVisible: false,
|
56
|
+
axisLineColorType: 'primary',
|
57
|
+
ticks: 4,
|
58
|
+
tickFormat: ',.0f',
|
59
|
+
tickLineVisible: true,
|
60
|
+
tickPadding: 20,
|
61
|
+
tickFullLine: true,
|
62
|
+
tickFullLineDasharray: 'none',
|
63
|
+
tickColorType: 'secondary',
|
64
|
+
tickTextRotate: 0,
|
65
|
+
tickTextColorType: 'primary',
|
66
|
+
gridIndexes: [0]
|
67
|
+
}
|
68
|
+
|
69
|
+
export const DEFAULT_MULTI_BARS_PARAMS: MultiBarsParams = {
|
70
|
+
barWidth: 0,
|
71
|
+
barPadding: 1,
|
72
|
+
barGroupPadding: 40,
|
73
|
+
barRadius: false,
|
74
|
+
gridIndexes: [0]
|
75
|
+
}
|
76
|
+
|
77
|
+
export const DEFAULT_MULTI_BAR_STACK_PARAMS: MultiBarStackParams = {
|
78
|
+
barWidth: 0,
|
79
|
+
barGroupPadding: 10,
|
80
|
+
barRadius: false,
|
81
|
+
gridIndexes: [0]
|
82
|
+
}
|
83
|
+
|
84
|
+
export const DEFAULT_MULTI_BARS_TRIANGLE_PARAMS: MultiBarsTriangleParams = {
|
85
|
+
barWidth: 0,
|
86
|
+
barPadding: 1,
|
87
|
+
barGroupPadding: 20,
|
88
|
+
linearGradientOpacity: [1, 0],
|
89
|
+
gridIndexes: [0]
|
90
|
+
}
|
91
|
+
|
92
|
+
export const DEFAULT_MULTI_LINES_PARAMS: MultiLinesParams = {
|
93
|
+
lineCurve: 'curveLinear',
|
94
|
+
lineWidth: 2,
|
95
|
+
gridIndexes: [1]
|
96
|
+
}
|
97
|
+
|
98
|
+
export const DEFAULT_MULTI_LINE_AREAS_PARAMS: MultiLineAreasParams = {
|
99
|
+
lineCurve: 'curveLinear',
|
100
|
+
linearGradientOpacity: [1, 0],
|
101
|
+
gridIndexes: [1]
|
102
|
+
}
|
103
|
+
|
104
|
+
export const DEFAULT_MULTI_DOTS_PARAMS: MultiDotsParams = {
|
105
|
+
radius: 4,
|
106
|
+
fillColorType: 'white',
|
107
|
+
strokeColorType: 'series',
|
108
|
+
strokeWidth: 2,
|
109
|
+
onlyShowHighlighted: false,
|
110
|
+
gridIndexes: [1]
|
111
|
+
}
|
112
|
+
|
113
|
+
export const DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS: OverlappingValueAxesParams = {
|
114
|
+
firstAxis: {
|
115
|
+
// labelAnchor: 'end',
|
116
|
+
labelOffset: [0, 0],
|
117
|
+
labelColorType: 'primary',
|
118
|
+
axisLineVisible: false,
|
119
|
+
axisLineColorType: 'primary',
|
120
|
+
ticks: 4,
|
121
|
+
tickFormat: ',.0f',
|
122
|
+
tickLineVisible: true,
|
123
|
+
tickPadding: 20,
|
124
|
+
tickFullLine: true,
|
125
|
+
tickFullLineDasharray: 'none',
|
126
|
+
tickColorType: 'secondary',
|
127
|
+
tickTextRotate: 0,
|
128
|
+
tickTextColorType: 'primary',
|
129
|
+
},
|
130
|
+
secondAxis: {
|
131
|
+
// labelAnchor: 'end',
|
132
|
+
labelOffset: [0, 0],
|
133
|
+
labelColorType: 'primary',
|
134
|
+
axisLineVisible: false,
|
135
|
+
axisLineColorType: 'primary',
|
136
|
+
ticks: 4,
|
137
|
+
tickFormat: ',.0f',
|
138
|
+
tickLineVisible: true,
|
139
|
+
tickPadding: 20,
|
140
|
+
tickFullLine: true,
|
141
|
+
tickFullLineDasharray: 'none',
|
142
|
+
tickColorType: 'secondary',
|
143
|
+
tickTextRotate: 0,
|
144
|
+
tickTextColorType: 'primary',
|
145
|
+
},
|
146
|
+
gridIndexes: [0, 1]
|
147
|
+
}
|
package/src/multiGrid/index.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
export * from './defaults'
|
2
|
-
export * from './types'
|
3
|
-
export { MultiGridLegend } from './plugins/MultiGridLegend'
|
4
|
-
export { MultiBars } from './plugins/MultiBars'
|
5
|
-
export { MultiBarStack } from './plugins/MultiBarStack'
|
6
|
-
export { MultiBarsTriangle } from './plugins/MultiBarsTriangle'
|
7
|
-
export { MultiLines } from './plugins/MultiLines'
|
8
|
-
export { MultiLineAreas } from './plugins/MultiLineAreas'
|
9
|
-
export { MultiDots } from './plugins/MultiDots'
|
10
|
-
export { MultiGroupAxis } from './plugins/MultiGroupAxis'
|
11
|
-
export { MultiValueAxis } from './plugins/MultiValueAxis'
|
1
|
+
export * from './defaults'
|
2
|
+
export * from './types'
|
3
|
+
export { MultiGridLegend } from './plugins/MultiGridLegend'
|
4
|
+
export { MultiBars } from './plugins/MultiBars'
|
5
|
+
export { MultiBarStack } from './plugins/MultiBarStack'
|
6
|
+
export { MultiBarsTriangle } from './plugins/MultiBarsTriangle'
|
7
|
+
export { MultiLines } from './plugins/MultiLines'
|
8
|
+
export { MultiLineAreas } from './plugins/MultiLineAreas'
|
9
|
+
export { MultiDots } from './plugins/MultiDots'
|
10
|
+
export { MultiGroupAxis } from './plugins/MultiGroupAxis'
|
11
|
+
export { MultiValueAxis } from './plugins/MultiValueAxis'
|
12
12
|
export { OverlappingValueAxes } from './plugins/OverlappingValueAxes'
|
@@ -1,290 +1,43 @@
|
|
1
|
-
import type { Observable } from 'rxjs'
|
2
|
-
import {
|
3
|
-
Subject,
|
4
|
-
takeUntil,
|
5
|
-
of,
|
6
|
-
map,
|
7
|
-
reduce,
|
8
|
-
switchMap,
|
9
|
-
combineLatest,
|
10
|
-
distinctUntilChanged,
|
11
|
-
shareReplay
|
12
|
-
} from 'rxjs'
|
13
|
-
import type {
|
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
|
-
// fullDataFormatter: observer.fullDataFormatter$,
|
44
|
-
// gridIndex: gridIndex$,
|
45
|
-
// }).pipe(
|
46
|
-
// map((data) => {
|
47
|
-
// const defaultGrid = data.fullDataFormatter.gridList[0] // ?? DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT
|
48
|
-
|
49
|
-
// return {
|
50
|
-
// type: 'grid',
|
51
|
-
// grid: {
|
52
|
-
// ...data.fullDataFormatter.gridList[data.gridIndex] ?? defaultGrid
|
53
|
-
// },
|
54
|
-
// container: {
|
55
|
-
// ...data.fullDataFormatter.container
|
56
|
-
// }
|
57
|
-
// }
|
58
|
-
// })
|
59
|
-
// )
|
60
|
-
|
61
|
-
// const gridDetail$ = combineLatest({
|
62
|
-
// multiGridEachDetail: observer.multiGridEachDetail$,
|
63
|
-
// gridIndex: gridIndex$,
|
64
|
-
// }).pipe(
|
65
|
-
// switchMap(async d => d),
|
66
|
-
// map(data => {
|
67
|
-
// return data.multiGridEachDetail[data.gridIndex] ?? data.multiGridEachDetail[0]
|
68
|
-
// }),
|
69
|
-
// shareReplay(1)
|
70
|
-
// )
|
71
|
-
|
72
|
-
// const isSeriesPositionSeprate$ = gridDetail$.pipe(
|
73
|
-
// switchMap(d => d.isSeriesPositionSeprate$)
|
74
|
-
// )
|
75
|
-
|
76
|
-
// const gridContainer$ = gridDetail$.pipe(
|
77
|
-
// switchMap(d => d.gridContainer$)
|
78
|
-
// )
|
79
|
-
|
80
|
-
// const gridAxesTransform$ = gridDetail$.pipe(
|
81
|
-
// switchMap(d => d.gridAxesTransform$)
|
82
|
-
// )
|
83
|
-
|
84
|
-
// const gridAxesReverseTransform$ = gridDetail$.pipe(
|
85
|
-
// switchMap(d => d.gridAxesReverseTransform$)
|
86
|
-
// )
|
87
|
-
|
88
|
-
// const gridAxesSize$ = gridDetail$.pipe(
|
89
|
-
// switchMap(d => d.gridAxesSize$)
|
90
|
-
// )
|
91
|
-
|
92
|
-
// const gridGraphicTransform$ = gridDetail$.pipe(
|
93
|
-
// switchMap(d => d.gridGraphicTransform$)
|
94
|
-
// )
|
95
|
-
|
96
|
-
// const gridGraphicReverseScale$ = gridDetail$.pipe(
|
97
|
-
// switchMap(d => d.gridGraphicReverseScale$)
|
98
|
-
// )
|
99
|
-
|
100
|
-
// const gridHighlight$ = gridDetail$.pipe(
|
101
|
-
// switchMap(d => d.gridHighlight$)
|
102
|
-
// )
|
103
|
-
|
104
|
-
// const existSeriesLabels$ = gridDetail$.pipe(
|
105
|
-
// switchMap(d => d.existSeriesLabels$)
|
106
|
-
// )
|
107
|
-
|
108
|
-
// const SeriesDataMap$ = gridDetail$.pipe(
|
109
|
-
// switchMap(d => d.SeriesDataMap$)
|
110
|
-
// )
|
111
|
-
|
112
|
-
// const GroupDataMap$ = gridDetail$.pipe(
|
113
|
-
// switchMap(d => d.GroupDataMap$)
|
114
|
-
// )
|
115
|
-
|
116
|
-
// const visibleComputedData$ = gridDetail$.pipe(
|
117
|
-
// switchMap(d => d.visibleComputedData$)
|
118
|
-
// )
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
// return {
|
123
|
-
// gridComputedData$,
|
124
|
-
// gridDataFormatter$,
|
125
|
-
// gridAxesTransform$,
|
126
|
-
// gridGraphicTransform$,
|
127
|
-
// gridGraphicReverseScale$,
|
128
|
-
// gridAxesReverseTransform$,
|
129
|
-
// gridAxesSize$,
|
130
|
-
// gridHighlight$,
|
131
|
-
// existSeriesLabels$,
|
132
|
-
// SeriesDataMap$,
|
133
|
-
// GroupDataMap$,
|
134
|
-
// visibleComputedData$,
|
135
|
-
// isSeriesPositionSeprate$,
|
136
|
-
// gridContainer$
|
137
|
-
// }
|
138
|
-
// }
|
139
|
-
|
140
|
-
// 可設定多個gridIndex的params
|
141
|
-
interface MultiGridPluginParams {
|
142
|
-
gridIndexes: number[]
|
143
|
-
}
|
144
|
-
|
145
|
-
interface MultiGridDetailObservables extends ContextObserverGridDetail {
|
146
|
-
gridComputedData$: Observable<ComputedDataGrid>
|
147
|
-
gridDataFormatter$: Observable<DataFormatterGrid>
|
148
|
-
}
|
149
|
-
|
150
|
-
|
151
|
-
// 對應grid資料的plugin所需Observable(必須有gridIndexes)
|
152
|
-
export const multiGridDetailObservables = (observer: ContextObserverMultiGrid<MultiGridPluginParams>): Observable<MultiGridDetailObservables[]> => {
|
153
|
-
const gridIndexes$ = observer.fullParams$.pipe(
|
154
|
-
map(fullParams => fullParams.gridIndexes),
|
155
|
-
distinctUntilChanged(),
|
156
|
-
shareReplay(1)
|
157
|
-
)
|
158
|
-
const destroy$ = new Subject()
|
159
|
-
|
160
|
-
// 合併所有gridHighlight$
|
161
|
-
const gridHighlight$ = observer.multiGridEachDetail$.pipe(
|
162
|
-
// switchMap(data => concat(...data.map(d => d.gridHighlight$))),
|
163
|
-
switchMap(data => {
|
164
|
-
return combineLatest(data.map(d => d.gridHighlight$))
|
165
|
-
}),
|
166
|
-
map(d => d.flat()),
|
167
|
-
shareReplay(1)
|
168
|
-
)
|
169
|
-
|
170
|
-
return gridIndexes$.pipe(
|
171
|
-
map(gridIndexes => {
|
172
|
-
return gridIndexes.map(gridIndex => {
|
173
|
-
// 每次重新計算時,清除之前的訂閱
|
174
|
-
destroy$.next(undefined)
|
175
|
-
|
176
|
-
const gridIndex$ = of(gridIndex).pipe(
|
177
|
-
takeUntil(destroy$),
|
178
|
-
shareReplay(1)
|
179
|
-
)
|
180
|
-
|
181
|
-
const gridComputedData$: Observable<ComputedDataGrid> = combineLatest({
|
182
|
-
computedData: observer.computedData$,
|
183
|
-
gridIndex: gridIndex$,
|
184
|
-
}).pipe(
|
185
|
-
takeUntil(destroy$),
|
186
|
-
map((data) => {
|
187
|
-
return data.computedData[data.gridIndex] ?? data.computedData[0]
|
188
|
-
})
|
189
|
-
)
|
190
|
-
|
191
|
-
const gridDataFormatter$: Observable<DataFormatterGrid> = combineLatest({
|
192
|
-
fullDataFormatter: observer.fullDataFormatter$,
|
193
|
-
gridIndex: gridIndex$,
|
194
|
-
}).pipe(
|
195
|
-
takeUntil(destroy$),
|
196
|
-
map((data) => {
|
197
|
-
const defaultGrid = data.fullDataFormatter.gridList[0] // ?? DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT
|
198
|
-
|
199
|
-
return {
|
200
|
-
type: 'grid',
|
201
|
-
grid: {
|
202
|
-
...data.fullDataFormatter.gridList[data.gridIndex] ?? defaultGrid
|
203
|
-
},
|
204
|
-
container: {
|
205
|
-
...data.fullDataFormatter.container
|
206
|
-
}
|
207
|
-
}
|
208
|
-
})
|
209
|
-
)
|
210
|
-
|
211
|
-
const gridDetail$ = combineLatest({
|
212
|
-
multiGridEachDetail: observer.multiGridEachDetail$,
|
213
|
-
gridIndex: gridIndex$,
|
214
|
-
}).pipe(
|
215
|
-
takeUntil(destroy$),
|
216
|
-
switchMap(async d => d),
|
217
|
-
map(data => {
|
218
|
-
return data.multiGridEachDetail[data.gridIndex] ?? data.multiGridEachDetail[0]
|
219
|
-
}),
|
220
|
-
shareReplay(1)
|
221
|
-
)
|
222
|
-
|
223
|
-
const isSeriesPositionSeprate$ = gridDetail$.pipe(
|
224
|
-
switchMap(d => d.isSeriesPositionSeprate$)
|
225
|
-
)
|
226
|
-
|
227
|
-
const gridContainer$ = gridDetail$.pipe(
|
228
|
-
switchMap(d => d.gridContainer$)
|
229
|
-
)
|
230
|
-
|
231
|
-
const gridAxesTransform$ = gridDetail$.pipe(
|
232
|
-
switchMap(d => d.gridAxesTransform$)
|
233
|
-
)
|
234
|
-
|
235
|
-
const gridAxesReverseTransform$ = gridDetail$.pipe(
|
236
|
-
switchMap(d => d.gridAxesReverseTransform$)
|
237
|
-
)
|
238
|
-
|
239
|
-
const gridAxesSize$ = gridDetail$.pipe(
|
240
|
-
switchMap(d => d.gridAxesSize$)
|
241
|
-
)
|
242
|
-
|
243
|
-
const gridGraphicTransform$ = gridDetail$.pipe(
|
244
|
-
switchMap(d => d.gridGraphicTransform$)
|
245
|
-
)
|
246
|
-
|
247
|
-
const gridGraphicReverseScale$ = gridDetail$.pipe(
|
248
|
-
switchMap(d => d.gridGraphicReverseScale$)
|
249
|
-
)
|
250
|
-
|
251
|
-
// const gridHighlight$ = gridDetail$.pipe(
|
252
|
-
// switchMap(d => d.gridHighlight$)
|
253
|
-
// )
|
254
|
-
|
255
|
-
const existSeriesLabels$ = gridDetail$.pipe(
|
256
|
-
switchMap(d => d.existSeriesLabels$)
|
257
|
-
)
|
258
|
-
|
259
|
-
const SeriesDataMap$ = gridDetail$.pipe(
|
260
|
-
switchMap(d => d.SeriesDataMap$)
|
261
|
-
)
|
262
|
-
|
263
|
-
const GroupDataMap$ = gridDetail$.pipe(
|
264
|
-
switchMap(d => d.GroupDataMap$)
|
265
|
-
)
|
266
|
-
|
267
|
-
const visibleComputedData$ = gridDetail$.pipe(
|
268
|
-
switchMap(d => d.visibleComputedData$)
|
269
|
-
)
|
270
|
-
|
271
|
-
return {
|
272
|
-
gridComputedData$,
|
273
|
-
gridDataFormatter$,
|
274
|
-
gridAxesTransform$,
|
275
|
-
gridGraphicTransform$,
|
276
|
-
gridGraphicReverseScale$,
|
277
|
-
gridAxesReverseTransform$,
|
278
|
-
gridAxesSize$,
|
279
|
-
gridHighlight$,
|
280
|
-
existSeriesLabels$,
|
281
|
-
SeriesDataMap$,
|
282
|
-
GroupDataMap$,
|
283
|
-
visibleComputedData$,
|
284
|
-
isSeriesPositionSeprate$,
|
285
|
-
gridContainer$
|
286
|
-
}
|
287
|
-
})
|
288
|
-
})
|
289
|
-
)
|
1
|
+
import type { Observable } from 'rxjs'
|
2
|
+
import {
|
3
|
+
Subject,
|
4
|
+
takeUntil,
|
5
|
+
of,
|
6
|
+
map,
|
7
|
+
reduce,
|
8
|
+
switchMap,
|
9
|
+
combineLatest,
|
10
|
+
distinctUntilChanged,
|
11
|
+
shareReplay
|
12
|
+
} from 'rxjs'
|
13
|
+
import type {
|
14
|
+
ContextObserverMultiGrid,
|
15
|
+
ComputedDataGrid,
|
16
|
+
DataFormatterGrid,
|
17
|
+
ContextObserverGridDetail,
|
18
|
+
ContextObserverMultiGridDetail } from '@orbcharts/core'
|
19
|
+
|
20
|
+
// 可設定多個gridIndex的params
|
21
|
+
interface MultiGridPluginParams {
|
22
|
+
gridIndexes: number[]
|
23
|
+
}
|
24
|
+
|
25
|
+
// 對應grid資料的plugin所需Observable(必須有gridIndexes)
|
26
|
+
export const multiGridPluginObservables = (observer: ContextObserverMultiGrid<MultiGridPluginParams>): Observable<ContextObserverMultiGridDetail[]> => {
|
27
|
+
const gridIndexes$ = observer.fullParams$.pipe(
|
28
|
+
map(fullParams => fullParams.gridIndexes),
|
29
|
+
distinctUntilChanged(),
|
30
|
+
shareReplay(1)
|
31
|
+
)
|
32
|
+
|
33
|
+
return combineLatest({
|
34
|
+
multiGridEachDetail: observer.multiGridEachDetail$,
|
35
|
+
gridIndexes: gridIndexes$,
|
36
|
+
}).pipe(
|
37
|
+
map(data => {
|
38
|
+
return data.gridIndexes.map(gridIndex => {
|
39
|
+
return data.multiGridEachDetail[gridIndex] ?? data.multiGridEachDetail[0]
|
40
|
+
})
|
41
|
+
})
|
42
|
+
)
|
290
43
|
}
|