I have a data table with columns ox, oy, dx, and dy. For demonstration purposes, you can assume all columns are random with formula: Random Normal(0, 10). The real problem is a network with a list of coordinates.
I would like to draw lines between (ox, oy) and (dx, dy) and I can do this with either Graph Builder or Graph Box (example below). However, with every interaction, JMP redraws the lines which makes my visualization very slow (I have >10 000 rows in the data table). I tested this by adding a small random part to the origin and destination coordinates in the graph script and as soon as there's any interaction (e.g., using the Grabber tool and dragging the canvas, adjusting axes, resizing the graph, resizing the window), the lines do change. Is there a way to stop JMP updating the graph and rerunning the scripts?
I couldn't find a way in Graph Builder (I'd prefer to use this platform) or Graph Box. I found the
<< Graph Updating( Per Mouse Up );
message but it only has two options; there's no "don't update" option as far as I can tell. Also, I think that message doesn't work with Graph Box anyway.
Here's a minimal Graph Box example that can draw lines but the lines get updated with every interaction:
New Window( "Example",
Graph Box(
Frame Size( 300, 300 ),
Pen Color( "Blue" );
o_x = :ox << Get Values();
o_y = :oy << Get Values();
d_x = :dx << Get Values();
d_y = :dy << Get Values();
For( i=1, i<=N Items(o_x), i++,
origin = Eval List({o_x[i]*Random Normal( 1, 0.1 ), o_y[i]*Random Normal( 1, 0.1 )});
destination = Eval List({d_x[i]*Random Normal( 1, 0.1 ), d_y[i]*Random Normal( 1, 0.1 )});
Line(origin, destination);
);
);
);
Reminder, I only added the Random Normal in that Graph Box script just to see if the lines are being recalculated. The real problem has fixed coordinates.
Bonus question: is there a way to add lines after the graph box has been constructed? I couldn't find it in the examples. I theorized that maybe they won't be updated with every mouse interaction but couldn't test it.
What we see of the real world is not the unvarnished real world but a model of the real world, constructed so it is useful for dealing with the real world. —Richard Dawkins