The list below describes recent changes and additions to DiagramLite:
New in version 3.2
Foldable containers
Set the Foldable property of ContainerNode to let users fold and unfold containers by clicking up/down arrow in their caption bars. The Folded property lets you fold or unfold containers programmatically. When folded, the child nodes of a container are hidden and its height is set to the caption bar height. The control raises ContainerFolded and ContainerUnfolded events when users fold or unfold a container interactively.
Improved arrowhead rendering
- Arrowheads are rendered as a single path when possible and several arrowhead Shape definitions have been changed to implement mitered joints when HeadStrokeThickness is set to a bigger value.
- The point where end segments connect to arrowheads can be specified via the LinkSegmentInset property of the Shape class. Shape definitions from the ArrowHeads class set it to suitable default value. This allows using transparent or semi-transparent brushes without seeing the link line drawn behind arrowheads.
License keys
There is no separate trial build of the control assemblies anymore. Instead, set the
LicenseKey property to disable the component's evaluation mode and stop displaying trial messages. If your application contains more than one
Diagram instance or other controls by MindFusion, you could call MindFusion.Licensing.LicenseManager.AddLicense(key) to specify the key once instead of setting it per each control. License key strings are listed on the Keys & Downloads page at MindFusion's customer portal.
Miscellaneous
- Set the Brush property of LinkLabel to fill the background of link labels.
- The Anchoring.Keep option is now honored by OrthogonalRouter.
- The ChangeUnit method sets a new MeasureUnit and scales the coordinates of diagram items to keep them the same size.
- Fixed node spacing in bottom-to-top TreeLayout.
- The updateLinks parameter of SetBounds lets you specify whether link positions should change when setting node's new position.
New in version 3.1
Tree map layout
Tree maps represent hierarchies by nesting child nodes within their parents, where the areas of leaf nodes are proportional to their
Weight values. Unlike other layout algorithms,
TreeMapLayout expects hierarchies to be defined via grouping or containment (see
AttachTo method and
ContainerNode class), and will ignore any links in the diagram. The diagram area covered by the topmost nodes in a hierarchy is specified via the
LayoutArea property. By default, the layout tries to keep the ratio of node sides as close as possible to one. However this could make it hard to distinguish separate levels of the hierarchy. To alleviate that, set
Squarify to
false, and child nodes will be arranged either as a row or a column inside their parent node, alternating directions for each level. The drawback is that when
Weight ratios differ greatly or nodes contain many children, some nodes could end up with very narrow rectangles.
Decision flowchart layout
DecisionLayout arranges simple flowcharts consisting of decision boxes with up to three outgoing links per node and activity boxes with a single outgoing link per node. The nodes are arranged in columns and rows, whose distance depends on the
HorizontalPadding and
VerticalPadding property values. When links share the same row or column, they are placed at a distance specified via
LinkPadding. The layout arranges nodes recursively starting from
StartNode. If
StartNode is not specified, the algorithm selects the root of the deepest branch of the graph's spanning tree as start node.
Miscellaneous
- Layout algorithms now automatically resize diagram's Bounds if it's not large enough to fit the arranged content. To revert to old behavior and keep fixed Bounds size, set GrowToFit to false.
- LinkLabels are now copied by DiagramLink copy constructor and clipboard methods.
- ContainerNode now displays a caption bar when its Shape is set to Rectangle or RoundRect. The caption bar height is controlled via the CaptionHeight property.
New in version 3.0.1
Zoom control
The
ZoomControl class lets users change interactively the current zoom level and scroll position of a
Diagram. To set it up, add a
ZoomControl to the page, place it anywhere over the target diagram, and set the control's
Target property to that diagram. Set the
ZoomStep and
ScrollStep properties to specify the amount added to view's zoom level or scroll position by
ZoomControl's buttons. You can customize the control's appearance by setting properties such as
Fill,
Stroke,
CornerRadius and
TickPosition.
Miscellaneous
- Enable the AllowRenamePages property of TabbedDiagramView to let users rename a DiagramPage interactively by clicking its tab.
- Several new stock shapes added: RightTriangle, Decagon, Trapezoid, Star4Pointed, Star5Pointed, Star6Pointed, Star7Pointed, Star16Pointed, Star24Pointed, Star32Pointed, Donut, Plaque.
- New RoundAndSquare and RoundAndSquare2 handle styles can be set as the HandlesStyle of nodes.
- The projection of a node on the scales of Ruler control now shows the boundaries of the rotated node shape. To ignore rotation as in older versions, set ProjectRotatedBounds to false.
- The ScrollZoneSize property specifies the size of the region near viewport borders that triggers auto-scrolling.
- Set the HandlesStyle property of nodes to Custom to implement custom appearance and hit-testing for adjustment handles. The control raises DrawAdjustmentHandles and HitTestAdjustmentHandles events for such nodes.
- The SetSelfLoopShape event is raised when a link becomes a self-loop, giving you a chance to set a custom shape for the link.
New in version 3.0
Node effects
Two visual effects, represented by GlassEffect and AeroEffect classes, can be applied to nodes. To apply an effect, create an instance of the respective class, set up its properties, then add the instance to the Effects collection of a node (or to Diagram.NodeEffects collection to apply it to all nodes). Effects can be added, removed or modified at any time and this will immediately reflect on the diagram. Effects of different types can be applied simultaneously. It is also possible to apply more than one effect of the same type. For more information about this new feature, check Node Effects.
Improved styling support
The Brush, Stroke* and Font* dependency properties no longer contain initial local values and will inherit style values without having to clear the local values first. The diagram now exposes a style property for each built-in node type, which allows creating global styles for nodes directly in the diagram's markup code in the Xaml page. The properties are called ShapeNodeStyle, TableNodeStyle, etc. and are of the Silverlight's standard Style type.
Themes and Theme Editor
A theme in DiagramLite is a set of styles, each associated with specific item type. When the theme is applied to a diagram, the styles registered in the theme affect all objects of their associated type. Themes are represented by the Theme class and can be assigned to Diagram objects through their Theme property. Styles are associated with item types within the theme through the RegisterStyle method. The package now includes a Theme Editor tool that provides simple visual environment for theme creation and modification. There are also several predefined themes available in the Themes subfolder of the installation root folder. For more information about this new feature, check Styles and Themes.
Diagram documents and tabbed views
The DiagramDocument class represents a collection of diagram pages or sheets, represented by DiagramPage objects. DiagramPage is derived from Diagram and only adds a Title property, so any current code that processes Diagram objects will work with DiagramPage objects too. New pages can be added to the document and existing pages can be removed and reordered via the Pages collection. The diagram document provides higher level of events for the pages contained inside it. The document supports the notion of an active page.
The new TabbedDiagramView can be used to display DiagramDocument objects. The view displays tabs for the individual pages in the document. The active page can be changed interactively by activating its associated tab. New pages can be added and removed to/from the document through buttons in the tab tray and the pages can be rearranged by dragging their associated tabs with the mouse.
One-way graph Layout
The OneWayLayout class ensures that links enter into nodes from the same general direction and exit them from the opposite side. If the graph contains cycles, some links bend around the nodes to keep the enter/exit direction consistent. The algorithm aims to minimize the number of such links.
Multiple labels per link
The LinkLabel class allows multiple captions to be displayed for a single DiagramLink object. Link labels provide a set of properties allowing full customization of their display and positioning. Labels can also be arranged automatically to avoid overlapping nodes and other labels by setting LinkLabel.AutoArrange to true.
Layers
Items can now be assigned to layers, and layers can be hidden, locked or moved up/down in the Z order as a group. Set the LayerIndex property of items to associate them with layers in the Diagram.Layers collection. The Layer objects provide Visible, Locked and ZIndex properties, which will affect all items in the respective layer. Layers also expose a Title property shown in the LayerListView control. Newly drawn items are added to the layer specified via Diagram.ActiveLayer. For additional information about layers, refer to Layers.
Layer list control
The LayerListView control provides user interface for working with Layer objects. The control displays a list of all layers in a specified Diagram with a title and an overview area, and also allows editing of layer's Title, Visible and Locked properties and choosing the Diagram's currently active layer. New layers can be added to the Diagram by clicking the '+' button. The selected layer can be deleted by clicking the '-' button.
Magnifier
The new magnifier tool allows users to interactively zoom in (or out) portions of the diagram by holding down a modifier key or pressing a mouse button. The magnifier's zoom factor and size can be customized. Additional information can be found in the corresponding section of Scrolling and Zooming.
Miscellaneous
- the value of DiagramItem.ZIndex property is no longer required to be unique and smaller than the number of items;
- diagram item collection types now implement the generic IList<> interface;
- Behavior can be set to SelectOnly to let users select existing items, but not modify them or draw new ones.
API changes
- the MindFusion.Diagramming.Silverlight namespace renamed to MindFusion.Diagramming;
- default brush properties such as ShapeBrush are no longer used; now the default brush for items can be set by adding a Brush setter to style properties such as ShapeNodeStyle;
- LinkStyle enum renamed to LinkShape;
- DiagramLink.Style property renamed to Shape;
- ZLevelUp, ZLevelDown, ZTop and ZBottom methods now require a boolean argument specifying whether items are allowed to change layers;
- ZIndex no longer corresponds to the position of items within Diagram.Items collection. Items however still contains the items sorted by Z order, as defined by item's ZIndex and LayerIndex;
- Event handler delegates have been removed; events are now defined as generic EventHandler specialized via EventArgs type. For example the type of NodeCreated is now EventHandler<NodeEventArgs>;