1

I've quite a few different combinations for the dimensions (in the property bar) but can't seem to get the Sankey diagram to work after I copy it, shown here: https://developers.google.com/datastudio/visualization/

What is the format of the data it needs? Also, how many nodes can it support - can I do 4 nodes?

TheMaster
  • 45,448
  • 6
  • 62
  • 85
credizian
  • 469
  • 5
  • 20

2 Answers2

3

First of all i love Sankey Diagrams but never get enough opportunities to use them.

The chart library is based on d3.org sankey diagrams

The data format it needs as per that page is:

{
"nodes":[
    {"node":0,"name":"node0"},
    {"node":1,"name":"node1"},
    {"node":2,"name":"node2"},
    {"node":3,"name":"node3"},
    {"node":4,"name":"node4"}
],
"links":[
    {"source":0,"target":2,"value":2},
    {"source":1,"target":2,"value":2},
    {"source":1,"target":3,"value":2},
    {"source":0,"target":4,"value":2},
    {"source":2,"target":3,"value":2},
    {"source":2,"target":4,"value":2},
    {"source":3,"target":4,"value":4}
]}

As for how many nodes it can support, I'm not sure there is an upper limit, though I suspect you would quicker be constrained by the page space/browser memory limit.

Lucas Taulealea
  • 355
  • 2
  • 10
1

The community visualization Sankey diagram requires 2 dimensions and 1 metric. It does not currently support more dimensions (you can't have 4 columns of dimensions, for example).

One caveat though: the 2 dimensions cannot share a value (see the README).

Yulan Lin
  • 154
  • 2
  • is it possible to clone the specific sankey subdirectory, put it on google cloud storage, and then use it as a community visualisation chart? I tried that but it's not working. May i ask what am I getting wrong? – Julliard Jun 02 '20 at 16:05
  • Hi @Yulan, I'm currently using the community visualization - Sankey diagram and was wondering if there's a way to also put in the metric label along with the node labels? – ORStudent Nov 13 '20 at 19:11