@orbcharts/core 3.0.0-alpha.61 → 3.0.0-alpha.63
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +200 -200
- package/dist/lib/core-types.d.ts +1 -0
- package/dist/orbcharts-core.es.js +3418 -2726
- package/dist/orbcharts-core.umd.js +6 -2
- package/dist/src/AbstractChart.d.ts +5 -3
- package/dist/src/GridChart.d.ts +1 -1
- package/dist/src/MultiGridChart.d.ts +1 -1
- package/dist/src/MultiValueChart.d.ts +1 -1
- package/dist/src/RelationshipChart.d.ts +1 -1
- package/dist/src/SeriesChart.d.ts +1 -1
- package/dist/src/TreeChart.d.ts +1 -1
- package/dist/src/base/createBaseChart.d.ts +1 -1
- package/dist/src/base/createBasePlugin.d.ts +1 -1
- package/dist/src/base/validators/chartOptionsValidator.d.ts +3 -0
- package/dist/src/base/validators/chartParamsValidator.d.ts +3 -0
- package/dist/src/base/validators/elementValidator.d.ts +3 -0
- package/dist/src/base/validators/pluginsValidator.d.ts +3 -0
- package/dist/src/defaults.d.ts +1 -16
- package/dist/src/defineGridPlugin.d.ts +1 -1
- package/dist/src/defineMultiGridPlugin.d.ts +1 -1
- package/dist/src/defineMultiValuePlugin.d.ts +1 -1
- package/dist/src/defineNoneDataPlugin.d.ts +1 -1
- package/dist/src/defineRelationshipPlugin.d.ts +1 -1
- package/dist/src/defineSeriesPlugin.d.ts +1 -1
- package/dist/src/defineTreePlugin.d.ts +1 -1
- package/dist/src/grid/computedDataFn.d.ts +4 -0
- package/dist/src/grid/contextObserverCallback.d.ts +3 -0
- package/dist/src/grid/dataFormatterValidator.d.ts +3 -0
- package/dist/src/grid/dataValidator.d.ts +3 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/multiGrid/computedDataFn.d.ts +3 -0
- package/dist/src/multiGrid/contextObserverCallback.d.ts +3 -0
- package/dist/src/multiGrid/dataFormatterValidator.d.ts +3 -0
- package/dist/src/multiGrid/dataValidator.d.ts +3 -0
- package/dist/src/multiValue/computedDataFn.d.ts +3 -0
- package/dist/src/multiValue/contextObserverCallback.d.ts +3 -0
- package/dist/src/multiValue/dataFormatterValidator.d.ts +3 -0
- package/dist/src/multiValue/dataValidator.d.ts +3 -0
- package/dist/src/relationship/computedDataFn.d.ts +3 -0
- package/dist/src/relationship/contextObserverCallback.d.ts +3 -0
- package/dist/src/relationship/dataFormatterValidator.d.ts +3 -0
- package/dist/src/relationship/dataValidator.d.ts +3 -0
- package/dist/src/series/computedDataFn.d.ts +3 -0
- package/dist/src/series/contextObserverCallback.d.ts +3 -0
- package/dist/src/series/dataFormatterValidator.d.ts +3 -0
- package/dist/src/series/dataValidator.d.ts +3 -0
- package/dist/src/tree/computedDataFn.d.ts +3 -0
- package/dist/src/tree/contextObserverCallback.d.ts +3 -0
- package/dist/src/tree/dataFormatterValidator.d.ts +3 -0
- package/dist/src/tree/dataValidator.d.ts +3 -0
- package/dist/src/utils/commonUtils.d.ts +1 -0
- package/dist/src/utils/errorMessage.d.ts +14 -0
- package/dist/src/{grid → utils}/gridObservables.d.ts +2 -2
- package/dist/src/utils/index.d.ts +7 -3
- package/dist/src/{multiGrid → utils}/multiGridObservables.d.ts +1 -1
- package/dist/src/utils/observables.d.ts +2 -1
- package/dist/src/utils/orbchartsUtils.d.ts +1 -12
- package/dist/src/{series → utils}/seriesObservables.d.ts +3 -3
- package/dist/src/{tree → utils}/treeObservables.d.ts +1 -1
- package/dist/src/utils/validator.d.ts +3 -0
- package/lib/core-types.ts +7 -0
- package/package.json +42 -41
- package/src/AbstractChart.ts +57 -48
- package/src/GridChart.ts +24 -20
- package/src/MultiGridChart.ts +24 -20
- package/src/MultiValueChart.ts +24 -20
- package/src/RelationshipChart.ts +24 -20
- package/src/SeriesChart.ts +24 -20
- package/src/TreeChart.ts +24 -20
- package/src/base/createBaseChart.ts +500 -388
- package/src/base/createBasePlugin.ts +152 -95
- package/src/base/validators/chartOptionsValidator.ts +24 -0
- package/src/base/validators/chartParamsValidator.ts +134 -0
- package/src/base/validators/elementValidator.ts +14 -0
- package/src/base/validators/pluginsValidator.ts +15 -0
- package/src/defaults.ts +232 -228
- package/src/defineGridPlugin.ts +3 -3
- package/src/defineMultiGridPlugin.ts +3 -3
- package/src/defineMultiValuePlugin.ts +3 -3
- package/src/defineNoneDataPlugin.ts +4 -4
- package/src/defineRelationshipPlugin.ts +3 -3
- package/src/defineSeriesPlugin.ts +3 -3
- package/src/defineTreePlugin.ts +3 -3
- package/src/grid/{computeGridData.ts → computedDataFn.ts} +129 -134
- package/src/grid/{createGridContextObserver.ts → contextObserverCallback.ts} +155 -155
- package/src/grid/dataFormatterValidator.ts +102 -0
- package/src/grid/dataValidator.ts +13 -0
- package/src/index.ts +20 -21
- package/src/multiGrid/{computeMultiGridData.ts → computedDataFn.ts} +123 -130
- package/src/multiGrid/{createMultiGridContextObserver.ts → contextObserverCallback.ts} +41 -41
- package/src/multiGrid/dataFormatterValidator.ts +116 -0
- package/src/multiGrid/dataValidator.ts +13 -0
- package/src/multiValue/{computeMultiValueData.ts → computedDataFn.ts} +176 -179
- package/src/multiValue/{createMultiValueContextObserver.ts → contextObserverCallback.ts} +12 -12
- package/src/multiValue/dataFormatterValidator.ts +10 -0
- package/src/multiValue/dataValidator.ts +10 -0
- package/src/relationship/{computeRelationshipData.ts → computedDataFn.ts} +125 -118
- package/src/relationship/{createRelationshipContextObserver.ts → contextObserverCallback.ts} +12 -12
- package/src/relationship/dataFormatterValidator.ts +10 -0
- package/src/relationship/dataValidator.ts +10 -0
- package/src/series/{computeSeriesData.ts → computedDataFn.ts} +88 -90
- package/src/series/{createSeriesContextObserver.ts → contextObserverCallback.ts} +100 -93
- package/src/series/dataFormatterValidator.ts +42 -0
- package/src/series/dataValidator.ts +13 -0
- package/src/tree/{computeTreeData.ts → computedDataFn.ts} +130 -132
- package/src/tree/{createTreeContextObserver.ts → contextObserverCallback.ts} +61 -61
- package/src/tree/dataFormatterValidator.ts +14 -0
- package/src/tree/dataValidator.ts +14 -0
- package/src/utils/commonUtils.ts +54 -50
- package/src/utils/d3Utils.ts +108 -108
- package/src/utils/errorMessage.ts +43 -0
- package/src/{grid → utils}/gridObservables.ts +611 -614
- package/src/utils/index.ts +10 -4
- package/src/{multiGrid → utils}/multiGridObservables.ts +366 -365
- package/src/utils/observables.ts +219 -202
- package/src/utils/orbchartsUtils.ts +352 -349
- package/src/{series → utils}/seriesObservables.ts +175 -175
- package/src/{tree → utils}/treeObservables.ts +94 -94
- package/src/utils/validator.ts +126 -0
- package/tsconfig.base.json +13 -13
- package/tsconfig.json +2 -2
- package/vite-env.d.ts +7 -0
- package/vite.config.js +22 -22
- package/dist/src/grid/computeGridData.d.ts +0 -6
- package/dist/src/grid/createGridContextObserver.d.ts +0 -3
- package/dist/src/multiGrid/computeMultiGridData.d.ts +0 -3
- package/dist/src/multiGrid/createMultiGridContextObserver.d.ts +0 -3
- package/dist/src/multiValue/computeMultiValueData.d.ts +0 -3
- package/dist/src/multiValue/createMultiValueContextObserver.d.ts +0 -3
- package/dist/src/relationship/computeRelationshipData.d.ts +0 -3
- package/dist/src/relationship/createRelationshipContextObserver.d.ts +0 -3
- package/dist/src/series/computeSeriesData.d.ts +0 -3
- package/dist/src/series/createSeriesContextObserver.d.ts +0 -3
- package/dist/src/tree/computeTreeData.d.ts +0 -3
- package/dist/src/tree/createTreeContextObserver.d.ts +0 -3
- package/dist/src/types/Axis.d.ts +0 -1
- package/dist/src/types/Chart.d.ts +0 -45
- package/dist/src/types/ChartParams.d.ts +0 -36
- package/dist/src/types/ComputedData.d.ts +0 -42
- package/dist/src/types/ComputedDataGrid.d.ts +0 -5
- package/dist/src/types/ComputedDataMultiGrid.d.ts +0 -3
- package/dist/src/types/ComputedDataMultiValue.d.ts +0 -6
- package/dist/src/types/ComputedDataRelationship.d.ts +0 -18
- package/dist/src/types/ComputedDataSeries.d.ts +0 -5
- package/dist/src/types/ComputedDataTree.d.ts +0 -7
- package/dist/src/types/ContextObserver.d.ts +0 -28
- package/dist/src/types/ContextObserverGrid.d.ts +0 -41
- package/dist/src/types/ContextObserverMultiGrid.d.ts +0 -15
- package/dist/src/types/ContextObserverMultiValue.d.ts +0 -4
- package/dist/src/types/ContextObserverRelationship.d.ts +0 -4
- package/dist/src/types/ContextObserverSeries.d.ts +0 -27
- package/dist/src/types/ContextObserverTree.d.ts +0 -11
- package/dist/src/types/ContextSubject.d.ts +0 -15
- package/dist/src/types/Data.d.ts +0 -19
- package/dist/src/types/DataFormatter.d.ts +0 -41
- package/dist/src/types/DataFormatterGrid.d.ts +0 -34
- package/dist/src/types/DataFormatterMultiGrid.d.ts +0 -20
- package/dist/src/types/DataFormatterMultiValue.d.ts +0 -18
- package/dist/src/types/DataFormatterRelationship.d.ts +0 -10
- package/dist/src/types/DataFormatterSeries.d.ts +0 -19
- package/dist/src/types/DataFormatterTree.d.ts +0 -7
- package/dist/src/types/DataGrid.d.ts +0 -6
- package/dist/src/types/DataMultiGrid.d.ts +0 -6
- package/dist/src/types/DataMultiValue.d.ts +0 -7
- package/dist/src/types/DataRelationship.d.ts +0 -21
- package/dist/src/types/DataSeries.d.ts +0 -6
- package/dist/src/types/DataTree.d.ts +0 -15
- package/dist/src/types/Event.d.ts +0 -56
- package/dist/src/types/Layout.d.ts +0 -8
- package/dist/src/types/Padding.d.ts +0 -6
- package/dist/src/types/Plugin.d.ts +0 -37
- package/dist/src/types/TransformData.d.ts +0 -8
- package/dist/src/types/index.d.ts +0 -37
- package/src/types/Axis.ts +0 -1
- package/src/types/Chart.ts +0 -54
- package/src/types/ChartParams.ts +0 -51
- package/src/types/ComputedData.ts +0 -84
- package/src/types/ComputedDataGrid.ts +0 -14
- package/src/types/ComputedDataMultiGrid.ts +0 -3
- package/src/types/ComputedDataMultiValue.ts +0 -9
- package/src/types/ComputedDataRelationship.ts +0 -20
- package/src/types/ComputedDataSeries.ts +0 -8
- package/src/types/ComputedDataTree.ts +0 -20
- package/src/types/ContextObserver.ts +0 -38
- package/src/types/ContextObserverGrid.ts +0 -43
- package/src/types/ContextObserverMultiGrid.ts +0 -17
- package/src/types/ContextObserverMultiValue.ts +0 -5
- package/src/types/ContextObserverRelationship.ts +0 -5
- package/src/types/ContextObserverSeries.ts +0 -29
- package/src/types/ContextObserverTree.ts +0 -11
- package/src/types/ContextSubject.ts +0 -18
- package/src/types/Data.ts +0 -45
- package/src/types/DataFormatter.ts +0 -74
- package/src/types/DataFormatterGrid.ts +0 -68
- package/src/types/DataFormatterMultiGrid.ts +0 -45
- package/src/types/DataFormatterMultiValue.ts +0 -24
- package/src/types/DataFormatterRelationship.ts +0 -26
- package/src/types/DataFormatterSeries.ts +0 -20
- package/src/types/DataFormatterTree.ts +0 -12
- package/src/types/DataGrid.ts +0 -11
- package/src/types/DataMultiGrid.ts +0 -7
- package/src/types/DataMultiValue.ts +0 -12
- package/src/types/DataRelationship.ts +0 -28
- package/src/types/DataSeries.ts +0 -11
- package/src/types/DataTree.ts +0 -20
- package/src/types/Event.ts +0 -153
- package/src/types/Layout.ts +0 -12
- package/src/types/Padding.ts +0 -6
- package/src/types/Plugin.ts +0 -60
- package/src/types/TransformData.ts +0 -8
- package/src/types/index.ts +0 -37
- /package/dist/src/{multiValue → utils}/multiValueObservables.d.ts +0 -0
- /package/dist/src/{relationship → utils}/relationshipObservables.d.ts +0 -0
- /package/src/{multiValue → utils}/multiValueObservables.ts +0 -0
- /package/src/{relationship → utils}/relationshipObservables.ts +0 -0
package/src/defaults.ts
CHANGED
@@ -1,228 +1,232 @@
|
|
1
|
-
|
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
|
-
|
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
|
-
export const
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
export const
|
90
|
-
|
91
|
-
export const
|
92
|
-
|
93
|
-
export const
|
94
|
-
|
95
|
-
export const
|
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
|
-
|
167
|
-
|
168
|
-
}
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
//
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
}
|
180
|
-
|
181
|
-
export const
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
//
|
223
|
-
// // labelFormat: (
|
224
|
-
// descriptionFormat: (
|
225
|
-
// },
|
226
|
-
|
227
|
-
|
228
|
-
|
1
|
+
import type {
|
2
|
+
ChartOptionsPartial,
|
3
|
+
DataSeries,
|
4
|
+
DataGrid,
|
5
|
+
DataMultiGrid,
|
6
|
+
DataMultiValue,
|
7
|
+
DataTree,
|
8
|
+
DataRelationship,
|
9
|
+
DataFormatterValueAxis,
|
10
|
+
DataFormatterGroupAxis,
|
11
|
+
DataFormatterContainer,
|
12
|
+
DataFormatterSeries,
|
13
|
+
DataFormatterGrid,
|
14
|
+
DataFormatterGridGrid,
|
15
|
+
DataFormatterMultiGrid,
|
16
|
+
DataFormatterMultiGridGrid,
|
17
|
+
DataFormatterMultiValue,
|
18
|
+
DataFormatterTree,
|
19
|
+
DataFormatterRelationship,
|
20
|
+
ChartParams,
|
21
|
+
Padding
|
22
|
+
} from '../lib/core-types'
|
23
|
+
|
24
|
+
export const CHART_OPTIONS_DEFAULT: ChartOptionsPartial<any> = {
|
25
|
+
// preset: {} // 預設為空
|
26
|
+
width: 'auto',
|
27
|
+
height: 'auto'
|
28
|
+
}
|
29
|
+
|
30
|
+
// export const GLOBAL_DEFAULT: ChartGlobalDefault = {
|
31
|
+
// colors: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
|
32
|
+
// padding: {
|
33
|
+
// top: 50,
|
34
|
+
// right: 70,
|
35
|
+
// bottom: 50,
|
36
|
+
// left: 70
|
37
|
+
// },
|
38
|
+
// // chartWidth: '100%',
|
39
|
+
// // chartHeight: 500
|
40
|
+
// }
|
41
|
+
|
42
|
+
// export const COLORS_DEFAULT = ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67']
|
43
|
+
// ['#ff7ab9', '#66dec8', '#84c8ff', '#30ad1b', '#f8c43e', '#fa5640', '#9d79d7', '#ea4f98']
|
44
|
+
|
45
|
+
export const PADDING_DEFAULT: Padding = {
|
46
|
+
top: 60,
|
47
|
+
right: 60,
|
48
|
+
bottom: 60,
|
49
|
+
left: 60
|
50
|
+
}
|
51
|
+
|
52
|
+
export const CHART_PARAMS_DEFAULT: ChartParams = {
|
53
|
+
padding: PADDING_DEFAULT,
|
54
|
+
highlightTarget: 'datum',
|
55
|
+
highlightDefault: null,
|
56
|
+
colorScheme: 'light',
|
57
|
+
colors: {
|
58
|
+
light: {
|
59
|
+
series: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
|
60
|
+
// primary: '#454545',
|
61
|
+
primary: '#1b1e23',
|
62
|
+
secondary: '#e1e1e1',
|
63
|
+
white: '#ffffff',
|
64
|
+
background: '#ffffff'
|
65
|
+
},
|
66
|
+
dark: {
|
67
|
+
series: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
|
68
|
+
primary: '#f0f0f0',
|
69
|
+
secondary: '#e1e1e1',
|
70
|
+
white: '#ffffff',
|
71
|
+
background: '#000000'
|
72
|
+
}
|
73
|
+
},
|
74
|
+
styles: {
|
75
|
+
// textSize: 14,
|
76
|
+
textSize: '0.875rem',
|
77
|
+
unhighlightedOpacity: 0.3
|
78
|
+
},
|
79
|
+
transitionDuration: 800,
|
80
|
+
transitionEase: 'easeCubic'
|
81
|
+
}
|
82
|
+
|
83
|
+
export const CHART_WIDTH_DEFAULT = 800
|
84
|
+
|
85
|
+
export const CHART_HEIGHT_DEFAULT = 500
|
86
|
+
|
87
|
+
// -- Data --
|
88
|
+
|
89
|
+
export const DATA_SERIES_DEFAULT: DataSeries = []
|
90
|
+
|
91
|
+
export const DATA_GRID_DEFAULT: DataGrid = []
|
92
|
+
|
93
|
+
export const DATA_MULTI_GRID_DEFAULT: DataMultiGrid = []
|
94
|
+
|
95
|
+
export const DATA_MULTI_VALUE_DEFAULT: DataMultiValue = []
|
96
|
+
|
97
|
+
export const DATA_TREE_DEFAULT: DataTree = []
|
98
|
+
|
99
|
+
export const DATA_RELATIONA_DEFAULTL: DataRelationship = {
|
100
|
+
nodes: [],
|
101
|
+
edges: []
|
102
|
+
}
|
103
|
+
|
104
|
+
// -- Data Formatter --
|
105
|
+
|
106
|
+
export const DATA_FORMATTER_VALUE_AXIS_DEFAULT: DataFormatterValueAxis = {
|
107
|
+
position: 'left',
|
108
|
+
scaleDomain: ['auto', 'auto'],
|
109
|
+
scaleRange: [0, 0.9],
|
110
|
+
label: '',
|
111
|
+
}
|
112
|
+
|
113
|
+
export const DATA_FORMATTER_GROUP_AXIS_DEFAULT: DataFormatterGroupAxis = {
|
114
|
+
position: 'bottom',
|
115
|
+
scaleDomain: [0, 'max'],
|
116
|
+
scalePadding: 0.5,
|
117
|
+
label: ''
|
118
|
+
}
|
119
|
+
|
120
|
+
export const DATA_FORMATTER_CONTAINER_DEFAULT: DataFormatterContainer = {
|
121
|
+
gap: 120,
|
122
|
+
rowAmount: 1,
|
123
|
+
columnAmount: 1
|
124
|
+
}
|
125
|
+
|
126
|
+
export const DATA_FORMATTER_SERIES_DEFAULT: DataFormatterSeries = {
|
127
|
+
type: 'series',
|
128
|
+
visibleFilter: (datum, context) => true,
|
129
|
+
sort: null,
|
130
|
+
seriesLabels: [],
|
131
|
+
container: {
|
132
|
+
...DATA_FORMATTER_CONTAINER_DEFAULT
|
133
|
+
},
|
134
|
+
separateSeries: false,
|
135
|
+
sumSeries: false
|
136
|
+
// mapSeries: (datum, rowIndex, columnIndex, { data, dataFormatter }) => {
|
137
|
+
// const seriesIndex = rowIndex >= dataFormatter.seriesLabels.length
|
138
|
+
// ? rowIndex % dataFormatter.seriesLabels.length // 如果index大於所設定的seriesLabels的數量則從頭回來算
|
139
|
+
// : rowIndex
|
140
|
+
// return dataFormatter.seriesLabels[seriesIndex]
|
141
|
+
// },
|
142
|
+
// colorsPredicate: (datum, rowIndex, columnIndex, { chartParams }) => {
|
143
|
+
// return rowIndex < chartParams.colors[chartParams.colorScheme].series.length
|
144
|
+
// ? chartParams.colors[chartParams.colorScheme].series[rowIndex]
|
145
|
+
// : chartParams.colors[chartParams.colorScheme].series[
|
146
|
+
// rowIndex % chartParams.colors[chartParams.colorScheme].series.length
|
147
|
+
// ]
|
148
|
+
// },
|
149
|
+
}
|
150
|
+
DATA_FORMATTER_SERIES_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
151
|
+
|
152
|
+
export const DATA_FORMATTER_GRID_GRID_DEFAULT: DataFormatterGridGrid = {
|
153
|
+
seriesDirection: 'row',
|
154
|
+
rowLabels: [],
|
155
|
+
columnLabels: [],
|
156
|
+
valueAxis: { ...DATA_FORMATTER_VALUE_AXIS_DEFAULT },
|
157
|
+
groupAxis: { ...DATA_FORMATTER_GROUP_AXIS_DEFAULT, },
|
158
|
+
separateSeries: false,
|
159
|
+
// slotIndex: 0,
|
160
|
+
// seriesSlotIndexes: null
|
161
|
+
}
|
162
|
+
|
163
|
+
export const DATA_FORMATTER_GRID_DEFAULT: DataFormatterGrid = {
|
164
|
+
type: 'grid',
|
165
|
+
visibleFilter: (datum, context) => true,
|
166
|
+
grid: {
|
167
|
+
...DATA_FORMATTER_GRID_GRID_DEFAULT
|
168
|
+
},
|
169
|
+
container: {
|
170
|
+
...DATA_FORMATTER_CONTAINER_DEFAULT
|
171
|
+
}
|
172
|
+
}
|
173
|
+
DATA_FORMATTER_GRID_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
174
|
+
|
175
|
+
// export const DATA_FORMATTER_MULTI_GRID_MULTI_GRID_DEFAULT: DataFormatterMultiGridMultiGrid = {
|
176
|
+
// ...DATA_FORMATTER_GRID_DEFAULT,
|
177
|
+
// slotIndex: 0,
|
178
|
+
// seriesSlotIndexes: null
|
179
|
+
// }
|
180
|
+
|
181
|
+
export const DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT: DataFormatterMultiGridGrid = {
|
182
|
+
...DATA_FORMATTER_GRID_GRID_DEFAULT
|
183
|
+
}
|
184
|
+
|
185
|
+
export const DATA_FORMATTER_MULTI_GRID_DEFAULT: DataFormatterMultiGrid = {
|
186
|
+
type: 'multiGrid',
|
187
|
+
visibleFilter: (datum, context) => true,
|
188
|
+
gridList: [
|
189
|
+
{
|
190
|
+
...DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT
|
191
|
+
},
|
192
|
+
],
|
193
|
+
separateGrid: false,
|
194
|
+
container: {
|
195
|
+
...DATA_FORMATTER_CONTAINER_DEFAULT
|
196
|
+
}
|
197
|
+
}
|
198
|
+
DATA_FORMATTER_MULTI_GRID_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
199
|
+
|
200
|
+
export const DATA_FORMATTER_MULTI_VALUE_DEFAULT: DataFormatterMultiValue = {
|
201
|
+
type: 'multiValue',
|
202
|
+
visibleFilter: (datum, context) => true,
|
203
|
+
categoryLabels: [],
|
204
|
+
multiValue: [],
|
205
|
+
xAxis: { ...DATA_FORMATTER_VALUE_AXIS_DEFAULT },
|
206
|
+
yAxis: { ...DATA_FORMATTER_VALUE_AXIS_DEFAULT },
|
207
|
+
}
|
208
|
+
DATA_FORMATTER_MULTI_VALUE_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
209
|
+
|
210
|
+
export const DATA_FORMATTER_TREE_DEFAULT: DataFormatterTree = {
|
211
|
+
type: 'tree',
|
212
|
+
visibleFilter: (datum, context) => true,
|
213
|
+
// labelFormat: (datum: any) => (datum && datum.label) ?? '',
|
214
|
+
categoryLabels: []
|
215
|
+
}
|
216
|
+
DATA_FORMATTER_TREE_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
217
|
+
|
218
|
+
export const DATA_FORMATTER_RELATIONAL_DEFAULT: DataFormatterRelationship = {
|
219
|
+
type: 'relationship',
|
220
|
+
visibleFilter: (datum, context) => true,
|
221
|
+
categoryLabels: []
|
222
|
+
// node: {
|
223
|
+
// // labelFormat: (node: any) => (node && node.label) ?? '',
|
224
|
+
// descriptionFormat: (node: any) => (node && node.label) ?? ''
|
225
|
+
// },
|
226
|
+
// edge: {
|
227
|
+
// // labelFormat: (edge: any) => (edge && edge.label) ?? '',
|
228
|
+
// descriptionFormat: (edge: any) => (edge && edge.label) ?? ''
|
229
|
+
// },
|
230
|
+
}
|
231
|
+
DATA_FORMATTER_RELATIONAL_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
232
|
+
|
package/src/defineGridPlugin.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
-
|
3
|
-
export const defineGridPlugin = createBasePlugin
|
1
|
+
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
+
|
3
|
+
export const defineGridPlugin = createBasePlugin('grid')
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
-
|
3
|
-
export const defineMultiGridPlugin = createBasePlugin
|
1
|
+
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
+
|
3
|
+
export const defineMultiGridPlugin = createBasePlugin('multiGrid')
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
-
|
3
|
-
export const defineMultiValuePlugin = createBasePlugin
|
1
|
+
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
+
|
3
|
+
export const defineMultiValuePlugin = createBasePlugin('multiValue')
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
-
|
3
|
-
|
4
|
-
export const defineNoneDataPlugin = createBasePlugin<any>()
|
1
|
+
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
+
|
3
|
+
// chartType型別使用 'any' 是為了讓 plugin entity 能夠被加入到所有類別的 chart.plugins$ 中
|
4
|
+
export const defineNoneDataPlugin = createBasePlugin<any>('noneData')
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
-
|
3
|
-
export const defineRelationshipPlugin = createBasePlugin
|
1
|
+
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
+
|
3
|
+
export const defineRelationshipPlugin = createBasePlugin('relationship')
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
-
|
3
|
-
export const defineSeriesPlugin = createBasePlugin
|
1
|
+
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
+
|
3
|
+
export const defineSeriesPlugin = createBasePlugin('series')
|
package/src/defineTreePlugin.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
-
|
3
|
-
export const defineTreePlugin = createBasePlugin
|
1
|
+
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
+
|
3
|
+
export const defineTreePlugin = createBasePlugin('tree')
|