MindFusion.Diagramming for JavaScript Programmer's Guide
What's New in this Release

The list below describes recent changes and additions to JsDiagram:

New in version 2.8

Fluent API

Builder objects with property setters and shortcut methods for font and brush creation add support for fluent programming style. Static With and instance init methods in DiagramItem, Style and Layout -derived classes return a builder instance that can be used to set up respective new or existing objects:

JavaScript  Copy Code

diagram.addItem(
    ShapeNode.With()
        .brush("lightGray")
        .font("Arial", 4)
        .enableStyledText(true)
        .text("Task <i>1</i>")
        .tooltip("This is the task")
        .create());

diagram.getFactory()
    .createShapeNode(20, 20, 20, 20).init()
        .brush("lightGray", "white", 20)
        .font("Arial", 4)
        .enableStyledText(true)
        .text("Task <i>2</i>")
        .tooltip("This is the second task");

diagram.arrange(
    TreeLayout.With()
        .levelDistance(20)
        .nodeDistance(20)
        .linkType(TreeLayoutLinkType.Cascading3)
        .create());

DiagramLink improvements

Miscellaneous