@orbcharts/core 3.0.0-alpha.43 → 3.0.0-alpha.45
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 +97 -97
- package/dist/orbcharts-core.umd.js +2 -2
- package/dist/src/series/seriesObservables.d.ts +3 -3
- package/dist/src/types/ContextObserverSeries.d.ts +1 -1
- package/dist/src/types/DataFormatterSeries.d.ts +3 -3
- 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 +368 -367
- package/src/base/createBasePlugin.ts +89 -89
- package/src/defaults.ts +220 -220
- 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 -134
- package/src/grid/createGridContextObserver.ts +147 -147
- package/src/grid/gridObservables.ts +573 -573
- package/src/index.ts +21 -21
- package/src/multiGrid/computeMultiGridData.ts +130 -130
- package/src/multiGrid/createMultiGridContextObserver.ts +40 -40
- package/src/multiGrid/multiGridObservables.ts +350 -350
- package/src/multiValue/computeMultiValueData.ts +143 -143
- package/src/multiValue/createMultiValueContextObserver.ts +12 -12
- package/src/relationship/computeRelationshipData.ts +118 -118
- package/src/relationship/createRelationshipContextObserver.ts +12 -12
- package/src/series/computeSeriesData.ts +90 -90
- package/src/series/createSeriesContextObserver.ts +93 -93
- package/src/series/seriesObservables.ts +175 -175
- package/src/tree/computeTreeData.ts +131 -131
- 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 -83
- 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 +7 -7
- package/src/types/ComputedDataTree.ts +19 -19
- package/src/types/ContextObserver.ts +38 -38
- package/src/types/ContextObserverGrid.ts +41 -41
- package/src/types/ContextObserverMultiGrid.ts +15 -15
- package/src/types/ContextObserverMultiValue.ts +4 -4
- package/src/types/ContextObserverRelationship.ts +4 -4
- package/src/types/ContextObserverSeries.ts +29 -29
- 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 -74
- package/src/types/DataFormatterGrid.ts +67 -67
- package/src/types/DataFormatterMultiGrid.ts +44 -44
- package/src/types/DataFormatterMultiValue.ts +23 -23
- package/src/types/DataFormatterRelationship.ts +25 -25
- package/src/types/DataFormatterSeries.ts +20 -20
- 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 -349
- package/tsconfig.json +13 -13
- package/vite.config.js +44 -44
@@ -1,12 +1,12 @@
|
|
1
|
-
import { DataTreeDatum, DataTree } from './DataTree'
|
2
|
-
import { DataFormatterBase, VisibleFilter } from './DataFormatter'
|
3
|
-
|
4
|
-
export interface DataFormatterTree
|
5
|
-
extends DataFormatterBase<'tree'> {
|
6
|
-
visibleFilter: VisibleFilter<'tree'>
|
7
|
-
// labelFormat: (datum: unknown) => string
|
8
|
-
// descriptionFormat: (datum: unknown) => string
|
9
|
-
categoryLabels: string[]
|
10
|
-
}
|
11
|
-
|
12
|
-
export type DataFormatterTreePartial = Partial<DataFormatterTree>
|
1
|
+
import { DataTreeDatum, DataTree } from './DataTree'
|
2
|
+
import { DataFormatterBase, VisibleFilter } from './DataFormatter'
|
3
|
+
|
4
|
+
export interface DataFormatterTree
|
5
|
+
extends DataFormatterBase<'tree'> {
|
6
|
+
visibleFilter: VisibleFilter<'tree'>
|
7
|
+
// labelFormat: (datum: unknown) => string
|
8
|
+
// descriptionFormat: (datum: unknown) => string
|
9
|
+
categoryLabels: string[]
|
10
|
+
}
|
11
|
+
|
12
|
+
export type DataFormatterTreePartial = Partial<DataFormatterTree>
|
package/src/types/DataGrid.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
import type { DatumBase, DatumValue } from './Data'
|
2
|
-
|
3
|
-
// export type DataGrid = DataGridDatum[][] | DataGridValue[][]
|
4
|
-
export type DataGrid = (DataGridDatum | DataGridValue)[][]
|
5
|
-
|
6
|
-
export type DataGridValue = number | null
|
7
|
-
|
8
|
-
export interface DataGridDatum extends DatumBase, DatumValue {
|
9
|
-
}
|
10
|
-
|
11
|
-
|
1
|
+
import type { DatumBase, DatumValue } from './Data'
|
2
|
+
|
3
|
+
// export type DataGrid = DataGridDatum[][] | DataGridValue[][]
|
4
|
+
export type DataGrid = (DataGridDatum | DataGridValue)[][]
|
5
|
+
|
6
|
+
export type DataGridValue = number | null
|
7
|
+
|
8
|
+
export interface DataGridDatum extends DatumBase, DatumValue {
|
9
|
+
}
|
10
|
+
|
11
|
+
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import type { DataGrid, DataGridDatum, DataGridValue } from './DataGrid'
|
2
|
-
|
3
|
-
export type DataMultiGrid = DataGrid[]
|
4
|
-
|
5
|
-
export interface DataMultiGridDatum extends DataGridDatum {}
|
6
|
-
|
1
|
+
import type { DataGrid, DataGridDatum, DataGridValue } from './DataGrid'
|
2
|
+
|
3
|
+
export type DataMultiGrid = DataGrid[]
|
4
|
+
|
5
|
+
export interface DataMultiGridDatum extends DataGridDatum {}
|
6
|
+
|
7
7
|
export type DataMultiGridValue = DataGridValue
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import type { DatumBase, DatumValue } from './Data'
|
2
|
-
|
3
|
-
// export type DataMultiValue = DataMultiValueDatum[][] | DataMultiValueValue[][]
|
4
|
-
export type DataMultiValue = (DataMultiValueDatum | DataMultiValueValue)[][]
|
5
|
-
|
6
|
-
export type DataMultiValueValue = number
|
7
|
-
|
8
|
-
export interface DataMultiValueDatum extends DatumBase, DatumValue {
|
9
|
-
categoryLabel?: string
|
10
|
-
}
|
11
|
-
|
12
|
-
|
1
|
+
import type { DatumBase, DatumValue } from './Data'
|
2
|
+
|
3
|
+
// export type DataMultiValue = DataMultiValueDatum[][] | DataMultiValueValue[][]
|
4
|
+
export type DataMultiValue = (DataMultiValueDatum | DataMultiValueValue)[][]
|
5
|
+
|
6
|
+
export type DataMultiValueValue = number
|
7
|
+
|
8
|
+
export interface DataMultiValueDatum extends DatumBase, DatumValue {
|
9
|
+
categoryLabel?: string
|
10
|
+
}
|
11
|
+
|
12
|
+
|
@@ -1,28 +1,28 @@
|
|
1
|
-
import type { DatumBase } from './Data'
|
2
|
-
|
3
|
-
export type DataRelationship = DataRelationshipObj | DataRelationshipList
|
4
|
-
|
5
|
-
// 物件資料
|
6
|
-
export interface DataRelationshipObj {
|
7
|
-
nodes: Node[]
|
8
|
-
edges: Edge[]
|
9
|
-
}
|
10
|
-
|
11
|
-
// 陣列資料
|
12
|
-
export type DataRelationshipList = [
|
13
|
-
Node[],
|
14
|
-
Edge[]
|
15
|
-
]
|
16
|
-
|
17
|
-
|
18
|
-
export interface Node extends DatumBase {
|
19
|
-
id: string
|
20
|
-
value?: number
|
21
|
-
categoryLabel?: string
|
22
|
-
}
|
23
|
-
|
24
|
-
export interface Edge extends DatumBase {
|
25
|
-
start: string
|
26
|
-
end: string
|
27
|
-
value?: number
|
1
|
+
import type { DatumBase } from './Data'
|
2
|
+
|
3
|
+
export type DataRelationship = DataRelationshipObj | DataRelationshipList
|
4
|
+
|
5
|
+
// 物件資料
|
6
|
+
export interface DataRelationshipObj {
|
7
|
+
nodes: Node[]
|
8
|
+
edges: Edge[]
|
9
|
+
}
|
10
|
+
|
11
|
+
// 陣列資料
|
12
|
+
export type DataRelationshipList = [
|
13
|
+
Node[],
|
14
|
+
Edge[]
|
15
|
+
]
|
16
|
+
|
17
|
+
|
18
|
+
export interface Node extends DatumBase {
|
19
|
+
id: string
|
20
|
+
value?: number
|
21
|
+
categoryLabel?: string
|
22
|
+
}
|
23
|
+
|
24
|
+
export interface Edge extends DatumBase {
|
25
|
+
start: string
|
26
|
+
end: string
|
27
|
+
value?: number
|
28
28
|
}
|
package/src/types/DataSeries.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
import type { DatumBase, DatumValue } from './Data'
|
2
|
-
|
3
|
-
// export type DataSeries = DataSeriesDatum[][] | DataSeriesDatum[] | DataSeriesValue[][] | DataSeriesValue[]
|
4
|
-
export type DataSeries = (DataSeriesDatum | DataSeriesValue)[][] | (DataSeriesDatum | DataSeriesValue)[]
|
5
|
-
|
6
|
-
export type DataSeriesValue = number | null
|
7
|
-
|
8
|
-
export interface DataSeriesDatum extends DatumBase, DatumValue {
|
9
|
-
}
|
10
|
-
|
11
|
-
|
1
|
+
import type { DatumBase, DatumValue } from './Data'
|
2
|
+
|
3
|
+
// export type DataSeries = DataSeriesDatum[][] | DataSeriesDatum[] | DataSeriesValue[][] | DataSeriesValue[]
|
4
|
+
export type DataSeries = (DataSeriesDatum | DataSeriesValue)[][] | (DataSeriesDatum | DataSeriesValue)[]
|
5
|
+
|
6
|
+
export type DataSeriesValue = number | null
|
7
|
+
|
8
|
+
export interface DataSeriesDatum extends DatumBase, DatumValue {
|
9
|
+
}
|
10
|
+
|
11
|
+
|
package/src/types/DataTree.ts
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
import type { DatumBase } from './Data'
|
2
|
-
|
3
|
-
export type DataTree = DataTreeObj | DataTreeDatum[]
|
4
|
-
|
5
|
-
// 樹狀結構
|
6
|
-
export interface DataTreeObj extends DatumBase {
|
7
|
-
id: string
|
8
|
-
value?: number
|
9
|
-
children?: DataTreeObj[]
|
10
|
-
categoryLabel?: string
|
11
|
-
}
|
12
|
-
|
13
|
-
// 陣列資料
|
14
|
-
export interface DataTreeDatum extends DatumBase {
|
15
|
-
id: string
|
16
|
-
value?: number
|
17
|
-
parent?: string
|
18
|
-
categoryLabel?: string
|
19
|
-
}
|
20
|
-
|
1
|
+
import type { DatumBase } from './Data'
|
2
|
+
|
3
|
+
export type DataTree = DataTreeObj | DataTreeDatum[]
|
4
|
+
|
5
|
+
// 樹狀結構
|
6
|
+
export interface DataTreeObj extends DatumBase {
|
7
|
+
id: string
|
8
|
+
value?: number
|
9
|
+
children?: DataTreeObj[]
|
10
|
+
categoryLabel?: string
|
11
|
+
}
|
12
|
+
|
13
|
+
// 陣列資料
|
14
|
+
export interface DataTreeDatum extends DatumBase {
|
15
|
+
id: string
|
16
|
+
value?: number
|
17
|
+
parent?: string
|
18
|
+
categoryLabel?: string
|
19
|
+
}
|
20
|
+
|
package/src/types/Event.ts
CHANGED
@@ -1,153 +1,153 @@
|
|
1
|
-
import * as d3 from 'd3'
|
2
|
-
import type { ChartType } from './Chart'
|
3
|
-
import type { ComputedDatumBase } from './ComputedData'
|
4
|
-
import type { ComputedDataSeries, ComputedDatumSeries } from './ComputedDataSeries'
|
5
|
-
import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
|
6
|
-
import type { ComputedDataMultiGrid } from './ComputedDataMultiGrid'
|
7
|
-
import type { ComputedDataMultiValue, ComputedDatumMultiValue } from './ComputedDataMultiValue'
|
8
|
-
import type { ComputedDataRelationship, ComputedNode } from './ComputedDataRelationship'
|
9
|
-
import type { ComputedDataTree } from './ComputedDataTree'
|
10
|
-
import type { HighlightTarget } from './ChartParams'
|
11
|
-
|
12
|
-
export type EventName = 'click'
|
13
|
-
| 'mouseover'
|
14
|
-
| 'mousemove'
|
15
|
-
| 'mouseout'
|
16
|
-
| 'dragstart'
|
17
|
-
| 'drag'
|
18
|
-
| 'dragend'
|
19
|
-
| 'resize'
|
20
|
-
| 'transitionMove'
|
21
|
-
| 'transitionEnd'
|
22
|
-
// | 'enterDuration'
|
23
|
-
|
24
|
-
// export interface Event<EventData = unknown> {
|
25
|
-
// eventName: EventName
|
26
|
-
// data: EventData
|
27
|
-
// }
|
28
|
-
|
29
|
-
// export interface ShareEvent<EventData = unknown> extends Event<EventData> {
|
30
|
-
// pluginName: string
|
31
|
-
// }
|
32
|
-
|
33
|
-
// export interface EventData {
|
34
|
-
|
35
|
-
// }
|
36
|
-
|
37
|
-
// 透過類型選擇Event
|
38
|
-
export type EventTypeMap<T extends ChartType> = T extends 'series' ? EventSeries
|
39
|
-
: T extends 'grid' ? EventGrid
|
40
|
-
: T extends 'multiGrid' ? EventMultiGrid
|
41
|
-
: T extends 'multiValue' ? EventMultiValue
|
42
|
-
: T extends 'relationship' ? EventRelationship
|
43
|
-
: T extends 'tree' ? EventTree
|
44
|
-
: EventBase<any>
|
45
|
-
|
46
|
-
export interface EventBase<T extends ChartType> {
|
47
|
-
type: T
|
48
|
-
eventName: EventName
|
49
|
-
pluginName: string
|
50
|
-
event: MouseEvent | undefined
|
51
|
-
highlightTarget: HighlightTarget
|
52
|
-
// datum: ComputedDatumBase | null
|
53
|
-
tween?: number
|
54
|
-
}
|
55
|
-
|
56
|
-
export interface EventBaseSeriesValue<DatumType, DataType> {
|
57
|
-
data: DataType
|
58
|
-
series: DatumType[]
|
59
|
-
seriesIndex: number
|
60
|
-
seriesLabel: string
|
61
|
-
datum: DatumType | null
|
62
|
-
}
|
63
|
-
|
64
|
-
export interface EventBaseGridValue<DatumType, DataType> {
|
65
|
-
data: DataType
|
66
|
-
gridIndex: number
|
67
|
-
series: DatumType[]
|
68
|
-
seriesIndex: number
|
69
|
-
seriesLabel: string
|
70
|
-
groups: DatumType[]
|
71
|
-
groupIndex: number
|
72
|
-
groupLabel: string
|
73
|
-
datum: DatumType | null
|
74
|
-
}
|
75
|
-
|
76
|
-
export interface EventBaseCategoryValue<DatumType, DataType> {
|
77
|
-
data: DataType
|
78
|
-
category: DatumType[]
|
79
|
-
categoryIndex: number
|
80
|
-
categoryLabel: string
|
81
|
-
datum: DatumType | null
|
82
|
-
}
|
83
|
-
|
84
|
-
export interface EventSeries extends EventBase<'series'>, EventBaseSeriesValue<ComputedDatumSeries, ComputedDataSeries> {
|
85
|
-
// type: 'series'
|
86
|
-
// data: ComputedDataSeries
|
87
|
-
// series: ComputedDatumSeries[]
|
88
|
-
// seriesIndex: number
|
89
|
-
// seriesLabel: string
|
90
|
-
// datum: ComputedDatumSeries | null
|
91
|
-
// // highlightTarget: 'series' | 'datum' | 'none'
|
92
|
-
// // highlightLabel: string | null
|
93
|
-
// // highlightId: string | null
|
94
|
-
}
|
95
|
-
|
96
|
-
export interface EventGrid extends EventBase<'grid'>, EventBaseGridValue<ComputedDatumGrid, ComputedDataGrid> {
|
97
|
-
// type: 'grid'
|
98
|
-
// data: ComputedDataGrid
|
99
|
-
// series: ComputedDatumGrid[]
|
100
|
-
// seriesIndex: number
|
101
|
-
// seriesLabel: string
|
102
|
-
// groups: ComputedDatumGrid[]
|
103
|
-
// groupIndex: number
|
104
|
-
// groupLabel: string
|
105
|
-
// datum: ComputedDatumGrid | null
|
106
|
-
// // highlightTarget: 'series' | 'group' | 'datum' | 'none'
|
107
|
-
// // highlightLabel: string | null
|
108
|
-
// // highlightId: string | null
|
109
|
-
}
|
110
|
-
|
111
|
-
export interface EventMultiGrid extends EventBase<'multiGrid'>, EventBaseGridValue<ComputedDatumGrid, ComputedDataMultiGrid> {
|
112
|
-
// type: 'multiGrid'
|
113
|
-
// data: ComputedDataMultiGrid
|
114
|
-
// gridIndex: number
|
115
|
-
// series: ComputedDatumGrid[]
|
116
|
-
// seriesIndex: number
|
117
|
-
// seriesLabel: string
|
118
|
-
// group: ComputedDatumGrid[]
|
119
|
-
// groupIndex: number
|
120
|
-
// groupLabel: string
|
121
|
-
// datum: ComputedDatumGrid | null
|
122
|
-
// // highlightTarget: 'series' | 'group' | 'datum' | 'none'
|
123
|
-
// // highlightLabel: string | null
|
124
|
-
// // highlightId: string | null
|
125
|
-
}
|
126
|
-
|
127
|
-
export interface EventMultiValue extends EventBase<'multiValue'>, EventBaseCategoryValue<ComputedDatumMultiValue, ComputedDataMultiValue> {
|
128
|
-
// type: 'multiValue'
|
129
|
-
// data: ComputedDataMultiValue
|
130
|
-
// category: ComputedDatumMultiValue[]
|
131
|
-
// categoryIndex: number
|
132
|
-
// categoryLabel: string
|
133
|
-
// datum: ComputedDatumMultiValue | null
|
134
|
-
}
|
135
|
-
|
136
|
-
export interface EventRelationship extends EventBase<'relationship'>, EventBaseCategoryValue<ComputedNode, ComputedDataRelationship> {
|
137
|
-
// type: 'relationship'
|
138
|
-
// data: ComputedDataRelationship
|
139
|
-
// category: ComputedNode[]
|
140
|
-
// categoryIndex: number
|
141
|
-
// categoryLabel: string
|
142
|
-
// datum: ComputedNode | null
|
143
|
-
}
|
144
|
-
|
145
|
-
export interface EventTree extends EventBase<'tree'>, EventBaseCategoryValue<ComputedDataTree, ComputedDataTree> {
|
146
|
-
// type: 'tree'
|
147
|
-
// data: ComputedDataTree
|
148
|
-
// category: ComputedDataTree[]
|
149
|
-
// categoryIndex: number
|
150
|
-
// categoryLabel: string
|
151
|
-
// datum: ComputedDataTree | null
|
152
|
-
}
|
153
|
-
|
1
|
+
import * as d3 from 'd3'
|
2
|
+
import type { ChartType } from './Chart'
|
3
|
+
import type { ComputedDatumBase } from './ComputedData'
|
4
|
+
import type { ComputedDataSeries, ComputedDatumSeries } from './ComputedDataSeries'
|
5
|
+
import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
|
6
|
+
import type { ComputedDataMultiGrid } from './ComputedDataMultiGrid'
|
7
|
+
import type { ComputedDataMultiValue, ComputedDatumMultiValue } from './ComputedDataMultiValue'
|
8
|
+
import type { ComputedDataRelationship, ComputedNode } from './ComputedDataRelationship'
|
9
|
+
import type { ComputedDataTree } from './ComputedDataTree'
|
10
|
+
import type { HighlightTarget } from './ChartParams'
|
11
|
+
|
12
|
+
export type EventName = 'click'
|
13
|
+
| 'mouseover'
|
14
|
+
| 'mousemove'
|
15
|
+
| 'mouseout'
|
16
|
+
| 'dragstart'
|
17
|
+
| 'drag'
|
18
|
+
| 'dragend'
|
19
|
+
| 'resize'
|
20
|
+
| 'transitionMove'
|
21
|
+
| 'transitionEnd'
|
22
|
+
// | 'enterDuration'
|
23
|
+
|
24
|
+
// export interface Event<EventData = unknown> {
|
25
|
+
// eventName: EventName
|
26
|
+
// data: EventData
|
27
|
+
// }
|
28
|
+
|
29
|
+
// export interface ShareEvent<EventData = unknown> extends Event<EventData> {
|
30
|
+
// pluginName: string
|
31
|
+
// }
|
32
|
+
|
33
|
+
// export interface EventData {
|
34
|
+
|
35
|
+
// }
|
36
|
+
|
37
|
+
// 透過類型選擇Event
|
38
|
+
export type EventTypeMap<T extends ChartType> = T extends 'series' ? EventSeries
|
39
|
+
: T extends 'grid' ? EventGrid
|
40
|
+
: T extends 'multiGrid' ? EventMultiGrid
|
41
|
+
: T extends 'multiValue' ? EventMultiValue
|
42
|
+
: T extends 'relationship' ? EventRelationship
|
43
|
+
: T extends 'tree' ? EventTree
|
44
|
+
: EventBase<any>
|
45
|
+
|
46
|
+
export interface EventBase<T extends ChartType> {
|
47
|
+
type: T
|
48
|
+
eventName: EventName
|
49
|
+
pluginName: string
|
50
|
+
event: MouseEvent | undefined
|
51
|
+
highlightTarget: HighlightTarget
|
52
|
+
// datum: ComputedDatumBase | null
|
53
|
+
tween?: number
|
54
|
+
}
|
55
|
+
|
56
|
+
export interface EventBaseSeriesValue<DatumType, DataType> {
|
57
|
+
data: DataType
|
58
|
+
series: DatumType[]
|
59
|
+
seriesIndex: number
|
60
|
+
seriesLabel: string
|
61
|
+
datum: DatumType | null
|
62
|
+
}
|
63
|
+
|
64
|
+
export interface EventBaseGridValue<DatumType, DataType> {
|
65
|
+
data: DataType
|
66
|
+
gridIndex: number
|
67
|
+
series: DatumType[]
|
68
|
+
seriesIndex: number
|
69
|
+
seriesLabel: string
|
70
|
+
groups: DatumType[]
|
71
|
+
groupIndex: number
|
72
|
+
groupLabel: string
|
73
|
+
datum: DatumType | null
|
74
|
+
}
|
75
|
+
|
76
|
+
export interface EventBaseCategoryValue<DatumType, DataType> {
|
77
|
+
data: DataType
|
78
|
+
category: DatumType[]
|
79
|
+
categoryIndex: number
|
80
|
+
categoryLabel: string
|
81
|
+
datum: DatumType | null
|
82
|
+
}
|
83
|
+
|
84
|
+
export interface EventSeries extends EventBase<'series'>, EventBaseSeriesValue<ComputedDatumSeries, ComputedDataSeries> {
|
85
|
+
// type: 'series'
|
86
|
+
// data: ComputedDataSeries
|
87
|
+
// series: ComputedDatumSeries[]
|
88
|
+
// seriesIndex: number
|
89
|
+
// seriesLabel: string
|
90
|
+
// datum: ComputedDatumSeries | null
|
91
|
+
// // highlightTarget: 'series' | 'datum' | 'none'
|
92
|
+
// // highlightLabel: string | null
|
93
|
+
// // highlightId: string | null
|
94
|
+
}
|
95
|
+
|
96
|
+
export interface EventGrid extends EventBase<'grid'>, EventBaseGridValue<ComputedDatumGrid, ComputedDataGrid> {
|
97
|
+
// type: 'grid'
|
98
|
+
// data: ComputedDataGrid
|
99
|
+
// series: ComputedDatumGrid[]
|
100
|
+
// seriesIndex: number
|
101
|
+
// seriesLabel: string
|
102
|
+
// groups: ComputedDatumGrid[]
|
103
|
+
// groupIndex: number
|
104
|
+
// groupLabel: string
|
105
|
+
// datum: ComputedDatumGrid | null
|
106
|
+
// // highlightTarget: 'series' | 'group' | 'datum' | 'none'
|
107
|
+
// // highlightLabel: string | null
|
108
|
+
// // highlightId: string | null
|
109
|
+
}
|
110
|
+
|
111
|
+
export interface EventMultiGrid extends EventBase<'multiGrid'>, EventBaseGridValue<ComputedDatumGrid, ComputedDataMultiGrid> {
|
112
|
+
// type: 'multiGrid'
|
113
|
+
// data: ComputedDataMultiGrid
|
114
|
+
// gridIndex: number
|
115
|
+
// series: ComputedDatumGrid[]
|
116
|
+
// seriesIndex: number
|
117
|
+
// seriesLabel: string
|
118
|
+
// group: ComputedDatumGrid[]
|
119
|
+
// groupIndex: number
|
120
|
+
// groupLabel: string
|
121
|
+
// datum: ComputedDatumGrid | null
|
122
|
+
// // highlightTarget: 'series' | 'group' | 'datum' | 'none'
|
123
|
+
// // highlightLabel: string | null
|
124
|
+
// // highlightId: string | null
|
125
|
+
}
|
126
|
+
|
127
|
+
export interface EventMultiValue extends EventBase<'multiValue'>, EventBaseCategoryValue<ComputedDatumMultiValue, ComputedDataMultiValue> {
|
128
|
+
// type: 'multiValue'
|
129
|
+
// data: ComputedDataMultiValue
|
130
|
+
// category: ComputedDatumMultiValue[]
|
131
|
+
// categoryIndex: number
|
132
|
+
// categoryLabel: string
|
133
|
+
// datum: ComputedDatumMultiValue | null
|
134
|
+
}
|
135
|
+
|
136
|
+
export interface EventRelationship extends EventBase<'relationship'>, EventBaseCategoryValue<ComputedNode, ComputedDataRelationship> {
|
137
|
+
// type: 'relationship'
|
138
|
+
// data: ComputedDataRelationship
|
139
|
+
// category: ComputedNode[]
|
140
|
+
// categoryIndex: number
|
141
|
+
// categoryLabel: string
|
142
|
+
// datum: ComputedNode | null
|
143
|
+
}
|
144
|
+
|
145
|
+
export interface EventTree extends EventBase<'tree'>, EventBaseCategoryValue<ComputedDataTree, ComputedDataTree> {
|
146
|
+
// type: 'tree'
|
147
|
+
// data: ComputedDataTree
|
148
|
+
// category: ComputedDataTree[]
|
149
|
+
// categoryIndex: number
|
150
|
+
// categoryLabel: string
|
151
|
+
// datum: ComputedDataTree | null
|
152
|
+
}
|
153
|
+
|
package/src/types/Layout.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
import type { Padding } from './Padding'
|
2
|
-
|
3
|
-
export interface Layout extends Padding {
|
4
|
-
width: number
|
5
|
-
height: number
|
6
|
-
// top: number
|
7
|
-
// right: number
|
8
|
-
// bottom: number
|
9
|
-
// left: number
|
10
|
-
rootWidth: number
|
11
|
-
rootHeight: number
|
1
|
+
import type { Padding } from './Padding'
|
2
|
+
|
3
|
+
export interface Layout extends Padding {
|
4
|
+
width: number
|
5
|
+
height: number
|
6
|
+
// top: number
|
7
|
+
// right: number
|
8
|
+
// bottom: number
|
9
|
+
// left: number
|
10
|
+
rootWidth: number
|
11
|
+
rootHeight: number
|
12
12
|
}
|
package/src/types/Padding.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export interface Padding {
|
2
|
-
top: number
|
3
|
-
right: number
|
4
|
-
bottom: number
|
5
|
-
left: number
|
1
|
+
export interface Padding {
|
2
|
+
top: number
|
3
|
+
right: number
|
4
|
+
bottom: number
|
5
|
+
left: number
|
6
6
|
}
|