Update node tree view help / implementation#6914
Conversation
77d5f98 to
a33f748
Compare
|
@prko @telephon @capital-G this is a minor cleanup after the recent s.plotTree rework. |
|
Thank you for the update. Everything looks good, but I do have one question. Is there no need to inform users about the 'plotTree' function? The server documentation provides information about NodeTreeView, but there is no mention of plotTree in the NodeTreeView documentation. Would it be beneficial to include a reference to it to help users determine whether they are using it properly? |
Possibly yes. But this PR focuses on fixing the discrepancies between the documentation and implementation, not on improving the documentation in itself. I think my main concern to consider is whether
Relatedly, I wonder whether |
@telephon do you have an opinion on this? |
|
In general, it should return the NodeTreeView. This is a breaking change, but probably not too severe? |
a33f748 to
0c8ddc2
Compare
|
@telephon thanks for the input! I updated the implementation to (again) return NodeTreeView. I updated the docs to match. I also thought that it would be cleaner to update the instance variable |
Purpose and Motivation
After merging #6834 I found some discrepancies between the documentation and the implementation.
s.plotTreereturns aNodeTreeView, as introduced in ServerTreeView: fix "group rect issue" and "node visibility issue" of #6294, fix "Rect collision issue with too many nodes" #6834. I reverted the previous change in this PR as suggested by @telephon.I made the
s.plotTreeView(the method that actually creates a view, but that's not typically called directly by the user) return the newly created instance of the NodeTreeView. In SC 3.13 this return a function that needed to be called to clean it up, or something like that. This is technically a breaking change, comparing with the state in SC 3.13. I don't think this function is meant to be used directly by the users anyway, and it's not sound-related so I'm okay with this "breaking change" (btw breaking change was introduced first in ServerTreeView: fix "group rect issue" and "node visibility issue" of #6294, fix "Rect collision issue with too many nodes" #6834)note slight interface change:
s.nodeTreeViewinstance variable is now updated by thes.plotTreemethod, NOT bys.plotTreeViewmethod. I think that's clearer? But i'm open to feedback on this. Also, both methods still return an instance ofNodeTreeView.examples in the docs assumed thatI updated the examples to get an instance of the view directly from the server -s.plotTreereturns theNodeTreeView, or its parentWindow, contrary to the previous statement abouts.plotTreereturning an instance of the server.s.nodeTreeView- instead of assigning it to a variable.I removed the note about
s.plotTreewindow automatically closing when the server is not running (this behavior was changed in ServerTreeView: fix "group rect issue" and "node visibility issue" of #6294, fix "Rect collision issue with too many nodes" #6834)This PR depends on #6913, let's merge that one first.done!Types of changes
To-do list