Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Arrange doesn't work (Read 1048 times)
Gagandeep Singh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Dec 1st, 2022
Arrange doesn't work
Dec 1st, 2022 at 5:44pm
Print Post  
Hello everyone,

I am new to MindFusion, so I have diagram when I am trying to change the layout it flashes and doesn't do anything.

This is the code:

HTML:
<div>
        <canvas id="DiagramArea_" height="800"></canvas>
</div>
<button id="changeShapeToRadial">
</button>

JS:
window.onload = function () {
var diagramView = MindFusion.Diagramming.DiagramView.create(document.getElementById("DiagramArea_"
));
    diagram = diagramView.diagram;

    diagram.loadFromXml(
        'Test/MindFusion',
        function () { console.log("Diagram loaded successfully") },
        function () { alert("error") }
    );
}

$('#changeShapeToRadial').click(function () {
    
    var layout = new MindFusion.Graphs.RadialTreeLayout();
    layout.direction = MindFusion.Graphs.LayoutDirection.TopToBottom;
    layout.levelDistance = 20;
    diagram.arrange(layout);

})
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3223
Joined: Oct 19th, 2005
Re: Arrange doesn't work
Reply #1 - Dec 2nd, 2022 at 9:05am
Print Post  
Hi,

Does the browser console show any errors?

This class was added in very last release - please check if you are using latest version of the scripts (print the Diagram.version property value). Also make sure your diagram contains a tree structure.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Gagandeep Singh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Dec 1st, 2022
Re: Arrange doesn't work
Reply #2 - Mar 15th, 2023 at 9:46pm
Print Post  
Thanks it works, was using old version
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint