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


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Version 3.2.1 beta
Mar 29th, 2018 at 8:18am
Print Post  
Version 3.2.1 of the JavaScript Diagram library contains the following new features -

Path finding
The PathFinder class provides methods that help you find paths and cycles in a graph:

~ findShortestPath(from, to) finds the shortest path between two DiagramNode objects;
~ findLongestPath(from, to) finds the longest path between the specified DiagramNode objects;
~ findCycle(participant) detects whether the specified DiagramNode participates in a cycle;
~ findAllPaths(from, to) finds all paths that exist between two DiagramNode objects;
~ findAllCycles() finds all cycles in the underlying diagram;

Path objects returned by these methods contain nodes, links and items arrays containing sequences of elements in the path. New PathFinder sample page included in distribution demonstrates path finding and animations over the found paths.

Embedded hyperlinks
Nodes and Text components with style text enabled can now contain <a> tags to create hyperlinks. When a link is clicked, the control raises hyperlinkClicked event to let you implement navigation:

Code
Select All
// node is a ShapeNode instance
node.setText("test <a='http://mindfusion.eu'>link</a> test");
node.setEnableStyledText(true);

//...

// attach an event listener to the hyperlinkClicked event
diagram.addEventListener(Events.hyperlinkClicked, onHyperlinkClicked);

function onHyperlinkClicked(sender, args)
{
    window.open(args.getHyperlink());
}  



If anyone is interested in trying the beta version, please download this archive containing updated script and sample files:
https://mindfusion.eu/_beta/jsdiag321.zip

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