Darby
Darby

Reputation: 789

using d3, redraw the graph based on node click

I am using a d3 force-directed graph that produces a hairball of data. :-)
I think it's either this one: http://bl.ocks.org/1138500 or this one: http://bl.ocks.org/4062045 (I inherited this so not exactly sure but these 2 visualizations are really similar!)

When I click a node, I'd like to zoom in on, or redraw the graph based on just that node. So on click of a node, the other nodes and edges would disappear. How can I do that? I'm using Ruby on Rails and Neo4j, so a cypher query is creating the JSON data that d3 uses.

Will i have to re-query the database via cypher? I hope not. I'm hoping that this can be done in d3.js alone.

Thanks in advance for your ideas. If you have a working example, I'd love to see it!

Upvotes: 2

Views: 1157

Answers (1)

Peter Neubauer
Peter Neubauer

Reputation: 6331

Probably you need to ask on the D3 mailing list.

Upvotes: 0

Related Questions