Hi,
I made a simple diagram with data :
const modelData = [
{
"key": "Step 0",
"status": "stop",
"color": "lightblue",
"name": "1"
},
{
"key": "Step 1",
"status": "stop",
"color": "orange",
"name": "2"
},
{
"key": "Step 2",
"status": "stop",
"color": "lightgreen",
"name": "3"
}
]
const modelLink = [
{
"from": "Step 0",
"to": "Step 1"
},
{
"from": "Step 1",
"to": "Step 2"
},
]
I receive new data from time to time and I want to refresh my diagram. In real life, I don’t know what is changed, I just know that some node properties may change (status, color, etc.). Links does not change.
On the event “new data arrived”, I make a transaction :
myDiagram.startTransaction("Change modelData");
myDiagram.model.nodeDataArray = newModelData;
myDiagram.commitTransaction("Change modelData");
When I do this, all my diagram is redrawn with an expand effect.
There is no modification when I tried the transcation with ;
myDiagram.startTransaction("Change modelData");
myDiagram.model.modelData = new go.Model(newModelData);
myDiagram.commitTransaction("Change modelData");
How do I refresh my diagram without redrawing all ?
Thank you
Jeleb