Skip to content

Releases: NorthwoodsSoftware/GoJS

2.2.1

28 Jan 15:29
Compare
Choose a tag to compare

If you are upgrading from 2.1 to 2.2, be sure to get a new license key. You must do this on every major.minor change, such as going from 2.1 to 2.2 or 2.3. You do not need a new key for point (2.2.x) releases.

Changes for 2.2.1

See the full 2.2 changelog here.

2.2.0

20 Jan 14:55
Compare
Choose a tag to compare

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: classes, 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 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

Read more

2.1.56

15 Jan 15:32
Compare
Choose a tag to compare

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.

2.1.55

08 Dec 19:38
Compare
Choose a tag to compare

Changes for 2.1.55

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

2.1.54

23 Nov 15:38
Compare
Choose a tag to compare

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.

2.1.53

05 Nov 14:51
Compare
Choose a tag to compare
  • 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.

2.1.52

13 Oct 20:42
Compare
Choose a tag to compare

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.

2.1.40

18 May 19:57
Compare
Choose a tag to compare
  • 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.

2.1.51

04 Oct 15:50
Compare
Choose a tag to compare
  • 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.

2.1.50

17 Sep 17:43
Compare
Choose a tag to compare

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.