Quantcast
Channel: Northwoods Software - Latest topics
Viewing all articles
Browse latest Browse all 7423

Adding a diagram to a diagram

$
0
0

@Tany wrote:

Hi,
I have two diagram that are saved as JSON in a DB and loaded into the diagram DIV.
Diagram A :


And Diagram B:

When i load each diagram from JSON, independently, they are located as shown in pics, as saved in DB (i bind “loc”).
When i load diagram A and then diagram B, diagram B is located on the right side of the document, un seen. I have to zoom out in order to see both diagrams :
.
To be more accurate, when i load diagram A, i load it from JSON as is. And then, when i add diagram B, i load only the nodeDataArray and add node by node by calling model.addNodeData(nodeData).
Every added node is added only if not already exist.
In the current example all nodes of diagram B DO NOT exist in diagram A, so all of them are added.
But, i want the nodes of diagram B to be located exactly where they saved.
I want that the two merged diagrams span like this :
.
I’ve tried to “modify” “loc” values before adding the node data, by adding or subtracting viewport bounds, but without success.
How can I load any diagram ONTO an existing diagram and maintain its original nodes location ?
Regards,
Tany

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7423

Trending Articles