@orbcharts/core 3.0.0-alpha.41 → 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 +1906 -1897
- 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,130 +1,147 @@
|
|
1
|
-
import { map, shareReplay } from 'rxjs'
|
2
|
-
import type { ContextObserverFn } from '../types'
|
3
|
-
import {
|
4
|
-
highlightObservable,
|
5
|
-
seriesDataMapObservable,
|
6
|
-
groupDataMapObservable,
|
7
|
-
textSizePxObservable } from '../utils/observables'
|
8
|
-
import {
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
1
|
+
import { map, shareReplay } from 'rxjs'
|
2
|
+
import type { ContextObserverFn } from '../types'
|
3
|
+
import {
|
4
|
+
highlightObservable,
|
5
|
+
seriesDataMapObservable,
|
6
|
+
groupDataMapObservable,
|
7
|
+
textSizePxObservable } from '../utils/observables'
|
8
|
+
import {
|
9
|
+
gridComputedLayoutDataObservable,
|
10
|
+
gridAxesTransformObservable,
|
11
|
+
gridAxesReverseTransformObservable,
|
12
|
+
gridGraphicTransformObservable,
|
13
|
+
gridGraphicReverseScaleObservable,
|
14
|
+
gridAxesSizeObservable,
|
15
|
+
seriesLabelsObservable,
|
16
|
+
gridVisibleComputedDataObservable,
|
17
|
+
gridVisibleComputedLayoutDataObservable,
|
18
|
+
// isSeriesSeprateObservable,
|
19
|
+
gridContainerPositionObservable } from './gridObservables'
|
20
|
+
|
21
|
+
export const createGridContextObserver: ContextObserverFn<'grid'> = ({ subject, observer }) => {
|
22
|
+
|
23
|
+
const textSizePx$ = textSizePxObservable(observer.fullChartParams$).pipe(
|
24
|
+
shareReplay(1)
|
25
|
+
)
|
26
|
+
|
27
|
+
// const isSeriesSeprate$ = isSeriesSeprateObservable({
|
28
|
+
// computedData$: observer.computedData$,
|
29
|
+
// fullDataFormatter$: observer.fullDataFormatter$
|
30
|
+
// }).pipe(
|
31
|
+
// shareReplay(1)
|
32
|
+
// )
|
33
|
+
|
34
|
+
const gridContainerPosition$ = gridContainerPositionObservable({
|
35
|
+
computedData$: observer.computedData$,
|
36
|
+
fullDataFormatter$: observer.fullDataFormatter$,
|
37
|
+
layout$: observer.layout$,
|
38
|
+
})
|
39
|
+
|
40
|
+
const gridAxesTransform$ = gridAxesTransformObservable({
|
41
|
+
fullDataFormatter$: observer.fullDataFormatter$,
|
42
|
+
layout$: observer.layout$
|
43
|
+
}).pipe(
|
44
|
+
shareReplay(1)
|
45
|
+
)
|
46
|
+
|
47
|
+
const gridAxesReverseTransform$ = gridAxesReverseTransformObservable({
|
48
|
+
gridAxesTransform$
|
49
|
+
}).pipe(
|
50
|
+
shareReplay(1)
|
51
|
+
)
|
52
|
+
|
53
|
+
const gridGraphicTransform$ = gridGraphicTransformObservable({
|
54
|
+
computedData$: observer.computedData$,
|
55
|
+
fullDataFormatter$: observer.fullDataFormatter$,
|
56
|
+
layout$: observer.layout$
|
57
|
+
}).pipe(
|
58
|
+
shareReplay(1)
|
59
|
+
)
|
60
|
+
|
61
|
+
const gridGraphicReverseScale$ = gridGraphicReverseScaleObservable({
|
62
|
+
gridContainerPosition$: gridContainerPosition$,
|
63
|
+
gridAxesTransform$: gridAxesTransform$,
|
64
|
+
gridGraphicTransform$: gridGraphicTransform$,
|
65
|
+
})
|
66
|
+
|
67
|
+
const gridAxesSize$ = gridAxesSizeObservable({
|
68
|
+
fullDataFormatter$: observer.fullDataFormatter$,
|
69
|
+
layout$: observer.layout$
|
70
|
+
}).pipe(
|
71
|
+
shareReplay(1)
|
72
|
+
)
|
73
|
+
|
74
|
+
const datumList$ = observer.computedData$.pipe(
|
75
|
+
map(d => d.flat())
|
76
|
+
).pipe(
|
77
|
+
shareReplay(1)
|
78
|
+
)
|
79
|
+
|
80
|
+
const gridHighlight$ = highlightObservable({
|
81
|
+
datumList$,
|
82
|
+
fullChartParams$: observer.fullChartParams$,
|
83
|
+
event$: subject.event$
|
84
|
+
}).pipe(
|
85
|
+
shareReplay(1)
|
86
|
+
)
|
87
|
+
|
88
|
+
const seriesLabels$ = seriesLabelsObservable({
|
89
|
+
computedData$: observer.computedData$,
|
90
|
+
})
|
91
|
+
|
92
|
+
const SeriesDataMap$ = seriesDataMapObservable({
|
93
|
+
datumList$: datumList$
|
94
|
+
}).pipe(
|
95
|
+
shareReplay(1)
|
96
|
+
)
|
97
|
+
|
98
|
+
const GroupDataMap$ = groupDataMapObservable({
|
99
|
+
datumList$: datumList$
|
100
|
+
}).pipe(
|
101
|
+
shareReplay(1)
|
102
|
+
)
|
103
|
+
|
104
|
+
const computedLayoutData$ = gridComputedLayoutDataObservable({
|
105
|
+
computedData$: observer.computedData$,
|
106
|
+
fullDataFormatter$: observer.fullDataFormatter$,
|
107
|
+
layout$: observer.layout$,
|
108
|
+
}).pipe(
|
109
|
+
shareReplay(1)
|
110
|
+
)
|
111
|
+
|
112
|
+
const visibleComputedData$ = gridVisibleComputedDataObservable({
|
113
|
+
computedData$: observer.computedData$,
|
114
|
+
}).pipe(
|
115
|
+
shareReplay(1)
|
116
|
+
)
|
117
|
+
|
118
|
+
const visibleComputedLayoutData$ = gridVisibleComputedLayoutDataObservable({
|
119
|
+
computedLayoutData$: computedLayoutData$,
|
120
|
+
}).pipe(
|
121
|
+
shareReplay(1)
|
122
|
+
)
|
123
|
+
|
124
|
+
|
125
|
+
return {
|
126
|
+
fullParams$: observer.fullParams$,
|
127
|
+
fullChartParams$: observer.fullChartParams$,
|
128
|
+
fullDataFormatter$: observer.fullDataFormatter$,
|
129
|
+
computedData$: observer.computedData$,
|
130
|
+
layout$: observer.layout$,
|
131
|
+
textSizePx$,
|
132
|
+
// isSeriesSeprate$,
|
133
|
+
gridContainerPosition$,
|
134
|
+
gridAxesTransform$,
|
135
|
+
gridAxesReverseTransform$,
|
136
|
+
gridGraphicTransform$,
|
137
|
+
gridGraphicReverseScale$,
|
138
|
+
gridAxesSize$,
|
139
|
+
gridHighlight$,
|
140
|
+
seriesLabels$,
|
141
|
+
SeriesDataMap$,
|
142
|
+
GroupDataMap$,
|
143
|
+
computedLayoutData$,
|
144
|
+
visibleComputedData$,
|
145
|
+
visibleComputedLayoutData$,
|
146
|
+
}
|
147
|
+
}
|