@orbcharts/core 3.0.0-alpha.50 → 3.0.0-alpha.52

Sign up to get free protection for your applications and to get access to all the features.
package/src/defaults.ts CHANGED
@@ -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
 
@@ -422,6 +426,9 @@ export const gridAxesSizeObservable = ({ fullDataFormatter$, layout$ }: {
422
426
  width: height,
423
427
  height: width
424
428
  }
429
+ } else {
430
+ // default
431
+ return { width, height }
425
432
  }
426
433
  }
427
434
 
@@ -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: ''