Plotly.js: Hover over lines in parallel coordinate chart

Created on 14 Sep 2018  Â·  13Comments  Â·  Source: plotly/plotly.js

Parallel coordinate charts are useful when we have to filter out data across multiple dimensions and play with the constraints interactively. It would be nice to have a hover feature over the lines which would display their respective IDs or labels so to identify which row or column it is.

Currently, I am not able to hover over or extract out the data filtered data from the chart which is the goal of a parallel coordinate chart.

feature ♥ NEEDS SPON$OR

Most helpful comment

+1 this would be a great feature!

How's the progress on this?

All 13 comments

Great idea. We currently do emit plotly_hover and plotly_unhover events that point to individual items, but we don't show hover labels, nor is there a way to access the set of selected items. These would be great to add.

I'd like to work on that. How can I add that (maybe on my fork)? Can someone guide me a bit through the code?

Absolutely! Here are the PR guidelines: https://github.com/plotly/plotly.js/blob/master/.github/PULL_REQUEST_TEMPLATE.md

Lets discuss this as two separate features (and two separate PRs), one for hover and another for filtered data.


Re: hover - here's where the events are emitted:

https://github.com/plotly/plotly.js/blob/ed39d82a9aa809f1de06f0050572a6d55fb524f8/src/traces/parcoords/plot.js#L57-L63

You'd just need to plumb in Fx.loneHover and Fx.loneUnhover before the event emissions. A good model for that may be gl3d:

https://github.com/plotly/plotly.js/blob/ed39d82a9aa809f1de06f0050572a6d55fb524f8/src/plots/gl3d/scene.js#L117-L133

https://github.com/plotly/plotly.js/blob/ed39d82a9aa809f1de06f0050572a6d55fb524f8/src/plots/gl3d/scene.js#L165


Re: extracting the filtered data: This one is tougher, as parcoords manages all of that on the GPU. I'm not sure what the best way to get back to js will be... have the shaders write selection data back into a buffer/texture as a bitmask perhaps, then convert that to an array of indices in js?

Then there's the question of where to put the resulting selection. We can certainly emit plotly_selecting and plotly_selected events once we have this data, but it would be great if it were available as part of the state, not just in events. Most other trace types define a selectedpoints attribute, but we can't (just) do that with parcoords because the selection is defined by the dimension filters. That said, it would be great for crossfiltering purposes if we did have a way to specify a selection independent of the dimension filters (like in the example @jonmmease made for parcats https://github.com/plotly/plotly.js/pull/2963#issuecomment-420769904). Perhaps a (writable) selectedpoints attribute as an input that acts as an additional filter beyond the dimension selections, then a (read-only) fullTrace._finalSelectedpoints array giving the resulting selection? We should hash out this API before anyone starts work on this part.

Thanks for the pointers. I was working with plotly python version, and thought I could do it from the python wrapper. I am new to javascript. Let me go through some of the basics regarding events and play around with the code a little more. I'll try to add in the hover label atleast. I welcome any suggestions or references to start with events handling in JS.

+1 this would be a great feature!

How's the progress on this?

Any progress on this feature?

I'd love to see this. That would be a real simplification for outlier detection and removal.

any update on this? much needed feature! Thanks for working on this...

I would love to have this feature if anyone is working on it. Any updates on the status?
The lack of this feature is forcing me to find another plotting library at the moment.
Thank you for any progress.

I love the sliding filter on the y-axes but same as @aquan9, I'm a little stuck without being able to see info about which data points I'm actually selecting. Would love to use this feature when possible :)

+1

This issue has been tagged with NEEDS SPON$OR

A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

Sponsorship range: $10k-$15k

What Sponsorship includes:

  • Completion of this feature to the Sponsor's satisfaction, in a manner coherent with the rest of the Plotly.js library and API
  • Tests for this feature
  • Long-term support (continued support of this feature in the latest version of Plotly.js)
  • Documentation at plotly.com/javascript
  • Possibility of integrating this feature with Plotly Graphing Libraries (Python, R, F#, Julia, MATLAB, etc)
  • Possibility of integrating this feature with Dash
  • Feature announcement on community.plotly.com with shout out to Sponsor (or can remain anonymous)
  • Gratification of advancing the world's most downloaded, interactive scientific graphing libraries (>50M downloads across supported languages)

Please include the link to this issue when contacting us to discuss.

Sorry for being out of the loop on this one. I haven't gotten around working with JS, so I wouldn't be able to work on this right now.

Was this page helpful?
0 / 5 - 0 ratings