Skip to content

Examples gallery

25 focused, runnable scenarios. Each example is its own HTML + TS pair under demo/examples/, so you can clone the repo and pnpm dev locally, or follow the links below to the live demo.

Live gallerySource
dev.flowgl.ouranos.kr/examples/github.com/Deiamor/flowgl/tree/master/demo/examples

Basics

ExampleWhat it shows
MinimalThree nodes, two edges, default options.
Drag & connectDrag nodes, draw new connections from handles.
Snap to gridsnapGrid: 20 + matching dotted background.
Keyboard navigationTab cycle, Arrow nudge, Delete, Cmd+Z.
Read-only modereadOnly: true disables every edit.

Selection & multi-select

ExampleWhat it shows
Box selectDrag on empty canvas to rubber-band.
Cmd-click multiToggle additional nodes into the selection.
Programmatic selectionsetSelectedIds() driven by a sidebar.
Align & distributealignNodes() + distributeNodes().

Edges

ExampleWhat it shows
Animated edgesanimated: true marching ants.
Edge labelsMidpoint label with pill background.
WaypointsDrag the midpoint to create / remove waypoints.
Endpoint rerouteDrag an endpoint to a different node.

Nodes

ExampleWhat it shows
Status badgeserror / warning / success / info badges.
Custom HTML nodehtmlContent with rich HTML inside a node.
Named portsports: [{ id, side, offset }] + maxConnections.
Multi-line CJK labels한국어, 日本語, 中文测试, mixed and multi-line.

Groups & layout

ExampleWhat it shows
Groups with collapsetype: 'group' + groupDoubleClickCollapses.
dissolveGroupRemove a group container while keeping its children.
Hierarchical layouthierarchicalLayout() driving chart.setNodes.
Animated layoutchart.animateLayout(targets, duration) smoothstep.

Viewport tools

ExampleWhat it shows
Fit viewfitView / fitViewToSelection / scrollToNode.
MinimapPosition + click-to-pan.
Search & highlightsearchNodes(query) with dashed highlight.

Import / export

ExampleWhat it shows
toJSON / fromJSONSerialize, edit, deserialize roundtrip.
Export PNGexportPNG(scale) with retina upscale.
Export SVGexportSVG(padding) with proper bezier + shape polygons.

Contributing an example

Each example is a single HTML file under demo/examples/<slug>.html with inline TS and a <aside> hint card explaining what to try. Add the new <slug> to demo/vite.config.ts rollupOptions.input and add a row to the table above. PRs welcome.

Released under the MIT License.