Repository navigation
Code Map
This page answers "where is the code that does X?". It maps the directories of the repository, lists the important files of each layer with their responsibility, and ends with a lookup table from features to the file and the symbol to search for. Read Architecture first for how the parts fit together.
Paths in the tables below are relative to src/main/webapp unless they start with /. Line numbers are deliberately not given; search for the symbol instead. Overridden methods often exist twice, once in js/grapheditor/ and once in js/diagramly/ (see the extension pattern); check both.
| Path | Contents |
|---|---|
/src/main/webapp |
The whole web application: HTML, JavaScript, styles, resources, shapes, templates. Serve this directory to run draw.io. |
/src/main/server/java |
Optional Java servlets (com.mxgraph.online), see below
|
/etc/build |
build.xml (Ant targets), build.properties, compiler.jar (Closure Compiler). See Building. |
/etc/integrate/Integrate.js |
Defaults for the integrate.min.js bundle (full editor for embedding in other applications) |
/etc/dependencies |
package.json that records the versions of the vendored libraries for dependency security checks, and dompurify-smoke.js, a smoke test for DOMPurify updates |
/etc/i18n/check-translations.py |
Checks that every key of resources/dia.txt exists in all translations |
/etc/imageResize |
Node script that resizes the images embedded in a .drawio file |
/docs |
code-review.md (review checklist), dialog-style-guide.md (dialog look and feel, CSS classes, dark mode) |
/.github |
Issue templates and two workflows: stale.yml and war.yml (builds draw.war for version tags) |
/VERSION, /ChangeLog
|
Current version and the change history. See Releases and versioning. |
/LICENSE, /SECURITY.md, /CITATION.cff
|
Licence, security policy, citation metadata |
| Path | Contents |
|---|---|
index.html |
The editor page: loads styles/grapheditor.css, js/bootstrap.js, js/main.js
|
js/ |
All JavaScript: the editor layers, vendored libraries and the committed bundles (next section) |
mxgraph/ |
The graph library: src/ (sources, loaded one by one in dev mode), mxClient.js (committed single-file build of src/, used by the bundles), css/, images/
|
plugins/ |
Plugins that ship with draw.io (see below) |
resources/ |
UI strings: dia.txt (English) and dia_<lang>.txt. See Internationalization. |
shapes/ |
Shapes implemented in JavaScript (mxAWS4.js, mxBasic.js, bpmn/, mockup/, pid2/, rack/, ...), bundled into js/shapes-14-6-5.min.js
|
stencils/ |
Only a licence file and an image in this repository; the stencil libraries ship as the binary-encoded bundle js/stencils.min.js. See Shapes and stencils. |
styles/ |
grapheditor.css (all UI styles), high-contrast.css (forced-colours mode), default.xml (default diagram stylesheet), fonts/
|
templates/ |
Diagram templates by category, listed in templates/index.xml (used by NewDialog) |
img/ |
Images for shapes and the sidebar (clipart, icons, lib/ for shape library images) |
images/ |
UI images, favicons and manifest.json (PWA manifest with file handlers) |
math4/es5/ |
MathJax bundle drawio-mathjax.min.js, loaded on demand |
connect/common/js/mxReader.js |
Reader compiled into the atlas.min.js bundle by the atlas target of build.xml
|
WEB-INF/ |
web.xml (servlet mappings) and the lib/ jars for the servlets |
service-worker.js |
Precache service worker for offline use (committed, not built by build.xml) |
export3.html |
Page that a server-side export service loads to render a diagram (with js/export-init.js, js/export.js, export-fonts.css) |
open.html |
Upload form that OpenDialog shows in an iframe (OPEN_FORM, js/open.js) |
github.html, gitlab.html, dropbox.html, onedrive3.html
|
OAuth redirect pages that pass the code or token back to the opener window |
clear.html |
Unregisters the service worker and clears the caches (js/clear.js) |
vsdxImporter.html |
Stand-alone VSDX import page (js/vsdxImporter.js) |
shortcuts.svg |
The keyboard shortcut reference shown by Help > Keyboard Shortcuts |
| Path | Contents |
|---|---|
bootstrap.js |
First script: parses urlParams, defines mxscript, loads the dev sources or app.min.js
|
main.js |
Calls App.main()
|
PreConfig.js, PostConfig.js
|
Hooks for self-hosted deployments: set global variables before or after the app code loads. See Configuration. |
grapheditor/ |
Generic editor layer (see below) |
diagramly/ |
draw.io application layer (see below) |
app.min.js |
Production editor bundle |
extensions.min.js |
Importers and optional engines (Lucidchart, VSDX, GraphML, Miro, ELK, Mermaid, libavoid, ...) |
shapes-14-6-5.min.js, stencils.min.js
|
Shape and stencil bundles |
viewer.min.js, viewer-static.min.js
|
Viewer bundles; viewer-static also contains the shapes |
integrate.min.js |
Self-contained editor bundle for integrations |
orgchart.min.js, orgchart/
|
Org chart layout and its sources |
elk/, mermaid/, plantuml/, libavoid-js/, vsd/, gliffy/
|
Vendored engine bundles (ELK layouts, Mermaid parser, PlantUML parser, orthogonal edge routing, binary Visio converter, Gliffy converter). Built outside this repository; do not edit. libavoid-js/libavoid-routing.js is the hand-written routing core. |
sanitizer/purify.min.js |
DOMPurify |
deflate/ |
pako (deflate) and a Base64 helper |
rough/ |
rough.js (sketch style) |
freehand/ |
perfect-freehand (freehand drawing) |
jszip/ |
JSZip (VSDX, ZIP import) |
cryptojs/ |
CryptoJS AES |
spin/ |
spin.js (loading spinner) |
jquery/ |
jQuery, only for the Trello client |
onedrive/ |
OneDrive picker (mxODPicker.js, mxODPickerV2.js, OneDrive.js) |
dropbox/ |
Dropbox SDK |
simplepeer/ |
WebRTC library for peer-to-peer collaboration |
export.js, export-init.js
|
Rendering logic of export3.html
|
embed.dev.js |
Development version of the embed script |
vsdxImporter.js, open.js, clear.js
|
Scripts of the helper pages |
math-print.js |
MathJax set-up for the print window (written by the print code in diagramly/EditorUi.js) |
| Directory | Contents |
|---|---|
mxClient.js |
Entry point: browser detection (mxClient.IS_*) and mxClient.include, which loads every other source file in dev mode |
model/ |
mxGraphModel (cells, transactions, the change classes mxChildChange, mxGeometryChange, mxStyleChange, ...), mxCell, mxGeometry, mxCellPath
|
view/ |
mxGraph, mxGraphView, mxCellState, mxCellRenderer, mxStylesheet, mxEdgeStyle, mxPerimeter, mxStyleRegistry, mxCellEditor (in-place text editing), mxConnectionConstraint, mxGraphSelectionModel, mxLayoutManager, mxSwimlaneManager, mxOutline, mxPrintPreview, mxTemporaryCellStates
|
shape/ |
mxShape and the basic shapes (mxRectangleShape, mxEllipse, mxConnector, mxSwimlane, mxText, ...), mxStencil and mxStencilRegistry
|
handler/ |
Mouse and keyboard handlers: mxGraphHandler (move), mxVertexHandler (resize, rotate), mxEdgeHandler and subclasses, mxConnectionHandler, mxConstraintHandler, mxRubberband, mxPanningHandler, mxPopupMenuHandler, mxKeyHandler, mxTooltipHandler, mxCellHighlight, mxCellMarker
|
layout/ |
mxStackLayout, mxCompactTreeLayout, mxCircleLayout, mxFastOrganicLayout, mxPartitionLayout, mxRadialTreeLayout, mxParallelEdgeLayout, mxEdgeLabelLayout, mxCompositeLayout, hierarchical/
|
io/ |
mxCodec, mxCodecRegistry, mxObjectCodec and the codecs for cells, the model and the changes |
util/ |
mxUtils, mxConstants, mxEvent, mxEventSource, mxEventObject, mxResources, mxSvgCanvas2D, mxAbstractCanvas2D, mxXmlCanvas2D, mxUndoManager, mxUndoableEdit, mxClipboard, mxDragSource, mxGuide, mxPopupMenu, mxWindow, mxXmlRequest, mxRectangle, mxPoint, ... |
animation.js, anonymize.js, edgeConnection.js, explore.js, flow.js, import.js, nextcloud.js, number.js, page.js, props.js, rackF5.js, random.js, replay.js, sql.js, svgdata.js, tags.js, text.js, trello.js, update.js, trees/trees.js, webcola/. App.pluginRegistry in js/diagramly/App.js maps the short ids of the p URL parameter to these files. See Plugins.
All classes are in com.mxgraph.online; WEB-INF/web.xml maps them to URLs. The editor works without them. See Self-hosting.
| Class | Purpose |
|---|---|
ProxyServlet |
/proxy: fetches remote images and files for the client |
ExportProxyServlet |
/export and /service/*: forwards export requests to the service in the EXPORT_URL environment variable |
GoogleAuthServlet, MSGraphAuthServlet, GitHubAuthServlet, GitlabAuthServlet, DropboxAuthServlet
|
OAuth code-for-token exchange for the storage backends (with AbsAuth and the *Auth helpers) |
EmbedServlet2 |
/embed2.js, the script for embedding diagrams in other pages |
LogServlet |
/log, client error reports |
ImgurRedirectServlet |
/i/*, legacy image redirects |
Utils, Constants, SecretFacade, CacheFacade, AbsCache, AbsComm, ServletComm, mxBase64
|
Shared helpers |
| File | Responsibility |
|---|---|
Init.js |
Defaults for global paths and URLs, DOM_PURIFY_CONFIG, mxGraph base paths, mxLanguage
|
Editor.js |
Editor (graph, undo manager, modified flag, setGraphXml/getGraphXml), the modal Dialog framework, ErrorDialog, PrintDialog, PageSetupDialog, FilenameDialog, WrapperWindow
|
EditorUi.js |
EditorUi: creates and lays out the UI, key handler, hover icons, shape picker, dialogs (showDialog), zoom and scroll handling, executeLayout, initCanvas
|
Graph.js |
Graph extends mxGraph: label sanitising, links and custom links, placeholders, tables, containers and the layout manager (initLayoutManager, createLayouts), animations, compression helpers (Graph.compress), SVG export (getSvg), HoverIcons, most overrides of mxGraph handlers |
Shapes.js |
draw.io's built-in shapes (TableShape, process, cube, note, ...), extra perimeters and edge styles, custom handles (Graph.handleFactory) |
Actions.js |
Actions: the editor commands with their shortcut labels (addAction); diagramly/Menus.js adds the app's commands |
Menus.js |
Menus: menu definitions (put), menubar, context menu (createPopupMenu) |
Toolbar.js |
Toolbar of the classic theme |
Sidebar.js |
Sidebar: palettes, drag and drop from the sidebar, shape previews, search |
Format.js |
Format panel and its panels: StyleFormatPanel, TextFormatPanel, ArrangePanel, DiagramStylePanel, DiagramFormatPanel
|
InlineToolbar.js |
InlineToolbar, the floating toolbar for a single selected edge (line style, line ends, connection style) |
Dialogs.js |
Generic dialogs: ColorDialog, EditDataDialog, EditDiagramDialog, ExportDialog, LinkDialog, LayersWindow, OutlineWindow, TextareaDialog, AboutDialog
|
| File | Responsibility |
|---|---|
Init.js |
Defaults for the app's global variables (DRAWIO_BASE_URL, EXPORT_URL, PROXY_URL, DRAW_MATH_URL, PLUGINS_BASE_PATH, ALLOW_CUSTOM_PLUGINS, ...), mxLanguage, mxLanguageMap, uiTheme
|
App.js |
App extends EditorUi: App.main, plugin loading, storage modes, opening files from the URL (start, loadFile), creating and saving files, splash screen, drafts |
Editor.js |
App-level additions to Editor and Graph: Editor.configure, math (Editor.initMath), sketch style (RoughCanvas), fonts, PDF and PNG metadata, tags, custom link actions (handleCustomLink), setGraphXml/getGraphXml overrides |
EditorUi.js |
App-level additions to EditorUi: file data (getFileData, setFileData, fileLoaded), import and export, libraries and scratchpad, clipboard, embed mode, dark mode and themes, CSV import, CommentsWindow
|
Menus.js |
The app's menus and actions (File, export, layouts, help, comments, find) |
Dialogs.js |
App dialogs: StorageDialog, SplashDialog, NewDialog (templates), ParseDialog, EmbedDialog, LinkDialog, FindWindow, TagsWindow, FreehandWindow, AnimationDialog, LibraryDialog, EditShapeDialog, RevisionDialog, DraftDialog, PluginsDialog, ConnectionPointsDialog, CustomDialog
|
Pages.js |
DiagramPage, the page changes (SelectPage, ChangePage, RenamePage, MovePage), page tabs, view states |
DrawioFile.js |
Base class of all files: modified state, autosave, save, conflicts, drafts, realtime hooks |
LocalFile.js, StorageFile.js, EmbedFile.js, RemoteFile.js
|
Device files, browser storage, embed mode, and remote files that are not saved automatically |
DriveClient.js, DriveFile.js, DriveLibrary.js, DriveComment.js, HomeDialog.js
|
Google Drive |
OneDriveClient.js, OneDriveFile.js, OneDriveLibrary.js
|
Microsoft OneDrive and SharePoint |
GitHubClient.js, GitHubFile.js, GitHubLibrary.js
|
GitHub |
GitLabClient.js, GitLabFile.js, GitLabLibrary.js
|
GitLab (extends the GitHub classes) |
DropboxClient.js, DropboxFile.js, DropboxLibrary.js
|
Dropbox |
TrelloClient.js, TrelloFile.js, TrelloLibrary.js
|
Trello |
DrawioClient.js, DrawioUser.js, DrawioComment.js
|
Base classes for clients, users and comments |
LocalLibrary.js, StorageLibrary.js, UrlLibrary.js, RemoteLibrary.js, DesktopLibrary.js
|
Shape libraries from the device, browser storage, a URL and the desktop app |
DrawioFileSync.js, DiffSync.js, DrawioFilePolling.js, P2PCollab.js
|
Realtime collaboration: sync, page diffs and patches, polling, peer-to-peer |
GraphViewer.js |
The read-only viewer and its lightbox |
Extensions.js |
LucidImporter, the Lucidchart converter (LucidImporter.importState), part of extensions.min.js
|
vsdx/importer.js, vsdx/bmpDecoder.js, emf/emf-svg.js
|
Visio import (com.mxgraph.io.mxVsdxCodec, EditorUi.prototype.doImportVisio) and EMF images |
graphml/mxGraphMlCodec.js, miro/MiroImporter.js
|
GraphML and Miro import |
gif/ |
Animated GIF and video export (GifEncoder, AnimatedExport, Mp4Encoder, AnimationExport) |
util/mxAsyncCanvas.js, util/mxJsCanvas.js
|
Canvas helpers used by the exports |
ElkLayout.js |
Editor bindings for the ELK layouts (ElkLayoutBindings.run, runWithDialog) |
LibavoidRouting.js |
Editor binding for orthogonal edge routing (LibavoidRouting.run, installAutoRouting) |
Trees.js |
Tree containers and mind maps (tree folding, moving subtrees) |
mxFreehand.js |
Freehand drawing (mxFreehand) |
mxRuler.js |
Rulers (mxRuler) |
Settings.js |
mxSettings, the user preferences in localStorage
|
ConfigEditor.js |
DrawioConfigEditor, the visual editor for the configuration JSON |
Minimal.js, Simple.js
|
The min theme, and the simple, sketch and atlas themes |
ElectronApp.js |
Desktop (Electron) overrides |
Devel.js |
Development loader for ?dev=1
|
DevTools.js |
Developer tooltips (dev-tooltips=1) |
Embed.js |
Source of the lightweight embed script (not built by the public build.xml) |
sidebar/Sidebar.js, sidebar/Sidebar-*.js
|
The shape palettes: Sidebar.prototype.configuration, initPalettes and one file per library. See Shapes and stencils. |
grapheditor/ means js/grapheditor/, diagramly/ means js/diagramly/.
| Feature | File | Search for |
|---|---|---|
| Toolbar (classic theme) | grapheditor/Toolbar.js |
Toolbar.prototype.init |
| Toolbars and menus of the simple and sketch themes | diagramly/Simple.js |
createMenubarForTheme, createPickerMenuForTheme, createFooterMenuForTheme
|
| Minimal theme | diagramly/Minimal.js |
EditorUi.initMinimalTheme |
| Menubar and menus |
grapheditor/Menus.js, diagramly/Menus.js
|
Menus.prototype.init, Menus.prototype.put, defaultMenuItems
|
| Context menu |
grapheditor/Menus.js, grapheditor/EditorUi.js
|
Menus.prototype.createPopupMenu, popupMenuHandler.factoryMethod
|
| Commands (actions) |
grapheditor/Actions.js, diagramly/Menus.js
|
Actions.prototype.init, addAction, editorUi.actions.put
|
| Keyboard shortcuts |
grapheditor/EditorUi.js, diagramly/EditorUi.js
|
EditorUi.prototype.createKeyHandler, keyHandler.bindAction
|
| Keyboard shortcut reference |
diagramly/Menus.js, shortcuts.svg
|
keyboardShortcuts... |
| Format panel and its tabs | grapheditor/Format.js |
Format.prototype.immediateRefresh, StyleFormatPanel, TextFormatPanel, ArrangePanel, DiagramFormatPanel
|
| Shape sidebar |
grapheditor/Sidebar.js, diagramly/sidebar/Sidebar.js
|
Sidebar.prototype.init, addPalette, createVertexTemplate, Sidebar.prototype.configuration
|
| Shape search |
grapheditor/Sidebar.js, diagramly/sidebar/Sidebar.js
|
addSearchPalette, searchEntries
|
| Shape picker (double-click on the background) | grapheditor/EditorUi.js |
installShapePicker, showShapePicker, createShapePicker
|
| Inline toolbar of a selected edge | grapheditor/InlineToolbar.js |
InlineToolbar, Editor.enableInlineToolbar
|
| Copy and paste |
grapheditor/Actions.js, diagramly/EditorUi.js
|
actions copy, paste; copyCells, pasteCells, pasteXml, installNativeClipboardHandler
|
| Pasting images | diagramly/EditorUi.js |
installImagePasteHandler, importFiles
|
| Undo and redo |
grapheditor/Editor.js, grapheditor/EditorUi.js, diagramly/EditorUi.js
|
Editor.prototype.createUndoManager, EditorUi.prototype.undo, mxUndoManager
|
| Model transactions and changes | mxgraph/src/model/mxGraphModel.js |
beginUpdate, endUpdate, execute, mxChildChange
|
| Find and replace |
diagramly/Dialogs.js, diagramly/EditorUi.js
|
FindWindow, showSearchWindow, action findReplace
|
| Layers dialog | grapheditor/Dialogs.js |
LayersWindow, action layers
|
| Tags |
diagramly/Dialogs.js, diagramly/Editor.js
|
TagsWindow, getTagsForCell, addTagsForCells
|
| Outline |
grapheditor/Dialogs.js, mxgraph/src/view/mxOutline.js
|
OutlineWindow, mxOutline
|
| Edit data (custom properties) |
grapheditor/Dialogs.js, grapheditor/EditorUi.js
|
EditDataDialog, showDataDialog
|
| Edit diagram XML | grapheditor/Dialogs.js |
EditDiagramDialog |
| Page tabs | diagramly/Pages.js |
updateTabContainer, createTabContainer, createPageMenu
|
| Switching, adding, removing pages | diagramly/Pages.js |
selectPage, SelectPage, insertPage, removePage, ChangePage
|
| PNG export |
diagramly/EditorUi.js, diagramly/Editor.js
|
exportImage, Editor.prototype.exportToCanvas, getEmbeddedPng
|
| SVG export |
grapheditor/Graph.js, diagramly/Editor.js, diagramly/EditorUi.js
|
Graph.prototype.getSvg, exportSvg, getEmbeddedSvg
|
| Export dialogs | diagramly/EditorUi.js |
showExportDialog, showRemoteExportDialog
|
| PDF export and printing |
diagramly/Menus.js, grapheditor/Editor.js, diagramly/EditorUi.js
|
action exportPdf, PrintDialog, isPrintPdfExport, downloadFile
|
| VSDX export | diagramly/EditorUi.js |
exportVisio, vsdxExportEnabled; the VsdxExport class is not part of this repository |
| HTML export and embed code |
diagramly/Menus.js, diagramly/EditorUi.js
|
action exportHtml, showHtmlDialog, createHtml, EmbedDialog
|
| Animated GIF and video export |
diagramly/gif/, diagramly/EditorUi.js
|
AnimatedExport, showAnimatedGifExportDialog
|
| Server-side export service page |
export3.html, js/export.js
|
export3.html |
| Visio (.vsdx, .vsd) import |
diagramly/EditorUi.js, diagramly/vsdx/importer.js
|
importVisio, doImportVisio, mxVsdxCodec, DrawioVsd
|
| Gliffy import | diagramly/EditorUi.js |
importGliffy, loadGliffy, mxGliffyToDrawio
|
| Lucidchart import |
diagramly/EditorUi.js, diagramly/Extensions.js
|
convertLucidChart, LucidImporter.importState
|
| GraphML import |
diagramly/EditorUi.js, diagramly/graphml/mxGraphMlCodec.js
|
importGraphML, mxGraphMlCodec
|
| Mermaid import |
diagramly/EditorUi.js, diagramly/Dialogs.js
|
parseMermaidDiagram, loadMermaid, EditorUi.isMermaidSupported, ParseDialog
|
| PlantUML import | diagramly/EditorUi.js |
parsePlantUmlDiagram, loadPlantUml, mxPlantUmlToDrawio
|
| CSV import | diagramly/EditorUi.js |
importCsv, showImportCsvDialog
|
| Dropped and opened files, any format | diagramly/EditorUi.js |
importFiles, importFile, importLocalFile
|
| Reading XML from PNG, SVG, PDF and HTML |
grapheditor/Editor.js, diagramly/Editor.js
|
Editor.extractGraphModelFromPng, Editor.extractGraphModelFromPdf, Editor.extractGraphModel
|
| Compression of pages |
grapheditor/Graph.js, diagramly/Editor.js
|
Graph.compress, Graph.decompress, Graph.compressNode, Editor.parseDiagramNode
|
| Opening a file from the URL hash | diagramly/App.js |
App.prototype.start, App.prototype.loadFile, getModeForChar
|
| Loading file data into the editor |
diagramly/EditorUi.js, diagramly/DrawioFile.js
|
fileLoaded, setFileData, DrawioFile.prototype.open
|
| Saving |
diagramly/App.js, diagramly/DrawioFile.js, diagramly/EditorUi.js
|
App.prototype.saveFile, DrawioFile.prototype.save, getFileData
|
| Autosave and the modified flag | diagramly/DrawioFile.js |
fileChanged, autosave, autosaveDelay, installListeners
|
| Drafts |
diagramly/App.js, diagramly/DrawioFile.js
|
checkDrafts, saveDraft, DraftDialog
|
| Cloud storage clients | diagramly/*Client.js |
DriveClient, OneDriveClient, GitHubClient, GitLabClient, DropboxClient, TrelloClient
|
| Storage picker and splash screen |
diagramly/Dialogs.js, diagramly/App.js
|
StorageDialog, SplashDialog, showSplash, pickFile
|
| Save conflicts | diagramly/DrawioFile.js |
handleConflictError, synchronizeFile, mergeFile, showConflictDialog
|
| Realtime collaboration |
diagramly/DrawioFileSync.js, diagramly/DiffSync.js
|
DrawioFileSync, diffPages, patchPages, DrawioFile.prototype.patch
|
| Shape libraries and scratchpad | diagramly/EditorUi.js |
loadLibrary, libraryLoaded, loadScratchpad, showLibraryDialog
|
| Templates dialog |
diagramly/Dialogs.js, templates/index.xml
|
NewDialog, EditorUi.templateFile
|
| Dark mode |
diagramly/EditorUi.js, grapheditor/Editor.js
|
setDarkMode, isAutoDarkMode, Editor.isDarkMode
|
| Adaptive colours | grapheditor/Graph.js |
adaptiveColors, getAdaptiveColors, Graph.addLightDarkColors
|
| Themes (kennedy, min, simple, sketch, atlas) |
diagramly/EditorUi.js, diagramly/Simple.js, diagramly/Minimal.js
|
Editor.currentTheme, setCurrentTheme, switchTheme, Editor.themes
|
| Configuration |
diagramly/Editor.js, diagramly/App.js
|
Editor.configure, DRAWIO_CONFIG
|
| User settings | diagramly/Settings.js |
mxSettings |
| Rubberband selection |
grapheditor/Graph.js, mxgraph/src/handler/mxRubberband.js
|
new mxRubberband, getRubberband
|
| Selection |
mxgraph/src/view/mxGraphSelectionModel.js, mxgraph/src/view/mxGraph.js
|
mxGraphSelectionModel, setSelectionCells
|
| Moving cells | mxgraph/src/handler/mxGraphHandler.js |
mxGraphHandler |
| Resize and rotate handles, custom handles |
mxgraph/src/handler/mxVertexHandler.js, grapheditor/Shapes.js
|
mxVertexHandler, createCustomHandles, Graph.handleFactory
|
| Hover icons and connection arrows | grapheditor/Graph.js |
HoverIcons, connectVertex, connectionArrowsEnabled
|
| Connecting edges, connection points |
mxgraph/src/handler/mxConnectionHandler.js, grapheditor/Graph.js
|
mxConnectionHandler, getAllConnectionConstraints, ConnectionPointsDialog
|
| Edge routing styles |
mxgraph/src/view/mxEdgeStyle.js, mxgraph/src/view/mxStyleRegistry.js, grapheditor/Shapes.js
|
mxEdgeStyle.OrthConnector, orthogonalEdgeStyle, isometricEdgeStyle
|
| Moving edge waypoints |
mxgraph/src/handler/mxEdgeHandler.js, grapheditor/Graph.js
|
mxEdgeHandler, createEdgeHandler, changePoints
|
| Orthogonal routing (libavoid) |
diagramly/LibavoidRouting.js, js/libavoid-js/libavoid-routing.js
|
LibavoidRouting.run, installAutoRouting, AvoidRouting.computeRoutes
|
| Automatic layouts (ELK) |
diagramly/ElkLayout.js, diagramly/Menus.js
|
ElkLayoutBindings.runWithDialog (copied onto ElkLayout at load), ElkLayout.MENU_PRESETS
|
Layout containers (childLayout) |
grapheditor/Graph.js |
initLayoutManager, createLayouts, Graph.decodeChildLayout
|
| Running a layout | grapheditor/EditorUi.js |
executeLayout |
| Tables |
grapheditor/Graph.js, grapheditor/Shapes.js
|
isTable, isTableRow, createTable, insertTableRow, TableShape
|
| Containers and swimlanes |
grapheditor/Graph.js, mxgraph/src/view/mxSwimlaneManager.js
|
isContainer, isSwimlane, mxSwimlane
|
| Collapsing and expanding |
grapheditor/Graph.js, diagramly/Trees.js
|
foldCells |
| Trees and mind maps | diagramly/Trees.js |
style keys treeFolding, treeMoving; foldCells
|
| Grid and page view |
grapheditor/Editor.js, mxgraph/src/view/mxGraphView.js
|
createSvgGrid, validateBackground, pageVisible
|
| Guides | mxgraph/src/util/mxGuide.js |
mxGuide, guidesEnabled
|
| Math (MathJax) |
diagramly/Editor.js, math4/es5/
|
Editor.initMath, Editor.loadMath, Editor.MathJaxRender, mathEnabled
|
| Sketch style (rough.js) | diagramly/Editor.js |
Editor.createRoughCanvas, RoughCanvas, createHandJiggle
|
| Freehand drawing |
diagramly/mxFreehand.js, diagramly/Menus.js
|
mxFreehand, action insertFreehand, FreehandWindow
|
| Placeholders | grapheditor/Graph.js |
replacePlaceholders, isReplacePlaceholders, getGlobalVariable
|
| Links | grapheditor/Graph.js |
getLinkForCell, setLinkForCell, labelLinkClicked, openLink, Graph.sanitizeLink
|
| Page links and custom link actions |
grapheditor/Graph.js, diagramly/Editor.js
|
isCustomLink, customLinkClicked, handleCustomLink, data:page/id,, data:action/json,
|
| Animations |
grapheditor/Graph.js, diagramly/Dialogs.js, plugins/animation.js
|
createWipeAnimations, executeAnimations, AnimationDialog
|
| Comments |
diagramly/EditorUi.js, diagramly/Menus.js, diagramly/DrawioComment.js
|
CommentsWindow, action comments, DrawioComment
|
| Label rendering and sanitising |
grapheditor/Graph.js, mxgraph/src/shape/mxText.js
|
cellRenderer.getLabelValue, Graph.sanitizeHtml, mxText
|
| In-place text editing |
mxgraph/src/view/mxCellEditor.js, grapheditor/Graph.js
|
mxCellEditor.prototype.startEditing, startEditingAtCell
|
| Rendering cells |
mxgraph/src/view/mxGraphView.js, mxgraph/src/view/mxCellRenderer.js
|
validate, validateCellState, mxCellRenderer.prototype.redraw
|
| Registering shapes |
mxgraph/src/view/mxCellRenderer.js, grapheditor/Shapes.js
|
mxCellRenderer.registerShape |
| Loading stencils |
grapheditor/Graph.js, mxgraph/src/shape/mxStencilRegistry.js
|
mxStencilRegistry.getStencil, loadStencilSet
|
| Fast zoom and pan (model coordinates) |
mxgraph/src/view/mxGraphView.js, grapheditor/EditorUi.js
|
modelCoordinates, updateDrawPaneTransform, Editor.fastRendering
|
| Fonts |
diagramly/Editor.js, diagramly/Dialogs.js
|
Graph.addFont, FontDialog
|
| Plugin loading | diagramly/App.js |
App.main, App.loadPlugins, App.pluginRegistry, Draw.loadPlugin, PluginsDialog
|
| Embed mode |
diagramly/EditorUi.js, diagramly/App.js
|
initializeEmbedMode, installMessageHandler, createLoadMessage
|
| Viewer and lightbox | diagramly/GraphViewer.js |
GraphViewer.processElements, createViewerForElement, showLightbox
|
| i18n resources |
mxgraph/src/util/mxResources.js, resources/, diagramly/Init.js
|
mxResources.get, mxLanguageMap
|
| Service worker |
diagramly/App.js, diagramly/Editor.js, service-worker.js
|
Editor.enableServiceWorker, App.clearServiceWorker
|
| Desktop app hooks | diagramly/ElectronApp.js |
electron.request, EditorUi.isElectronApp
|
| Error handling and logging | diagramly/EditorUi.js |
handleError, EditorUi.logError
|
| Dialog framework |
grapheditor/Editor.js, grapheditor/EditorUi.js, diagramly/Dialogs.js, /docs/dialog-style-guide.md
|
Dialog, showDialog, CustomDialog
|
- Architecture: how the parts fit together
- Glossary: the vocabulary of the code
- Extending the editor: changing menus, actions, the toolbar and panels
-
Shapes and stencils: the shape libraries in
shapes/,stencils/andsidebar/ - Import and export: every format in detail
- Storage backends: the cloud clients
- Building: which files go into which bundle
- Debugging: finding code at runtime
Describes the dev branch of jgraph/drawio as of release 32.3.0 (October 2026). Internal JavaScript APIs change between releases; check the code of the version you use. · Questions: Discussions · Bugs: Issues · Vulnerabilities: report privately · User docs: drawio.com/docs
Get started
Concepts
Guides
- Self-hosting
- Configuration
- Storage backends
- OneDrive app registration
- Embedding
- Diagrams in GitHub
- Plugins
- Extending the editor
- Shapes and stencils
- Import and export
- Desktop app
- Internationalization
Reference
Project
Elsewhere