d3.js

Place pie charts on nodes of force directed layout graph in D3

帅比萌擦擦* 提交于 2020-01-19 12:53:10
问题 I would like to place pie charts on the node of a D3 force directed layout graph using D3.js. This is a common visualization in population genetics, see for example http://mathildasanthropologyblog.files.wordpress.com/2008/06/as3.jpg I've started with a very basic graph plot: <!DOCTYPE html> <html lang="en"> <head> <script type="text/javascript" src="d3/d3.v3.js"></script> </head> <body> <script type="text/javascript"> graph = { "nodes":[{"proportions": [{"group": 1, "value": 1}, {"group": 2,

Place pie charts on nodes of force directed layout graph in D3

我的梦境 提交于 2020-01-19 12:53:05
问题 I would like to place pie charts on the node of a D3 force directed layout graph using D3.js. This is a common visualization in population genetics, see for example http://mathildasanthropologyblog.files.wordpress.com/2008/06/as3.jpg I've started with a very basic graph plot: <!DOCTYPE html> <html lang="en"> <head> <script type="text/javascript" src="d3/d3.v3.js"></script> </head> <body> <script type="text/javascript"> graph = { "nodes":[{"proportions": [{"group": 1, "value": 1}, {"group": 2,

In D3 V4, how to use .ease(“bounce”) propertly?

梦想的初衷 提交于 2020-01-19 03:56:06
问题 Here is my code: <html> <head> <meta charset="UTF-8"> <title>circle</title> </head> <body> <script src="http://d3js.org/d3.v4.min.js"></script> <script> var width = 400; var height = 400; var svg = d3.select("body") .append("svg") .attr("width",width) .attr("height",height); var circle1 = svg.append("circle") .attr("cx", 100) .attr("cy", 100) .attr("r", 45) .style("fill","green"); circle1.transition() .duration(1000) //延迟1000ms .attr("cx", 300); var circle2 = svg.append("circle") .attr("cx",

tooltip using d3-tip not showing

混江龙づ霸主 提交于 2020-01-17 14:04:40
问题 I'm trying to implement a tooltip in svg using Angular, d3 v4, d3-tip. here's the JS logic var data = [{ train: 1 }, { train: 2 }, { train: 3 }, { train: 4 }] const tip = d3Tip() let svg =d3.select('svg') tip .offset([-10, 0]) .html(d => { return ( `<strong>Frequency:</strong> <span style="color:red"> test</span>"` ) }) svg.call(tip) let selectedElms = d3.selectAll('circle') .data(data, function(d) { console.log(this.id) return (d && d.train) || this['id']; }) selectedElms .on('mouseover',

How to render table from JSON array elemnts using d3

谁说我不能喝 提交于 2020-01-17 13:59:08
问题 Folks, I want to render a html table for the following JSON using D3.js The JSON I am using for this proceess is here, http://jsfiddle.net/d9wgnbdd/2 For example, 'office type' has more 'code' and that 'code' having more 'cluster' also the clusters having more branches. I want to show the table as follows, need your help in this @mccannaff. Looking forward Code Office-code Corp-Code Region-Code Cluster-Code CO CRP CBE BN117 C1038 CO CRP CBE BN117 C1039 CO CRP CBE BN117 C1049 CO CRP CBE BN117

How to change the color of all links with determined initial and final d.data.id in a d3.tree tidy code?

本小妞迷上赌 提交于 2020-01-17 10:14:24
问题 So far I have received great helps and answers regarding my previous question on d3.tree code. I have two more questions and hope someone kindly assist me. Assume I have the same flare.csv file as the one in my previous question (with small modifications), that is, A A.A A.A.B A.A.C A.B A.B.C A.C A.C.D A.D A.D.A A.D.B A.D.D A.E A.E.A A.E.B A.F A.H How can I modify the code such that all links between A and B (that is A is the parent and B is the child) become yellow, for instance? Note that I

How to change the color of all links with determined initial and final d.data.id in a d3.tree tidy code?

*爱你&永不变心* 提交于 2020-01-17 10:13:09
问题 So far I have received great helps and answers regarding my previous question on d3.tree code. I have two more questions and hope someone kindly assist me. Assume I have the same flare.csv file as the one in my previous question (with small modifications), that is, A A.A A.A.B A.A.C A.B A.B.C A.C A.C.D A.D A.D.A A.D.B A.D.D A.E A.E.A A.E.B A.F A.H How can I modify the code such that all links between A and B (that is A is the parent and B is the child) become yellow, for instance? Note that I

How to change the color of all links with determined initial and final d.data.id in a d3.tree tidy code?

大憨熊 提交于 2020-01-17 10:13:03
问题 So far I have received great helps and answers regarding my previous question on d3.tree code. I have two more questions and hope someone kindly assist me. Assume I have the same flare.csv file as the one in my previous question (with small modifications), that is, A A.A A.A.B A.A.C A.B A.B.C A.C A.C.D A.D A.D.A A.D.B A.D.D A.E A.E.A A.E.B A.F A.H How can I modify the code such that all links between A and B (that is A is the parent and B is the child) become yellow, for instance? Note that I

d3js - Force-Directed Graph: Delete node that only link to itself

余生颓废 提交于 2020-01-17 10:09:07
问题 I am trying to do the Force-Directed Graph from this example but my data is really big (5000 nodes) so I want to remove some nodes that do not link to any other nodes. However, in my JSON, every node has at least 1 link (that link to itself). This is an example of my data: {"directed": false, "graph": {}, "nodes": [{"id": 0}, {"id": 1}, {"id": 2}, {"id": 3}, {"id": 4}, {"id": 5}, {"id": 6}, {"id": 7}, {"id": 8}, {"id": 9}, {"id": 10}, {"id": 11}, {"id": 12}], "links": [{"source": 0, "target":

vuejs + dagre-d3 tooltip issue

假如想象 提交于 2020-01-17 07:31:12
问题 I am trying to integrate the below graph(dagre-d3) to my vuejs application. http://www.samsarin.com/project/dagre-d3/latest/demo/hover.html I have successfully able to generate the graph inside the vuejs component. But i am not able to achieve the tooltip functionality which is provided in the graph. They are using a library called tipsy, when i run the graph in a plain html it works fine. But when i use inside the vue application its throwing the below error. [Vue warn]: Error in mounted