‼️ Hotfix: Allow graph creation with empty nodes and links ‼️#560
‼️ Hotfix: Allow graph creation with empty nodes and links ‼️#560krusche wants to merge 1 commit intoswimlane:masterfrom
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 |
|
@MarkColeman1 can you please merge this PR? |
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
undefinederrors, because the graph is not created andthis.graph.nodesis still invokedWhat is the new behavior?
Graphs with 0 nodes or 0 links can be used without
undefinederrors. 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