Skip to content

Releases: NorthwoodsSoftware/GoJS

4.0.0

Choose a tag to compare

@simonsarris simonsarris released this 16 Jun 20:09

GoJS 4.0

GoJS 4.0 brings a number of new features.

  • Performance improvements for large graphs, especially during dragging and object picking.
  • ForceDirectedLayout has been re-implemented to be much faster.
  • Several improvements for stronger type checking and use with AI tooling. Regardless of tooling, we will continue to make it easier to create and verify code.
  • The functionality of the Robot extension has now been merged into the Diagram class.
  • We have added a HeatMap extension.

API Improvements for Structured Authoring

  • Added typed constant objects for string-based registries, providing autocomplete and compile-time checking for values that were previously plain strings. The new constants are: Figures, Arrowheads, PanelTypes, ToolNames, Builders, and LayerNames. For example, go.Figures.RoundedRectangle instead of "RoundedRectangle", or go.Arrowheads.Standard instead of "Standard". Corresponding union types (FigureName, ArrowheadName, PanelTypeName, ToolName, BuilderName, LayerName) are exported for use in TypeScript. However, because the programmer can define new names for each of these kinds of things, those types only represent the built-in subset of possibilities.
  • Model classes are now generic, accepting NodeDataType and LinkDataType type parameters. These can be optionally specified to get stronger type checking on model data, and in methods such as Model.nodeDataArray, GraphLinksModel.linkDataArray, Model.copyNodeData, and GraphLinksModel.copyLinkData. Model, TreeModel, and GraphLinksModel accept a NodeDataType parameter, while GraphLinksModel accepts both NodeDataType and LinkDataType. These default to ObjectData and are fully backward compatible.

Model typing examples:

import go from 'gojs';

// Create your own node and link data types
interface MyNodeData { key: string; text: string; color: string; }
interface MyLinkData { key: number; from: string; to: string; }

// Create typed models: keeps type info
const treeModel = new go.TreeModel<MyNodeData>();
const model = new go.GraphLinksModel<MyNodeData, MyLinkData>();
diagram.model = model;

// TYPED: use model variable for data operations

model.addNodeData({ key: '1', name: 'Alpha', color: 'red' }); // type-checked
model.addNodeData({ key: '2', color: 'blue' }); // Error: missing 'name'

const found = model.findNodeDataForKey('1'); // MyNodeData | null
model.nodeDataArray.forEach(nd => nd.name); // autocompletes .name, .color, .key
model.addLinkData({ key: 1, from: '1', to: '2' }); // type-checked
model.linkDataArray.forEach(ld => ld.thickness); // autocompletes .from, .to, .thickness

// NON-TYPED: diagram.model is fine for non-data operations
diagram.model.commit(m => { /* ... */ });
const json = diagram.model.toJson();
diagram.model.undoManager.isEnabled = true;

Other New Features and Changes for GoJS 4.0

New features of ForceDirectedLayout:

  • ForceDirectedLayout now uses a Barnes-Hut approximation algorithm, that uses a quadtree to render large graphs significantly faster. We have observed 7-10x performance boosts on graphs with node counts in the low thousands.
  • The ForceDirectedLayout.theta parameter has been added. This parameter controls the accuracy versus speed of the layout. Higher values of theta will produce a faster, but potentially less accurate, layout.

Incompatible changes in ForceDirectedLayout:

  • Repulsion between Nodes no longer scales as aggressively with the size of the nodes. If you are using a ForceDirectedLayout with large, or varying, node sizes, you may have to increase the value ForceDirectedLayout.defaultElectricalCharge.
  • Some parameters have changed their default values, which should produce strictly better results for most use cases:
  • The default value of ForceDirectedLayout.moveLimit has changed from 10 to Infinity, which allows nodes to move arbitrarily far per iteration. For large layouts performed all at once, this will produce better results. If your layout is small or incremental, you may have to set a value for this parameter to prevent nodes from moving too much during incremental changes.
  • The default value of ForceDirectedLayout.infinityDistance has changed from 1000 to Infinity, which means Nodes will always interact regardless of how far apart they are. For large layouts performed all at once, this will produce better results. If your layout depends on a limited distance between interacting Nodes, you may have to add an explicit value for this parameter.

Added the HeatMap extension, which assumes each Node or Link could have a temperature used in drawing a heat map in the viewport. There is also a HeatMap.renderImageData method to generate a raster image for any given area.

The functionality of the Robot extension class for simulating mouse and keyboard events has been moved into the Diagram class, with the method names prepended with "emit..."/. This makes it easier to write regression tests and automation scripts, because you no longer need to load the Robot extension code. The Robot extension has been deprecated, although for compatibility it remains in the extensionsJSM and extensions directories. The Robot sample has been rewritten to call the new Diagram methods. The new methods are:

The maxSize option used by Diagram.makeImageData and Diagram.makeImage has been moved from the DiagramRendererOptions interface to the ImageRendererOptions interface. And due to increased memory available in all devices, the default value has increased from 2000x2000 to 4000x4000.

Other New Features and Changes

  • Enhanced the PanningTool to support two-finger panning as well as pinch-zooming and one-finger panning. Added the PanningTool.pan method, taking several arguments to make it easier to override in order to implement custom behaviors. For example, the Pinch Resizing sample now overrides that method to demonstrate resizing and rotating a selected node.
  • Added the DragSelectingTool.findInRect method that can be overridden to customize the criteria by which Parts are selected.
  • Added the Tool.canStartButton overridable predicate, which defaults to returning true if the Diagram.lastInput has InputEvent.left true -- i.e. whether the left mouse button is held down. You can override this method to change the behavior of many predefined Tools to operate with a mouse button other than the left one.
  • Added an optional "result" argument to a number of methods that allocated Points or Rects, so that memory allocation can be reduced by passing one to the method and it can be modified and returned. Those methods are: Diagram.transformDocToView, Diagram.transformViewToDoc, Link.computeOtherPoint, Geometry.computeBoundsWithoutOrigin.
  • Some methods now return this instead of r...
Read more

3.1.10

Choose a tag to compare

@simonsarris simonsarris released this 07 May 15:46

Changes for 3.1.10

  • Fixed positioning of Parts in Layers with Layer.isViewportAligned set to true, when those parts were modified without modifying the Diagram's bounds.

3.1.9

Choose a tag to compare

@simonsarris simonsarris released this 07 Apr 18:45

Changes for 3.1.9

  • In Table Panel, fixed measuring of stretched GraphObjects that span multiple rows or columns so that they correctly account for space used by other rows or columns.
  • Fixed routing of multiple links connected with ...Side Spot ports when some have non-None Link.adjusting.
  • Improved routing of orthogonal links and routing of no-Spot links when ports overlap, fixing regressions since 3.1.0.

3.1.8

Choose a tag to compare

@simonsarris simonsarris released this 19 Mar 00:41

Changes for 3.1.8

  • Fixed a bug with Diagram.grid sometimes not updating when the diagram is scrolled.
  • Improved the routing of links connecting with non-default ports of collapsed groups with ...Side spots.

3.1.7

Choose a tag to compare

@simonsarris simonsarris released this 05 Mar 17:00

Changes for 3.1.7

  • Fixed the rendering of Diagram.grid when dynamically updating grid properties.
  • Fixed the copying of attached properties when changing the category of a Part.

3.1.5

Choose a tag to compare

@simonsarris simonsarris released this 04 Feb 02:18

Changes for 3.1.5

  • Fixed undo of setting Link.curve to or from Bezier curve.
  • Fixed object picking within the Diagram viewport when the viewport has been updated but not yet redrawn (for example in a "ViewportBoundsChanged" DiagramEvent listener).
  • Fixed LinkReshapingTool not to allow resegmenting when the Link.curve is Bezier unless Link.isOrthogonal is true.
  • Fixed Picture.source setter not updating the Picture measurements.

3.1.4

Choose a tag to compare

@simonsarris simonsarris released this 06 Jan 22:20

Changes for 3.1.4

3.1.3

Choose a tag to compare

@simonsarris simonsarris released this 12 Dec 17:29

Changes for 3.1.3

  • Improved performance of JumpOver or JumpGap links.
  • Fixed some cases of invalid AvoidsNodes routing after removing Nodes or changing their visibility.
  • Improved Picture.source caching.

3.1.2

Choose a tag to compare

@simonsarris simonsarris released this 24 Nov 19:47

Changes for 3.1.2

  • Improved LayeredDigraphLayout routing of Bezier curve Links near their Nodes.
  • Fixed SVG rendering of RowColumnDefinition backgrounds in Panels that themselves have backgrounds.

See GoJS 3.1 release notes here: https://forum.nwoods.com/t/gojs-3-1-has-been-released/17292

3.1.1

Choose a tag to compare

@simonsarris simonsarris released this 18 Nov 19:37

Changes for 3.1.1

  • Fixed LinkReshapingTool not to insert points into orthogonal routes unnecessarily. However, the behavior of that tool has changed to no longer try to repair routes that are not orthogonal to begin with.
  • Fixed some cases of undo of link routes with ...Side Spots.
  • Improvements for use in mock-DOM environments like jsdom with canvas

See GoJS 3.1 release notes here: https://forum.nwoods.com/t/gojs-3-1-has-been-released/17292