简体   繁体   中英

d3.js, applying transitions to data?

So I'm using d3 with a force layout and want to move a fixed node over time. Using a transition() would make sense here, but I can't seem to figure out how to apply a transition to the node's bound data, rather than attributes of the svg object. Is this possible, or should I just write a simple setTimeout() with an interpolation?

here is the tutorial

or you can try

window.setTimeout(someFunction, 2000);

in function you can get nodes of your graph and change the xy in that and just update it.

another example

if you need example then feel free for it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM