apache / apache/echarts

桑基图设置layoutIterations: 0,排序仍然有问题

Open
#20,079 3 comments 0 reactions 0 assignees View on GitHub
bug pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
15h 17m
Merged PRs (30d)
5

Description

### Version

5.5.0

### Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=sankey-itemstyle&version=5.5.0

### Steps to Reproduce

option = {
tooltip: {
trigger: 'item',
triggerOn: 'mousemove'
},
animation: false,
series: [
{
type: 'sankey',
bottom: '10%',
emphasis: {
focus: 'adjacency'
},
data: [

{

"name": "步骤一",

"value": 1085,

"id": "1",

"mergeIdList": null,
x: 10,
y: 10

},

{

"name": "步骤五",

"value": 192,

"id": "2",

"mergeIdList": null,

},

{

"name": "步骤四",

"value": 184,

"id": "11",

"mergeIdList": null,

},

{

"name": "步骤三",

"value": 176,

"id": "23",

"mergeIdList": null

},

{

"name": "步骤二",

"value": 170,

"id": "5",

"mergeIdList": null

},

{

"name": "步骤四",

"value": 109,

"id": "6",

"mergeIdList": null

},

{

"name": "步骤二",

"value": 101,

"id": "3",

"mergeIdList": null

},

{

"name": "步骤三",

"value": 87,

"id": "12",

"mergeIdList": null

},

{

"name": "步骤五",

"value": 84,

"id": "16",

"mergeIdList": null

},

{

"name": "步骤二",

"value": 67,

"id": "7",

"mergeIdList": null

},

{

"name": "步骤四",

"value": 41,

"id": "27",

"mergeIdList": null

},

{

"name": "步骤三",

"value": 40,

"id": "4",

"mergeIdList": null

},

{

"name": "步骤五",

"value": 38,

"id": "8",

"mergeIdList": null

},

{

"name": "步骤三",

"value": 25,

"id": "13",

"mergeIdList": null

},

{

"name": "步骤五",

"value": 25,

"id": "17",

"mergeIdList": null

},

{

"name": "步骤二",

"value": 16,

"id": "18",

"mergeIdList": null

},

{

"name": "步骤四",

"value": 15,

"id": "9",

"mergeIdList": null

},

{

"name": "步骤四",

"value": 10,

"id": "14",

"mergeIdList": null

},

{

"name": "步骤三",

"value": 9,

"id": "10",

"mergeIdList": null

},

{

"name": "步骤二",

"value": 9,

"id": "24",

"mergeIdList": null

},

{

"name": "步骤五",

"value": 6,

"id": "29",

"mergeIdList": null

},

{

"name": "步骤三",

"value": 9,

"id": "28",

"mergeIdList": null

},

{

"name": "步骤二",

"value": 6,

"id": "15",

"mergeIdList": null

},

{

"name": "步骤四",

"value": 4,

"id": "25",

"mergeIdList": null

},

{

"name": "步骤五",

"value": 1,

"id": "19",

"mergeIdList": null

},

{

"name": "步骤三",

"value": 2,

"id": "20",

"mergeIdList": null

},

{

"name": "步骤四",

"value": 2,

"id": "30",

"mergeIdList": null

},

{

"name": "步骤五",

"value": 1,

"id": "26",

"mergeIdList": null

},

{

"name": "步骤二",

"value": 1,

"id": "31",

"mergeIdList": null

},

{

"name": "步骤四",

"value": 2,

"id": "32",

"mergeIdList": null

},

{

"name": "步骤五",

"value": 1,

"id": "21",

"mergeIdList": null

},

{

"name": "步骤四",

"value": 1,

"id": "22",

"mergeIdList": null

},

{

"name": "步骤五",

"value": 1,

"id": "33",

"mergeIdList": null

},

{

"name": "步骤三",

"value": 1,

"id": "34",

"mergeIdList": null

}

],
links: [

{

"source": "17",

"target": "10",

"value": 9

},

{

"source": "7",

"target": "17",

"value": 25

},

{

"source": "16",

"target": "7",

"value": 67

},

{

"source": "7",

"target": "13",

"value": 25

},

{

"source": "14",

"target": "15",

"value": 6

},

{

"source": "9",

"target": "24",

"value": 9

},

{

"source": "10",

"target": "25",

"value": 4

},

{

"source": "1",

"target": "2",

"value": 192

},

{

"source": "23",

"target": "6",

"value": 109

},

{

"source": "25",

"target": "26",

"value": 1

},

{

"source": "16",

"target": "27",

"value": 41

},

{

"source": "18",

"target": "29",

"value": 6

},

{

"source": "20",

"target": "32",

"value": 2

},

{

"source": "5",

"target": "12",

"value": 87

},

{

"source": "23",

"target": "16",

"value": 84

},

{

"source": "12",

"target": "27",

"value": 41

},

{

"source": "7",

"target": "9",

"value": 15

},

{

"source": "24",

"target": "25",

"value": 4

},

{

"source": "3",

"target": "4",

"value": 40

},

{

"source": "21",

"target": "22",

"value": 1

},

{

"source": "24",

"target": "28",

"value": 9

},

{

"source": "32",

"target": "33",

"value": 1

},

{

"source": "6",

"target": "8",

"value": 38

},

{

"source": "10",

"target": "15",

"value": 6

},

{

"source": "17",

"target": "14",

"value": 10

},

{

"source": "12",

"target": "7",

"value": 67

},

{

"source": "1",

"target": "11",

"value": 184

},

{

"source": "2",

"target": "6",

"value": 109

},

{

"source": "10",

"target": "19",

"value": 1

},

{

"source": "17",

"target": "24",

"value": 9

},

{

"source": "13",

"target": "14",

"value": 10

},

{

"source": "27",

"target": "13",

"value": 25

},

{

"source": "13",

"target": "24",

"value": 9

},

{

"source": "8",

"target": "13",

"value": 25

},

{

"source": "11",

"target": "3",

"value": 101

},

{

"source": "9",

"target": "29",

"value": 6

},

{

"source": "29",

"target": "28",

"value": 9

},

{

"source": "27",

"target": "17",

"value": 25

},

{

"source": "18",

"target": "10",

"value": 9

},

{

"source": "23",

"target": "3",

"value": 101

},

{

"source": "11",

"target": "12",

"value": 87

},

{

"source": "12",

"target": "8",

"value": 38

},

{

"source": "3",

"target": "27",

"value": 41

},

{

"source": "2",

"target": "3",

"value": 101

},

{

"source": "1",

"target": "5",

"value": 170

},

{

"source": "4",

"target": "17",

"value": 25

},

{

"source": "6",

"target": "4",

"value": 40

},

{

"source": "5",

"target": "16",

"value": 84

},

{

"source": "18",

"target": "14",

"value": 10

},

{

"source": "8",

"target": "9",

"value": 15

},

{

"source": "28",

"target": "31",

"value": 1

},

{

"source": "33",

"target": "34",

"value": 1

},

{

"source": "5",

"target": "6",

"value": 109

},

{

"source": "29",

"target": "15",

"value": 6

},

{

"source": "16",

"target": "4",

"value": 40

},

{

"source": "20",

"target": "21",

"value": 1

},

{

"source": "27",

"target": "18",

"value": 16

},

{

"source": "9",

"target": "10",

"value": 9

},

{

"source": "8",

"target": "18",

"value": 16

},

{

"source": "4",

"target": "9",

"value": 15

},

{

"source": "2",

"target": "12",

"value": 87

},

{

"source": "19",

"target": "20",

"value": 2

},

{

"source": "28",

"target": "30",

"value": 2

},

{

"source": "6",

"target": "7",

"value": 67

},

{

"source": "4",

"target": "18",

"value": 16

},

{

"source": "13",

"target": "29",

"value": 6

},

{

"source": "1",

"target": "23",

"value": 176

},

{

"source": "11",

"target": "16",

"value": 84

},

{

"source": "3",

"target": "8",

"value": 38

},

{

"source": "31",

"target": "32",

"value": 2

},

{

"source": "15",

"target": "20",

"value": 2

},

{

"source": "14",

"target": "28",

"value": 9

}

],
label: {

normal: {

show: true, // 显示标签

position: '', // 标签位置

formatter: function(node) {

// 自定义标签内容

return node.data.name +'\n' + node.data.value;

}

}

},
layoutIterations: 0,
nodeGap: 42,
lineStyle: {
color: 'source',
curveness: 0.5
}
}
]
};

### Current Behavior

![Snipaste_2024-06-26_18-55-03](https://github.com/apache/echarts/assets/54066851/b59feeae-4af9-48a1-9630-e8f84a04faf0)

### Expected Behavior

![Snipaste_2024-06-26_18-56-14](https://github.com/apache/echarts/assets/54066851/bdff5d20-f263-43af-a79f-d399c2328914)

### Environment

```markdown
- OS:
- Browser:
- Framework:
```

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked ECharts Sankey minimal reproduction and inspect the Sankey layout path handling layoutIterations: 0. Reproduce the ordering problem with the supplied option and determine what sorting behavior is expected when iterations are disabled; done means the resulting node order is correct in that case.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.