sankey-diagram

Sankey diagram in javascript

旧城冷巷雨未停 提交于 2019-12-31 10:42:36
问题 I want to draw a Sankey diagram using Javascript. Can anyone provide some direction regarding the algorithms or libraries that are available for this? 回答1: This is a basic Sankey diagram using raphaeljs function Sankey(x0, y0, height, losses) { var initialcolor = Raphael.getColor(); var start = x0 + 200; var level = y0 + height; var heightunit = height / 100; var remaining = 100 * heightunit; function drawloss(start, level, loss) { var thecolor = Raphael.getColor(); paper.path("M" + (start -

Sankey diagram in javascript

落爺英雄遲暮 提交于 2019-12-31 10:42:20
问题 I want to draw a Sankey diagram using Javascript. Can anyone provide some direction regarding the algorithms or libraries that are available for this? 回答1: This is a basic Sankey diagram using raphaeljs function Sankey(x0, y0, height, losses) { var initialcolor = Raphael.getColor(); var start = x0 + 200; var level = y0 + height; var heightunit = height / 100; var remaining = 100 * heightunit; function drawloss(start, level, loss) { var thecolor = Raphael.getColor(); paper.path("M" + (start -

Tiny plot output from sankeyNetwork (NetworkD3) in Firefox

ぐ巨炮叔叔 提交于 2019-12-29 07:01:48
问题 As per object, I get a very small plot in Firefox when using sankeyNetwork() from networkd3 in shiny but not in Chrome or RStudio. I have not included any CSS or JS in the script - the code below produces this result for me. Is there any CSS property I have missed? I am using R 3.4.1, shiny 1.1.0, networkD3 0.4 and Firefox 52.9.0. Firefox: Chrome: library(shiny) library(magrittr) library(shinydashboard) library(networkD3) labels = as.character(1:9) ui <- tagList( dashboardPage(

d3.js Sankey diagram: rectangles fill color

对着背影说爱祢 提交于 2019-12-29 04:24:31
问题 So I am playing around with the d3.js Sankey diagram. In this example (pictured above) color is defined using var color = d3.scale.category20(); For each node there is a rectangle, and that rectangle is filled by altering the style: .style("fill", function(d) { return d.color = color(d.name.replace(/ .*/, "")); }) I'm looking for suggestions on using custom colors. If I wanted to use only say 6 colors, but have the node rectangle colors chosen based on a value in the .json file. For example,

Highlight all connected paths from start to end in Sankey graph using R

烈酒焚心 提交于 2019-12-28 05:54:21
问题 I want to highlight the whole path when i click on the node to know the whole story of specific node and here's an example- http://bl.ocks.org/git-ashish/8959771 . Please check this link and you will find the function that highlight the path in javscript, but take care please , this function doesn't do what i want, it highlight links related to the clicked node and the links related to the target nodes. what i want is to highlight all links related to the clicked node. d3 Sankey - Highlight

Get automatically nodes and links from table for sankey diagram

微笑、不失礼 提交于 2019-12-24 19:33:40
问题 For plotting a sankey diagram nodes and links are required. To get the nodes and links from a data frame one could use for example a count function from the package plyr and use it for each node to count the links between the neighbours but is there another elegant way? example target, aim is to get nodes and links: param1 | param2 | param3 | a | b | d | w | c | d | a | b | d | z | c | e | #nodes: nodes = data.frame("name" = c( a, #node 0 w, #node 1 z, #node 2 b, #node 3 c, #node 4 d, #node 5

Thin gray lines as links plotting sankeyNetwork in R

拜拜、爱过 提交于 2019-12-24 18:59:11
问题 Disclaimer: I'm an R newbie, so I may be overlooking something really obvious here... I am currently working on a sankeyNetwork diagram using R, and I am facing a problem that almost seems to be a bug, but I'm completely clueless... I've googled extensively, and haven't been able to find anybody else reporting the same... The problem is that in my code I currently have 7 nodes, and 5 links. When I plot the diagram, everything works fine: Plot 1, everything working fine This is the code for

Riverplot package in R - output plot covered in gridlines or outlines

南笙酒味 提交于 2019-12-23 07:38:21
问题 I've made a Sankey diagram in R Riverplot (v0.5), the output looks OK small in RStudio, but when exported or zoomed in it the colours have dark outlines or gridlines. I think it may be because the outlines of the shapes are not matching the transparency I want to use for the fill? I possibly need to find a way to get rid of outlines altogether (rather than make them semi-transparent), as I think they're also the reason why flows with a value of zero still show up as thin lines. my code is

Sankey diagrams in Python

女生的网名这么多〃 提交于 2019-12-23 07:08:52
问题 Is there a Python library for generating Sankey diagrams? I've seen this list of Sankey diagram applications and libraries, but none of them is in Python. 回答1: Apparently matplotlib 1.1 can now do this. Code and sample output is here. Below is a screenshot demonstrating what it can do. 回答2: I did a Google search on "Python graph visualization" and found some stuff. There are several libraries that have "spring" behavior where the software balances out a graph and makes it pretty; they do much

Sankey diagrams in Python

蓝咒 提交于 2019-12-23 07:08:08
问题 Is there a Python library for generating Sankey diagrams? I've seen this list of Sankey diagram applications and libraries, but none of them is in Python. 回答1: Apparently matplotlib 1.1 can now do this. Code and sample output is here. Below is a screenshot demonstrating what it can do. 回答2: I did a Google search on "Python graph visualization" and found some stuff. There are several libraries that have "spring" behavior where the software balances out a graph and makes it pretty; they do much