@orbcharts/core 3.0.0-alpha.40 → 3.0.0-alpha.41
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +200 -200
- package/dist/orbcharts-core.es.js +1152 -1124
- package/dist/orbcharts-core.umd.js +2 -2
- package/dist/src/types/ChartParams.d.ts +1 -1
- package/dist/src/types/ContextObserverGrid.d.ts +1 -0
- package/dist/src/types/ContextObserverMultiGrid.d.ts +1 -0
- package/dist/src/types/ContextObserverSeries.d.ts +1 -0
- package/dist/src/types/ContextObserverTree.d.ts +1 -0
- package/dist/src/utils/observables.d.ts +1 -0
- package/package.json +41 -41
- package/src/AbstractChart.ts +48 -48
- package/src/GridChart.ts +20 -20
- package/src/MultiGridChart.ts +20 -20
- package/src/MultiValueChart.ts +20 -20
- package/src/RelationshipChart.ts +20 -20
- package/src/SeriesChart.ts +20 -20
- package/src/TreeChart.ts +20 -20
- package/src/base/createBaseChart.ts +367 -367
- package/src/base/createBasePlugin.ts +89 -89
- package/src/defaults.ts +248 -247
- 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 +205 -205
- package/src/grid/createGridContextObserver.ts +130 -124
- package/src/grid/gridObservables.ts +486 -486
- package/src/index.ts +21 -21
- package/src/multiGrid/computeMultiGridData.ts +173 -173
- package/src/multiGrid/createMultiGridContextObserver.ts +40 -34
- package/src/multiGrid/multiGridObservables.ts +285 -285
- package/src/multiValue/computeMultiValueData.ts +136 -136
- package/src/multiValue/createMultiValueContextObserver.ts +12 -12
- package/src/relationship/computeRelationshipData.ts +106 -106
- package/src/relationship/createRelationshipContextObserver.ts +12 -12
- package/src/series/computeSeriesData.ts +153 -153
- package/src/series/createSeriesContextObserver.ts +38 -33
- package/src/series/seriesObservables.ts +23 -23
- package/src/tree/computeTreeData.ts +128 -128
- package/src/tree/createTreeContextObserver.ts +61 -56
- package/src/tree/treeObservables.ts +94 -94
- package/src/types/Chart.ts +48 -48
- package/src/types/ChartParams.ts +51 -51
- package/src/types/ComputedData.ts +82 -82
- package/src/types/ComputedDataGrid.ts +13 -13
- package/src/types/ComputedDataMultiGrid.ts +2 -2
- package/src/types/ComputedDataMultiValue.ts +9 -9
- package/src/types/ComputedDataRelationship.ts +19 -19
- package/src/types/ComputedDataSeries.ts +7 -7
- package/src/types/ComputedDataTree.ts +19 -19
- package/src/types/ContextObserver.ts +38 -38
- package/src/types/ContextObserverGrid.ts +33 -33
- package/src/types/ContextObserverMultiGrid.ts +28 -27
- package/src/types/ContextObserverMultiValue.ts +4 -4
- package/src/types/ContextObserverRelationship.ts +4 -4
- package/src/types/ContextObserverSeries.ts +8 -7
- package/src/types/ContextObserverTree.ts +11 -10
- package/src/types/ContextSubject.ts +18 -18
- package/src/types/Data.ts +45 -45
- package/src/types/DataFormatter.ts +95 -95
- package/src/types/DataFormatterGrid.ts +55 -55
- package/src/types/DataFormatterMultiGrid.ts +42 -42
- package/src/types/DataFormatterMultiValue.ts +20 -20
- package/src/types/DataFormatterRelationship.ts +22 -22
- package/src/types/DataFormatterSeries.ts +29 -29
- package/src/types/DataFormatterTree.ts +12 -12
- package/src/types/DataGrid.ts +11 -11
- package/src/types/DataMultiGrid.ts +6 -6
- package/src/types/DataMultiValue.ts +12 -12
- package/src/types/DataRelationship.ts +27 -27
- package/src/types/DataSeries.ts +11 -11
- package/src/types/DataTree.ts +20 -20
- package/src/types/Event.ts +153 -153
- package/src/types/Layout.ts +11 -11
- package/src/types/Padding.ts +5 -5
- package/src/types/Plugin.ts +60 -60
- package/src/types/TransformData.ts +7 -7
- package/src/types/index.ts +37 -37
- package/src/utils/commonUtils.ts +50 -50
- package/src/utils/d3Utils.ts +89 -89
- package/src/utils/index.ts +4 -4
- package/src/utils/observables.ts +202 -181
- package/src/utils/orbchartsUtils.ts +253 -253
- package/tsconfig.json +13 -13
- package/vite.config.js +44 -44
package/src/defaults.ts
CHANGED
@@ -1,247 +1,248 @@
|
|
1
|
-
// import type { ChartGlobalDefault } from './types/Chart'
|
2
|
-
// import { ChartRenderOptions } from './types/Chart'
|
3
|
-
import type { ChartType, ChartOptionsPartial } from './types/Chart'
|
4
|
-
import type { DataSeries } from './types/DataSeries'
|
5
|
-
import type { DataGrid, DataGridDatum } from './types/DataGrid'
|
6
|
-
import type { DataMultiGrid } from './types/DataMultiGrid'
|
7
|
-
import type { DataMultiValue } from './types/DataMultiValue'
|
8
|
-
import type { DataTree } from './types/DataTree'
|
9
|
-
import type { DataRelationship } from './types/DataRelationship'
|
10
|
-
import type { DataFormatterBase, DataFormatterValueAxis, DataFormatterGroupAxis } from './types/DataFormatter'
|
11
|
-
import type { DataFormatterSeries } from './types/DataFormatterSeries'
|
12
|
-
import type { DataFormatterGrid, DataFormatterGridGrid } from './types/DataFormatterGrid'
|
13
|
-
import type { DataFormatterMultiGrid, DataFormatterMultiGridGrid } from './types/DataFormatterMultiGrid'
|
14
|
-
import type { DataFormatterMultiValue } from './types/DataFormatterMultiValue'
|
15
|
-
import type { DataFormatterTree } from './types/DataFormatterTree'
|
16
|
-
import type { DataFormatterRelationship } from './types/DataFormatterRelationship'
|
17
|
-
import type { ChartParams } from './types/ChartParams'
|
18
|
-
import type { Padding } from './types/Padding'
|
19
|
-
|
20
|
-
export const CHART_OPTIONS_DEFAULT: ChartOptionsPartial<any> = {
|
21
|
-
preset: {} // 預設為空
|
22
|
-
}
|
23
|
-
|
24
|
-
// export const GLOBAL_DEFAULT: ChartGlobalDefault = {
|
25
|
-
// colors: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
|
26
|
-
// padding: {
|
27
|
-
// top: 50,
|
28
|
-
// right: 70,
|
29
|
-
// bottom: 50,
|
30
|
-
// left: 70
|
31
|
-
// },
|
32
|
-
// // chartWidth: '100%',
|
33
|
-
// // chartHeight: 500
|
34
|
-
// }
|
35
|
-
|
36
|
-
// export const COLORS_DEFAULT = ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67']
|
37
|
-
// ['#ff7ab9', '#66dec8', '#84c8ff', '#30ad1b', '#f8c43e', '#fa5640', '#9d79d7', '#ea4f98']
|
38
|
-
|
39
|
-
export const PADDING_DEFAULT: Padding = {
|
40
|
-
top: 60,
|
41
|
-
right: 60,
|
42
|
-
bottom: 60,
|
43
|
-
left: 60
|
44
|
-
}
|
45
|
-
|
46
|
-
// export const HIGHLIGHT_DEFAULT: HighlightDefault = {
|
47
|
-
// // trigger: 'datum',
|
48
|
-
// id: null,
|
49
|
-
// label: null
|
50
|
-
// }
|
51
|
-
|
52
|
-
export const CHART_PARAMS_DEFAULT: ChartParams = {
|
53
|
-
padding: PADDING_DEFAULT,
|
54
|
-
highlightTarget: 'datum',
|
55
|
-
// highlightDefault: HIGHLIGHT_DEFAULT,
|
56
|
-
highlightDefault: null,
|
57
|
-
colorScheme: 'light',
|
58
|
-
colors: {
|
59
|
-
light: {
|
60
|
-
series: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
|
61
|
-
// primary: '#454545',
|
62
|
-
primary: '#1b1e23',
|
63
|
-
secondary: '#e1e1e1',
|
64
|
-
white: '#ffffff',
|
65
|
-
background: '#ffffff'
|
66
|
-
},
|
67
|
-
dark: {
|
68
|
-
series: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
|
69
|
-
primary: '#f0f0f0',
|
70
|
-
secondary: '#e1e1e1',
|
71
|
-
white: '#ffffff',
|
72
|
-
background: '#000000'
|
73
|
-
}
|
74
|
-
},
|
75
|
-
styles: {
|
76
|
-
textSize: 14,
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
//
|
108
|
-
//
|
109
|
-
//
|
110
|
-
//
|
111
|
-
//
|
112
|
-
//
|
113
|
-
//
|
114
|
-
//
|
115
|
-
//
|
116
|
-
//
|
117
|
-
//
|
118
|
-
// //
|
119
|
-
// //
|
120
|
-
// //
|
121
|
-
//
|
122
|
-
//
|
123
|
-
//
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
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
|
-
|
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
|
-
|
224
|
-
}
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
//
|
238
|
-
//
|
239
|
-
//
|
240
|
-
//
|
241
|
-
//
|
242
|
-
//
|
243
|
-
//
|
244
|
-
}
|
245
|
-
|
246
|
-
|
247
|
-
|
1
|
+
// import type { ChartGlobalDefault } from './types/Chart'
|
2
|
+
// import { ChartRenderOptions } from './types/Chart'
|
3
|
+
import type { ChartType, ChartOptionsPartial } from './types/Chart'
|
4
|
+
import type { DataSeries } from './types/DataSeries'
|
5
|
+
import type { DataGrid, DataGridDatum } from './types/DataGrid'
|
6
|
+
import type { DataMultiGrid } from './types/DataMultiGrid'
|
7
|
+
import type { DataMultiValue } from './types/DataMultiValue'
|
8
|
+
import type { DataTree } from './types/DataTree'
|
9
|
+
import type { DataRelationship } from './types/DataRelationship'
|
10
|
+
import type { DataFormatterBase, DataFormatterValueAxis, DataFormatterGroupAxis } from './types/DataFormatter'
|
11
|
+
import type { DataFormatterSeries } from './types/DataFormatterSeries'
|
12
|
+
import type { DataFormatterGrid, DataFormatterGridGrid } from './types/DataFormatterGrid'
|
13
|
+
import type { DataFormatterMultiGrid, DataFormatterMultiGridGrid } from './types/DataFormatterMultiGrid'
|
14
|
+
import type { DataFormatterMultiValue } from './types/DataFormatterMultiValue'
|
15
|
+
import type { DataFormatterTree } from './types/DataFormatterTree'
|
16
|
+
import type { DataFormatterRelationship } from './types/DataFormatterRelationship'
|
17
|
+
import type { ChartParams } from './types/ChartParams'
|
18
|
+
import type { Padding } from './types/Padding'
|
19
|
+
|
20
|
+
export const CHART_OPTIONS_DEFAULT: ChartOptionsPartial<any> = {
|
21
|
+
preset: {} // 預設為空
|
22
|
+
}
|
23
|
+
|
24
|
+
// export const GLOBAL_DEFAULT: ChartGlobalDefault = {
|
25
|
+
// colors: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
|
26
|
+
// padding: {
|
27
|
+
// top: 50,
|
28
|
+
// right: 70,
|
29
|
+
// bottom: 50,
|
30
|
+
// left: 70
|
31
|
+
// },
|
32
|
+
// // chartWidth: '100%',
|
33
|
+
// // chartHeight: 500
|
34
|
+
// }
|
35
|
+
|
36
|
+
// export const COLORS_DEFAULT = ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67']
|
37
|
+
// ['#ff7ab9', '#66dec8', '#84c8ff', '#30ad1b', '#f8c43e', '#fa5640', '#9d79d7', '#ea4f98']
|
38
|
+
|
39
|
+
export const PADDING_DEFAULT: Padding = {
|
40
|
+
top: 60,
|
41
|
+
right: 60,
|
42
|
+
bottom: 60,
|
43
|
+
left: 60
|
44
|
+
}
|
45
|
+
|
46
|
+
// export const HIGHLIGHT_DEFAULT: HighlightDefault = {
|
47
|
+
// // trigger: 'datum',
|
48
|
+
// id: null,
|
49
|
+
// label: null
|
50
|
+
// }
|
51
|
+
|
52
|
+
export const CHART_PARAMS_DEFAULT: ChartParams = {
|
53
|
+
padding: PADDING_DEFAULT,
|
54
|
+
highlightTarget: 'datum',
|
55
|
+
// highlightDefault: HIGHLIGHT_DEFAULT,
|
56
|
+
highlightDefault: null,
|
57
|
+
colorScheme: 'light',
|
58
|
+
colors: {
|
59
|
+
light: {
|
60
|
+
series: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
|
61
|
+
// primary: '#454545',
|
62
|
+
primary: '#1b1e23',
|
63
|
+
secondary: '#e1e1e1',
|
64
|
+
white: '#ffffff',
|
65
|
+
background: '#ffffff'
|
66
|
+
},
|
67
|
+
dark: {
|
68
|
+
series: ['#67B7DC', '#6794DC', '#6771DC', '#8067DC', '#A367DC', '#C767DC', '#DC67CE', '#DC67AB', '#DC6788', '#DC6967', '#DC8C67', '#DCAF67'],
|
69
|
+
primary: '#f0f0f0',
|
70
|
+
secondary: '#e1e1e1',
|
71
|
+
white: '#ffffff',
|
72
|
+
background: '#000000'
|
73
|
+
}
|
74
|
+
},
|
75
|
+
styles: {
|
76
|
+
// textSize: 14,
|
77
|
+
textSize: '1rem',
|
78
|
+
unhighlightedOpacity: 0.3
|
79
|
+
},
|
80
|
+
transitionDuration: 800,
|
81
|
+
transitionEase: 'easeCubic'
|
82
|
+
}
|
83
|
+
|
84
|
+
export const CHART_WIDTH_DEFAULT = 800
|
85
|
+
|
86
|
+
export const CHART_HEIGHT_DEFAULT = 500
|
87
|
+
|
88
|
+
// -- Data --
|
89
|
+
|
90
|
+
export const DATA_SERIES_DEFAULT: DataSeries = []
|
91
|
+
|
92
|
+
export const DATA_GRID_DEFAULT: DataGrid = []
|
93
|
+
|
94
|
+
export const DATA_MULTI_GRID_DEFAULT: DataMultiGrid = []
|
95
|
+
|
96
|
+
export const DATA_MULTI_VALUE_DEFAULT: DataMultiValue = []
|
97
|
+
|
98
|
+
export const DATA_TREE_DEFAULT: DataTree = []
|
99
|
+
|
100
|
+
export const DATA_RELATIONA_DEFAULTL: DataRelationship = {
|
101
|
+
nodes: [],
|
102
|
+
edges: []
|
103
|
+
}
|
104
|
+
|
105
|
+
// -- Data Formatter --
|
106
|
+
|
107
|
+
// 基本欄位
|
108
|
+
// export const DATA_FORMATTER: DataFormatterBase<ChartType> = {
|
109
|
+
// // ...GLOBAL_DEFAULT,
|
110
|
+
// type: ('' as any), // 後面需複蓋掉否則會有問題
|
111
|
+
// }
|
112
|
+
// 有value
|
113
|
+
// export const DATA_FORMATTER_WITH_VALUE: DataFormatterValue = {
|
114
|
+
// valueFormat: ',.0f'
|
115
|
+
// }
|
116
|
+
// 有axis
|
117
|
+
// export const DATA_FORMATTER_WITH_AXIS: DataFormatterAxis = {
|
118
|
+
// // domainMinValue: 0,
|
119
|
+
// // domainMaxValue: undefined,
|
120
|
+
// // domainMinRange: undefined,
|
121
|
+
// // domainMaxRange: 0.9
|
122
|
+
// valueDomain: [0, 'auto'],
|
123
|
+
// valueRange: [0, 0.9]
|
124
|
+
// }
|
125
|
+
|
126
|
+
export const DATA_FORMATTER_VALUE_AXIS: DataFormatterValueAxis = {
|
127
|
+
position: 'left',
|
128
|
+
scaleDomain: [0, 'auto'],
|
129
|
+
scaleRange: [0, 0.9],
|
130
|
+
label: '',
|
131
|
+
}
|
132
|
+
|
133
|
+
export const DATA_FORMATTER_GROUP_AXIS: DataFormatterGroupAxis = {
|
134
|
+
position: 'bottom',
|
135
|
+
scaleDomain: [0, 'auto'],
|
136
|
+
scalePadding: 0.5,
|
137
|
+
label: ''
|
138
|
+
}
|
139
|
+
|
140
|
+
export const DATA_FORMATTER_SERIES_DEFAULT: DataFormatterSeries = {
|
141
|
+
// ...DATA_FORMATTER_WITH_VALUE,
|
142
|
+
type: 'series',
|
143
|
+
visibleFilter: (datum, rowIndex, columnIndex, context) => true,
|
144
|
+
// unitLabel: '',
|
145
|
+
seriesLabels: [],
|
146
|
+
// mapSeries: (datum, rowIndex, columnIndex, { data, dataFormatter }) => {
|
147
|
+
// const seriesIndex = rowIndex >= dataFormatter.seriesLabels.length
|
148
|
+
// ? rowIndex % dataFormatter.seriesLabels.length // 如果index大於所設定的seriesLabels的數量則從頭回來算
|
149
|
+
// : rowIndex
|
150
|
+
// return dataFormatter.seriesLabels[seriesIndex]
|
151
|
+
// },
|
152
|
+
// colorsPredicate: (datum, rowIndex, columnIndex, { chartParams }) => {
|
153
|
+
// return rowIndex < chartParams.colors[chartParams.colorScheme].series.length
|
154
|
+
// ? chartParams.colors[chartParams.colorScheme].series[rowIndex]
|
155
|
+
// : chartParams.colors[chartParams.colorScheme].series[
|
156
|
+
// rowIndex % chartParams.colors[chartParams.colorScheme].series.length
|
157
|
+
// ]
|
158
|
+
// },
|
159
|
+
sort: null,
|
160
|
+
}
|
161
|
+
|
162
|
+
export const DATA_FORMATTER_GRID_GRID_DEFAULT: DataFormatterGridGrid = {
|
163
|
+
visibleFilter: (datum, rowIndex, columnIndex, context) => true,
|
164
|
+
gridData: {
|
165
|
+
seriesDirection: 'row',
|
166
|
+
rowLabels: [],
|
167
|
+
columnLabels: [],
|
168
|
+
},
|
169
|
+
valueAxis: { ...DATA_FORMATTER_VALUE_AXIS },
|
170
|
+
groupAxis: { ...DATA_FORMATTER_GROUP_AXIS, },
|
171
|
+
slotIndex: 0,
|
172
|
+
seriesSlotIndexes: null
|
173
|
+
}
|
174
|
+
|
175
|
+
export const DATA_FORMATTER_GRID_DEFAULT: DataFormatterGrid = {
|
176
|
+
// ...DATA_FORMATTER_WITH_VALUE,
|
177
|
+
type: 'grid',
|
178
|
+
grid: {
|
179
|
+
...DATA_FORMATTER_GRID_GRID_DEFAULT
|
180
|
+
},
|
181
|
+
container: {
|
182
|
+
gap: 120,
|
183
|
+
rowAmount: 1,
|
184
|
+
columnAmount: 1
|
185
|
+
}
|
186
|
+
// visibleGroupRange: null,
|
187
|
+
// colorsPredicate: (datum, rowIndex, columnIndex, { chartParams, dataFormatter }) => {
|
188
|
+
// const seriesIndex = dataFormatter.grid.seriesDirection === 'row' ? rowIndex : columnIndex
|
189
|
+
// return chartParams.colors[chartParams.colorScheme].series[seriesIndex]
|
190
|
+
// },
|
191
|
+
}
|
192
|
+
|
193
|
+
// export const DATA_FORMATTER_MULTI_GRID_MULTI_GRID_DEFAULT: DataFormatterMultiGridMultiGrid = {
|
194
|
+
// ...DATA_FORMATTER_GRID_DEFAULT,
|
195
|
+
// slotIndex: 0,
|
196
|
+
// seriesSlotIndexes: null
|
197
|
+
// }
|
198
|
+
|
199
|
+
export const DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT: DataFormatterMultiGridGrid = {
|
200
|
+
...DATA_FORMATTER_GRID_GRID_DEFAULT
|
201
|
+
}
|
202
|
+
|
203
|
+
export const DATA_FORMATTER_MULTI_GRID_DEFAULT: DataFormatterMultiGrid = {
|
204
|
+
type: 'multiGrid',
|
205
|
+
// visibleFilter: (datum, rowIndex, columnIndex, context) => true,
|
206
|
+
gridList: [
|
207
|
+
{
|
208
|
+
...DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT
|
209
|
+
},
|
210
|
+
],
|
211
|
+
container: {
|
212
|
+
gap: 120,
|
213
|
+
rowAmount: 1,
|
214
|
+
columnAmount: 1
|
215
|
+
}
|
216
|
+
}
|
217
|
+
|
218
|
+
export const DATA_FORMATTER_MULTI_VALUE_DEFAULT: DataFormatterMultiValue = {
|
219
|
+
type: 'multiValue',
|
220
|
+
visibleFilter: (datum, rowIndex, columnIndex, context) => true,
|
221
|
+
// labelFormat: (datum: any) => (datum && datum.label) ?? '',
|
222
|
+
multiValue: [],
|
223
|
+
xAxis: { ...DATA_FORMATTER_VALUE_AXIS },
|
224
|
+
yAxis: { ...DATA_FORMATTER_VALUE_AXIS },
|
225
|
+
}
|
226
|
+
|
227
|
+
export const DATA_FORMATTER_TREE_DEFAULT: DataFormatterTree = {
|
228
|
+
type: 'tree',
|
229
|
+
visibleFilter: (datum, rowIndex, columnIndex, context) => true,
|
230
|
+
// labelFormat: (datum: any) => (datum && datum.label) ?? '',
|
231
|
+
categoryLabels: []
|
232
|
+
}
|
233
|
+
|
234
|
+
export const DATA_FORMATTER_RELATIONAL_DEFAULT: DataFormatterRelationship = {
|
235
|
+
type: 'relationship',
|
236
|
+
visibleFilter: (datum, rowIndex, columnIndex, context) => true,
|
237
|
+
// node: {
|
238
|
+
// // labelFormat: (node: any) => (node && node.label) ?? '',
|
239
|
+
// descriptionFormat: (node: any) => (node && node.label) ?? ''
|
240
|
+
// },
|
241
|
+
// edge: {
|
242
|
+
// // labelFormat: (edge: any) => (edge && edge.label) ?? '',
|
243
|
+
// descriptionFormat: (edge: any) => (edge && edge.label) ?? ''
|
244
|
+
// },
|
245
|
+
}
|
246
|
+
|
247
|
+
// -- Render Data --
|
248
|
+
|
package/src/defineGridPlugin.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
-
|
3
|
-
export const defineGridPlugin = createBasePlugin<'grid'>()
|
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<'multiGrid'>()
|
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<'multiValue'>()
|
1
|
+
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
+
|
3
|
+
export const defineMultiValuePlugin = createBasePlugin<'multiValue'>()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
-
import { ChartType } from './types/Chart'
|
3
|
-
|
4
|
-
export const defineNoneDataPlugin = createBasePlugin<any>() // noneDataPlugin 可以使用在任何的 chartType
|
1
|
+
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
+
import { ChartType } from './types/Chart'
|
3
|
+
|
4
|
+
export const defineNoneDataPlugin = createBasePlugin<any>() // noneDataPlugin 可以使用在任何的 chartType
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
-
|
3
|
-
export const defineRelationshipPlugin = createBasePlugin<'relationship'>()
|
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<'series'>()
|
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<'tree'>()
|
1
|
+
import { createBasePlugin } from './base/createBasePlugin'
|
2
|
+
|
3
|
+
export const defineTreePlugin = createBasePlugin<'tree'>()
|