sankey-diagram

Reactive height for sankeyNetworkOutput from networkD3

梦想的初衷 提交于 2019-12-11 10:59:36
问题 I have a Shiny dashboard that is displaying a sankeyNetwork from the networkD3 package. I'm creating the sankeyNetwork inside of a renderSankeyNetwork function on the server and then calling it on the ui with sankeyNetworkOutput. I'd like to make the height of the created sankeynetwork be dependent on a height value I've created. I tried using renderUI with uiOutput to run the sankeyNetworkOutput on the server, but it doesn't seem to be working. The dashboard works otherwise but there is

Controlling position of subsystems in Sankey-diagram with matplotlib

自闭症网瘾萝莉.ら 提交于 2019-12-11 09:02:56
问题 I have the following question: I would like to add two subfigures to a Sankey diagram, that are not connected to each other. if I draw: import matplotlib.pyplot as plt from matplotlib.sankey import Sankey fig = plt.figure(figsize = (12, 5), frameon=True) ax = fig.add_subplot(1, 1, 1) sankey = Sankey(ax=ax, unit=None, radius=0.15, shoulder = 0, gap = 0.15) sankey.add(flows=[0.2, -0.2], label='A', orientations=[-1, 0]) sankey.add(flows=[0.1, -0.1], label='B', orientations=[1, 0]) diagrams =

Sankey with Matplotlib

风流意气都作罢 提交于 2019-12-11 07:38:46
问题 In this Senkey are two Inputs: K and S, three Outputs: H,F and Sp and the Rest: x The Inputs shall come from the left Side, the Outputs go to the right Side. The Rest shall go to the Top. from matplotlib.sankey import Sankey import matplotlib.pyplot as plt fig = plt.figure(figsize = [10,10]) ax = fig.add_subplot(1,1,1) ax.set(yticklabels=[],xticklabels=[]) ax.text(-10,10, "xxx") Sankey(ax=ax, flows = [ 20400,3000,-19900,-400,-2300,800], labels = ['K', 'S', 'H', 'F', 'Sp', 'x'], orientations =

Sankey Diagram with R library networkD3 does not show colors

帅比萌擦擦* 提交于 2019-12-11 07:14:17
问题 I am using the networkD3 library for R in order to create Sankey networks. While this works pretty well for me, I have now encountered an issue with assigning the attributes "NoteID" and/or "NoteGroup" to group and allocate colors as shown in https://christophergandrud.github.io/networkD3/#sankey The following code shows 4 examples of creating a Sankey diagram, only "Sankey4" works as designed, i.e., no colors: library(networkD3) #Unique list of nodes my_nodes = structure(list(name = c(

How to tune horizontal node position in d3 sankey.js?

你离开我真会死。 提交于 2019-12-11 06:10:01
问题 I am trying to plot some flow diagrams using d3's sankey.js . I am stuck at arranging nodes x positions in the diagrams. t2_a should be in same column as t2_b as they represent quantity from same time period. However by default this is placed at the end which gives wrong interpretation. I can arrange manually for small number of nodes but its really difficult when number of nodes increase. Any help or suggestion would be highly appreciated. 回答1: In sankey.js comment the moveSinksRight call in

Highlight all connected paths from start to end of a sankey diagram using networkD3

感情迁移 提交于 2019-12-11 05:31:34
问题 I would like to produce a Sankey-diagram using the networkD3 package in R that has the functionality as described in this question, and the "highlight_node_links" function in the answer: d3 Sankey - Highlight all connected paths from start to end I'm a beginner with both R and Javascript and my problem is that I cannot make the above javascript function work with my R code. I have checked Highlight all connected paths from start to end in Sankey graph using R question too, but unfortunately I

Google Charts Sankey - Node text style

老子叫甜甜 提交于 2019-12-11 04:24:28
问题 Is there a way to change the color of the target node text with style role in Google's Sankey diagram? Currently I have data setup like this: [Source, Target, Label, Style] [A,B,"Test Label", "#ffffff"] I am able to change the color of the node and links but not the text. d3 is not an option for me at this point and the whole idea is to animate the nodes to appear one after the another at its place - hence trying to change the style and re-draw the diagram. Growing the table is not working

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

不问归期 提交于 2019-12-11 04:04:17
问题 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 clickable. <script> var margin = {top: 1, right: 1, bottom: 6, left: 1}, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; var formatNumber = d3.format(",.0f"), //decimal places format = function(d) { return formatNumber

Show total values in Sankey Diagram

余生长醉 提交于 2019-12-11 03:12:07
问题 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 (2) Pineapple (1) All three are linked to Place A, so Place A should be: (7) Place A (1 more is because of Grape) http://jsfiddle.net/Khrys/5c2urqbx/ UPDATE: Looks like the v42 added weight by default. 回答1: Take a look at this jsfiddle code data1 = [ [