In https://github.com/plotly/plotly.py/issues/1536, @adurivault discovered a combination of Sankey links that causes Plotly.js to freeze up.
CodePen: https://codepen.io/jonmmease/pen/OGGPjL?editors=1010
var fig = {
"data": [
{
"link": {
"source": [
2,
2,
4,
2,
3,
0,
1,
0
],
"target": [
0,
4,
2,
3,
2,
4,
2,
1
],
"value": [
1,
1,
1,
1,
1,
1,
1,
1
]
},
"node": {
"label": [
"A",
"B",
"C",
"D",
"E"
]
},
"type": "sankey"
}
],
"layout": {}
}
Plotly.newPlot('myDiv', fig, {showSendToCloud: true});
Interestingly, if any single link is commented out, then the diagram renders successfully.
Thanks for reporting this @jonmmease. It is indeed misbehaving.
The problem is with the following function which never completes: https://github.com/tomshanley/d3-sankey-circular/blob/dbb238a97da7177b6b69dd00cb81106b1253f97e/src/sankeyCircular.js#L401-L440
As a first step, I opened an issue upstream at https://github.com/tomshanley/d3-sankey-circular/issues/35
Here's another dataset that fails as reported by @joetristano: https://github.com/plotly/plotly.js/issues/3844#issue-441844098
Codepen from his comment https://codepen.io/joetristano/pen/wbKjbo#0
Hi All, any updates on this issue? I also have this data set that wont render
[{'link': {'source': [34, 27, 28, 22, 7, 25, 28, 27, 19, 28, 9, 10, 7, 5, 9, 33, 27, 8, 6, 22, 19, 15, 6, 10, 27, 9, 26, 36, 17, 15, 25, 9, 5, 6, 34, 8, 27, 22, 17, 17, 19, 7, 9, 34, 22, 22, 22, 22, 10, 10, 6, 7, 12, 10, 12, 15, 36, 28, 28, 17, 12, 12, 36, 7, 7, 13, 5, 13, 9, 34, 7, 15, 4, 8, 13, 9, 17, 27, 5, 12, 9, 19, 22, 28, 19, 10, 17, 13, 8, 26, 6, 12, 22, 8, 33, 4, 28, 27, 9, 10, 22, 27, 7, 27, 33, 28, 8, 4, 22, 5, 22, 17, 34, 4, 26, 12, 34, 22, 26, 34, 12, 27, 10, 9, 9, 34, 13, 25, 34, 27, 9, 25, 26, 19, 12, 22, 9, 28, 27, 18, 9, 6, 17, 26, 7, 13, 34, 25, 6, 22, 4, 7, 33, 12, 34, 27, 4, 19, 34, 18, 19, 19, 34, 36, 27, 28, 12, 27, 4, 10, 7, 12, 28, 6, 18], 'target': [13, 27, 25, 22, 5, 6, 6, 33, 22, 8, 6, 9, 27, 25, 8, 22, 9, 19, 10, 33, 9, 19, 25, 22, 22, 7, 27, 27, 5, 7, 22, 18, 7, 27, 26, 7, 13, 10, 34, 7, 7, 9, 28, 28, 25, 34, 6, 19, 18, 8, 28, 7, 15, 27, 19, 10, 22, 7, 27, 25, 22, 9, 10, 10, 19, 9, 10, 28, 26, 34, 22, 9, 19, 27, 22, 13, 4, 36, 4, 7, 34, 28, 8, 34, 10, 15, 8, 34, 10, 9, 7, 10, 13, 5, 26, 8, 9, 28, 33, 19, 26, 7, 8, 26, 27, 10, 9, 10, 28, 27, 7, 10, 22, 17, 22, 8, 10, 27, 34, 27, 25, 8, 10, 10, 9, 25, 10, 28, 33, 34, 27, 25, 33, 34, 34, 36, 19, 22, 18, 9, 22, 9, 9, 10, 4, 27, 6, 34, 22, 9, 27, 34, 10, 28, 9, 6, 7, 27, 36, 10, 8, 18, 7, 34, 19, 13, 18, 10, 5, 7, 28, 27, 19, 34, 8], 'value': [5, 8164, 4, 3, 31, 9, 459, 39, 2, 1, 77, 806, 1, 1, 16, 96, 84, 2, 23, 67, 7, 5, 1, 2, 2545, 14, 10, 1, 5, 1, 23, 1, 13, 15, 15, 6, 27, 147, 1, 5, 11, 6, 109, 42, 32, 604, 444, 2, 3, 82, 661, 9, 17, 10564, 7, 80, 80, 1, 53, 1, 11, 307, 1, 39, 1, 3, 6, 227, 78, 878, 1, 5, 1, 7, 122, 20, 32, 9, 31, 15, 129, 1, 1, 17, 38, 116, 1, 3, 55, 24, 1, 4211, 124, 1, 23, 3, 31, 470, 5, 44, 168, 10, 12, 95, 3, 74, 19, 6, 1098, 1, 1, 9, 407, 59, 254, 44, 159, 2441, 13, 661, 21, 20, 2, 302, 2385, 68, 7, 2, 1, 947, 11, 94, 18, 1, 4, 80, 13, 1394, 2, 1, 454, 7, 1, 18, 31, 2, 54, 62, 561, 486, 1, 2, 2, 2, 133, 294, 3, 5, 5, 2, 5, 1, 2, 2, 17, 212, 3, 9144, 16, 61, 1, 1693, 1, 7, 1]}, 'node': {'line': {'color': 'black', 'width': 0.5}, 'label': ['A', 'B', 'C', 'D', 'E', 'F', 'G, 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'BB', 'CC', 'DD', 'EE', ' FF', 'GG', 'HH', 'II', 'JJ', 'KK', 'LL'], 'thickness': 20, 'pad': 15, 'color': ['blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue', 'blue']}, 'type': 'sankey'}]
Thank you for posting your dataset @joetristano. I haven't had time to tackle the issue upstream tomshanley/d3-sankey-circular#35 but I will give it a look soon. I'll keep you posted.
@joetristano can you confirm that the bundle built off #3932 fixes your problem?
Minified bundle: https://40395-45646037-gh.circle-artifacts.com/0/dist/plotly.min.js
@antoinerg - That bundle fixes my problem. Can you let me know when it has been merged into plotly.py ?
Thanks
Joe
Thank you @joetristano for confirming this fixes your issue!
The PR hasn't been merged into master yet but it should be part of our next minor release which will be v1.49.0. You can follow the progress in PR #3932