# GoJS Change Log

We maintain a GitHub Repository, which you can star to follow version updates. We also notify of changes on Twitter.

## GoJS 2.2

GoJS 2.2 introduces a number of properties and methods for convenience and to improve customization. GoJS 2.2 also includes new methods for constructing objects, and enhances TypeScript typings support.

GoJS 2.2 also includes several performance enhancements when drawing large graphs, reduced memory usage, and more efficient replacing or merging of item Arrays.

Some of the samples and written documentation have been upgraded to use more modern JavaScript: `class`es, arrow functions, `const` and `let`, so the samples and documentation might no longer be viewable using old browsers such as Internet Explorer 11 or some old Android browsers. The library and the extensions continue to target ES5 (ES2012), so that apps using the library can still work on IE11.

### Method Chaining and New Ways to Build Objects

In GoJS 2.2 many methods that previously returned `void` now return the method's instance, to promote method chaining. GoJS 2.2 also introduces several new methods or arguments to allow type-checking of settings by compilers and in text editors.

Several existing methods now return their instance:

- GraphObject.setProperties and Diagram.setProperties - and their new synonyms GraphObject.attach and Diagram.attach
- Panel.add
- GraphObject.bind, which also has new functionality via method overloads.
- GraphObject.trigger - to add AnimationTriggers to a GraphObject
- Diagram.addEventListener, Diagram.addChangedListener, Diagram.addModelChangedListener, Model.addChangedListener
- Diagram.addLayer, Diagram.addLayerBefore, Diagram.addLayerAfter
- Animation.add, and Animation.addTemporaryPart

GraphObject constructors now accept one or two optional arguments. The first is the value for a common property, and the second is a JavaScript Object detailing properties to initialize. For example, one can now write:

- `new go.TextBlock("Some Text", { margin: 5 })`
- `new go.Picture("sourceURI.png", { width: 30, height: 30 })`
- `new go.Shape("RoundedRectangle", { fill: "blue", stroke: "yellow" })`
- `new go.Panel("Auto", { padding: 10, background: "green" })`

This means that one can now write code like:

    // Create a Node and add a Shape and a TextBlock to it:
    myDiagram.nodeTemplate =
      new go.Node("Vertical")
        .add(new go.Shape({ width: 40, height: 40, fill: "white" })  // default width & height & fill
              .bind("width") // binds data.width to Shape.width
              .bind("height")
              .bind("fill", "color") // binds data.color to Shape.fill
              .bind("figure", "fig")) // data.fig should be the registered name of a geometry figure generator
        .add(new go.TextBlock("(no name)",  // default string to display
                              { isMultiline: false, editable: true })
              .bind("text", "name", null, null));  // TwoWay Binding of TextBlock.text with data.name without converters

New methods GraphObject.set and Diagram.set return their instance. When using TypeScript definitions, the compiler checks these calls for GraphObject and Diagram property existence and value types.

New method GraphObject.apply can be used to define common functions that provide settings and bindings. Such customizations can then be applied to a GraphObject that you are initializing by calling GraphObject.apply with that function.

Together, these changes remove the need to use GraphObject,make when concisely defining Diagrams and templates. For a complete example, this code:

    const $ = go.GraphObject.make;

    const myDiagram = $(go.Diagram, "myDiagramDiv",
      {
        "undoManager.isEnabled": true
      });

    myDiagram.nodeTemplate =
      $(go.Node, "Auto",
        $(go.Shape, "RoundedRectangle",
          { strokeWidth: 0, fill: "white" },
          new go.Binding("fill", "color")),
        $(go.TextBlock,
          { margin: 8, font: "bold 14px sans-serif", stroke: '#333' },
          new go.Binding("text", "key"))
      );

Can now be written as:

    const myDiagram = new go.Diagram("myDiagramDiv",
      {
        "undoManager.isEnabled": true
      });

    myDiagram.nodeTemplate =
      new go.Node("Auto")
        .add(new go.Shape("RoundedRectangle", { strokeWidth: 0, fill: "white" })
              .bind("fill", "color"))
        .add(new go.TextBlock({ margin: 8, font: "bold 14px sans-serif", stroke: '#333' })
              .bind("text", "key"));

For more information and examples, see the intro page on Building Objects.

### General New Features in GoJS 2.2

- Spot Panels now support Panel.alignmentFocusName on the main element. This can be useful for creating Spot panels with multiple item arrays that align to the same main element. There is an example of this property in the Spot Panel section of the Panel intro page.
- The Diagram.autoScrollInterval property controls the milliseconds between autoscroll events.
- The Diagram.delayInitialization's argument function is now a passed a reference to the Diagram.
- The Overview.drawsGrid and Overview.updateDelay properties control drawing by an Overview.
- The CommandHandler.isZoomToFitRestoreEnabled property controls whether the CommandHandler.zoomToFit command ever restores the previous Diagram scale and position.
- The DraggingTool.copyCursor, DraggingTool.moveCursor, and DraggingTool.nodropCursor properties modify the cursors during a drag.
- The LinkingBaseTool.linkingCursor property modifies the cursor during linking.
- The GraphObject.findBindingPanel method walks up the visual tree to return the first Panel whose Panel.data is bound to data. Used in the Hyperlink sample.
- The Panel.copyTemplate method makes a deep copy of a Panel, including its Bindings, to allow use of the result in templates. This is used in LinkLabels In Front sample.
- The TextBlock.formatting property controls the policy of trimming whitespace on TextBlock text. This can be useful when text strings are preformatted.
- The TextBlock.lineHeight property provides better information about how the text is being measured and rendered.
- The TextBlock.spacingAbove and TextBlock.spacingBelow properties better control the measuring and rendering in addition to the TextBlock.lineHeight.
- The Node.findExternalTreeLinksConnected method returns a collection of Links that connect with this Node or any in its subtree, excluding any isTreeLink Links. This is the tree-equivalent of Group.findExternalLinksConnected for Groups/subgraphs.
- The Node.findVisibleNode method walks up the chain of Node.containingGroups to find the first node that is visible. This can be overridden to change behavior, as it is in Tree Mapper sample.
- The PanelLayout.remeasureObject method forces a specific GraphObject (but none of its containing panels) to remeasure. This can be useful implementing custom layouts.
- The DraggingTool now optimizes transactions to reduce memory usage by only saving the first and last drag changes. This can be changed by overriding DraggingTool.stopTransaction.
- The Binding constructor now accepts a back-converter as an argument. A null or function argument value as the fourth argument will automatically call Binding.makeTwoWay> for you. Not supplying the fourth argument or passing it undefined will leave the Binding OneWay, as it has in the past.
- The RadialLayout extension by default spreads the children better.
- The TextEditingTool now stops any default animation when the tool is activated.
- The TextEditingTool now respects the vertical alignment when a TextBlock is taller than its text.
- InputEvent.bubbles allows events to bubble beyond the Diagram div. This can be useful in CommandHandler and Tool method overrides.
- For some testing environments: Diagram,isUsingDOM and Diagram,useDOM can query and control the GoJS library's expectation of a DOM existing.
- Fixed a regression from 2.1.29 where some links may update their geometries outside of a transaction.
- Potentially incompatible: Touch and Mouse events have been replaced internally with Pointer events. The GoJS API has not changed, nor has its behavior, as long as the browser is not so old that it does not implement pointer events.

### Easier Manipulation and Customization of Geometries

GoJS 2.2 contains new methods to simplify geometric calculations and more easily customize geometries.

- Point,intersectingLineSegments is a static function that returns true if two finite straight line segments intersect each other.
- Rect,intersectsLineSegment is a static function that returns true if a rectangular area is intersected by a finite straight line segment.
- Point,compareWithLineSegment is a static function that compares a point with a finite straight line segment, given x,y numbers. Point.compareWithLineSegmentPoint is a method that performs the same comparison, but on Points.
- Geometry.containsPoint is a method that returns true if the Geometry contains a given point.
- The Link.routeBounds read-only property returns the bounds of the Link geometry in document coordinates. Used in the BalloonLink sample.
- The Node.getAvoidableRect method returns the area to be avoided for this node, equal to the node's GraphObject.actualBounds plus the Node.avoidableMargin. This method can be overridden to customize AvoidsNodes routing behavior near a node to account for the visual area occupied by the node being smaller than the full rectangular bounds of the node.
- Groups now implement Panel.isClipping. If set to true on a Group and if the group has a Group.placeholder, the group will visually clip its member nodes and links. This does not change how those parts are measured, nor does it affect how those parts may be positioned.
- The Layer.isInDocumentBounds property allows finer control of which layers are part of the Diagram.documentBounds. Before 2.2, only layers with Layer.isTemporary set to true were excluded from the document bounds (and could not be explicitly included).
- The ResizingTool.oppositePoint property returns the Point opposite to the chosen, dragged handle of the "Resizing" Adornment. This allows customizations like the LimitedGroupResizingTool sample, which demonstrates a custom tool to allow resizing groups while disallowing the group to resize smaller than its members, and also disallowing the group to expand to cover any non-member nodes.
- The `RoundedRectangles` extension code now includes definitions for the "RoundedLeftRectangle" and "RoundedRightRectangle" figures. The definitions for all four "Rounded...Rectangle" figures has been modified slightly to better match the curves of a full "RoundedRectangle".

## GoJS 2.1

### New Animation Capabilities

GoJS 2.1 contains a number of new features to animate different components of your Diagram.

See the Intro page on Animation and the Custom Animation sample for more details and examples.

- New default GoJS animation "fades up", instead of animating Node locations. Added AnimationManager.initialAnimationStyle to control this behavior. Here is an example of:
  - (top) The new initial animation, the Diagram position animating upwards and Diagram opacity animating from 0 to 1.
  - (middle) A custom "zoom in" animation, animating Diagram scale, which is demonstrated in the new State Chart sample,
  - (bottom) AnimationManager.initialAnimationStyle set to AnimationManager.AnimateLocations to perform the GoJS 2.0 and previous style of animation. The Data Visualization sample uses this option.
- Added `"InitialAnimationStarting"` DiagramEvent to more easily customize initial animations. See AnimationManager.initialAnimationStyle for details.
- New class: AnimationTrigger. These describe how to automatically animate a property on a GraphObject when it changes value.
- New class: Animation. This class lets you declaratively setup custom animations, with options for indefinite animations.
- New AnimationManager options, including the ability to define custom animation effects to animate with AnimationManager,defineAnimationEffect
- New Animation samples and samples modified to use new Animation features:
  - Custom Animation - New Sample: Demonstrating a number of Node creation/deletion animations, linking animations, and more.
  - Tree Load Animation - New Sample: recursive animation upon model load.
  - Flowchart - In the Palette only, initial animation is disabled in favor of a custom fade-in animation.
  - State Chart - Initial animation is disabled in favor of a custom zoom fade-in animation.
  - Data Visualization - Nodes now move using an AnimationTrigger.
  - Kitten Monitor - Kittens now move using an AnimationTrigger.
  - Process Flow - An indefinite Animation of the Links' strokeDashArray.
  - Shop Floor Monitor - Link color changes now use an AnimationTrigger.

### Improved Support For Data Synchronization

GoJS 2.1 contains some new methods to ease integration of GoJS diagrams in applications that maintain their own data, particularly React apps.

See the Intro page on using GoJS with React and the gojs-react example project for details and examples. Also see gojs-react, a package containing React Components for GoJS Diagrams, Palettes, and Overviews.

- New method: Model.toIncrementalData. This method outputs an IncrementalData object containing changes that occurred within a Transaction, similar to the existing method, Model.toIncrementalJson. It can be used to keep outside data synchronized with the GoJS model.
- New methods: Model.mergeNodeDataArray and GraphLinksModel.mergeLinkDataArray. These methods are used to merge outside data changes into the GoJS model.
- New method: Model.cloneDeep. This method can be used to make a deep copy of an object, which may be useful to ensure GoJS doesn't share references with outside state. It is also used within Model.toIncrementalData to ensure IncrementalData's list of modified objects won't contain references to the model's data objects, if the external data is required to be immutable.

#### Changes for 2.1.56

- Updated the root object for systems that define `window` but do not attach all global variables to it. GoJS now prefers `globalThis` if it exists, then `global`.

#### Changes for 2.1.55

- Fixed some improper shadows in the SVG output of Diagram.makeSVG.

#### Changes for 2.1.54

- Fixed Diagram.viewSize when setting it to a real value and then later setting it back to a NaN value.
- As with 2.1.52, fixed more scenarios with custom animations improperly adding state to the AnimationManager.defaultAnimation.
- Fixed rare cases of LayeredDigraphLayout trying to get the "centerX" property of a null vertex.
- Fixed the RelinkingTool not to automatically select the link that was reconnected.

#### Changes for 2.1.53

- Fixed Binding.ofModel binding when there is no Diagram and thus no Model to just ignore the binding.
- Fixed a regression in Diagram.makeSVG from 2.1.49 when using a Panel,Spot with Panel.isClipping set to `true`, where some elements would get grouped and positioned incorrectly.
- Fixed Model.toJson output when object keys contained unescaped double-quote characters.
- Fixed some Shape Geometry intersections (such as with Link connections) when the Shape's Geometry contained small and flat beziers.
- Fixed collapsed Parts incorrectly causing their Groups to remeasure, which may have caused Group's connected Links to re-route.

#### Changes for 2.1.52

- Fixed animations incorrectly resetting some link routes.
- Fixed custom animations improperly adding state to the AnimationManager.defaultAnimation.
- Fixed a regression in 2.1.51 where un-modeled parts containing Images, that are added before a model is set, may fail to load.
- Fixed a regression from 2.1.50 when Picture.errorFunction was used to modify the Picture.source or Picture.element, which would cause a "Collection was modified during iteration" error.

#### Changes for 2.1.51

- The TextEditingTool, when the user has entered an invalid text string, has always called any TextBlock.errorFunction and then continued showing the text editor so that the user could fix their text entry. The TextEditingTool.doError method now calls any TextBlock.errorFunction and also calls HTMLInfo.show on the TextEditingTool.currentTextEditor. This will allow an override of TextEditingTool.doError not to continue showing the editor. If you have not overridden that method, which was new in 2.1, this change will not affect you.
- Fixed Model,fromJson not to substitute instances of classes such as Point and Size when the Object's "class" property had a value that is "Point" or "Size". The property value must be what is produced by Model.toJson, which uses values such as "go.Point" or "go.Size". The documentation lists all of the substitution cases that Model,fromJson handles.
- Fixed a regression from 2.1.43 which caused some links to animate routes incorrectly upon dragging.
- Fixed loading Images used as a Picture.element.
- Improved some AvoidsNodes routing of Links when connecting Nodes in different Groups and the Groups are not Group.avoidable.
- Fixed using multiple license keys.

#### Changes for 2.1.50

- Enhanced the LinkShiftingTool extension to support links that are only connected at one end.
- Fixed CommandHandler.doKeyDown to support Robot.keyDown use of "F2" and "ContextMenu" keys.
- Improved routing of AvoidsNodes links that have a "to" end segment with a direction that is a multiple of 45 (but not 90) degrees.
- Fixed diagram not redrawing after images load in frameworks that use a shadow DOM, such as Angular.
- If you call TextBlock,setBaseline or TextBlock,setUnderline outside of your diagram initialization, you should also call Diagram.redraw on all Diagrams.

#### Changes for 2.1.49

- Added the Flow PanelLayout extension, demonstrated in the Flow PanelLayout sample. This panel layout (not a diagram layout!) arranges panel elements into rows or columns. As time goes by we may add more properties to control the behavior of this custom panel layout.
- Fixed undo/redo bug involving setting RowColumnDefinition properties and calls to Panel.removeColumnDefinition.
- Fixed Picture.successFunction erroneously being called twice in some situations, such as when a node was copy-pasted.
- Fixed Diagram.makeSVG not rendering shadows on some GraphObjects.
- Fixed Diagram.makeSVG not clipping when using a Panel,Spot with Panel.isClipping set to `true`.
- Improved visual consistency of shadows in SVG output from Diagram.makeSVG.

#### Changes for 2.1.48

- Fixed Panel.removeRowDefinition and Panel.removeColumnDefinition to decrease the Panel.rowCount and Panel.columnCount when the highest index RowColumnDefinition is removed.
- Fixed Picture.successFunction, which was called for only the first Picture with a given unique Picture.source. It is now called for every Picture that has a `successFunction` defined with the same (successfully loaded) source.

#### Changes for 2.1.47

- Fixed Diagram.layoutDiagram not performing a layout immediately if called within an ongoing Diagram update (such as during a DiagramEvent like `"InitialLayoutCompleted"`).
- Fixed Panel.itemTemplate so that it is used, not the default item template, when the panel cannot find any template with the given category name in the item data.
- Diagram.viewSize, if set, now takes precedence over the size of the Diagram.div. It is not typical to set both a DIV and the `viewSize`, but in environments where a DIV is set automatically it may be useful for testing purposes to set an explicit `viewSize` as well.

#### Changes for 2.1.46

- Fixed indefinite animations causing some transactions to skip the UndoManager.
- Fixed Diagram.makeImageData to draw any other Parts in the "Grid" Layer besides the Part holding the Diagram.grid when the `showGrid` option is true but the `showTemporary` option is false.

#### Changes for 2.1.45

- Fixed a bounds calculation bug with PathSegment,SvgArcs, when the arc has a zero X or Y radius value.
- Link route calculations now avoid an effectively infinite loop due to floating point errors when the two ports almost exactly overlap each other.
- Fixed an occasional exception when dragging a disconnected link when the link had no points in its route.
- The GraphObject.naturalBounds of a Shape now always prefers GraphObject.desiredSize if it exists, over the Shape's Geometry.bounds. These are usually the same, but a Geometry with beziers can be slightly off from the desiredSize used to create it.

#### Changes for 2.1.44

- Fixed a regression from 2.1.28 with some Shape.geometryString paths. If a path contained an arc command that was closed, a relative move command afterwards would be at the wrong coordinates.

#### Changes for 2.1.43

- Improved performance of LayeredDigraphLayout for large graphs when LayeredDigraphLayout.packOption is set to LayeredDigraphLayout,PackAll. Setting LayeredDigraphLayout.packOption to a subset of the possible flags has always helped performance at the expense of improved layout. Also, it has always helped to set LayeredDigraphLayout.aggressiveOption to LayeredDigraphLayout,AggressiveNone.
- Fixed non-default indefinite animations preventing the default animation from starting. Fixed some other non-default animation bugs, such as indefinite animations preventing Overviews from updating.
- Enhanced LinkingTool.findLinkablePort, when LinkingTool.startObject is a Node and the whole node is not a port, to return the node's default port Node.port instead of null, if the port is a valid port for linking from or to.

#### Changes for 2.1.42

- Fixed an animation bug with ResizingTool where it would disable all animations on resizing.
- Setting AnimationManager.isEnabled to false and then true again will resume any indefinite animations (animations with Animation.runCount set to `Infinity`).
- Fixed RadialLayout not properly resetting its network. This was most often seen when using with Diagram.delayInitialization (including gojs-react and gojs-angular).

#### Changes for 2.1.41

- Improved the animation of colors in Animations.
- Added the Spot Rotating Tool extension, demonstrated in the Spot Rotating sample. This is basically the RotatingTool extended to support an additional Adornment and handle for letting the user interactively move the RotatingTool.rotationPoint by setting Part.rotationSpot.
- Added an Introduction page about Using GoJS on Different Platforms, summarizing existing resources for them.

#### Changes for 2.1.40

- Fixed some styling and missing files in the web site as a result of the reorganization in 2.1.39.
- Simplified the Storage and FloorplannerTS projects.

#### Changes for 2.1.39

- Reorganized GoJS kit and site. `gojs` package no longer contains jQuery, and samples that reference jQuery use a CDN.
- Fixed animating the position of GraphObjects inside a Position Panel.

#### Changes for 2.1.38

- Table panel fixes with stretch elements, this includes a regression fix from 2.1.35.
- Fixed a regression (for IE11 only) from 2.1.37, which broke mouse events.

#### Changes for 2.1.37

- Added an Introduction page about Testing with Jest and with Cypress.
- Fixed some scenarios with Table Panels not apportioning space correctly when elements stretched and rows/columns had minimums or maximums set.
- Fixed touch-dragging between Diagrams in frameworks that use a shadow DOM (like Angular).
- Fixed routing invalidation of links to nodes in collapsed groups that have "...Sides" Spots.
- Fixed shadows on unfilled PathFigures when a GraphObject.fill was set. This mostly presented itself when shadowing bezier or orthogonal Link paths. This fix may cause Links with a Link Label to draw a shadow on the Link path where none was previously. If you do not want the Link path shaded, you must set GraphObject.shadowVisible to `false` on the Link path Shape.

#### Changes for 2.1.36

- Fixed "Graduated" Panels rendering of final tick mark in some cases where due to floating point errors the tick mark was not drawn.
- Fixed Link.getLinkPointFromPoint for some cases where the start point was inside the target port shape.
- One can now avoid invalidating the routes of other links that connect the same pair of ports when links between them are added or removed, by setting Link.curviness to a number such as zero.

#### Changes for 2.1.35

- Fixed jitter that occurred when dragging between diagrams with a modifier key held down.
- When dragging between diagrams, fixed the loss of routing of partly or fully disconnected reshaped links that have TwoWay Bindings on "points", and fixed the positioning of multiple fully disconnected links.
- Fixed a shadow-drawing bug that could occur when Part.isShadowed is false but GraphObject.shadowVisible is true.

#### Changes for 2.1.34

- Improved performance for off-screen Adornments and Parts.
- Fixed exception regarding Workers when running in a web Worker.

#### Changes for 2.1.33

- Improved AvoidsNodes routing performance for many common cases.
- Improved ContextMenuTool.canStart to return false for double or triple context clicks.

#### Changes for 2.1.32

- Fixed auto-scrolling not to do so in the directions in which Diagram.allowHorizontalScroll and Diagram.allowVerticalScroll disallow it.
- Fixed the positioning of nodes and links when an animation is stopped during a drag that operates on the same Parts.
- Fixed Diagram.makeSvg where the SVG would not include Picture.source in headless browsers.
- Fixed Diagram initialization when no Diagram DIV is specified, but setting some properties expected one (such as Diagram.scrollMargin).

#### Changes for 2.1.31

- Fixed a regression since 2.1.30 where the library might not load in React or Angular environments, and a TypeError would be thrown.
- Fixed dragging of links connected with snapped nodes when the grid cell size was not an integer, causing the links to slowly shift over time.
- Fixed rendering of background in images drawn by Diagram.makeImageData when the whole page has been scaled to be less than 100%.
- Fixed Diagram.delayInitialization when calling code that prompts the Diagram to update immediately afterwards.
- Fixed premature routing of links in Groups that start off collapsed (with Group.isSubGraphExpanded set or bound to false).
- Fixed animation that might revert some routes when the initial animation was turned off.
- Link.computeAdjusting now only returns Link,End during animation only when routing is AvoidsNodes.
- Fixed a regression since 2.1.29 where an Overview would not update with a newly set Overview.observed Diagram and a newly displayed HTMLDivElement until some activity happened on that observed Diagram.

#### Changes for 2.1.30

- Changed the behavior of GraphLinksModel so that the use of a key of a non-existent node can be resolved by adding a node with that key in a later transaction, not just in the same transaction.
- Fixed routing of duplicate orthogonal links between ports with "...Side" Spots to avoid producing little loops when the ports are close to each other.
- Fixed ContextMenuTool to automatically stop running if the newly shown context menu is a not-GraphObject.visible Adornment.
- Fixed exception on expanding a Group whose member nodes had partly disconnected links.

#### Changes for 2.1.29

- Overviews now wait for the Diagram to draw first before attempting to draw. This solves timing issues with Diagram.delayInitialization.
- Fixed delays in updating the Link.geometry after changing properties such as Link.corner.
- Fixed setting Diagram.scrollMargin during Diagram initialization, which would interrupt the initial transaction.

#### Changes for 2.1.28

- Added the Diagram.ensureBounds method. Like Part.ensureBounds, this is useful when you need the document bounds computed immediately. It is rare that you will need to call either method, because the normal updating process will perform the computations for you as part of a transaction, asynchronously.
- Fixed some parsing issues when using Geometry.parse or Shape.geometryString with SVG arcs.
- Fixed the Picture.source setter from failing in non-DOM environments.
- Fix for DOM-less environments that do not have `setImmediate` defined.
- Fix for Link routing when connecting to the edge of an arc segment.

#### Changes for 2.1.27

- Fixed the routing of links connected with nodes that are members of expanded groups inside collapsed groups.
- Fixed some Shapes in Link Selection Adornments inheriting their `strokeWidth` from the Link. Only the main path Shapes of Link "Selection" Adornments with a `strokeWidth` of 0 will inherit the `strokeWidth` from the adorned Link.path Shape.
- Fixed changing Picture.source back to an empty string not to throw an unnecessary error.

#### Changes for 2.1.26

- Added a `ResizeObserver` to automatically detect changes in the size of the HTMLDivElement (the Diagram.div) in recent browsers. You will still need to call Diagram.requestUpdate when running in older browsers or in Internet Explorer.
- Added the ResizingTool.dragsMembers property, for controlling whether resizing a Group may move its Group.memberParts if it has no Placeholder.
- Fixed regression since 2.1.24 causing some diagrams not to be drawn even after calling Diagram.requestUpdate.
- Fixed some cases of finding the nearest intersection point of Bezier curves with a straight finite line.

#### Changes for 2.1.25

- Added the Connection Box Node sample, showing nodes that allow links between ports within a node.
- In order to avoid possible errors caused by loading the GoJS library more than once, an Error is thrown when a second load is detected, even if the version number is the same. This helps avoid problems where there are multiple definitions for each of the classes, causing errors such as: `Error: Unknown type of binding target: Node#241`, where the object is a GoJS Node, but not the same GoJS Node class as the code expects. It also helps avoid situations when both the release library and the debug library are loaded.
- Fixed raising an extraneous Diagram.mouseOver event during initialization.
- Fixed a regression since 2.1.0 that would prevent a Diagram or Overview from re-scaling or aligning when its DIV changed size.
- Fixed invalidating routes of external links when nested groups change their visibility in ways other than expanding trees or subgraphs.
- Fixed Model.mergeNodeDataArray, GraphLinksModel.mergeLinkDataArray, and Model.applyIncrementalJson to set known properties, eg. GraphLinksModel.nodeGroupKeyProperty, even when the property is not present on the new data.

#### Changes for 2.1.24

- Added the Multi-color Links sample, showing links whose paths can be stroked with multiple colors specified in an Array as the value of the link's `data.colors`.
- Associating a Diagram instance with an HTMLDivElement now causes that Div element to get two new properties: "goDiagram" to refer to that Diagram instance, and "go" to refer to the "go" namespace if it exists. This makes it easier to examine or set Diagram properties or to call Diagram methods or methods on GraphObjects in existing apps without access to the app's source code.
- Fixed using subclasses of GraphLinksModel or TreeModel.
- Fixed AnimationTriggers incorrectly starting when AnimationManager.isEnabled is set to `false`.
- Fixed extraneous Transaction ChangedEvents when modifying a group invalidated a layout.

#### Changes for 2.1.23

- Added the Arranging Layout extension, demonstrated in the Arranging sample. This layout is basically a layout of layouts, so that you can have a CircularLayout of CircularLayouts, as shown in the sample, or a PackedLayout of TableLayouts, or whatever. The ArrangingLayout also has a third layout that is used to position nodes not arranged by the main layout. This is normally a GridLayout that only positions singleton (disconnected) nodes.
- Improved the ParallelLayout extension and rewrote the Flowgrammer sample to use that ParallelLayout.
- Fixed UndoManager sometimes adding a duplicate "Layout" transaction to the UndoManager.history.

#### Changes for 2.1.22

- Added the Rescaling Tool extension, demonstrated in the Rescaling sample. This tool modifies the GraphObject.scale property, unlike the ResizingTool which modifies the GraphObject.desiredSize property.
- Improved performance of Model.mergeNodeDataArray, GraphLinksModel.mergeLinkDataArray, and Model.toIncrementalData. The merge methods require that references are not shared between the the GoJS model and the external data provided and will now make deep copies of any new data objects before adding them to the model. This means Model.cloneDeep doesn't need to be called on the arrays passed in, as the merge methods will make the necessary calls.
- Fixed `go-module.js` to work when treated as an ES6 module in Node.js. At the same time we have added `go.mjs` and `go-debug.mjs` as copies of `go-module.js` and `go-debug-module.js`. For compatibility the kit will contain both sets of files.
- Fixed automatically performing layouts of outer groups after inner nested groups changed size.

#### Changes for 2.1.21

- Added the Swim Lane Layout extension, demonstrated in the Swim Lane Layout sample. This layout is a version of LayeredDigraphLayout that positions each node in the lane in which it is supposed to be.
- Fixed parts that have their location or position set when not in the Diagram. This issue affected temporary parts, such as Adornments created by Tools that were repeatedly added and removed from the Diagram.
- Fixed ordering of links on a Spot,TopSide or Spot,BottomSide port when linking with a node to the right.
- Fixed some scaling animations when Diagram.autoScale is set.

#### Changes for 2.1.20

- Fixed GraphLinksModel.setLabelKeysForLinkData sometimes disassociating a link's label nodes that existed in both the old and new array.
- Fixed the recording of model changes bound to a Part's `position` or `location`, where they may not have been recorded in the UndoManager when modifying the `position`, `location`, or `desiredSize`. This also fixes a regression from 2.1.14.
- Fixed LinearGradient painting when used as a Shape.stroke. This drawing issue was most apparent when the Shape's geometry was one-dimensional.
- Fixed warning messages in Chrome about passive touch event listeners.
- Fixed JumpOver and AvoidsNodes issues where ongoing animations might stop them from updating.

#### Changes for 2.1.19

- Fixed changing Placeholder.padding to remeasure its Group or Adornment.
- Fixed Diagram.initialPosition and Diagram.initialScale sometimes not showing scrollbars on initialization.
- Fixed not recording a transaction that was empty until a "CommittingTransaction" Transaction-type ChangedEvent caused some ChangedEvents to made, a regression from 2.1.16.

#### Changes for 2.1.18

- Added the Belts and Rollers sample, showing belts or chains wending around rollers or gears.
- Fixed finding a node by key after undoing a call to Model.setKeyForNodeData.
- Fixed Diagram initialization without DIVs or with delayed initialization, where setting some properties like Diagram.scaleComputation would cause measuring errors.
- Improved handling of numeric large arc flag values when creating SVG arc PathSegments via PathSegment.constructor.
- Fixed the TypeScript declaration for GraphObject,make to handle AnimationTriggers.

#### Changes for 2.1.17

- Added the Radial Adornment Buttons sample, showing a selection Adornment, only on one node, that is like a context menu with buttons arranged in a circle around the selected node.
- Added the Donut Charts sample, showing a simple circular bar chart in each node.
- Fixed exporting the Picture.reloadSource and Picture.redraw methods.
- Fixed the LinkingBaseTool.temporaryFromPort and LinkingBaseTool.temporaryToPort property setters to replace the port of the corresponding temporary node. This allows customization of a LinkingTool by setting either or both of those two properties.
- Fixed Diagram.makeImage with a Picture SVG data URI source, in the same manner as in 2.1.16.
- Fixed undo of a Shape.geometry setting, after its GraphObject.desiredSize had been set. This particular sequence of events was discovered in the use of the GeometryReshapingTool extension.

#### Changes for 2.1.16

- Added the Animated Focus sample, which demonstrates how to scroll to a node and really make it obvious where the node is and what it looks like.
- Added the Add To Palette sample, which allows the user to add items from the palette by selecting a node, customizing it, and then executing a command to copy it to the palette's model. The user can also remove selected items from the palette via a command, even though Palette.isReadOnly is true.
- Fixed Diagram.makeImage when a Picture has an SVG source that has a different size than its viewbox. In some browsers the SVGs had been drawn with the incorrect aspect ratio.
- Fixed Diagram.delayInitialization incorrectly resetting the Diagram.position when animation is enabled.

#### Changes for 2.1.15

- Added the Single Page Diagram sample, demonstrating how to show a sheet of paper behind the diagram and how to limit dragging and resizing to stay within the margins of the page.
- Fixed label TextBlocks in Graduated Panels not respecting their assigned GraphObject.angle. The angle will now be used when the label's GraphObject.segmentOrientation is Link.None, Link.OrientAlong, or Link.OrientUpright.
- Fixed expand and collapse animations, where collapsed objects would temporarily receive NaN locations.

#### Changes for 2.1.14

- Added the Simple Block Editor sample, demonstrating how to let users easily build block diagrams.
- Changing Link.fromShortLength or Link.toShortLength no longer invalidates the link's route.
- Improved the corner curves of orthogonal links when needing to make consecutive turns within double the corner radius.
- Fixed an incorrect optimization introduced in 2.1.13 updating initial scrollbars when animating.
- Fixed undo and redo of ResizingTool operations when the Part.locationSpot is not TopLeft.

#### Changes for 2.1.13

- Fixed the cursor shown during a drag in an Overview if some external HTML element changed the cursor.
- Fixed Diagram.makeSvg when rendering a fill or a stroke that is translucent not to make the opacity too small.
- Added wait spinners to three of the "Virtualized" samples: Virtualized, VirtualizedForceDirectedLayout, VirtualizedTreeLayout. These use an image rotated using CSS animation that is positioned in front of the Diagram.

#### Changes for 2.1.12

- Added the Meter and Gauge Controls sample, demonstrating several different kinds of meter and gauge instruments whose values can also be modified by the user by dragging their indicators.
- Added the Production process editor sample, which edits diagrams that can be shown by the Production process sample.
- Added the SnapLinkReshapingTool.avoidsNodes property in the extensions directories.

#### Changes for 2.1.11

- Fixed "Grid" Panels to ignore the order of shapes in the panel when considering whether a larger Shape.interval shape should suppress a smaller interval shape, or should be suppressed by a larger interval shape. Changed "Grid" Panels to allow multiple shapes with the same Shape.interval to be drawn in the same orientation (horizontal or vertical).
- Fixed documentation by undocumenting the useless AnimationManager.animationReasons property that was accidentally documented. See the updated documentation for AnimationManager.canStart.
- Fixed Brush.isDark sometimes using an incorrect ordering of Brush.colorStops when determining darkness near the middle of a Brush.

#### Changes for 2.1.10

- Added DrawCommandHandler.pullToFront and DrawCommandHandler.pushToBack commands in the extensions directories.

#### Changes for 2.1.9

- Fixed breadth computations for some cases of TreeLayout.arrangement of separate trees when TreeLayout.compaction is `go.TreeLayout.CompactionNone`.
- Fixed type declarations of Binding.converter and Binding.backConverter to return `any` instead of `void`.

#### Changes for 2.1.8

- Added the Game of Life cellular automation sample.
- You can improve the performance of an Overview that is observing a large diagram with a visible Diagram.grid by setting Overview.drawsTemporaryLayers to false.
- Improved the behavior from 2.1.7 when trying to open text editors in multiple diagrams. A new text editor can be started only if the previous one was able to be accepted. If TextBlock.textValidation or TextEditingTool.textValidation fails, focus remains in that older editor and a new one cannot be started.
- Fixed exception during copy-dragging when some parts are not Part.copyable.

#### Changes for 2.1.7

- Added the Packed Hierarchy sample, which demonstrates a custom PackedLayout for nested circular groups.
- Added an optional argument to Diagram.clearSelection, and allowed that method to be overridden.
- The TextEditingTool now only allows one active text editor globally, instead of one per Diagram. This avoids some focus problems in various browsers.

#### Changes for 2.1.6

- The `release/go-module.js` file now exports every class, so that you can import only specific classes, instead of `go`. For example: `import { Diagram, Node, Link, Point, Shape, TextBlock } from ...`.
- Added a sample demonstrating generating a PDF file for a Diagram, in the `projects/pdf` subdirectory. The sample is at minimalPDF.
- Fixed AnimationTriggers erroneously starting when dragging and dropping Parts from another Diagram or Palette.
- Fixed LinkingTool not deselecting other parts when a new link is created.

#### Changes for 2.1.5

- Added VirtualizedPacked sample, which demonstrates a custom layout for large graphs of nested groups, defined in VirtualizedPackedLayout.ts. (Source is TS only)
- Fixed setting a node key reference in either a node or link via GraphLinksModel.setGroupKeyForNodeData, GraphLinksModel.setFromKeyForLinkData, or GraphLinksModel.setToKeyForLinkData where it could fail to resolve if the node did not yet exist. This issue did not exist during typical model loading.
- Fixed a regression since 2.1.1 with Diagram.clear failing to clear internal Parts lists (like Diagram.nodes).

#### Changes for 2.1.4

- Added Link.computeAdjusting to conditionally change the value of Link.adjusting used. As a new default, links will use the adjusting value Link,End during animation. Link.computeAdjusting can be overridden to change this behavior.
- Added Geometry.getPointAlongPath, Geometry.getAngleAlongPath, and Geometry.getFractionForPoint. These methods can be used to find a point or angle for a given fractional distance along a Geometry's path, or to find the fractional distance along the Geometry's path given a nearby point.
- Setting GraphObject.segmentIndex to NaN, which was previously an error, will now treat the entire link path as the segment for the purpose of GraphObject.segmentFraction. This allows for using fractional distances along the entire link rather than just one segment.
- Fixed object picking during Diagram's InitialLayoutCompleted DiagramEvent.
- Fixed GoCloudStorage where a null defaultModel would fail.
- Fixed Panel.graduatedValueForPoint in cases where the main shape was a diagonal line and the provided point didn't fall on the line.

#### Changes for 2.1.3

- Fixed a regression from 2.0.0 with AvoidsNodes links improperly re-routing when using the DraggingTool.
- Fixed a undo (redo) bug with AnimationTriggers that used location or position on Parts.
- Improved routing of duplicate links that have Link.adjusting set to a value other than None and have more than the standard number of points in their route.

#### Changes for 2.1.2

- Fixed a regression in 2.1.1 with the timing of `InitialAnimationStarting` that would prevent custom initial animations.
- CTRL + Mouse-wheel will still stop the event from bubbling, even if CommandHandler.canIncreaseZoom or CommandHandler.canDecreaseZoom return false. These are potentially false if a Diagram.minScale or Diagram.maxScale are set. This change stops the entire page from accidentally zooming during a zoom-wheel operation.
- Fixed a measuring bug with Link Geometry when the Link is smaller than the Link.toShortLength or Link.fromShortLength.

#### Changes for 2.1.1

- Fixed updating of Adornments when there are Bindings from Model.modelData and that shared object has been modified by calling Model.set.
- Improved performance when replacing Diagram.model when cleaning up the old model, which had infrequently resulted in obscure warnings in debug mode about Node.isTreeLeaf.
- Fixes for loading Models with serialized EnumValues.
- Performance improvements for concurrent animations.
- Fixes for consistency of animation state. This includes modifying when `AnimationStarting` and `InitialAnimationStarting` are called, and fixes when default animations are stopped and another is immediately started, such as when loading a new model in the middle of animation.
- Fixed Model.fromJson loading models with serialized EnumValues.
- Improved showing non-default cursors when dragging between diagrams.
- Fixed the operation of Diagram.handlesDragDropForTopLevelParts when dragging on the elements of a Group.
- Fixed Diagram.scrollHorizontalLineChange and Diagram.scrollVerticalLineChange would not affect scrolling size in some browsers.
- Fixed AvoidsNodes Links routing in nested groups.

#### Other Changes for 2.1.0:

See the major changes above.

- Added DoubleTreeLayout to the extensions and extensionsTS directories. This is now used by the Double Tree sample.
- Updated the sequencing of "ChangingSelection" and "ChangedSelection" DiagramEvents to be outside of transactions for commands and tools. Exceptions include "ChangingSelection" being called during "Drag" and "Linking" operations when drag-copying or inserting a link. With "ChangedSelection" occuring after a transaction completes, any changes will be complete and can be used in the listener.
- CommandHandler.zoomToFit now animates by default.
- Improved the ContextMenuTool.defaultTouchContextMenu's "Paste" command to use the ContextMenuTool.mouseDownPoint rather than the Diagram.lastInput's InputEvent.documentPoint.
- Added new property, Diagram.opacity. This may be useful for fade-in/out animations, or visual indication of a disabled Diagram.
- Added new method, Diagram.findLinkForKey, which will look for a link corresponding to a model's link data object's unique key. This will only return a link when using a GraphLinksModel with GraphLinksModel.linkKeyProperty set to a non-empty string.
- Model.applyIncrementalJson now throws an error if model properties (eg. nodeKeyProperty) included in the JSON don't match the existing model. This check only includes properties included in the output from Model.toIncrementalJson.
- Added new methods, Picture.reloadSource, which reloads a Picture source in case the file on the server has changed, and Picture.redraw which redraws the picture, and can be useful to update the Picture if the source is backed by an HTML Canvas or HTML Video Element.
- Added new sample: SVG Data URL - Export SVG with Base64 hrefs instead of the Picture.source URL.

#### Changes for 2.0 are here.

#### Changes for 1.* are here.

GoJS