sunburst-diagram

D3 zoomable sunburst not zooming (with data from R)

偶尔善良 提交于 2020-01-07 04:41:27
问题 I'm trying to adapt some code so I can plot data in a sunburst (using D3) chart with data coming from R as a dataframe. I've got most of it working ok except the zooming part, when i click (almost) nothing happens. On mouseOver I've got a portion of circle with a greater radius than the one for the sunburst to help emphasizing the data I'm hovering. This explains the arcHighlight variable. Also one can notice it is not constructed using my scales a and b . I modifed the original code to use

How to create legend for D3 Sequence Sunburst?

限于喜欢 提交于 2020-01-06 15:08:11
问题 I'm modifying the original D3 Sequence Sunburst file to better suit my needs. The original colors variable is a hard-coded object. This clearly cannot be the best method. I'm using the flare.json example, which is larger, harder to read, and still much smaller than the json file I will be user after testing. I'd like to randomly generate colors, apply them to each datum in the createvisualization function, but I'm new to D3, and do not know how to 1) fetch names (everything but the leaves)

D3.js Zoomable Sunburst not Zooming

陌路散爱 提交于 2019-12-31 05:18:46
问题 I have a static 3 level Sunburst diagram - http://colinwhite.net/Sunburst/ My data is being nested with this function http://colinwhite.net/Sunburst/js/treeRemapper.js My approach is based on this example - http://bl.ocks.org/mbostock/4348373 For some reason my zoom and tweening is not working - var width = 960, height = 700, radius = Math.min(width, height) / 2, color = d3.scale.category20c(); var x = d3.scale.linear().range([0, 2 * Math.PI]), y = d3.scale.sqrt().range([0, radius]); var svg

Appending “size” element to last json child element for a sunburst diagram

北城余情 提交于 2019-12-24 12:12:33
问题 I have a working python script that takes my csv columns data and converts it to a json file to be read by my d3 sunburst visualization. Problem is that there is no "size" element at the final child element which is needed to populate the sunburst diagram correctly. Below is the script I have that reads the csv to a json the way I need it. I've tried modifying the script with an if else loop to find where there is no child element (the last element) and then appending on that element the

Selecting arc/element

巧了我就是萌 提交于 2019-12-24 09:26:59
问题 In the sunburst, how can I make code select a root arc, just after all arcs was generated? For example, in the code: var first_arc = "" .json("../data/flare.json", function(json) { var path = vis.data([json]).selectAll("path") .data(partition.nodes) .enter().append("path") .attr("display", function(d) { return d.depth ? null : "none"; }) .attr("d", arc) .attr("t_name", function(d) {return d.name}) .style("fill-rule", "evenodd") .on("click", function(d)... it would be passed as "d" to the

How to hide outer ring in zoomable sunburst

不打扰是莪最后的温柔 提交于 2019-12-21 20:03:07
问题 I wanted to hide the outer ring in Sunburst, and I wanted to show it when the user drills down the sunburst. So that I can clearly show the data in outer ring clearly.... Thanks in advance Here is my code var width = 700, height = width, radius = width / 2, x = d3.scale.linear().range([0, 2 * Math.PI]), y = d3.scale.pow().exponent(1.3).domain([0, 1]).range([0, radius]), padding = 5, duration = 1000; color = d3.scale.category20c(); var div = d3.select("#vis"); div.select("svg").remove(); div

Improving D3 Sequence Sunburst Example

天大地大妈咪最大 提交于 2019-12-21 12:25:38
问题 This D3 example served as my starting point: http://bl.ocks.org/kerryrodden/7090426 I wanted to change data that feeds the diagram, and I made following new example : http://jsfiddle.net/ZGVK3/ One can notice at least two problems: Legend is wrong. This is because it still contains 'hardcoded' names from original example. All nodes are colored black. This is because the color scheme is also 'hardcoded' only for node names from original example. How to improve the original example (or my

How to format data for plotly sunburst diagram

拈花ヽ惹草 提交于 2019-12-18 18:28:37
问题 I'm trying to make an sunburst diagram using Plotly via R. I'm struggling with the data model required for the hierarchy, both in terms of conceptualizing how it works, and seeing if there are any easy ways to transform a regular dataframe, with columns representing different hierarchical levels, into the format needed. I've looked at examples for plotly sunburst charts in R, e.g., here, and seen the reference page but don't totally get the model for data formatting. # Create some fake data -

Looking for a way to display labels on sunburst chart (could not find a working example)

假如想象 提交于 2019-12-12 17:03:51
问题 Thanks to someone's help (Brandon), I've been able to add tooltips to the sunburst charts. I am still looking for a way to display the label of a path on the sunburst chart (and then have the dual mode tooltip + text). The example that I'd like to improve is provided on jsfiddle.net/trakkasure/UPqX5/ I am looking for the code to add to the following code section: path = svg.data([getData()]).selectAll("path") .data(partition.nodes) .enter().append("svg:path") .attr("d", arc) .style("fill",

broken legend and tooltip in zoomable sunburst chart (D3.js)

这一生的挚爱 提交于 2019-12-11 16:03:38
问题 I have a zoomable sunburst chart with the following issues: Legend is displaying vertically instead of horizontal. I thought that float:left on class legend would do the trick but labels display on new line instead. Allow users to disable categories in the legend to recalculate the sunburst chart. Tooltip is not showing up. What in the world am I missing? I want to append the grand total in the middle of the doughnut which dynamically changes upon zoom transitions. How does one go about that?