GoJS 2.2.21 released

Changes for 2.2.21

  • Improved Link.makeGeometry so that overrides do not need to test for situations where a Link has fewer than two points.
  • Improved shadows when Diagram and Part are scaled.

Also: GoJS 2.3 (alpha) - available at gojs.net/alpha

New SVG Rendering Context

GoJS typically renders the Diagram to an HTML Canvas, and offers exporting the Diagram scene to image formats and SVG. In GoJS 2.3, the library now supports rendering to a live SVG context in addition to the default Canvas context. Visually there should be no changes, and performance will be faster when using the default Canvas context, but the SVG context may be useful for applications where DOM accessibility is paramount, either because users need to select and copy text, or because screen readers need access to all text in the application.

The new SVG rendering context comes with significant changes and upgrades to the GoJS SVG structure, including export SVG. For example, an object with a clip-path would formerly point to a <clippath> via URL, and now clipping paths are defined in-line. These changes make some elementFinished code in Diagram.makeSVG potentially incompatible.

Read more about the SVG Rendering Context here

General New Features in GoJS 2.3

  • Added PathFigure.isEvenOdd - PathFigures now support the “even-odd” fill rule. This can be set with the new property PathFigure.isEvenOdd or when making SVG-like Path syntax, with the fill rule F1, eg "F1 M 0 0 L 50 50 ...".
  • TypeScript: The GoJS API and therefore TS definitions file currently requires TypeScript 4.3 or higher. This is because property getters now return Margin instead of MarginLike. The corresponding setters still use MarginLike, so these properties now have separate write types, a feature of TypeScript 4.3.
  • Added Size.inflate .
  • Bugfixes for shadow drawing when Shapes have a background set.