Subgraph Expand Collapse

cnvs =[0].selection.canvas{
	if(graphic instanceof Subgraph){graphic.collapsed = false}

I would like to know how to modify this script to apply it only to the selection.
The reason I want to know that is because I want to operate on IOS.

1 Like

This script works on iOS.
But it expands ALL subgraphs in a canvas.
I’d like to do that for a selected one.

please help me someone knows .!

Instead of going from the window’s selection to the canvas and looping through all of the graphics on that canvas, you can take your list of graphics directly from the selection:[0]{
	if(graphic instanceof Subgraph){graphic.collapsed = false}

If you’re implementing this as a plug-in action which is passed a selection as its first parameter, you can reference that selection parameter directly (e.g. writing rather than going through the document to its first window (writing[0]

Hope this helps!


Hi, kcase
Thanks a lot! and it works!!!

I hope iOS app could touch Subgraphs near future !!
Then I can remove all my other mindmapping apps and make concentration to OG. ;))

1 Like