Skip to content

Commit ee3d3d5

Browse files
committed
fix(Sankey): some fields should be hard coded
1 parent ac0a2ec commit ee3d3d5

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/plots/sankey/adaptor.ts

+2-13
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,7 @@ function defaultOptions(params: Params<SankeyOptions>): Params<SankeyOptions> {
3838
*/
3939
function geometry(params: Params<SankeyOptions>): Params<SankeyOptions> {
4040
const { chart, options } = params;
41-
const {
42-
color,
43-
nodeStyle,
44-
edgeStyle,
45-
label,
46-
tooltip,
47-
nodeState,
48-
edgeState,
49-
sourceField,
50-
targetField,
51-
rawFields = [],
52-
} = options;
41+
const { color, nodeStyle, edgeStyle, label, tooltip, nodeState, edgeState, rawFields = [] } = options;
5342

5443
// 1. 组件,优先设置,因为子 view 会继承配置
5544
chart.legend(false);
@@ -73,7 +62,7 @@ function geometry(params: Params<SankeyOptions>): Params<SankeyOptions> {
7362
xField: X_FIELD,
7463
yField: Y_FIELD,
7564
seriesField: COLOR_FIELD,
76-
rawFields: [sourceField, targetField, ...rawFields],
65+
rawFields: ['source', 'target', ...rawFields],
7766
edge: {
7867
color,
7968
style: edgeStyle,

0 commit comments

Comments
 (0)