Our samples demonstrate how to build several Diagram types and showcase specific features and layouts. You can use the HTML and JavaScript in these samples as the starting point for your application.
If you are done looking around and are ready to experiment with GoJS, read the getting started tutorial.
If you are looking for examples of a particular GoJS method or property, you can search the source code of all samples and extensions and documentation on GitHub:
A standard flowchart, showing different node templates and several data bindings. Each node has 3 or 4 port elements. Links are orthogonal and avoid nodes.
Shows an organizational chart, uses an in-laid Overview to aid the user in navigation, and allows the user to search by example.
An organizational chart that allows user editing and re-organizing of the hierarchy.
A state chart diagram that also shows dynamic creation of new nodes and links on a button press.
Shows default Diagram interactivity and basic data binding. Select, move, copy, delete, undo, redo with keyboard or touch.
Shows many of the commands possible in GoJS, templates for Links and for Groups, plus tooltips and context menus for Nodes, for Links, for Groups, and for the Diagram.
Sankey diagrams show the amount of flow between nodes by the width of the links.
A simple PERT chart, showcasing GoJS table panels and RowColumnDefinition properties.
Demonstrates a simple Gantt chart.
A read-only diagram where clicking on a node will open a new webpage.
An entity relationship diagram, showcasing data binding with item arrays.
A UML Class diagram shows software classes and their properties and methods, and the relationships between them.
Drag-and-drop items from the Palette onto racks in the Diagram.
Displays the GoJS Class Hierarchy as a series of trees. Double-click to go to the class's API documentation.
Shows the DOM of this page displayed as a tree. Selection highlights the DOM element in the page.
This sample shows the actual visual tree of a running Diagram, using a second Diagram.
Shows a standard family tree.
Shows a standard family tree.
Shows an org chart with extra links and expand/collapse functionality.
Shows an org chart with assistant nodes at the side, above regular child nodes.
Two diagrams, the one on top showing a full tree and the one below focusing on a specific node in the tree and those nodes that are logically "near" it.
Allows a user to make progressive decisions.
Demonstrates the expansion of a tree where nodes are only created "on-demand", when the user clicks on the "expand" Button.
Displays a single diagram of two trees sharing a single root node growing in opposite directions, using two layouts.
Double Tree, loading JSON from server.
A Mind Map, a double-tree whose nodes have an "add" button when selected and a context menu.
Tournament bracket with dynamic advancement as scores are entered.
Demonstrates a traditional "Tree View" in a GoJS diagram, with optional orthogonal links between the nodes.
Demonstrates a traditional "Tree View" in a GoJS diagram, where each item has a checkbox with three states.
Displays two trees, allowing the user to dynamically draw or reconnect links mapping one tree node to another.
A Parse tree representing the syntactic structure of a sentence. The leaf nodes are shown in a horizontal line.
A tree layout with rectangular nodes at alternating angles and no links.
A fault tree diagram with collapsing/expanding subtrees and gates at each non-root node.
Diagram representation of an Interactive Voice Response Tree (IVR tree). Nodes may have a collapsible list of details.
A genogram or pedigree chart is an extended family tree diagram that show information about each person or each relationship.
Demonstrates reading JSON data describing the relative rankings of NFL teams at a particular moment in time and generating a diagram from that data.
A web of interlinked concepts displayed with a ForceDirected Layout, showcasing link labels.
Animation of diagram parts (tokens) along link paths.
Show distances between two nodes and highlights one of all possible paths between the nodes.
Showcases all pre-defined Link arrowheads. You can define your own named arrowhead geometries.
Shows how you can create custom renderings for Links by repeatedly drawing GraphObjects along the route.
An example customization of the Link.curviness property and having an arrowhead at the middle of the link route.
Demonstrates custom routing for Links running through other Nodes.
Demonstrates a custom Geometry for Link paths.
A custom orthogonal Link that draws arrowheads at the end of each segment.
Showcases draggable disconnectable links that can be connected by dropping one or both ends at a valid port.
Demonstrates the ability for a Link to appear to connect with another Link, using label nodes that belong to links.
Displays relationships between different parts of a diagram.
Demonstrates subgraphs that are created only as groups are expanded.
Allows the user to drag nodes, including groups, into and out of groups, both from the Palette as well as from within the Diagram.
Demonstrates subgraphs that have rounded headers and rounded footers.
A Kanban board editor, allowing the categorization of editable tasks.
Layer Bands are automatically created for each "layer" of a TreeLayout, and run perpendicular to the layout.
Demonstrates collapsible, resizable, re-orderable swimlanes, a kind of process-flow diagram, with custom dragging rules that disallow nodes from leaving their lane.
Demonstrates collapsible, resizable, re-orderable swimlanes, a kind of process-flow diagram, with custom dragging rules that disallow nodes from leaving their lane.
This shows the same visual tree using nested Groups instead of nodes and links.
As an alternative to using Groups, this manages Nodes that simultaneously belong to multiple containers.
Shows GridLayout and options. Places all of the Parts in a grid-like arrangement, ordered, spaced apart, and wrapping as needed.
Shows TreeLayout and options. Positions nodes of a tree-structured graph in layers (rows or columns).
Shows ForceDirectedLayout and options. Treats the graph as if it were a system of physical bodies with forces acting on them and between them.
Shows LayeredDigraphLayout and options. Arranges nodes of directed graphs into layers (rows or columns).
Shows CircularLayout and options. This layout positions nodes in a circular arrangement.
A continuous ForceDirectedLayout that occurs as the user drags around a node.
Multiple circles using repeated CircularLayouts.
Demonstrates a customized CircularLayout.
Arrange people in circles around a central person, in layers according to distance from the central person.
Arrange people in rings around a central person, in layers according to distance from the central person.
A diagram representation of webpage flow.
Tanks, valves, and pipes, with animated flow in the pipes.
Partially describes the production process for converting natural gas and oil byproducts into their end products.
A System Dynamics diagram shows the storages and flows of material in some system, and the factors that influence the rates of flow.
A sequence diagram that shows different node templates, LayeredDigraphLayout and in-place text editing.
A Grafcet is a kind of sequential function chart used in automation design.
A sequence diagram illustrates how different processes interact with one-another and in what order.
A functioning logic circuit diagram, which allows the user to make circuits using gates and wires.
Show the processing steps involved in a database transformation or query, with labeled ports.
Same as Data Flow, but vertically oriented, and with slightly different styling.
Add ports to a selected node by clicking buttons or by using a context menu. Draw links by dragging between ports. If you select a link you can relink or reshape it.
A Node with ports that can be selected and deleted.
A Group with Nodes acting as ports that can be dragged within and between nodes.
Simple bar charts or histograms within nodes.
Simple pie charts within nodes.
Simple candlestick or range charts within nodes.
Simple sparkline charts within nodes.
Dynamic pie chart with selectable slices that can change size.
Graduated thermometer scales using Graduated Panel.
A gauge using a scale made with a Graduated Panel.
Showcases alignment properties of the Diagram.
Contains two draggable HTML elements (using jQuery UI). One of the two HTML elements houses a panel that interacts with the main Diagram.
Demonstrates using a custom HTML element for in-place editing of a TextBlock.
Demonstrates the implementation of a custom HTML context menu.
Shows how HTML Canvas Elements, such as those created from other libraries, can be used inside of GoJS as Pictures.
A data-visualization demonstration that showcases GoJS interacting with other elements on the page.
A GoJS diagram atop a Leaflet.js map, with nodes placed at latitude and longitude based locations.
This sample demonstrates custom logic in a GoJS diagram - a "Person" node can be dropped onto a "Table" node, causing the person to be assigned a position at the closest empty seat at that table.
Showcasing nodes (Pipes) that can be joined, and will snap and drag together.
Selected nodes show a row of buttons that execute commands or start tools.
A simple timeline with events arranged along a line.
A diagram with Graduated Panels at the edges acting as rulers.
Shows the continuously updating state of a number of stations on an imaginary shop floor.
A monitoring diagram where the nodes (kittens) move about a house, with tooltips for each kitten.
An example of nested Table Panels forming a spreadsheet-like grid.
Displays a variable number of fields for each record, with links mapping one field to another.
Records with fields that the user can select.
Demonstrates adding and removing columns of a Table Panel.
Showcases two Diagrams observing the same Model. Modifying positions in one Diagram will modify them in the model, updating the other Diagram as well.
A diagram that does not scroll or zoom or allow parts to be dragged out of a fixed area.
An Overview used as a magnifying glass.
The Fishbone or Ishikawa layout is a tree layout for cause-and-effect relationships.
A custom Layout that assumes there is a single 'split' and a single 'merge' node with parallel lines of nodes connecting them.
A custom Layout that positions a chain of nodes in rows of alternating direction.
A custom Layout that positions a chain of nodes in a spiral.
A custom Layout that renders nested Groups into the viewport with each Node having an area proportional to its declared 'size'.
A custom Layout that arranges Nodes just as a Table Panel arranges GraphObjects.
A custom Tool that lets a user drag and create a box to select nodes and links.
A custom Tool that lets a user draw a box showing where and how large a new node should be.
A custom Tool that lets a user draw a box showing what to zoom in to.
A custom ResizingTool that lets the user resize many selected objects at once.
A custom RotatingTool that lets the user rotate many selected objects at once.
A custom Tool that lets the user reshape curved links with a single handle.
A custom Tool that lets the user reshape orthogonal links by dragging entire segments.
A custom Tool that allows reshaping links with grid snapping.
A custom Tool that supports interactive reshaping of Geometries.
A custom Tool that supports interactive reshaping of pie-shaped sectors of circles.
A custom Tool that lets the user interactively draw a line, converting it into a Shape.
A custom Tool that lets the user interactively draw polygons and polyline Shapes.
A custom LinkingTool that lets the user determine the route of a new Link by clicking.
A custom Tool that adds handles on Links to allow the user to shift the end point of the Link along the sides of the port without disconnecting it.
A custom Tool that lets the user drag a label on a Link and that keeps its relative position to the link.
A custom Tool that lets the user drag a label on a Link and that keeps the label along the path of the link.
A custom Tool that lets the user drag a label in a Spot Panel of a Node.
A custom DraggingTool that lets the user drag a translucent image of the Nodes and Links to be moved, leaving them in place until the mouse up.
A custom DraggingTool that makes guidelines visible as a Part is dragged around a Diagram and is nearly aligned with another Part.
A custom Tool that lets the user drag a port in a Spot Panel of a Node.
Two custom Tools that let the user resize the width of columns or the height of rows in a Table Panel of a Node.
A simple drop-in for inspecting and editing Part data.
A more complex inspector for inspecting all sorts of GraphObject, Node, Link, Shape, etc properties, and Part data.
Demonstrates simple uses of CheckBoxButtons.
Demonstrates usage of the HyperlinkText extension.
Demonstrates using an HTMLInfo that acts as a re-implementation of the default text editor.
Demonstrates a custom Table Panel with a scrollbar implemented in GoJS, including two AutoRepeatButtons.
Demonstrates a Node with a top half and a bottom half, with rounded corners.
Demonstrates custom Links that create a "Balloon" around the fromNode.
Demonstrates custom Links that route parallel to other Links between the same two ports.
Demonstrates custom Links that show the distance between two points.
Demonstrates custom CommandHandler which provides alignment commands and additional behaviors for the arrow keys.
Demonstrates custom CommandHandler which uses localStorage as the repository for the clipboard, rather than an in-memory global variable, allowing for copying between tabs and windows.
Demonstrates dynamically choosing the user's cloud storage service (using the user's credentials) or localStorage.
Demonstrates use of the Robot class to simulate mouse events.
The start of a Business Process Model and Notation editor.
An editor for users to position, resize, and rotate furniture in a room.
A tool to open plans made in Floor Pan Editor and watch simulated alerts.
An editor for users to create robust, detailed floor plans.
Minimal, loading JSON from server.
Minimal, loading XML from server.
Minimal, showing image Blob creation with Diagram.makeImageData, and download.
Minimal, showing SVG creation with Diagram.makeSvg, and download.
Minimal, using RequireJS.
Minimal, using AngularJS.
Minimal, using Vue.js.
When zooming, change the spacing of the Nodes, not the Diagram.scale.
Shows different options for ToolManager's gestureBehavior.
Demonstrates customization of pinch-zooming to scale a node.
Shows buttons in an Adornment upon hover over a node.
Shows infinite scrolling and positionComputation.
Shows how to create Buttons with custom behavior for expanding/collapsing of a graph.
Kitten Monitor with constant size markers and tooltips when zooming out.
Virtualized no Layout, an example of virtualization where the model holds 123,456 node data yet the diagram only creates a few nodes at a time.
An example of virtualization where the model holds 123,456 node data yet the diagram only creates a few nodes at a time.
Shows a virtualized TreeLayout with TreeModel.
Shows a virtualized ForceDirectedLayout with GraphLinksModel.
Demonstrates a flow builder where nodes/links can be created or dropped onto a recycling node.
Demonstrates a flow-chart-like editor of a restricted syntax language.
Shows a network configurator with a Palette and Overview.
State Chart using incremental JSON.
Regrouping with nested groups scaled ever smaller.
Regrouping with tree view of grouping hierarchy.
Drag out fields from record Nodes to an HTML element.
Drag and drop fields from/to record Nodes.
Demonstrates drag and drop between two different diagrams using a shared UndoManager.
Demonstrates dragging and dropping from HTML.
Demonstrates dragging and dropping from HTML using jQuery.
Demonstrates an automatic ungrouping of nodes when dropping an element on the diagram.
Demonstrates a function to avoid any overlapping of nodes during dragging.
Shows a LightBox style HTML Context Menu.
Shows how to create a Diagram within a jQuery UI Tab.