GoJS 2.2.20 released

Changes for 2.2.20

  • Improved LinkingTool.doActivate to assign the location of the LinkingBaseTool.temporaryToNode (or the LinkingBaseTool.temporaryFromNode, if drawing a link in the reverse direction) so as to avoid momentarily seeing where the temporary node had been the last time the user tried to draw a new link.
  • Corrected functionality when a browser cancels a Pointer event (for instance when the browser is minimized during ongoing Pointer events).
  • Corrected GraphObject.mouseLeave sometimes not getting called when the user’s pointer leaves the Diagram.
  • Fixed iOS Safari text highlighting when dragging Pointer events out of a Diagram.
  • Fixed a regression from 2.2.18 where link JumpOvers might cause “Change not within a transaction” warnings on model load.

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.