To restore scroll position and zoom when going back from function, several changes are added.
An additional optional parameter behavior is added to scrollTo method of view.View class to customize scrolling behavior. 'smooth' is used originally but IMO, 'instant' is suited in this case.
An additional optional parameter nodeElementId is added to pushGraph method of view.View class to save target node's element id.
Added a line of code to reset the class variable view.Node.counter to 0 in renderGraph method of view.View class.
The counter variable is used in a constructor method of view.Node class. Without the resetting, different identifiers are assigned to nameless nodes when they are recreated so that negates identifying a target element to scroll to.
To restore scroll position and zoom when going back from function, several changes are added.
behavior
is added toscrollTo
method ofview.View
class to customize scrolling behavior. 'smooth' is used originally but IMO, 'instant' is suited in this case.nodeElementId
is added topushGraph
method ofview.View
class to save target node's element id.view.Node.counter
to 0 inrenderGraph
method ofview.View
class.view.Node
class. Without the resetting, different identifiers are assigned to nameless nodes when they are recreated so that negates identifying a target element to scroll to.Tested with the following models.
Clara_DenseNet_dynamo.onnx
in Clara_DenseNet_dynamo.zip (linked in https://github.com/lutzroeder/netron/issues/1225#issue-2126336662, contains a lot of nested function nodes)1334 is related.