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

Nodes do not update correctly (edges do) #53

Open
chriscarex opened this issue Jul 3, 2018 · 6 comments
Open

Nodes do not update correctly (edges do) #53

chriscarex opened this issue Jul 3, 2018 · 6 comments

Comments

@chriscarex
Copy link

Hi,
when clicking on a node, I would like to change the color and background properties of the clicked nodes and neighbours (including connecting edges)

The nodes change properties correctly, while the nodes do not seem to change, unless I redraw the canvas.

Any ideas on why that's the case? Workarounds, suggestions, etc?

@ahas36
Copy link

ahas36 commented Jul 13, 2018

Hi,
I'm facing the same problem. In my case, when I add or remove nodes, the graph updates without any problem. But when I'm changing properties of an exiting node (e.g. it's label or value), the graph remains same.

A quick update. When I manually call setData() method, the graph gets updated.

@chriscarex
Copy link
Author

I confirm that setData() works, but it redraws the graph, which is a thing I would like to avoid.
any updates?

@matttk
Copy link

matttk commented Jul 19, 2018

What's worse is that setData() doesn't REALLY work because of #22 - the zoom and pan get reset, which is hardly ideal behaviour.

@LukeDefeo
Copy link

hi guys how to do manually call set data?

@chriscarex
Copy link
Author

render a component like this:
<Graph
getNetwork={network => this.setState({ network })}
graph={graphData}
options={options}
events={events}
/>

then in your methods, add
const {network} = this.state;
network.setData(nodesEdges);

@bennofatius
Copy link

Hi! Facing the same issue and am curious of you have ever found a good solution here?

I confirm that setData() works, but it redraws the graph, which is a thing I would like to avoid.
any updates?

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

No branches or pull requests

5 participants