sunburst-diagram

Export or Download d3.js sunburst / collapsible tree charts as pdf file

不羁岁月 提交于 2019-12-06 14:12:31
I need to download my d3.js collapsible tree chart and sunburst chart as PDF file . I tried using jspdf.plugin.svgToPdf plugin but it doesnt work. Could someone guide me in downloading the charts as pdf ? My source code for collapsible tree (function () { var out$ = typeof exports != 'undefined' && exports || this; var margin = { top : 20, right : 120, bottom : 20, left : 120 }, width = 960 - margin.right - margin.left, height = 800 - margin.top - margin.bottom; var i = 0, duration = 750, root; var tree = d3.layout.tree() .size([height, width]); var diagonal = d3.svg.diagonal() .projection

d3.js Zoomable Sunburst visualization from self-referencing CSV input

主宰稳场 提交于 2019-12-06 13:58:35
问题 I'm a newbie at d3.js and need help to adapt Zoomable Sunburst to make it work with self-referencing CSV data. Sample lines from the input CSV: id,parentId,name,size ROOT,NULL,Root, RE,ROOT,General > Revenue Expenditure, RE11,RE,Main supervision recovery etc., RE11A109K,RE11,Shivjayanti celebrations and lighting,170000 RE11H108,RE11,Electicity for import tax naka,2550000 RE11J,RE11,Maintaince for main building, RE11J101A,RE11J,Electricity expenditure,11475000 RE11J101 C,RE11J,Power lift

Edit the innerRadius of D3 Sunburst visualization

烈酒焚心 提交于 2019-12-06 06:04:47
问题 How can I change the radius of the innermost circle of the Sunburst visualization? See following example: (http://bl.ocks.org/d/910126/ - notice how large is central area; can it be smaller?) Also, is it possible to define different heights for all the layers in the Sunburst? 回答1: Yes , it is possible. Base Example jsfiddle Custom layer height 1 jsfiddle Custom layer height 2 jsfiddle Custom layer height 3 jsfiddle 回答2: I've just compared the examples above so can't claim any great skill

D3 Sequences Sunburst Animation

寵の児 提交于 2019-12-06 05:42:42
I'm new to D3 and am trying to upgrade Kerryrodden's sequences sunburst with zooming and animation: I've added the zooming opportunity with the onclick event and fully redraw the paths: function click(d) { d3.select("#container").selectAll("path").remove(); var nodes = partition.nodes(d) .filter(function(d) { return (d.dx > 0.005); // 0.005 radians = 0.29 degrees }) ; var path = vis.data([d]).selectAll("path") .data(nodes) .enter().append("svg:path") .attr("display", function(d) { return d.depth ? null : "none"; }) .attr("d", arc) .attr("fill-rule", "evenodd") .style("fill", function(d) {

How to format data for plotly sunburst diagram

浪子不回头ぞ 提交于 2019-12-04 20:23:44
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 - say ownership and land use data with acreage df <- data.frame(ownership=c(rep("private", 3), rep(

d3.js Zoomable Sunburst visualization from self-referencing CSV input

∥☆過路亽.° 提交于 2019-12-04 18:45:31
I'm a newbie at d3.js and need help to adapt Zoomable Sunburst to make it work with self-referencing CSV data. Sample lines from the input CSV: id,parentId,name,size ROOT,NULL,Root, RE,ROOT,General > Revenue Expenditure, RE11,RE,Main supervision recovery etc., RE11A109K,RE11,Shivjayanti celebrations and lighting,170000 RE11H108,RE11,Electicity for import tax naka,2550000 RE11J,RE11,Maintaince for main building, RE11J101A,RE11J,Electricity expenditure,11475000 RE11J101 C,RE11J,Power lift,2125000 As you can see, there are variable levels of depth. At some places the data is coming at 3rd level,

Edit the innerRadius of D3 Sunburst visualization

半腔热情 提交于 2019-12-04 10:41:59
How can I change the radius of the innermost circle of the Sunburst visualization? See following example: ( http://bl.ocks.org/d/910126/ - notice how large is central area; can it be smaller?) Also, is it possible to define different heights for all the layers in the Sunburst? Yes , it is possible. Base Example jsfiddle Custom layer height 1 jsfiddle Custom layer height 2 jsfiddle Custom layer height 3 jsfiddle I've just compared the examples above so can't claim any great skill\knowledge here but all the changes are in this section: var arc = d3.svg.arc() .startAngle(function(d) { return d.x;

Infovis JIT: add click listener to edge

风流意气都作罢 提交于 2019-12-04 02:00:16
问题 I'm trying to capture a click event on an edge of a sunburst graph. I've already captured click events on nodes. This is what I'm trying: //..sunburst example code Events: { enable: true, enableForEdges: true, type: 'Native', onClick: function(node, eventInfo, e){ if (!node) return; if(node.nodeFrom){ console.log("target is an edge"); }else{ console.log("target is a node"); } } But this only captures node clicks. What's wrong? Thank you in advance. 回答1: The problem is that 'contains' method,

D3.js Zoomable Sunburst not Zooming

对着背影说爱祢 提交于 2019-12-02 09:07:27
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 = d3.select("body").append("svg") .attr("width", width) .attr("height", height) .append("g") .attr(

How to properly rotate text labels in a D3 sunburst diagram

北战南征 提交于 2019-12-02 00:52:12
问题 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. 回答1: Following this example: http://www.jasondavies.com/coffee-wheel/ I've edited your