@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.16.0
Release date: 2025-03-02
For more details, see the 0.16.0 Changelog on the GitHub release page.
This new version enhances internationalization (i18n), improves connector configurations, and prepares for future updates with tree shaking optimizations.
Breaking Changes:
- The
utils.isNullish
and utils.isNotNullish
functions are now marked as private.
They had been made public by mistake, and had been considered internal since their introduction.
- Some utility functions formerly used to retrieve default values for
CellStateStyle
and CellStyle
properties, which were intended only for internal use, have been removed.
Client.isBrowserSupported
has been removed. It didn't correctly validate all prerequisites required to know if the browser supports maxGraph.
So, remove it without replacement.
Client.VERSION
moved to constants.VERSION
.
VERSION
is supposed to be immutable as it represents the actual version of maxGraph.
- When it was stored in
Client
, it was a static property that could be modified.
- Moving it to the constants module ensures that it cannot be modified.
- All elements that were in
Client
to manage the configuration of Translations
have moved to TranslationsConfig
:
Client.defaultLanguage
to TranslationsConfig.getDefaultLanguage
Client.setDefaultLanguage
to TranslationsConfig.setDefaultLanguage
Client.language
to TranslationsConfig.getLanguage
Client.setLanguage
to TranslationsConfig.setLanguage
Client.languages
to TranslationsConfig.getLanguages
Client.setLanguages
to TranslationsConfig.setLanguages
ManhattanConnector
is now configured with the global ManhattanConnectorConfig
object.
The following properties that were previously on EdgeStyle
have moved to ManhattanConnectorConfig
:
MANHATTAN_END_DIRECTIONS
to endDirections
MANHATTAN_MAX_ALLOWED_DIRECTION_CHANGE
to maxAllowedDirectionChange
MANHATTAN_MAXIMUM_LOOPS
to maxLoops
MANHATTAN_START_DIRECTIONS
to startDirections
MANHATTAN_STEP
to step
OrthConnector
is now configured with the global OrthogonalConnectorConfig
object.
The following properties that were previously on EdgeStyle
have moved to OrthogonalConnectorConfig
:
orthBuffer
to buffer
orthPointsFallback
to pointsFallback
- properties and utility methods previously exposed by
EdgeStyle
are now only internal.
- The
getRoutePattern
method has been completely removed as it was not being used.
- Nor was it used in the entire mxGraph and draw.io codebase.