Skip to content

Commit 75dd430

Browse files
authored
Merge pull request #19763 from deftliang/fix-sankey-radius
feat(sankey): Add sankey chart itemStyle.borderRadius support.
2 parents 7e4c703 + 29c0f9d commit 75dd430

File tree

3 files changed

+98
-2
lines changed

3 files changed

+98
-2
lines changed

src/chart/sankey/SankeyView.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,15 @@ class SankeyView extends ChartView {
259259
const dragX = itemModel.get('localX');
260260
const dragY = itemModel.get('localY');
261261
const emphasisModel = itemModel.getModel('emphasis');
262+
const borderRadius = itemModel.get(['itemStyle', 'borderRadius']) as number | number[] || 0;
262263

263264
const rect = new graphic.Rect({
264265
shape: {
265266
x: dragX != null ? dragX * width : layout.x,
266267
y: dragY != null ? dragY * height : layout.y,
267268
width: layout.dx,
268-
height: layout.dy
269+
height: layout.dy,
270+
r: borderRadius
269271
},
270272
style: itemModel.getModel('itemStyle').getItemStyle(),
271273
z2: 10
@@ -387,7 +389,7 @@ function createGridClipShape(rect: RectLike, seriesModel: SankeySeriesModel, cb:
387389
x: rect.x - 10,
388390
y: rect.y - 10,
389391
width: 0,
390-
height: rect.height + 20
392+
height: rect.height + 20,
391393
}
392394
});
393395
graphic.initProps(rectEl, {

src/util/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,7 @@ export interface ItemStyleOption<TCbParams = never> extends ShadowOptionMixin, B
925925
color?: ZRColor | (TCbParams extends never ? never : ((params: TCbParams) => ZRColor))
926926
opacity?: number
927927
decal?: DecalObject | 'none'
928+
borderRadius?: (number | string)[] | number | string
928929
}
929930

930931
/**

test/sankey-borderRadius.html

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)