-
Notifications
You must be signed in to change notification settings - Fork 678
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
Fix graph issue when deleting node #401
Conversation
This is to fix a problem at startup regarding instantiation of objects. See: - #394 (comment) - https://discord.com/channels/729975036148056075/737970741324152882/784180656560275507
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nitpick, but happy for this be merged without!
@@ -27,7 +27,7 @@ const style = { | |||
const sizeScale = d3 | |||
.scaleLinear() | |||
.domain([0, 30]) | |||
.range([1, 3]) | |||
.range([0.5, 2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick for the future, changes like these add noise to the original PR
I also suffer from this but I think we can all each other get better
m.selectedNodes = new Set( | ||
Array.from(m.selectedNodes).filter(nId => remaining.has(nId)) | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebased my branch for #394 on top of this -- I'm noticing that when I save a file the graph loses track of which node is selected / being hovered over. Could that be related to my change of not deleting the node anymore on save?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just reproduced this on master, so it's unrelated to your changes - I am investigating what's causing this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you rebase from master the issue is now fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fix #397, graph freezing when removing a node.
The problem was that the
selectedNodes
included the deleted graph (if the user deletes it when coming from the document window, which set the selection to the document on focus).Two main changes:
hoverNode
andselectedNodes
to make sure they don't include removed notesAlso added a minor style change to the graph for better readibility.
Unfortunately right now it's not easy to add tests for the webview, this would be addressed when making it its own module.