Collapsed Object GoJS

On WinForms I can also do it this way.

GoSubGraph gs = new GoSubGraph {CollapsedObject = new SiteNode()};

how it is done wıth GoJS? Is it possible

Things are different in GoJS compared to GoDiagram, but you can certainly achieve similar results.

First, GoSubGraph in GoDiagram is Group in GoJS. (And GoGroup --> Panel.)

Second, GoJS uses templates to define the appearance and behaviors of its Nodes and Links, including Groups. So you can define the appearance of a Group without any knowledge about the nodes and links that it contains.

Third, if the template for a group does not look the way you want it to look when it is collapsed (when Group.isSubGraphExpanded is false), you can either use Bindings to make minor changes or you can use a different template if you want to dramatically change its appearance.

I highly recommend that you learn about GoJS by reading and then all of the pages of that apply to the kind of app that you want to build.

Thank you for the suggestion