I want to display the Node’s information just like in the example (http://www.gojs.net/latest/samples/htmlInteraction.html) and i want to display the location of the selected node i.e, x and y position and the width, height of that node too.
How can i do that ? i.e, display the node x, y position and its width, height
One more question : I want to add some new information to some particular node , like, for each node i want to bind a list of comments( just text) . How can i add, manage, and retrieve and display that whenever that node is selected
myDiagram.startTransaction(“move”); var node = myDiagram.selection.first(); node.location = new go.Point(newval, node.location.y); myDiagram.commitTransaction(“move”);
Or:
myDiagram.startTransaction(“move”); var data = myDiagram.selection.first().data; myDiagram.model.setDataProperty(data, “loc”, new go.Point(newval, data.loc.y)); myDiagram.commitTransaction(“move”);
That assumes there is a selected Node, your data property is named “loc” and it is of type Point (not string), and there is a TwoWay Binding on Node.location to “loc”.
OK. By the way, if you are calling moveX repeatedly, say in a loop, you will want to move those calls to start and commit transaction to be outside of the loop.