Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chart sankey does not support a->b->a pattern #8218

Open
shshen opened this issue Apr 20, 2018 · 13 comments
Open

chart sankey does not support a->b->a pattern #8218

shshen opened this issue Apr 20, 2018 · 13 comments

Comments

@shshen
Copy link

shshen commented Apr 20, 2018

Expected behaviour

sankey should be able to render a->b->a

Actual behaviour

sankey render incorrectly to b->a only.

Live demo with steps to reproduce

https://jsfiddle.net/zbnu6w36/

Product version

highcharts 6.1, but i think this does not work on all versions.

Affected browser(s)

all browser types.

@pawelfus
Copy link
Contributor

Hi @shshen

Thank you for reporting. You are right, circular references are not supported right now.

@KacperMadej
Copy link

Internal note:
Going back doesn't look good, but works for other than starting nodes.
Looks bad - "to" is not start : https://jsfiddle.net/BlackLabel/zbnu6w36/5/
Doesn't work - "to" is start: https://jsfiddle.net/BlackLabel/zbnu6w36/6/

@TorsteinHonsi
Copy link
Collaborator

I did some work here, making the layout work in some cases. At least it is better now. But now we need to set chart margins to make room for the links, the next improvement would be to make the layout flow automatically.

@hurcy
Copy link

hurcy commented Jan 29, 2019

@TorsteinHonsi Could you see this case?
a->b, b->c, c->b doesn't work.
https://jsfiddle.net/m5yjrkv1/

@TorsteinHonsi
Copy link
Collaborator

Fixed, thanks for reporting! https://jsfiddle.net/highcharts/jfeo8tdy/2/

@niran-manandhar
Copy link

ERROR RangeError: Maximum call stack size exceeded in sankey.js
any updates?

@pawelfus
Copy link
Contributor

pawelfus commented Feb 5, 2019

Hi @niran-manandhar

Could you share an example? Note that new version (with fix) is not released, only available on our master branch:

<script src="https://github.highcharts.com/highcharts.js"></script>
<script src="https://github.highcharts.com/modules/sankey.js"></script>

@niran-manandhar
Copy link

with released
https://jsfiddle.net/niran_manandhar/q9b05amd/13/
has the stack size error
with master
https://jsfiddle.net/niran_manandhar/tuj874Lz/5/
doesnt have the stack size error but chart doesn't seem right

@TorsteinHonsi
Copy link
Collaborator

You're right, there's still a geometry issue even though the stack size issue is resolved. As a workaround we can override the translate function, though there's still something wrong with the green link: https://jsfiddle.net/highcharts/jfeo8tdy/9/

@niran-manandhar
Copy link

managed to do it with margins and clip:false
https://jsfiddle.net/niran_manandhar/vL913mkb/

@sruchot
Copy link

sruchot commented Jul 22, 2020

Hello,
Someone advise me to comment this issue since it's related to one I'm having at the moment.

When having a reverse flow in your data the chart will display correctly on first render but will behave differently on any resize/update action.

A quick example is set up at: https://jsfiddle.net/Lelith/7omz94gc/1/

You just have to increase the size of the chart container to reproduce the issue.
Everything looks good on first rendering though.

(original post on HC forum was https://www.highcharts.com/forum/viewtopic.php?f=9&t=44510 )

Thanks!

@applewil
Copy link

applewil commented Dec 8, 2021

Is there a workaround for this issue?

When I plot a->d and b->c->d the arrangement is compressed until I resize the panel triggering a reflow

data: [
  ['a', 'd', 1],
  ['b', 'c', 1],
  ['c', 'd', 1]
]

Demo: https://jsfiddle.net/applewil/ezjfarh4/6/

How do I get the uncompressed node arrangement when the panel loads?

@raf18seb
Copy link
Contributor

raf18seb commented Dec 9, 2021

Hi @applewil,

As a workaround, you can use the chart.events.load event to reflow the chart, see demo: https://jsfiddle.net/BlackLabel/xw24o8kh/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants