Shripad Ashtekar
Shripad Ashtekar

Reputation: 201

d3 Increase radius of a particular circular node

I am new to d3.

Following is the link in which i want to increase the radius of the center node.

http://jsfiddle.net/k2NL5/81/

var node = svg.selectAll(".node")
    .data(graph.nodes)
    .enter().append("circle")
    .attr("class", "node")
    .attr("r", 8)
    .style("fill", function (d) {
    return color(d.owner);
})


for(var counter in graph.nodes);
d3.select(node[0][counter]).attr("r",10);

EDIT: Now it has become dynamic. Thanks for the help.

Upvotes: 0

Views: 823

Answers (2)

Shailendra Sharma
Shailendra Sharma

Reputation: 6992

you can also vary radius dynamicly by json values like in your case

.attr("r", function(d){ return (d.application_name == 'paragon')?20:10; })

here the fiddle http://jsfiddle.net/k2NL5/82/

Upvotes: 1

Andi AR
Andi AR

Reputation: 2908

Try this

d3.select(node[0][8]).attr("r",10);

JsFiddle: http://jsfiddle.net/k2NL5/80/

Upvotes: 2

Related Questions