javascript - How does the following code get away with not defining initial x and y coordinates for nodes? -



javascript - How does the following code get away with not defining initial x and y coordinates for nodes? -

drawing attending wonderful d3 illustration here - http://www.d3noob.org/2013/03/d3js-force-directed-graph-example-basic.html, how x , y coordinates specified in forcefulness d.nodes.x , d.nodes.y, yet these never specified in first instance?

an explanation of x , y coordinates within on tick fn "mean" useful - x , y coordinates nodes should move on duration of forcefulness (once force.start() activated)? force.draggable activated these coordinates become coordinates nodes should gravitate towards?

thanks in advance help.

the reply on d3noob page: initial node location arbitrarily determined d3.js when associate them links, i.e.

links.foreach(function(link) { link.source = nodes[link.source] || (nodes[link.source] = {name: link.source}); link.target = nodes[link.target] || (nodes[link.target] = {name: link.target}); link.value = +link.value; });

i'm not sure rest of question though. did mean tick function?

i think way: @ each tick, x , y positions of links (and/or nodes ... not sure) change, need re-draw paths , circles according new x , y. how re-draw things depend on tick function.

javascript d3.js

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -