Discussing with naught101 we thought about hiding the nodes for a while.

$(.nodes).hide();
run the physics
$(.nodes).hide();

Could be a quick win.

The animation should maybe stop after a while too?

Comments

naught101’s picture

I think that's a possibility.

I wonder if it'd be worth measureing the largest distance between frames/iterations, and using that as a threshold for animation? eg. iterated without animation, until largest distance change is <10px, then animate, then stop physics after largest distance change is <2px.

Perhaps the thresholds could be configurable? then you could set the upper and lower threshold equal, to prevent animation at all..

clemens.tolboom’s picture

Distance is no the right variable as for say two nodes never stop animating.

We can use the speed of all nodes as a threshold.
Or the sum of all forces.

So this issue to also give some data indicator
- total kinetic energy
- total potential energy
- max speed
- max force
?

naught101’s picture

of course, max force is best, as it is already calculated anyway...

clemens.tolboom’s picture

Component: Code » jquery-graphapi
clemens.tolboom’s picture

Component: jquery-graphapi » graph_phyz

The animation should stop one moment in time. For this to happen I need to rewrite the engine to implement ease-in/out functions.

See also #1477658: Disable animation by default.

marcoka’s picture

all current graphs will be calculated on load, meaning the graph is looking a bit different all the time. i think thats caused by the algorithm. i am not so familiar with graph theory. but would it somehow possible to save the order a user does manually? i mean one can drag and drop the nodes around but the positions do not get saved. i am not sure if this is even possible, so just brainstorming.

clemens.tolboom’s picture

This could be possible if and when #1143686: Render a static graph lands.

clemens.tolboom’s picture

Project: Graph API » Graph Phyz
Version: 7.x-1.x-dev »
Component: graph_phyz » Code