@orbcharts/core 3.0.0-beta.3 → 3.0.0-beta.4

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 (77) hide show
  1. package/LICENSE +200 -200
  2. package/dist/orbcharts-core.es.js +2623 -2338
  3. package/dist/orbcharts-core.umd.js +4 -4
  4. package/dist/src/utils/d3Scale.d.ts +28 -0
  5. package/dist/src/utils/gridObservables.d.ts +29 -19
  6. package/dist/src/utils/index.d.ts +1 -1
  7. package/dist/src/utils/multiGridObservables.d.ts +2 -2
  8. package/dist/src/utils/multiValueObservables.d.ts +73 -0
  9. package/dist/src/utils/orbchartsUtils.d.ts +19 -5
  10. package/dist/src/utils/seriesObservables.d.ts +4 -4
  11. package/dist/src/utils/treeObservables.d.ts +2 -5
  12. package/lib/core-types.ts +7 -7
  13. package/package.json +42 -42
  14. package/src/AbstractChart.ts +57 -57
  15. package/src/GridChart.ts +24 -24
  16. package/src/MultiGridChart.ts +24 -24
  17. package/src/MultiValueChart.ts +24 -24
  18. package/src/RelationshipChart.ts +24 -24
  19. package/src/SeriesChart.ts +24 -24
  20. package/src/TreeChart.ts +24 -24
  21. package/src/base/createBaseChart.ts +505 -505
  22. package/src/base/createBasePlugin.ts +153 -153
  23. package/src/base/validators/chartOptionsValidator.ts +23 -23
  24. package/src/base/validators/chartParamsValidator.ts +133 -133
  25. package/src/base/validators/elementValidator.ts +13 -13
  26. package/src/base/validators/pluginsValidator.ts +14 -14
  27. package/src/defaults.ts +235 -232
  28. package/src/defineGridPlugin.ts +3 -3
  29. package/src/defineMultiGridPlugin.ts +3 -3
  30. package/src/defineMultiValuePlugin.ts +3 -3
  31. package/src/defineNoneDataPlugin.ts +4 -4
  32. package/src/defineRelationshipPlugin.ts +3 -3
  33. package/src/defineSeriesPlugin.ts +3 -3
  34. package/src/defineTreePlugin.ts +3 -3
  35. package/src/grid/computedDataFn.ts +129 -129
  36. package/src/grid/contextObserverCallback.ts +176 -155
  37. package/src/grid/dataFormatterValidator.ts +101 -101
  38. package/src/grid/dataValidator.ts +12 -12
  39. package/src/index.ts +20 -20
  40. package/src/multiGrid/computedDataFn.ts +123 -123
  41. package/src/multiGrid/contextObserverCallback.ts +41 -41
  42. package/src/multiGrid/dataFormatterValidator.ts +115 -115
  43. package/src/multiGrid/dataValidator.ts +12 -12
  44. package/src/multiValue/computedDataFn.ts +110 -176
  45. package/src/multiValue/contextObserverCallback.ts +160 -12
  46. package/src/multiValue/dataFormatterValidator.ts +9 -9
  47. package/src/multiValue/dataValidator.ts +9 -9
  48. package/src/relationship/computedDataFn.ts +125 -125
  49. package/src/relationship/contextObserverCallback.ts +12 -12
  50. package/src/relationship/dataFormatterValidator.ts +9 -9
  51. package/src/relationship/dataValidator.ts +9 -9
  52. package/src/series/computedDataFn.ts +88 -88
  53. package/src/series/contextObserverCallback.ts +100 -100
  54. package/src/series/dataFormatterValidator.ts +41 -41
  55. package/src/series/dataValidator.ts +12 -12
  56. package/src/tree/computedDataFn.ts +129 -130
  57. package/src/tree/contextObserverCallback.ts +58 -61
  58. package/src/tree/dataFormatterValidator.ts +13 -13
  59. package/src/tree/dataValidator.ts +13 -13
  60. package/src/utils/commonUtils.ts +55 -55
  61. package/src/utils/d3Scale.ts +198 -0
  62. package/src/utils/errorMessage.ts +42 -42
  63. package/src/utils/gridObservables.ts +671 -614
  64. package/src/utils/index.ts +9 -9
  65. package/src/utils/multiGridObservables.ts +392 -366
  66. package/src/utils/multiValueObservables.ts +643 -0
  67. package/src/utils/observables.ts +219 -219
  68. package/src/utils/orbchartsUtils.ts +377 -352
  69. package/src/utils/seriesObservables.ts +175 -175
  70. package/src/utils/treeObservables.ts +105 -94
  71. package/src/utils/validator.ts +126 -125
  72. package/tsconfig.base.json +13 -13
  73. package/tsconfig.json +2 -2
  74. package/vite-env.d.ts +6 -6
  75. package/vite.config.js +22 -22
  76. package/dist/src/utils/d3Utils.d.ts +0 -19
  77. package/src/utils/d3Utils.ts +0 -108
@@ -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,235 @@
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
+ xAxis: { ...DATA_FORMATTER_VALUE_AXIS_DEFAULT },
205
+ yAxis: { ...DATA_FORMATTER_VALUE_AXIS_DEFAULT },
206
+ container: {
207
+ ...DATA_FORMATTER_CONTAINER_DEFAULT
208
+ },
209
+ separateCategory: false
210
+ }
211
+ DATA_FORMATTER_MULTI_VALUE_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
212
+
213
+ export const DATA_FORMATTER_TREE_DEFAULT: DataFormatterTree = {
214
+ type: 'tree',
215
+ visibleFilter: (datum, context) => true,
216
+ // labelFormat: (datum: any) => (datum && datum.label) ?? '',
217
+ categoryLabels: []
218
+ }
219
+ DATA_FORMATTER_TREE_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
220
+
221
+ export const DATA_FORMATTER_RELATIONAL_DEFAULT: DataFormatterRelationship = {
222
+ type: 'relationship',
223
+ visibleFilter: (datum, context) => true,
224
+ categoryLabels: []
225
+ // node: {
226
+ // // labelFormat: (node: any) => (node && node.label) ?? '',
227
+ // descriptionFormat: (node: any) => (node && node.label) ?? ''
228
+ // },
229
+ // edge: {
230
+ // // labelFormat: (edge: any) => (edge && edge.label) ?? '',
231
+ // descriptionFormat: (edge: any) => (edge && edge.label) ?? ''
232
+ // },
233
+ }
234
+ DATA_FORMATTER_RELATIONAL_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
235
+
@@ -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')