The examples can be edited with any texteditor. To run the examples point
your browser directly to the local files (use links below) or use a
webserver to deliver the files. Note that the files should always be
delivered via a webserver in production. Local usage of files is only
recommended for development and testing. (Please read this
for running examples from the local filesystem in Internet Explorer.)
- Codec - Dynamically
creating a graph from XML and encoding the model into XML, as well
as changing the default style for edges in-place.
- dbEditor - Uses Google
for database content editing. The database contains Persons,
Locations and connections between persons and locations.
- Dynamicloading -
Loading graph model data dynamically to limit the number of cells in the model.
- Dynamic Style -
Changing the style of a cell by overriding mxGraphModel.
- Dynamic Toolbar -
Changing the state of the toolbar at runtime.
- Editing -
Using the in-place editor trigger to specify the editing value and write the
new value into a specific field of the user object. Wrapping and DOM nodes as
labels are also demonstrated here.
- Events - Creating
a graph container and using the mxDivResizer to update the size,
interaction on the graph, including marquee selection, custom
tooltips, context menu handling and changing the default menu
opacity. It also demonstrates how to use an edgestyle in the
default stylesheet, and handle the doubleclick on the adjustment
point. See also: overlays.html for click event handling.
- ExtJs -
- File I/O -
Reading an XML file, writing a custom parser, applying an automatic layout
and defining a 2-way edge.
- Graphlayout -
Using automatic graph layouts and listening to changes of the graph size
to keep the container size in sync.
- Hello, World! - Using
a DOM node to create a graph and adding vertices and edges.
- Hierarchical Layout -
Using the hierarchical and organic layout algorithms.
- Images -
Using background images and images for for the label- and image-shape.
- Indicators -
Using small subshapes (indicators) inside a parent shape, typically an mxLabel.
- Label Position -
Using the label position styles to set the position of vertex labels.
- Labels -
Wrapping and clipping for HTML labels of vertices, truncating labels to fit the
size of a vertex, and manually placing vertex labels and relative children
that act as "sublabels".
- Layers - Using
multiple layers to contain cells.
- Merge -
Using the mergeChildren function to merge two graphs.
- Monitor -
Using mxGraph to display the current state of a workflow.
- Offpage Connectors -
Creating offpage connectors in a graph and loading a new diagram on a
- Orgchart -
Using automatic layouts, fit to page zoom and poster print (across
- Overlays - Cell
highlighting, overlays and handling click and double click
events. See also: events.html for more event handling.
- Permissions -
Creating permissions to define the available operations on a graph.
- Ports -
Implementing ports as child vertices with relative positions,
drag and drop and using images and HTML in cells.
- Schema -
Implementing a database schema editor.
- Scrollbars -
Using a scrollable table with different sections in a cell label.
- Secondlabel -
Adding another string label to vertices.
- Shape - How to
implement and use a custom shape.
- Stylesheet - Using
a custom stylesheet and control points in edges, as well as
overriding the getLabel and getTooltip function to return
- Swimlanes -
Using swimlanes for pools and lanes and using the stack layout as an
- Thread - Setting
overlays in mxGraph from within a timed function.
- Toolbar -
Using existing cells as templates for creating new cells.
- Tree -
Folding for subtrees in acyclic graphs (trees).
- UIConfig -
Using a config file to configure the toolbar and popup menu in mxEditor.
- Userobject -
Using XML objects as values for cells.
- Validation -
Using multiplicities for automatically validating a graph.
- Windows -
Using the mxWindow class for displaying windows.
- Wrapping -
Using HTML markup and word-wrapping in vertex and edge labels.
- HelloPort -
Using the isPort hook for visually connecting to another cell.
- Pagebreaks -
Using the pageBreaksVisible and preferPageSize switches.
- FixedPoints -
Using fixed connection points for connecting edges to vertices.
- ServerView -
Using a server-side image of the graph as the diagram in the client.
- ContextIcons -
Adding icons to selected vertices to carry out special operations.
- Guides - Using the guidesEnabled
and snapToTerminals switches, creating a grid using a canvas and
handling cursor keys.
- FixedIcon - Customizing the icon
position in the mxLabel shape.
- Markers - Creating custom marker.
- Dragsource - Using
one drag source for multiple graphs and changing the drag icon.
- Orthogonal - Demonstrates the
use of port constraints and orthogonal edge styles and handlers.
- Standardsmode - How to use
mxGraphs VML rendering with a Doctype in IE.
- EdgeTolerance - Increasing
the tolerance for hit detection on edges.
- Stencils - Using an XML file to
define new stencils to be used as shapes.
- IE9SVG - Using SVG for rendering
a diagram in IE9 (and the HTML5 doctype).
- HoverIcons - Showing
icons on vertices as mouse hovers over them.
- Portrefs - Referencing
connection points by ID.
- Control - Adding controls
to specific cells in a graph.
- Wires - Drawing electrical and
digital circuits with devices and wires.
- Menustyle - Styling the built-in
popupmenu using CSS.
- Perimeter - How to avoid edge and
- Grid - Drawing a grid dynamically
using HTML 5 canvas.
- Grid - Using cells as parts of
- Graph Editor -
Fully functional diagram editor and drawing application.
- mxDraw -
Web 2.0-style diagram editor and drawing application.
- mxProcess -
Process editor with a fancy stylesheet and user interface.
- mxWorkflow -
BPMN workflow editor with various example diagrams.
- mxWorkflow/Layout -
BPMN workflow editor with automatic layout. (Experimental)
© 2006-2010 by JGraph Ltd.