GoJS 2.1 Alpha available at: https://gojs.net/alpha
GoJS-React example project available here.
This release is available through npm by name:
npm install email@example.com
New Animation Capabilities
GoJS 2.1 Alpha contains a number of new features to animate different components of your Diagram.
See the Intro page on Animation and the Custom Animation Examples for more details and examples.
Library additions for animation:
- 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 Extension: Demonstrating a number of Node creation/deletion animations, linking animations, and more.
- Tree Load Animation - New Sample: recursive animation upon model load.
- Flowchart - Initial animation is disabled in favor of a custom fade-in animation.
- Data Visualization - Nodes now move using an AnimationTrigger.
- Kitten Monitor - Kittens now move using an AnimationTrigger.
- Process Flow - Custom animation defined to animate the Link’s 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. Further improvements are in the works.
- New method: Model.toIncrementalData. This 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 are used to merge outside data changes into the GoJS model without having to rebuild everything.
Other Changes for 2.1.0:
- 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.
- New property, Diagram.opacity. This may be useful for fade-in/out animations, or visual indication of a disabled Diagram.
- 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.
- New Samples:
- SVG Data URL - Export SVG with Base64 hrefs instead of the Picture.source URL