angular2-minimal
project, in the projects subdirectory.
This is a copy of the Angular 2 Quick Start example, https://angular.io/docs/ts/latest/quickstart.html,
augmented to show the GoJS "minimal" sample.
go.d.ts
.
go.d.ts
.
GoJS version 1.7 brings several new features and samples. Here are some highlights:
go.js
file download, instead it uses a license key.
Read more on the Deployment Intro page.
returnType
, which allows you to specify a string
(default),
ImageData
(new), or Blob
(new) as the returned type.
Diagram.makeImageData also has a new option callback
which is used in conjunction with returnType: "Blob"
.
See the Minimal Image Blob Download sample for usage details.
These features will remain in the library until version 2.0, but they will no longer be documented and their use is discouraged.
In order to shrink the size of the GoJS library we will be not be defining most predefined figures in the library. Instead, you can find all of their definitions in the Figures.js file. You can simply load only those figures that you want to use by copying their definitions into your code.
Until version 2.0 all of the predefined figures remain defined in the GoJS library, so you do not yet have to load any figures from the extensions file. However, a number of very common figures will remain predefined even in version 2.0. The figures that will remain in 2.0 are: "Rectangle", "Square", "RoundedRectangle", "Border", "Ellipse", "Circle", "TriangleRight", "TriangleDown", "TriangleLeft", "TriangleUp", "Triangle", "Diamond", "LineH", "LineV", "BarH", "BarV", "MinusLine", "PlusLine", "XLine".
Note also that the definitions that are in the Figures.js file are not entirely the same as their current definitions in the library. A number of figures have been improved and some figure parameters have changed meaning.
The only use for this property was with the "SelectionDeleting" DiagramEvent in order to prevent the user from deleting the selection. Where one might have written this Diagram listener:
"SelectionDeleting": function(e) { if (e.diagram.selection.any(function(p) { return p.data.key.indexOf("e") >= 0; })) { e.cancel = true; } },one can write the equivalent functionality with this CommandHandler.canDeleteSelection method override:
"commandHandler.canDeleteSelection": function() { return !this.diagram.selection.any(function(p) { return p.data.key.indexOf("e") >= 0; }) && go.CommandHandler.prototype.canDeleteSelection.call(this); },Overriding the method supports the updating/enablement of commands that call CommandHandler.deleteSelection. Furthermore not having a "cancel" property on the DiagramEvent avoids any potential problems that might occur if there are multiple listeners for the "SelectionDeleting" event. The "SelectionDeleting" DiagramEvent remains useful, but not for controlling whether or not the deletion should happen.
These properties have not been useful. One can override Link.getLinkDirection to achieve the same effects.
These undocumented properties were used to modify the default functionality of the TextEditingTool. That is now done by setting TextBlock.defaultTextEditor to an instance of HTMLInfo (new in 1.7).
For examples, see Custom TextEditingTool sample and Text Editor default implementation extension.
These properties are now primarily used with HTMLInfo values. HTML Elements will still work until version 2.0.
release/goJS.d.ts
to release/go.d.ts
.go-debug.js
involving a name conflict caused by minification.GoJS version 1.6 brings several new features and samples. Here are some highlights:
The complete list of changes:
localStorage
.
$(go.Diagram, "myDiagram", { . . ., "ModelChanged": function(e) { if (e.isTransactionFinished) saveModel(); }, . . . });The listener will be called even if the Diagram.model has been replaced.
Home
and End
keys.
Spot.RightSide
and their GraphObject.toSpot to be Spot.LeftSide
(assuming the LayeredDigraphLayout.direction is zero).
If you do not want the "backwards" cycle-producing links to be routed "around" nodes,
set LayeredDigraphLayout.setsPortSpots to false and set both the GraphObject.fromSpot
and GraphObject.toSpot on the nodes to be Spot.TopBottomSides
(assuming the LayeredDigraphLayout.direction is 90).
module.exports
as well as window.module.exports
, in case they are different objects.
relayoutLanes()
.
This allows the sample to remember where users have dragged the nodes, including saving and loading to JSON text.
Debug
mode if the new value
is not a valid font.
showTemporary
is set to true.crossOrigin
flag on generated images. This functionality can be customized with the undocumented property Picture.sourceCrossOrigin,
a settable function that returns a new value for the image.crossOrigin
. This property will be documented in 1.5.
xmlns
and xmlns:xlink
attributes.new go.Binding("stroke", "isHighlighted", function (h) { return h ? "red" : "black"; }).ofObject()
"go-debug.js"
,
making it easier to track down painting problems.
aMap.iterator.first()
to return a key/value pair object, not the first key.first
, any
, all
, or each
on the Iterator.)
define
capability is present, go
is still exposed to the global object,
which avoids problems with undefined go
when explicitly loading "go.js"
instead of using your framework's require mechanisms.
scale
for Diagram.makeImage (Default should be null
, was erroneously NaN
).
Layout.isRealtime == false
would perform their layout at incorrect times.
release/go.d.ts
for better type-checking when using TypeScript and for Intellisense support in Visual Studio.update
and requestUpdate
methods.link.labelNodes.count > 0
, but more convenient.Shift-Z
.
Invoke it twice in a row to restore the original viewport.
Array.isArray(x)
instead of x instanceof Array
to check for Arrays created in different frames.