@orbcharts/plugins-basic 3.0.0-alpha.44 → 3.0.0-alpha.46
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/dist/orbcharts-plugins-basic.es.js +7770 -7580
- package/dist/orbcharts-plugins-basic.umd.js +8 -8
- package/dist/src/base/BaseBarStack.d.ts +6 -4
- package/dist/src/base/BaseBars.d.ts +6 -4
- package/dist/src/base/BaseBarsTriangle.d.ts +7 -4
- package/dist/src/base/BaseDots.d.ts +5 -3
- package/dist/src/base/BaseGroupAxis.d.ts +3 -3
- package/dist/src/base/BaseLineAreas.d.ts +6 -3
- package/dist/src/base/BaseLines.d.ts +6 -3
- package/dist/src/base/BaseValueAxis.d.ts +3 -3
- package/dist/src/grid/gridObservables.d.ts +4 -4
- package/dist/src/multiGrid/multiGridObservables.d.ts +2 -6
- package/dist/src/series/plugins/PieEventTexts.d.ts +3 -1
- package/dist/src/series/seriesObservables.d.ts +21 -0
- package/dist/src/series/seriesUtils.d.ts +3 -3
- package/package.json +2 -2
- package/src/base/BaseBarStack.ts +105 -208
- package/src/base/BaseBars.ts +78 -64
- package/src/base/BaseBarsTriangle.ts +76 -63
- package/src/base/BaseDots.ts +41 -178
- package/src/base/BaseGroupAxis.ts +13 -13
- package/src/base/BaseLineAreas.ts +85 -81
- package/src/base/BaseLines.ts +82 -75
- package/src/base/BaseValueAxis.ts +14 -15
- package/src/grid/gridObservables.ts +22 -38
- package/src/grid/plugins/BarStack.ts +16 -3
- package/src/grid/plugins/Bars.ts +18 -4
- package/src/grid/plugins/BarsDiverging.ts +6 -4
- package/src/grid/plugins/BarsTriangle.ts +20 -4
- package/src/grid/plugins/Dots.ts +4 -2
- package/src/grid/plugins/GroupAux.ts +1 -2
- package/src/grid/plugins/GroupAxis.ts +15 -3
- package/src/grid/plugins/LineAreas.ts +5 -2
- package/src/grid/plugins/Lines.ts +5 -2
- package/src/grid/plugins/ScalingArea.ts +0 -1
- package/src/grid/plugins/ValueAxis.ts +15 -3
- package/src/grid/plugins/ValueStackAxis.ts +14 -5
- package/src/multiGrid/multiGridObservables.ts +14 -261
- package/src/multiGrid/plugins/MultiBarStack.ts +22 -8
- package/src/multiGrid/plugins/MultiBars.ts +21 -7
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +22 -7
- package/src/multiGrid/plugins/MultiDots.ts +7 -5
- package/src/multiGrid/plugins/MultiGridLegend.ts +1 -1
- package/src/multiGrid/plugins/MultiGroupAxis.ts +19 -7
- package/src/multiGrid/plugins/MultiLineAreas.ts +9 -6
- package/src/multiGrid/plugins/MultiLines.ts +9 -6
- package/src/multiGrid/plugins/MultiValueAxis.ts +19 -7
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +52 -47
- package/src/noneData/defaults.ts +3 -0
- package/src/series/defaults.ts +13 -3
- package/src/series/plugins/Bubbles.ts +139 -88
- package/src/series/plugins/Pie.ts +307 -352
- package/src/series/plugins/PieEventTexts.ts +102 -38
- package/src/series/plugins/PieLabels.ts +95 -48
- package/src/series/seriesObservables.ts +145 -0
- package/src/series/seriesUtils.ts +4 -4
- package/tsconfig.json +1 -1
@@ -5,7 +5,7 @@ import {
|
|
5
5
|
defineMultiGridPlugin } from '@orbcharts/core'
|
6
6
|
import { DEFAULT_MULTI_DOTS_PARAMS } from '../defaults'
|
7
7
|
import { createBaseDots } from '../../base/BaseDots'
|
8
|
-
import {
|
8
|
+
import { multiGridPluginObservables } from '../multiGridObservables'
|
9
9
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
10
10
|
|
11
11
|
const pluginName = 'MultiDots'
|
@@ -17,7 +17,7 @@ export const MultiDots = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_DOTS_PA
|
|
17
17
|
|
18
18
|
const unsubscribeFnArr: (() => void)[] = []
|
19
19
|
|
20
|
-
const multiGridPlugin$ =
|
20
|
+
const multiGridPlugin$ = multiGridPluginObservables(observer)
|
21
21
|
|
22
22
|
multiGridPlugin$.subscribe(data => {
|
23
23
|
// 每次重新計算時,清除之前的訂閱
|
@@ -33,9 +33,11 @@ export const MultiDots = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_DOTS_PA
|
|
33
33
|
|
34
34
|
unsubscribeFnArr[i] = createBaseDots(pluginName, {
|
35
35
|
selection: gridSelection,
|
36
|
-
computedData$: d.
|
36
|
+
computedData$: d.computedData$,
|
37
37
|
visibleComputedData$: d.visibleComputedData$,
|
38
|
-
|
38
|
+
computedLayoutData$: d.computedLayoutData$,
|
39
|
+
visibleComputedLayoutData$: d.visibleComputedLayoutData$,
|
40
|
+
seriesLabels$: d.seriesLabels$,
|
39
41
|
SeriesDataMap$: d.SeriesDataMap$,
|
40
42
|
GroupDataMap$: d.GroupDataMap$,
|
41
43
|
fullParams$: observer.fullParams$,
|
@@ -45,7 +47,7 @@ export const MultiDots = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_DOTS_PA
|
|
45
47
|
gridGraphicReverseScale$: d.gridGraphicReverseScale$,
|
46
48
|
gridAxesSize$: d.gridAxesSize$,
|
47
49
|
gridHighlight$: d.gridHighlight$,
|
48
|
-
|
50
|
+
gridContainerPosition$: d.gridContainerPosition$,
|
49
51
|
event$: subject.event$ as Subject<any>,
|
50
52
|
})
|
51
53
|
})
|
@@ -35,7 +35,7 @@ export const MultiGridLegend = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_G
|
|
35
35
|
|
36
36
|
const seriesList$ = combineLatest({
|
37
37
|
fullParams: observer.fullParams$,
|
38
|
-
multiGrid: observer.multiGridEachDetail$,
|
38
|
+
// multiGrid: observer.multiGridEachDetail$,
|
39
39
|
computedData: observer.computedData$,
|
40
40
|
}).pipe(
|
41
41
|
takeUntil(destroy$),
|
@@ -1,11 +1,16 @@
|
|
1
1
|
import * as d3 from 'd3'
|
2
2
|
import {
|
3
|
-
Subject
|
3
|
+
Subject,
|
4
|
+
map,
|
5
|
+
distinctUntilChanged,
|
6
|
+
shareReplay,
|
7
|
+
takeUntil
|
8
|
+
} from 'rxjs'
|
4
9
|
import {
|
5
10
|
defineMultiGridPlugin } from '@orbcharts/core'
|
6
11
|
import { DEFAULT_MULTI_GROUP_AXIS_PARAMS } from '../defaults'
|
7
12
|
import { createBaseGroupAxis } from '../../base/BaseGroupAxis'
|
8
|
-
import {
|
13
|
+
import { multiGridPluginObservables } from '../multiGridObservables'
|
9
14
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
10
15
|
|
11
16
|
const pluginName = 'MultiGroupAxis'
|
@@ -17,7 +22,7 @@ export const MultiGroupAxis = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_GR
|
|
17
22
|
|
18
23
|
const unsubscribeFnArr: (() => void)[] = []
|
19
24
|
|
20
|
-
const multiGridPlugin$ =
|
25
|
+
const multiGridPlugin$ = multiGridPluginObservables(observer)
|
21
26
|
|
22
27
|
multiGridPlugin$.subscribe(data => {
|
23
28
|
// 每次重新計算時,清除之前的訂閱
|
@@ -31,17 +36,24 @@ export const MultiGroupAxis = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_GR
|
|
31
36
|
|
32
37
|
const gridSelection = d3.select(g[i])
|
33
38
|
|
39
|
+
const isSeriesSeprate$ = d.dataFormatter$.pipe(
|
40
|
+
takeUntil(destroy$),
|
41
|
+
map(d => d.grid.separateSeries),
|
42
|
+
distinctUntilChanged(),
|
43
|
+
shareReplay(1)
|
44
|
+
)
|
45
|
+
|
34
46
|
unsubscribeFnArr[i] = createBaseGroupAxis(pluginName, {
|
35
47
|
selection: gridSelection,
|
36
|
-
computedData$: d.
|
48
|
+
computedData$: d.computedData$,
|
37
49
|
fullParams$: observer.fullParams$,
|
38
|
-
fullDataFormatter$: d.
|
50
|
+
fullDataFormatter$: d.dataFormatter$,
|
39
51
|
fullChartParams$: observer.fullChartParams$,
|
40
52
|
gridAxesTransform$: d.gridAxesTransform$,
|
41
53
|
gridAxesReverseTransform$: d.gridAxesReverseTransform$,
|
42
54
|
gridAxesSize$: d.gridAxesSize$,
|
43
|
-
|
44
|
-
|
55
|
+
gridContainerPosition$: d.gridContainerPosition$,
|
56
|
+
isSeriesSeprate$,
|
45
57
|
})
|
46
58
|
})
|
47
59
|
})
|
@@ -6,7 +6,7 @@ import {
|
|
6
6
|
|
7
7
|
import { DEFAULT_MULTI_LINE_AREAS_PARAMS } from '../defaults'
|
8
8
|
import { createBaseLineAreas } from '../../base/BaseLineAreas'
|
9
|
-
import {
|
9
|
+
import { multiGridPluginObservables } from '../multiGridObservables'
|
10
10
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
11
11
|
|
12
12
|
const pluginName = 'MultiLineAreas'
|
@@ -18,7 +18,7 @@ export const MultiLineAreas = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LI
|
|
18
18
|
|
19
19
|
const unsubscribeFnArr: (() => void)[] = []
|
20
20
|
|
21
|
-
const multiGridPlugin$ =
|
21
|
+
const multiGridPlugin$ = multiGridPluginObservables(observer)
|
22
22
|
|
23
23
|
multiGridPlugin$.subscribe(data => {
|
24
24
|
// 每次重新計算時,清除之前的訂閱
|
@@ -34,18 +34,21 @@ export const MultiLineAreas = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LI
|
|
34
34
|
|
35
35
|
unsubscribeFnArr[i] = createBaseLineAreas(pluginName, {
|
36
36
|
selection: gridSelection,
|
37
|
-
computedData$: d.
|
38
|
-
|
37
|
+
computedData$: d.computedData$,
|
38
|
+
computedLayoutData$: d.computedLayoutData$,
|
39
|
+
visibleComputedData$: d.visibleComputedData$,
|
40
|
+
visibleComputedLayoutData$: d.visibleComputedLayoutData$,
|
41
|
+
seriesLabels$: d.seriesLabels$,
|
39
42
|
SeriesDataMap$: d.SeriesDataMap$,
|
40
43
|
GroupDataMap$: d.GroupDataMap$,
|
41
|
-
fullDataFormatter$: d.
|
44
|
+
fullDataFormatter$: d.dataFormatter$,
|
42
45
|
fullParams$: observer.fullParams$,
|
43
46
|
fullChartParams$: observer.fullChartParams$,
|
44
47
|
gridAxesTransform$: d.gridAxesTransform$,
|
45
48
|
gridGraphicTransform$: d.gridGraphicTransform$,
|
46
49
|
gridAxesSize$: d.gridAxesSize$,
|
47
50
|
gridHighlight$: d.gridHighlight$,
|
48
|
-
|
51
|
+
gridContainerPosition$: d.gridContainerPosition$,
|
49
52
|
layout$: observer.layout$,
|
50
53
|
event$: subject.event$ as Subject<any>,
|
51
54
|
})
|
@@ -6,7 +6,7 @@ import {
|
|
6
6
|
|
7
7
|
import { DEFAULT_MULTI_LINES_PARAMS } from '../defaults'
|
8
8
|
import { createBaseLines } from '../../base/BaseLines'
|
9
|
-
import {
|
9
|
+
import { multiGridPluginObservables } from '../multiGridObservables'
|
10
10
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
11
11
|
|
12
12
|
const pluginName = 'MultiLines'
|
@@ -18,7 +18,7 @@ export const MultiLines = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LINES_
|
|
18
18
|
|
19
19
|
const unsubscribeFnArr: (() => void)[] = []
|
20
20
|
|
21
|
-
const multiGridPlugin$ =
|
21
|
+
const multiGridPlugin$ = multiGridPluginObservables(observer)
|
22
22
|
|
23
23
|
multiGridPlugin$.subscribe(data => {
|
24
24
|
// 每次重新計算時,清除之前的訂閱
|
@@ -34,18 +34,21 @@ export const MultiLines = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LINES_
|
|
34
34
|
|
35
35
|
unsubscribeFnArr[i] = createBaseLines(pluginName, {
|
36
36
|
selection: gridSelection,
|
37
|
-
computedData$: d.
|
38
|
-
|
37
|
+
computedData$: d.computedData$,
|
38
|
+
computedLayoutData$: d.computedLayoutData$,
|
39
|
+
visibleComputedData$: d.visibleComputedData$,
|
40
|
+
visibleComputedLayoutData$: d.visibleComputedLayoutData$,
|
41
|
+
seriesLabels$: d.seriesLabels$,
|
39
42
|
SeriesDataMap$: d.SeriesDataMap$,
|
40
43
|
GroupDataMap$: d.GroupDataMap$,
|
41
|
-
fullDataFormatter$: d.
|
44
|
+
fullDataFormatter$: d.dataFormatter$,
|
42
45
|
fullParams$: observer.fullParams$,
|
43
46
|
fullChartParams$: observer.fullChartParams$,
|
44
47
|
gridAxesTransform$: d.gridAxesTransform$,
|
45
48
|
gridGraphicTransform$: d.gridGraphicTransform$,
|
46
49
|
gridAxesSize$: d.gridAxesSize$,
|
47
50
|
gridHighlight$: d.gridHighlight$,
|
48
|
-
|
51
|
+
gridContainerPosition$: d.gridContainerPosition$,
|
49
52
|
event$: subject.event$ as Subject<any>,
|
50
53
|
})
|
51
54
|
})
|
@@ -1,11 +1,16 @@
|
|
1
1
|
import * as d3 from 'd3'
|
2
2
|
import {
|
3
|
-
Subject
|
3
|
+
Subject,
|
4
|
+
map,
|
5
|
+
distinctUntilChanged,
|
6
|
+
shareReplay,
|
7
|
+
takeUntil
|
8
|
+
} from 'rxjs'
|
4
9
|
import {
|
5
10
|
defineMultiGridPlugin } from '@orbcharts/core'
|
6
11
|
import { DEFAULT_MULTI_VALUE_AXIS_PARAMS } from '../defaults'
|
7
12
|
import { createBaseValueAxis } from '../../base/BaseValueAxis'
|
8
|
-
import {
|
13
|
+
import { multiGridPluginObservables } from '../multiGridObservables'
|
9
14
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
10
15
|
|
11
16
|
const pluginName = 'MultiValueAxis'
|
@@ -17,7 +22,7 @@ export const MultiValueAxis = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_VA
|
|
17
22
|
|
18
23
|
const unsubscribeFnArr: (() => void)[] = []
|
19
24
|
|
20
|
-
const multiGridPlugin$ =
|
25
|
+
const multiGridPlugin$ = multiGridPluginObservables(observer)
|
21
26
|
|
22
27
|
multiGridPlugin$.subscribe(data => {
|
23
28
|
// 每次重新計算時,清除之前的訂閱
|
@@ -31,17 +36,24 @@ export const MultiValueAxis = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_VA
|
|
31
36
|
|
32
37
|
const gridSelection = d3.select(g[i])
|
33
38
|
|
39
|
+
const isSeriesSeprate$ = d.dataFormatter$.pipe(
|
40
|
+
takeUntil(destroy$),
|
41
|
+
map(d => d.grid.separateSeries),
|
42
|
+
distinctUntilChanged(),
|
43
|
+
shareReplay(1)
|
44
|
+
)
|
45
|
+
|
34
46
|
unsubscribeFnArr[i] = createBaseValueAxis(pluginName, {
|
35
47
|
selection: gridSelection,
|
36
|
-
computedData$: d.
|
48
|
+
computedData$: d.computedData$,
|
37
49
|
fullParams$: observer.fullParams$,
|
38
|
-
fullDataFormatter$: d.
|
50
|
+
fullDataFormatter$: d.dataFormatter$,
|
39
51
|
fullChartParams$: observer.fullChartParams$,
|
40
52
|
gridAxesTransform$: d.gridAxesTransform$,
|
41
53
|
gridAxesReverseTransform$: d.gridAxesReverseTransform$,
|
42
54
|
gridAxesSize$: d.gridAxesSize$,
|
43
|
-
|
44
|
-
|
55
|
+
gridContainerPosition$: d.gridContainerPosition$,
|
56
|
+
isSeriesSeprate$,
|
45
57
|
})
|
46
58
|
})
|
47
59
|
})
|
@@ -5,18 +5,19 @@ import {
|
|
5
5
|
switchMap,
|
6
6
|
combineLatest,
|
7
7
|
takeUntil,
|
8
|
+
distinctUntilChanged,
|
9
|
+
shareReplay,
|
8
10
|
iif,
|
9
11
|
Observable,
|
10
12
|
Subject } from 'rxjs'
|
11
|
-
import type { ContextObserverMultiGrid, DataFormatterGrid } from '@orbcharts/core'
|
13
|
+
import type { ContextObserverMultiGrid, DataFormatterGrid, DataFormatterTypeMap, Layout } from '@orbcharts/core'
|
12
14
|
import {
|
13
15
|
defineMultiGridPlugin } from '@orbcharts/core'
|
14
16
|
import { DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS } from '../defaults'
|
15
17
|
import { createBaseValueAxis } from '../../base/BaseValueAxis'
|
16
|
-
import {
|
18
|
+
import { multiGridPluginObservables } from '../multiGridObservables'
|
17
19
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
18
|
-
|
19
|
-
import { gridAxesTransformObservable, gridAxesReverseTransformObservable, gridContainerObservable } from '@orbcharts/core/src/grid/gridObservables'
|
20
|
+
import { gridAxesTransformObservable, gridAxesReverseTransformObservable, gridContainerPositionObservable } from '@orbcharts/core/src/grid/gridObservables'
|
20
21
|
|
21
22
|
const pluginName = 'OverlappingValueAxes'
|
22
23
|
|
@@ -40,43 +41,41 @@ export const OverlappingValueAxes = defineMultiGridPlugin(pluginName, DEFAULT_OV
|
|
40
41
|
// 為了要反轉第二個valueAxis的位置所以要重新計算
|
41
42
|
const secondGridDataFormatter$: Observable<DataFormatterGrid> = combineLatest({
|
42
43
|
firstGridIndex: firstGridIndex$,
|
43
|
-
secondGridIndex: secondGridIndex
|
44
|
+
secondGridIndex: secondGridIndex$,
|
45
|
+
fullDataFormatter: observer.fullDataFormatter$,
|
44
46
|
}).pipe(
|
45
47
|
takeUntil(destroy$),
|
46
|
-
switchMap(
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
position: reversePosition
|
71
|
-
}
|
72
|
-
},
|
73
|
-
container: {
|
74
|
-
...fullDataFormatter.container
|
75
|
-
}
|
48
|
+
switchMap(async (d) => d),
|
49
|
+
map(data => {
|
50
|
+
if (!data.fullDataFormatter.gridList[data.secondGridIndex]) {
|
51
|
+
data.fullDataFormatter.gridList[data.secondGridIndex] = Object.assign({}, data.fullDataFormatter.gridList[data.firstGridIndex])
|
52
|
+
}
|
53
|
+
// 反轉第二個valueAxis的位置
|
54
|
+
let reversePosition = ''
|
55
|
+
if (data.fullDataFormatter.gridList[data.firstGridIndex].valueAxis.position === 'left') {
|
56
|
+
reversePosition = 'right'
|
57
|
+
} else if (data.fullDataFormatter.gridList[data.firstGridIndex].valueAxis.position === 'bottom') {
|
58
|
+
reversePosition = 'top'
|
59
|
+
} else if (data.fullDataFormatter.gridList[data.firstGridIndex].valueAxis.position === 'top') {
|
60
|
+
reversePosition = 'bottom'
|
61
|
+
} else if (data.fullDataFormatter.gridList[data.firstGridIndex].valueAxis.position === 'right') {
|
62
|
+
reversePosition = 'left'
|
63
|
+
}
|
64
|
+
return <DataFormatterGrid>{
|
65
|
+
type: 'grid',
|
66
|
+
visibleFilter: data.fullDataFormatter.visibleFilter as any,
|
67
|
+
grid: {
|
68
|
+
...data.fullDataFormatter.gridList[data.secondGridIndex],
|
69
|
+
valueAxis: {
|
70
|
+
...data.fullDataFormatter.gridList[data.secondGridIndex].valueAxis,
|
71
|
+
position: reversePosition
|
76
72
|
}
|
77
|
-
}
|
78
|
-
|
79
|
-
|
73
|
+
},
|
74
|
+
container: {
|
75
|
+
...data.fullDataFormatter.container
|
76
|
+
}
|
77
|
+
}
|
78
|
+
})
|
80
79
|
)
|
81
80
|
|
82
81
|
const multiGridPlugin$ = of(observer).pipe(
|
@@ -95,7 +94,7 @@ export const OverlappingValueAxes = defineMultiGridPlugin(pluginName, DEFAULT_OV
|
|
95
94
|
)
|
96
95
|
}
|
97
96
|
}),
|
98
|
-
switchMap(observer =>
|
97
|
+
switchMap(observer => multiGridPluginObservables(observer)),
|
99
98
|
map(data => {
|
100
99
|
return data.map((observables, index) => {
|
101
100
|
if (index === 0) {
|
@@ -109,17 +108,16 @@ export const OverlappingValueAxes = defineMultiGridPlugin(pluginName, DEFAULT_OV
|
|
109
108
|
const gridAxesReverseTransform$ = gridAxesReverseTransformObservable({
|
110
109
|
gridAxesTransform$
|
111
110
|
})
|
112
|
-
const
|
113
|
-
computedData$: observables.
|
111
|
+
const gridContainerPosition$ = gridContainerPositionObservable({
|
112
|
+
computedData$: observables.computedData$,
|
114
113
|
fullDataFormatter$: secondGridDataFormatter$,
|
115
|
-
fullChartParams$: observer.fullChartParams$,
|
116
114
|
layout$: observer.layout$
|
117
115
|
})
|
118
116
|
return {
|
119
117
|
...observables,
|
120
118
|
gridAxesTransform$,
|
121
119
|
gridAxesReverseTransform$,
|
122
|
-
|
120
|
+
gridContainerPosition$,
|
123
121
|
}
|
124
122
|
})
|
125
123
|
})
|
@@ -140,19 +138,26 @@ export const OverlappingValueAxes = defineMultiGridPlugin(pluginName, DEFAULT_OV
|
|
140
138
|
|
141
139
|
const gridSelection = d3.select(g[i])
|
142
140
|
|
141
|
+
const isSeriesSeprate$ = d.dataFormatter$.pipe(
|
142
|
+
takeUntil(destroy$),
|
143
|
+
map(d => d.grid.separateSeries),
|
144
|
+
distinctUntilChanged(),
|
145
|
+
shareReplay(1)
|
146
|
+
)
|
147
|
+
|
143
148
|
unsubscribeFnArr[i] = createBaseValueAxis(pluginName, {
|
144
149
|
selection: gridSelection,
|
145
|
-
computedData$: d.
|
150
|
+
computedData$: d.computedData$,
|
146
151
|
fullParams$: observer.fullParams$.pipe(
|
147
152
|
map(fullParams => i === 0 ? fullParams.firstAxis : fullParams.secondAxis)
|
148
153
|
),
|
149
|
-
fullDataFormatter$: d.
|
154
|
+
fullDataFormatter$: d.dataFormatter$,
|
150
155
|
fullChartParams$: observer.fullChartParams$,
|
151
156
|
gridAxesTransform$: d.gridAxesTransform$,
|
152
157
|
gridAxesReverseTransform$: d.gridAxesReverseTransform$,
|
153
158
|
gridAxesSize$: d.gridAxesSize$,
|
154
|
-
|
155
|
-
|
159
|
+
gridContainerPosition$: d.gridContainerPosition$,
|
160
|
+
isSeriesSeprate$,
|
156
161
|
})
|
157
162
|
})
|
158
163
|
})
|
package/src/noneData/defaults.ts
CHANGED
@@ -27,6 +27,7 @@ export const TOOLTIP_PARAMS: TooltipParams = {
|
|
27
27
|
} else if (eventData.highlightTarget === 'series') {
|
28
28
|
const label = (eventData as EventBaseSeriesValue<any, any>).seriesLabel
|
29
29
|
const valueArr = (eventData as EventBaseSeriesValue<any, any>).series
|
30
|
+
.filter(d => d.visible == true)
|
30
31
|
.map(d => {
|
31
32
|
return d.value
|
32
33
|
})
|
@@ -37,6 +38,7 @@ export const TOOLTIP_PARAMS: TooltipParams = {
|
|
37
38
|
} else if (eventData.highlightTarget === 'group') {
|
38
39
|
const label = (eventData as EventBaseGridValue<any, any>).groupLabel
|
39
40
|
const valueArr = (eventData as EventBaseGridValue<any, any>).series
|
41
|
+
.filter(d => d.visible == true)
|
40
42
|
.map(d => {
|
41
43
|
return d.value
|
42
44
|
})
|
@@ -47,6 +49,7 @@ export const TOOLTIP_PARAMS: TooltipParams = {
|
|
47
49
|
} else if (eventData.highlightTarget === 'category') {
|
48
50
|
const label = (eventData as EventBaseCategoryValue<any, any>).categoryLabel
|
49
51
|
const valueArr = (eventData as EventBaseCategoryValue<any, any>).category
|
52
|
+
.filter(d => d.visible == true)
|
50
53
|
.map(d => {
|
51
54
|
return d.value
|
52
55
|
})
|
package/src/series/defaults.ts
CHANGED
@@ -45,11 +45,21 @@ export const DEFAULT_PIE_PARAMS: PieParams = {
|
|
45
45
|
}
|
46
46
|
|
47
47
|
export const DEFAULT_PIE_EVENT_TEXTS_PARAMS: PieEventTextsParams = {
|
48
|
-
eventFn: (
|
48
|
+
eventFn: (eventData: EventSeries, eventName: EventName, t: number) => {
|
49
49
|
if (eventName === 'mouseover' || eventName === 'mousemove') {
|
50
|
-
return [String(
|
50
|
+
return [String(eventData.datum!.value)]
|
51
51
|
}
|
52
|
-
return [
|
52
|
+
return [
|
53
|
+
String(
|
54
|
+
Math.round(
|
55
|
+
eventData.data.reduce((acc, seriesData) => {
|
56
|
+
return acc + seriesData.reduce((_acc, data) => {
|
57
|
+
return _acc + (data.value ?? 0)
|
58
|
+
}, 0)
|
59
|
+
}, 0) * t
|
60
|
+
)
|
61
|
+
)
|
62
|
+
]
|
53
63
|
},
|
54
64
|
textAttrs: [
|
55
65
|
{
|