@orbcharts/plugins-basic 3.0.0-beta.1 → 3.0.0-beta.11

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.
Files changed (181) hide show
  1. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBars.d.ts +2 -2
  2. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBarsTriangle.d.ts +2 -2
  3. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseDots.d.ts +2 -2
  4. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseGroupAxis.d.ts +2 -2
  5. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLegend.d.ts +1 -1
  6. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLineAreas.d.ts +3 -3
  7. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLines.d.ts +3 -3
  8. package/dist/{src/base/BaseBarStack.d.ts → orbcharts-plugins-basic/src/base/BaseStackedBar.d.ts} +6 -6
  9. package/dist/{src → orbcharts-plugins-basic/src}/base/BaseValueAxis.d.ts +3 -2
  10. package/dist/{src → orbcharts-plugins-basic/src}/grid/defaults.d.ts +4 -4
  11. package/dist/{src → orbcharts-plugins-basic/src}/grid/gridObservables.d.ts +5 -5
  12. package/dist/{src → orbcharts-plugins-basic/src}/grid/index.d.ts +2 -2
  13. package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedBar.d.ts +1 -0
  14. package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedValueAxis.d.ts +1 -0
  15. package/dist/orbcharts-plugins-basic/src/index.d.ts +7 -0
  16. package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/defaults.d.ts +4 -4
  17. package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/index.d.ts +3 -3
  18. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedBar.d.ts +1 -0
  19. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedValueAxis.d.ts +1 -0
  20. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/OverlappingStackedValueAxes.d.ts +1 -0
  21. package/dist/orbcharts-plugins-basic/src/multiValue/defaults.d.ts +9 -0
  22. package/dist/orbcharts-plugins-basic/src/multiValue/index.d.ts +8 -0
  23. package/dist/orbcharts-plugins-basic/src/multiValue/multiValueObservables.d.ts +33 -0
  24. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueLegend.d.ts +1 -0
  25. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueTooltip.d.ts +1 -0
  26. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/Scatter.d.ts +3 -0
  27. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/ScatterBubbles.d.ts +3 -0
  28. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAux.d.ts +3 -0
  29. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAxes.d.ts +3 -0
  30. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYZoom.d.ts +1 -0
  31. package/dist/orbcharts-plugins-basic/src/relationship/defaults.d.ts +6 -0
  32. package/dist/orbcharts-plugins-basic/src/relationship/index.d.ts +5 -0
  33. package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirected.d.ts +3 -0
  34. package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirectedBubbles.d.ts +3 -0
  35. package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipLegend.d.ts +1 -0
  36. package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipTooltip.d.ts +1 -0
  37. package/dist/orbcharts-plugins-basic/src/relationship/relationshipObservables.d.ts +1 -0
  38. package/dist/{src → orbcharts-plugins-basic/src}/series/seriesObservables.d.ts +3 -3
  39. package/dist/{src → orbcharts-plugins-basic/src}/utils/commonUtils.d.ts +1 -1
  40. package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Utils.d.ts +2 -2
  41. package/dist/{src → orbcharts-plugins-basic/src}/utils/observables.d.ts +1 -1
  42. package/dist/{src → orbcharts-plugins-basic/src}/utils/orbchartsUtils.d.ts +3 -3
  43. package/dist/orbcharts-plugins-basic.es.js +13327 -10361
  44. package/dist/orbcharts-plugins-basic.umd.js +99 -49
  45. package/dist/src/index.d.ts +1 -5
  46. package/package.json +4 -4
  47. package/src/base/BaseBars.ts +5 -5
  48. package/src/base/BaseBarsTriangle.ts +6 -4
  49. package/src/base/BaseDots.ts +3 -54
  50. package/src/base/BaseGroupAxis.ts +50 -50
  51. package/src/base/BaseLegend.ts +25 -21
  52. package/src/base/BaseLineAreas.ts +4 -4
  53. package/src/base/BaseLines.ts +3 -3
  54. package/src/base/{BaseBarStack.ts → BaseStackedBar.ts} +22 -20
  55. package/src/base/BaseTooltip.ts +5 -2
  56. package/src/base/BaseValueAxis.ts +84 -81
  57. package/src/grid/defaults.ts +15 -13
  58. package/src/grid/gridObservables.ts +56 -47
  59. package/src/grid/index.ts +2 -2
  60. package/src/grid/plugins/GridLegend.ts +2 -2
  61. package/src/grid/plugins/GridZoom.ts +20 -20
  62. package/src/grid/plugins/GroupAux.ts +216 -211
  63. package/src/grid/plugins/{BarStack.ts → StackedBar.ts} +7 -7
  64. package/src/grid/plugins/{ValueStackAxis.ts → StackedValueAxis.ts} +6 -5
  65. package/src/grid/plugins/ValueAxis.ts +1 -0
  66. package/src/index.ts +2 -5
  67. package/src/multiGrid/defaults.ts +11 -11
  68. package/src/multiGrid/index.ts +3 -3
  69. package/src/multiGrid/plugins/MultiBars.ts +1 -1
  70. package/src/multiGrid/plugins/MultiBarsTriangle.ts +1 -1
  71. package/src/multiGrid/plugins/MultiGridLegend.ts +2 -2
  72. package/src/multiGrid/plugins/MultiGroupAxis.ts +1 -1
  73. package/src/multiGrid/plugins/{MultiBarStack.ts → MultiStackedBar.ts} +8 -8
  74. package/src/multiGrid/plugins/{MultiValueStackAxis.ts → MultiStackedValueAxis.ts} +4 -3
  75. package/src/multiGrid/plugins/MultiValueAxis.ts +2 -1
  76. package/src/multiGrid/plugins/{OverlappingValueStackAxes.ts → OverlappingStackedValueAxes.ts} +9 -8
  77. package/src/multiGrid/plugins/OverlappingValueAxes.ts +4 -3
  78. package/src/multiValue/defaults.ts +167 -0
  79. package/src/multiValue/index.ts +9 -0
  80. package/src/multiValue/multiValueObservables.ts +297 -0
  81. package/src/multiValue/plugins/MultiValueLegend.ts +107 -0
  82. package/src/multiValue/plugins/MultiValueTooltip.ts +66 -0
  83. package/src/multiValue/plugins/Scatter.ts +426 -0
  84. package/src/multiValue/plugins/ScatterBubbles.ts +554 -0
  85. package/src/multiValue/plugins/XYAux.ts +682 -0
  86. package/src/multiValue/plugins/XYAxes.ts +685 -0
  87. package/src/multiValue/plugins/XYZoom.ts +300 -0
  88. package/src/noneData/plugins/Container.ts +23 -23
  89. package/src/noneData/plugins/Tooltip.ts +365 -365
  90. package/src/relationship/defaults.ts +197 -0
  91. package/src/relationship/index.ts +5 -0
  92. package/src/relationship/plugins/ForceDirected.ts +1169 -0
  93. package/src/relationship/plugins/ForceDirectedBubbles.ts +1394 -0
  94. package/src/relationship/plugins/RelationshipLegend.ts +100 -0
  95. package/src/relationship/plugins/RelationshipTooltip.ts +66 -0
  96. package/src/relationship/relationshipObservables.ts +50 -0
  97. package/src/series/defaults.ts +13 -12
  98. package/src/series/plugins/Bubbles.ts +22 -22
  99. package/src/series/plugins/Pie.ts +2 -2
  100. package/src/series/plugins/PieEventTexts.ts +22 -21
  101. package/src/series/plugins/PieLabels.ts +2 -2
  102. package/src/series/plugins/Rose.ts +2 -2
  103. package/src/series/plugins/RoseLabels.ts +2 -2
  104. package/src/series/plugins/SeriesLegend.ts +4 -4
  105. package/src/series/seriesObservables.ts +3 -3
  106. package/src/tree/defaults.ts +3 -3
  107. package/src/tree/plugins/TreeLegend.ts +3 -10
  108. package/src/utils/commonUtils.ts +5 -5
  109. package/src/utils/d3Utils.ts +4 -3
  110. package/src/utils/observables.ts +2 -2
  111. package/src/utils/orbchartsUtils.ts +28 -12
  112. package/dist/src/grid/plugins/BarStack.d.ts +0 -1
  113. package/dist/src/grid/plugins/ValueStackAxis.d.ts +0 -1
  114. package/dist/src/multiGrid/plugins/MultiBarStack.d.ts +0 -1
  115. package/dist/src/multiGrid/plugins/MultiValueStackAxis.d.ts +0 -1
  116. package/dist/src/multiGrid/plugins/OverlappingValueStackAxes.d.ts +0 -1
  117. package/dist/src/multiValue/plugins/Scatter.d.ts +0 -0
  118. package/dist/src/multiValue/plugins/ScatterAxes.d.ts +0 -0
  119. package/dist/src/noneData/plugins/Container.d.ts +0 -1
  120. package/dist/src/noneData/plugins/Tooltip.d.ts +0 -3
  121. package/dist/src/relationship/index.d.ts +0 -0
  122. package/dist/src/relationship/plugins/Relationship.d.ts +0 -0
  123. package/src/base/BaseGroupArea.ts +0 -0
  124. package/src/multiValue/plugins/ScatterAxes.ts +0 -0
  125. package/src/relationship/plugins/Relationship.ts +0 -0
  126. /package/dist/{lib → orbcharts-plugins-basic/lib}/core-types.d.ts +0 -0
  127. /package/dist/{lib → orbcharts-plugins-basic/lib}/core.d.ts +0 -0
  128. /package/dist/{lib → orbcharts-plugins-basic/lib}/plugins-basic-types.d.ts +0 -0
  129. /package/dist/{src → orbcharts-plugins-basic/src}/base/BaseTooltip.d.ts +0 -0
  130. /package/dist/{src → orbcharts-plugins-basic/src}/base/types.d.ts +0 -0
  131. /package/dist/{src → orbcharts-plugins-basic/src}/const.d.ts +0 -0
  132. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Bars.d.ts +0 -0
  133. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarsPN.d.ts +0 -0
  134. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarsTriangle.d.ts +0 -0
  135. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Dots.d.ts +0 -0
  136. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridLegend.d.ts +0 -0
  137. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridTooltip.d.ts +0 -0
  138. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridZoom.d.ts +0 -0
  139. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GroupAux.d.ts +0 -0
  140. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GroupAxis.d.ts +0 -0
  141. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/LineAreas.d.ts +0 -0
  142. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Lines.d.ts +0 -0
  143. /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/ValueAxis.d.ts +0 -0
  144. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/multiGridObservables.d.ts +0 -0
  145. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBars.d.ts +0 -0
  146. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBarsTriangle.d.ts +0 -0
  147. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiDots.d.ts +0 -0
  148. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGridLegend.d.ts +0 -0
  149. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGridTooltip.d.ts +0 -0
  150. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGroupAxis.d.ts +0 -0
  151. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiLineAreas.d.ts +0 -0
  152. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiLines.d.ts +0 -0
  153. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiValueAxis.d.ts +0 -0
  154. /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/OverlappingValueAxes.d.ts +0 -0
  155. /package/dist/{src/grid → orbcharts-plugins-basic/src/multiValue}/plugins/Ranking.d.ts +0 -0
  156. /package/dist/{src/grid → orbcharts-plugins-basic/src/multiValue}/plugins/RankingAxis.d.ts +0 -0
  157. /package/dist/{src → orbcharts-plugins-basic/src}/noneData/defaults.d.ts +0 -0
  158. /package/dist/{src → orbcharts-plugins-basic/src}/noneData/index.d.ts +0 -0
  159. /package/dist/{src/base/BaseGroupArea.d.ts → orbcharts-plugins-basic/src/noneData/plugins/Container.d.ts} +0 -0
  160. /package/dist/{src/multiValue/index.d.ts → orbcharts-plugins-basic/src/noneData/plugins/Tooltip.d.ts} +0 -0
  161. /package/dist/{src → orbcharts-plugins-basic/src}/series/defaults.d.ts +0 -0
  162. /package/dist/{src → orbcharts-plugins-basic/src}/series/index.d.ts +0 -0
  163. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Bubbles.d.ts +0 -0
  164. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Pie.d.ts +0 -0
  165. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/PieEventTexts.d.ts +0 -0
  166. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/PieLabels.d.ts +0 -0
  167. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Rose.d.ts +0 -0
  168. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/RoseLabels.d.ts +0 -0
  169. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/SeriesLegend.d.ts +0 -0
  170. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/SeriesTooltip.d.ts +0 -0
  171. /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Waffle.d.ts +0 -0
  172. /package/dist/{src → orbcharts-plugins-basic/src}/series/seriesUtils.d.ts +0 -0
  173. /package/dist/{src → orbcharts-plugins-basic/src}/tree/defaults.d.ts +0 -0
  174. /package/dist/{src → orbcharts-plugins-basic/src}/tree/index.d.ts +0 -0
  175. /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeLegend.d.ts +0 -0
  176. /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeMap.d.ts +0 -0
  177. /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeTooltip.d.ts +0 -0
  178. /package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Graphics.d.ts +0 -0
  179. /package/dist/{vite.config.d.ts → orbcharts-plugins-basic/vite.config.d.ts} +0 -0
  180. /package/src/{grid → multiValue}/plugins/Ranking.ts +0 -0
  181. /package/src/{grid → multiValue}/plugins/RankingAxis.ts +0 -0
@@ -20,12 +20,12 @@ import type {
20
20
  TransformData,
21
21
  DataFormatterGrid,
22
22
  ChartParams } from '../../../lib/core-types'
23
- import { DEFAULT_GROUP_AREA_PARAMS } from '../defaults'
23
+ import { DEFAULT_GROUP_AUX_PARAMS } from '../defaults'
24
24
  import { parseTickFormatValue } from '../../utils/d3Utils'
25
25
  import { measureTextWidth } from '../../utils/commonUtils'
26
26
  import { getColor, getClassName, getUniID } from '../../utils/orbchartsUtils'
27
27
  import { d3EventObservable } from '../../utils/observables'
28
- import { gridGroupPosition } from '../gridObservables'
28
+ import { gridGroupPositionObservable } from '../gridObservables'
29
29
  import type { GroupAuxParams } from '../../../lib/plugins-basic-types'
30
30
  import { gridSelectionsObservable } from '../gridObservables'
31
31
  import { renderTspansOnAxis } from '../../utils/d3Graphics'
@@ -52,9 +52,9 @@ interface LabelDatum {
52
52
  const pluginName = 'GroupAux'
53
53
  const labelClassName = getClassName(pluginName, 'label-box')
54
54
 
55
- const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_GROUP_AREA_PARAMS> = {
55
+ const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_GROUP_AUX_PARAMS> = {
56
56
  name: pluginName,
57
- defaultParams: DEFAULT_GROUP_AREA_PARAMS,
57
+ defaultParams: DEFAULT_GROUP_AUX_PARAMS,
58
58
  layerIndex: LAYER_INDEX_OF_AUX,
59
59
  validator: (params, { validateColumns }) => {
60
60
  const result = validateColumns(params, {
@@ -107,11 +107,12 @@ function createLineData ({ groupLabel, axisX, axisHeight, fullParams }: {
107
107
  : []
108
108
  }
109
109
 
110
- function createLabelData ({ groupLabel, axisX, fullParams, textSizePx }: {
110
+ function createLabelData ({ groupLabel, axisX, fullParams, textSizePx, rowAmount }: {
111
111
  groupLabel: string
112
112
  axisX: number
113
113
  fullParams: GroupAuxParams
114
114
  textSizePx: number
115
+ rowAmount: number
115
116
  }) {
116
117
  const text = parseTickFormatValue(groupLabel, fullParams.labelTextFormat)
117
118
  const textArr = text.split('\n')
@@ -122,7 +123,7 @@ function createLabelData ({ groupLabel, axisX, fullParams, textSizePx }: {
122
123
  ? [{
123
124
  id: groupLabel,
124
125
  x: axisX,
125
- y: - fullParams.labelPadding,
126
+ y: - fullParams.labelPadding * rowAmount, // rowAmount 是為了把外部 container 的變形逆轉回來
126
127
  text,
127
128
  textArr,
128
129
  textWidth,
@@ -139,36 +140,36 @@ function renderLine ({ selection, pluginName, lineData, fullParams, fullChartPar
139
140
  fullChartParams: ChartParams
140
141
  }) {
141
142
  const gClassName = getClassName(pluginName, 'auxline')
142
- const update = selection
143
+ const auxLineSelection = selection
143
144
  .selectAll<SVGLineElement, LineDatum>(`line.${gClassName}`)
144
145
  .data(lineData)
145
- const enter = update
146
- .enter()
147
- .append('line')
148
- .classed(gClassName, true)
149
- // .style('stroke', '#E4E7ED')
146
+ .join(
147
+ enter => {
148
+ return enter
149
+ .append('line')
150
+ .classed(gClassName, true)
151
+ .style('stroke-width', 1)
152
+ .style('pointer-events', 'none')
153
+ .style('vector-effect', 'non-scaling-stroke')
154
+ .attr('x1', d => d.x1)
155
+ .attr('y1', d => d.y1)
156
+ .attr('x2', d => d.x2)
157
+ .attr('y2', d => d.y2)
158
+ },
159
+ update => {
160
+ const updateSelection = update
161
+ .transition()
162
+ .duration(50)
163
+ .attr('x1', d => d.x1)
164
+ .attr('y1', d => d.y1)
165
+ .attr('x2', d => d.x2)
166
+ .attr('y2', d => d.y2)
167
+ return updateSelection
168
+ },
169
+ exit => exit.remove()
170
+ )
150
171
  .style('stroke', d => getColor(fullParams.lineColorType, fullChartParams))
151
- .style('stroke-width', 1)
152
172
  .style('stroke-dasharray', fullParams.lineDashArray ?? 'none')
153
- .style('pointer-events', 'none')
154
- // .attr('opacity', 0)
155
- const auxLineSelection = update.merge(enter)
156
- // .attr('opacity', (d) => {
157
- // return d.active == true ? 1 : 0
158
- // })
159
- update.exit().remove()
160
- enter
161
- .attr('x1', d => d.x1)
162
- .attr('y1', d => d.y1)
163
- .attr('x2', d => d.x2)
164
- .attr('y2', d => d.y2)
165
- update
166
- .transition()
167
- .duration(50)
168
- .attr('x1', d => d.x1)
169
- .attr('y1', d => d.y1)
170
- .attr('x2', d => d.x2)
171
- .attr('y2', d => d.y2)
172
173
 
173
174
  return auxLineSelection
174
175
  }
@@ -193,140 +194,143 @@ function renderLabel ({ selection, labelData, fullParams, fullDataFormatter, ful
193
194
  }) {
194
195
  // const rectHeight = textSizePx + 6
195
196
 
196
- const gUpdate = selection
197
+ const axisLabelSelection = selection
197
198
  .selectAll<SVGGElement, LabelDatum>(`g.${labelClassName}`)
198
199
  .data(labelData)
199
- const gEnter = gUpdate
200
- .enter()
201
- .append('g')
202
- .classed(labelClassName, true)
203
- .style('cursor', 'pointer')
204
- const axisLabelSelection = gEnter.merge(gUpdate)
205
- gEnter
206
- .attr("transform", (d, i) => {
207
- return `translate(${d.x}, ${d.y})`
208
- })
209
- gUpdate
210
- .transition()
211
- .duration(50)
212
- .attr("transform", (d, i) => {
213
- return `translate(${d.x}, ${d.y})`
214
- })
215
- gUpdate.exit().remove()
216
-
217
- axisLabelSelection.each((datum, i, n) => {
218
- // const rectWidth = measureTextWidth(datum.text, textSizePx) + 12
219
- const rectWidth = datum.textWidth + 12
220
- const rectHeight = datum.textHeight + 6
221
- // -- label偏移位置 --
222
- let rectX = - rectWidth / 2
223
- let rectY = -2
224
- if (fullDataFormatter.grid.groupAxis.position === 'bottom') {
225
- rectX = fullParams.labelRotate
226
- ? - rectWidth + rectHeight // 有傾斜時以末端對齊(+height是為了修正移動太多)
227
- : - rectWidth / 2
228
- rectY = 2
229
- } else if (fullDataFormatter.grid.groupAxis.position === 'left') {
230
- rectX = - rectWidth + 2
231
- rectY = - rectHeight / 2
232
- } else if (fullDataFormatter.grid.groupAxis.position === 'right') {
233
- rectX = - 2
234
- rectY = - rectHeight / 2
235
- } else if (fullDataFormatter.grid.groupAxis.position === 'top') {
236
- rectX = fullParams.labelRotate
237
- ? - rectWidth + rectHeight // 有傾斜時以末端對齊(+height是為了修正移動太多)
238
- : - rectWidth / 2
239
- rectY = - rectHeight + 2
240
- }
241
-
242
- // -- rect --
243
- d3.select(n[i])
244
- .selectAll<SVGRectElement, LabelDatum>('rect')
245
- .data([datum])
246
- .join(
247
- enter => enter.append('rect')
200
+ .join(
201
+ enter => {
202
+ return enter
203
+ .append('g')
204
+ .classed(labelClassName, true)
248
205
  .style('cursor', 'pointer')
249
- .attr('rx', 5)
250
- .attr('ry', 5),
251
- update => update,
252
- exit => exit.remove()
253
- )
254
- .attr('width', d => `${rectWidth}px`)
255
- .attr('height', `${rectHeight}px`)
256
- .attr('fill', d => getColor(fullParams.labelColorType, fullChartParams))
257
- .attr('x', rectX)
258
- .attr('y', rectY - 3) // 奇怪的偏移修正
259
- .style('transform', textReverseTransformWithRotate)
260
-
261
- // const rectUpdate = d3.select(n[i])
262
- // .selectAll<SVGRectElement, LabelDatum>('rect')
263
- // .data([datum])
264
- // const rectEnter = rectUpdate
265
- // .enter()
266
- // .append('rect')
267
- // .attr('height', `${rectHeight}px`)
268
- // .attr('fill', d => getColor(fullParams.labelColorType, fullChartParams))
269
- // .attr('x', rectX)
270
- // .attr('y', rectY - 3) // 奇怪的偏移修正
271
- // .attr('rx', 5)
272
- // .attr('ry', 5)
273
- // .style('cursor', 'pointer')
274
- // // .style('pointer-events', 'none')
275
- // const rect = rectUpdate.merge(rectEnter)
276
- // .attr('width', d => `${rectWidth}px`)
277
- // .style('transform', textReverseTransformWithRotate)
278
- // rectUpdate.exit().remove()
279
-
280
- // -- text --
281
- d3.select(n[i])
282
- .selectAll<SVGTextElement, LabelDatum>('text')
283
- .data([datum])
284
- .join(
285
- enter => enter.append('text')
286
- .style('dominant-baseline', 'hanging')
287
- .style('cursor', 'pointer'),
288
- update => update,
289
- exit => exit.remove()
290
- )
291
- .style('transform', textReverseTransformWithRotate)
292
- .attr('fill', d => getColor(fullParams.labelTextColorType, fullChartParams))
293
- .attr('font-size', fullChartParams.styles.textSize)
294
- .attr('x', rectX + 6)
295
- .attr('y', rectY)
296
- .each((d, i, n) => {
297
- renderTspansOnAxis(d3.select(n[i]), {
298
- textArr: datum.textArr,
299
- textSizePx,
300
- groupAxisPosition: fullDataFormatter.grid.groupAxis.position
206
+ .attr("transform", (d, i) => {
207
+ return `translate(${d.x}, ${d.y})`
208
+ })
209
+ },
210
+ update => {
211
+ const updateSelection = update
212
+ .transition()
213
+ .duration(50)
214
+ .attr("transform", (d, i) => {
215
+ return `translate(${d.x}, ${d.y})`
216
+ })
217
+ return updateSelection
218
+ },
219
+ exit => exit.remove()
220
+ )
221
+ .each((datum, i, n) => {
222
+ // const rectWidth = measureTextWidth(datum.text, textSizePx) + 12
223
+ const rectWidth = datum.textWidth + 12
224
+ const rectHeight = datum.textHeight + 6
225
+ // -- label偏移位置 --
226
+ let rectX = - rectWidth / 2
227
+ let rectY = -2
228
+ if (fullDataFormatter.groupAxis.position === 'bottom') {
229
+ rectX = fullParams.labelRotate
230
+ ? - rectWidth + rectHeight // 有傾斜時以末端對齊(+height是為了修正移動太多)
231
+ : - rectWidth / 2
232
+ rectY = 2
233
+ } else if (fullDataFormatter.groupAxis.position === 'left') {
234
+ rectX = - rectWidth + 2
235
+ rectY = - rectHeight / 2
236
+ } else if (fullDataFormatter.groupAxis.position === 'right') {
237
+ rectX = - 2
238
+ rectY = - rectHeight / 2
239
+ } else if (fullDataFormatter.groupAxis.position === 'top') {
240
+ rectX = fullParams.labelRotate
241
+ ? - rectWidth + rectHeight // 有傾斜時以末端對齊(+height是為了修正移動太多)
242
+ : - rectWidth / 2
243
+ rectY = - rectHeight + 2
244
+ }
245
+
246
+ // -- rect --
247
+ d3.select(n[i])
248
+ .selectAll<SVGRectElement, LabelDatum>('rect')
249
+ .data([datum])
250
+ .join(
251
+ enter => enter.append('rect')
252
+ .style('cursor', 'pointer')
253
+ .attr('rx', 5)
254
+ .attr('ry', 5),
255
+ update => update,
256
+ exit => exit.remove()
257
+ )
258
+ .attr('width', d => `${rectWidth}px`)
259
+ .attr('height', `${rectHeight}px`)
260
+ .attr('fill', d => getColor(fullParams.labelColorType, fullChartParams))
261
+ .attr('x', rectX)
262
+ .attr('y', rectY - 3) // 奇怪的偏移修正
263
+ .style('transform', textReverseTransformWithRotate)
264
+
265
+ // const rectUpdate = d3.select(n[i])
266
+ // .selectAll<SVGRectElement, LabelDatum>('rect')
267
+ // .data([datum])
268
+ // const rectEnter = rectUpdate
269
+ // .enter()
270
+ // .append('rect')
271
+ // .attr('height', `${rectHeight}px`)
272
+ // .attr('fill', d => getColor(fullParams.labelColorType, fullChartParams))
273
+ // .attr('x', rectX)
274
+ // .attr('y', rectY - 3) // 奇怪的偏移修正
275
+ // .attr('rx', 5)
276
+ // .attr('ry', 5)
277
+ // .style('cursor', 'pointer')
278
+ // // .style('pointer-events', 'none')
279
+ // const rect = rectUpdate.merge(rectEnter)
280
+ // .attr('width', d => `${rectWidth}px`)
281
+ // .style('transform', textReverseTransformWithRotate)
282
+ // rectUpdate.exit().remove()
283
+
284
+ // -- text --
285
+ d3.select(n[i])
286
+ .selectAll<SVGTextElement, LabelDatum>('text')
287
+ .data([datum])
288
+ .join(
289
+ enter => enter.append('text')
290
+ .style('dominant-baseline', 'hanging')
291
+ .style('cursor', 'pointer'),
292
+ update => update,
293
+ exit => exit.remove()
294
+ )
295
+ .style('transform', textReverseTransformWithRotate)
296
+ .attr('fill', d => getColor(fullParams.labelTextColorType, fullChartParams))
297
+ .attr('font-size', fullChartParams.styles.textSize)
298
+ .attr('x', rectX + 6)
299
+ .attr('y', rectY)
300
+ .each((d, i, n) => {
301
+ renderTspansOnAxis(d3.select(n[i]), {
302
+ textArr: datum.textArr,
303
+ textSizePx,
304
+ groupAxisPosition: fullDataFormatter.groupAxis.position
305
+ })
301
306
  })
302
- })
303
307
 
304
- // const textUpdate = d3.select(n[i])
305
- // .selectAll<SVGTextElement, LabelDatum>('text')
306
- // .data([datum])
307
- // const textEnter = textUpdate
308
- // .enter()
309
- // .append('text')
310
- // .style('dominant-baseline', 'hanging')
311
- // .style('cursor', 'pointer')
312
- // // .style('pointer-events', 'none')
313
- // const text = textUpdate.merge(textEnter)
314
- // // .text(d => d.text)
315
- // .style('transform', textReverseTransformWithRotate)
316
- // .attr('fill', d => getColor(fullParams.labelTextColorType, fullChartParams))
317
- // .attr('font-size', fullChartParams.styles.textSize)
318
- // .attr('x', rectX + 6)
319
- // .attr('y', rectY)
320
- // textUpdate.exit().remove()
321
-
322
- // text.each((d, i, n) => {
323
- // renderTspansOnAxis(d3.select(n[i]), {
324
- // textArr: datum.textArr,
325
- // textSizePx,
326
- // groupAxisPosition: fullDataFormatter.grid.groupAxis.position
327
- // })
328
- // })
329
- })
308
+ // const textUpdate = d3.select(n[i])
309
+ // .selectAll<SVGTextElement, LabelDatum>('text')
310
+ // .data([datum])
311
+ // const textEnter = textUpdate
312
+ // .enter()
313
+ // .append('text')
314
+ // .style('dominant-baseline', 'hanging')
315
+ // .style('cursor', 'pointer')
316
+ // // .style('pointer-events', 'none')
317
+ // const text = textUpdate.merge(textEnter)
318
+ // // .text(d => d.text)
319
+ // .style('transform', textReverseTransformWithRotate)
320
+ // .attr('fill', d => getColor(fullParams.labelTextColorType, fullChartParams))
321
+ // .attr('font-size', fullChartParams.styles.textSize)
322
+ // .attr('x', rectX + 6)
323
+ // .attr('y', rectY)
324
+ // textUpdate.exit().remove()
325
+
326
+ // text.each((d, i, n) => {
327
+ // renderTspansOnAxis(d3.select(n[i]), {
328
+ // textArr: datum.textArr,
329
+ // textSizePx,
330
+ // groupAxisPosition: fullDataFormatter.groupAxis.position
331
+ // })
332
+ // })
333
+ })
330
334
 
331
335
  return axisLabelSelection
332
336
  }
@@ -484,20 +488,20 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
484
488
  // ).subscribe(data => {
485
489
  // const groupMin = 0
486
490
  // const groupMax = data.computedData[0] ? data.computedData[0].length - 1 : 0
487
- // const groupScaleDomainMin = data.fullDataFormatter.grid.groupAxis.scaleDomain[0] === 'auto'
488
- // ? groupMin - data.fullDataFormatter.grid.groupAxis.scalePadding
489
- // : data.fullDataFormatter.grid.groupAxis.scaleDomain[0] as number - data.fullDataFormatter.grid.groupAxis.scalePadding
490
- // const groupScaleDomainMax = data.fullDataFormatter.grid.groupAxis.scaleDomain[1] === 'auto'
491
- // ? groupMax + data.fullDataFormatter.grid.groupAxis.scalePadding
492
- // : data.fullDataFormatter.grid.groupAxis.scaleDomain[1] as number + data.fullDataFormatter.grid.groupAxis.scalePadding
491
+ // const groupScaleDomainMin = data.fullDataFormatter.groupAxis.scaleDomain[0] === 'auto'
492
+ // ? groupMin - data.fullDataFormatter.groupAxis.scalePadding
493
+ // : data.fullDataFormatter.groupAxis.scaleDomain[0] as number - data.fullDataFormatter.groupAxis.scalePadding
494
+ // const groupScaleDomainMax = data.fullDataFormatter.groupAxis.scaleDomain[1] === 'auto'
495
+ // ? groupMax + data.fullDataFormatter.groupAxis.scalePadding
496
+ // : data.fullDataFormatter.groupAxis.scaleDomain[1] as number + data.fullDataFormatter.groupAxis.scalePadding
493
497
 
494
498
  // const groupingLength = data.computedData[0]
495
499
  // ? data.computedData[0].length
496
500
  // : 0
497
501
 
498
- // let _labels = data.fullDataFormatter.grid.seriesDirection === 'row'
499
- // // ? data.fullDataFormatter.grid.columnLabels
500
- // // : data.fullDataFormatter.grid.rowLabels
502
+ // let _labels = data.fullDataFormatter.seriesDirection === 'row'
503
+ // // ? data.fullDataFormatter.columnLabels
504
+ // // : data.fullDataFormatter.rowLabels
501
505
  // ? (data.computedData[0] ?? []).map(d => d.groupLabel)
502
506
  // : data.computedData.map(d => d[0].groupLabel)
503
507
 
@@ -512,9 +516,9 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
512
516
  // })
513
517
 
514
518
 
515
- // const padding = data.fullDataFormatter.grid.groupAxis.scalePadding
519
+ // const padding = data.fullDataFormatter.groupAxis.scalePadding
516
520
 
517
- // const groupScale = createAxisPointScale({
521
+ // const groupScale = createLabelToAxisScale({
518
522
  // axisLabels,
519
523
  // axisWidth: data.gridAxesSize.width,
520
524
  // padding
@@ -524,38 +528,38 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
524
528
  // })
525
529
  // })
526
530
 
527
- const groupScaleDomain$ = combineLatest({
528
- fullDataFormatter: observer.fullDataFormatter$,
529
- gridAxesSize: observer.gridAxesSize$,
530
- computedData: observer.computedData$
531
- }).pipe(
532
- takeUntil(destroy$),
533
- switchMap(async (d) => d),
534
- map(data => {
535
- const groupMin = 0
536
- const groupMax = data.computedData[0] ? data.computedData[0].length - 1 : 0
537
- // const groupScaleDomainMin = data.fullDataFormatter.grid.groupAxis.scaleDomain[0] === 'auto'
538
- // ? groupMin - data.fullDataFormatter.grid.groupAxis.scalePadding
539
- // : data.fullDataFormatter.grid.groupAxis.scaleDomain[0] as number - data.fullDataFormatter.grid.groupAxis.scalePadding
540
- const groupScaleDomainMin = data.fullDataFormatter.grid.groupAxis.scaleDomain[0] - data.fullDataFormatter.grid.groupAxis.scalePadding
541
- const groupScaleDomainMax = data.fullDataFormatter.grid.groupAxis.scaleDomain[1] === 'max'
542
- ? groupMax + data.fullDataFormatter.grid.groupAxis.scalePadding
543
- : data.fullDataFormatter.grid.groupAxis.scaleDomain[1] as number + data.fullDataFormatter.grid.groupAxis.scalePadding
544
-
545
- return [groupScaleDomainMin, groupScaleDomainMax]
546
- }),
547
- shareReplay(1)
548
- )
531
+ // const groupScaleDomain$ = combineLatest({
532
+ // fullDataFormatter: observer.fullDataFormatter$,
533
+ // gridAxesSize: observer.gridAxesSize$,
534
+ // computedData: observer.computedData$
535
+ // }).pipe(
536
+ // takeUntil(destroy$),
537
+ // switchMap(async (d) => d),
538
+ // map(data => {
539
+ // const groupMin = 0
540
+ // const groupMax = data.computedData[0] ? data.computedData[0].length - 1 : 0
541
+ // // const groupScaleDomainMin = data.fullDataFormatter.groupAxis.scaleDomain[0] === 'auto'
542
+ // // ? groupMin - data.fullDataFormatter.groupAxis.scalePadding
543
+ // // : data.fullDataFormatter.groupAxis.scaleDomain[0] as number - data.fullDataFormatter.groupAxis.scalePadding
544
+ // const groupScaleDomainMin = data.fullDataFormatter.groupAxis.scaleDomain[0] - data.fullDataFormatter.groupAxis.scalePadding
545
+ // const groupScaleDomainMax = data.fullDataFormatter.groupAxis.scaleDomain[1] === 'max'
546
+ // ? groupMax + data.fullDataFormatter.groupAxis.scalePadding
547
+ // : data.fullDataFormatter.groupAxis.scaleDomain[1] as number + data.fullDataFormatter.groupAxis.scalePadding
548
+
549
+ // return [groupScaleDomainMin, groupScaleDomainMax]
550
+ // }),
551
+ // shareReplay(1)
552
+ // )
549
553
 
550
554
  const groupScale$ = combineLatest({
551
- groupScaleDomain: groupScaleDomain$,
555
+ groupScaleDomainValue: observer.groupScaleDomainValue$,
552
556
  gridAxesSize: observer.gridAxesSize$
553
557
  }).pipe(
554
558
  takeUntil(destroy$),
555
559
  switchMap(async (d) => d),
556
560
  map(data => {
557
561
  const groupScale: d3.ScaleLinear<number, number> = d3.scaleLinear()
558
- .domain(data.groupScaleDomain)
562
+ .domain(data.groupScaleDomainValue)
559
563
  .range([0, data.gridAxesSize.width])
560
564
  return groupScale
561
565
  })
@@ -603,7 +607,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
603
607
  // eventName: 'mouseover',
604
608
  // highlightTarget: data.highlightTarget,
605
609
  // datum: null,
606
- // gridIndex: 0, // @Q@ 暫不處理
610
+ // gridIndex: 0,
607
611
  // series: [],
608
612
  // seriesIndex: -1,
609
613
  // seriesLabel: '',
@@ -626,7 +630,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
626
630
  // eventName: 'mousemove',
627
631
  // highlightTarget: data.highlightTarget,
628
632
  // datum: null,
629
- // gridIndex: 0, // @Q@ 暫不處理
633
+ // gridIndex: 0,
630
634
  // series: [],
631
635
  // seriesIndex: -1,
632
636
  // seriesLabel: '',
@@ -649,7 +653,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
649
653
  // eventName: 'mouseout',
650
654
  // highlightTarget: data.highlightTarget,
651
655
  // datum: null,
652
- // gridIndex: 0, // @Q@ 暫不處理
656
+ // gridIndex: 0,
653
657
  // series: [],
654
658
  // seriesIndex: -1,
655
659
  // seriesLabel: '',
@@ -672,7 +676,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
672
676
  // eventName: 'click',
673
677
  // highlightTarget: data.highlightTarget,
674
678
  // datum: null,
675
- // gridIndex: 0, // @Q@ 暫不處理
679
+ // gridIndex: 0,
676
680
  // series: [],
677
681
  // seriesIndex: -1,
678
682
  // seriesLabel: '',
@@ -757,7 +761,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
757
761
  distinctUntilChanged()
758
762
  )
759
763
 
760
- const gridGroupPosition$ = gridGroupPosition({
764
+ const gridGroupPosition$ = gridGroupPositionObservable({
761
765
  rootSelection,
762
766
  fullDataFormatter$: observer.fullDataFormatter$,
763
767
  gridAxesSize$: observer.gridAxesSize$,
@@ -821,7 +825,8 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
821
825
  groupLabel: groupLabel,
822
826
  axisX,
823
827
  fullParams: data.fullParams,
824
- textSizePx: data.textSizePx
828
+ textSizePx: data.textSizePx,
829
+ rowAmount: data.rowAmount
825
830
  })
826
831
  const labelSelection = renderLabel({
827
832
  // selection: axisSelection,
@@ -832,7 +837,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
832
837
  fullChartParams: data.fullChartParams,
833
838
  // gridAxesReverseTransformValue: data.gridAxesReverseTransform.value,
834
839
  textReverseTransformWithRotate: data.textReverseTransformWithRotate,
835
- textSizePx: data.textSizePx
840
+ textSizePx: data.textSizePx,
836
841
  })
837
842
 
838
843
  // label的事件
@@ -849,7 +854,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
849
854
  eventName: 'mouseover',
850
855
  highlightTarget: data.highlightTarget,
851
856
  datum: null,
852
- gridIndex: 0, // @Q@ 暫不處理
857
+ gridIndex: 0,
853
858
  series: [],
854
859
  seriesIndex: -1,
855
860
  seriesLabel: '',
@@ -870,7 +875,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
870
875
  eventName: 'mousemove',
871
876
  highlightTarget: data.highlightTarget,
872
877
  datum: null,
873
- gridIndex: 0, // @Q@ 暫不處理
878
+ gridIndex: 0,
874
879
  series: [],
875
880
  seriesIndex: -1,
876
881
  seriesLabel: '',
@@ -893,7 +898,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
893
898
  eventName: 'mouseout',
894
899
  highlightTarget: data.highlightTarget,
895
900
  datum: null,
896
- gridIndex: 0, // @Q@ 暫不處理
901
+ gridIndex: 0,
897
902
  series: [],
898
903
  seriesIndex: -1,
899
904
  seriesLabel: '',
@@ -914,7 +919,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
914
919
  eventName: 'click',
915
920
  highlightTarget: data.highlightTarget,
916
921
  datum: null,
917
- gridIndex: 0, // @Q@ 暫不處理
922
+ gridIndex: 0,
918
923
  series: [],
919
924
  seriesIndex: -1,
920
925
  seriesLabel: '',
@@ -995,7 +1000,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
995
1000
  // eventName: 'mouseover',
996
1001
  // highlightTarget: data.highlightTarget,
997
1002
  // datum: null,
998
- // gridIndex: 0, // @Q@ 暫不處理
1003
+ // gridIndex: 0,
999
1004
  // series: [],
1000
1005
  // seriesIndex: -1,
1001
1006
  // seriesLabel: '',
@@ -1015,7 +1020,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
1015
1020
  // eventName: 'mousemove',
1016
1021
  // highlightTarget: data.highlightTarget,
1017
1022
  // datum: null,
1018
- // gridIndex: 0, // @Q@ 暫不處理
1023
+ // gridIndex: 0,
1019
1024
  // series: [],
1020
1025
  // seriesIndex: -1,
1021
1026
  // seriesLabel: '',
@@ -1035,7 +1040,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
1035
1040
  // eventName: 'mouseout',
1036
1041
  // highlightTarget: data.highlightTarget,
1037
1042
  // datum: null,
1038
- // gridIndex: 0, // @Q@ 暫不處理
1043
+ // gridIndex: 0,
1039
1044
  // series: [],
1040
1045
  // seriesIndex: -1,
1041
1046
  // seriesLabel: '',
@@ -1055,7 +1060,7 @@ export const GroupAux = defineGridPlugin(pluginConfig)(({ selection, rootSelecti
1055
1060
  // eventName: 'click',
1056
1061
  // highlightTarget: data.highlightTarget,
1057
1062
  // datum: null,
1058
- // gridIndex: 0, // @Q@ 暫不處理
1063
+ // gridIndex: 0,
1059
1064
  // series: [],
1060
1065
  // seriesIndex: -1,
1061
1066
  // seriesLabel: '',
@@ -7,15 +7,15 @@ import {
7
7
  Observable } from 'rxjs'
8
8
  import type { DefinePluginConfig } from '../../../lib/core-types'
9
9
  import { defineGridPlugin } from '../../../lib/core'
10
- import { DEFAULT_BAR_STACK_PARAMS } from '../defaults'
10
+ import { DEFAULT_STACKED_BAR_PARAMS } from '../defaults'
11
11
  import { LAYER_INDEX_OF_GRAPHIC } from '../../const'
12
- import { createBaseBarStack } from '../../base/BaseBarStack'
12
+ import { createBaseStackedBar } from '../../base/BaseStackedBar'
13
13
 
14
- const pluginName = 'BarStack'
14
+ const pluginName = 'StackedBar'
15
15
 
16
- const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_BAR_STACK_PARAMS> = {
16
+ const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_STACKED_BAR_PARAMS> = {
17
17
  name: pluginName,
18
- defaultParams: DEFAULT_BAR_STACK_PARAMS,
18
+ defaultParams: DEFAULT_STACKED_BAR_PARAMS,
19
19
  layerIndex: 5,
20
20
  validator: (params, { validateColumns }) => {
21
21
  const result = validateColumns(params, {
@@ -33,10 +33,10 @@ const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_BAR_STA
33
33
  }
34
34
  }
35
35
 
36
- export const BarStack = defineGridPlugin(pluginConfig)(({ selection, name, subject, observer }) => {
36
+ export const StackedBar = defineGridPlugin(pluginConfig)(({ selection, name, subject, observer }) => {
37
37
  const destroy$ = new Subject()
38
38
 
39
- const unsubscribeBaseBars = createBaseBarStack(pluginName, {
39
+ const unsubscribeBaseBars = createBaseStackedBar(pluginName, {
40
40
  selection,
41
41
  computedData$: observer.computedData$,
42
42
  computedLayoutData$: observer.computedLayoutData$,