0

I looked at the gallery on the D3 page, but couldn't find an (for me) obvious one: Say, I have two dozens (or more) of subjects (elements), they are all more or less directly connected. Now, one thing is to display these elements and connections. This one here is the closest to it I've seen.

But another thing would be to bring the element that the user clicks on in the middle of the screen and highlight the connections this element has.

Does anyone can give me a hint for what I am looking for? Does it exit? Can it easily be produced? Thanks a lot!

luftikus143
  • 1,285
  • 3
  • 27
  • 52
  • Have you seen [this question](http://stackoverflow.com/questions/8739072/highlight-selected-node-its-links-and-its-children-in-a-d3-force-directed-grap)? – Lars Kotthoff Mar 26 '14 at 09:29
  • No. Interesting, and have thought about this type of graphic too. But it's less "network" as the other graphical type. Thanks! – luftikus143 Mar 26 '14 at 09:49
  • 1
    @luftikus143 As for the bringing the clicked node to the center of the screen, I have kept this [FIDDLE](http://jsfiddle.net/aRAb9/) around...you might find it useful as well. Any node you click is moved to the center. – FernOfTheAndes Mar 26 '14 at 21:23
  • @FernOfTheAndes: Thanks. Looks interesting, although a bit "sudden" when it gets centered. – luftikus143 Apr 02 '14 at 08:31
  • Hmmm... Still looking around for a working "node gets centered" example. This one [link](http://bl.ocks.org/robschmuecker/7880033) is "centering" nicely, but is hierarchical. And this one [link](http://projects.flowingdata.com/tut/interactive_network_demo/) would be a nice example of a network, if the nodes would center. I guess one can script the second one so that it behaves like the first...? – luftikus143 Apr 02 '14 at 08:35
  • 1
    @luftikus143 A couple of points here: 1) the "suddenness" can be dealt with using a `transition()`. I updated the [FIDDLE above](http://jsfiddle.net/aRAb9/2/) with such transition for you to check. 2) It should be possible to apply the technique to the force layout since it is operating on the computed `x` and `y` coords, which is present in both hierarchical and force layouts. – FernOfTheAndes Apr 02 '14 at 11:00

0 Answers0