sunburst-diagram

How to properly rotate text labels in a D3 sunburst diagram

北慕城南 提交于 2019-12-01 21:35:05
In the following D3 sunburst : http://jsfiddle.net/maxl/eabFC/ .attr("transform", function(d) { return "rotate(" + (d.x + d.dx / 2 - Math.PI / 2) / Math.PI * 180 + ")"; }); The labels in the left quadrants are upside down, I would like to perform a rotation on them so that the text reads from left to right. The transformation should only apply to the arcs from approximately 100 degree to 270 degree. Following this example: http://www.jasondavies.com/coffee-wheel/ I've edited your jsfiddle here: http://tributary.io/inlet/4127332/ You are going to have to deal with your long labels and the above

Labels on bilevel D3 partition / sunburst layout

时光毁灭记忆、已成空白 提交于 2019-12-01 13:19:27
I am trying to add labels to the bilevel sunburst / partition shown here - http://bl.ocks.org/mbostock/5944371 : I have added labels to the first 2 levels and rotated them correctly. But I cant now add the new level's labels during a transition. To get started I have put ... text = text.data(partition.nodes(root).slice(1), function(d) { return d.key; }); straight after the ... path = path.data(partition.nodes(root).slice(1), function(d) { return d.key; }); line but it throws the following error ... Uncaught TypeError: Cannot read property '__data__' of undefined What am I doing wrong? I used

Labels on bilevel D3 partition / sunburst layout

最后都变了- 提交于 2019-12-01 11:18:32
问题 I am trying to add labels to the bilevel sunburst / partition shown here - http://bl.ocks.org/mbostock/5944371: I have added labels to the first 2 levels and rotated them correctly. But I cant now add the new level's labels during a transition. To get started I have put ... text = text.data(partition.nodes(root).slice(1), function(d) { return d.key; }); straight after the ... path = path.data(partition.nodes(root).slice(1), function(d) { return d.key; }); line but it throws the following

Transitioning sunburst in D3.js

风流意气都作罢 提交于 2019-11-29 00:35:17
I'm doing a data-driven visualization with d3. I have a structure similar to the sunburst (but with a single layer, sort of a pie chart with a hole in the middle). By clicking the arrow on keyboard the data visualized changes and so it does the sunburst. In particular the innerRadius changes depending on a particular property of the data and some elements are added, deleted and updated. I cannot manage to transition correctly from one to another sunburst. The transition is almost ok apart from the update of existing element. For example suppose I have common elements in the two following

d3 is not defined - ReferenceError

会有一股神秘感。 提交于 2019-11-28 20:27:47
I am trying to use a "fancy graph" found at http://bl.ocks.org/kerryrodden/7090426 : The way I've done it was to download the code and simply edit the CSV file to match my data. Then I simply open the .html-file in Firefox to see the interactive graph. However, using it at a another computer I get the following errors: ReferenceError: d3 is not defined sequences.js:25 ReferenceError: d3 is not defined index.html:28 As I have almost no knowledge of d3 or javascript I am a bit lost. Can any of you give me a hint to what is causing the errors and how I should correct the code? I've done a single

Transitioning sunburst in D3.js

荒凉一梦 提交于 2019-11-27 15:23:03
问题 I'm doing a data-driven visualization with d3. I have a structure similar to the sunburst (but with a single layer, sort of a pie chart with a hole in the middle). By clicking the arrow on keyboard the data visualized changes and so it does the sunburst. In particular the innerRadius changes depending on a particular property of the data and some elements are added, deleted and updated. I cannot manage to transition correctly from one to another sunburst. The transition is almost ok apart

How to make a sunburst plot in R or Python?

你说的曾经没有我的故事 提交于 2019-11-27 06:37:35
So far I have been unable to find an R library that can create a sunburst plot like those by John Stasko . Anyone knows how to accomplish that in R or Python? Python version of sunburst diagram using matplotlib bars in polar projection: import numpy as np import matplotlib.pyplot as plt def sunburst(nodes, total=np.pi * 2, offset=0, level=0, ax=None): ax = ax or plt.subplot(111, projection='polar') if level == 0 and len(nodes) == 1: label, value, subnodes = nodes[0] ax.bar([0], [0.5], [np.pi * 2]) ax.text(0, 0, label, ha='center', va='center') sunburst(subnodes, total=value, level=level + 1,

d3 is not defined - ReferenceError

送分小仙女□ 提交于 2019-11-27 01:34:26
问题 I am trying to use a "fancy graph" found at http://bl.ocks.org/kerryrodden/7090426: The way I've done it was to download the code and simply edit the CSV file to match my data. Then I simply open the .html-file in Firefox to see the interactive graph. However, using it at a another computer I get the following errors: ReferenceError: d3 is not defined sequences.js:25 ReferenceError: d3 is not defined index.html:28 As I have almost no knowledge of d3 or javascript I am a bit lost. Can any of

d3 - sunburst - transition given updated data — trying to animate, not snap

百般思念 提交于 2019-11-26 22:03:14
问题 I am working on a sunburst viz based off of Mike Bostock's Zoomable Sunburst example. I want to be able to change the underlying data using a whole new JSON (which has the same structure but different 'size' values), and have the sunburst animate a transition to reflect the updated data. If I change the data of the path elements using .data(), and then attempt to update in the following fashion: path.data(partition.nodes(transformed_json)) .transition() .duration(750) .attrTween("d", arcTween

How to make a sunburst plot in R or Python?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 12:54:43
问题 So far I have been unable to find an R library that can create a sunburst plot like those by John Stasko. Anyone knows how to accomplish that in R or Python? 回答1: Python version of sunburst diagram using matplotlib bars in polar projection: import numpy as np import matplotlib.pyplot as plt def sunburst(nodes, total=np.pi * 2, offset=0, level=0, ax=None): ax = ax or plt.subplot(111, projection='polar') if level == 0 and len(nodes) == 1: label, value, subnodes = nodes[0] ax.bar([0], [0.5], [np