@orbcharts/core 3.0.0-alpha.25 → 3.0.0-alpha.27

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  import { DataGridDatum, DataGridValue } from './DataGrid';
2
- import { DataFormatterBase, DataFormatterValueAxis, DataFormatterGroupAxis, DataFormatterContext } from './DataFormatter';
2
+ import { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis, DataFormatterGroupAxis, DataFormatterContext } from './DataFormatter';
3
3
 
4
4
  export type SeriesType = 'row' | 'column';
5
5
  export interface DataFormatterGrid extends DataFormatterBase<'grid'> {
@@ -8,11 +8,12 @@ export interface DataFormatterGrid extends DataFormatterBase<'grid'> {
8
8
  groupAxis: DataFormatterGroupAxis;
9
9
  colorsPredicate: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string;
10
10
  }
11
- export type DataFormatterGridPartial = Partial<DataFormatterGrid> & Partial<{
12
- grid: Partial<DataFormatterGridGrid>;
13
- valueAxis: Partial<DataFormatterValueAxis>;
14
- groupAxis: Partial<DataFormatterGroupAxis>;
15
- }>;
11
+ export interface DataFormatterGridPartial extends DataFormatterBasePartial<'grid'> {
12
+ grid?: Partial<DataFormatterGridGrid>;
13
+ valueAxis?: Partial<DataFormatterValueAxis>;
14
+ groupAxis?: Partial<DataFormatterGroupAxis>;
15
+ colorsPredicate?: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string;
16
+ }
16
17
  export interface DataFormatterGridGrid {
17
18
  rowLabels: string[];
18
19
  columnLabels: string[];
@@ -1,16 +1,9 @@
1
- import { DataGridDatum, DataGridValue } from './DataGrid';
2
- import { DataFormatterGridGrid } from './DataFormatterGrid';
3
- import { DataFormatterBase, DataFormatterValueAxis, DataFormatterGroupAxis, DataFormatterContext } from './DataFormatter';
1
+ import { DataFormatterGrid } from './DataFormatterGrid';
2
+ import { DataFormatterBase, DataFormatterBasePartial } from './DataFormatter';
4
3
 
5
4
  export interface DataFormatterMultiGrid extends DataFormatterBase<'multiGrid'> {
6
- multiGrid: Array<DataFormatterMultiGridMultiGrid>;
5
+ multiGrid: Array<DataFormatterGrid>;
7
6
  }
8
- export type DataFormatterMultiGridPartial = Partial<DataFormatterMultiGrid> & Partial<{
9
- multiGrid: Array<Partial<DataFormatterMultiGridMultiGrid>>;
10
- }>;
11
- export interface DataFormatterMultiGridMultiGrid {
12
- grid: DataFormatterGridGrid;
13
- valueAxis: DataFormatterValueAxis;
14
- groupAxis: DataFormatterGroupAxis;
15
- colorsPredicate: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string;
7
+ export interface DataFormatterMultiGridPartial extends DataFormatterBasePartial<'multiGrid'> {
8
+ multiGrid?: Array<Partial<DataFormatterGrid>>;
16
9
  }
@@ -1,13 +1,15 @@
1
- import { DataFormatterBase, DataFormatterValueAxis } from './DataFormatter';
1
+ import { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis } from './DataFormatter';
2
2
 
3
3
  export interface DataFormatterMultiValue extends DataFormatterBase<'multiValue'> {
4
4
  multiValue: Array<DataFormatterMultiValueMultiValue>;
5
5
  xAxis: DataFormatterValueAxis;
6
6
  yAxis: DataFormatterValueAxis;
7
7
  }
8
- export type DataFormatterMultiValuePartial = Partial<DataFormatterMultiValue> & Partial<{
9
- multiValue: Array<Partial<DataFormatterMultiValueMultiValue>>;
10
- }>;
8
+ export interface DataFormatterMultiValuePartial extends DataFormatterBasePartial<'multiValue'> {
9
+ multiValue?: Array<Partial<DataFormatterMultiValueMultiValue>>;
10
+ xAxis?: Partial<DataFormatterValueAxis>;
11
+ yAxis?: Partial<DataFormatterValueAxis>;
12
+ }
11
13
  export interface DataFormatterMultiValueMultiValue {
12
14
  unitLabel: string;
13
15
  }
@@ -1,5 +1,6 @@
1
- import { DataFormatterBase } from './DataFormatter';
1
+ import { DataFormatterBase, DataFormatterBasePartial } from './DataFormatter';
2
2
 
3
3
  export interface DataFormatterRelationship extends DataFormatterBase<'relationship'> {
4
4
  }
5
- export type DataFormatterRelationshipPartial = Partial<DataFormatterRelationship> & Partial<{}>;
5
+ export interface DataFormatterRelationshipPartial extends DataFormatterBasePartial<'relationship'> {
6
+ }
@@ -1,5 +1,5 @@
1
1
  import { DataSeriesDatum, DataSeriesValue } from './DataSeries';
2
- import { DataFormatterBase, DataFormatterContext } from './DataFormatter';
2
+ import { DataFormatterBase, DataFormatterBasePartial, DataFormatterContext } from './DataFormatter';
3
3
 
4
4
  export interface DataFormatterSeries extends DataFormatterBase<'series'> {
5
5
  unitLabel: string;
@@ -7,4 +7,9 @@ export interface DataFormatterSeries extends DataFormatterBase<'series'> {
7
7
  colorsPredicate: (datum: DataSeriesDatum | DataSeriesValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'series'>) => string;
8
8
  sort: ((a: DataSeriesDatum | DataSeriesValue, b: DataSeriesDatum | number) => number) | null;
9
9
  }
10
- export type DataFormatterSeriesPartial = Partial<DataFormatterSeries> & Partial<{}>;
10
+ export interface DataFormatterSeriesPartial extends DataFormatterBasePartial<'series'> {
11
+ unitLabel?: string;
12
+ seriesLabels?: string[];
13
+ colorsPredicate?: (datum: DataSeriesDatum | DataSeriesValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'series'>) => string;
14
+ sort?: ((a: DataSeriesDatum | DataSeriesValue, b: DataSeriesDatum | number) => number) | null;
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbcharts/core",
3
- "version": "3.0.0-alpha.25",
3
+ "version": "3.0.0-alpha.27",
4
4
  "description": "OrbCharts is an open source chart library based on d3.js and rx.js",
5
5
  "author": "Blue Planet Inc.",
6
6
  "license": "Apache-2.0",
package/src/defaults.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // import { ChartRenderOptions } from './types/Chart'
3
3
  import type { ChartType, ChartOptionsPartial } from './types/Chart'
4
4
  import type { DataSeries } from './types/DataSeries'
5
- import type { DataGrid } from './types/DataGrid'
5
+ import type { DataGrid, DataGridDatum } from './types/DataGrid'
6
6
  import type { DataMultiGrid } from './types/DataMultiGrid'
7
7
  import type { DataMultiValue } from './types/DataMultiValue'
8
8
  import type { DataTree } from './types/DataTree'
@@ -197,7 +197,24 @@ export const DATA_FORMATTER_GRID_DEFAULT: DataFormatterGrid = {
197
197
  export const DATA_FORMATTER_MULTI_GRID_DEFAULT: DataFormatterMultiGrid = {
198
198
  ...DATA_FORMATTER,
199
199
  type: 'multiGrid',
200
- multiGrid: [], // 預設無資料,由各plugin定義預設值
200
+ multiGrid: [
201
+ {
202
+ ...DATA_FORMATTER_GRID_DEFAULT
203
+ },
204
+ {
205
+ ...DATA_FORMATTER_GRID_DEFAULT,
206
+ valueAxis: {
207
+ ...DATA_FORMATTER_VALUE_AXIS,
208
+ position: 'right'
209
+ },
210
+ colorsPredicate: (datum, rowIndex, columnIndex, { chartParams, dataFormatter }) => {
211
+ const seriesIndex = dataFormatter.grid.seriesType === 'row' ? rowIndex : columnIndex
212
+ // @Q@ 暫時性的邏輯,之後改寫成接續前一個grid的series index
213
+ const reverseIndex = chartParams.colors[chartParams.colorScheme].series.length - 1 - seriesIndex
214
+ return chartParams.colors[chartParams.colorScheme].series[reverseIndex]
215
+ },
216
+ }
217
+ ],
201
218
  // visibleGroupRange: null,
202
219
  }
203
220
 
@@ -205,7 +222,7 @@ export const DATA_FORMATTER_MULTI_VALUE_DEFAULT: DataFormatterMultiValue = {
205
222
  ...DATA_FORMATTER,
206
223
  type: 'multiValue',
207
224
  // labelFormat: (datum: any) => (datum && datum.label) ?? '',
208
- multiValue: [], // 預設無資料,由各plugin定義預設值
225
+ multiValue: [],
209
226
  xAxis: { ...DATA_FORMATTER_VALUE_AXIS },
210
227
  yAxis: { ...DATA_FORMATTER_VALUE_AXIS },
211
228
  }
@@ -127,7 +127,8 @@ export const gridAxesTransformObservable = ({ fullDataFormatter$, layout$ }: {
127
127
  fullDataFormatter: fullDataFormatter$,
128
128
  layout: layout$
129
129
  }).pipe(
130
- takeUntil(destroy$)
130
+ takeUntil(destroy$),
131
+ switchMap(async (d) => d),
131
132
  ).subscribe(data => {
132
133
  const axesTransformData = calcAxesTransform({
133
134
  xAxis: data.fullDataFormatter.groupAxis,
@@ -238,7 +239,8 @@ export const gridGraphicTransformObservable = ({ computedData$, fullDataFormatte
238
239
  fullDataFormatter: fullDataFormatter$,
239
240
  layout: layout$
240
241
  }).pipe(
241
- takeUntil(destroy$)
242
+ takeUntil(destroy$),
243
+ switchMap(async (d) => d),
242
244
  ).subscribe(data => {
243
245
  const dataAreaTransformData = calcGridDataAreaTransform ({
244
246
  data: data.computedData,
@@ -311,7 +313,6 @@ export const gridAxesSizeObservable = ({ fullDataFormatter$, layout$ }: {
311
313
  layout: layout$
312
314
  }).pipe(
313
315
  takeUntil(destroy$),
314
- // 轉換後會退訂前一個未完成的訂閱事件,因此可以取到「同時間」最後一次的訂閱事件
315
316
  switchMap(async (d) => d),
316
317
  ).subscribe(data => {
317
318
 
@@ -1,12 +1,26 @@
1
+ import {
2
+ shareReplay } from 'rxjs'
1
3
  import type { ContextObserverFn } from '../types'
4
+ import { multiGridObservable } from './multiGridObservables'
2
5
 
3
6
  export const createMultiGridContextObserver: ContextObserverFn<'multiGrid'> = ({ subject, observer }) => {
4
7
 
8
+ const multiGrid$ = multiGridObservable({
9
+ fullDataFormatter$: observer.fullDataFormatter$,
10
+ computedData$: observer.computedData$,
11
+ layout$: observer.layout$,
12
+ fullChartParams$: observer.fullChartParams$,
13
+ event$: subject.event$
14
+ }).pipe(
15
+ shareReplay(1)
16
+ )
17
+
5
18
  return {
6
19
  fullParams$: observer.fullParams$,
7
20
  fullChartParams$: observer.fullChartParams$,
8
21
  fullDataFormatter$: observer.fullDataFormatter$,
9
22
  computedData$: observer.computedData$,
10
23
  layout$: observer.layout$,
24
+ multiGrid$
11
25
  }
12
26
  }
@@ -0,0 +1,152 @@
1
+ import {
2
+ combineLatest,
3
+ distinctUntilChanged,
4
+ filter,
5
+ of,
6
+ map,
7
+ merge,
8
+ takeUntil,
9
+ shareReplay,
10
+ switchMap,
11
+ Subject,
12
+ Observable,
13
+ combineLatestAll} from 'rxjs'
14
+ import type {
15
+ AxisPosition,
16
+ ChartType,
17
+ ChartParams,
18
+ ComputedDataTypeMap,
19
+ ComputedDatumTypeMap,
20
+ ContextObserverFn,
21
+ DataTypeMap,
22
+ DataFormatterTypeMap,
23
+ DataFormatterGrid,
24
+ DataFormatterContext,
25
+ DataFormatterValueAxis,
26
+ DataFormatterGroupAxis,
27
+ EventMultiGrid,
28
+ HighlightTarget,
29
+ Layout,
30
+ TransformData } from '../types'
31
+ import { getMinAndMaxGrid, transposeData } from '../utils/orbchartsUtils'
32
+ import { createAxisLinearScale, createAxisPointScale, createAxisQuantizeScale } from '../utils/d3Utils'
33
+ import {
34
+ highlightObservable,
35
+ seriesDataMapObservable,
36
+ groupDataMapObservable } from '../utils/observables'
37
+ import {
38
+ gridAxesTransformObservable,
39
+ gridGraphicTransformObservable,
40
+ gridAxesOppositeTransformObservable,
41
+ gridAxesSizeObservable,
42
+ gridVisibleComputedDataObservable } from '../grid/gridObservables'
43
+
44
+ export const multiGridObservable = ({ fullDataFormatter$, computedData$, layout$, fullChartParams$, event$ }: {
45
+ fullDataFormatter$: Observable<DataFormatterTypeMap<'multiGrid'>>
46
+ computedData$: Observable<ComputedDataTypeMap<'multiGrid'>>
47
+ layout$: Observable<Layout>
48
+ fullChartParams$: Observable<ChartParams>
49
+ event$: Subject<EventMultiGrid>
50
+ }) => {
51
+ const destroy$ = new Subject()
52
+
53
+ return combineLatest({
54
+ fullDataFormatter: fullDataFormatter$,
55
+ computedData: computedData$,
56
+ }).pipe(
57
+ switchMap(async (d) => d),
58
+ distinctUntilChanged((a, b) => {
59
+ return a.fullDataFormatter.multiGrid.length === b.fullDataFormatter.multiGrid.length
60
+ && a.computedData.length === b.computedData.length
61
+ }),
62
+ map(data => {
63
+ // 每次重新計算時,清除之前的訂閱
64
+ destroy$.next(undefined)
65
+
66
+ return data.fullDataFormatter.multiGrid.map((gridDataFormatter, gridIndex) => {
67
+
68
+ // -- 取得該grid的data和dataFormatter
69
+ const gridDataFormatter$ = of(gridDataFormatter).pipe(
70
+ takeUntil(destroy$),
71
+ shareReplay(1)
72
+ )
73
+ const gridComputedData$ = of(data.computedData[gridIndex] || []).pipe(
74
+ takeUntil(destroy$),
75
+ shareReplay(1)
76
+ )
77
+
78
+ // -- 建立Observables --
79
+ const gridAxesTransform$ = gridAxesTransformObservable({
80
+ fullDataFormatter$: gridDataFormatter$,
81
+ layout$: layout$
82
+ }).pipe(
83
+ shareReplay(1)
84
+ )
85
+
86
+ const gridGraphicTransform$ = gridGraphicTransformObservable({
87
+ computedData$: gridComputedData$,
88
+ fullDataFormatter$: gridDataFormatter$,
89
+ layout$: layout$
90
+ }).pipe(
91
+ shareReplay(1)
92
+ )
93
+
94
+ const gridAxesOppositeTransform$ = gridAxesOppositeTransformObservable({
95
+ gridAxesTransform$
96
+ }).pipe(
97
+ shareReplay(1)
98
+ )
99
+
100
+ const gridAxesSize$ = gridAxesSizeObservable({
101
+ fullDataFormatter$: gridDataFormatter$,
102
+ layout$: layout$
103
+ }).pipe(
104
+ shareReplay(1)
105
+ )
106
+
107
+ const datumList$ = gridComputedData$.pipe(
108
+ map(d => d.flat())
109
+ ).pipe(
110
+ shareReplay(1)
111
+ )
112
+
113
+ const gridHighlight$ = highlightObservable({
114
+ datumList$,
115
+ fullChartParams$: fullChartParams$,
116
+ event$: event$
117
+ }).pipe(
118
+ shareReplay(1)
119
+ )
120
+
121
+ const SeriesDataMap$ = seriesDataMapObservable({
122
+ datumList$: datumList$
123
+ }).pipe(
124
+ shareReplay(1)
125
+ )
126
+
127
+ const GroupDataMap$ = groupDataMapObservable({
128
+ datumList$: datumList$
129
+ }).pipe(
130
+ shareReplay(1)
131
+ )
132
+
133
+ const visibleComputedData$ = gridVisibleComputedDataObservable({
134
+ computedData$: gridComputedData$,
135
+ }).pipe(
136
+ shareReplay(1)
137
+ )
138
+
139
+ return {
140
+ gridAxesTransform$,
141
+ gridGraphicTransform$,
142
+ gridAxesOppositeTransform$,
143
+ gridAxesSize$,
144
+ gridHighlight$,
145
+ SeriesDataMap$,
146
+ GroupDataMap$,
147
+ visibleComputedData$
148
+ }
149
+ })
150
+ })
151
+ )
152
+ }
@@ -15,7 +15,7 @@ export interface ChartParams {
15
15
  // [key: string]: any
16
16
  }
17
17
 
18
- export type ChartParamsPartial = Partial<ChartParams> & Partial<{
18
+ export type ChartParamsPartial = Partial<ChartParams | {
19
19
  padding: Partial<Padding>,
20
20
  colors: Partial<{
21
21
  light: Partial<ColorScheme>
@@ -24,6 +24,15 @@ export type ChartParamsPartial = Partial<ChartParams> & Partial<{
24
24
  styles: Partial<Styles>
25
25
  }>
26
26
 
27
+ function test (): ChartParamsPartial {
28
+ return {
29
+ colorScheme: 'dark',
30
+ padding: {
31
+ top: 10
32
+ }
33
+ }
34
+ }
35
+
27
36
  export type HighlightTarget = 'series' | 'group' | 'datum' | 'none'
28
37
 
29
38
  export interface Styles {
@@ -1,5 +1,19 @@
1
+ import { Observable } from 'rxjs'
1
2
  import type { ContextObserverBase } from './ContextObserver'
3
+ import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
4
+ import type { TransformData } from './TransformData'
2
5
 
3
6
  export interface ContextObserverMultiGrid<PluginParams> extends ContextObserverBase<'multiGrid', PluginParams> {
7
+ multiGrid$: Observable<MultiGridObservableAll[]>
8
+ }
4
9
 
10
+ export interface MultiGridObservableAll {
11
+ gridAxesTransform$: Observable<TransformData>
12
+ gridGraphicTransform$: Observable<TransformData>
13
+ gridAxesOppositeTransform$: Observable<TransformData>
14
+ gridAxesSize$: Observable<{ width: number; height: number; }>
15
+ gridHighlight$: Observable<string[]>
16
+ SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
17
+ GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
18
+ visibleComputedData$: Observable<ComputedDataGrid>
5
19
  }
@@ -4,8 +4,7 @@ import type { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxi
4
4
 
5
5
  export type SeriesType = 'row' | 'column' // default: 'row'
6
6
 
7
- export interface DataFormatterGrid
8
- extends DataFormatterBase<'grid'> {
7
+ export interface DataFormatterGrid extends DataFormatterBase<'grid'> {
9
8
  grid: DataFormatterGridGrid
10
9
  valueAxis: DataFormatterValueAxis
11
10
  groupAxis: DataFormatterGroupAxis
@@ -13,11 +12,12 @@ export interface DataFormatterGrid
13
12
  colorsPredicate: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string
14
13
  }
15
14
 
16
- export type DataFormatterGridPartial = Partial<DataFormatterGrid> & Partial<{
17
- grid: Partial<DataFormatterGridGrid>
18
- valueAxis: Partial<DataFormatterValueAxis>
19
- groupAxis: Partial<DataFormatterGroupAxis>
20
- }>
15
+ export interface DataFormatterGridPartial extends DataFormatterBasePartial<'grid'> {
16
+ grid?: Partial<DataFormatterGridGrid>
17
+ valueAxis?: Partial<DataFormatterValueAxis>
18
+ groupAxis?: Partial<DataFormatterGroupAxis>
19
+ colorsPredicate?: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string
20
+ }
21
21
 
22
22
  // grid欄位
23
23
  export interface DataFormatterGridGrid {
@@ -1,23 +1,27 @@
1
1
  import { DataGridDatum, DataGridValue } from './DataGrid'
2
- import { DataFormatterGridGrid } from './DataFormatterGrid'
3
- import { DataFormatterBase, DataFormatterValueAxis, DataFormatterGroupAxis, DataFormatterContext } from './DataFormatter'
2
+ import { DataFormatterGrid, DataFormatterGridGrid } from './DataFormatterGrid'
3
+ import {
4
+ DataFormatterBase,
5
+ DataFormatterBasePartial,
6
+ DataFormatterValueAxis,
7
+ DataFormatterGroupAxis,
8
+ DataFormatterContext } from './DataFormatter'
4
9
  import { AxisPosition } from './Axis'
5
10
 
6
- export interface DataFormatterMultiGrid
7
- extends DataFormatterBase<'multiGrid'> {
8
- multiGrid: Array<DataFormatterMultiGridMultiGrid>
11
+ export interface DataFormatterMultiGrid extends DataFormatterBase<'multiGrid'> {
12
+ multiGrid: Array<DataFormatterGrid>
9
13
  // visibleGroupRange: [number, number] | null
10
14
  }
11
15
 
12
- export type DataFormatterMultiGridPartial = Partial<DataFormatterMultiGrid> & Partial<{
13
- multiGrid: Array<Partial<DataFormatterMultiGridMultiGrid>>
14
- }>
16
+ export interface DataFormatterMultiGridPartial extends DataFormatterBasePartial<'multiGrid'> {
17
+ multiGrid?: Array<Partial<DataFormatterGrid>>
18
+ }
15
19
 
16
- // multiGrid欄位
17
- export interface DataFormatterMultiGridMultiGrid {
18
- grid: DataFormatterGridGrid
19
- valueAxis: DataFormatterValueAxis // default: 'left'
20
- groupAxis: DataFormatterGroupAxis // default: 'bottom'
21
- colorsPredicate: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string
22
- // colors: Colors
23
- }
20
+ // // multiGrid欄位
21
+ // export interface DataFormatterMultiGridMultiGrid {
22
+ // grid: DataFormatterGridGrid
23
+ // valueAxis: DataFormatterValueAxis // default: 'left'
24
+ // groupAxis: DataFormatterGroupAxis // default: 'bottom'
25
+ // colorsPredicate: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string
26
+ // // colors: Colors
27
+ // }
@@ -1,17 +1,18 @@
1
1
  import { DataMultiValueDatum, DataMultiValue } from './DataMultiValue'
2
- import { DataFormatterBase, DataFormatterValueAxis } from './DataFormatter'
2
+ import { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis } from './DataFormatter'
3
3
 
4
- export interface DataFormatterMultiValue
5
- extends DataFormatterBase<'multiValue'> {
4
+ export interface DataFormatterMultiValue extends DataFormatterBase<'multiValue'> {
6
5
  // labelFormat: (datum: unknown) => string
7
6
  multiValue: Array<DataFormatterMultiValueMultiValue>
8
7
  xAxis: DataFormatterValueAxis
9
8
  yAxis: DataFormatterValueAxis
10
9
  }
11
10
 
12
- export type DataFormatterMultiValuePartial = Partial<DataFormatterMultiValue> & Partial<{
13
- multiValue: Array<Partial<DataFormatterMultiValueMultiValue>>
14
- }>
11
+ export interface DataFormatterMultiValuePartial extends DataFormatterBasePartial<'multiValue'> {
12
+ multiValue?: Array<Partial<DataFormatterMultiValueMultiValue>>
13
+ xAxis?: Partial<DataFormatterValueAxis>
14
+ yAxis?: Partial<DataFormatterValueAxis>
15
+ }
15
16
 
16
17
  // multiValue欄位
17
18
  export interface DataFormatterMultiValueMultiValue {
@@ -1,16 +1,15 @@
1
1
  import { Node, Edge, DataRelationship } from './DataRelationship'
2
- import { DataFormatterBase } from './DataFormatter'
2
+ import { DataFormatterBase, DataFormatterBasePartial } from './DataFormatter'
3
3
 
4
- export interface DataFormatterRelationship
5
- extends DataFormatterBase<'relationship'> {
4
+ export interface DataFormatterRelationship extends DataFormatterBase<'relationship'> {
6
5
  // node: DataFormatterRelationshipNode
7
6
  // edge: DataFormatterRelationshipEdge
8
7
  }
9
8
 
10
- export type DataFormatterRelationshipPartial = Partial<DataFormatterRelationship> & Partial<{
9
+ export interface DataFormatterRelationshipPartial extends DataFormatterBasePartial<'relationship'> {
11
10
  // node: Partial<DataFormatterRelationshipNode>
12
11
  // edge: Partial<DataFormatterRelationshipEdge>
13
- }>
12
+ }
14
13
 
15
14
  // export interface DataFormatterRelationshipNode {
16
15
  // labelFormat: (node: unknown) => string
@@ -1,9 +1,8 @@
1
1
  import { DataSeriesDatum, DataSeriesValue, DataSeries } from './DataSeries'
2
- import { DataFormatterBase, DataFormatterContext } from './DataFormatter'
2
+ import { DataFormatterBase, DataFormatterBasePartial, DataFormatterContext } from './DataFormatter'
3
3
  // import { ComputedDatumSeries } from './ComputedDataSeries'
4
4
 
5
- export interface DataFormatterSeries
6
- extends DataFormatterBase<'series'> {
5
+ export interface DataFormatterSeries extends DataFormatterBase<'series'> {
7
6
  // series: DataFormatterSeriesSeries
8
7
  unitLabel: string
9
8
  seriesLabels: string[]
@@ -14,9 +13,13 @@ export interface DataFormatterSeries
14
13
  // colors: Colors
15
14
  }
16
15
 
17
- export type DataFormatterSeriesPartial = Partial<DataFormatterSeries> & Partial<{
16
+ export interface DataFormatterSeriesPartial extends DataFormatterBasePartial<'series'> {
18
17
  // series: Partial<DataFormatterSeriesSeries>
19
- }>
18
+ unitLabel?: string
19
+ seriesLabels?: string[]
20
+ colorsPredicate?: (datum: DataSeriesDatum | DataSeriesValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'series'>) => string
21
+ sort?: ((a: DataSeriesDatum | DataSeriesValue, b: DataSeriesDatum | number) => number) | null
22
+ }
20
23
 
21
24
  // export interface DataFormatterSeriesSeries {
22
25
  // unitLabel: string