@orbcharts/core 3.0.7 → 4.0.0-pre-alpha.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 (196) hide show
  1. package/dist/orbcharts-core.es.js +2795 -6591
  2. package/dist/orbcharts-core.umd.js +6 -6
  3. package/dist/src/OrbCharts.d.ts +18 -0
  4. package/dist/src/chart/createChart.d.ts +3 -0
  5. package/dist/src/chart/createGraphData.d.ts +3 -0
  6. package/dist/src/chart/createGridData.d.ts +3 -0
  7. package/dist/src/chart/createMultivariateData.d.ts +3 -0
  8. package/dist/src/chart/createSeriesData.d.ts +3 -0
  9. package/dist/src/chart/createTreeData.d.ts +3 -0
  10. package/dist/src/chart/defaults.d.ts +5 -0
  11. package/dist/src/defineCanvasLayer.d.ts +16 -0
  12. package/dist/src/defineCanvasPlugin.d.ts +22 -0
  13. package/dist/src/defineSVGLayer.d.ts +16 -0
  14. package/dist/src/defineSVGPlugin.d.ts +22 -0
  15. package/dist/src/index.d.ts +6 -14
  16. package/dist/src/layer/createLayer.d.ts +3 -0
  17. package/dist/src/plugin/createPlugin.d.ts +3 -0
  18. package/dist/src/test/createGraphData.test.d.ts +1 -0
  19. package/dist/src/test/createTreeData.test.d.ts +1 -0
  20. package/dist/src/test/simple-graph-test.d.ts +74 -0
  21. package/dist/src/test/simple-tree-test.d.ts +13 -0
  22. package/dist/src/types/Chart.d.ts +39 -0
  23. package/dist/src/types/ChartContext.d.ts +27 -0
  24. package/dist/src/types/Common.d.ts +3 -0
  25. package/dist/src/types/Encoding.d.ts +33 -0
  26. package/dist/src/types/Event.d.ts +12 -0
  27. package/dist/src/types/Layers.d.ts +55 -0
  28. package/dist/src/types/ModelData.d.ts +70 -0
  29. package/dist/src/types/Plugin.d.ts +39 -0
  30. package/dist/src/types/RawData.d.ts +18 -0
  31. package/dist/src/types/RenderData.d.ts +4 -0
  32. package/dist/src/types/Theme.d.ts +17 -0
  33. package/dist/src/types/Validator.d.ts +20 -0
  34. package/dist/src/types/index.d.ts +12 -0
  35. package/dist/src/utils/aggregateUtils.d.ts +37 -0
  36. package/dist/src/utils/colorUtils.d.ts +22 -0
  37. package/dist/src/utils/commonUtils.d.ts +3 -5
  38. package/dist/src/utils/dom-lifecycle.d.ts +37 -0
  39. package/dist/src/utils/dom.d.ts +6 -0
  40. package/dist/src/utils/index.d.ts +5 -1
  41. package/dist/src/utils/observables.d.ts +1 -25
  42. package/dist/src/utils/orbchartsUtils.d.ts +2 -53
  43. package/dist/src/utils/validator.d.ts +2 -2
  44. package/dist/test/aggregateTest.d.ts +1 -0
  45. package/package.json +26 -13
  46. package/src/OrbCharts.ts +35 -0
  47. package/src/chart/createChart.ts +997 -0
  48. package/src/chart/createGraphData.ts +391 -0
  49. package/src/chart/createGridData.ts +247 -0
  50. package/src/chart/createMultivariateData.ts +181 -0
  51. package/src/chart/createSeriesData.ts +297 -0
  52. package/src/chart/createTreeData.ts +344 -0
  53. package/src/chart/defaults.ts +100 -0
  54. package/src/defineCanvasLayer.ts +24 -0
  55. package/src/defineCanvasPlugin.ts +39 -0
  56. package/src/defineSVGLayer.ts +24 -0
  57. package/src/defineSVGPlugin.ts +39 -0
  58. package/src/index.ts +6 -18
  59. package/src/layer/createLayer.ts +138 -0
  60. package/src/plugin/createPlugin.ts +470 -0
  61. package/src/test/createGraphData.test.ts +103 -0
  62. package/src/test/createTreeData.test.ts +97 -0
  63. package/src/test/simple-graph-test.js +51 -0
  64. package/src/test/simple-tree-test.js +58 -0
  65. package/src/types/Chart.ts +62 -0
  66. package/src/types/ChartContext.ts +42 -0
  67. package/src/types/Common.ts +5 -0
  68. package/src/types/Encoding.ts +43 -0
  69. package/src/types/Event.ts +26 -0
  70. package/src/types/Layers.ts +93 -0
  71. package/src/types/ModelData.ts +95 -0
  72. package/src/types/Plugin.ts +98 -0
  73. package/src/types/RawData.ts +67 -0
  74. package/src/types/RenderData.ts +16 -0
  75. package/src/types/Theme.ts +21 -0
  76. package/src/types/Validator.ts +36 -0
  77. package/src/types/index.ts +12 -0
  78. package/src/utils/aggregateUtils.ts +99 -0
  79. package/src/utils/colorUtils.ts +63 -0
  80. package/src/utils/commonUtils.ts +12 -11
  81. package/src/utils/dom-lifecycle.ts +164 -0
  82. package/src/utils/dom.ts +55 -0
  83. package/src/utils/index.ts +6 -2
  84. package/src/utils/observables.ts +1 -292
  85. package/src/utils/orbchartsUtils.ts +6 -393
  86. package/src/utils/validator.ts +15 -14
  87. package/dist/lib/core-types.d.ts +0 -1
  88. package/dist/src/AbstractChart.d.ts +0 -19
  89. package/dist/src/GridChart.d.ts +0 -6
  90. package/dist/src/MultiGridChart.d.ts +0 -6
  91. package/dist/src/MultiValueChart.d.ts +0 -6
  92. package/dist/src/RelationshipChart.d.ts +0 -6
  93. package/dist/src/SeriesChart.d.ts +0 -6
  94. package/dist/src/TreeChart.d.ts +0 -6
  95. package/dist/src/base/createBaseChart.d.ts +0 -3
  96. package/dist/src/base/createBasePlugin.d.ts +0 -3
  97. package/dist/src/base/validators/chartOptionsValidator.d.ts +0 -3
  98. package/dist/src/base/validators/chartParamsValidator.d.ts +0 -3
  99. package/dist/src/base/validators/elementValidator.d.ts +0 -3
  100. package/dist/src/base/validators/pluginsValidator.d.ts +0 -3
  101. package/dist/src/defaults.d.ts +0 -25
  102. package/dist/src/defineGridPlugin.d.ts +0 -1
  103. package/dist/src/defineMultiGridPlugin.d.ts +0 -1
  104. package/dist/src/defineMultiValuePlugin.d.ts +0 -1
  105. package/dist/src/defineNoneDataPlugin.d.ts +0 -1
  106. package/dist/src/defineRelationshipPlugin.d.ts +0 -1
  107. package/dist/src/defineSeriesPlugin.d.ts +0 -1
  108. package/dist/src/defineTreePlugin.d.ts +0 -1
  109. package/dist/src/grid/computedDataFn.d.ts +0 -4
  110. package/dist/src/grid/contextObserverCallback.d.ts +0 -3
  111. package/dist/src/grid/dataFormatterValidator.d.ts +0 -3
  112. package/dist/src/grid/dataValidator.d.ts +0 -3
  113. package/dist/src/grid/gridObservables.d.ts +0 -64
  114. package/dist/src/multiGrid/computedDataFn.d.ts +0 -3
  115. package/dist/src/multiGrid/contextObserverCallback.d.ts +0 -3
  116. package/dist/src/multiGrid/dataFormatterValidator.d.ts +0 -3
  117. package/dist/src/multiGrid/dataValidator.d.ts +0 -3
  118. package/dist/src/multiGrid/multiGridObservables.d.ts +0 -16
  119. package/dist/src/multiValue/computedDataFn.d.ts +0 -3
  120. package/dist/src/multiValue/contextObserverCallback.d.ts +0 -3
  121. package/dist/src/multiValue/dataFormatterValidator.d.ts +0 -3
  122. package/dist/src/multiValue/dataValidator.d.ts +0 -3
  123. package/dist/src/multiValue/multiValueObservables.d.ts +0 -130
  124. package/dist/src/relationship/computedDataFn.d.ts +0 -3
  125. package/dist/src/relationship/contextObserverCallback.d.ts +0 -3
  126. package/dist/src/relationship/dataFormatterValidator.d.ts +0 -3
  127. package/dist/src/relationship/dataValidator.d.ts +0 -3
  128. package/dist/src/relationship/relationshipObservables.d.ts +0 -13
  129. package/dist/src/series/computedDataFn.d.ts +0 -3
  130. package/dist/src/series/contextObserverCallback.d.ts +0 -3
  131. package/dist/src/series/dataFormatterValidator.d.ts +0 -3
  132. package/dist/src/series/dataValidator.d.ts +0 -3
  133. package/dist/src/series/seriesObservables.d.ts +0 -37
  134. package/dist/src/tree/computedDataFn.d.ts +0 -3
  135. package/dist/src/tree/contextObserverCallback.d.ts +0 -3
  136. package/dist/src/tree/dataFormatterValidator.d.ts +0 -3
  137. package/dist/src/tree/dataValidator.d.ts +0 -3
  138. package/dist/src/tree/treeObservables.d.ts +0 -10
  139. package/dist/src/utils/d3Scale.d.ts +0 -28
  140. package/lib/core-types.ts +0 -7
  141. package/src/AbstractChart.ts +0 -57
  142. package/src/GridChart.ts +0 -25
  143. package/src/MultiGridChart.ts +0 -25
  144. package/src/MultiValueChart.ts +0 -25
  145. package/src/RelationshipChart.ts +0 -25
  146. package/src/SeriesChart.ts +0 -25
  147. package/src/TreeChart.ts +0 -25
  148. package/src/base/createBaseChart.ts +0 -524
  149. package/src/base/createBasePlugin.ts +0 -154
  150. package/src/base/validators/chartOptionsValidator.ts +0 -24
  151. package/src/base/validators/chartParamsValidator.ts +0 -134
  152. package/src/base/validators/elementValidator.ts +0 -14
  153. package/src/base/validators/pluginsValidator.ts +0 -15
  154. package/src/defaults.ts +0 -284
  155. package/src/defineGridPlugin.ts +0 -3
  156. package/src/defineMultiGridPlugin.ts +0 -3
  157. package/src/defineMultiValuePlugin.ts +0 -3
  158. package/src/defineNoneDataPlugin.ts +0 -4
  159. package/src/defineRelationshipPlugin.ts +0 -3
  160. package/src/defineSeriesPlugin.ts +0 -3
  161. package/src/defineTreePlugin.ts +0 -3
  162. package/src/grid/computedDataFn.ts +0 -129
  163. package/src/grid/contextObserverCallback.ts +0 -209
  164. package/src/grid/dataFormatterValidator.ts +0 -126
  165. package/src/grid/dataValidator.ts +0 -13
  166. package/src/grid/gridObservables.ts +0 -699
  167. package/src/multiGrid/computedDataFn.ts +0 -123
  168. package/src/multiGrid/contextObserverCallback.ts +0 -109
  169. package/src/multiGrid/dataFormatterValidator.ts +0 -121
  170. package/src/multiGrid/dataValidator.ts +0 -13
  171. package/src/multiGrid/multiGridObservables.ts +0 -367
  172. package/src/multiValue/computedDataFn.ts +0 -113
  173. package/src/multiValue/contextObserverCallback.ts +0 -328
  174. package/src/multiValue/dataFormatterValidator.ts +0 -95
  175. package/src/multiValue/dataValidator.ts +0 -13
  176. package/src/multiValue/multiValueObservables.ts +0 -865
  177. package/src/relationship/computedDataFn.ts +0 -159
  178. package/src/relationship/contextObserverCallback.ts +0 -80
  179. package/src/relationship/dataFormatterValidator.ts +0 -14
  180. package/src/relationship/dataValidator.ts +0 -14
  181. package/src/relationship/relationshipObservables.ts +0 -85
  182. package/src/series/computedDataFn.ts +0 -88
  183. package/src/series/contextObserverCallback.ts +0 -132
  184. package/src/series/dataFormatterValidator.ts +0 -47
  185. package/src/series/dataValidator.ts +0 -13
  186. package/src/series/seriesObservables.ts +0 -210
  187. package/src/tree/computedDataFn.ts +0 -129
  188. package/src/tree/contextObserverCallback.ts +0 -58
  189. package/src/tree/dataFormatterValidator.ts +0 -14
  190. package/src/tree/dataValidator.ts +0 -14
  191. package/src/tree/treeObservables.ts +0 -106
  192. package/src/utils/d3Scale.ts +0 -198
  193. package/tsconfig.base.json +0 -14
  194. package/tsconfig.json +0 -3
  195. package/vite-env.d.ts +0 -7
  196. package/vite.config.js +0 -23
@@ -1,209 +0,0 @@
1
- import { map, shareReplay, distinctUntilChanged } from 'rxjs'
2
- import type { ContextObserverCallback } from '../../lib/core-types'
3
- import {
4
- highlightObservable,
5
- seriesDataMapObservable,
6
- groupDataMapObservable,
7
- textSizePxObservable,
8
- containerSizeObservable } from '../utils/observables'
9
- import {
10
- gridComputedAxesDataObservable,
11
- gridAxesSizeObservable,
12
- gridAxesContainerSizeObservable,
13
- gridSeriesLabelsObservable,
14
- gridVisibleComputedDataObservable,
15
- gridVisibleComputedAxesDataObservable,
16
- // isSeriesSeprateObservable,
17
- gridContainerPositionObservable,
18
- computedStackedDataObservables,
19
- groupScaleDomainValueObservable,
20
- filteredMinMaxValueObservable,
21
- gridAxesTransformObservable,
22
- gridAxesReverseTransformObservable,
23
- gridGraphicTransformObservable,
24
- gridGraphicReverseScaleObservable,
25
- } from './gridObservables'
26
-
27
- export const contextObserverCallback: ContextObserverCallback<'grid'> = ({ subject, observer }) => {
28
-
29
- const textSizePx$ = textSizePxObservable(observer.fullChartParams$).pipe(
30
- shareReplay(1)
31
- )
32
-
33
- const isSeriesSeprate$ = observer.fullDataFormatter$.pipe(
34
- map(d => d.separateSeries),
35
- distinctUntilChanged(),
36
- shareReplay(1)
37
- )
38
-
39
- const gridContainerPosition$ = gridContainerPositionObservable({
40
- computedData$: observer.computedData$,
41
- fullDataFormatter$: observer.fullDataFormatter$,
42
- layout$: observer.layout$,
43
- }).pipe(
44
- shareReplay(1)
45
- )
46
-
47
- const containerSize$ = containerSizeObservable({
48
- layout$: observer.layout$,
49
- containerPosition$: gridContainerPosition$,
50
- container$: observer.fullDataFormatter$.pipe(
51
- map(d => d.container)
52
- )
53
- }).pipe(
54
- shareReplay(1)
55
- )
56
-
57
- const gridAxesSize$ = gridAxesSizeObservable({
58
- fullDataFormatter$: observer.fullDataFormatter$,
59
- layout$: observer.layout$
60
- }).pipe(
61
- shareReplay(1)
62
- )
63
-
64
- const gridAxesContainerSize$ = gridAxesContainerSizeObservable({
65
- fullDataFormatter$: observer.fullDataFormatter$,
66
- containerSize$
67
- }).pipe(
68
- shareReplay(1)
69
- )
70
-
71
- const datumList$ = observer.computedData$.pipe(
72
- map(d => d.flat())
73
- ).pipe(
74
- shareReplay(1)
75
- )
76
-
77
- const gridHighlight$ = highlightObservable({
78
- datumList$,
79
- fullChartParams$: observer.fullChartParams$,
80
- event$: subject.event$
81
- }).pipe(
82
- shareReplay(1)
83
- )
84
-
85
- const seriesLabels$ = gridSeriesLabelsObservable({
86
- computedData$: observer.computedData$,
87
- })
88
-
89
- const SeriesDataMap$ = seriesDataMapObservable({
90
- datumList$: datumList$
91
- }).pipe(
92
- shareReplay(1)
93
- )
94
-
95
- const GroupDataMap$ = groupDataMapObservable({
96
- datumList$: datumList$
97
- }).pipe(
98
- shareReplay(1)
99
- )
100
-
101
- const computedAxesData$ = gridComputedAxesDataObservable({
102
- computedData$: observer.computedData$,
103
- fullDataFormatter$: observer.fullDataFormatter$,
104
- layout$: observer.layout$,
105
- }).pipe(
106
- shareReplay(1)
107
- )
108
-
109
- const visibleComputedData$ = gridVisibleComputedDataObservable({
110
- computedData$: observer.computedData$,
111
- }).pipe(
112
- shareReplay(1)
113
- )
114
-
115
- const visibleComputedAxesData$ = gridVisibleComputedAxesDataObservable({
116
- computedAxesData$: computedAxesData$,
117
- }).pipe(
118
- shareReplay(1)
119
- )
120
-
121
- const computedStackedData$ = computedStackedDataObservables({
122
- computedData$: observer.computedData$,
123
- isSeriesSeprate$: isSeriesSeprate$
124
- }).pipe(
125
- shareReplay(1)
126
- )
127
-
128
- const groupScaleDomainValue$ = groupScaleDomainValueObservable({
129
- computedData$: observer.computedData$,
130
- fullDataFormatter$: observer.fullDataFormatter$,
131
- }).pipe(
132
- shareReplay(1)
133
- )
134
-
135
- const filteredMinMaxValue$ = filteredMinMaxValueObservable({
136
- computedData$: observer.computedData$,
137
- groupScaleDomainValue$: groupScaleDomainValue$,
138
- }).pipe(
139
- shareReplay(1)
140
- )
141
-
142
- const filteredStackedMinMaxValue$ = filteredMinMaxValueObservable({
143
- computedData$: computedStackedData$,
144
- groupScaleDomainValue$: groupScaleDomainValue$,
145
- }).pipe(
146
- shareReplay(1)
147
- )
148
-
149
- const gridAxesTransform$ = gridAxesTransformObservable({
150
- fullDataFormatter$: observer.fullDataFormatter$,
151
- layout$: observer.layout$
152
- }).pipe(
153
- shareReplay(1)
154
- )
155
-
156
- const gridAxesReverseTransform$ = gridAxesReverseTransformObservable({
157
- gridAxesTransform$
158
- }).pipe(
159
- shareReplay(1)
160
- )
161
-
162
- const gridGraphicTransform$ = gridGraphicTransformObservable({
163
- computedData$: observer.computedData$,
164
- groupScaleDomainValue$: groupScaleDomainValue$,
165
- filteredMinMaxValue$: filteredMinMaxValue$,
166
- fullDataFormatter$: observer.fullDataFormatter$,
167
- layout$: observer.layout$
168
- }).pipe(
169
- shareReplay(1)
170
- )
171
-
172
- const gridGraphicReverseScale$ = gridGraphicReverseScaleObservable({
173
- gridContainerPosition$: gridContainerPosition$,
174
- gridAxesTransform$: gridAxesTransform$,
175
- gridGraphicTransform$: gridGraphicTransform$,
176
- }).pipe(
177
- shareReplay(1)
178
- )
179
-
180
-
181
- return {
182
- fullParams$: observer.fullParams$,
183
- fullChartParams$: observer.fullChartParams$,
184
- fullDataFormatter$: observer.fullDataFormatter$,
185
- computedData$: observer.computedData$,
186
- layout$: observer.layout$,
187
- textSizePx$,
188
- isSeriesSeprate$,
189
- gridContainerPosition$,
190
- containerSize$,
191
- gridAxesSize$,
192
- gridAxesContainerSize$,
193
- gridHighlight$,
194
- seriesLabels$,
195
- SeriesDataMap$,
196
- GroupDataMap$,
197
- computedAxesData$,
198
- visibleComputedData$,
199
- visibleComputedAxesData$,
200
- computedStackedData$,
201
- groupScaleDomainValue$,
202
- filteredMinMaxValue$,
203
- filteredStackedMinMaxValue$,
204
- gridAxesTransform$,
205
- gridAxesReverseTransform$,
206
- gridGraphicTransform$,
207
- gridGraphicReverseScale$,
208
- }
209
- }
@@ -1,126 +0,0 @@
1
- import type { DataFormatterValidator, DataFormatterTypeMap } from '../../lib/core-types'
2
- import { validateColumns } from '../utils/validator'
3
-
4
- export const dataFormatterValidator: DataFormatterValidator<'grid'> = (dataFormatter: DataFormatterTypeMap<'grid'>) => {
5
- const result = validateColumns(dataFormatter, {
6
- visibleFilter: {
7
- toBeTypes: ['Function']
8
- },
9
- // grid: {
10
- // toBeTypes: ['object']
11
- // },
12
- container: {
13
- toBeTypes: ['object']
14
- },
15
- seriesDirection: {
16
- toBe: '"row" | "column"',
17
- test: (value) => value === 'row' || value === 'column'
18
- },
19
- rowLabels: {
20
- toBeTypes: ['string[]']
21
- },
22
- columnLabels: {
23
- toBeTypes: ['string[]']
24
- },
25
- valueAxis: {
26
- toBeTypes: ['object']
27
- },
28
- groupAxis: {
29
- toBeTypes: ['object']
30
- },
31
- separateSeries: {
32
- toBeTypes: ['boolean']
33
- }
34
- })
35
- // if (dataFormatter.grid) {
36
- // const visibleFilterResult = validateColumns(dataFormatter, {
37
- // seriesDirection: {
38
- // toBe: '"row" | "column"',
39
- // test: (value) => value === 'row' || value === 'column'
40
- // },
41
- // rowLabels: {
42
- // toBeTypes: ['string[]']
43
- // },
44
- // columnLabels: {
45
- // toBeTypes: ['string[]']
46
- // },
47
- // valueAxis: {
48
- // toBeTypes: ['object']
49
- // },
50
- // groupAxis: {
51
- // toBeTypes: ['object']
52
- // },
53
- // separateSeries: {
54
- // toBeTypes: ['boolean']
55
- // }
56
- // })
57
- if (result.status === 'error') {
58
- return result
59
- }
60
- if (dataFormatter.valueAxis) {
61
- const valueAxisResult = validateColumns(dataFormatter.valueAxis, {
62
- position: {
63
- toBe: '"bottom" | "left" | "top" | "right"',
64
- test: (value) => value === 'bottom' || value === 'left' || value === 'top' || value === 'right'
65
- },
66
- scaleDomain: {
67
- toBe: '[number | "min" | "auto", number | "max" | "auto"]',
68
- test: (value) => Array.isArray(value) && value.length === 2 && (typeof value[0] === 'number' || value[0] === 'min' || value[0] === 'auto') && (typeof value[1] === 'number' || value[1] === 'max' || value[1] === 'auto')
69
- },
70
- scaleRange: {
71
- toBe: '[number, number]',
72
- test: (value) => Array.isArray(value) && value.length === 2 && typeof value[0] === 'number' && typeof value[1] === 'number'
73
- },
74
- label: {
75
- toBeTypes: ['string']
76
- }
77
- })
78
- if (valueAxisResult.status === 'error') {
79
- return valueAxisResult
80
- }
81
- }
82
- if (dataFormatter.groupAxis) {
83
- const groupAxisResult = validateColumns(dataFormatter.groupAxis, {
84
- position: {
85
- toBe: '"bottom" | "left" | "top" | "right"',
86
- test: (value) => value === 'bottom' || value === 'left' || value === 'top' || value === 'right'
87
- },
88
- scaleDomain: {
89
- toBe: '[number, number | "max"]',
90
- test: (value) => Array.isArray(value) && value.length === 2 && typeof value[0] === 'number' && (typeof value[1] === 'number' || value[1] === 'max')
91
- },
92
- scalePadding: {
93
- toBeTypes: ['number']
94
- },
95
- label: {
96
- toBeTypes: ['string']
97
- }
98
- })
99
- if (groupAxisResult.status === 'error') {
100
- return groupAxisResult
101
- }
102
- }
103
- // }
104
- if (dataFormatter.container) {
105
- const containerResult = validateColumns(dataFormatter.container, {
106
- columnAmount: {
107
- toBeTypes: ['number']
108
- },
109
- rowAmount: {
110
- toBeTypes: ['number']
111
- },
112
- columnGap: {
113
- toBe: '"auto" | number',
114
- test: (value: any) => value === 'auto' || typeof value === 'number'
115
- },
116
- rowGap: {
117
- toBe: '"auto" | number',
118
- test: (value: any) => value === 'auto' || typeof value === 'number'
119
- },
120
- })
121
- if (containerResult.status === 'error') {
122
- return containerResult
123
- }
124
- }
125
- return result
126
- }
@@ -1,13 +0,0 @@
1
- import type { DataValidator, DataTypeMap } from '../../lib/core-types'
2
- import { validateColumns } from '../utils/validator'
3
-
4
- export const dataValidator: DataValidator<'grid'> = (data: DataTypeMap<'grid'>) => {
5
- const result = validateColumns({ data }, {
6
- data: {
7
- toBe: '(DataGridDatum | DataGridValue)[][]',
8
- // 畢免資料量過大檢查不完,不深度檢查
9
- test: (value) => Array.isArray(value)
10
- }
11
- })
12
- return result
13
- }