@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.
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBars.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBarsTriangle.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseDots.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseGroupAxis.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLegend.d.ts +1 -1
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLineAreas.d.ts +3 -3
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLines.d.ts +3 -3
- package/dist/{src/base/BaseBarStack.d.ts → orbcharts-plugins-basic/src/base/BaseStackedBar.d.ts} +6 -6
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseValueAxis.d.ts +3 -2
- package/dist/{src → orbcharts-plugins-basic/src}/grid/defaults.d.ts +4 -4
- package/dist/{src → orbcharts-plugins-basic/src}/grid/gridObservables.d.ts +5 -5
- package/dist/{src → orbcharts-plugins-basic/src}/grid/index.d.ts +2 -2
- package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedBar.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedValueAxis.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/index.d.ts +7 -0
- package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/defaults.d.ts +4 -4
- package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/index.d.ts +3 -3
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedBar.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedValueAxis.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/OverlappingStackedValueAxes.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/defaults.d.ts +9 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/index.d.ts +8 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/multiValueObservables.d.ts +33 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueLegend.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueTooltip.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/Scatter.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/ScatterBubbles.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAux.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAxes.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYZoom.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/relationship/defaults.d.ts +6 -0
- package/dist/orbcharts-plugins-basic/src/relationship/index.d.ts +5 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirected.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirectedBubbles.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipLegend.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipTooltip.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/relationship/relationshipObservables.d.ts +1 -0
- package/dist/{src → orbcharts-plugins-basic/src}/series/seriesObservables.d.ts +3 -3
- package/dist/{src → orbcharts-plugins-basic/src}/utils/commonUtils.d.ts +1 -1
- package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Utils.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/utils/observables.d.ts +1 -1
- package/dist/{src → orbcharts-plugins-basic/src}/utils/orbchartsUtils.d.ts +3 -3
- package/dist/orbcharts-plugins-basic.es.js +13327 -10361
- package/dist/orbcharts-plugins-basic.umd.js +99 -49
- package/dist/src/index.d.ts +1 -5
- package/package.json +4 -4
- package/src/base/BaseBars.ts +5 -5
- package/src/base/BaseBarsTriangle.ts +6 -4
- package/src/base/BaseDots.ts +3 -54
- package/src/base/BaseGroupAxis.ts +50 -50
- package/src/base/BaseLegend.ts +25 -21
- package/src/base/BaseLineAreas.ts +4 -4
- package/src/base/BaseLines.ts +3 -3
- package/src/base/{BaseBarStack.ts → BaseStackedBar.ts} +22 -20
- package/src/base/BaseTooltip.ts +5 -2
- package/src/base/BaseValueAxis.ts +84 -81
- package/src/grid/defaults.ts +15 -13
- package/src/grid/gridObservables.ts +56 -47
- package/src/grid/index.ts +2 -2
- package/src/grid/plugins/GridLegend.ts +2 -2
- package/src/grid/plugins/GridZoom.ts +20 -20
- package/src/grid/plugins/GroupAux.ts +216 -211
- package/src/grid/plugins/{BarStack.ts → StackedBar.ts} +7 -7
- package/src/grid/plugins/{ValueStackAxis.ts → StackedValueAxis.ts} +6 -5
- package/src/grid/plugins/ValueAxis.ts +1 -0
- package/src/index.ts +2 -5
- package/src/multiGrid/defaults.ts +11 -11
- package/src/multiGrid/index.ts +3 -3
- package/src/multiGrid/plugins/MultiBars.ts +1 -1
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +1 -1
- package/src/multiGrid/plugins/MultiGridLegend.ts +2 -2
- package/src/multiGrid/plugins/MultiGroupAxis.ts +1 -1
- package/src/multiGrid/plugins/{MultiBarStack.ts → MultiStackedBar.ts} +8 -8
- package/src/multiGrid/plugins/{MultiValueStackAxis.ts → MultiStackedValueAxis.ts} +4 -3
- package/src/multiGrid/plugins/MultiValueAxis.ts +2 -1
- package/src/multiGrid/plugins/{OverlappingValueStackAxes.ts → OverlappingStackedValueAxes.ts} +9 -8
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +4 -3
- package/src/multiValue/defaults.ts +167 -0
- package/src/multiValue/index.ts +9 -0
- package/src/multiValue/multiValueObservables.ts +297 -0
- package/src/multiValue/plugins/MultiValueLegend.ts +107 -0
- package/src/multiValue/plugins/MultiValueTooltip.ts +66 -0
- package/src/multiValue/plugins/Scatter.ts +426 -0
- package/src/multiValue/plugins/ScatterBubbles.ts +554 -0
- package/src/multiValue/plugins/XYAux.ts +682 -0
- package/src/multiValue/plugins/XYAxes.ts +685 -0
- package/src/multiValue/plugins/XYZoom.ts +300 -0
- package/src/noneData/plugins/Container.ts +23 -23
- package/src/noneData/plugins/Tooltip.ts +365 -365
- package/src/relationship/defaults.ts +197 -0
- package/src/relationship/index.ts +5 -0
- package/src/relationship/plugins/ForceDirected.ts +1169 -0
- package/src/relationship/plugins/ForceDirectedBubbles.ts +1394 -0
- package/src/relationship/plugins/RelationshipLegend.ts +100 -0
- package/src/relationship/plugins/RelationshipTooltip.ts +66 -0
- package/src/relationship/relationshipObservables.ts +50 -0
- package/src/series/defaults.ts +13 -12
- package/src/series/plugins/Bubbles.ts +22 -22
- package/src/series/plugins/Pie.ts +2 -2
- package/src/series/plugins/PieEventTexts.ts +22 -21
- package/src/series/plugins/PieLabels.ts +2 -2
- package/src/series/plugins/Rose.ts +2 -2
- package/src/series/plugins/RoseLabels.ts +2 -2
- package/src/series/plugins/SeriesLegend.ts +4 -4
- package/src/series/seriesObservables.ts +3 -3
- package/src/tree/defaults.ts +3 -3
- package/src/tree/plugins/TreeLegend.ts +3 -10
- package/src/utils/commonUtils.ts +5 -5
- package/src/utils/d3Utils.ts +4 -3
- package/src/utils/observables.ts +2 -2
- package/src/utils/orbchartsUtils.ts +28 -12
- package/dist/src/grid/plugins/BarStack.d.ts +0 -1
- package/dist/src/grid/plugins/ValueStackAxis.d.ts +0 -1
- package/dist/src/multiGrid/plugins/MultiBarStack.d.ts +0 -1
- package/dist/src/multiGrid/plugins/MultiValueStackAxis.d.ts +0 -1
- package/dist/src/multiGrid/plugins/OverlappingValueStackAxes.d.ts +0 -1
- package/dist/src/multiValue/plugins/Scatter.d.ts +0 -0
- package/dist/src/multiValue/plugins/ScatterAxes.d.ts +0 -0
- package/dist/src/noneData/plugins/Container.d.ts +0 -1
- package/dist/src/noneData/plugins/Tooltip.d.ts +0 -3
- package/dist/src/relationship/index.d.ts +0 -0
- package/dist/src/relationship/plugins/Relationship.d.ts +0 -0
- package/src/base/BaseGroupArea.ts +0 -0
- package/src/multiValue/plugins/ScatterAxes.ts +0 -0
- package/src/relationship/plugins/Relationship.ts +0 -0
- /package/dist/{lib → orbcharts-plugins-basic/lib}/core-types.d.ts +0 -0
- /package/dist/{lib → orbcharts-plugins-basic/lib}/core.d.ts +0 -0
- /package/dist/{lib → orbcharts-plugins-basic/lib}/plugins-basic-types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/base/BaseTooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/base/types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/const.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Bars.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarsPN.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarsTriangle.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Dots.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridTooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridZoom.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GroupAux.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GroupAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/LineAreas.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Lines.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/ValueAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/multiGridObservables.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBars.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBarsTriangle.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiDots.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGridLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGridTooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGroupAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiLineAreas.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiLines.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiValueAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/OverlappingValueAxes.d.ts +0 -0
- /package/dist/{src/grid → orbcharts-plugins-basic/src/multiValue}/plugins/Ranking.d.ts +0 -0
- /package/dist/{src/grid → orbcharts-plugins-basic/src/multiValue}/plugins/RankingAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/noneData/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/noneData/index.d.ts +0 -0
- /package/dist/{src/base/BaseGroupArea.d.ts → orbcharts-plugins-basic/src/noneData/plugins/Container.d.ts} +0 -0
- /package/dist/{src/multiValue/index.d.ts → orbcharts-plugins-basic/src/noneData/plugins/Tooltip.d.ts} +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/index.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Bubbles.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Pie.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/PieEventTexts.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/PieLabels.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Rose.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/RoseLabels.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/SeriesLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/SeriesTooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Waffle.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/seriesUtils.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/index.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeMap.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeTooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Graphics.d.ts +0 -0
- /package/dist/{vite.config.d.ts → orbcharts-plugins-basic/vite.config.d.ts} +0 -0
- /package/src/{grid → multiValue}/plugins/Ranking.ts +0 -0
- /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 {
|
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 {
|
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
|
55
|
+
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_GROUP_AUX_PARAMS> = {
|
56
56
|
name: pluginName,
|
57
|
-
defaultParams:
|
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
|
143
|
+
const auxLineSelection = selection
|
143
144
|
.selectAll<SVGLineElement, LineDatum>(`line.${gClassName}`)
|
144
145
|
.data(lineData)
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
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
|
197
|
+
const axisLabelSelection = selection
|
197
198
|
.selectAll<SVGGElement, LabelDatum>(`g.${labelClassName}`)
|
198
199
|
.data(labelData)
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
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(
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
.
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
)
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
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
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
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.
|
488
|
-
// ? groupMin - data.fullDataFormatter.
|
489
|
-
// : data.fullDataFormatter.
|
490
|
-
// const groupScaleDomainMax = data.fullDataFormatter.
|
491
|
-
// ? groupMax + data.fullDataFormatter.
|
492
|
-
// : data.fullDataFormatter.
|
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.
|
499
|
-
// // ? data.fullDataFormatter.
|
500
|
-
// // : data.fullDataFormatter.
|
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.
|
519
|
+
// const padding = data.fullDataFormatter.groupAxis.scalePadding
|
516
520
|
|
517
|
-
// const groupScale =
|
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
|
-
|
529
|
-
|
530
|
-
|
531
|
-
}).pipe(
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
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
|
-
|
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.
|
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,
|
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,
|
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,
|
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,
|
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$ =
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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 {
|
10
|
+
import { DEFAULT_STACKED_BAR_PARAMS } from '../defaults'
|
11
11
|
import { LAYER_INDEX_OF_GRAPHIC } from '../../const'
|
12
|
-
import {
|
12
|
+
import { createBaseStackedBar } from '../../base/BaseStackedBar'
|
13
13
|
|
14
|
-
const pluginName = '
|
14
|
+
const pluginName = 'StackedBar'
|
15
15
|
|
16
|
-
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof
|
16
|
+
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_STACKED_BAR_PARAMS> = {
|
17
17
|
name: pluginName,
|
18
|
-
defaultParams:
|
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
|
36
|
+
export const StackedBar = defineGridPlugin(pluginConfig)(({ selection, name, subject, observer }) => {
|
37
37
|
const destroy$ = new Subject()
|
38
38
|
|
39
|
-
const unsubscribeBaseBars =
|
39
|
+
const unsubscribeBaseBars = createBaseStackedBar(pluginName, {
|
40
40
|
selection,
|
41
41
|
computedData$: observer.computedData$,
|
42
42
|
computedLayoutData$: observer.computedLayoutData$,
|