@orbcharts/core 3.0.0-alpha.40 → 3.0.0-alpha.42

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.
Files changed (88) hide show
  1. package/LICENSE +200 -200
  2. package/dist/orbcharts-core.es.js +1152 -1124
  3. package/dist/orbcharts-core.umd.js +2 -2
  4. package/dist/src/types/ChartParams.d.ts +1 -1
  5. package/dist/src/types/ContextObserverGrid.d.ts +1 -0
  6. package/dist/src/types/ContextObserverMultiGrid.d.ts +1 -0
  7. package/dist/src/types/ContextObserverSeries.d.ts +1 -0
  8. package/dist/src/types/ContextObserverTree.d.ts +1 -0
  9. package/dist/src/utils/observables.d.ts +1 -0
  10. package/package.json +41 -41
  11. package/src/AbstractChart.ts +48 -48
  12. package/src/GridChart.ts +20 -20
  13. package/src/MultiGridChart.ts +20 -20
  14. package/src/MultiValueChart.ts +20 -20
  15. package/src/RelationshipChart.ts +20 -20
  16. package/src/SeriesChart.ts +20 -20
  17. package/src/TreeChart.ts +20 -20
  18. package/src/base/createBaseChart.ts +367 -367
  19. package/src/base/createBasePlugin.ts +89 -89
  20. package/src/defaults.ts +248 -247
  21. package/src/defineGridPlugin.ts +3 -3
  22. package/src/defineMultiGridPlugin.ts +3 -3
  23. package/src/defineMultiValuePlugin.ts +3 -3
  24. package/src/defineNoneDataPlugin.ts +4 -4
  25. package/src/defineRelationshipPlugin.ts +3 -3
  26. package/src/defineSeriesPlugin.ts +3 -3
  27. package/src/defineTreePlugin.ts +3 -3
  28. package/src/grid/computeGridData.ts +205 -205
  29. package/src/grid/createGridContextObserver.ts +130 -124
  30. package/src/grid/gridObservables.ts +486 -486
  31. package/src/index.ts +21 -21
  32. package/src/multiGrid/computeMultiGridData.ts +173 -173
  33. package/src/multiGrid/createMultiGridContextObserver.ts +40 -34
  34. package/src/multiGrid/multiGridObservables.ts +285 -285
  35. package/src/multiValue/computeMultiValueData.ts +136 -136
  36. package/src/multiValue/createMultiValueContextObserver.ts +12 -12
  37. package/src/relationship/computeRelationshipData.ts +106 -106
  38. package/src/relationship/createRelationshipContextObserver.ts +12 -12
  39. package/src/series/computeSeriesData.ts +153 -153
  40. package/src/series/createSeriesContextObserver.ts +38 -33
  41. package/src/series/seriesObservables.ts +23 -23
  42. package/src/tree/computeTreeData.ts +128 -128
  43. package/src/tree/createTreeContextObserver.ts +61 -56
  44. package/src/tree/treeObservables.ts +94 -94
  45. package/src/types/Chart.ts +48 -48
  46. package/src/types/ChartParams.ts +51 -51
  47. package/src/types/ComputedData.ts +82 -82
  48. package/src/types/ComputedDataGrid.ts +13 -13
  49. package/src/types/ComputedDataMultiGrid.ts +2 -2
  50. package/src/types/ComputedDataMultiValue.ts +9 -9
  51. package/src/types/ComputedDataRelationship.ts +19 -19
  52. package/src/types/ComputedDataSeries.ts +7 -7
  53. package/src/types/ComputedDataTree.ts +19 -19
  54. package/src/types/ContextObserver.ts +38 -38
  55. package/src/types/ContextObserverGrid.ts +33 -33
  56. package/src/types/ContextObserverMultiGrid.ts +28 -27
  57. package/src/types/ContextObserverMultiValue.ts +4 -4
  58. package/src/types/ContextObserverRelationship.ts +4 -4
  59. package/src/types/ContextObserverSeries.ts +8 -7
  60. package/src/types/ContextObserverTree.ts +11 -10
  61. package/src/types/ContextSubject.ts +18 -18
  62. package/src/types/Data.ts +45 -45
  63. package/src/types/DataFormatter.ts +95 -95
  64. package/src/types/DataFormatterGrid.ts +55 -55
  65. package/src/types/DataFormatterMultiGrid.ts +42 -42
  66. package/src/types/DataFormatterMultiValue.ts +20 -20
  67. package/src/types/DataFormatterRelationship.ts +22 -22
  68. package/src/types/DataFormatterSeries.ts +29 -29
  69. package/src/types/DataFormatterTree.ts +12 -12
  70. package/src/types/DataGrid.ts +11 -11
  71. package/src/types/DataMultiGrid.ts +6 -6
  72. package/src/types/DataMultiValue.ts +12 -12
  73. package/src/types/DataRelationship.ts +27 -27
  74. package/src/types/DataSeries.ts +11 -11
  75. package/src/types/DataTree.ts +20 -20
  76. package/src/types/Event.ts +153 -153
  77. package/src/types/Layout.ts +11 -11
  78. package/src/types/Padding.ts +5 -5
  79. package/src/types/Plugin.ts +60 -60
  80. package/src/types/TransformData.ts +7 -7
  81. package/src/types/index.ts +37 -37
  82. package/src/utils/commonUtils.ts +50 -50
  83. package/src/utils/d3Utils.ts +89 -89
  84. package/src/utils/index.ts +4 -4
  85. package/src/utils/observables.ts +202 -181
  86. package/src/utils/orbchartsUtils.ts +253 -253
  87. package/tsconfig.json +13 -13
  88. 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
- 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
- // 基本欄位
107
- // export const DATA_FORMATTER: DataFormatterBase<ChartType> = {
108
- // // ...GLOBAL_DEFAULT,
109
- // type: ('' as any), // 後面需複蓋掉否則會有問題
110
- // }
111
- // 有value
112
- // export const DATA_FORMATTER_WITH_VALUE: DataFormatterValue = {
113
- // valueFormat: ',.0f'
114
- // }
115
- // 有axis
116
- // export const DATA_FORMATTER_WITH_AXIS: DataFormatterAxis = {
117
- // // domainMinValue: 0,
118
- // // domainMaxValue: undefined,
119
- // // domainMinRange: undefined,
120
- // // domainMaxRange: 0.9
121
- // valueDomain: [0, 'auto'],
122
- // valueRange: [0, 0.9]
123
- // }
124
-
125
- export const DATA_FORMATTER_VALUE_AXIS: DataFormatterValueAxis = {
126
- position: 'left',
127
- scaleDomain: [0, 'auto'],
128
- scaleRange: [0, 0.9],
129
- label: '',
130
- }
131
-
132
- export const DATA_FORMATTER_GROUP_AXIS: DataFormatterGroupAxis = {
133
- position: 'bottom',
134
- scaleDomain: [0, 'auto'],
135
- scalePadding: 0.5,
136
- label: ''
137
- }
138
-
139
- export const DATA_FORMATTER_SERIES_DEFAULT: DataFormatterSeries = {
140
- // ...DATA_FORMATTER_WITH_VALUE,
141
- type: 'series',
142
- visibleFilter: (datum, rowIndex, columnIndex, context) => true,
143
- // unitLabel: '',
144
- seriesLabels: [],
145
- // mapSeries: (datum, rowIndex, columnIndex, { data, dataFormatter }) => {
146
- // const seriesIndex = rowIndex >= dataFormatter.seriesLabels.length
147
- // ? rowIndex % dataFormatter.seriesLabels.length // 如果index大於所設定的seriesLabels的數量則從頭回來算
148
- // : rowIndex
149
- // return dataFormatter.seriesLabels[seriesIndex]
150
- // },
151
- // colorsPredicate: (datum, rowIndex, columnIndex, { chartParams }) => {
152
- // return rowIndex < chartParams.colors[chartParams.colorScheme].series.length
153
- // ? chartParams.colors[chartParams.colorScheme].series[rowIndex]
154
- // : chartParams.colors[chartParams.colorScheme].series[
155
- // rowIndex % chartParams.colors[chartParams.colorScheme].series.length
156
- // ]
157
- // },
158
- sort: null,
159
- }
160
-
161
- export const DATA_FORMATTER_GRID_GRID_DEFAULT: DataFormatterGridGrid = {
162
- visibleFilter: (datum, rowIndex, columnIndex, context) => true,
163
- gridData: {
164
- seriesDirection: 'row',
165
- rowLabels: [],
166
- columnLabels: [],
167
- },
168
- valueAxis: { ...DATA_FORMATTER_VALUE_AXIS },
169
- groupAxis: { ...DATA_FORMATTER_GROUP_AXIS, },
170
- slotIndex: 0,
171
- seriesSlotIndexes: null
172
- }
173
-
174
- export const DATA_FORMATTER_GRID_DEFAULT: DataFormatterGrid = {
175
- // ...DATA_FORMATTER_WITH_VALUE,
176
- type: 'grid',
177
- grid: {
178
- ...DATA_FORMATTER_GRID_GRID_DEFAULT
179
- },
180
- container: {
181
- gap: 120,
182
- rowAmount: 1,
183
- columnAmount: 1
184
- }
185
- // visibleGroupRange: null,
186
- // colorsPredicate: (datum, rowIndex, columnIndex, { chartParams, dataFormatter }) => {
187
- // const seriesIndex = dataFormatter.grid.seriesDirection === 'row' ? rowIndex : columnIndex
188
- // return chartParams.colors[chartParams.colorScheme].series[seriesIndex]
189
- // },
190
- }
191
-
192
- // export const DATA_FORMATTER_MULTI_GRID_MULTI_GRID_DEFAULT: DataFormatterMultiGridMultiGrid = {
193
- // ...DATA_FORMATTER_GRID_DEFAULT,
194
- // slotIndex: 0,
195
- // seriesSlotIndexes: null
196
- // }
197
-
198
- export const DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT: DataFormatterMultiGridGrid = {
199
- ...DATA_FORMATTER_GRID_GRID_DEFAULT
200
- }
201
-
202
- export const DATA_FORMATTER_MULTI_GRID_DEFAULT: DataFormatterMultiGrid = {
203
- type: 'multiGrid',
204
- // visibleFilter: (datum, rowIndex, columnIndex, context) => true,
205
- gridList: [
206
- {
207
- ...DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT
208
- },
209
- ],
210
- container: {
211
- gap: 120,
212
- rowAmount: 1,
213
- columnAmount: 1
214
- }
215
- }
216
-
217
- export const DATA_FORMATTER_MULTI_VALUE_DEFAULT: DataFormatterMultiValue = {
218
- type: 'multiValue',
219
- visibleFilter: (datum, rowIndex, columnIndex, context) => true,
220
- // labelFormat: (datum: any) => (datum && datum.label) ?? '',
221
- multiValue: [],
222
- xAxis: { ...DATA_FORMATTER_VALUE_AXIS },
223
- yAxis: { ...DATA_FORMATTER_VALUE_AXIS },
224
- }
225
-
226
- export const DATA_FORMATTER_TREE_DEFAULT: DataFormatterTree = {
227
- type: 'tree',
228
- visibleFilter: (datum, rowIndex, columnIndex, context) => true,
229
- // labelFormat: (datum: any) => (datum && datum.label) ?? '',
230
- categoryLabels: []
231
- }
232
-
233
- export const DATA_FORMATTER_RELATIONAL_DEFAULT: DataFormatterRelationship = {
234
- type: 'relationship',
235
- visibleFilter: (datum, rowIndex, columnIndex, context) => true,
236
- // node: {
237
- // // labelFormat: (node: any) => (node && node.label) ?? '',
238
- // descriptionFormat: (node: any) => (node && node.label) ?? ''
239
- // },
240
- // edge: {
241
- // // labelFormat: (edge: any) => (edge && edge.label) ?? '',
242
- // descriptionFormat: (edge: any) => (edge && edge.label) ?? ''
243
- // },
244
- }
245
-
246
- // -- Render Data --
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: '0.875rem',
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
+
@@ -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'>()
@@ -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'>()