Questions tagged [sankey-diagram]

Sankey diagrams are a kind of flow diagram, in which the width of the arrows is shown proportionally to the flow quantity. They are typically used to visualize energy or material or cost transfers between processes.

752 questions
2
votes
1 answer

What kind of data do you input for a Sankey Diagram in R?

I'm new to R, and attempting to use sample data to create a Sankey Diagram using rCharts. I've run this code and it works as intended. However, when I edit that code with my source, target, and value vectors, R crashes and no diagram is produced.…
Sri Rao
  • 21
  • 3
2
votes
1 answer

Customize googleVis Sankey diagrams in R to add customised tool tip

I managed to plot a sankey diagram as following, col1 contains the ids set.seed(1000) df <- data.frame(col1= sample(c(1:15), 15, replace = F), col2=sample(c("aa", "bb","cc"), 15, replace=TRUE), col3=sample(c('a','b','c','d'), 15, replace=TRUE,…
andy
  • 643
  • 2
  • 12
  • 20
2
votes
0 answers

Strange symbol "" appearing from rChart sankey output in Shiny

Here's a screenshot of the output: The problem seems to be with the $setLib() function. As depending on the directory given, it gives a corresponding string output. Providing the correct directory produces the symbol . For example providing a…
JnrfL
  • 189
  • 2
  • 8
2
votes
0 answers

Bi-directional BihiSankey node position d3

I am working on this example of d3 bi-directional sankey chart. http://bl.ocks.org/Neilos/584b9a5d44d5fe00f779 I have lately realized that the positioning of the childnodes of parent nodes in the last x-cordinate or the nodes at the right edge seems…
Omkar
  • 2,274
  • 6
  • 21
  • 34
2
votes
1 answer

d3.js sankey link color

I am looking for making the link color same as node fill color in d3 sankey charts. I am using following function to get the node color function getNodeColor(d){ console.log(d3.rgb(d.color).darker(2)); return…
Arun
  • 65
  • 1
  • 4
2
votes
1 answer

How to make a d3 sankey link flow out the bottom of the diagram?

With a d3.js sankey diagram, how can I make a link flow out of a node and off the diagram towards either the bottom or top? This necessitates a 90deg turn in the link and for it to not end at a node (or at least not one in the diagram) and…
2
votes
1 answer

Vertical sort of nodes in D3 Sankey diagram

I'm trying to achieve a basic sankey diagram building on top of this example: http://bl.ocks.org/d3noob/c9b90689c1438f57d649 By default they get sorted by value. I want to customize the vertical order of the nodes. Here is an example: In this case…
Jens
  • 121
  • 1
  • 9
2
votes
1 answer

Animate a matplotlib sankey diagram

I am trying to animate a matplotlib Sankey diagram where the magnitude of the flows changes. I have an example partially working, however it keeps adding more Sankey diagrams as indicated by the counter; len(sankey.diagrams). This means it will not…
mjfwest
  • 93
  • 1
  • 8
2
votes
1 answer

How to make nodes in sankey diagram clickable using d3.js library

Code Snippet : We are using d3.js for this. Sankey diagrams is made up of nodes and links. Here the data comes from json file. So how to make all the nodes clickable. Which methods can we use with the rectangles so that we can make the nodes…
2
votes
2 answers

Change Font Size on rCharts Sankey Diagram

I'm using the following code to create a Sankey Diagram using rCharts. I wish to increase the font size of the text printed on the Sankey Diagram. I can't find a manual to show me how to do this. Thoughts? rm(list =…
Reuben Mathew
  • 598
  • 4
  • 22
2
votes
3 answers

Show total values in Sankey Diagram

Is it possible to show a total in sankey diagram? For example, the fiddle bellow show Fruits > Place. I would like to know how many fruits are liked to the places and in places how many fruits are linked. So something like: Mango (3) Apple…
Khrys
  • 2,670
  • 9
  • 49
  • 82
2
votes
0 answers

d3.js Sankey Node with a tall image

I am able to append images to a Node; however I am unable to set the height of the image? Any help would be much appreciated. node.append("image") .attr("xlink:href", function(d) { if (…
Rob
  • 1,226
  • 3
  • 23
  • 41
2
votes
0 answers

Format CSV to JSON with JavaScript

My task: given a set of data in CSV format, display a sankey chart using D3. Given data format: (I'm unable to change this) Uses,Types,Feedback Use1,Type1,Feedback1 Use2,Type1,Feedback1 Use2,Type2,Feedback1 ... Required format for D3 Sankey…
chazsolo
  • 7,873
  • 1
  • 20
  • 44
2
votes
1 answer

d3.js sankey diagram - using multi dime array as nodes

I've been developing an application using Google Chart's Sankey Diagram and I successfully created a Sankey Diagram sample on a web app. But I'm not satisfied with the layout, and I search the internet and came upon d3.js's plugin for Sankey…
2
votes
1 answer

Dynamically change width of d3.js sankey chart

I'm trying to modify the width of a d3 sankey chart, so I can put expanded content (details about a node) into the space created by the resize. So user clicks node, chart shrinks to half it's width, and I can append content into the new…
abenrob
  • 878
  • 10
  • 23