Skip to main content

Nested Groups

Learn about how JsPlumb lets you work with groups nested to an arbitrary level, with full drag and drop support.
Vanilla JS
React
Angular
Vue
Svelte
Typescript
Drag Node
Drag Group
Drag Elastic Group
JsPlumb - JavaScript and Typescript diagramming library that fuels exceptional UIs

The source code for this demo is available on Github.

Vanilla JS
https://github.com/jsplumb-demonstrations/groups

If you haven't got a license for JsPlumb, we offer 30 day evaluations.

Start a free trial

Nested Groups

JsPlumb has comprehensive support for groups, which can be nested to an arbitrary level. When groups are collapsed any edges to/from children of the group are relocated to the group. You can collapse and expand groups in this demo with the `-` and `+` buttons.

Group 1 in this demo has `autoSize` switched on, and will resize when new nodes are dropped into the group, or nodes are deleted or dragged out.

Group 2 has `constrain` set, meaning that child nodes cannot be dragged outside of its bounds.

Elastic Groups

The headless group in this app is an elastic group, which is a type of group that is available from 6.10.0 onwards. When you drag a child node around in an elastic group, the group will resize to always encompass its child nodes (while still respecting any minSize or maxSize you may have set). If you want to drag a node out of an elastic group, hold down the Shift key while dragging.

By default, an elastic group will resize from any edge. This can be switched off programmatically via setting `allowResizeFromOrigin:false` on a group definition, and you can also switch it off on an ad-hoc basis by holding down the Ctrl or Meta key while dragging (on a Mac the Meta key is the Command key).

Further reading

Read about this demo itself in our docs: https://docs.jsplumbtoolkit.com/toolkit/7.x/lib/starter-app-groups

Read about groups in detail here: https://docs.jsplumbtoolkit.com/toolkit/7.x/lib/groups

More Demos
See all demos

Flowchart builder application - JsPlumb - Angular, React, Vue, Svelte diagramming library

Flowchart

Gantt chart builder application - JsPlumb, flowcharts, chatbots, bar charts, decision trees, mindmaps, org charts, gantt charts and more

Gantt

Chatbot builder application - JsPlumb, flowcharts, chatbots, bar charts, decision trees, mindmaps, org charts, gantt charts and more

Chatbot

Callflow builder application - JsPlumb, build diagrams and rich visual UIs fast

Call Flow

Kanban application - JsPlumb, build diagrams and rich visual UIs fast

Kanban

Network topology diagram builder - JsPlumb, build diagrams and rich visual UIs fast

Network Topology

Database schema builder application - JsPlumb, leading alternative to GoJS, JointJS and ReactFlow

Database Schema

Org Chart application - JsPlumb, leading alternative to GoJS, JointJS and ReactFlow

Org Chart

Mindmap builder application - JsPlumb - JavaScript and Typescript diagramming library that fuels exceptional UIs

Mindmap

Element grouping demonstration - JsPlumb, flowcharts, chatbots, bar charts, decision trees, mindmaps, org charts, gantt charts and more

Nested Groups

Path tracing demonstration - JsPlumb, leading alternative to GoJS, JointJS and ReactFlow

Path Tracing

Hello world demonstration - JsPlumb - When you've reached the limit with ReactFlow, we can help!

Hello World

Image processor application - JsPlumb - Angular, React, Vue, Svelte diagramming library

Image Processor

Neighbour views dynamic selections demonstration - JsPlumb, build diagrams and rich visual UIs fast

Neighbourhood Views

Active filtering demonstration - JsPlumb, leading alternative to GoJS, JointJS and ReactFlow

Active Filtering

Org chart layout demonstration - JsPlumb, leading alternative to GoJS, JointJS and ReactFlow

Hierarchy Layout

CAD Drawing tools demonstration - JsPlumb - JavaScript and Typescript diagramming library that fuels exceptional UIs

Connector Editors

Force directed layout demonstration, org chart layout demonstration - JsPlumb - When you've reached the limit with ReactFlow, we can help!

Layouts

Collapsible hierarchy Italic language family demonstration - JsPlumb - Angular, React, Vue, Svelte diagramming library

Collapsible Hierarchy

Nested instances desktop example - JsPlumb, flowcharts, chatbots, bar charts, decision trees, mindmaps, org charts, gantt charts and more

Nested Instances