@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.
Files changed (80) hide show
  1. package/dist/orbcharts-plugins-basic.es.js +10136 -9414
  2. package/dist/orbcharts-plugins-basic.umd.js +10 -10
  3. package/dist/src/base/BaseBarStack.d.ts +5 -1
  4. package/dist/src/base/BaseBars.d.ts +5 -1
  5. package/dist/src/base/BaseBarsTriangle.d.ts +5 -1
  6. package/dist/src/base/BaseDots.d.ts +4 -1
  7. package/dist/src/base/BaseGroupAxis.d.ts +35 -0
  8. package/dist/src/base/BaseLines.d.ts +3 -1
  9. package/dist/src/base/BaseValueAxis.d.ts +36 -0
  10. package/dist/src/grid/defaults.d.ts +3 -3
  11. package/dist/src/grid/gridObservables.d.ts +18 -4
  12. package/dist/src/grid/index.d.ts +1 -1
  13. package/dist/src/grid/plugins/GroupAux.d.ts +3 -0
  14. package/dist/src/grid/plugins/GroupAxis.d.ts +1 -3
  15. package/dist/src/grid/plugins/ValueAxis.d.ts +1 -3
  16. package/dist/src/grid/plugins/ValueStackAxis.d.ts +1 -3
  17. package/dist/src/grid/types.d.ts +1 -1
  18. package/dist/src/multiGrid/defaults.d.ts +9 -2
  19. package/dist/src/multiGrid/index.d.ts +8 -1
  20. package/dist/src/multiGrid/multiGridObservables.d.ts +12 -0
  21. package/dist/src/multiGrid/plugins/MultiBarStack.d.ts +1 -0
  22. package/dist/src/multiGrid/plugins/MultiBars.d.ts +1 -0
  23. package/dist/src/multiGrid/plugins/MultiBarsTriangle.d.ts +1 -0
  24. package/dist/src/multiGrid/plugins/MultiDots.d.ts +1 -0
  25. package/dist/src/multiGrid/plugins/MultiGroupAxis.d.ts +1 -0
  26. package/dist/src/multiGrid/plugins/MultiLines.d.ts +1 -0
  27. package/dist/src/multiGrid/plugins/MultiValueAxis.d.ts +1 -0
  28. package/dist/src/multiGrid/plugins/OverlappingValueAxes.d.ts +1 -0
  29. package/dist/src/multiGrid/types.d.ts +31 -0
  30. package/package.json +2 -2
  31. package/src/base/BaseBarStack.ts +375 -198
  32. package/src/base/BaseBars.ts +297 -191
  33. package/src/base/BaseBarsTriangle.ts +344 -229
  34. package/src/base/BaseDots.ts +285 -117
  35. package/src/base/BaseGroupAxis.ts +497 -0
  36. package/src/base/BaseLegend.ts +54 -5
  37. package/src/base/BaseLines.ts +180 -50
  38. package/src/base/BaseValueAxis.ts +475 -0
  39. package/src/grid/defaults.ts +3 -3
  40. package/src/grid/gridObservables.ts +163 -14
  41. package/src/grid/index.ts +1 -1
  42. package/src/grid/plugins/BarStack.ts +4 -0
  43. package/src/grid/plugins/Bars.ts +4 -0
  44. package/src/grid/plugins/BarsTriangle.ts +4 -0
  45. package/src/grid/plugins/Dots.ts +3 -0
  46. package/src/grid/plugins/{GroupArea.ts → GroupAux.ts} +24 -24
  47. package/src/grid/plugins/GroupAxis.ts +16 -348
  48. package/src/grid/plugins/Lines.ts +2 -0
  49. package/src/grid/plugins/ScalingArea.ts +9 -6
  50. package/src/grid/plugins/ValueAxis.ts +13 -337
  51. package/src/grid/plugins/ValueStackAxis.ts +35 -336
  52. package/src/grid/types.ts +1 -1
  53. package/src/index.ts +1 -0
  54. package/src/multiGrid/defaults.ts +120 -14
  55. package/src/multiGrid/index.ts +9 -2
  56. package/src/multiGrid/multiGridObservables.ts +279 -0
  57. package/src/multiGrid/plugins/MultiBarStack.ts +60 -0
  58. package/src/multiGrid/plugins/MultiBars.ts +59 -0
  59. package/src/multiGrid/plugins/MultiBarsTriangle.ts +58 -0
  60. package/src/multiGrid/plugins/MultiDots.ts +58 -0
  61. package/src/multiGrid/plugins/MultiGridLegend.ts +2 -7
  62. package/src/multiGrid/plugins/MultiGroupAxis.ts +53 -0
  63. package/src/multiGrid/plugins/MultiLines.ts +58 -0
  64. package/src/multiGrid/plugins/MultiValueAxis.ts +53 -0
  65. package/src/multiGrid/plugins/OverlappingValueAxes.ts +165 -0
  66. package/src/multiGrid/types.ts +39 -0
  67. package/tsconfig.dev.json +17 -0
  68. package/tsconfig.prod.json +14 -0
  69. package/vite.config.js +5 -0
  70. package/dist/src/grid/plugins/GroupArea.d.ts +0 -3
  71. package/dist/src/multiGrid/plugins/BarsAndLines.d.ts +0 -1
  72. package/dist/src/multiGrid/plugins/FirstGroupScaleAxis.d.ts +0 -0
  73. package/dist/src/multiGrid/plugins/TwoValueScaleAxes.d.ts +0 -0
  74. package/src/multiGrid/plugins/BarStackAndLines.ts +0 -0
  75. package/src/multiGrid/plugins/BarsAndLines.ts +0 -126
  76. package/src/multiGrid/plugins/BarsTriangleAndLines.ts +0 -0
  77. package/src/multiGrid/plugins/FirstGroupScaleAxis.ts +0 -0
  78. package/src/multiGrid/plugins/TwoValueScaleAxes.ts +0 -0
  79. /package/dist/src/{multiGrid/plugins/BarStackAndLines.d.ts → base/BaseGroupArea.d.ts} +0 -0
  80. /package/{dist/src/multiGrid/plugins/BarsTriangleAndLines.d.ts → src/base/BaseGroupArea.ts} +0 -0
@@ -1,15 +1,164 @@
1
- import { Observable, Subject, takeUntil, filter, map, switchMap, combineLatest, merge, distinctUntilChanged } from 'rxjs'
1
+ import * as d3 from 'd3'
2
+ import {
3
+ Observable,
4
+ Subject,
5
+ of,
6
+ takeUntil,
7
+ filter,
8
+ map,
9
+ switchMap,
10
+ combineLatest,
11
+ merge,
12
+ shareReplay,
13
+ distinctUntilChanged
14
+ } from 'rxjs'
2
15
  import type {
3
16
  ChartParams,
4
17
  HighlightTarget,
5
18
  DataFormatterGrid,
6
19
  ComputedDataGrid,
7
20
  ComputedDatumGrid,
21
+ TransformData,
22
+ ContainerPosition,
8
23
  Layout } from '@orbcharts/core'
9
24
  import { createAxisQuantizeScale } from '@orbcharts/core'
25
+ import { getClassName, getUniID } from '../utils/orbchartsUtils'
26
+
27
+ export const gridSelectionsObservable = ({ selection, pluginName, clipPathID, existedSeriesLabels$, gridContainer$, gridAxesTransform$, gridGraphicTransform$ }: {
28
+ selection: d3.Selection<any, unknown, any, unknown>
29
+ pluginName: string
30
+ clipPathID: string
31
+ // computedData$: Observable<ComputedDataGrid>
32
+ existedSeriesLabels$: Observable<string[]>
33
+ gridContainer$: Observable<ContainerPosition[]>
34
+ gridAxesTransform$: Observable<TransformData>
35
+ gridGraphicTransform$: Observable<TransformData>
36
+ }) => {
37
+ const seriesClassName = getClassName(pluginName, 'series')
38
+ const axesClassName = getClassName(pluginName, 'axes')
39
+ const graphicClassName = getClassName(pluginName, 'graphic')
40
+
41
+ const seriesSelection$ = existedSeriesLabels$.pipe(
42
+ map((existedSeriesLabels, i) => {
43
+ return selection
44
+ .selectAll<SVGGElement, string>(`g.${seriesClassName}`)
45
+ .data(existedSeriesLabels, d => d)
46
+ .join(
47
+ enter => {
48
+ return enter
49
+ .append('g')
50
+ .classed(seriesClassName, true)
51
+ .each((d, i, g) => {
52
+ const axesSelection = d3.select(g[i])
53
+ .selectAll<SVGGElement, ComputedDatumGrid[]>(`g.${axesClassName}`)
54
+ .data([i])
55
+ .join(
56
+ enter => {
57
+ return enter
58
+ .append('g')
59
+ .classed(axesClassName, true)
60
+ .attr('clip-path', `url(#${clipPathID})`)
61
+ .each((d, i, g) => {
62
+ const defsSelection = d3.select(g[i])
63
+ .selectAll<SVGDefsElement, any>('defs')
64
+ .data([i])
65
+ .join('defs')
66
+
67
+ const graphicGSelection = d3.select(g[i])
68
+ .selectAll<SVGGElement, any>('g')
69
+ .data([i])
70
+ .join('g')
71
+ .classed(graphicClassName, true)
72
+ })
73
+ },
74
+ update => update,
75
+ exit => exit.remove()
76
+ )
77
+ })
78
+ },
79
+ update => update,
80
+ exit => exit.remove()
81
+ )
82
+ }),
83
+ switchMap(selection => combineLatest({
84
+ seriesSelection: of(selection),
85
+ gridContainer: gridContainer$
86
+ })),
87
+ map(data => {
88
+ data.seriesSelection
89
+ .transition()
90
+ .attr('transform', (d, i) => {
91
+ const gridContainer = data.gridContainer[i] ?? data.gridContainer[0]
92
+ const translate = gridContainer.translate
93
+ const scale = gridContainer.scale
94
+ return `translate(${translate[0]}, ${translate[1]}) scale(${scale[0]}, ${scale[1]})`
95
+ })
96
+ return data.seriesSelection
97
+ }),
98
+ shareReplay(1)
99
+ )
100
+
101
+ // combineLatest({
102
+ // seriesSelection: seriesSelection$,
103
+ // gridContainer: gridContainer$
104
+ // }).pipe(
105
+ // switchMap(async d => d)
106
+ // ).subscribe(data => {
107
+ // data.seriesSelection
108
+ // .transition()
109
+ // .attr('transform', (d, i) => {
110
+ // const translate = data.gridContainer[i].translate
111
+ // const scale = data.gridContainer[i].scale
112
+ // return `translate(${translate[0]}, ${translate[1]}) scale(${scale[0]}, ${scale[1]})`
113
+ // })
114
+ // })
115
+
116
+
117
+ const axesSelection$ = combineLatest({
118
+ seriesSelection: seriesSelection$,
119
+ gridAxesTransform: gridAxesTransform$
120
+ }).pipe(
121
+ switchMap(async d => d),
122
+ map(data => {
123
+ return data.seriesSelection
124
+ .select<SVGGElement>(`g.${axesClassName}`)
125
+ .style('transform', data.gridAxesTransform.value)
126
+ }),
127
+ shareReplay(1)
128
+ )
129
+ const defsSelection$ = axesSelection$.pipe(
130
+ map(axesSelection => {
131
+ return axesSelection.select<SVGDefsElement>('defs')
132
+ }),
133
+ shareReplay(1)
134
+ )
135
+ const graphicGSelection$ = combineLatest({
136
+ axesSelection: axesSelection$,
137
+ gridGraphicTransform: gridGraphicTransform$
138
+ }).pipe(
139
+ switchMap(async d => d),
140
+ map(data => {
141
+ const graphicGSelection = data.axesSelection
142
+ .select<SVGGElement>(`g.${graphicClassName}`)
143
+ graphicGSelection
144
+ .transition()
145
+ .duration(50)
146
+ .style('transform', data.gridGraphicTransform.value)
147
+ return graphicGSelection
148
+ }),
149
+ shareReplay(1)
150
+ )
151
+
152
+ return {
153
+ seriesSelection$,
154
+ axesSelection$,
155
+ defsSelection$,
156
+ graphicGSelection$
157
+ }
158
+ }
10
159
 
11
160
  // 由事件取得group data的function
12
- export function gridGroupPositionFnObservable ({ fullDataFormatter$, gridAxesSize$, computedData$, fullChartParams$ }: {
161
+ export const gridGroupPositionFnObservable = ({ fullDataFormatter$, gridAxesSize$, computedData$, fullChartParams$ }: {
13
162
  fullDataFormatter$: Observable<DataFormatterGrid>
14
163
  gridAxesSize$: Observable<{
15
164
  width: number;
@@ -18,7 +167,7 @@ export function gridGroupPositionFnObservable ({ fullDataFormatter$, gridAxesSiz
18
167
  computedData$: Observable<ComputedDataGrid>
19
168
  // GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
20
169
  fullChartParams$: Observable<ChartParams>
21
- }): Observable<(event: any) => { groupIndex: number; groupLabel: string }> {
170
+ }): Observable<(event: any) => { groupIndex: number; groupLabel: string }> => {
22
171
  const destroy$ = new Subject()
23
172
 
24
173
  // 顯示範圍內的group labels
@@ -33,18 +182,18 @@ export function gridGroupPositionFnObservable ({ fullDataFormatter$, gridAxesSiz
33
182
  ).subscribe(data => {
34
183
  const groupMin = 0
35
184
  const groupMax = data.computedData[0] ? data.computedData[0].length - 1 : 0
36
- const groupScaleDomainMin = data.dataFormatter.groupAxis.scaleDomain[0] === 'auto'
37
- ? groupMin - data.dataFormatter.groupAxis.scalePadding
38
- : data.dataFormatter.groupAxis.scaleDomain[0] as number - data.dataFormatter.groupAxis.scalePadding
39
- const groupScaleDomainMax = data.dataFormatter.groupAxis.scaleDomain[1] === 'auto'
40
- ? groupMax + data.dataFormatter.groupAxis.scalePadding
41
- : data.dataFormatter.groupAxis.scaleDomain[1] as number + data.dataFormatter.groupAxis.scalePadding
185
+ const groupScaleDomainMin = data.dataFormatter.grid.groupAxis.scaleDomain[0] === 'auto'
186
+ ? groupMin - data.dataFormatter.grid.groupAxis.scalePadding
187
+ : data.dataFormatter.grid.groupAxis.scaleDomain[0] as number - data.dataFormatter.grid.groupAxis.scalePadding
188
+ const groupScaleDomainMax = data.dataFormatter.grid.groupAxis.scaleDomain[1] === 'auto'
189
+ ? groupMax + data.dataFormatter.grid.groupAxis.scalePadding
190
+ : data.dataFormatter.grid.groupAxis.scaleDomain[1] as number + data.dataFormatter.grid.groupAxis.scalePadding
42
191
 
43
192
  // const groupingAmount = data.computedData[0]
44
193
  // ? data.computedData[0].length
45
194
  // : 0
46
195
 
47
- let _labels = data.dataFormatter.grid.seriesType === 'row'
196
+ let _labels = data.dataFormatter.grid.gridData.seriesDirection === 'row'
48
197
  ? (data.computedData[0] ?? []).map(d => d.groupLabel)
49
198
  : data.computedData.map(d => d[0].groupLabel)
50
199
 
@@ -75,8 +224,8 @@ export function gridGroupPositionFnObservable ({ fullDataFormatter$, gridAxesSiz
75
224
  switchMap(async (d) => d),
76
225
  ).subscribe(data => {
77
226
 
78
- const reverse = data.dataFormatter.valueAxis.position === 'right'
79
- || data.dataFormatter.valueAxis.position === 'bottom'
227
+ const reverse = data.dataFormatter.grid.valueAxis.position === 'right'
228
+ || data.dataFormatter.grid.valueAxis.position === 'bottom'
80
229
  ? true : false
81
230
 
82
231
  // 比例尺座標對應非連續資料索引
@@ -88,8 +237,8 @@ export function gridGroupPositionFnObservable ({ fullDataFormatter$, gridAxesSiz
88
237
 
89
238
  // 依比例尺位置計算座標
90
239
  const axisValuePredicate = (event: any) => {
91
- return data.dataFormatter.groupAxis.position === 'bottom'
92
- || data.dataFormatter.groupAxis.position === 'top'
240
+ return data.dataFormatter.grid.groupAxis.position === 'bottom'
241
+ || data.dataFormatter.grid.groupAxis.position === 'top'
93
242
  ? event.offsetX - data.fullChartParams.padding.left
94
243
  : event.offsetY - data.fullChartParams.padding.top
95
244
  }
package/src/grid/index.ts CHANGED
@@ -10,4 +10,4 @@ export { GroupAxis } from './plugins/GroupAxis'
10
10
  export { ValueAxis } from './plugins/ValueAxis'
11
11
  export { ValueStackAxis } from './plugins/ValueStackAxis'
12
12
  export { ScalingArea } from './plugins/ScalingArea'
13
- export { GroupArea } from './plugins/GroupArea'
13
+ export { GroupAux } from './plugins/GroupAux'
@@ -15,6 +15,7 @@ export const BarStack = defineGridPlugin(pluginName, DEFAULT_BAR_STACK_PARAMS)((
15
15
  selection,
16
16
  computedData$: observer.computedData$,
17
17
  visibleComputedData$: observer.visibleComputedData$,
18
+ existedSeriesLabels$: observer.existedSeriesLabels$,
18
19
  SeriesDataMap$: observer.SeriesDataMap$,
19
20
  GroupDataMap$: observer.GroupDataMap$,
20
21
  fullParams$: observer.fullParams$,
@@ -22,8 +23,11 @@ export const BarStack = defineGridPlugin(pluginName, DEFAULT_BAR_STACK_PARAMS)((
22
23
  fullChartParams$: observer.fullChartParams$,
23
24
  gridAxesTransform$: observer.gridAxesTransform$,
24
25
  gridGraphicTransform$: observer.gridGraphicTransform$,
26
+ gridGraphicReverseScale$: observer.gridGraphicReverseScale$,
25
27
  gridAxesSize$: observer.gridAxesSize$,
26
28
  gridHighlight$: observer.gridHighlight$,
29
+ gridContainer$: observer.gridContainer$,
30
+ isSeriesPositionSeprate$: observer.isSeriesPositionSeprate$,
27
31
  event$: subject.event$,
28
32
  })
29
33
 
@@ -15,14 +15,18 @@ export const Bars = defineGridPlugin(pluginName, DEFAULT_BARS_PARAMS)(({ selecti
15
15
  selection,
16
16
  computedData$: observer.computedData$,
17
17
  visibleComputedData$: observer.visibleComputedData$,
18
+ existedSeriesLabels$: observer.existedSeriesLabels$,
18
19
  SeriesDataMap$: observer.SeriesDataMap$,
19
20
  GroupDataMap$: observer.GroupDataMap$,
20
21
  fullParams$: observer.fullParams$,
21
22
  fullChartParams$: observer.fullChartParams$,
22
23
  gridAxesTransform$: observer.gridAxesTransform$,
23
24
  gridGraphicTransform$: observer.gridGraphicTransform$,
25
+ gridGraphicReverseScale$: observer.gridGraphicReverseScale$,
24
26
  gridAxesSize$: observer.gridAxesSize$,
25
27
  gridHighlight$: observer.gridHighlight$,
28
+ gridContainer$: observer.gridContainer$,
29
+ isSeriesPositionSeprate$: observer.isSeriesPositionSeprate$,
26
30
  event$: subject.event$,
27
31
  })
28
32
 
@@ -13,6 +13,8 @@ export const BarsTriangle = defineGridPlugin(pluginName, DEFAULT_BARS_TRIANGLE_P
13
13
  const unsubscribeBaseBars = createBaseBarsTriangle(pluginName, {
14
14
  selection,
15
15
  computedData$: observer.computedData$,
16
+ visibleComputedData$: observer.visibleComputedData$,
17
+ existedSeriesLabels$: observer.existedSeriesLabels$,
16
18
  SeriesDataMap$: observer.SeriesDataMap$,
17
19
  GroupDataMap$: observer.GroupDataMap$,
18
20
  fullParams$: observer.fullParams$,
@@ -21,6 +23,8 @@ export const BarsTriangle = defineGridPlugin(pluginName, DEFAULT_BARS_TRIANGLE_P
21
23
  gridGraphicTransform$: observer.gridGraphicTransform$,
22
24
  gridAxesSize$: observer.gridAxesSize$,
23
25
  gridHighlight$: observer.gridHighlight$,
26
+ gridContainer$: observer.gridContainer$,
27
+ isSeriesPositionSeprate$: observer.isSeriesPositionSeprate$,
24
28
  event$: subject.event$,
25
29
  })
26
30
 
@@ -15,14 +15,17 @@ export const Dots = defineGridPlugin(pluginName, DEFAULT_DOTS_PARAMS)(({ selecti
15
15
  selection,
16
16
  computedData$: observer.computedData$,
17
17
  visibleComputedData$: observer.visibleComputedData$,
18
+ existedSeriesLabels$: observer.existedSeriesLabels$,
18
19
  SeriesDataMap$: observer.SeriesDataMap$,
19
20
  GroupDataMap$: observer.GroupDataMap$,
20
21
  fullParams$: observer.fullParams$,
21
22
  fullChartParams$: observer.fullChartParams$,
22
23
  gridAxesTransform$: observer.gridAxesTransform$,
23
24
  gridGraphicTransform$: observer.gridGraphicTransform$,
25
+ gridGraphicReverseScale$: observer.gridGraphicReverseScale$,
24
26
  gridAxesSize$: observer.gridAxesSize$,
25
27
  gridHighlight$: observer.gridHighlight$,
28
+ gridContainer$: observer.gridContainer$,
26
29
  event$: subject.event$,
27
30
  })
28
31
 
@@ -24,7 +24,7 @@ import { getColor, getClassName, getUniID } from '../../utils/orbchartsUtils'
24
24
  import { d3EventObservable } from '../../utils/observables'
25
25
  import { gridGroupPositionFnObservable } from '../gridObservables'
26
26
  import { createAxisPointScale } from '@orbcharts/core'
27
- import type { GroupAreaParams } from '../types'
27
+ import type { GroupAuxParams } from '../types'
28
28
 
29
29
  interface LineDatum {
30
30
  id: string
@@ -41,14 +41,14 @@ interface LabelDatum {
41
41
  y: number
42
42
  }
43
43
 
44
- const pluginName = 'GroupArea'
44
+ const pluginName = 'GroupAux'
45
45
  const labelClassName = getClassName(pluginName, 'label-box')
46
46
 
47
47
  function createLineData ({ groupLabel, axisX, axisHeight, fullParams }: {
48
48
  groupLabel: string
49
49
  axisX: number
50
50
  axisHeight: number
51
- fullParams: GroupAreaParams
51
+ fullParams: GroupAuxParams
52
52
  }): LineDatum[] {
53
53
  return fullParams.showLine && groupLabel
54
54
  ? [{
@@ -65,7 +65,7 @@ function renderLine ({ selection, pluginName, lineData, fullParams, fullChartPar
65
65
  selection: d3.Selection<any, unknown, any, unknown>
66
66
  pluginName: string
67
67
  lineData: LineDatum[]
68
- fullParams: GroupAreaParams
68
+ fullParams: GroupAuxParams
69
69
  fullChartParams: ChartParams
70
70
  }) {
71
71
  const gClassName = getClassName(pluginName, 'auxline')
@@ -114,7 +114,7 @@ function removeLine (selection: d3.Selection<any, unknown, any, unknown>) {
114
114
  function createLabelData ({ groupLabel, axisX, fullParams }: {
115
115
  groupLabel: string
116
116
  axisX: number
117
- fullParams: GroupAreaParams
117
+ fullParams: GroupAuxParams
118
118
  }) {
119
119
  return fullParams.showLabel && groupLabel
120
120
  ? [{
@@ -126,12 +126,12 @@ function createLabelData ({ groupLabel, axisX, fullParams }: {
126
126
  : []
127
127
  }
128
128
 
129
- function renderLabel ({ selection, labelData, fullParams, fullChartParams, gridAxesOppositeTransformValue }: {
129
+ function renderLabel ({ selection, labelData, fullParams, fullChartParams, gridAxesReverseTransformValue }: {
130
130
  selection: d3.Selection<any, unknown, any, unknown>
131
131
  labelData: LabelDatum[]
132
- fullParams: GroupAreaParams
132
+ fullParams: GroupAuxParams
133
133
  fullChartParams: ChartParams
134
- gridAxesOppositeTransformValue: string
134
+ gridAxesReverseTransformValue: string
135
135
  }) {
136
136
  const rectHeight = fullChartParams.styles.textSize + 4
137
137
 
@@ -176,7 +176,7 @@ function renderLabel ({ selection, labelData, fullParams, fullChartParams, gridA
176
176
  // .style('pointer-events', 'none')
177
177
  const rect = rectUpdate.merge(rectEnter)
178
178
  .attr('width', d => `${rectWidth}px`)
179
- .style('transform', gridAxesOppositeTransformValue)
179
+ .style('transform', gridAxesReverseTransformValue)
180
180
  rectUpdate.exit().remove()
181
181
 
182
182
  const textUpdate = d3.select(n[i])
@@ -190,7 +190,7 @@ function renderLabel ({ selection, labelData, fullParams, fullChartParams, gridA
190
190
  // .style('pointer-events', 'none')
191
191
  const text = textUpdate.merge(textEnter)
192
192
  .text(d => d.text)
193
- .style('transform', gridAxesOppositeTransformValue)
193
+ .style('transform', gridAxesReverseTransformValue)
194
194
  .attr('fill', d => getColor(fullParams.labelTextColorType, fullChartParams))
195
195
  .attr('font-size', fullChartParams.styles.textSize)
196
196
  .attr('x', rectX + 6)
@@ -208,7 +208,7 @@ function removeLabel (selection: d3.Selection<any, unknown, any, unknown>) {
208
208
  gUpdate.exit().remove()
209
209
  }
210
210
 
211
- export const GroupArea = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)(({ selection, rootSelection, name, subject, observer }) => {
211
+ export const GroupAux = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)(({ selection, rootSelection, name, subject, observer }) => {
212
212
  const destroy$ = new Subject()
213
213
 
214
214
  const rootRectSelection: d3.Selection<SVGRectElement, any, any, any> = rootSelection
@@ -283,7 +283,7 @@ export const GroupArea = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)
283
283
  // subscriber.next(transformData.value)
284
284
  // })
285
285
  // })
286
- // const oppositeTransform$: Observable<TransformData> = observer.gridAxesTransform$.pipe(
286
+ // const reverseTransform$: Observable<TransformData> = observer.gridAxesTransform$.pipe(
287
287
  // takeUntil(destroy$),
288
288
  // map(d => {
289
289
  // const translate: [number, number] = [d.translate[0] * -1, d.translate[1] * -1]
@@ -303,12 +303,12 @@ export const GroupArea = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)
303
303
  // )
304
304
  // const contentTransform$ = combineLatest({
305
305
  // fullParams: observer.fullParams$,
306
- // oppositeTransform: oppositeTransform$
306
+ // reverseTransform: reverseTransform$
307
307
  // }).pipe(
308
308
  // takeUntil(destroy$),
309
309
  // switchMap(async data => {
310
310
  // const translate = [0, 0]
311
- // return `translate(${translate[0]}px, ${translate[1]}px) rotate(${data.oppositeTransform.rotate}deg) rotateX(${data.oppositeTransform.rotateX}deg) rotateY(${data.oppositeTransform.rotateY}deg)`
311
+ // return `translate(${translate[0]}px, ${translate[1]}px) rotate(${data.reverseTransform.rotate}deg) rotateX(${data.reverseTransform.rotateX}deg) rotateY(${data.reverseTransform.rotateY}deg)`
312
312
  // }),
313
313
  // distinctUntilChanged()
314
314
  // )
@@ -324,18 +324,18 @@ export const GroupArea = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)
324
324
  ).subscribe(data => {
325
325
  const groupMin = 0
326
326
  const groupMax = data.computedData[0] ? data.computedData[0].length - 1 : 0
327
- const groupScaleDomainMin = data.fullDataFormatter.groupAxis.scaleDomain[0] === 'auto'
328
- ? groupMin - data.fullDataFormatter.groupAxis.scalePadding
329
- : data.fullDataFormatter.groupAxis.scaleDomain[0] as number - data.fullDataFormatter.groupAxis.scalePadding
330
- const groupScaleDomainMax = data.fullDataFormatter.groupAxis.scaleDomain[1] === 'auto'
331
- ? groupMax + data.fullDataFormatter.groupAxis.scalePadding
332
- : data.fullDataFormatter.groupAxis.scaleDomain[1] as number + data.fullDataFormatter.groupAxis.scalePadding
327
+ const groupScaleDomainMin = data.fullDataFormatter.grid.groupAxis.scaleDomain[0] === 'auto'
328
+ ? groupMin - data.fullDataFormatter.grid.groupAxis.scalePadding
329
+ : data.fullDataFormatter.grid.groupAxis.scaleDomain[0] as number - data.fullDataFormatter.grid.groupAxis.scalePadding
330
+ const groupScaleDomainMax = data.fullDataFormatter.grid.groupAxis.scaleDomain[1] === 'auto'
331
+ ? groupMax + data.fullDataFormatter.grid.groupAxis.scalePadding
332
+ : data.fullDataFormatter.grid.groupAxis.scaleDomain[1] as number + data.fullDataFormatter.grid.groupAxis.scalePadding
333
333
 
334
334
  const groupingLength = data.computedData[0]
335
335
  ? data.computedData[0].length
336
336
  : 0
337
337
 
338
- let _labels = data.fullDataFormatter.grid.seriesType === 'row'
338
+ let _labels = data.fullDataFormatter.grid.gridData.seriesDirection === 'row'
339
339
  // ? data.fullDataFormatter.grid.columnLabels
340
340
  // : data.fullDataFormatter.grid.rowLabels
341
341
  ? (data.computedData[0] ?? []).map(d => d.groupLabel)
@@ -352,7 +352,7 @@ export const GroupArea = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)
352
352
  })
353
353
 
354
354
 
355
- const padding = data.fullDataFormatter.groupAxis.scalePadding
355
+ const padding = data.fullDataFormatter.grid.groupAxis.scalePadding
356
356
 
357
357
  const groupScale = createAxisPointScale({
358
358
  axisLabels,
@@ -496,7 +496,7 @@ export const GroupArea = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)
496
496
  fullParams: observer.fullParams$,
497
497
  fullChartParams: observer.fullChartParams$,
498
498
  highlightTarget: highlightTarget$,
499
- gridAxesOppositeTransform: observer.gridAxesOppositeTransform$,
499
+ gridAxesReverseTransform: observer.gridAxesReverseTransform$,
500
500
  GroupDataMap: observer.GroupDataMap$,
501
501
  gridGroupPositionFn: gridGroupPositionFn$,
502
502
  }).pipe(
@@ -535,7 +535,7 @@ export const GroupArea = defineGridPlugin(pluginName, DEFAULT_GROUP_AREA_PARAMS)
535
535
  labelData,
536
536
  fullParams: data.fullParams,
537
537
  fullChartParams: data.fullChartParams,
538
- gridAxesOppositeTransformValue: data.gridAxesOppositeTransform.value
538
+ gridAxesReverseTransformValue: data.gridAxesReverseTransform.value
539
539
  })
540
540
 
541
541
  // label的事件