@orbcharts/core 3.0.0-alpha.67 → 3.0.0-beta.1

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 (66) hide show
  1. package/LICENSE +200 -200
  2. package/dist/orbcharts-core.es.js +1337 -1328
  3. package/dist/orbcharts-core.umd.js +3 -3
  4. package/lib/core-types.ts +7 -7
  5. package/package.json +42 -42
  6. package/src/AbstractChart.ts +57 -57
  7. package/src/GridChart.ts +24 -24
  8. package/src/MultiGridChart.ts +24 -24
  9. package/src/MultiValueChart.ts +24 -24
  10. package/src/RelationshipChart.ts +24 -24
  11. package/src/SeriesChart.ts +24 -24
  12. package/src/TreeChart.ts +24 -24
  13. package/src/base/createBaseChart.ts +505 -500
  14. package/src/base/createBasePlugin.ts +153 -152
  15. package/src/base/validators/chartOptionsValidator.ts +23 -23
  16. package/src/base/validators/chartParamsValidator.ts +133 -133
  17. package/src/base/validators/elementValidator.ts +13 -13
  18. package/src/base/validators/pluginsValidator.ts +14 -14
  19. package/src/defaults.ts +232 -232
  20. package/src/defineGridPlugin.ts +3 -3
  21. package/src/defineMultiGridPlugin.ts +3 -3
  22. package/src/defineMultiValuePlugin.ts +3 -3
  23. package/src/defineNoneDataPlugin.ts +4 -4
  24. package/src/defineRelationshipPlugin.ts +3 -3
  25. package/src/defineSeriesPlugin.ts +3 -3
  26. package/src/defineTreePlugin.ts +3 -3
  27. package/src/grid/computedDataFn.ts +129 -129
  28. package/src/grid/contextObserverCallback.ts +155 -155
  29. package/src/grid/dataFormatterValidator.ts +101 -101
  30. package/src/grid/dataValidator.ts +12 -12
  31. package/src/index.ts +20 -20
  32. package/src/multiGrid/computedDataFn.ts +123 -123
  33. package/src/multiGrid/contextObserverCallback.ts +41 -41
  34. package/src/multiGrid/dataFormatterValidator.ts +115 -115
  35. package/src/multiGrid/dataValidator.ts +12 -12
  36. package/src/multiValue/computedDataFn.ts +176 -176
  37. package/src/multiValue/contextObserverCallback.ts +12 -12
  38. package/src/multiValue/dataFormatterValidator.ts +9 -9
  39. package/src/multiValue/dataValidator.ts +9 -9
  40. package/src/relationship/computedDataFn.ts +125 -125
  41. package/src/relationship/contextObserverCallback.ts +12 -12
  42. package/src/relationship/dataFormatterValidator.ts +9 -9
  43. package/src/relationship/dataValidator.ts +9 -9
  44. package/src/series/computedDataFn.ts +88 -88
  45. package/src/series/contextObserverCallback.ts +100 -100
  46. package/src/series/dataFormatterValidator.ts +41 -41
  47. package/src/series/dataValidator.ts +12 -12
  48. package/src/tree/computedDataFn.ts +130 -130
  49. package/src/tree/contextObserverCallback.ts +61 -61
  50. package/src/tree/dataFormatterValidator.ts +13 -13
  51. package/src/tree/dataValidator.ts +13 -13
  52. package/src/utils/commonUtils.ts +55 -55
  53. package/src/utils/d3Utils.ts +108 -108
  54. package/src/utils/errorMessage.ts +42 -42
  55. package/src/utils/gridObservables.ts +611 -611
  56. package/src/utils/index.ts +9 -9
  57. package/src/utils/multiGridObservables.ts +366 -366
  58. package/src/utils/observables.ts +219 -219
  59. package/src/utils/orbchartsUtils.ts +352 -352
  60. package/src/utils/seriesObservables.ts +175 -175
  61. package/src/utils/treeObservables.ts +94 -94
  62. package/src/utils/validator.ts +125 -125
  63. package/tsconfig.base.json +13 -13
  64. package/tsconfig.json +2 -2
  65. package/vite-env.d.ts +6 -6
  66. package/vite.config.js +22 -22
@@ -1,15 +1,15 @@
1
- import type { ChartType, PluginEntity, ValidatorResult } from '../../../lib/core-types'
2
- import { validateColumns } from '../../utils/validator'
3
-
4
- export function pluginsValidator (chartType: ChartType, pluginEntities: PluginEntity<any, any, any>[]): ValidatorResult {
5
- const result = validateColumns({ pluginEntities }, {
6
- pluginEntities: {
7
- toBe: `PluginEntity<'${chartType}'>[]`,
8
- test: (value: PluginEntity<any, any, any>[]) => {
9
- return Array.isArray(value) && value.every((v) => v.chartType === chartType || v.chartType === 'noneData')
10
- }
11
- }
12
- })
13
-
14
- return result
1
+ import type { ChartType, PluginEntity, ValidatorResult } from '../../../lib/core-types'
2
+ import { validateColumns } from '../../utils/validator'
3
+
4
+ export function pluginsValidator (chartType: ChartType, pluginEntities: PluginEntity<any, any, any>[]): ValidatorResult {
5
+ const result = validateColumns({ pluginEntities }, {
6
+ pluginEntities: {
7
+ toBe: `PluginEntity<'${chartType}'>[]`,
8
+ test: (value: PluginEntity<any, any, any>[]) => {
9
+ return Array.isArray(value) && value.every((v) => v.chartType === chartType || v.chartType === 'noneData')
10
+ }
11
+ }
12
+ })
13
+
14
+ return result
15
15
  }
package/src/defaults.ts CHANGED
@@ -1,232 +1,232 @@
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
-
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
+
@@ -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
-
3
- // chartType型別使用 'any' 是為了讓 plugin entity 能夠被加入到所有類別的 chart.plugins$ 中
4
- export const defineNoneDataPlugin = createBasePlugin<any>('noneData')
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('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')