-
Notifications
You must be signed in to change notification settings - Fork 297
‼️ Hotfix: Allow graph creation with empty nodes and links ‼️ #560
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
base: master
Are you sure you want to change the base?
Conversation
@steveblue any chance you merge this quickly and create a 9.0.2 release? |
1 similar comment
@steveblue any chance you merge this quickly and create a 9.0.2 release? |
Hi @steveblue @fhayd |
Hi @steveblue @fhayd we would like to update to 9.x, any updates for this issue? |
I quickly solved the issue by adding these:
and in typescript file
and make sure to initialize them as well in the onInit with empty values before add the actual data.
|
This doesn't solve our problem, as we want to display single nodes without any links :( |
It shows the node without links, but the error will still appear in the browser console. But this is jus a workaround to make it work smoothly. |
I ended up with this solution: if links array is empty then I push a link pointing to the single node itself, and setting the width to zero. |
Can u share the code itself? |
you could also simply add a patch: @swimlane+ngx-graph+10.0.0.patch add |
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
At the moment, graphs with 0 nodes or 0 links crash the component with
undefined
errors, because the graph is not created andthis.graph.nodes
is still invokedWhat is the new behavior?
Graphs with 0 nodes or 0 links can be used without
undefined
errors. Closes #559Does this PR introduce a breaking change? (check one with "x")
Other information:
Please merge this PR asap and create a bugfix release 9.0.2 as we currently cannot upgrade to 9.x