circle-pack

D3.js packed circle layout - how to adjust child radius

╄→гoц情女王★ 提交于 2019-12-01 09:26:21
问题 I am currently useing d3's packed cicle layout(this) and have noticed that when a parent only has one child, the radius of the child is the same as the parents. Is it possible to modify this using the the .radius method the layout provides? Ideally if a parent only has one child the child's radius should be 1/2 of the parents. i found a partial solution, which is to add placeholder nodes to the tree, then run the layout, then remove them again. But this isnt exactly what i want, since it

Circle-packing diagram - transition between two set of values

左心房为你撑大大i 提交于 2019-12-01 08:47:57
I have a diagram very similar to circle packing At some point, a user wants to see some different data. Obviously, a different diagram can be displayed immediately, but transition would be much better from perception and cognition point of view. NOTE: The hierarchical structure remains the same, there is no new or deleted nodes, just underlying values that determine circle size change. What would be the good way to implement such smooth transition between two circle pack graphs of the same structure but different values? (Of course, during transition, that lets say lasts 10 sec, there is no

Circle-packing diagram - transition between two set of values

☆樱花仙子☆ 提交于 2019-12-01 05:51:57
问题 I have a diagram very similar to circle packing At some point, a user wants to see some different data. Obviously, a different diagram can be displayed immediately, but transition would be much better from perception and cognition point of view. NOTE: The hierarchical structure remains the same, there is no new or deleted nodes, just underlying values that determine circle size change. What would be the good way to implement such smooth transition between two circle pack graphs of the same

Updating the data of a pack layout from JSON call and redrawing

我的未来我决定 提交于 2019-12-01 04:11:58
I've been toying around with the circle pack sample . However, I have a lot of trouble trying to update the thing from a new set of JSON data and refreshing it afterwards. My code is just a modified version of the circle pack sample: var diameter = 960, format = d3.format(",d"); var pack = d3.layout.pack() .size([diameter - 4, diameter - 4]) .value(function(d) { return d.size; }); var svg = d3.select("body").append("svg") .attr("width", diameter) .attr("height", diameter) .append("g") .attr("transform", "translate(2,2)"); var node; d3.json("data1.json", function(error, root) { node = svg.datum

Updating a layout.pack in d3.js

不想你离开。 提交于 2019-11-29 01:34:57
问题 I am trying to wrap my mind around d3's pack layout (http://bl.ocks.org/4063530). I have the basic layout working but I would like to update it with new data. i.e. collect new data, bind it to the current layout.pack and update accordingly (update/exit/enter). My attempts are here (http://jsfiddle.net/emepyc/n4xk8/14/): var bPack = function(vis) { var pack = d3.layout.pack() .size([400,400]) .value(function(d) {return d.time}); var node = vis.data([data]) .selectAll("g.node") .data(pack.nodes

D3: Substituting d3.svg.diagonal() with d3.svg.line()

杀马特。学长 韩版系。学妹 提交于 2019-11-28 06:55:28
I have implemented the following graph with the edges rendered with d3.svg.diagonal(). However, when I try substituting the diagonal with d3.svg.line(), it doesn't appear to pull the target and source data. What am I missing? Is there something I don't understand about d3.svg.line? The following is the code I am referring to, followed by the full code: var line = d3.svg.line() .x(function(d) { return d.lx; }) .y(function(d) { return d.ly; }); ... var link= svg.selectAll("path") .data(links) .enter().append("path") .attr("d",d3.svg.diagonal()) .attr("class", ".link") .attr("stroke", "black")

D3: Substituting d3.svg.diagonal() with d3.svg.line()

隐身守侯 提交于 2019-11-27 01:41:01
问题 I have implemented the following graph with the edges rendered with d3.svg.diagonal(). However, when I try substituting the diagonal with d3.svg.line(), it doesn't appear to pull the target and source data. What am I missing? Is there something I don't understand about d3.svg.line? The following is the code I am referring to, followed by the full code: var line = d3.svg.line() .x(function(d) { return d.lx; }) .y(function(d) { return d.ly; }); ... var link= svg.selectAll("path") .data(links)