We have released version 6.0 of NetDiagram. It contains the following new features and improvements. Java Applet mode has been dropped.
User-interaction controllersAll kinds of user interaction are now carried out by controller objects. The startDraw method of BehaviorBase-derived classes that returned an opaque InteractionState instance has been replaced by createController method returning a controller of class specific to the modified item and interaction types. Built-in controllers include CreateNodeController, CreateLinkController, ModifyNodeController, ModifyLinkController, LaneGridController. You can also create custom controllers by deriving and overriding the methods of SinglePointerController -
SinglePointerController.prototype =
{
start: function (position) {},
move: function (position) {},
validate: function (position) {},
commit: function (position) {},
cancel: function (position) {},
drawInteraction: function (context) {}
}
Record and replayThe Diagram class provides record, stopRecording and replay methods that can be used to save and replay all user actions with keyboard and mouse. The replay method takes (recording, timer, diagramJson) parameters. The recording argument is an array of records returned by stopRecording. If the timer argument is set to true, events are replayed from a timer preserving their original timing, otherwise they are replayed immediately. Timer mode can be used to show tutorials played directly in the diagram. Immediate mode could be used to automate user interaction testing where an assertion is checked after replaying series of events. Recorded events could also be replayed as macros if ran on a diagram with items placed on same initial coordinates.
Improved testabilityUser interaction can now be tested automatically in several ways outlined below.
Ruler controlThe Ruler control provides horizontal and vertical scales that help users measure and align diagram items. In order to set up a Ruler instance, create a Ruler element and set its DiagramViewID property to the target DiagramView -
<ndiag:Ruler runat="server" ID="ruler">
<ndiag:DiagramView runat="server" ID="diagramView" ClientSideMode="Canvas" />
</ndiag:Ruler>
3rd party dependencies now optionalThe diagram can now be used without JQuery and Microsoft Ajax libraries. To enable that mode, set ClientScriptMode="StandAlone" for DiagramView element. Stand-alone mode requires relatively modern browsers, the base feature-set against we test it is the one of IE11.
Flip shapesThe shape of a ShapeNode can be flipped horizontally or vertically. Enable the AllowFlip property and the shape flips when an edge is dragged over its opposite edge. You can get or set current flip state using FlipX and FlipY properties.
Revamped item dependency systemDependencies between diagram items are now expressed by rule objects and applied in sequence by the DiagramMediator class. Built-in dependencies are implemented by ItemFollowsContainerRule, AttachedFollowsMasterRule, LinkFollowsNodesRule, NodeFollowsSelectionRule rules. You can create custom rule objects with following API and add them to DiagramMediator.AllRules array to make items follow other items during user interaction -
var MyRule =
{
dependencies: function (master) {}, // return array of items that should follow master
dependentUpon: function (dependency) {}, // return array of items that should be followed by dependency
recognize: function (dependency) {}, // return true or false if this rule should be applied on an item
updateFromMasters: function (dependency, originalStates) // set new position or size of dependency
}
Miscellaneous- CaptionBackBrush and FoldIconSize properties added to ContainerNode.
- Multiple rotation of nodes improved, now node angles are modified by same rotation delta calculated from mouse position instead of pointing all rotation handles in mouse direction.
- CustomLinkType property now supported in Canvas mode.
- The LinkPadding property of LayeredLayout specifies the padding space between Cascading links.
- Export overloads that write to Stream objects added to PdfExporter, VisioExporter and Visio2013Exporter.
- ClientScriptMode="JQuery" now supports version 3 of JQuery.
Installer for the latest version can be downloaded here, or from the
clients area on our site:
https://www.mindfusion.eu/NetDiagramTrial.zipUpdated assemblies and script files are also available as
MindFusion.Diagramming.WebForms NuGet package.
Enjoy!