GoJS 2.3 Alpha and GoJS 2.2.19 released

GoJS 2.3 (alpha) - available at GoJS - Build Interactive Diagrams for the Web

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.

Changes for 2.2.19

  • Event fix for some platforms that reimplement DOM functionality (Polymer and Salesforce Aura components).
  • Graduated panels no longer display shadows on Shape and TextBlock elements when those elements explicitly disable shadows with GraphObject.shadowVisible