Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Version 4.8 beta (Read 521 times)
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Version 4.8 beta
Sep 17th, 2025 at 7:30am
Print Post  
Version 4.8 of MindFusion JavaScript Diagram contains the following new features and improvements -

Paged containers
PagedContainerNode is a ContainerNode subclass that organizes its child nodes into a collection of pages, represented by ContainerPage objects. This allows for the creation of more organized diagrams where nodes can be grouped into logical views within a single container. Only the nodes belonging to the currently active page, specified by currentPage property, are rendered and participate in user interactions.

Navigation between pages is handled by scroll arrows in the caption bar, allowing users to cycle through the pages sequentially. For faster access, users can also double-click the container's caption to open an in-place combo box listing available page titles, enabling direct navigation to any page. The node's text value is automatically set to the title of newly activated ContainerPage.

Pattern router
New PatternRouter class routes links by applying patterns of segment and turn sequences and accepting them when resulting paths do not cross nodes. A path is accepted if its final segment ends in target point and is orthogonal to respective side of target node. If there are several possible paths, the router selects the shortest one. The minimumDistance property specifies minimum allowed distance of link segments from nodes. The preferredDistance property specifies distance of first or last link bend from associated node. PatternRouter includes several predefined patterns designed to create consistent-looking paths, and allows creation of custom patterns. Custom patterns can be defined as sequence of RouteStep objects specifying whether the path advances by relative or absolute distance, or changes direction:

Code
Select All
var rightZigzag = new RoutePattern();
rightZigzag.steps.push(
    new RouteStep(RouteStepKind.AdvanceRelative, 0.5));
rightZigzag.steps.push(
    new RouteStep(RouteStepKind.TurnRight));
rightZigzag.steps.push(
    new RouteStep(RouteStepKind.AdvanceRelative, 1));
rightZigzag.steps.push(
    new RouteStep(RouteStepKind.TurnLeft));
rightZigzag.steps.push(
    new RouteStep(RouteStepKind.AdvanceRelative, 0.5));
router.patterns.push(rightZigzag);

// this can be defined in shorter form using a pattern string
// var rightZigzag = new RoutePattern(
//     "ADR0.5 TRR ADR1 TRL ADR0.5");
 


Composite router
The CompositeRouter class lets you chain link routers (objects implementing the Router interface) so that a link passes through the sequence until it gets routed successfully. Diagram's default router is now set to a CompositeRouter instance containing a PatternRouter and Router sequence. This applies the several standard pattern paths when possible, and otherwise routes links using a simple cost-minimizing router.

API changes
Default Diagram.linkRouter changed from Router to CompositeRouter instance.

If anyone is interested in trying the beta version, please download this archive containing updated script files:
http://mindfusion.dev/_beta/JsDiagram48.zip

Any comments, questions and general feedback are welcome.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint