Skip to content

0.22.0

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Dec 10:02
· 19 commits to main since this release
Immutable release. Only release title and notes can be modified.
v0.22.0
2e5ec21

Version 0.22.0 released on 2025-12-11.

⚡ This new version makes default style properties globally configurable and includes bug fixes for a smoother developer experience. ⚡

Resources

Highlights

Globally configurable default style properties

Previously, changing default styles required local configuration per Graph instance using a Stylesheet.
It was also not possible to configure the rounding factor used when a vertex uses a non absolute arcSize, because there was no dedicated cell style property for that.
This release solves these limitations by making the built-in defaults globally configurable.

The StyleDefaultsConfig object has been extended to allow customization of default style values that were previously hardcoded as constants.
All direct references to DEFAULT_* constants in the codebase are now replaced with StyleDefaultsConfig property access. This means you can change these defaults at runtime without updating stylesheets on every Graph instance.

New configurable properties include:

  • Font settings: fontFamily, fontSize
  • Arrow settings: arrowSize, arrowSpacing, arrowWidth
  • Size settings: markerSize, imageSize, startSize
  • Rounding: roundingFactor, lineArcSize

You can now globally customize these defaults at runtime like this:

import { StyleDefaultsConfig } from '@maxgraph/core';

// Change default marker size
StyleDefaultsConfig.markerSize = 10;

// Change default image size for labels
StyleDefaultsConfig.imageSize = 32;

// Change default swimlane start size
StyleDefaultsConfig.startSize = 50;

// Change default rounding factor
StyleDefaultsConfig.roundingFactor = 0.4;

Note

This change is especially useful if you want a consistent look across multiple graphs without duplicating stylesheet configuration, and if you need fine control over rounding/arc behavior that was not configurable before.

Bug fixes

This release also includes bug fixes that improve overall stability and consistency of rendering and styling.
If you encounter any regressions or unexpected behavior, please open an issue with a minimal reproduction so we can address it quickly.

What's Changed

🎉 New Features

  • feat: accept more nullish parameter in various methods by @tbouffard in #892
  • feat: allow to pass more null and undefined to Multiplicity by @tbouffard in #914
  • feat: add generic font in default font family by @tbouffard in #931
  • feat: make default style properties globally configurable by @tbouffard in #932

🐛 Bug Fixes

  • fix(editor): ensure editor context in installDblClickHandler callback by @tbouffard in #934
  • fix: restore tooltip display when PopupMenuHandler is unavailable by @chrisob194 in #970
  • fix(VertexHandler): fix top-left resize handle behavior by @Lockps in #968

📝 Documentation

⚙️ Refactor

  • refactor: fix most problems in the Wires story by @tbouffard in #893
  • refactor: simplify signature of the isNullish internal function by @tbouffard in #907
  • refactor: migrate the Guides story to TypeScript by @tbouffard in #908
  • refactor: simplify implementation of ParallelEdgeLayout by @tbouffard in #909
  • refactor: ensure mixins do not create shared properties in AbstractGraph by @tbouffard in #879
  • refactor: simplify Editor installDblClickHandler by @tbouffard in #938
  • refactor: prefer includes to indexOf by @tbouffard in #952
  • refactor(Stylesheet): simplify default style creation methods by @tbouffard in #955
  • refactor: introduce AbstractPathShape base class for shape hierarchy by @tbouffard in #953
  • refactor: improve types usage in PageBreaksMixin by @tbouffard in #956

🛠 Chore

New Contributors

Full Changelog: v0.21.0...v0.22.0