newcat / baklavajs

Graph / node editor in the browser using VueJS
http://baklava.tech
MIT License
1.6k stars 117 forks source link

Update graph.ts to access baklava.displayedGraph.selectedNodes. first pull request <3 #406

Closed code-snips closed 7 months ago

code-snips commented 7 months ago

proposed answer in discussion was not working: https://github.com/newcat/baklavajs/discussions/396#discussioncomment-8791843

newcat commented 7 months ago

I tested the solution in my comment and it works for me. Please provide the error as to why it doesn't work on your side.

In addition, the change should not be performed in the core package, since the graph implementation in that package does not know about selectedNodes - the property is only added by the renderer-vue package (see switchGraph.ts and overrides.d.ts). When only using the core package (e.g. on the server side) your change would lead to infinite recursion.

code-snips commented 7 months ago

reopened issue https://github.com/newcat/baklavajs/discussions/396#discussioncomment-9072182