Issue with select events for Sankey Diagrams.

491 views
Skip to first unread message

Lakshay Akula

unread,
Jun 19, 2015, 7:06:40 PM6/19/15
to google-visua...@googlegroups.com
Hey everyone,

I'm not sure if this is the appropriate place to post this, but I'm having issues with the "select event" and the Sankey Diagram. I want the Sankey diagram to display an alert box when clicked.

Here is the Sankey diagram without a working select functionality - https://jsfiddle.net/lakula/zkpakn9u/3/
Here is a box chart with a working select functionality - https://jsfiddle.net/lakula/nx6my3bc/2/

Can someone help me figure out what's stopping the select functionality from working properly in my Sankey diagram?

Thanks,
Lakshay

Sergey Grabkovsky

unread,
Jun 22, 2015, 10:06:23 AM6/22/15
to google-visua...@googlegroups.com
Hi Lakshay,

You are posting in the right place! The reason that Sankey selection wasn't working for you is that you need to explicitly enable selection on the Sankey chart via the 'sankey.node.interactivity' option. The currently release only supports node interactivity, and the next should support both node and link interactivity. Here is a modified version of your jsfiddle with working selection: https://jsfiddle.net/gcxusavm/

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Lakshay Akula

unread,
Jun 22, 2015, 3:22:44 PM6/22/15
to google-visua...@googlegroups.com
Thank you so much! It works pefectly now.


On Monday, June 22, 2015 at 7:06:23 AM UTC-7, Sergey wrote:
Hi Lakshay,

You are posting in the right place! The reason that Sankey selection wasn't working for you is that you need to explicitly enable selection on the Sankey chart via the 'sankey.node.interactivity' option. The currently release only supports node interactivity, and the next should support both node and link interactivity. Here is a modified version of your jsfiddle with working selection: https://jsfiddle.net/gcxusavm/

On Fri, Jun 19, 2015 at 7:06 PM Lakshay Akula <laksha...@gmail.com> wrote:
Hey everyone,

I'm not sure if this is the appropriate place to post this, but I'm having issues with the "select event" and the Sankey Diagram. I want the Sankey diagram to display an alert box when clicked.

Here is the Sankey diagram without a working select functionality - https://jsfiddle.net/lakula/zkpakn9u/3/
Here is a box chart with a working select functionality - https://jsfiddle.net/lakula/nx6my3bc/2/

Can someone help me figure out what's stopping the select functionality from working properly in my Sankey diagram?

Thanks,
Lakshay

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

Lakshay Akula

unread,
Jun 24, 2015, 2:11:59 AM6/24/15
to google-visua...@googlegroups.com
Hello Sergey,

I'm running into some issues now trying to take advantage of the selection functionality in the Sankey diagrams. I want to retrieve the node which was selected by using getSelection() and then finding the appropriate row and column value in the DataTable. However, I'm only getting null row and column values here. Any help?



On Monday, June 22, 2015 at 7:06:23 AM UTC-7, Sergey wrote:
Hi Lakshay,

You are posting in the right place! The reason that Sankey selection wasn't working for you is that you need to explicitly enable selection on the Sankey chart via the 'sankey.node.interactivity' option. The currently release only supports node interactivity, and the next should support both node and link interactivity. Here is a modified version of your jsfiddle with working selection: https://jsfiddle.net/gcxusavm/

On Fri, Jun 19, 2015 at 7:06 PM Lakshay Akula <laksha...@gmail.com> wrote:
Hey everyone,

I'm not sure if this is the appropriate place to post this, but I'm having issues with the "select event" and the Sankey Diagram. I want the Sankey diagram to display an alert box when clicked.

Here is the Sankey diagram without a working select functionality - https://jsfiddle.net/lakula/zkpakn9u/3/
Here is a box chart with a working select functionality - https://jsfiddle.net/lakula/nx6my3bc/2/

Can someone help me figure out what's stopping the select functionality from working properly in my Sankey diagram?

Thanks,
Lakshay

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.

Sergey Grabkovsky

unread,
Jun 24, 2015, 9:52:24 AM6/24/15
to google-visua...@googlegroups.com
Hi Lakshay,

The node selections for Sankey will not give you either a column or a row reference. That doesn't really make sense for nodes, since there's no canonical cell, row, or column that can be viewed as the reference to the node, because a single node could be referenced multiple times in the DataTable. Instead of this, we give you an object with a 'name' property. This gives you the identifier of the node, so you can find the node yourself. Here's a version of your jsfiddle that takes this into account: https://jsfiddle.net/xdubqzmf/

On Wed, Jun 24, 2015 at 2:12 AM Lakshay Akula <laksha...@gmail.com> wrote:
Hello Sergey,

I'm running into some issues now trying to take advantage of the selection functionality in the Sankey diagrams. I want to retrieve the node which was selected by using getSelection() and then finding the appropriate row and column value in the DataTable. However, I'm only getting null row and column values here. Any help?



On Monday, June 22, 2015 at 7:06:23 AM UTC-7, Sergey wrote:
Hi Lakshay,

You are posting in the right place! The reason that Sankey selection wasn't working for you is that you need to explicitly enable selection on the Sankey chart via the 'sankey.node.interactivity' option. The currently release only supports node interactivity, and the next should support both node and link interactivity. Here is a modified version of your jsfiddle with working selection: https://jsfiddle.net/gcxusavm/

On Fri, Jun 19, 2015 at 7:06 PM Lakshay Akula <laksha...@gmail.com> wrote:
Hey everyone,

I'm not sure if this is the appropriate place to post this, but I'm having issues with the "select event" and the Sankey Diagram. I want the Sankey diagram to display an alert box when clicked.

Here is the Sankey diagram without a working select functionality - https://jsfiddle.net/lakula/zkpakn9u/3/
Here is a box chart with a working select functionality - https://jsfiddle.net/lakula/nx6my3bc/2/

Can someone help me figure out what's stopping the select functionality from working properly in my Sankey diagram?

Thanks,
Lakshay

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

Kirkham Parry

unread,
Nov 10, 2015, 6:55:23 PM11/10/15
to Google Visualization API
This is a great link. Is there a way to have this interactivity (making the other nodes disappear) with the nodes without clicking, but simply hovering over it with a mouse?

Sergey Grabkovsky

unread,
Nov 11, 2015, 4:25:20 PM11/11/15
to Google Visualization API
Yep!

However, this functionality is only available in version 43, which is only available via frozen versions.

Here's a simple example of changing the opacity of all unfocused (something is focused [hovered] and it's not this element) nodes and links: https://jsfiddle.net/xdubqzmf/1/

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.
--
unnamed.gif 
Sergey Grabkovsky | SWE  | gra...@google.com

Claudio Salatino

unread,
Oct 24, 2017, 5:53:05 AM10/24/17
to Google Visualization API
Hi, 

I have this sankey diagram https://jsfiddle.net/xz5raoLc/27/ that I would like to use as a navigation for a blog post. Basically, each time a phrase or a word is clicked, I would like the page to go to different paragraphs/words. Any help? Thank you so much 

Claudio 


On Wednesday, November 11, 2015 at 10:25:20 PM UTC+1, Sergey wrote:
Yep!

However, this functionality is only available in version 43, which is only available via frozen versions.

Here's a simple example of changing the opacity of all unfocused (something is focused [hovered] and it's not this element) nodes and links: https://jsfiddle.net/xdubqzmf/1/

On Tue, Nov 10, 2015 at 6:55 PM Kirkham Parry <kirkha...@gmail.com> wrote:
This is a great link. Is there a way to have this interactivity (making the other nodes disappear) with the nodes without clicking, but simply hovering over it with a mouse?


On Monday, June 22, 2015 at 8:06:23 AM UTC-6, Sergey wrote:
Hi Lakshay,

You are posting in the right place! The reason that Sankey selection wasn't working for you is that you need to explicitly enable selection on the Sankey chart via the 'sankey.node.interactivity' option. The currently release only supports node interactivity, and the next should support both node and link interactivity. Here is a modified version of your jsfiddle with working selection: https://jsfiddle.net/gcxusavm/

On Fri, Jun 19, 2015 at 7:06 PM Lakshay Akula <laksha...@gmail.com> wrote:
Hey everyone,

I'm not sure if this is the appropriate place to post this, but I'm having issues with the "select event" and the Sankey Diagram. I want the Sankey diagram to display an alert box when clicked.

Here is the Sankey diagram without a working select functionality - https://jsfiddle.net/lakula/zkpakn9u/3/
Here is a box chart with a working select functionality - https://jsfiddle.net/lakula/nx6my3bc/2/

Can someone help me figure out what's stopping the select functionality from working properly in my Sankey diagram?

Thanks,
Lakshay

--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages