@maxgraph/core
maxGraph
is a TypeScript library which can display and allow interaction with vector diagrams. At a high level, it provides:
- Nodes, also known as vertices which are typically represented by shapes like rectangles.
- Edges which can be lines and arrows which normally point between one node and another.
It provides many of the diagramming features which would be expected by a piece of presentation software like Microsoft® PowerPoint™
or LibreOffice® Impress such as being able to resize, move or rotate nodes, but has a stronger focus on automatic layout
algorithms and applications of Graph Theory. It is suited towards software
which requires finer-grained customization of functionality than off-the-shelf packages.
For more details, see the maxGraph GitHub repository.
Install
npm install @maxgraph/core
Getting started
All the information is available in the README of the GitHub repository.
0.20.0
Release date: 2025-05-16
For more details, see the 0.20.0 Changelog on the GitHub release page.
This new version improves registry consistency, removes legacy enums, supports CommonJS, and enables tree-shaking optimizations.
Breaking Changes:
- Some enums have been removed. Use the string counterparts from related types:
constants.ALIGN
--> AlignValue
and VAlignValue
constants.DIALECT
--> DialectValue
constants.ARROW
--> ArrowValue
constants.DIRECTION
--> DirectionValue
constants.EDGESTYLE
--> EdgeStyleValue
constants.ELBOW
--> ElbowValue
constants.PERIMETER
--> PerimeterValue
constants.RENDERING_HINT
: no replacement as it wasn't used
constants.SHAPE
--> ShapeValue
constants.TEXT_DIRECTION
--> TextDirectionValue
- The
constants.NODETYPE
enum has been removed and replaced by the constants.NODE_TYPE
value object.
The former DOCUMENTTYPE
enum member has been renamed to DOCUMENT_TYPE
.
constants.DIRECTION_MASK
is now read-only (types only).
- The
constants.FONT
enum has been removed and replaced by the constants.FONT_STYLE_FLAG
value object.
- The
constants.CURSOR
enum has been removed. The values are now configurable and have been moved to:
ConnectionHandler
EdgeHandlerConfig
HandleConfig
VertexHandlerConfig
- All registries used to manage "styles" elements now derived from the
Registry
interface for consistency.
So, they all share the same methods (add, get and clear) and their internal storage is no longer accessible.
- The
MarkerShape
registry has been renamed to MarkerShapeRegistry
.
- The Shapes are now registered in
ShapeRegistry
instead in CellRenderer
.
StyleRegistry
has been removed. Use EdgeStyleRegistry
and PerimeterRegistry
instead.