sankey-diagram

R - Riverplot package uses - Sankey diagram

[亡魂溺海] 提交于 2019-12-11 01:55:55
问题 I try to draw a sankey chart using riverplot package by January. However my cases is quite complex and I haven't found way to fix my chart so I post this questions, hope this help either find some answer to my questions or way to improve the packages. My charts as below. As you can see my chart in the 1st image have the node's status overlap each others and not readable. Is it possible to display the nodes name on the side of the chart, and each nodes name will next to the lane that it stand

How to place node title to the left or right of the node in d3 Sankey graph?

不想你离开。 提交于 2019-12-11 00:27:44
问题 Here is the example I'm referring to: http://bl.ocks.org/d3noob/c9b90689c1438f57d649 The second level nodes have their title to their right. How can I place those to the left of the nodes? Please help. 回答1: This is how you make text to the nodes. node.append("text") .attr("x", -6) .attr("y", function(d) { return d.dy / 2; }) .attr("dy", ".35em") .attr("text-anchor", "end") .attr("transform", null) .text(function(d) { return d.name; }) .filter(function(d) { return d.x < width / 2; }) .attr("x"

Incorrect output sankey diagram when using shiny

那年仲夏 提交于 2019-12-10 23:38:25
问题 When I create a sankey diagram in a regular R session the output looks ok. The tooltip shows an arrow between the connections: require(rCharts) require(rjson) links <- matrix(unlist( rjson::fromJSON( file = "http://bost.ocks.org/mike/sankey/energy.json" )$links ),ncol = 3, byrow = TRUE) nodes <- unlist( rjson::fromJSON( file = "http://bost.ocks.org/mike/sankey/energy.json" )$nodes ) links <- data.frame(links) colnames(links) <- c("source", "target", "value") links$source <- sapply(links

How to color two links coming out of the same node (or going to the same node) with different colors using gvisSankey?

∥☆過路亽.° 提交于 2019-12-10 17:29:54
问题 I am creating a Sankey diagram using googleVis in R. I want to to color links of nodes that "advance" in one color, links of nodes that "regress" in another, and links of nodes that "stay the same" in a third color. For example: A1 -> B3 means moving up, A1 -> B0 means moving down, and A1 -> B1 means staying the same I looked at this post How to change node and link colors in R googleVis sankey chart but my case is a bit different in that two links coming out of the same node (when using

Weighted sankey / alluvial diagram for visualizing discrete and continuous panel data?

旧城冷巷雨未停 提交于 2019-12-09 13:00:00
问题 Questions I'm trying to visualize panel data on individuals that includes both a discrete or categorical choice and a continuous choice in each time period. One common example of this situation is customers purchasing a product/subscription and then choosing how frequently to use the product/service. I would like to show "flows" across time periods weighted by the continuous variable in each time period -- some sort of cross between a weighted stacked bar chart and a sankey or alluvial

How to make a googleVis multiple Sankey from a data.frame?

早过忘川 提交于 2019-12-09 06:28:18
问题 Aim I am aiming to make a multiple Sankey in R using the googleVis package. The output should look similar to this: Data I've created some dummy data in R: set.seed(1) source <- sample(c("North","South","East","West"),100,replace=T) mid <- sample(c("North ","South ","East ","West "),100,replace=T) destination <- sample(c("North","South","East","West"),100,replace=T) # N.B. It is important to have a space after the second set of destinations to avoid a cycle dummy <- rep(1,100) # For

Displaying the table details from sankey chart in R shiny

不羁的心 提交于 2019-12-08 14:02:11
问题 The script below works on the patients data from bupaR package,and creates a sankey plot listing the relation between a resource from the "employee" column with the activity he is involved in from the "handling" column in the patients data. Besides the plot there is a data table available from DT which gives details of every sankey plot path when clicked. I want a functionality such that when I click on any path, say path connecting "r1" employee and "Registration" handling activity, I want

Python Plotly Sankey Graph not showing up

本小妞迷上赌 提交于 2019-12-08 06:40:37
问题 Was wondering if anyone can help figure out why this Sankey diagram is not working. I am pretty sure I followed the proper syntax and conventions to use the module. Been banging my head on the table because of this. import plotly.offline data_trace = {'domain': {'x': [0, 1], 'y': [0, 1]}, 'height': 772, 'link': {'label': ['EM', 'GWF9C51E', 'GWF9C511', 'GWF9C51E Sensor Set', 'GWF9C511 Sensor Set'], 'source': [0, 1, 3, 1, 4, 2, 0, 2], 'target': [1, 3, 1, 0, 2, 0, 2, 4], 'value': [40, 76, 29, 86

Sankey diagram for Discrete State Sequences in R using networkd3

荒凉一梦 提交于 2019-12-08 05:29:59
问题 I am trying to create an interactive Sankey diagram in R using the networkD3 package as described at http://christophergandrud.github.io/networkD3/#sankey. My data is in the format of Discrete State Sequences(DSS). 1 row represents 1 event sequence. NAs represent that the sequence has ended. Recreating a sample of the data in R: x1 <- c('06002100', '06002001', '06001304', '06002100') x2 <- c('06002100', '06002001', 'NA', 'NA') x3 <- c('06001304', '06002100', '06002001', 'NA') test <- as.data

sankey diagram with rCharts into shiny application. Color issue

喜欢而已 提交于 2019-12-08 02:58:24
问题 I am using rCharts to create a Sankey plot library(networkD3) library(rCharts) source1 = c('Proizvodnja okroglega lesa', 'Uvoz okroglega lesa', 'Poraba okroglega lesa', 'Poraba okroglega lesa', 'Zage','Zage','Zage', 'Zagan les','Uvoz zaganega lesa','Zagan les','Stanje','Stanje') target1=c('Poraba okroglega lesa','Poraba okroglega lesa', 'Izvoz okroglega lesa', 'Zage', 'Celuloza in plosce', 'Energetska raba','Zagan les', 'Lesni ostanki','Stanje','Stanje', 'Poraba zaganega lesa v Sloveniji',