Search
What's New in this Release

The list below describes recent changes and additions to JsDiagram:

New in version 4.6

Spatial index

Set the enableSpatialIndex property of Diagram to create an index of item positions for faster hit-testing and viewport clipping queries. This should greatly improve user interaction and rendering speed for diagrams containing tens of thousands or more items.

JavaScript  Copy Code

// create 20000 links + nodes in total
for (var i = 0; i < 10000; i++)
{
    var node = diagram.factory.createShapeNode(x, y, size, size);
    node.text = i;
    if (x > diagram.bounds.x)
    {
        diagram.factory.createDiagramLink(
            diagram.nodes[i - 1], diagram.nodes[i]);
    }

    x += dist;
    if (x >= diagram.bounds.right())
    {
        x = diagram.bounds.x;
        y += dist;
    }
}

diagram.enableSpatialIndex = true;

Miscellaneous