@orbcharts/core 3.0.0-alpha.42 → 3.0.0-alpha.43
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +200 -200
- package/dist/orbcharts-core.es.js +1905 -1896
- package/dist/orbcharts-core.umd.js +2 -2
- package/dist/src/defaults.d.ts +4 -3
- package/dist/src/grid/computeGridData.d.ts +4 -11
- package/dist/src/grid/gridObservables.d.ts +15 -18
- package/dist/src/multiGrid/multiGridObservables.d.ts +4 -11
- package/dist/src/series/seriesObservables.d.ts +26 -1
- package/dist/src/types/ComputedData.d.ts +1 -0
- package/dist/src/types/ComputedDataGrid.d.ts +0 -3
- package/dist/src/types/ComputedDataSeries.d.ts +1 -2
- package/dist/src/types/ContextObserverGrid.d.ts +11 -4
- package/dist/src/types/ContextObserverMultiGrid.d.ts +8 -3
- package/dist/src/types/ContextObserverSeries.d.ts +18 -0
- package/dist/src/types/DataFormatter.d.ts +8 -5
- package/dist/src/types/DataFormatterGrid.d.ts +13 -16
- package/dist/src/types/DataFormatterMultiGrid.d.ts +6 -3
- package/dist/src/types/DataFormatterMultiValue.d.ts +3 -0
- package/dist/src/types/DataFormatterRelationship.d.ts +3 -0
- package/dist/src/types/DataFormatterSeries.d.ts +10 -3
- package/dist/src/utils/orbchartsUtils.d.ts +14 -13
- package/package.json +41 -41
- package/src/AbstractChart.ts +48 -48
- package/src/GridChart.ts +20 -20
- package/src/MultiGridChart.ts +20 -20
- package/src/MultiValueChart.ts +20 -20
- package/src/RelationshipChart.ts +20 -20
- package/src/SeriesChart.ts +20 -20
- package/src/TreeChart.ts +20 -20
- package/src/base/createBaseChart.ts +367 -367
- package/src/base/createBasePlugin.ts +89 -89
- package/src/defaults.ts +220 -248
- package/src/defineGridPlugin.ts +3 -3
- package/src/defineMultiGridPlugin.ts +3 -3
- package/src/defineMultiValuePlugin.ts +3 -3
- package/src/defineNoneDataPlugin.ts +4 -4
- package/src/defineRelationshipPlugin.ts +3 -3
- package/src/defineSeriesPlugin.ts +3 -3
- package/src/defineTreePlugin.ts +3 -3
- package/src/grid/computeGridData.ts +134 -205
- package/src/grid/createGridContextObserver.ts +147 -130
- package/src/grid/gridObservables.ts +573 -486
- package/src/index.ts +21 -21
- package/src/multiGrid/computeMultiGridData.ts +130 -173
- package/src/multiGrid/createMultiGridContextObserver.ts +40 -40
- package/src/multiGrid/multiGridObservables.ts +350 -285
- package/src/multiValue/computeMultiValueData.ts +143 -136
- package/src/multiValue/createMultiValueContextObserver.ts +12 -12
- package/src/relationship/computeRelationshipData.ts +118 -106
- package/src/relationship/createRelationshipContextObserver.ts +12 -12
- package/src/series/computeSeriesData.ts +90 -153
- package/src/series/createSeriesContextObserver.ts +93 -38
- package/src/series/seriesObservables.ts +176 -24
- package/src/tree/computeTreeData.ts +131 -128
- package/src/tree/createTreeContextObserver.ts +61 -61
- package/src/tree/treeObservables.ts +94 -94
- package/src/types/Chart.ts +48 -48
- package/src/types/ChartParams.ts +51 -51
- package/src/types/ComputedData.ts +83 -82
- package/src/types/ComputedDataGrid.ts +13 -13
- package/src/types/ComputedDataMultiGrid.ts +2 -2
- package/src/types/ComputedDataMultiValue.ts +9 -9
- package/src/types/ComputedDataRelationship.ts +19 -19
- package/src/types/ComputedDataSeries.ts +8 -8
- package/src/types/ComputedDataTree.ts +19 -19
- package/src/types/ContextObserver.ts +38 -38
- package/src/types/ContextObserverGrid.ts +41 -33
- package/src/types/ContextObserverMultiGrid.ts +16 -28
- package/src/types/ContextObserverMultiValue.ts +4 -4
- package/src/types/ContextObserverRelationship.ts +4 -4
- package/src/types/ContextObserverSeries.ts +29 -9
- package/src/types/ContextObserverTree.ts +11 -11
- package/src/types/ContextSubject.ts +18 -18
- package/src/types/Data.ts +45 -45
- package/src/types/DataFormatter.ts +74 -95
- package/src/types/DataFormatterGrid.ts +67 -55
- package/src/types/DataFormatterMultiGrid.ts +44 -42
- package/src/types/DataFormatterMultiValue.ts +23 -20
- package/src/types/DataFormatterRelationship.ts +25 -22
- package/src/types/DataFormatterSeries.ts +20 -30
- package/src/types/DataFormatterTree.ts +12 -12
- package/src/types/DataGrid.ts +11 -11
- package/src/types/DataMultiGrid.ts +6 -6
- package/src/types/DataMultiValue.ts +12 -12
- package/src/types/DataRelationship.ts +27 -27
- package/src/types/DataSeries.ts +11 -11
- package/src/types/DataTree.ts +20 -20
- package/src/types/Event.ts +153 -153
- package/src/types/Layout.ts +11 -11
- package/src/types/Padding.ts +5 -5
- package/src/types/Plugin.ts +60 -60
- package/src/types/TransformData.ts +7 -7
- package/src/types/index.ts +37 -37
- package/src/utils/commonUtils.ts +50 -50
- package/src/utils/d3Utils.ts +89 -89
- package/src/utils/index.ts +4 -4
- package/src/utils/observables.ts +201 -201
- package/src/utils/orbchartsUtils.ts +349 -253
- package/tsconfig.json +13 -13
- package/vite.config.js +44 -44
@@ -1,9 +1,29 @@
|
|
1
|
-
import { Observable } from 'rxjs'
|
2
|
-
import type { ContextObserverBase } from './ContextObserver'
|
3
|
-
import type { ComputedDatumSeries } from './ComputedDataSeries'
|
4
|
-
|
5
|
-
export interface ContextObserverSeries<PluginParams> extends ContextObserverBase<'series', PluginParams> {
|
6
|
-
textSizePx$: Observable<number>
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
import { Observable } from 'rxjs'
|
2
|
+
import type { ContextObserverBase } from './ContextObserver'
|
3
|
+
import type { ComputedDatumSeries } from './ComputedDataSeries'
|
4
|
+
|
5
|
+
export interface ContextObserverSeries<PluginParams> extends ContextObserverBase<'series', PluginParams> {
|
6
|
+
textSizePx$: Observable<number>
|
7
|
+
seriesSeparate$: Observable<boolean>
|
8
|
+
visibleComputedData$: Observable<ComputedDatumSeries[][]>
|
9
|
+
computedLayoutData$: Observable<ComputedDatumSeries[][]>
|
10
|
+
visibleComputedLayoutData$: Observable<ComputedDatumSeries[][]>
|
11
|
+
seriesHighlight$: Observable<ComputedDatumSeries[]>
|
12
|
+
seriesLabels$: Observable<string[]>
|
13
|
+
SeriesDataMap$: Observable<Map<string, ComputedDatumSeries[]>>
|
14
|
+
seriesContainerPosition$: Observable<SeriesContainerPosition[]>
|
15
|
+
SeriesContainerPositionMap$: Observable<Map<string, SeriesContainerPosition>>
|
16
|
+
}
|
17
|
+
|
18
|
+
export interface SeriesContainerPosition {
|
19
|
+
slotIndex: number
|
20
|
+
rowIndex: number
|
21
|
+
columnIndex: number
|
22
|
+
// translate: [number, number]
|
23
|
+
startX: number
|
24
|
+
startY: number
|
25
|
+
centerX: number
|
26
|
+
centerY: number
|
27
|
+
width: number
|
28
|
+
height: number
|
29
|
+
}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { Observable } from 'rxjs'
|
2
|
-
import type { ContextObserverBase } from './ContextObserver'
|
3
|
-
import type { ComputedDataTree } from './ComputedDataTree'
|
4
|
-
|
5
|
-
export interface ContextObserverTree<PluginParams> extends ContextObserverBase<'tree', PluginParams> {
|
6
|
-
textSizePx$: Observable<number>
|
7
|
-
treeHighlight$: Observable<ComputedDataTree[]>
|
8
|
-
existCategoryLabels$: Observable<string[]>
|
9
|
-
CategoryDataMap$: Observable<Map<string, ComputedDataTree[]>>
|
10
|
-
visibleComputedData$: Observable<ComputedDataTree>
|
11
|
-
}
|
1
|
+
import { Observable } from 'rxjs'
|
2
|
+
import type { ContextObserverBase } from './ContextObserver'
|
3
|
+
import type { ComputedDataTree } from './ComputedDataTree'
|
4
|
+
|
5
|
+
export interface ContextObserverTree<PluginParams> extends ContextObserverBase<'tree', PluginParams> {
|
6
|
+
textSizePx$: Observable<number>
|
7
|
+
treeHighlight$: Observable<ComputedDataTree[]>
|
8
|
+
existCategoryLabels$: Observable<string[]>
|
9
|
+
CategoryDataMap$: Observable<Map<string, ComputedDataTree[]>>
|
10
|
+
visibleComputedData$: Observable<ComputedDataTree>
|
11
|
+
}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import { Observable, Subject, BehaviorSubject } from 'rxjs'
|
2
|
-
import type { ChartType } from './Chart'
|
3
|
-
import type { EventTypeMap } from './Event'
|
4
|
-
import type { ChartParamsPartial } from './ChartParams'
|
5
|
-
// import type { Data } from './Data'
|
6
|
-
import type { DataFormatterPartialTypeMap } from './DataFormatter'
|
7
|
-
import type { DataTypeMap } from './Data'
|
8
|
-
import type { DataFormatterTypeMap } from './DataFormatter'
|
9
|
-
import type { PluginEntity } from './Plugin'
|
10
|
-
|
11
|
-
export interface ContextSubject<T extends ChartType> {
|
12
|
-
data$: Subject<DataTypeMap<T>>
|
13
|
-
dataFormatter$: Subject<DataFormatterPartialTypeMap<T>>
|
14
|
-
plugins$: Subject<PluginEntity<T, any, any>[]>
|
15
|
-
// pluginParams$: Subject<{[keys: string]: unknown}>
|
16
|
-
chartParams$: Subject<ChartParamsPartial>
|
17
|
-
event$: Subject<EventTypeMap<T>>
|
18
|
-
}
|
1
|
+
import { Observable, Subject, BehaviorSubject } from 'rxjs'
|
2
|
+
import type { ChartType } from './Chart'
|
3
|
+
import type { EventTypeMap } from './Event'
|
4
|
+
import type { ChartParamsPartial } from './ChartParams'
|
5
|
+
// import type { Data } from './Data'
|
6
|
+
import type { DataFormatterPartialTypeMap } from './DataFormatter'
|
7
|
+
import type { DataTypeMap } from './Data'
|
8
|
+
import type { DataFormatterTypeMap } from './DataFormatter'
|
9
|
+
import type { PluginEntity } from './Plugin'
|
10
|
+
|
11
|
+
export interface ContextSubject<T extends ChartType> {
|
12
|
+
data$: Subject<DataTypeMap<T>>
|
13
|
+
dataFormatter$: Subject<DataFormatterPartialTypeMap<T>>
|
14
|
+
plugins$: Subject<PluginEntity<T, any, any>[]>
|
15
|
+
// pluginParams$: Subject<{[keys: string]: unknown}>
|
16
|
+
chartParams$: Subject<ChartParamsPartial>
|
17
|
+
event$: Subject<EventTypeMap<T>>
|
18
|
+
}
|
package/src/types/Data.ts
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
import { ChartType } from './Chart'
|
2
|
-
import { DataSeries, DataSeriesDatum, DataSeriesValue } from './DataSeries'
|
3
|
-
import { DataGrid, DataGridDatum, DataGridValue } from './DataGrid'
|
4
|
-
import { DataMultiGrid, DataMultiGridDatum, DataMultiGridValue } from './DataMultiGrid'
|
5
|
-
import { DataMultiValue, DataMultiValueDatum, DataMultiValueValue } from './DataMultiValue'
|
6
|
-
import { DataTree, DataTreeDatum, DataTreeObj } from './DataTree'
|
7
|
-
import { DataRelationship, Node, Edge } from './DataRelationship'
|
8
|
-
|
9
|
-
// 基本欄位(皆為可選,無填寫則在計算時產生預設值)
|
10
|
-
export interface DatumBase {
|
11
|
-
id?: string
|
12
|
-
label?: string
|
13
|
-
description?: string
|
14
|
-
data?: any // 使用者注入的資料
|
15
|
-
}
|
16
|
-
|
17
|
-
// 需具備value的datum
|
18
|
-
export interface DatumValue {
|
19
|
-
value: number | null
|
20
|
-
}
|
21
|
-
|
22
|
-
// 透過類型選擇Data
|
23
|
-
export type DataTypeMap<T extends ChartType> = T extends 'series' ? DataSeries
|
24
|
-
: T extends 'grid' ? DataGrid
|
25
|
-
: T extends 'multiGrid' ? DataMultiGrid
|
26
|
-
: T extends 'multiValue' ? DataMultiValue
|
27
|
-
: T extends 'relationship' ? DataRelationship
|
28
|
-
: T extends 'tree' ? DataTree
|
29
|
-
: unknown
|
30
|
-
|
31
|
-
// 透過類型選擇Datum
|
32
|
-
export type DatumTypeMap<T extends ChartType> = T extends 'series' ? DataSeriesDatum | DataSeriesValue
|
33
|
-
: T extends 'grid' ? DataGridDatum | DataGridValue
|
34
|
-
: T extends 'multiGrid' ? DataMultiGridDatum | DataMultiGridValue
|
35
|
-
: T extends 'multiValue' ? DataMultiValueDatum | DataMultiValueValue
|
36
|
-
: T extends 'relationship' ? Node | Edge
|
37
|
-
: T extends 'tree' ? DataTreeDatum | DataTreeObj
|
38
|
-
: unknown
|
39
|
-
|
40
|
-
// export type Data = DataSeries
|
41
|
-
// | DataGrid
|
42
|
-
// | DataMultiGrid
|
43
|
-
// | DataMultiValue
|
44
|
-
// | DataTree
|
45
|
-
// | DataRelationship
|
1
|
+
import { ChartType } from './Chart'
|
2
|
+
import { DataSeries, DataSeriesDatum, DataSeriesValue } from './DataSeries'
|
3
|
+
import { DataGrid, DataGridDatum, DataGridValue } from './DataGrid'
|
4
|
+
import { DataMultiGrid, DataMultiGridDatum, DataMultiGridValue } from './DataMultiGrid'
|
5
|
+
import { DataMultiValue, DataMultiValueDatum, DataMultiValueValue } from './DataMultiValue'
|
6
|
+
import { DataTree, DataTreeDatum, DataTreeObj } from './DataTree'
|
7
|
+
import { DataRelationship, Node, Edge } from './DataRelationship'
|
8
|
+
|
9
|
+
// 基本欄位(皆為可選,無填寫則在計算時產生預設值)
|
10
|
+
export interface DatumBase {
|
11
|
+
id?: string
|
12
|
+
label?: string
|
13
|
+
description?: string
|
14
|
+
data?: any // 使用者注入的資料
|
15
|
+
}
|
16
|
+
|
17
|
+
// 需具備value的datum
|
18
|
+
export interface DatumValue {
|
19
|
+
value: number | null
|
20
|
+
}
|
21
|
+
|
22
|
+
// 透過類型選擇Data
|
23
|
+
export type DataTypeMap<T extends ChartType> = T extends 'series' ? DataSeries
|
24
|
+
: T extends 'grid' ? DataGrid
|
25
|
+
: T extends 'multiGrid' ? DataMultiGrid
|
26
|
+
: T extends 'multiValue' ? DataMultiValue
|
27
|
+
: T extends 'relationship' ? DataRelationship
|
28
|
+
: T extends 'tree' ? DataTree
|
29
|
+
: unknown
|
30
|
+
|
31
|
+
// 透過類型選擇Datum
|
32
|
+
export type DatumTypeMap<T extends ChartType> = T extends 'series' ? DataSeriesDatum | DataSeriesValue
|
33
|
+
: T extends 'grid' ? DataGridDatum | DataGridValue
|
34
|
+
: T extends 'multiGrid' ? DataMultiGridDatum | DataMultiGridValue
|
35
|
+
: T extends 'multiValue' ? DataMultiValueDatum | DataMultiValueValue
|
36
|
+
: T extends 'relationship' ? Node | Edge
|
37
|
+
: T extends 'tree' ? DataTreeDatum | DataTreeObj
|
38
|
+
: unknown
|
39
|
+
|
40
|
+
// export type Data = DataSeries
|
41
|
+
// | DataGrid
|
42
|
+
// | DataMultiGrid
|
43
|
+
// | DataMultiValue
|
44
|
+
// | DataTree
|
45
|
+
// | DataRelationship
|
@@ -1,95 +1,74 @@
|
|
1
|
-
import type { ChartType } from './Chart'
|
2
|
-
import type { ChartParams } from './ChartParams'
|
3
|
-
import type { DataTypeMap, DatumTypeMap } from './Data'
|
4
|
-
import type {
|
5
|
-
import type {
|
6
|
-
import type {
|
7
|
-
import type {
|
8
|
-
import type {
|
9
|
-
import type {
|
10
|
-
import type {
|
11
|
-
import type {
|
12
|
-
|
13
|
-
|
14
|
-
//
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
//
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
: T extends '
|
39
|
-
: T
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
:
|
44
|
-
|
45
|
-
|
46
|
-
export type
|
47
|
-
|
48
|
-
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
53
|
-
|
54
|
-
|
55
|
-
export interface
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
//
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
// export
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
export interface DataFormatterValueAxis {
|
77
|
-
position: AxisPosition
|
78
|
-
scaleDomain: [number | 'auto', number | 'auto']
|
79
|
-
scaleRange: [number, number]
|
80
|
-
label: string
|
81
|
-
}
|
82
|
-
|
83
|
-
export interface DataFormatterGroupAxis {
|
84
|
-
position: AxisPosition
|
85
|
-
scaleDomain: [number | 'auto', number | 'auto']
|
86
|
-
scalePadding: number
|
87
|
-
label: string
|
88
|
-
}
|
89
|
-
|
90
|
-
|
91
|
-
// export type ValueFormat = string | ((text: d3.NumberValue) => string)
|
92
|
-
|
93
|
-
export type VisibleFilter<T extends ChartType> = (datum: DatumTypeMap<T>, rowIndex: number, columnIndex: number, context: DataFormatterContext<T>) => boolean | null
|
94
|
-
|
95
|
-
export type TooltipContentFormat<T extends ChartType> = (datum: DatumTypeMap<T>, rowIndex: number, columnIndex: number, context: DataFormatterContext<T>) => string | null
|
1
|
+
import type { ChartType } from './Chart'
|
2
|
+
import type { ChartParams } from './ChartParams'
|
3
|
+
import type { DataTypeMap, DatumTypeMap } from './Data'
|
4
|
+
import type { ComputedDataTypeMap, ComputedDatumTypeMap } from './ComputedData'
|
5
|
+
import type { DataFormatterSeries, DataFormatterSeriesPartial } from './DataFormatterSeries'
|
6
|
+
import type { DataFormatterGrid, DataFormatterGridPartial } from './DataFormatterGrid'
|
7
|
+
import type { DataFormatterMultiGrid, DataFormatterMultiGridPartial } from './DataFormatterMultiGrid'
|
8
|
+
import type { DataFormatterMultiValue, DataFormatterMultiValuePartial } from './DataFormatterMultiValue'
|
9
|
+
import type { DataFormatterTree, DataFormatterTreePartial } from './DataFormatterTree'
|
10
|
+
import type { DataFormatterRelationship, DataFormatterRelationshipPartial } from './DataFormatterRelationship'
|
11
|
+
import type { AxisPosition } from './Axis'
|
12
|
+
|
13
|
+
|
14
|
+
// dataFormatter計算當中會使用的資料
|
15
|
+
export interface DataFormatterContext<T extends ChartType> {
|
16
|
+
data: DataTypeMap<T>
|
17
|
+
dataFormatter: DataFormatterTypeMap<T>
|
18
|
+
chartParams: ChartParams
|
19
|
+
// layout: Layout
|
20
|
+
}
|
21
|
+
|
22
|
+
|
23
|
+
// 透過類型選擇DataFormatter
|
24
|
+
export type DataFormatterTypeMap<T extends ChartType> = T extends 'series' ? DataFormatterSeries
|
25
|
+
: T extends 'grid' ? DataFormatterGrid
|
26
|
+
: T extends 'multiGrid' ? DataFormatterMultiGrid
|
27
|
+
: T extends 'multiValue' ? DataFormatterMultiValue
|
28
|
+
: T extends 'relationship' ? DataFormatterRelationship
|
29
|
+
: T extends 'tree' ? DataFormatterTree
|
30
|
+
: DataFormatterBase<T>
|
31
|
+
|
32
|
+
// 透過類型選擇DataFormatter(可選欄位)
|
33
|
+
export type DataFormatterPartialTypeMap<T extends ChartType> = T extends 'series' ? DataFormatterSeriesPartial
|
34
|
+
: T extends 'grid' ? DataFormatterGridPartial
|
35
|
+
: T extends 'multiGrid' ? DataFormatterMultiGridPartial
|
36
|
+
: T extends 'multiValue' ? DataFormatterMultiValuePartial
|
37
|
+
: T extends 'relationship' ? DataFormatterRelationshipPartial
|
38
|
+
: T extends 'tree' ? DataFormatterTreePartial
|
39
|
+
: DataFormatterBasePartial<T>
|
40
|
+
|
41
|
+
// 基本介面
|
42
|
+
export interface DataFormatterBase<T extends ChartType> {
|
43
|
+
type: T
|
44
|
+
}
|
45
|
+
|
46
|
+
export type DataFormatterBasePartial<T extends ChartType> = Partial<DataFormatterBase<T>>
|
47
|
+
|
48
|
+
export interface DataFormatterValueAxis {
|
49
|
+
position: AxisPosition
|
50
|
+
scaleDomain: [number | 'auto', number | 'auto']
|
51
|
+
scaleRange: [number, number]
|
52
|
+
label: string
|
53
|
+
}
|
54
|
+
|
55
|
+
export interface DataFormatterGroupAxis {
|
56
|
+
position: AxisPosition
|
57
|
+
scaleDomain: [number | 'auto', number | 'auto']
|
58
|
+
scalePadding: number
|
59
|
+
label: string
|
60
|
+
}
|
61
|
+
|
62
|
+
|
63
|
+
// export type ValueFormat = string | ((text: d3.NumberValue) => string)
|
64
|
+
|
65
|
+
export type VisibleFilter<T extends ChartType> = (datum: ComputedDatumTypeMap<T>, context: DataFormatterContext<T>) => boolean | null
|
66
|
+
|
67
|
+
// export type TooltipContentFormat<T extends ChartType> = (datum: DatumTypeMap<T>, rowIndex: number, columnIndex: number, context: DataFormatterContext<T>) => string | null
|
68
|
+
|
69
|
+
export interface DataFormatterContainer {
|
70
|
+
gap: number
|
71
|
+
rowAmount: number
|
72
|
+
columnAmount: number
|
73
|
+
}
|
74
|
+
|
@@ -1,56 +1,68 @@
|
|
1
|
-
import type {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
grid
|
16
|
-
container
|
17
|
-
}
|
18
|
-
|
19
|
-
export interface
|
20
|
-
visibleFilter
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
36
|
-
|
37
|
-
export interface
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
//
|
1
|
+
import type {
|
2
|
+
DataFormatterBase,
|
3
|
+
DataFormatterBasePartial,
|
4
|
+
DataFormatterValueAxis,
|
5
|
+
DataFormatterGroupAxis,
|
6
|
+
VisibleFilter,
|
7
|
+
DataFormatterContainer
|
8
|
+
} from './DataFormatter'
|
9
|
+
|
10
|
+
|
11
|
+
export type SeriesDirection = 'row' | 'column' // default: 'row'
|
12
|
+
|
13
|
+
export interface DataFormatterGrid extends DataFormatterBase<'grid'> {
|
14
|
+
visibleFilter: VisibleFilter<'grid'>
|
15
|
+
grid: DataFormatterGridGrid
|
16
|
+
container: DataFormatterContainer
|
17
|
+
}
|
18
|
+
|
19
|
+
export interface DataFormatterGridPartial extends DataFormatterBasePartial<'grid'> {
|
20
|
+
visibleFilter?: VisibleFilter<'grid'>
|
21
|
+
grid?: DataFormatterGridGridPartial
|
22
|
+
container?: Partial<DataFormatterContainer>
|
23
|
+
}
|
24
|
+
|
25
|
+
export interface DataFormatterGridGrid {
|
26
|
+
// gridData: DataFormatterGridGridData
|
27
|
+
// slotIndex: number | null
|
28
|
+
// seriesSlotIndexes: number[] | null
|
29
|
+
seriesDirection: SeriesDirection
|
30
|
+
rowLabels: string[]
|
31
|
+
columnLabels: string[]
|
32
|
+
valueAxis: DataFormatterValueAxis
|
33
|
+
groupAxis: DataFormatterGroupAxis
|
34
|
+
separateSeries: boolean
|
35
|
+
}
|
36
|
+
|
37
|
+
export interface DataFormatterGridGridPartial {
|
38
|
+
// gridData?: Partial<DataFormatterGridGridData>
|
39
|
+
// slotIndex?: number | null
|
40
|
+
// seriesSlotIndexes?: number[] | null
|
41
|
+
seriesDirection?: SeriesDirection
|
42
|
+
rowLabels?: string[]
|
43
|
+
columnLabels?: string[]
|
44
|
+
valueAxis?: Partial<DataFormatterValueAxis>
|
45
|
+
groupAxis?: Partial<DataFormatterGroupAxis>
|
46
|
+
separateSeries?: boolean
|
47
|
+
}
|
48
|
+
|
49
|
+
export interface DataFormatterGridContainer {
|
50
|
+
gap: number
|
51
|
+
rowAmount: number
|
52
|
+
columnAmount: number
|
53
|
+
}
|
54
|
+
|
55
|
+
// grid欄位
|
56
|
+
// export interface DataFormatterGridGridData {
|
57
|
+
// seriesDirection: SeriesDirection
|
58
|
+
// rowLabels: string[]
|
59
|
+
// columnLabels: string[]
|
60
|
+
// }
|
61
|
+
|
62
|
+
// const test: DataFormatterGridPartial = {
|
63
|
+
// type: 'grid',
|
64
|
+
// grid: {
|
65
|
+
// rowLabels: [],
|
66
|
+
// // a: ''
|
67
|
+
// }
|
56
68
|
// }
|
@@ -1,43 +1,45 @@
|
|
1
|
-
import type { VisibleFilter } from './DataFormatter'
|
2
|
-
import type { DataFormatterGridGrid, DataFormatterGridGridPartial
|
3
|
-
import type {
|
4
|
-
DataFormatterBase,
|
5
|
-
DataFormatterBasePartial,
|
6
|
-
DataFormatterValueAxis,
|
7
|
-
DataFormatterGroupAxis,
|
8
|
-
DataFormatterContext } from './DataFormatter'
|
9
|
-
import type { AxisPosition } from './Axis'
|
10
|
-
|
11
|
-
export interface DataFormatterMultiGrid extends DataFormatterBase<'multiGrid'> {
|
12
|
-
|
13
|
-
gridList: Array<DataFormatterGridGrid>
|
14
|
-
container: DataFormatterMultiGridContainer
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
//
|
39
|
-
//
|
40
|
-
//
|
41
|
-
//
|
42
|
-
// //
|
1
|
+
import type { VisibleFilter, DataFormatterContainer } from './DataFormatter'
|
2
|
+
import type { DataFormatterGridGrid, DataFormatterGridGridPartial } from './DataFormatterGrid'
|
3
|
+
import type {
|
4
|
+
DataFormatterBase,
|
5
|
+
DataFormatterBasePartial,
|
6
|
+
DataFormatterValueAxis,
|
7
|
+
DataFormatterGroupAxis,
|
8
|
+
DataFormatterContext } from './DataFormatter'
|
9
|
+
import type { AxisPosition } from './Axis'
|
10
|
+
|
11
|
+
export interface DataFormatterMultiGrid extends DataFormatterBase<'multiGrid'> {
|
12
|
+
visibleFilter: VisibleFilter<'multiGrid'>
|
13
|
+
gridList: Array<DataFormatterGridGrid>
|
14
|
+
container: DataFormatterMultiGridContainer
|
15
|
+
separateGrid: boolean
|
16
|
+
}
|
17
|
+
|
18
|
+
export interface DataFormatterMultiGridPartial extends DataFormatterBasePartial<'multiGrid'> {
|
19
|
+
// visibleFilter?: VisibleFilter<'multiGrid'>
|
20
|
+
gridList?: Array<DataFormatterGridGridPartial>
|
21
|
+
container?: Partial<DataFormatterMultiGridContainer>
|
22
|
+
separateGrid?: boolean
|
23
|
+
}
|
24
|
+
|
25
|
+
export interface DataFormatterMultiGridGrid extends DataFormatterGridGrid {
|
26
|
+
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface DataFormatterMultiGridGridPartial extends DataFormatterGridGridPartial {
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
// container
|
34
|
+
export interface DataFormatterMultiGridContainer extends DataFormatterContainer {
|
35
|
+
|
36
|
+
}
|
37
|
+
|
38
|
+
// multiGrid欄位
|
39
|
+
// export interface DataFormatterMultiGridMultiGrid {
|
40
|
+
// grid: DataFormatterGridGridData
|
41
|
+
// valueAxis: DataFormatterValueAxis // default: 'left'
|
42
|
+
// groupAxis: DataFormatterGroupAxis // default: 'bottom'
|
43
|
+
// colorsPredicate: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string
|
44
|
+
// // colors: Colors
|
43
45
|
// }
|
@@ -1,21 +1,24 @@
|
|
1
|
-
import { DataMultiValueDatum, DataMultiValue } from './DataMultiValue'
|
2
|
-
import { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis, VisibleFilter } from './DataFormatter'
|
3
|
-
|
4
|
-
export interface DataFormatterMultiValue extends DataFormatterBase<'multiValue'> {
|
5
|
-
visibleFilter: VisibleFilter<'multiValue'>
|
6
|
-
// labelFormat: (datum: unknown) => string
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
1
|
+
import { DataMultiValueDatum, DataMultiValue } from './DataMultiValue'
|
2
|
+
import { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis, VisibleFilter } from './DataFormatter'
|
3
|
+
|
4
|
+
export interface DataFormatterMultiValue extends DataFormatterBase<'multiValue'> {
|
5
|
+
visibleFilter: VisibleFilter<'multiValue'>
|
6
|
+
// labelFormat: (datum: unknown) => string
|
7
|
+
categoryLabels: string[]
|
8
|
+
multiValue: Array<DataFormatterMultiValueMultiValue>
|
9
|
+
xAxis: DataFormatterValueAxis
|
10
|
+
yAxis: DataFormatterValueAxis
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface DataFormatterMultiValuePartial extends DataFormatterBasePartial<'multiValue'> {
|
14
|
+
visibleFilter?: VisibleFilter<'multiValue'>
|
15
|
+
categoryLabels?: string[]
|
16
|
+
multiValue?: Array<Partial<DataFormatterMultiValueMultiValue>>
|
17
|
+
xAxis?: Partial<DataFormatterValueAxis>
|
18
|
+
yAxis?: Partial<DataFormatterValueAxis>
|
19
|
+
}
|
20
|
+
|
21
|
+
// multiValue欄位
|
22
|
+
export interface DataFormatterMultiValueMultiValue {
|
23
|
+
// unitLabel: string
|
21
24
|
}
|