google / google-visualization-issues

288 stars 35 forks source link

Feature Request : Ability to more directly specify the data structure for Sankey diagrams #1668

Open orwant opened 9 years ago

orwant commented 9 years ago
What would you like to see us add to this API?
*********************************************************

The data table format this chart uses is currently restricted to 'pairs' of data nodes
only, I would like to see that opened up to allow multiple nodes allowed per data row.

For example; Currently the data format is as follows; 

['A','B',Count],
['B','C',Count]

and this will result in a table with the following calculated structure; 

[A]-[B]-[C]

I would like to be able to specify a more 'direct' structure rather than the 'relational'
structure used above, I want to be able to specify each column directly and to have
the ability to control the flow myself instead of the chart working it out for me.
I would especially like to be able to allow 'circular' flows that the current chart
does not permit;

Eg. 

['A',['B',Count],['C',Count],['D',Count], ...],
['A',['B',Count],['E',Count],['F',Count], ...],
['A',['B',Count],['B',Count],['C',Count], ...],

Which will result in a table with the structure (directly as I specify, 'not calculated')
per row. Eg.

[A]-[B]-[C]-[D]
[A]-[B]-[E]-[F]
[A]-[B]-[B]-[C]

I hope this makes sense.

*********************************************************
What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)?
*********************************************************
Sankey Chart.

*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by combustioncat on 2014-07-15 04:21:35

orwant commented 9 years ago
Hi,

1.If so, what should the type be in 'addColumn'?
2.And do I need to add other columns to display all?
        var data2 = new google.visualization.DataTable();
          data2.addColumn('string', 'From');
          data2.addColumn('string', 'To');

Thanks.

Original issue reported on code.google.com by ntfgroup318 on 2014-10-23 05:08:43

orwant commented 9 years ago
Seconded. This is already obviously a capability in Google Analytics' flow diagrams,
so the use case is there.

Original issue reported on code.google.com by reischd on 2014-11-18 18:23:29