Draw2D touch version 5.7.1 released

+ fixing broke resize of SetFigure (e.g. Icons).
+ source and target decoration of an connection isn't handle correct with the toFront and toBack operation - fixed.
+ fix broken serialization of "Line" if the vertices in the JSON document contains less than 2 vertex. This will break the complete reading of the document.
+ fixing wrong icon size of collapsible figure
+ respect the "visible" flag of a child by calling the method "add"
+ fixing wrong width calculation of verticalLayout
+ fixing that ports are not moved when a figure is moved.

Draw2D touch version 5.7.0 released

+ undo/redo support for LabelInplaceEditor and LabelEditor
+ new class draw2d.command.CommandAttr to support any kind of attribute undo/redo

Draw2D touch version 5.6.9 released

+ adding Polygon.setDashArray

Draw2D touch version 5.6.8 (TEST) released

+ fixing method Line.setEndY. The broken implementation swaps end/start coordinate.
+ enable selection of connections within Composites
+ fix broken drag/drop of lines. Line didn'T update end/start after drag&drop end points
+ add the start/end point of a draw2d.shape.basic.Line to the JSON document. Lines can now read/write to JSON too.
+ extend constructor of ShowGridPolicy that the policy can listen to the "zoom" event of the canvas and apply them to the grid size.
+ support Layout.clone()
+ fix grouping error of connections with a label as a child. Label pushed into the background after grouping

Draw2D touch version 5.6.7 released

+ provide method that the ReadOnlyEditPolicy can override/block the onClick method.

Draw2D touch version 5.6.6 released

+ handle "Groups" and "Composites" correct for the SnapToXYZ edit policies.

update bower repository to 5.6.5

Update the bower repository to the latest version of Draw2D

Equidistant between two nodes

Visual feedback during mouse move gestures with snapping support enabled. The support for interactive snapping of graph elements can be conveniently enabled by installing the right EditPolicy into the canvas.


Two nodes aligned at their center coordinates

Visual feedback during mouse move gestures with snapping support enabled.


Draw2D touch version 5.6.5 released

+ fixing broken undo/redo behaviour for Text.js
+ major bug in Canvas.getBestFigure which breaks port drop operation

Draw2D touch version 5.6.4 released

+ remove bug in ArrayList.removeAll which didn't remove any element
+ new SnapToCenter edit policy
+ new SnapToInBetween edit policy
+ consider parent/child relation for canvas.getBestFigure and drag/drop operation
+ change to Zoom example and add the SnapTo guides

Drag&Drop between two different canvas

Example implementation available in the latest release.


Github as JSON backend

When writing a simple web app or prototyping something, you may want a quick and simple way to store, edit and retrieve data.
Let's say you write a simple editor for blog entries or a diagram editor done with a graph lib like draw2d and don't want to build a backend to write, edit and store your data - but you want to conveniently consume this data as JSON - then the Github API helps you with that.


clone on GitHub

Draw2D touch version 5.6.0 released

+ new draw2d.shape.widget.Slider implementation. A Slider (Widget) can now be part of a VerticalLayout/HorizontalLayout
+ Rectangle.translate(x,y)
+ Point.scale(factor). Scale of a Point...it is a scale of a vector.
+ Point.translated(x,y). Returns a translated clone of the original point
+ fixing wrong coordinate handling in the BoundingBoxSelectionPolicy in the onDragStart method. coordinates must be relative instead of absolute.
+ new event callback onPanningEnd for figures with supports panning
+ VerticalLayout didn't calculate dimension correct if padding of the shape is used - fixed
+ Widget didn't forward setter/getter to the base class - fixed

Draw2D touch version 5.5.3 released

+ major bug in parsing "maxFanOut". Using Numbers.MAX_NUMBER to persist and "parseInt" to read. After writing, reading maxFanOut is "1".
+ Draw2D ist now installable with bower. "bower install draw2d" https://github.com/freegroup/draw2d_js.bower
+ new demo projects on GitHub available. https://github.com/search?utf8=%E2%9C%93&q=draw2d_js
+ demo using GITHUB as storage provider for a HTML5 WebApp (serverless!).
code : https://github.com/freegroup/draw2d_js.app.starterkit_githubstorage
demo : http://freegroup.github.io/draw2d_js.app.starterkit_githubstorage/

Using github + npm + bower + grunt...

Grunt and Bower are great command line tools for automating tedious front-end workflow tasks, and quickly adding libraries to a project. With Grunt we can define a series of tasks such as concatenating files, compressing images, running scripts, and so on. Bower is self-described as a “package manager for the web”. It provides an easy way to install a wide variety of libraries into a project, from twitter bootstrap, jQuery, font-awesome, and even your own personal repositories.

Draw2D released a first boilerplate project to automatic download draw2D, dependencies and build the project.


Clone the boilerplate project on Github

Draw2D touch version 5.5.2 released

+ wrong command executed if a group is deleted. The Group still exists but isn't visible

Draw2D touch version 5.5.1 released

+ fixing error in group/ungroup of non resizeable figures
+ new method ArrayList.find

Draw2D touch version 5.5.0 released

+ enhance the png.Writer to support PNG snapshots of a single figure instead of a complete canvas
+ example how to drag&drop figures between multiple canvas (see examples/code_snippets/canvas_drag_drop/)
+ fixing bug in maxFanOut handling in the JSON handling of Port.js
+ fixing PolygonShape bug in translate method with missing "_this" reference

Draw2D touch version 5.4.0 released

+ serialize the port attributes like color, maxFanOut and stroke to the JSON if a node is serialized.

Draw2D touch version 5.3.7 released

+ fixing grouping and toFront bug in Label.js. Text isn'T visible after toFront or grouping.
+ fixing major bug in canvg.js . The lib didn't stop a timer. Memory Leak if you are using PNG-Writer.

Draw2D touch version 5.3.6 released

+ select the group instead of a single figure after undo the "CommandDeleteGroup" command.
+ fire events for the drag enter/leave events.

Draw2D touch version 5.3.5 released

+ fixing missing implementation for group delete and undo of this operation. Implementing CommandDeleteGroup.
+ remove console.log statement which breaks IE.

Draw2D touch version 5.3.4 released

+ take care about already delete figures. Ignore multiple calls if canvas.remove for a figure
+ fixing broke Layout.js. Child figures are always hidden.

Just a click away...

The example shows how to implement a custom port to provide a fast configuration option.
It is not always necessary to implement full blown dialogs or property panes. Sometimes the tiny smart
way ist the best way. Just a mouse click away.

  • hidden if a connection is present
  • the user can stick the label to provide a default value for the port
  • the default value can be changed with a context menu
  • mouse over for quick access the label

Draw2D touch version 5.3.3 released

+ attributes not applied/set to a label figure if it has been removed and added again to the canvas - fixed.
+ new events fired for "dragstart", "dragend", "mouseenter" and "mouseleave" for figures, resize handles and ports
+ "growing" ports during connecting two ports is solved.
+ fire events "connect" and "disconnect" on ports if a connection is deleted
+ add "padding" to the horizontal and vertical layout shape
+ fixing "gap" calculation in horizontal layout
+ invoke missing layout recalculation if a child->child element has changed the dimension.
+ add "margin" as attr property to the LeftLocator/RightLocator constructor to drive the distance between child and parent.
+ move Connection.insetPoint method to new draw2d.geo.Util scope
+ fixing rendering problem in the "Polygon" element. The rendering is always "one behind" the mouse movement.
+ new example. Show how to implement a port decoration which can be toggled off/on by the user.

Draw2D touch version 5.3.2 released

+ enable the canvas to uninstall editPolicy by string instead of pure class instance reference.
+ fixing wrong "panning" direction in the canvas edit policy.
+ fixing rotation bug for nodes

Draw2D touch version 5.3.1 released

+ enhanced documentation for the FlexGridLAyout
+ custom router "RubberbandRouter" with corresponding example

Custom router rendering example for version 5.3.1

The version 5.3.1 contains a custom router example with a not so serious rendering. It is a rubber band.