# Sankey nodes rearranging after moving node

**URL:** <https://community.plotly.com/t/sankey-nodes-rearranging-after-moving-node/42266>\
**Category:** plotly.js\
**Created:** [July 10, 2020, 1:53am UTC](https://community.plotly.com/t/sankey-nodes-rearranging-after-moving-node/42266 "2020-07-10T01:53:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glenn](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@Glenn](https://community.plotly.com/u/Glenn)\
**Post date:** [July 10, 2020, 1:53am UTC](https://community.plotly.com/t/sankey-nodes-rearranging-after-moving-node/42266/1 "2020-07-10T01:53:45Z")

</div>

Hi all,

I have a Sankey chart which gets data through an API, populates the graphData object and then executes a react() to plot the graph. This is working correctly with no issues at all.

I have a button on the page which changes the data that the API receives, populates the graphData object again, and then executes a react() a second time.

This works correctly if any of the nodes haven’t been moved (or if in fixed moved), however if any of the nodes from the first graph have moved prior to replotting the graph, the arrangement of the nodes seems to be completely arbitrary on the second plot and the nodes reposition horizontally when moved (in perpendicular mode).

I am setting responsive to true when executing react().

Does anyone know why this would be happening?

---

<div class="post-metadata">

**Author:** ![tgmangolini](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@tgmangolini](https://community.plotly.com/u/tgmangolini)\
**Post date:** [September 18, 2021, 1:39am UTC](https://community.plotly.com/t/sankey-nodes-rearranging-after-moving-node/42266/2 "2021-09-18T01:39:02Z")

</div>

I solved this by setting node y = [] and x = [] after change the dataset
