@orbcharts/core 3.0.0-alpha.43 → 3.0.0-alpha.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,84 +1,84 @@
|
|
1
|
-
import type { ChartType } from './Chart'
|
2
|
-
import type { ComputedDataSeries, ComputedDatumSeries } from './ComputedDataSeries'
|
3
|
-
import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
|
4
|
-
import type { ComputedDataMultiGrid } from './ComputedDataMultiGrid'
|
5
|
-
import type { ComputedDataMultiValue, ComputedDatumMultiValue } from './ComputedDataMultiValue'
|
6
|
-
import type { ComputedDataRelationship, ComputedNode } from './ComputedDataRelationship'
|
7
|
-
import type { ComputedDataTree } from './ComputedDataTree'
|
8
|
-
import type { DataFormatterContext } from './DataFormatter'
|
9
|
-
|
10
|
-
export interface ComputedDataFn<T extends ChartType> {
|
11
|
-
(dataFormatterContext: DataFormatterContext<T>): ComputedDataTypeMap<T>
|
12
|
-
}
|
13
|
-
|
14
|
-
// datum - 基本型本
|
15
|
-
export interface ComputedDatumBase {
|
16
|
-
id: string
|
17
|
-
index: number
|
18
|
-
label: string
|
19
|
-
value: number | null
|
20
|
-
visible: boolean
|
21
|
-
description: string
|
22
|
-
data: any // 使用者注入的資料
|
23
|
-
}
|
24
|
-
|
25
|
-
// datum - 單值
|
26
|
-
// export interface ComputedDatumValue {
|
27
|
-
// value: number | null
|
28
|
-
// // valueLabel: string
|
29
|
-
// }
|
30
|
-
|
31
|
-
// datum - 多值
|
32
|
-
// export interface ComputedDatumMultiValue {
|
33
|
-
// value: number[]
|
34
|
-
// valueLabels: string[]
|
35
|
-
// }
|
36
|
-
|
37
|
-
// datum - 圖軸
|
38
|
-
// export interface ComputedDatumWithAxis {
|
39
|
-
// axisX: number
|
40
|
-
// axisY: number
|
41
|
-
// }
|
42
|
-
|
43
|
-
// datum - 序列資料
|
44
|
-
export interface ComputedDatumSeriesValue {
|
45
|
-
color: string
|
46
|
-
seriesIndex: number
|
47
|
-
seriesLabel: string
|
48
|
-
seq: number
|
49
|
-
}
|
50
|
-
|
51
|
-
// datum - 矩陣資料
|
52
|
-
export interface ComputedDatumGridValue {
|
53
|
-
gridIndex: number
|
54
|
-
color: string
|
55
|
-
seriesIndex: number
|
56
|
-
seriesLabel: string
|
57
|
-
groupIndex: number
|
58
|
-
groupLabel: string
|
59
|
-
}
|
60
|
-
|
61
|
-
// datum - 類別資料
|
62
|
-
export interface ComputedDatumCategoryValue {
|
63
|
-
color: string
|
64
|
-
categoryIndex: number
|
65
|
-
categoryLabel: string | null
|
66
|
-
}
|
67
|
-
|
68
|
-
// 透過類型選擇ComputedData
|
69
|
-
export type ComputedDataTypeMap<T extends ChartType> = T extends 'series' ? ComputedDataSeries
|
70
|
-
: T extends 'grid' ? ComputedDataGrid
|
71
|
-
: T extends 'multiGrid' ? ComputedDataMultiGrid
|
72
|
-
: T extends 'multiValue' ? ComputedDataMultiValue
|
73
|
-
: T extends 'relationship' ? ComputedDataRelationship
|
74
|
-
: T extends 'tree' ? ComputedDataTree
|
75
|
-
: ComputedDatumBase
|
76
|
-
|
77
|
-
// 透過類型選擇ComputedDatum
|
78
|
-
export type ComputedDatumTypeMap<T extends ChartType> = T extends 'series' ? ComputedDatumSeries
|
79
|
-
: T extends 'grid' ? ComputedDatumGrid
|
80
|
-
: T extends 'multiGrid' ? ComputedDatumGrid
|
81
|
-
: T extends 'multiValue' ? ComputedDatumMultiValue
|
82
|
-
: T extends 'relationship' ? ComputedNode
|
83
|
-
: T extends 'tree' ? ComputedDataTree
|
1
|
+
import type { ChartType } from './Chart'
|
2
|
+
import type { ComputedDataSeries, ComputedDatumSeries } from './ComputedDataSeries'
|
3
|
+
import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
|
4
|
+
import type { ComputedDataMultiGrid } from './ComputedDataMultiGrid'
|
5
|
+
import type { ComputedDataMultiValue, ComputedDatumMultiValue } from './ComputedDataMultiValue'
|
6
|
+
import type { ComputedDataRelationship, ComputedNode } from './ComputedDataRelationship'
|
7
|
+
import type { ComputedDataTree } from './ComputedDataTree'
|
8
|
+
import type { DataFormatterContext } from './DataFormatter'
|
9
|
+
|
10
|
+
export interface ComputedDataFn<T extends ChartType> {
|
11
|
+
(dataFormatterContext: DataFormatterContext<T>): ComputedDataTypeMap<T>
|
12
|
+
}
|
13
|
+
|
14
|
+
// datum - 基本型本
|
15
|
+
export interface ComputedDatumBase {
|
16
|
+
id: string
|
17
|
+
index: number
|
18
|
+
label: string
|
19
|
+
value: number | null
|
20
|
+
visible: boolean
|
21
|
+
description: string
|
22
|
+
data: any // 使用者注入的資料
|
23
|
+
}
|
24
|
+
|
25
|
+
// datum - 單值
|
26
|
+
// export interface ComputedDatumValue {
|
27
|
+
// value: number | null
|
28
|
+
// // valueLabel: string
|
29
|
+
// }
|
30
|
+
|
31
|
+
// datum - 多值
|
32
|
+
// export interface ComputedDatumMultiValue {
|
33
|
+
// value: number[]
|
34
|
+
// valueLabels: string[]
|
35
|
+
// }
|
36
|
+
|
37
|
+
// datum - 圖軸
|
38
|
+
// export interface ComputedDatumWithAxis {
|
39
|
+
// axisX: number
|
40
|
+
// axisY: number
|
41
|
+
// }
|
42
|
+
|
43
|
+
// datum - 序列資料
|
44
|
+
export interface ComputedDatumSeriesValue {
|
45
|
+
color: string
|
46
|
+
seriesIndex: number
|
47
|
+
seriesLabel: string
|
48
|
+
seq: number
|
49
|
+
}
|
50
|
+
|
51
|
+
// datum - 矩陣資料
|
52
|
+
export interface ComputedDatumGridValue {
|
53
|
+
gridIndex: number
|
54
|
+
color: string
|
55
|
+
seriesIndex: number
|
56
|
+
seriesLabel: string
|
57
|
+
groupIndex: number
|
58
|
+
groupLabel: string
|
59
|
+
}
|
60
|
+
|
61
|
+
// datum - 類別資料
|
62
|
+
export interface ComputedDatumCategoryValue {
|
63
|
+
color: string
|
64
|
+
categoryIndex: number
|
65
|
+
categoryLabel: string | null
|
66
|
+
}
|
67
|
+
|
68
|
+
// 透過類型選擇ComputedData
|
69
|
+
export type ComputedDataTypeMap<T extends ChartType> = T extends 'series' ? ComputedDataSeries
|
70
|
+
: T extends 'grid' ? ComputedDataGrid
|
71
|
+
: T extends 'multiGrid' ? ComputedDataMultiGrid
|
72
|
+
: T extends 'multiValue' ? ComputedDataMultiValue
|
73
|
+
: T extends 'relationship' ? ComputedDataRelationship
|
74
|
+
: T extends 'tree' ? ComputedDataTree
|
75
|
+
: ComputedDatumBase
|
76
|
+
|
77
|
+
// 透過類型選擇ComputedDatum
|
78
|
+
export type ComputedDatumTypeMap<T extends ChartType> = T extends 'series' ? ComputedDatumSeries
|
79
|
+
: T extends 'grid' ? ComputedDatumGrid
|
80
|
+
: T extends 'multiGrid' ? ComputedDatumGrid
|
81
|
+
: T extends 'multiValue' ? ComputedDatumMultiValue
|
82
|
+
: T extends 'relationship' ? ComputedNode
|
83
|
+
: T extends 'tree' ? ComputedDataTree
|
84
84
|
: unknown
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { ComputedDatumBase, ComputedDatumGridValue } from './ComputedData'
|
2
|
-
|
3
|
-
export interface ComputedDatumGrid
|
4
|
-
extends ComputedDatumBase, ComputedDatumGridValue {
|
5
|
-
// accSeriesIndex: number // 每一個grid累加的seriesIndex
|
6
|
-
// gridIndex: number
|
7
|
-
// groupIndex: number
|
8
|
-
// groupLabel: string
|
9
|
-
// axisX: number
|
10
|
-
// axisY: number
|
11
|
-
// axisYFromZero: number
|
12
|
-
}
|
13
|
-
|
1
|
+
import { ComputedDatumBase, ComputedDatumGridValue } from './ComputedData'
|
2
|
+
|
3
|
+
export interface ComputedDatumGrid
|
4
|
+
extends ComputedDatumBase, ComputedDatumGridValue {
|
5
|
+
// accSeriesIndex: number // 每一個grid累加的seriesIndex
|
6
|
+
// gridIndex: number
|
7
|
+
// groupIndex: number
|
8
|
+
// groupLabel: string
|
9
|
+
// axisX: number
|
10
|
+
// axisY: number
|
11
|
+
// axisYFromZero: number
|
12
|
+
}
|
13
|
+
|
14
14
|
export type ComputedDataGrid = ComputedDatumGrid[][]
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { ComputedDataGrid } from './ComputedDataGrid'
|
2
|
-
|
1
|
+
import { ComputedDataGrid } from './ComputedDataGrid'
|
2
|
+
|
3
3
|
export type ComputedDataMultiGrid = ComputedDataGrid[]
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import type { ComputedDatumBase, ComputedDatumCategoryValue } from './ComputedData'
|
2
|
-
|
3
|
-
export type ComputedDataMultiValue = ComputedDatumMultiValue[][]
|
4
|
-
|
5
|
-
export interface ComputedDatumMultiValue extends ComputedDatumBase, ComputedDatumCategoryValue {
|
6
|
-
axis: number
|
7
|
-
}
|
8
|
-
|
9
|
-
|
1
|
+
import type { ComputedDatumBase, ComputedDatumCategoryValue } from './ComputedData'
|
2
|
+
|
3
|
+
export type ComputedDataMultiValue = ComputedDatumMultiValue[][]
|
4
|
+
|
5
|
+
export interface ComputedDatumMultiValue extends ComputedDatumBase, ComputedDatumCategoryValue {
|
6
|
+
axis: number
|
7
|
+
}
|
8
|
+
|
9
|
+
|
@@ -1,20 +1,20 @@
|
|
1
|
-
import type { ComputedDatumBase, ComputedDatumCategoryValue } from './ComputedData'
|
2
|
-
|
3
|
-
export type ComputedDataRelationship = {
|
4
|
-
nodes: ComputedNode[]
|
5
|
-
edges: ComputedEdge[]
|
6
|
-
}
|
7
|
-
|
8
|
-
export interface ComputedNode extends ComputedDatumBase, ComputedDatumCategoryValue {
|
9
|
-
startNodes: ComputedNode[]
|
10
|
-
startNodeIds: string[]
|
11
|
-
endNodes: ComputedNode[]
|
12
|
-
endNodeIds: string[]
|
13
|
-
}
|
14
|
-
|
15
|
-
export interface ComputedEdge extends ComputedDatumBase {
|
16
|
-
startNode: ComputedNode
|
17
|
-
startNodeId: string
|
18
|
-
endNode: ComputedNode
|
19
|
-
endNodeId: string
|
1
|
+
import type { ComputedDatumBase, ComputedDatumCategoryValue } from './ComputedData'
|
2
|
+
|
3
|
+
export type ComputedDataRelationship = {
|
4
|
+
nodes: ComputedNode[]
|
5
|
+
edges: ComputedEdge[]
|
6
|
+
}
|
7
|
+
|
8
|
+
export interface ComputedNode extends ComputedDatumBase, ComputedDatumCategoryValue {
|
9
|
+
startNodes: ComputedNode[]
|
10
|
+
startNodeIds: string[]
|
11
|
+
endNodes: ComputedNode[]
|
12
|
+
endNodeIds: string[]
|
13
|
+
}
|
14
|
+
|
15
|
+
export interface ComputedEdge extends ComputedDatumBase {
|
16
|
+
startNode: ComputedNode
|
17
|
+
startNodeId: string
|
18
|
+
endNode: ComputedNode
|
19
|
+
endNodeId: string
|
20
20
|
}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { ComputedDatumBase, ComputedDatumSeriesValue } from './ComputedData'
|
2
|
-
|
3
|
-
export interface ComputedDatumSeries
|
4
|
-
extends ComputedDatumBase, ComputedDatumSeriesValue {
|
5
|
-
|
6
|
-
}
|
7
|
-
|
1
|
+
import { ComputedDatumBase, ComputedDatumSeriesValue } from './ComputedData'
|
2
|
+
|
3
|
+
export interface ComputedDatumSeries
|
4
|
+
extends ComputedDatumBase, ComputedDatumSeriesValue {
|
5
|
+
|
6
|
+
}
|
7
|
+
|
8
8
|
export type ComputedDataSeries = ComputedDatumSeries[][]
|
@@ -1,20 +1,20 @@
|
|
1
|
-
import type { ComputedDatumBase, ComputedDatumCategoryValue } from './ComputedData'
|
2
|
-
|
3
|
-
// export type ComputedDataTree = ComputedDataTreeDatum[]
|
4
|
-
|
5
|
-
// export interface ComputedDataTreeDatum extends ComputedDatum {
|
6
|
-
// // id: string
|
7
|
-
// children: ComputedDataTreeDatum[]
|
8
|
-
// childrenIds: string[]
|
9
|
-
// // ChildrenMap: Map<string, ComputedDataTreeDatum>
|
10
|
-
// parent: ComputedDataTreeDatum
|
11
|
-
// parentId: string
|
12
|
-
// value?: number
|
13
|
-
// }
|
14
|
-
|
15
|
-
// 樹狀結構
|
16
|
-
export interface ComputedDataTree extends ComputedDatumBase, ComputedDatumCategoryValue {
|
17
|
-
level: number
|
18
|
-
seq: number
|
19
|
-
children?: ComputedDataTree[]
|
1
|
+
import type { ComputedDatumBase, ComputedDatumCategoryValue } from './ComputedData'
|
2
|
+
|
3
|
+
// export type ComputedDataTree = ComputedDataTreeDatum[]
|
4
|
+
|
5
|
+
// export interface ComputedDataTreeDatum extends ComputedDatum {
|
6
|
+
// // id: string
|
7
|
+
// children: ComputedDataTreeDatum[]
|
8
|
+
// childrenIds: string[]
|
9
|
+
// // ChildrenMap: Map<string, ComputedDataTreeDatum>
|
10
|
+
// parent: ComputedDataTreeDatum
|
11
|
+
// parentId: string
|
12
|
+
// value?: number
|
13
|
+
// }
|
14
|
+
|
15
|
+
// 樹狀結構
|
16
|
+
export interface ComputedDataTree extends ComputedDatumBase, ComputedDatumCategoryValue {
|
17
|
+
level: number
|
18
|
+
seq: number
|
19
|
+
children?: ComputedDataTree[]
|
20
20
|
}
|
@@ -1,38 +1,38 @@
|
|
1
|
-
import { Observable, Subject, BehaviorSubject } from 'rxjs'
|
2
|
-
import type { ChartType } from './Chart'
|
3
|
-
import type { ChartParams } from './ChartParams'
|
4
|
-
import type { DataFormatterTypeMap } from './DataFormatter'
|
5
|
-
import type { ComputedDataTypeMap } from './ComputedData'
|
6
|
-
import type { Layout } from './Layout'
|
7
|
-
import type { ContextObserverGrid } from './ContextObserverGrid'
|
8
|
-
import type { ContextObserverMultiGrid } from './ContextObserverMultiGrid'
|
9
|
-
import type { ContextObserverMultiValue } from './ContextObserverMultiValue'
|
10
|
-
import type { ContextObserverRelationship } from './ContextObserverRelationship'
|
11
|
-
import type { ContextObserverSeries } from './ContextObserverSeries'
|
12
|
-
import type { ContextObserverTree } from './ContextObserverTree'
|
13
|
-
import type { ContextSubject } from './ContextSubject'
|
14
|
-
|
15
|
-
export interface ContextObserverFn<T extends ChartType> {
|
16
|
-
({ subject, observer }: {
|
17
|
-
subject: ContextSubject<T>
|
18
|
-
observer: ContextObserverBase<T, unknown>
|
19
|
-
}): ContextObserverTypeMap<T, unknown>
|
20
|
-
}
|
21
|
-
|
22
|
-
// ContextObserver
|
23
|
-
export type ContextObserverTypeMap<T extends ChartType, PluginParams> = T extends 'series' ? ContextObserverSeries<PluginParams>
|
24
|
-
: T extends 'grid' ? ContextObserverGrid<PluginParams>
|
25
|
-
: T extends 'multiGrid' ? ContextObserverMultiGrid<PluginParams>
|
26
|
-
: T extends 'multiValue' ? ContextObserverMultiValue<PluginParams>
|
27
|
-
: T extends 'relationship' ? ContextObserverRelationship<PluginParams>
|
28
|
-
: T extends 'tree' ? ContextObserverTree<PluginParams>
|
29
|
-
: ContextObserverBase<ChartType, PluginParams>
|
30
|
-
|
31
|
-
export interface ContextObserverBase<T extends ChartType, PluginParams> {
|
32
|
-
fullParams$: Observable<PluginParams>
|
33
|
-
fullChartParams$: Observable<ChartParams>
|
34
|
-
fullDataFormatter$: Observable<DataFormatterTypeMap<T>>
|
35
|
-
computedData$: Observable<ComputedDataTypeMap<T>>
|
36
|
-
layout$: Observable<Layout>
|
37
|
-
}
|
38
|
-
|
1
|
+
import { Observable, Subject, BehaviorSubject } from 'rxjs'
|
2
|
+
import type { ChartType } from './Chart'
|
3
|
+
import type { ChartParams } from './ChartParams'
|
4
|
+
import type { DataFormatterTypeMap } from './DataFormatter'
|
5
|
+
import type { ComputedDataTypeMap } from './ComputedData'
|
6
|
+
import type { Layout } from './Layout'
|
7
|
+
import type { ContextObserverGrid } from './ContextObserverGrid'
|
8
|
+
import type { ContextObserverMultiGrid } from './ContextObserverMultiGrid'
|
9
|
+
import type { ContextObserverMultiValue } from './ContextObserverMultiValue'
|
10
|
+
import type { ContextObserverRelationship } from './ContextObserverRelationship'
|
11
|
+
import type { ContextObserverSeries } from './ContextObserverSeries'
|
12
|
+
import type { ContextObserverTree } from './ContextObserverTree'
|
13
|
+
import type { ContextSubject } from './ContextSubject'
|
14
|
+
|
15
|
+
export interface ContextObserverFn<T extends ChartType> {
|
16
|
+
({ subject, observer }: {
|
17
|
+
subject: ContextSubject<T>
|
18
|
+
observer: ContextObserverBase<T, unknown>
|
19
|
+
}): ContextObserverTypeMap<T, unknown>
|
20
|
+
}
|
21
|
+
|
22
|
+
// ContextObserver
|
23
|
+
export type ContextObserverTypeMap<T extends ChartType, PluginParams> = T extends 'series' ? ContextObserverSeries<PluginParams>
|
24
|
+
: T extends 'grid' ? ContextObserverGrid<PluginParams>
|
25
|
+
: T extends 'multiGrid' ? ContextObserverMultiGrid<PluginParams>
|
26
|
+
: T extends 'multiValue' ? ContextObserverMultiValue<PluginParams>
|
27
|
+
: T extends 'relationship' ? ContextObserverRelationship<PluginParams>
|
28
|
+
: T extends 'tree' ? ContextObserverTree<PluginParams>
|
29
|
+
: ContextObserverBase<ChartType, PluginParams>
|
30
|
+
|
31
|
+
export interface ContextObserverBase<T extends ChartType, PluginParams> {
|
32
|
+
fullParams$: Observable<PluginParams>
|
33
|
+
fullChartParams$: Observable<ChartParams>
|
34
|
+
fullDataFormatter$: Observable<DataFormatterTypeMap<T>>
|
35
|
+
computedData$: Observable<ComputedDataTypeMap<T>>
|
36
|
+
layout$: Observable<Layout>
|
37
|
+
}
|
38
|
+
|
@@ -1,42 +1,42 @@
|
|
1
|
-
import { Observable } from 'rxjs'
|
2
|
-
import type { ContextObserverBase } from './ContextObserver'
|
3
|
-
import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
|
4
|
-
import type { TransformData } from './TransformData'
|
5
|
-
|
6
|
-
export interface ContextObserverGrid<PluginParams> extends
|
7
|
-
ContextObserverBase<'grid', PluginParams>, ContextObserverGridDetail {
|
8
|
-
textSizePx$: Observable<number>
|
9
|
-
}
|
10
|
-
|
11
|
-
export interface ContextObserverGridDetail {
|
12
|
-
gridContainerPosition$: Observable<GridContainerPosition[]>
|
13
|
-
gridAxesTransform$: Observable<TransformData>
|
14
|
-
gridAxesReverseTransform$: Observable<TransformData>
|
15
|
-
gridGraphicTransform$: Observable<TransformData>
|
16
|
-
gridGraphicReverseScale$: Observable<[number, number][]>
|
17
|
-
gridAxesSize$: Observable<{ width: number; height: number; }>
|
18
|
-
gridHighlight$: Observable<ComputedDatumGrid[]>
|
19
|
-
seriesLabels$: Observable<string[]>
|
20
|
-
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
21
|
-
GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
22
|
-
computedLayoutData$: Observable<ComputedLayoutDataGrid>
|
23
|
-
visibleComputedData$: Observable<ComputedDataGrid>
|
24
|
-
visibleComputedLayoutData$: Observable<ComputedLayoutDataGrid>
|
25
|
-
// isSeriesSeprate$: Observable<boolean>
|
26
|
-
}
|
27
|
-
|
28
|
-
export type ComputedLayoutDataGrid = ComputedLayoutDatumGrid[][]
|
29
|
-
|
30
|
-
export interface ComputedLayoutDatumGrid extends ComputedDatumGrid {
|
31
|
-
axisX: number
|
32
|
-
axisY: number
|
33
|
-
axisYFromZero: number
|
34
|
-
}
|
35
|
-
|
36
|
-
export interface GridContainerPosition {
|
37
|
-
slotIndex: number
|
38
|
-
rowIndex: number
|
39
|
-
columnIndex: number
|
40
|
-
translate: [number, number]
|
41
|
-
scale: [number, number]
|
1
|
+
import { Observable } from 'rxjs'
|
2
|
+
import type { ContextObserverBase } from './ContextObserver'
|
3
|
+
import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
|
4
|
+
import type { TransformData } from './TransformData'
|
5
|
+
|
6
|
+
export interface ContextObserverGrid<PluginParams> extends
|
7
|
+
ContextObserverBase<'grid', PluginParams>, ContextObserverGridDetail {
|
8
|
+
textSizePx$: Observable<number>
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface ContextObserverGridDetail {
|
12
|
+
gridContainerPosition$: Observable<GridContainerPosition[]>
|
13
|
+
gridAxesTransform$: Observable<TransformData>
|
14
|
+
gridAxesReverseTransform$: Observable<TransformData>
|
15
|
+
gridGraphicTransform$: Observable<TransformData>
|
16
|
+
gridGraphicReverseScale$: Observable<[number, number][]>
|
17
|
+
gridAxesSize$: Observable<{ width: number; height: number; }>
|
18
|
+
gridHighlight$: Observable<ComputedDatumGrid[]>
|
19
|
+
seriesLabels$: Observable<string[]>
|
20
|
+
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
21
|
+
GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
22
|
+
computedLayoutData$: Observable<ComputedLayoutDataGrid>
|
23
|
+
visibleComputedData$: Observable<ComputedDataGrid>
|
24
|
+
visibleComputedLayoutData$: Observable<ComputedLayoutDataGrid>
|
25
|
+
// isSeriesSeprate$: Observable<boolean>
|
26
|
+
}
|
27
|
+
|
28
|
+
export type ComputedLayoutDataGrid = ComputedLayoutDatumGrid[][]
|
29
|
+
|
30
|
+
export interface ComputedLayoutDatumGrid extends ComputedDatumGrid {
|
31
|
+
axisX: number
|
32
|
+
axisY: number
|
33
|
+
axisYFromZero: number
|
34
|
+
}
|
35
|
+
|
36
|
+
export interface GridContainerPosition {
|
37
|
+
slotIndex: number
|
38
|
+
rowIndex: number
|
39
|
+
columnIndex: number
|
40
|
+
translate: [number, number]
|
41
|
+
scale: [number, number]
|
42
42
|
}
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import { Observable } from 'rxjs'
|
2
|
-
import type { ContextObserverBase } from './ContextObserver'
|
3
|
-
import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
|
4
|
-
import type { DataFormatterGrid } from './DataFormatterGrid'
|
5
|
-
import type { ContextObserverGridDetail } from './ContextObserverGrid'
|
6
|
-
|
7
|
-
export interface ContextObserverMultiGrid<PluginParams> extends ContextObserverBase<'multiGrid', PluginParams> {
|
8
|
-
textSizePx$: Observable<number>
|
9
|
-
multiGridEachDetail$: Observable<ContextObserverMultiGridDetail[]>
|
10
|
-
}
|
11
|
-
|
12
|
-
|
13
|
-
export interface ContextObserverMultiGridDetail extends ContextObserverGridDetail {
|
14
|
-
computedData$: Observable<ComputedDataGrid>
|
15
|
-
dataFormatter$: Observable<DataFormatterGrid>
|
1
|
+
import { Observable } from 'rxjs'
|
2
|
+
import type { ContextObserverBase } from './ContextObserver'
|
3
|
+
import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
|
4
|
+
import type { DataFormatterGrid } from './DataFormatterGrid'
|
5
|
+
import type { ContextObserverGridDetail } from './ContextObserverGrid'
|
6
|
+
|
7
|
+
export interface ContextObserverMultiGrid<PluginParams> extends ContextObserverBase<'multiGrid', PluginParams> {
|
8
|
+
textSizePx$: Observable<number>
|
9
|
+
multiGridEachDetail$: Observable<ContextObserverMultiGridDetail[]>
|
10
|
+
}
|
11
|
+
|
12
|
+
|
13
|
+
export interface ContextObserverMultiGridDetail extends ContextObserverGridDetail {
|
14
|
+
computedData$: Observable<ComputedDataGrid>
|
15
|
+
dataFormatter$: Observable<DataFormatterGrid>
|
16
16
|
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type { ContextObserverBase } from './ContextObserver'
|
2
|
-
|
3
|
-
export interface ContextObserverMultiValue<PluginParams> extends ContextObserverBase<'multiValue', PluginParams> {
|
4
|
-
|
1
|
+
import type { ContextObserverBase } from './ContextObserver'
|
2
|
+
|
3
|
+
export interface ContextObserverMultiValue<PluginParams> extends ContextObserverBase<'multiValue', PluginParams> {
|
4
|
+
|
5
5
|
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type { ContextObserverBase } from './ContextObserver'
|
2
|
-
|
3
|
-
export interface ContextObserverRelationship<PluginParams> extends ContextObserverBase<'relationship', PluginParams> {
|
4
|
-
|
1
|
+
import type { ContextObserverBase } from './ContextObserver'
|
2
|
+
|
3
|
+
export interface ContextObserverRelationship<PluginParams> extends ContextObserverBase<'relationship', PluginParams> {
|
4
|
+
|
5
5
|
}
|
@@ -1,29 +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
|
-
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
|
+
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
|
+
separateSeries$: 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
|
+
}
|