我的圈子没有正确地提取他们的半径数据,我觉得我错过了一些明显的东西。
这是我的数据:
var links = [
{source: "Clinton St & Washington Blvd", target: "Dearborn St & Monroe St", trips: 124},
{source: "Clinton St & Washington Blvd", target: "State St & Kinzie St", trips: 132},
{source: "Clinton St & Washington Blvd", target: "Franklin St & Chicago Ave", trips: 136},
{source: "Clinton St & Washington Blvd", target: "Michigan Ave & Washington St", trips: 137},
{source: "Clinton St & Washington Blvd", target: "LaSalle St & Illinois St", trips: 191},
{source: "Clinton St & Washington Blvd", target: "Michigan Ave & Lake St", trips: 231}
];
这是圈子进入的地方:
var circle = svg.append("g").selectAll("circle")
.data(force.nodes())
.enter().append("circle")
.attr("r", function(d) { return d.trips; })
//.attr("r", 10)
.call(force.drag);
如果我将“r”静态设置为10,则一切都正确显示。如果我尝试拉半径的“trip”值,我得到1px * 1px。任何提示?
谢谢, 乳木果