@orbcharts/plugins-basic 3.0.0-alpha.34 → 3.0.0-alpha.36
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/orbcharts-plugins-basic.es.js +10136 -9414
- package/dist/orbcharts-plugins-basic.umd.js +10 -10
- package/dist/src/base/BaseBarStack.d.ts +5 -1
- package/dist/src/base/BaseBars.d.ts +5 -1
- package/dist/src/base/BaseBarsTriangle.d.ts +5 -1
- package/dist/src/base/BaseDots.d.ts +4 -1
- package/dist/src/base/BaseGroupAxis.d.ts +35 -0
- package/dist/src/base/BaseLines.d.ts +3 -1
- package/dist/src/base/BaseValueAxis.d.ts +36 -0
- package/dist/src/grid/defaults.d.ts +3 -3
- package/dist/src/grid/gridObservables.d.ts +18 -4
- package/dist/src/grid/index.d.ts +1 -1
- package/dist/src/grid/plugins/GroupAux.d.ts +3 -0
- package/dist/src/grid/plugins/GroupAxis.d.ts +1 -3
- package/dist/src/grid/plugins/ValueAxis.d.ts +1 -3
- package/dist/src/grid/plugins/ValueStackAxis.d.ts +1 -3
- package/dist/src/grid/types.d.ts +1 -1
- package/dist/src/multiGrid/defaults.d.ts +9 -2
- package/dist/src/multiGrid/index.d.ts +8 -1
- package/dist/src/multiGrid/multiGridObservables.d.ts +12 -0
- package/dist/src/multiGrid/plugins/MultiBarStack.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiBars.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiBarsTriangle.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiDots.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiGroupAxis.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiLines.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiValueAxis.d.ts +1 -0
- package/dist/src/multiGrid/plugins/OverlappingValueAxes.d.ts +1 -0
- package/dist/src/multiGrid/types.d.ts +31 -0
- package/package.json +2 -2
- package/src/base/BaseBarStack.ts +375 -198
- package/src/base/BaseBars.ts +297 -191
- package/src/base/BaseBarsTriangle.ts +344 -229
- package/src/base/BaseDots.ts +285 -117
- package/src/base/BaseGroupAxis.ts +497 -0
- package/src/base/BaseLegend.ts +54 -5
- package/src/base/BaseLines.ts +180 -50
- package/src/base/BaseValueAxis.ts +475 -0
- package/src/grid/defaults.ts +3 -3
- package/src/grid/gridObservables.ts +163 -14
- package/src/grid/index.ts +1 -1
- package/src/grid/plugins/BarStack.ts +4 -0
- package/src/grid/plugins/Bars.ts +4 -0
- package/src/grid/plugins/BarsTriangle.ts +4 -0
- package/src/grid/plugins/Dots.ts +3 -0
- package/src/grid/plugins/{GroupArea.ts → GroupAux.ts} +24 -24
- package/src/grid/plugins/GroupAxis.ts +16 -348
- package/src/grid/plugins/Lines.ts +2 -0
- package/src/grid/plugins/ScalingArea.ts +9 -6
- package/src/grid/plugins/ValueAxis.ts +13 -337
- package/src/grid/plugins/ValueStackAxis.ts +35 -336
- package/src/grid/types.ts +1 -1
- package/src/index.ts +1 -0
- package/src/multiGrid/defaults.ts +120 -14
- package/src/multiGrid/index.ts +9 -2
- package/src/multiGrid/multiGridObservables.ts +279 -0
- package/src/multiGrid/plugins/MultiBarStack.ts +60 -0
- package/src/multiGrid/plugins/MultiBars.ts +59 -0
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +58 -0
- package/src/multiGrid/plugins/MultiDots.ts +58 -0
- package/src/multiGrid/plugins/MultiGridLegend.ts +2 -7
- package/src/multiGrid/plugins/MultiGroupAxis.ts +53 -0
- package/src/multiGrid/plugins/MultiLines.ts +58 -0
- package/src/multiGrid/plugins/MultiValueAxis.ts +53 -0
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +165 -0
- package/src/multiGrid/types.ts +39 -0
- package/tsconfig.dev.json +17 -0
- package/tsconfig.prod.json +14 -0
- package/vite.config.js +5 -0
- package/dist/src/grid/plugins/GroupArea.d.ts +0 -3
- package/dist/src/multiGrid/plugins/BarsAndLines.d.ts +0 -1
- package/dist/src/multiGrid/plugins/FirstGroupScaleAxis.d.ts +0 -0
- package/dist/src/multiGrid/plugins/TwoValueScaleAxes.d.ts +0 -0
- package/src/multiGrid/plugins/BarStackAndLines.ts +0 -0
- package/src/multiGrid/plugins/BarsAndLines.ts +0 -126
- package/src/multiGrid/plugins/BarsTriangleAndLines.ts +0 -0
- package/src/multiGrid/plugins/FirstGroupScaleAxis.ts +0 -0
- package/src/multiGrid/plugins/TwoValueScaleAxes.ts +0 -0
- /package/dist/src/{multiGrid/plugins/BarStackAndLines.d.ts → base/BaseGroupArea.d.ts} +0 -0
- /package/{dist/src/multiGrid/plugins/BarsTriangleAndLines.d.ts → src/base/BaseGroupArea.ts} +0 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
import * as d3 from 'd3'
|
2
|
+
import {
|
3
|
+
Subject } from 'rxjs'
|
4
|
+
import {
|
5
|
+
defineMultiGridPlugin } from '@orbcharts/core'
|
6
|
+
import { DEFAULT_MULTI_VALUE_AXIS_PARAMS } from '../defaults'
|
7
|
+
import { createBaseValueAxis } from '../../base/BaseValueAxis'
|
8
|
+
import { multiGridDetailObservables } from '../multiGridObservables'
|
9
|
+
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
10
|
+
|
11
|
+
const pluginName = 'MultiValueAxis'
|
12
|
+
|
13
|
+
const gridClassName = getClassName(pluginName, 'grid')
|
14
|
+
|
15
|
+
export const MultiValueAxis = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_VALUE_AXIS_PARAMS)(({ selection, name, subject, observer }) => {
|
16
|
+
const destroy$ = new Subject()
|
17
|
+
|
18
|
+
const unsubscribeFnArr: (() => void)[] = []
|
19
|
+
|
20
|
+
const multiGridPlugin$ = multiGridDetailObservables(observer)
|
21
|
+
|
22
|
+
multiGridPlugin$.subscribe(data => {
|
23
|
+
// 每次重新計算時,清除之前的訂閱
|
24
|
+
unsubscribeFnArr.forEach(fn => fn())
|
25
|
+
|
26
|
+
selection.selectAll(`g.${gridClassName}`)
|
27
|
+
.data(data)
|
28
|
+
.join('g')
|
29
|
+
.attr('class', gridClassName)
|
30
|
+
.each((d, i, g) => {
|
31
|
+
|
32
|
+
const gridSelection = d3.select(g[i])
|
33
|
+
|
34
|
+
unsubscribeFnArr[i] = createBaseValueAxis(pluginName, {
|
35
|
+
selection: gridSelection,
|
36
|
+
computedData$: d.gridComputedData$,
|
37
|
+
fullParams$: observer.fullParams$,
|
38
|
+
fullDataFormatter$: d.gridDataFormatter$,
|
39
|
+
fullChartParams$: observer.fullChartParams$,
|
40
|
+
gridAxesTransform$: d.gridAxesTransform$,
|
41
|
+
gridAxesReverseTransform$: d.gridAxesReverseTransform$,
|
42
|
+
gridAxesSize$: d.gridAxesSize$,
|
43
|
+
gridContainer$: d.gridContainer$,
|
44
|
+
isSeriesPositionSeprate$: d.isSeriesPositionSeprate$,
|
45
|
+
})
|
46
|
+
})
|
47
|
+
})
|
48
|
+
|
49
|
+
return () => {
|
50
|
+
destroy$.next(undefined)
|
51
|
+
unsubscribeFnArr.forEach(fn => fn())
|
52
|
+
}
|
53
|
+
})
|
@@ -0,0 +1,165 @@
|
|
1
|
+
import * as d3 from 'd3'
|
2
|
+
import {
|
3
|
+
of,
|
4
|
+
map,
|
5
|
+
switchMap,
|
6
|
+
combineLatest,
|
7
|
+
takeUntil,
|
8
|
+
iif,
|
9
|
+
Observable,
|
10
|
+
Subject } from 'rxjs'
|
11
|
+
import type { ContextObserverMultiGrid, DataFormatterGrid } from '@orbcharts/core'
|
12
|
+
import {
|
13
|
+
defineMultiGridPlugin } from '@orbcharts/core'
|
14
|
+
import { DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS } from '../defaults'
|
15
|
+
import { createBaseValueAxis } from '../../base/BaseValueAxis'
|
16
|
+
import { multiGridDetailObservables } from '../multiGridObservables'
|
17
|
+
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
18
|
+
// @Q@
|
19
|
+
import { gridAxesTransformObservable, gridAxesReverseTransformObservable, gridContainerObservable } from '@orbcharts/core/src/grid/gridObservables'
|
20
|
+
|
21
|
+
const pluginName = 'OverlappingValueAxes'
|
22
|
+
|
23
|
+
const gridClassName = getClassName(pluginName, 'grid')
|
24
|
+
|
25
|
+
export const OverlappingValueAxes = defineMultiGridPlugin(pluginName, DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS)(({ selection, name, subject, observer }) => {
|
26
|
+
const destroy$ = new Subject()
|
27
|
+
|
28
|
+
const unsubscribeFnArr: (() => void)[] = []
|
29
|
+
|
30
|
+
const firstGridIndex$ = observer.fullParams$.pipe(
|
31
|
+
takeUntil(destroy$),
|
32
|
+
map(fullParams => fullParams.gridIndexes[0])
|
33
|
+
)
|
34
|
+
|
35
|
+
const secondGridIndex$ = observer.fullParams$.pipe(
|
36
|
+
takeUntil(destroy$),
|
37
|
+
map(fullParams => fullParams.gridIndexes[1])
|
38
|
+
)
|
39
|
+
|
40
|
+
// 為了要反轉第二個valueAxis的位置所以要重新計算
|
41
|
+
const secondGridDataFormatter$: Observable<DataFormatterGrid> = combineLatest({
|
42
|
+
firstGridIndex: firstGridIndex$,
|
43
|
+
secondGridIndex: secondGridIndex$
|
44
|
+
}).pipe(
|
45
|
+
takeUntil(destroy$),
|
46
|
+
switchMap(data => {
|
47
|
+
return observer.fullDataFormatter$.pipe(
|
48
|
+
takeUntil(destroy$),
|
49
|
+
map(fullDataFormatter => {
|
50
|
+
if (!fullDataFormatter.gridList[data.secondGridIndex]) {
|
51
|
+
fullDataFormatter.gridList[data.secondGridIndex] = Object.assign({}, fullDataFormatter.gridList[data.firstGridIndex])
|
52
|
+
}
|
53
|
+
// 反轉第二個valueAxis的位置
|
54
|
+
let reversePosition = ''
|
55
|
+
if (fullDataFormatter.gridList[data.firstGridIndex].valueAxis.position === 'left') {
|
56
|
+
reversePosition = 'right'
|
57
|
+
} else if (fullDataFormatter.gridList[data.firstGridIndex].valueAxis.position === 'bottom') {
|
58
|
+
reversePosition = 'top'
|
59
|
+
} else if (fullDataFormatter.gridList[data.firstGridIndex].valueAxis.position === 'top') {
|
60
|
+
reversePosition = 'bottom'
|
61
|
+
} else if (fullDataFormatter.gridList[data.firstGridIndex].valueAxis.position === 'right') {
|
62
|
+
reversePosition = 'left'
|
63
|
+
}
|
64
|
+
console.log('reversePosition', reversePosition)
|
65
|
+
return <DataFormatterGrid>{
|
66
|
+
type: 'grid',
|
67
|
+
grid: {
|
68
|
+
...fullDataFormatter.gridList[data.secondGridIndex],
|
69
|
+
valueAxis: {
|
70
|
+
...fullDataFormatter.gridList[data.secondGridIndex].valueAxis,
|
71
|
+
position: reversePosition
|
72
|
+
}
|
73
|
+
},
|
74
|
+
container: {
|
75
|
+
...fullDataFormatter.container
|
76
|
+
}
|
77
|
+
}
|
78
|
+
})
|
79
|
+
)
|
80
|
+
}),
|
81
|
+
)
|
82
|
+
|
83
|
+
const multiGridPlugin$ = of(observer).pipe(
|
84
|
+
takeUntil(destroy$),
|
85
|
+
map(observer => {
|
86
|
+
// 將observer的gridIndexes限制在2個
|
87
|
+
return {
|
88
|
+
...observer,
|
89
|
+
fullParams$: observer.fullParams$.pipe(
|
90
|
+
map(fullParams => {
|
91
|
+
if (fullParams.gridIndexes.length > 2) {
|
92
|
+
fullParams.gridIndexes.length = 2
|
93
|
+
}
|
94
|
+
return fullParams
|
95
|
+
})
|
96
|
+
)
|
97
|
+
}
|
98
|
+
}),
|
99
|
+
switchMap(observer => multiGridDetailObservables(observer)),
|
100
|
+
map(data => {
|
101
|
+
return data.map((observables, index) => {
|
102
|
+
if (index === 0) {
|
103
|
+
return observables
|
104
|
+
}
|
105
|
+
// index === 1,將跟第二個valueAxis有關的observables全部重新計算
|
106
|
+
const gridAxesTransform$ = gridAxesTransformObservable({
|
107
|
+
fullDataFormatter$: secondGridDataFormatter$,
|
108
|
+
layout$: observer.layout$
|
109
|
+
})
|
110
|
+
const gridAxesReverseTransform$ = gridAxesReverseTransformObservable({
|
111
|
+
gridAxesTransform$
|
112
|
+
})
|
113
|
+
const gridContainer$ = gridContainerObservable({
|
114
|
+
computedData$: observables.gridComputedData$,
|
115
|
+
fullDataFormatter$: secondGridDataFormatter$,
|
116
|
+
fullChartParams$: observer.fullChartParams$,
|
117
|
+
layout$: observer.layout$
|
118
|
+
})
|
119
|
+
return {
|
120
|
+
...observables,
|
121
|
+
gridAxesTransform$,
|
122
|
+
gridAxesReverseTransform$,
|
123
|
+
gridContainer$,
|
124
|
+
}
|
125
|
+
})
|
126
|
+
})
|
127
|
+
)
|
128
|
+
|
129
|
+
multiGridPlugin$.subscribe(data => {
|
130
|
+
// 每次重新計算時,清除之前的訂閱
|
131
|
+
unsubscribeFnArr.forEach(fn => fn())
|
132
|
+
|
133
|
+
selection.selectAll(`g.${gridClassName}`)
|
134
|
+
.data(data)
|
135
|
+
.join('g')
|
136
|
+
.attr('class', gridClassName)
|
137
|
+
.each((d, i, g) => {
|
138
|
+
if (i > 1) {
|
139
|
+
return
|
140
|
+
}
|
141
|
+
|
142
|
+
const gridSelection = d3.select(g[i])
|
143
|
+
|
144
|
+
unsubscribeFnArr[i] = createBaseValueAxis(pluginName, {
|
145
|
+
selection: gridSelection,
|
146
|
+
computedData$: d.gridComputedData$,
|
147
|
+
fullParams$: observer.fullParams$.pipe(
|
148
|
+
map(fullParams => i === 0 ? fullParams.firstAxis : fullParams.secondAxis)
|
149
|
+
),
|
150
|
+
fullDataFormatter$: d.gridDataFormatter$,
|
151
|
+
fullChartParams$: observer.fullChartParams$,
|
152
|
+
gridAxesTransform$: d.gridAxesTransform$,
|
153
|
+
gridAxesReverseTransform$: d.gridAxesReverseTransform$,
|
154
|
+
gridAxesSize$: d.gridAxesSize$,
|
155
|
+
gridContainer$: d.gridContainer$,
|
156
|
+
isSeriesPositionSeprate$: d.isSeriesPositionSeprate$,
|
157
|
+
})
|
158
|
+
})
|
159
|
+
})
|
160
|
+
|
161
|
+
return () => {
|
162
|
+
destroy$.next(undefined)
|
163
|
+
unsubscribeFnArr.forEach(fn => fn())
|
164
|
+
}
|
165
|
+
})
|
package/src/multiGrid/types.ts
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
import type { BaseBarsParams } from '../base/BaseBars'
|
2
|
+
import type { BaseBarStackParams } from '../base/BaseBarStack'
|
3
|
+
import type { BaseBarsTriangleParams } from '../base/BaseBarsTriangle'
|
2
4
|
import type { BaseLinesParams } from '../base/BaseLines'
|
5
|
+
import type { BaseDotsParams } from '../base/BaseDots'
|
6
|
+
import type { BaseGroupAxisParams } from '../base/BaseGroupAxis'
|
7
|
+
import type { BaseValueAxisParams } from '../base/BaseValueAxis'
|
3
8
|
import type {
|
4
9
|
ChartParams, Layout, ColorType } from '@orbcharts/core'
|
5
10
|
|
@@ -25,3 +30,37 @@ export interface MultiGridLegendParams {
|
|
25
30
|
listRectRadius: number
|
26
31
|
}>
|
27
32
|
}
|
33
|
+
|
34
|
+
export interface MultiGroupAxisParams extends BaseGroupAxisParams {
|
35
|
+
gridIndexes: number[]
|
36
|
+
}
|
37
|
+
|
38
|
+
export interface MultiValueAxisParams extends BaseValueAxisParams {
|
39
|
+
gridIndexes: number[]
|
40
|
+
}
|
41
|
+
|
42
|
+
export interface MultiBarsParams extends BaseBarsParams {
|
43
|
+
gridIndexes: number[]
|
44
|
+
}
|
45
|
+
|
46
|
+
export interface MultiBarStackParams extends BaseBarStackParams {
|
47
|
+
gridIndexes: number[]
|
48
|
+
}
|
49
|
+
|
50
|
+
export interface MultiBarsTriangleParams extends BaseBarsTriangleParams {
|
51
|
+
gridIndexes: number[]
|
52
|
+
}
|
53
|
+
|
54
|
+
export interface MultiLinesParams extends BaseLinesParams {
|
55
|
+
gridIndexes: number[]
|
56
|
+
}
|
57
|
+
|
58
|
+
export interface MultiDotsParams extends BaseDotsParams {
|
59
|
+
gridIndexes: number[]
|
60
|
+
}
|
61
|
+
|
62
|
+
export interface OverlappingValueAxesParams {
|
63
|
+
firstAxis: BaseValueAxisParams
|
64
|
+
secondAxis: BaseValueAxisParams
|
65
|
+
gridIndexes: [number, number]
|
66
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"outDir": "./dist/",
|
4
|
+
"sourceMap": true,
|
5
|
+
"noImplicitAny": true,
|
6
|
+
"module": "es6",
|
7
|
+
"target": "es5",
|
8
|
+
"jsx": "react",
|
9
|
+
"allowJs": true,
|
10
|
+
"moduleResolution": "node",
|
11
|
+
"allowSyntheticDefaultImports" : true,
|
12
|
+
"esModuleInterop" : true,
|
13
|
+
"paths":{
|
14
|
+
"@orbcharts/core": ["./../orbcharts-core/src"]
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"outDir": "./dist/",
|
4
|
+
"sourceMap": true,
|
5
|
+
"noImplicitAny": true,
|
6
|
+
"module": "es6",
|
7
|
+
"target": "es5",
|
8
|
+
"jsx": "react",
|
9
|
+
"allowJs": true,
|
10
|
+
"moduleResolution": "node",
|
11
|
+
"allowSyntheticDefaultImports" : true,
|
12
|
+
"esModuleInterop" : true
|
13
|
+
}
|
14
|
+
}
|
package/vite.config.js
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const BarsAndLines: import('@orbcharts/core').PluginConstructor<"multiGrid", string, import('..').BarsAndLinesParams>;
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,126 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
combineLatest,
|
3
|
-
map,
|
4
|
-
switchMap,
|
5
|
-
takeUntil,
|
6
|
-
Subject,
|
7
|
-
Observable } from 'rxjs'
|
8
|
-
import {
|
9
|
-
defineMultiGridPlugin } from '@orbcharts/core'
|
10
|
-
import { DATA_FORMATTER_MULTI_GRID_DEFAULT } from '@orbcharts/core/src/defaults'
|
11
|
-
// import { defineMultiGridPlugin } from '../../../../orbcharts-core/src'
|
12
|
-
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
13
|
-
import { DEFAULT_BARS_AND_LINES_PARAMS } from '../defaults'
|
14
|
-
import { createBaseBars } from '../../base/BaseBars'
|
15
|
-
import { createBaseLines } from '../../base/BaseLines'
|
16
|
-
|
17
|
-
const pluginName = 'BarsAndLines'
|
18
|
-
const barsClassName = getClassName(pluginName, 'bars')
|
19
|
-
const linesClassName = getClassName(pluginName, 'lines')
|
20
|
-
|
21
|
-
export const BarsAndLines = defineMultiGridPlugin(pluginName, DEFAULT_BARS_AND_LINES_PARAMS)(({ selection, name, subject, observer }) => {
|
22
|
-
const destroy$ = new Subject()
|
23
|
-
|
24
|
-
const barsSelection = selection.append('g').attr('class', barsClassName)
|
25
|
-
const linesSelection = selection.append('g').attr('class', linesClassName)
|
26
|
-
|
27
|
-
let unsubscribeBaseBars = () => {}
|
28
|
-
let unsubscribeBaseLines = () => {}
|
29
|
-
|
30
|
-
// combineLatest({
|
31
|
-
// fullParams: observer.fullParams$,
|
32
|
-
// fullChartParams: observer.fullChartParams$,
|
33
|
-
// computedData: observer.computedData$,
|
34
|
-
// event: subject.event$,
|
35
|
-
// multiGrid: observer.multiGrid$,
|
36
|
-
// }).pipe(
|
37
|
-
// takeUntil(destroy$),
|
38
|
-
// switchMap(async d => d)
|
39
|
-
// ).subscribe(data => {
|
40
|
-
|
41
|
-
// })
|
42
|
-
|
43
|
-
const barsComputedData$ = observer.computedData$.pipe(
|
44
|
-
takeUntil(destroy$),
|
45
|
-
map((computedData) => computedData[0] || [])
|
46
|
-
)
|
47
|
-
|
48
|
-
const linesComputedData$ = observer.computedData$.pipe(
|
49
|
-
takeUntil(destroy$),
|
50
|
-
map((computedData) => computedData[1] || [])
|
51
|
-
)
|
52
|
-
|
53
|
-
const barsFullParams$ = observer.fullParams$.pipe(
|
54
|
-
takeUntil(destroy$),
|
55
|
-
map((fullParams) => fullParams.bars)
|
56
|
-
)
|
57
|
-
|
58
|
-
const linesFullParams$ = observer.fullParams$.pipe(
|
59
|
-
takeUntil(destroy$),
|
60
|
-
map((fullParams) => fullParams.lines)
|
61
|
-
)
|
62
|
-
|
63
|
-
const defaultFullDataFormatter$ = observer.fullDataFormatter$.pipe(
|
64
|
-
takeUntil(destroy$),
|
65
|
-
map((fullDataFormatter) => fullDataFormatter.multiGrid[0] || DATA_FORMATTER_MULTI_GRID_DEFAULT.multiGrid[0])
|
66
|
-
)
|
67
|
-
|
68
|
-
const linesFullDataFormatter$ = combineLatest({
|
69
|
-
fullDataFormatter: observer.fullDataFormatter$,
|
70
|
-
defaultFullDataFormatter: defaultFullDataFormatter$,
|
71
|
-
}).pipe(
|
72
|
-
takeUntil(destroy$),
|
73
|
-
map((data) => {
|
74
|
-
return data.fullDataFormatter.multiGrid[1] ?? data.defaultFullDataFormatter
|
75
|
-
})
|
76
|
-
)
|
77
|
-
|
78
|
-
observer.multiGrid$.subscribe((multiGrid) => {
|
79
|
-
// bars
|
80
|
-
if (multiGrid[0]) {
|
81
|
-
unsubscribeBaseBars = createBaseBars(pluginName, {
|
82
|
-
selection: barsSelection,
|
83
|
-
computedData$: barsComputedData$,
|
84
|
-
visibleComputedData$: multiGrid[0].visibleComputedData$,
|
85
|
-
SeriesDataMap$: multiGrid[0].SeriesDataMap$,
|
86
|
-
GroupDataMap$: multiGrid[0].GroupDataMap$,
|
87
|
-
fullParams$: barsFullParams$,
|
88
|
-
fullChartParams$: observer.fullChartParams$,
|
89
|
-
gridAxesTransform$: multiGrid[0].gridAxesTransform$,
|
90
|
-
gridGraphicTransform$: multiGrid[0].gridGraphicTransform$,
|
91
|
-
gridAxesSize$: multiGrid[0].gridAxesSize$,
|
92
|
-
gridHighlight$: multiGrid[0].gridHighlight$,
|
93
|
-
event$: subject.event$ as Subject<any>,
|
94
|
-
})
|
95
|
-
} else {
|
96
|
-
unsubscribeBaseBars()
|
97
|
-
}
|
98
|
-
// lines
|
99
|
-
if (multiGrid[1]) {
|
100
|
-
unsubscribeBaseLines = createBaseLines(pluginName, {
|
101
|
-
selection: linesSelection,
|
102
|
-
computedData$: linesComputedData$,
|
103
|
-
SeriesDataMap$: multiGrid[1].SeriesDataMap$,
|
104
|
-
GroupDataMap$: multiGrid[1].GroupDataMap$,
|
105
|
-
fullParams$: linesFullParams$,
|
106
|
-
fullDataFormatter$: linesFullDataFormatter$,
|
107
|
-
fullChartParams$: observer.fullChartParams$,
|
108
|
-
gridAxesTransform$: multiGrid[1].gridAxesTransform$,
|
109
|
-
gridGraphicTransform$: multiGrid[1].gridGraphicTransform$,
|
110
|
-
gridAxesSize$: multiGrid[1].gridAxesSize$,
|
111
|
-
gridHighlight$: multiGrid[1].gridHighlight$,
|
112
|
-
event$: subject.event$ as Subject<any>,
|
113
|
-
})
|
114
|
-
} else {
|
115
|
-
unsubscribeBaseLines()
|
116
|
-
}
|
117
|
-
})
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
return () => {
|
122
|
-
destroy$.next(undefined)
|
123
|
-
unsubscribeBaseBars()
|
124
|
-
unsubscribeBaseLines()
|
125
|
-
}
|
126
|
-
})
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|