@orbcharts/core 3.0.0-alpha.38 → 3.0.0-alpha.40
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 +5 -4
- package/dist/orbcharts-core.umd.js +1 -1
- package/dist/src/types/ContextObserverGrid.d.ts +1 -1
- package/dist/src/types/ContextObserverSeries.d.ts +1 -1
- package/dist/src/types/ContextObserverTree.d.ts +1 -1
- package/dist/src/utils/observables.d.ts +5 -5
- 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 +247 -247
- 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 +205 -205
- package/src/grid/createGridContextObserver.ts +124 -124
- package/src/grid/gridObservables.ts +486 -486
- package/src/index.ts +21 -21
- package/src/multiGrid/computeMultiGridData.ts +173 -173
- package/src/multiGrid/createMultiGridContextObserver.ts +34 -34
- package/src/multiGrid/multiGridObservables.ts +285 -285
- package/src/multiValue/computeMultiValueData.ts +136 -136
- package/src/multiValue/createMultiValueContextObserver.ts +12 -12
- package/src/relationship/computeRelationshipData.ts +106 -106
- package/src/relationship/createRelationshipContextObserver.ts +12 -12
- package/src/series/computeSeriesData.ts +153 -153
- package/src/series/createSeriesContextObserver.ts +33 -33
- package/src/series/seriesObservables.ts +23 -23
- package/src/tree/computeTreeData.ts +128 -128
- package/src/tree/createTreeContextObserver.ts +56 -56
- 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 +82 -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 +7 -7
- package/src/types/ComputedDataTree.ts +19 -19
- package/src/types/ContextObserver.ts +38 -38
- package/src/types/ContextObserverGrid.ts +33 -33
- package/src/types/ContextObserverMultiGrid.ts +27 -27
- package/src/types/ContextObserverMultiValue.ts +4 -4
- package/src/types/ContextObserverRelationship.ts +4 -4
- package/src/types/ContextObserverSeries.ts +7 -7
- package/src/types/ContextObserverTree.ts +10 -10
- package/src/types/ContextSubject.ts +18 -18
- package/src/types/Data.ts +45 -45
- package/src/types/DataFormatter.ts +95 -95
- package/src/types/DataFormatterGrid.ts +55 -55
- package/src/types/DataFormatterMultiGrid.ts +42 -42
- package/src/types/DataFormatterMultiValue.ts +20 -20
- package/src/types/DataFormatterRelationship.ts +22 -22
- package/src/types/DataFormatterSeries.ts +29 -29
- 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 +181 -181
- package/src/utils/orbchartsUtils.ts +253 -253
- package/tsconfig.json +13 -13
- package/vite.config.js +44 -44
package/src/types/ChartParams.ts
CHANGED
@@ -1,51 +1,51 @@
|
|
1
|
-
import type { Padding } from './Padding'
|
2
|
-
|
3
|
-
export interface ChartParams {
|
4
|
-
padding: Padding,
|
5
|
-
highlightTarget: HighlightTarget
|
6
|
-
highlightDefault: string | null
|
7
|
-
colorScheme: 'dark' | 'light'
|
8
|
-
colors: {
|
9
|
-
light: ColorScheme
|
10
|
-
dark: ColorScheme
|
11
|
-
}
|
12
|
-
styles: Styles
|
13
|
-
transitionDuration: number
|
14
|
-
transitionEase: string
|
15
|
-
// [key: string]: any
|
16
|
-
}
|
17
|
-
|
18
|
-
export type ChartParamsPartial = Partial<ChartParams | {
|
19
|
-
padding: Partial<Padding>,
|
20
|
-
colors: Partial<{
|
21
|
-
light: Partial<ColorScheme>
|
22
|
-
dark: Partial<ColorScheme>
|
23
|
-
}>
|
24
|
-
styles: Partial<Styles>
|
25
|
-
}>
|
26
|
-
|
27
|
-
function test (): ChartParamsPartial {
|
28
|
-
return {
|
29
|
-
colorScheme: 'dark',
|
30
|
-
padding: {
|
31
|
-
top: 10
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
export type HighlightTarget = 'series' | 'group' | 'category' | 'datum' | 'none'
|
37
|
-
|
38
|
-
export interface Styles {
|
39
|
-
textSize: number
|
40
|
-
unhighlightedOpacity: number
|
41
|
-
}
|
42
|
-
|
43
|
-
export interface ColorScheme {
|
44
|
-
series: string[]
|
45
|
-
primary: string
|
46
|
-
secondary: string
|
47
|
-
white: string
|
48
|
-
background: string
|
49
|
-
}
|
50
|
-
|
51
|
-
export type ColorType = 'none' | keyof ColorScheme
|
1
|
+
import type { Padding } from './Padding'
|
2
|
+
|
3
|
+
export interface ChartParams {
|
4
|
+
padding: Padding,
|
5
|
+
highlightTarget: HighlightTarget
|
6
|
+
highlightDefault: string | null
|
7
|
+
colorScheme: 'dark' | 'light'
|
8
|
+
colors: {
|
9
|
+
light: ColorScheme
|
10
|
+
dark: ColorScheme
|
11
|
+
}
|
12
|
+
styles: Styles
|
13
|
+
transitionDuration: number
|
14
|
+
transitionEase: string
|
15
|
+
// [key: string]: any
|
16
|
+
}
|
17
|
+
|
18
|
+
export type ChartParamsPartial = Partial<ChartParams | {
|
19
|
+
padding: Partial<Padding>,
|
20
|
+
colors: Partial<{
|
21
|
+
light: Partial<ColorScheme>
|
22
|
+
dark: Partial<ColorScheme>
|
23
|
+
}>
|
24
|
+
styles: Partial<Styles>
|
25
|
+
}>
|
26
|
+
|
27
|
+
function test (): ChartParamsPartial {
|
28
|
+
return {
|
29
|
+
colorScheme: 'dark',
|
30
|
+
padding: {
|
31
|
+
top: 10
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
export type HighlightTarget = 'series' | 'group' | 'category' | 'datum' | 'none'
|
37
|
+
|
38
|
+
export interface Styles {
|
39
|
+
textSize: number
|
40
|
+
unhighlightedOpacity: number
|
41
|
+
}
|
42
|
+
|
43
|
+
export interface ColorScheme {
|
44
|
+
series: string[]
|
45
|
+
primary: string
|
46
|
+
secondary: string
|
47
|
+
white: string
|
48
|
+
background: string
|
49
|
+
}
|
50
|
+
|
51
|
+
export type ColorType = 'none' | keyof ColorScheme
|
@@ -1,83 +1,83 @@
|
|
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
|
-
}
|
49
|
-
|
50
|
-
// datum - 矩陣資料
|
51
|
-
export interface ComputedDatumGridValue {
|
52
|
-
gridIndex: number
|
53
|
-
color: string
|
54
|
-
seriesIndex: number
|
55
|
-
seriesLabel: string
|
56
|
-
groupIndex: number
|
57
|
-
groupLabel: string
|
58
|
-
}
|
59
|
-
|
60
|
-
// datum - 類別資料
|
61
|
-
export interface ComputedDatumCategoryValue {
|
62
|
-
color: string
|
63
|
-
categoryIndex: number
|
64
|
-
categoryLabel: string | null
|
65
|
-
}
|
66
|
-
|
67
|
-
// 透過類型選擇ComputedData
|
68
|
-
export type ComputedDataTypeMap<T extends ChartType> = T extends 'series' ? ComputedDataSeries
|
69
|
-
: T extends 'grid' ? ComputedDataGrid
|
70
|
-
: T extends 'multiGrid' ? ComputedDataMultiGrid
|
71
|
-
: T extends 'multiValue' ? ComputedDataMultiValue
|
72
|
-
: T extends 'relationship' ? ComputedDataRelationship
|
73
|
-
: T extends 'tree' ? ComputedDataTree
|
74
|
-
: ComputedDatumBase
|
75
|
-
|
76
|
-
// 透過類型選擇ComputedDatum
|
77
|
-
export type ComputedDatumTypeMap<T extends ChartType> = T extends 'series' ? ComputedDatumSeries
|
78
|
-
: T extends 'grid' ? ComputedDatumGrid
|
79
|
-
: T extends 'multiGrid' ? ComputedDatumGrid
|
80
|
-
: T extends 'multiValue' ? ComputedDatumMultiValue
|
81
|
-
: T extends 'relationship' ? ComputedNode
|
82
|
-
: 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
|
+
}
|
49
|
+
|
50
|
+
// datum - 矩陣資料
|
51
|
+
export interface ComputedDatumGridValue {
|
52
|
+
gridIndex: number
|
53
|
+
color: string
|
54
|
+
seriesIndex: number
|
55
|
+
seriesLabel: string
|
56
|
+
groupIndex: number
|
57
|
+
groupLabel: string
|
58
|
+
}
|
59
|
+
|
60
|
+
// datum - 類別資料
|
61
|
+
export interface ComputedDatumCategoryValue {
|
62
|
+
color: string
|
63
|
+
categoryIndex: number
|
64
|
+
categoryLabel: string | null
|
65
|
+
}
|
66
|
+
|
67
|
+
// 透過類型選擇ComputedData
|
68
|
+
export type ComputedDataTypeMap<T extends ChartType> = T extends 'series' ? ComputedDataSeries
|
69
|
+
: T extends 'grid' ? ComputedDataGrid
|
70
|
+
: T extends 'multiGrid' ? ComputedDataMultiGrid
|
71
|
+
: T extends 'multiValue' ? ComputedDataMultiValue
|
72
|
+
: T extends 'relationship' ? ComputedDataRelationship
|
73
|
+
: T extends 'tree' ? ComputedDataTree
|
74
|
+
: ComputedDatumBase
|
75
|
+
|
76
|
+
// 透過類型選擇ComputedDatum
|
77
|
+
export type ComputedDatumTypeMap<T extends ChartType> = T extends 'series' ? ComputedDatumSeries
|
78
|
+
: T extends 'grid' ? ComputedDatumGrid
|
79
|
+
: T extends 'multiGrid' ? ComputedDatumGrid
|
80
|
+
: T extends 'multiValue' ? ComputedDatumMultiValue
|
81
|
+
: T extends 'relationship' ? ComputedNode
|
82
|
+
: T extends 'tree' ? ComputedDataTree
|
83
83
|
: 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
|
-
sortedIndex: number
|
6
|
-
}
|
7
|
-
|
1
|
+
import { ComputedDatumBase, ComputedDatumSeriesValue } from './ComputedData'
|
2
|
+
|
3
|
+
export interface ComputedDatumSeries
|
4
|
+
extends ComputedDatumBase, ComputedDatumSeriesValue {
|
5
|
+
sortedIndex: number
|
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,34 +1,34 @@
|
|
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>
|
7
|
-
extends
|
8
|
-
ContextObserverBase<'grid', PluginParams>,
|
9
|
-
ContextObserverGridDetail {
|
10
|
-
|
11
|
-
}
|
12
|
-
|
13
|
-
export interface ContextObserverGridDetail {
|
14
|
-
gridContainer$: Observable<ContainerPosition[]>
|
15
|
-
gridAxesTransform$: Observable<TransformData>
|
16
|
-
gridAxesReverseTransform$: Observable<TransformData>
|
17
|
-
gridGraphicTransform$: Observable<TransformData>
|
18
|
-
gridGraphicReverseScale$: Observable<[number, number][]>
|
19
|
-
gridAxesSize$: Observable<{ width: number; height: number; }>
|
20
|
-
gridHighlight$: Observable<
|
21
|
-
existSeriesLabels$: Observable<string[]>
|
22
|
-
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
23
|
-
GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
24
|
-
visibleComputedData$: Observable<ComputedDataGrid>
|
25
|
-
isSeriesPositionSeprate$: Observable<boolean>
|
26
|
-
}
|
27
|
-
|
28
|
-
export interface ContainerPosition {
|
29
|
-
slotIndex: number
|
30
|
-
rowIndex: number
|
31
|
-
columnIndex: number
|
32
|
-
translate: [number, number]
|
33
|
-
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>
|
7
|
+
extends
|
8
|
+
ContextObserverBase<'grid', PluginParams>,
|
9
|
+
ContextObserverGridDetail {
|
10
|
+
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface ContextObserverGridDetail {
|
14
|
+
gridContainer$: Observable<ContainerPosition[]>
|
15
|
+
gridAxesTransform$: Observable<TransformData>
|
16
|
+
gridAxesReverseTransform$: Observable<TransformData>
|
17
|
+
gridGraphicTransform$: Observable<TransformData>
|
18
|
+
gridGraphicReverseScale$: Observable<[number, number][]>
|
19
|
+
gridAxesSize$: Observable<{ width: number; height: number; }>
|
20
|
+
gridHighlight$: Observable<ComputedDatumGrid[]>
|
21
|
+
existSeriesLabels$: Observable<string[]>
|
22
|
+
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
23
|
+
GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
24
|
+
visibleComputedData$: Observable<ComputedDataGrid>
|
25
|
+
isSeriesPositionSeprate$: Observable<boolean>
|
26
|
+
}
|
27
|
+
|
28
|
+
export interface ContainerPosition {
|
29
|
+
slotIndex: number
|
30
|
+
rowIndex: number
|
31
|
+
columnIndex: number
|
32
|
+
translate: [number, number]
|
33
|
+
scale: [number, number]
|
34
34
|
}
|
@@ -1,27 +1,27 @@
|
|
1
|
-
import { Observable } from 'rxjs'
|
2
|
-
import type { ContextObserverBase } from './ContextObserver'
|
3
|
-
import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
|
4
|
-
import type { ContainerPosition } from './ContextObserverGrid'
|
5
|
-
import type { TransformData } from './TransformData'
|
6
|
-
import type { ContextObserverGridDetail } from './ContextObserverGrid'
|
7
|
-
|
8
|
-
export interface ContextObserverMultiGrid<PluginParams> extends ContextObserverBase<'multiGrid', PluginParams> {
|
9
|
-
multiGridEachDetail$: Observable<ContextObserverGridDetail[]>
|
10
|
-
multiGridContainer$: Observable<ContainerPosition[][]>
|
11
|
-
}
|
12
|
-
|
13
|
-
// export interface MultiGridObservableAll {
|
14
|
-
// isSeriesPositionSeprate$: Observable<boolean>
|
15
|
-
// gridContainer$: Observable<ContainerPosition[]>
|
16
|
-
// gridAxesTransform$: Observable<TransformData>
|
17
|
-
// gridAxesReverseTransform$: Observable<TransformData>
|
18
|
-
// gridGraphicTransform$: Observable<TransformData>
|
19
|
-
// gridGraphicReverseScale$: Observable<[number, number][]>
|
20
|
-
// gridAxesSize$: Observable<{ width: number; height: number; }>
|
21
|
-
// gridHighlight$: Observable<string[]>
|
22
|
-
// existSeriesLabels$: Observable<string[]>
|
23
|
-
// SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
24
|
-
// GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
25
|
-
// visibleComputedData$: Observable<ComputedDataGrid>
|
26
|
-
// }
|
27
|
-
|
1
|
+
import { Observable } from 'rxjs'
|
2
|
+
import type { ContextObserverBase } from './ContextObserver'
|
3
|
+
import type { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid'
|
4
|
+
import type { ContainerPosition } from './ContextObserverGrid'
|
5
|
+
import type { TransformData } from './TransformData'
|
6
|
+
import type { ContextObserverGridDetail } from './ContextObserverGrid'
|
7
|
+
|
8
|
+
export interface ContextObserverMultiGrid<PluginParams> extends ContextObserverBase<'multiGrid', PluginParams> {
|
9
|
+
multiGridEachDetail$: Observable<ContextObserverGridDetail[]>
|
10
|
+
multiGridContainer$: Observable<ContainerPosition[][]>
|
11
|
+
}
|
12
|
+
|
13
|
+
// export interface MultiGridObservableAll {
|
14
|
+
// isSeriesPositionSeprate$: Observable<boolean>
|
15
|
+
// gridContainer$: Observable<ContainerPosition[]>
|
16
|
+
// gridAxesTransform$: Observable<TransformData>
|
17
|
+
// gridAxesReverseTransform$: Observable<TransformData>
|
18
|
+
// gridGraphicTransform$: Observable<TransformData>
|
19
|
+
// gridGraphicReverseScale$: Observable<[number, number][]>
|
20
|
+
// gridAxesSize$: Observable<{ width: number; height: number; }>
|
21
|
+
// gridHighlight$: Observable<string[]>
|
22
|
+
// existSeriesLabels$: Observable<string[]>
|
23
|
+
// SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
24
|
+
// GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
25
|
+
// visibleComputedData$: Observable<ComputedDataGrid>
|
26
|
+
// }
|
27
|
+
|
@@ -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
|
}
|