@orbcharts/plugins-basic 3.0.0-alpha.43 → 3.0.0-alpha.45

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBarStack.d.ts +6 -4
  2. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBars.d.ts +6 -4
  3. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBarsTriangle.d.ts +7 -4
  4. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseDots.d.ts +5 -3
  5. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseGroupAxis.d.ts +3 -3
  6. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLegend.d.ts +1 -0
  7. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLineAreas.d.ts +6 -3
  8. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLines.d.ts +6 -3
  9. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseValueAxis.d.ts +3 -3
  10. package/dist/{src → orbcharts-plugins-basic/src}/grid/gridObservables.d.ts +4 -4
  11. package/dist/orbcharts-plugins-basic/src/index.d.ts +5 -0
  12. package/dist/orbcharts-plugins-basic/src/multiGrid/multiGridObservables.d.ts +8 -0
  13. package/dist/orbcharts-plugins-basic/src/series/plugins/PieEventTexts.d.ts +3 -0
  14. package/dist/orbcharts-plugins-basic/src/series/seriesObservables.d.ts +21 -0
  15. package/dist/{src → orbcharts-plugins-basic/src}/series/seriesUtils.d.ts +3 -3
  16. package/dist/orbcharts-plugins-basic.es.js +8349 -8142
  17. package/dist/orbcharts-plugins-basic.umd.js +8 -8
  18. package/dist/src/index.d.ts +1 -5
  19. package/package.json +2 -2
  20. package/src/base/BaseBarStack.ts +105 -208
  21. package/src/base/BaseBars.ts +78 -64
  22. package/src/base/BaseBarsTriangle.ts +76 -63
  23. package/src/base/BaseDots.ts +41 -178
  24. package/src/base/BaseGroupAxis.ts +16 -16
  25. package/src/base/BaseLegend.ts +18 -13
  26. package/src/base/BaseLineAreas.ts +85 -81
  27. package/src/base/BaseLines.ts +82 -75
  28. package/src/base/BaseValueAxis.ts +17 -18
  29. package/src/grid/gridObservables.ts +22 -38
  30. package/src/grid/plugins/BarStack.ts +16 -3
  31. package/src/grid/plugins/Bars.ts +18 -4
  32. package/src/grid/plugins/BarsDiverging.ts +6 -4
  33. package/src/grid/plugins/BarsTriangle.ts +20 -4
  34. package/src/grid/plugins/Dots.ts +4 -2
  35. package/src/grid/plugins/GridLegend.ts +2 -1
  36. package/src/grid/plugins/GroupAux.ts +8 -6
  37. package/src/grid/plugins/GroupAxis.ts +15 -3
  38. package/src/grid/plugins/LineAreas.ts +5 -2
  39. package/src/grid/plugins/Lines.ts +5 -2
  40. package/src/grid/plugins/ScalingArea.ts +0 -1
  41. package/src/grid/plugins/ValueAxis.ts +15 -3
  42. package/src/grid/plugins/ValueStackAxis.ts +14 -5
  43. package/src/multiGrid/multiGridObservables.ts +14 -261
  44. package/src/multiGrid/plugins/MultiBarStack.ts +22 -8
  45. package/src/multiGrid/plugins/MultiBars.ts +21 -7
  46. package/src/multiGrid/plugins/MultiBarsTriangle.ts +22 -7
  47. package/src/multiGrid/plugins/MultiDots.ts +7 -5
  48. package/src/multiGrid/plugins/MultiGridLegend.ts +3 -2
  49. package/src/multiGrid/plugins/MultiGroupAxis.ts +19 -7
  50. package/src/multiGrid/plugins/MultiLineAreas.ts +9 -6
  51. package/src/multiGrid/plugins/MultiLines.ts +9 -6
  52. package/src/multiGrid/plugins/MultiValueAxis.ts +19 -7
  53. package/src/multiGrid/plugins/OverlappingValueAxes.ts +52 -47
  54. package/src/noneData/defaults.ts +3 -0
  55. package/src/noneData/plugins/Tooltip.ts +9 -3
  56. package/src/series/defaults.ts +13 -3
  57. package/src/series/plugins/Bubbles.ts +57 -37
  58. package/src/series/plugins/Pie.ts +300 -352
  59. package/src/series/plugins/PieEventTexts.ts +102 -38
  60. package/src/series/plugins/PieLabels.ts +95 -48
  61. package/src/series/plugins/SeriesLegend.ts +2 -1
  62. package/src/series/seriesObservables.ts +145 -0
  63. package/src/series/seriesUtils.ts +4 -4
  64. package/src/tree/plugins/TreeLegend.ts +2 -1
  65. package/src/tree/plugins/TreeMap.ts +8 -5
  66. package/tsconfig.json +3 -0
  67. package/dist/src/multiGrid/multiGridObservables.d.ts +0 -12
  68. package/dist/src/series/plugins/PieEventTexts.d.ts +0 -1
  69. /package/dist/{src → orbcharts-plugins-basic/src}/base/BaseGroupArea.d.ts +0 -0
  70. /package/dist/{src → orbcharts-plugins-basic/src}/base/types.d.ts +0 -0
  71. /package/dist/{src → orbcharts-plugins-basic/src}/grid/defaults.d.ts +0 -0
  72. /package/dist/{src → orbcharts-plugins-basic/src}/grid/index.d.ts +0 -0
  73. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarStack.d.ts +0 -0
  74. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Bars.d.ts +0 -0
  75. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarsDiverging.d.ts +0 -0
  76. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarsTriangle.d.ts +0 -0
  77. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Dots.d.ts +0 -0
  78. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridLegend.d.ts +0 -0
  79. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GroupAux.d.ts +0 -0
  80. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GroupAxis.d.ts +0 -0
  81. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/LineAreas.d.ts +0 -0
  82. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Lines.d.ts +0 -0
  83. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Ranking.d.ts +0 -0
  84. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/RankingAxis.d.ts +0 -0
  85. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/ScalingArea.d.ts +0 -0
  86. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/ValueAxis.d.ts +0 -0
  87. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/ValueStackAxis.d.ts +0 -0
  88. /package/dist/{src → orbcharts-plugins-basic/src}/grid/types.d.ts +0 -0
  89. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/defaults.d.ts +0 -0
  90. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/index.d.ts +0 -0
  91. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBarStack.d.ts +0 -0
  92. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBars.d.ts +0 -0
  93. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBarsTriangle.d.ts +0 -0
  94. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiDots.d.ts +0 -0
  95. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGridLegend.d.ts +0 -0
  96. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGroupAxis.d.ts +0 -0
  97. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiLineAreas.d.ts +0 -0
  98. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiLines.d.ts +0 -0
  99. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiValueAxis.d.ts +0 -0
  100. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/OverlappingValueAxes.d.ts +0 -0
  101. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/types.d.ts +0 -0
  102. /package/dist/{src → orbcharts-plugins-basic/src}/multiValue/index.d.ts +0 -0
  103. /package/dist/{src → orbcharts-plugins-basic/src}/multiValue/plugins/Scatter.d.ts +0 -0
  104. /package/dist/{src → orbcharts-plugins-basic/src}/multiValue/plugins/ScatterAxes.d.ts +0 -0
  105. /package/dist/{src → orbcharts-plugins-basic/src}/noneData/defaults.d.ts +0 -0
  106. /package/dist/{src → orbcharts-plugins-basic/src}/noneData/index.d.ts +0 -0
  107. /package/dist/{src → orbcharts-plugins-basic/src}/noneData/plugins/Container.d.ts +0 -0
  108. /package/dist/{src → orbcharts-plugins-basic/src}/noneData/plugins/Tooltip.d.ts +0 -0
  109. /package/dist/{src → orbcharts-plugins-basic/src}/noneData/types.d.ts +0 -0
  110. /package/dist/{src → orbcharts-plugins-basic/src}/relationship/index.d.ts +0 -0
  111. /package/dist/{src → orbcharts-plugins-basic/src}/relationship/plugins/Relationship.d.ts +0 -0
  112. /package/dist/{src → orbcharts-plugins-basic/src}/series/defaults.d.ts +0 -0
  113. /package/dist/{src → orbcharts-plugins-basic/src}/series/index.d.ts +0 -0
  114. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Bubbles.d.ts +0 -0
  115. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Pie.d.ts +0 -0
  116. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/PieLabels.d.ts +0 -0
  117. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/SeriesLegend.d.ts +0 -0
  118. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Waffle.d.ts +0 -0
  119. /package/dist/{src → orbcharts-plugins-basic/src}/series/types.d.ts +0 -0
  120. /package/dist/{src → orbcharts-plugins-basic/src}/tree/defaults.d.ts +0 -0
  121. /package/dist/{src → orbcharts-plugins-basic/src}/tree/index.d.ts +0 -0
  122. /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeLegend.d.ts +0 -0
  123. /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeMap.d.ts +0 -0
  124. /package/dist/{src → orbcharts-plugins-basic/src}/tree/types.d.ts +0 -0
  125. /package/dist/{src → orbcharts-plugins-basic/src}/utils/commonUtils.d.ts +0 -0
  126. /package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Graphics.d.ts +0 -0
  127. /package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Utils.d.ts +0 -0
  128. /package/dist/{src → orbcharts-plugins-basic/src}/utils/observables.d.ts +0 -0
  129. /package/dist/{src → orbcharts-plugins-basic/src}/utils/orbchartsUtils.d.ts +0 -0
  130. /package/dist/{vite.config.d.ts → orbcharts-plugins-basic/vite.config.d.ts} +0 -0
@@ -10,280 +10,33 @@ import {
10
10
  distinctUntilChanged,
11
11
  shareReplay
12
12
  } from 'rxjs'
13
- import type { ContextObserverMultiGrid, ComputedDataGrid, DataFormatterGrid, ContextObserverGridDetail } from '@orbcharts/core'
14
- // import { DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT } from '@orbcharts/core/src/defaults'
15
-
16
- // interface GridPluginParams {
17
- // gridIndex: number
18
- // }
19
-
20
- // interface GridPluginObservables extends ContextObserverGridDetail {
21
- // gridComputedData$: Observable<ComputedDataGrid>
22
- // gridDataFormatter$: Observable<DataFormatterGrid>
23
- // }
24
-
25
- // // 對應grid資料的plugin所需Observable(必須有gridIndex)
26
- // export const gridPluginObservables = (observer: ContextObserverMultiGrid<GridPluginParams>): GridPluginObservables => {
27
- // const gridIndex$ = observer.fullParams$.pipe(
28
- // map(fullParams => fullParams.gridIndex),
29
- // distinctUntilChanged(),
30
- // shareReplay(1)
31
- // )
32
-
33
- // const gridComputedData$: Observable<ComputedDataGrid> = combineLatest({
34
- // computedData: observer.computedData$,
35
- // gridIndex: gridIndex$,
36
- // }).pipe(
37
- // map((data) => {
38
- // return data.computedData[data.gridIndex] ?? data.computedData[0]
39
- // })
40
- // )
41
-
42
- // const gridDataFormatter$: Observable<DataFormatterGrid> = combineLatest({
43
- // fullDataFormatter: observer.fullDataFormatter$,
44
- // gridIndex: gridIndex$,
45
- // }).pipe(
46
- // map((data) => {
47
- // const defaultGrid = data.fullDataFormatter.gridList[0] // ?? DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT
48
-
49
- // return {
50
- // type: 'grid',
51
- // grid: {
52
- // ...data.fullDataFormatter.gridList[data.gridIndex] ?? defaultGrid
53
- // },
54
- // container: {
55
- // ...data.fullDataFormatter.container
56
- // }
57
- // }
58
- // })
59
- // )
60
-
61
- // const gridDetail$ = combineLatest({
62
- // multiGridEachDetail: observer.multiGridEachDetail$,
63
- // gridIndex: gridIndex$,
64
- // }).pipe(
65
- // switchMap(async d => d),
66
- // map(data => {
67
- // return data.multiGridEachDetail[data.gridIndex] ?? data.multiGridEachDetail[0]
68
- // }),
69
- // shareReplay(1)
70
- // )
71
-
72
- // const isSeriesPositionSeprate$ = gridDetail$.pipe(
73
- // switchMap(d => d.isSeriesPositionSeprate$)
74
- // )
75
-
76
- // const gridContainer$ = gridDetail$.pipe(
77
- // switchMap(d => d.gridContainer$)
78
- // )
79
-
80
- // const gridAxesTransform$ = gridDetail$.pipe(
81
- // switchMap(d => d.gridAxesTransform$)
82
- // )
83
-
84
- // const gridAxesReverseTransform$ = gridDetail$.pipe(
85
- // switchMap(d => d.gridAxesReverseTransform$)
86
- // )
87
-
88
- // const gridAxesSize$ = gridDetail$.pipe(
89
- // switchMap(d => d.gridAxesSize$)
90
- // )
91
-
92
- // const gridGraphicTransform$ = gridDetail$.pipe(
93
- // switchMap(d => d.gridGraphicTransform$)
94
- // )
95
-
96
- // const gridGraphicReverseScale$ = gridDetail$.pipe(
97
- // switchMap(d => d.gridGraphicReverseScale$)
98
- // )
99
-
100
- // const gridHighlight$ = gridDetail$.pipe(
101
- // switchMap(d => d.gridHighlight$)
102
- // )
103
-
104
- // const existSeriesLabels$ = gridDetail$.pipe(
105
- // switchMap(d => d.existSeriesLabels$)
106
- // )
107
-
108
- // const SeriesDataMap$ = gridDetail$.pipe(
109
- // switchMap(d => d.SeriesDataMap$)
110
- // )
111
-
112
- // const GroupDataMap$ = gridDetail$.pipe(
113
- // switchMap(d => d.GroupDataMap$)
114
- // )
115
-
116
- // const visibleComputedData$ = gridDetail$.pipe(
117
- // switchMap(d => d.visibleComputedData$)
118
- // )
119
-
120
-
121
-
122
- // return {
123
- // gridComputedData$,
124
- // gridDataFormatter$,
125
- // gridAxesTransform$,
126
- // gridGraphicTransform$,
127
- // gridGraphicReverseScale$,
128
- // gridAxesReverseTransform$,
129
- // gridAxesSize$,
130
- // gridHighlight$,
131
- // existSeriesLabels$,
132
- // SeriesDataMap$,
133
- // GroupDataMap$,
134
- // visibleComputedData$,
135
- // isSeriesPositionSeprate$,
136
- // gridContainer$
137
- // }
138
- // }
13
+ import type {
14
+ ContextObserverMultiGrid,
15
+ ComputedDataGrid,
16
+ DataFormatterGrid,
17
+ ContextObserverGridDetail,
18
+ ContextObserverMultiGridDetail } from '@orbcharts/core'
139
19
 
140
20
  // 可設定多個gridIndex的params
141
21
  interface MultiGridPluginParams {
142
22
  gridIndexes: number[]
143
23
  }
144
24
 
145
- interface MultiGridDetailObservables extends ContextObserverGridDetail {
146
- gridComputedData$: Observable<ComputedDataGrid>
147
- gridDataFormatter$: Observable<DataFormatterGrid>
148
- }
149
-
150
-
151
25
  // 對應grid資料的plugin所需Observable(必須有gridIndexes)
152
- export const multiGridDetailObservables = (observer: ContextObserverMultiGrid<MultiGridPluginParams>): Observable<MultiGridDetailObservables[]> => {
26
+ export const multiGridPluginObservables = (observer: ContextObserverMultiGrid<MultiGridPluginParams>): Observable<ContextObserverMultiGridDetail[]> => {
153
27
  const gridIndexes$ = observer.fullParams$.pipe(
154
28
  map(fullParams => fullParams.gridIndexes),
155
29
  distinctUntilChanged(),
156
30
  shareReplay(1)
157
31
  )
158
- const destroy$ = new Subject()
159
-
160
- // 合併所有gridHighlight$
161
- const gridHighlight$ = observer.multiGridEachDetail$.pipe(
162
- // switchMap(data => concat(...data.map(d => d.gridHighlight$))),
163
- switchMap(data => {
164
- return combineLatest(data.map(d => d.gridHighlight$))
165
- }),
166
- map(d => d.flat()),
167
- shareReplay(1)
168
- )
169
-
170
- return gridIndexes$.pipe(
171
- map(gridIndexes => {
172
- return gridIndexes.map(gridIndex => {
173
- // 每次重新計算時,清除之前的訂閱
174
- destroy$.next(undefined)
175
-
176
- const gridIndex$ = of(gridIndex).pipe(
177
- takeUntil(destroy$),
178
- shareReplay(1)
179
- )
180
32
 
181
- const gridComputedData$: Observable<ComputedDataGrid> = combineLatest({
182
- computedData: observer.computedData$,
183
- gridIndex: gridIndex$,
184
- }).pipe(
185
- takeUntil(destroy$),
186
- map((data) => {
187
- return data.computedData[data.gridIndex] ?? data.computedData[0]
188
- })
189
- )
190
-
191
- const gridDataFormatter$: Observable<DataFormatterGrid> = combineLatest({
192
- fullDataFormatter: observer.fullDataFormatter$,
193
- gridIndex: gridIndex$,
194
- }).pipe(
195
- takeUntil(destroy$),
196
- map((data) => {
197
- const defaultGrid = data.fullDataFormatter.gridList[0] // ?? DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT
198
-
199
- return {
200
- type: 'grid',
201
- grid: {
202
- ...data.fullDataFormatter.gridList[data.gridIndex] ?? defaultGrid
203
- },
204
- container: {
205
- ...data.fullDataFormatter.container
206
- }
207
- }
208
- })
209
- )
210
-
211
- const gridDetail$ = combineLatest({
212
- multiGridEachDetail: observer.multiGridEachDetail$,
213
- gridIndex: gridIndex$,
214
- }).pipe(
215
- takeUntil(destroy$),
216
- switchMap(async d => d),
217
- map(data => {
218
- return data.multiGridEachDetail[data.gridIndex] ?? data.multiGridEachDetail[0]
219
- }),
220
- shareReplay(1)
221
- )
222
-
223
- const isSeriesPositionSeprate$ = gridDetail$.pipe(
224
- switchMap(d => d.isSeriesPositionSeprate$)
225
- )
226
-
227
- const gridContainer$ = gridDetail$.pipe(
228
- switchMap(d => d.gridContainer$)
229
- )
230
-
231
- const gridAxesTransform$ = gridDetail$.pipe(
232
- switchMap(d => d.gridAxesTransform$)
233
- )
234
-
235
- const gridAxesReverseTransform$ = gridDetail$.pipe(
236
- switchMap(d => d.gridAxesReverseTransform$)
237
- )
238
-
239
- const gridAxesSize$ = gridDetail$.pipe(
240
- switchMap(d => d.gridAxesSize$)
241
- )
242
-
243
- const gridGraphicTransform$ = gridDetail$.pipe(
244
- switchMap(d => d.gridGraphicTransform$)
245
- )
246
-
247
- const gridGraphicReverseScale$ = gridDetail$.pipe(
248
- switchMap(d => d.gridGraphicReverseScale$)
249
- )
250
-
251
- // const gridHighlight$ = gridDetail$.pipe(
252
- // switchMap(d => d.gridHighlight$)
253
- // )
254
-
255
- const existSeriesLabels$ = gridDetail$.pipe(
256
- switchMap(d => d.existSeriesLabels$)
257
- )
258
-
259
- const SeriesDataMap$ = gridDetail$.pipe(
260
- switchMap(d => d.SeriesDataMap$)
261
- )
262
-
263
- const GroupDataMap$ = gridDetail$.pipe(
264
- switchMap(d => d.GroupDataMap$)
265
- )
266
-
267
- const visibleComputedData$ = gridDetail$.pipe(
268
- switchMap(d => d.visibleComputedData$)
269
- )
270
-
271
- return {
272
- gridComputedData$,
273
- gridDataFormatter$,
274
- gridAxesTransform$,
275
- gridGraphicTransform$,
276
- gridGraphicReverseScale$,
277
- gridAxesReverseTransform$,
278
- gridAxesSize$,
279
- gridHighlight$,
280
- existSeriesLabels$,
281
- SeriesDataMap$,
282
- GroupDataMap$,
283
- visibleComputedData$,
284
- isSeriesPositionSeprate$,
285
- gridContainer$
286
- }
33
+ return combineLatest({
34
+ multiGridEachDetail: observer.multiGridEachDetail$,
35
+ gridIndexes: gridIndexes$,
36
+ }).pipe(
37
+ map(data => {
38
+ return data.gridIndexes.map(gridIndex => {
39
+ return data.multiGridEachDetail[gridIndex] ?? data.multiGridEachDetail[0]
287
40
  })
288
41
  })
289
42
  )
@@ -1,11 +1,16 @@
1
1
  import * as d3 from 'd3'
2
2
  import {
3
- Subject } from 'rxjs'
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_BAR_STACK_PARAMS } from '../defaults'
7
12
  import { createBaseBarStack } from '../../base/BaseBarStack'
8
- import { multiGridDetailObservables } from '../multiGridObservables'
13
+ import { multiGridPluginObservables } from '../multiGridObservables'
9
14
  import { getClassName, getUniID } from '../../utils/orbchartsUtils'
10
15
 
11
16
  const pluginName = 'MultiBarStack'
@@ -17,7 +22,7 @@ export const MultiBarStack = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_BAR
17
22
 
18
23
  const unsubscribeFnArr: (() => void)[] = []
19
24
 
20
- const multiGridPlugin$ = multiGridDetailObservables(observer)
25
+ const multiGridPlugin$ = multiGridPluginObservables(observer)
21
26
 
22
27
  multiGridPlugin$.subscribe(data => {
23
28
  // 每次重新計算時,清除之前的訂閱
@@ -31,23 +36,32 @@ export const MultiBarStack = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_BAR
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] = createBaseBarStack(pluginName, {
35
47
  selection: gridSelection,
36
- computedData$: d.gridComputedData$,
48
+ computedData$: d.computedData$,
37
49
  visibleComputedData$: d.visibleComputedData$,
38
- existSeriesLabels$: d.existSeriesLabels$,
50
+ computedLayoutData$: d.computedLayoutData$,
51
+ visibleComputedLayoutData$: d.visibleComputedLayoutData$,
52
+ seriesLabels$: d.seriesLabels$,
39
53
  SeriesDataMap$: d.SeriesDataMap$,
40
54
  GroupDataMap$: d.GroupDataMap$,
41
55
  fullParams$: observer.fullParams$,
42
- fullDataFormatter$: d.gridDataFormatter$,
56
+ fullDataFormatter$: d.dataFormatter$,
43
57
  fullChartParams$: observer.fullChartParams$,
44
58
  gridAxesTransform$: d.gridAxesTransform$,
45
59
  gridGraphicTransform$: d.gridGraphicTransform$,
46
60
  gridGraphicReverseScale$: d.gridGraphicReverseScale$,
47
61
  gridAxesSize$: d.gridAxesSize$,
48
62
  gridHighlight$: d.gridHighlight$,
49
- gridContainer$: d.gridContainer$,
50
- isSeriesPositionSeprate$: d.isSeriesPositionSeprate$,
63
+ gridContainerPosition$: d.gridContainerPosition$,
64
+ isSeriesSeprate$,
51
65
  event$: subject.event$ as Subject<any>,
52
66
  })
53
67
  })
@@ -1,11 +1,16 @@
1
1
  import * as d3 from 'd3'
2
2
  import {
3
- Subject } from 'rxjs'
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_BARS_PARAMS } from '../defaults'
7
12
  import { createBaseBars } from '../../base/BaseBars'
8
- import { multiGridDetailObservables } from '../multiGridObservables'
13
+ import { multiGridPluginObservables } from '../multiGridObservables'
9
14
  import { getClassName, getUniID } from '../../utils/orbchartsUtils'
10
15
 
11
16
  const pluginName = 'MultiBars'
@@ -17,7 +22,7 @@ export const MultiBars = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_BARS_PA
17
22
 
18
23
  const unsubscribeFnArr: (() => void)[] = []
19
24
 
20
- const multiGridPlugin$ = multiGridDetailObservables(observer)
25
+ const multiGridPlugin$ = multiGridPluginObservables(observer)
21
26
 
22
27
  multiGridPlugin$.subscribe(data => {
23
28
  // 每次重新計算時,清除之前的訂閱
@@ -31,11 +36,20 @@ export const MultiBars = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_BARS_PA
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] = createBaseBars(pluginName, {
35
47
  selection: gridSelection,
36
- computedData$: d.gridComputedData$,
48
+ computedData$: d.computedData$,
37
49
  visibleComputedData$: d.visibleComputedData$,
38
- existSeriesLabels$: d.existSeriesLabels$,
50
+ computedLayoutData$: d.computedLayoutData$,
51
+ visibleComputedLayoutData$: d.visibleComputedLayoutData$,
52
+ seriesLabels$: d.seriesLabels$,
39
53
  SeriesDataMap$: d.SeriesDataMap$,
40
54
  GroupDataMap$: d.GroupDataMap$,
41
55
  fullParams$: observer.fullParams$,
@@ -45,8 +59,8 @@ export const MultiBars = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_BARS_PA
45
59
  gridGraphicReverseScale$: d.gridGraphicReverseScale$,
46
60
  gridAxesSize$: d.gridAxesSize$,
47
61
  gridHighlight$: d.gridHighlight$,
48
- gridContainer$: d.gridContainer$,
49
- isSeriesPositionSeprate$: d.isSeriesPositionSeprate$,
62
+ gridContainerPosition$: d.gridContainerPosition$,
63
+ isSeriesSeprate$,
50
64
  event$: subject.event$ as Subject<any>,
51
65
  })
52
66
  })
@@ -1,11 +1,16 @@
1
1
  import * as d3 from 'd3'
2
2
  import {
3
- Subject } from 'rxjs'
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_BARS_TRIANGLE_PARAMS } from '../defaults'
7
12
  import { createBaseBarsTriangle } from '../../base/BaseBarsTriangle'
8
- import { multiGridDetailObservables } from '../multiGridObservables'
13
+ import { multiGridPluginObservables } from '../multiGridObservables'
9
14
  import { getClassName, getUniID } from '../../utils/orbchartsUtils'
10
15
 
11
16
  const pluginName = 'MultiBarsTriangle'
@@ -17,7 +22,7 @@ export const MultiBarsTriangle = defineMultiGridPlugin(pluginName, DEFAULT_MULTI
17
22
 
18
23
  const unsubscribeFnArr: (() => void)[] = []
19
24
 
20
- const multiGridPlugin$ = multiGridDetailObservables(observer)
25
+ const multiGridPlugin$ = multiGridPluginObservables(observer)
21
26
 
22
27
  multiGridPlugin$.subscribe(data => {
23
28
  // 每次重新計算時,清除之前的訂閱
@@ -31,21 +36,31 @@ export const MultiBarsTriangle = defineMultiGridPlugin(pluginName, DEFAULT_MULTI
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] = createBaseBarsTriangle(pluginName, {
35
47
  selection: gridSelection,
36
- computedData$: d.gridComputedData$,
48
+ computedData$: d.computedData$,
37
49
  visibleComputedData$: d.visibleComputedData$,
38
- existSeriesLabels$: d.existSeriesLabels$,
50
+ computedLayoutData$: d.computedLayoutData$,
51
+ visibleComputedLayoutData$: d.visibleComputedLayoutData$,
52
+ seriesLabels$: d.seriesLabels$,
39
53
  SeriesDataMap$: d.SeriesDataMap$,
40
54
  GroupDataMap$: d.GroupDataMap$,
41
55
  fullParams$: observer.fullParams$,
42
56
  fullChartParams$: observer.fullChartParams$,
57
+ fullDataFormatter$: d.dataFormatter$,
43
58
  gridAxesTransform$: d.gridAxesTransform$,
44
59
  gridGraphicTransform$: d.gridGraphicTransform$,
45
60
  gridAxesSize$: d.gridAxesSize$,
46
61
  gridHighlight$: d.gridHighlight$,
47
- gridContainer$: d.gridContainer$,
48
- isSeriesPositionSeprate$: d.isSeriesPositionSeprate$,
62
+ gridContainerPosition$: d.gridContainerPosition$,
63
+ isSeriesSeprate$: isSeriesSeprate$,
49
64
  event$: subject.event$ as Subject<any>,
50
65
  })
51
66
  })
@@ -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 { multiGridDetailObservables } from '../multiGridObservables'
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$ = multiGridDetailObservables(observer)
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.gridComputedData$,
36
+ computedData$: d.computedData$,
37
37
  visibleComputedData$: d.visibleComputedData$,
38
- existSeriesLabels$: d.existSeriesLabels$,
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
- gridContainer$: d.gridContainer$,
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$),
@@ -77,7 +77,8 @@ export const MultiGridLegend = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_G
77
77
  seriesLabels$,
78
78
  fullParams$,
79
79
  layout$: observer.layout$,
80
- fullChartParams$: observer.fullChartParams$
80
+ fullChartParams$: observer.fullChartParams$,
81
+ textSizePx$: observer.textSizePx$
81
82
  })
82
83
 
83
84
  return () => {
@@ -1,11 +1,16 @@
1
1
  import * as d3 from 'd3'
2
2
  import {
3
- Subject } from 'rxjs'
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 { multiGridDetailObservables } from '../multiGridObservables'
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$ = multiGridDetailObservables(observer)
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.gridComputedData$,
48
+ computedData$: d.computedData$,
37
49
  fullParams$: observer.fullParams$,
38
- fullDataFormatter$: d.gridDataFormatter$,
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
- gridContainer$: d.gridContainer$,
44
- isSeriesPositionSeprate$: d.isSeriesPositionSeprate$,
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 { multiGridDetailObservables } from '../multiGridObservables'
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$ = multiGridDetailObservables(observer)
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.gridComputedData$,
38
- existSeriesLabels$: d.existSeriesLabels$,
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.gridDataFormatter$,
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
- gridContainer$: d.gridContainer$,
51
+ gridContainerPosition$: d.gridContainerPosition$,
49
52
  layout$: observer.layout$,
50
53
  event$: subject.event$ as Subject<any>,
51
54
  })