Regarding Automation of Canvas

We are planning to Automate Canvas for our functionality based on the co-ordinates of nodes and menus. I just want assurances that for mind map if i redraw same diagram again and again then co-ordianates will be same for the nodes and menus.

If you have any other idea then lets know.

I assume you don’t mean that you are drawing the same diagram each time manually, by drag-and-drop, since clearly users cannot reliably position nodes by hand unless grid snapping is turned on and the grid cell size is really big.

All of the predefined Layouts but one are deterministic – the same Nodes and Links in the same order with the same layout properties produce the same results. The only exception is ForceDirectedLayout, which normally uses Math.random() to “bounce” nodes away from each other when they are on top of each other. In version 1.5 one can substitute your own random number generator so that the results are deterministic again.

Everything I have talked about so far is about dimensions and positions in document coordinates. The user can easily scroll/pan and zoom to cause the apparent size and position in viewport coordinates to change without having changed any nodes or links.

I assume you have searched this forum to find more information about automation. In particular, you’ll want to use the Robot class in extensions/Robot.js. It’s demonstrated by the extensions/Robot.html sample.