@orbcharts/core 3.0.0-alpha.49 → 3.0.0-alpha.51
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/orbcharts-core.es.js +507 -497
- package/dist/orbcharts-core.umd.js +2 -2
- package/package.json +1 -1
- package/src/defaults.ts +7 -1
- package/src/grid/gridObservables.ts +4 -0
- package/src/tree/computeTreeData.ts +2 -1
package/src/defaults.ts
CHANGED
@@ -18,7 +18,7 @@ import type { ChartParams } from './types/ChartParams'
|
|
18
18
|
import type { Padding } from './types/Padding'
|
19
19
|
|
20
20
|
export const CHART_OPTIONS_DEFAULT: ChartOptionsPartial<any> = {
|
21
|
-
preset: {} // 預設為空
|
21
|
+
// preset: {} // 預設為空
|
22
22
|
}
|
23
23
|
|
24
24
|
// export const GLOBAL_DEFAULT: ChartGlobalDefault = {
|
@@ -141,6 +141,7 @@ export const DATA_FORMATTER_SERIES_DEFAULT: DataFormatterSeries = {
|
|
141
141
|
// ]
|
142
142
|
// },
|
143
143
|
}
|
144
|
+
DATA_FORMATTER_SERIES_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
144
145
|
|
145
146
|
export const DATA_FORMATTER_GRID_GRID_DEFAULT: DataFormatterGridGrid = {
|
146
147
|
seriesDirection: 'row',
|
@@ -163,6 +164,7 @@ export const DATA_FORMATTER_GRID_DEFAULT: DataFormatterGrid = {
|
|
163
164
|
...DATA_FORMATTER_CONTAINER_DEFAULT
|
164
165
|
}
|
165
166
|
}
|
167
|
+
DATA_FORMATTER_GRID_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
166
168
|
|
167
169
|
// export const DATA_FORMATTER_MULTI_GRID_MULTI_GRID_DEFAULT: DataFormatterMultiGridMultiGrid = {
|
168
170
|
// ...DATA_FORMATTER_GRID_DEFAULT,
|
@@ -187,6 +189,7 @@ export const DATA_FORMATTER_MULTI_GRID_DEFAULT: DataFormatterMultiGrid = {
|
|
187
189
|
...DATA_FORMATTER_CONTAINER_DEFAULT
|
188
190
|
}
|
189
191
|
}
|
192
|
+
DATA_FORMATTER_MULTI_GRID_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
190
193
|
|
191
194
|
export const DATA_FORMATTER_MULTI_VALUE_DEFAULT: DataFormatterMultiValue = {
|
192
195
|
type: 'multiValue',
|
@@ -196,6 +199,7 @@ export const DATA_FORMATTER_MULTI_VALUE_DEFAULT: DataFormatterMultiValue = {
|
|
196
199
|
xAxis: { ...DATA_FORMATTER_VALUE_AXIS_DEFAULT },
|
197
200
|
yAxis: { ...DATA_FORMATTER_VALUE_AXIS_DEFAULT },
|
198
201
|
}
|
202
|
+
DATA_FORMATTER_MULTI_VALUE_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
199
203
|
|
200
204
|
export const DATA_FORMATTER_TREE_DEFAULT: DataFormatterTree = {
|
201
205
|
type: 'tree',
|
@@ -203,6 +207,7 @@ export const DATA_FORMATTER_TREE_DEFAULT: DataFormatterTree = {
|
|
203
207
|
// labelFormat: (datum: any) => (datum && datum.label) ?? '',
|
204
208
|
categoryLabels: []
|
205
209
|
}
|
210
|
+
DATA_FORMATTER_TREE_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
206
211
|
|
207
212
|
export const DATA_FORMATTER_RELATIONAL_DEFAULT: DataFormatterRelationship = {
|
208
213
|
type: 'relationship',
|
@@ -217,4 +222,5 @@ export const DATA_FORMATTER_RELATIONAL_DEFAULT: DataFormatterRelationship = {
|
|
217
222
|
// descriptionFormat: (edge: any) => (edge && edge.label) ?? ''
|
218
223
|
// },
|
219
224
|
}
|
225
|
+
DATA_FORMATTER_RELATIONAL_DEFAULT.visibleFilter.toString = () => `(datum, context) => true`
|
220
226
|
|
@@ -188,6 +188,10 @@ export const gridAxesTransformObservable = ({ fullDataFormatter$, layout$ }: {
|
|
188
188
|
rotateX = 180
|
189
189
|
translateY = height
|
190
190
|
}
|
191
|
+
} else {
|
192
|
+
// 預設
|
193
|
+
rotateX = 180
|
194
|
+
translateY = height
|
191
195
|
}
|
192
196
|
// selection.style('transform', `translate(${translateX}px, ${translateY}px) rotate(${rotate}deg) rotateX(${rotateX}deg) rotateY(${rotateY}deg)`)
|
193
197
|
|
@@ -34,7 +34,8 @@ export const computeTreeData: ComputedDataFn<'tree'> = (context) => {
|
|
34
34
|
const dataTreeObj: DataTreeObj = (function () {
|
35
35
|
if (isPlainObject(data) === true) {
|
36
36
|
// 原本就是樹狀結構則直接複製
|
37
|
-
return structuredClone(data) as DataTreeObj
|
37
|
+
// return structuredClone(data) as DataTreeObj
|
38
|
+
return JSON.parse(JSON.stringify(data)) as DataTreeObj
|
38
39
|
} else if (Array.isArray(data) === false) {
|
39
40
|
return {
|
40
41
|
id: ''
|