Skip to content

boxplot points hover events #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
joshua-gould opened this issue Jan 19, 2016 · 16 comments · Fixed by #2094
Closed

boxplot points hover events #192

joshua-gould opened this issue Jan 19, 2016 · 16 comments · Fixed by #2094
Labels
feature something new

Comments

@joshua-gould
Copy link
Contributor

It would be nice if hover events were fired for points rendered when drawing a boxplot

@mdtusz
Copy link
Contributor

mdtusz commented Jan 19, 2016

Could you share an example of your code (codepen/jsbin/jsfiddle) where this isn't working for you? A graph div with a box plot will emit a plotly_hover event that you can bind a function to like so:

var graphDiv = document.getElementById('graph-div');

graphDiv.on('plotly_hover', function(data){
  // do something with the emitted data here
});

@joshua-gould
Copy link
Contributor Author

http://codepen.io/anon/pen/mVqQyY

When you hover any of the data points (not the box and whisker itself), I would like to show a tooltip corresponding to the text array.

@mdtusz
Copy link
Contributor

mdtusz commented Jan 19, 2016

@etpinard perhaps can chime in with more details on this.

@etpinard
Copy link
Contributor

@joshua-gould that'd be a nice feature. Thanks for the suggestion!

I suspect making this happen will be tricky. But it could be a good opportunity to split up graph_interact.js

@joshua-gould
Copy link
Contributor Author

One workaround is to create an additional scatter trace.

@etpinard etpinard added the feature something new label Jul 8, 2016
@ifll
Copy link

ifll commented Feb 14, 2017

Recently I was seeking for the exact same feature.

If it were possible to have it the close future that would be very nice.

@MikeRixWolfe
Copy link

+1 for separate hover tool tips for the data points, my users would like to be able to hover the points for labels associated with the numerical data being plotted

@gfairchild
Copy link

I'd love this feature.

@etpinard
Copy link
Contributor

etpinard commented Oct 13, 2017

Select/lasso dragmodes are coming to box traces soon; it might be good to tackle this ticket too.

To get this done, I'm thinking about adding a hoveron attribute to box trace (similar to scatter and scatterternary):

// (default) this would correspond to the current behavior
hoveron: 'boxes' 

// display hover labels for the visible boxpoints only
// this would support multiple labels per box and per traces 
// for hovermode 'x' and 'y'
hoveron: 'points' 

// both modes at the same time,
// where 'boxes' would take precedence when cursor is over a box
hoveron: 'points+boxes'

any thoughts on this @alexcjohnson @cldougl @chriddyp ?

@chriddyp
Copy link
Member

👍 love this! points+boxes will be great, hoveron seems right to me.
I suppose that hovermode options could apply here as well (think horizontally stacked box plots with points)

@alexcjohnson
Copy link
Collaborator

Sounds great! hoveron and its values sound perfect. Only question is about:

'boxes' would take precedence when cursor is over a box

I'd probably have gone the other way, since the box is large and has a permissive hover region, give the points small hover regions (reuse the way scatter does it) but let them take precedence within that region.

@dejanskledar
Copy link

I have difficulties producing the implemented hover effect:
https://codepen.io/anon/pen/BwerzQ

What did I miss? I used the latest 1.32.1 version...

@etpinard
Copy link
Contributor

@dejanskledar #2094 hasn't been released yet.

See changelog here: https://github.com/plotly/plotly.js/releases

@dejanskledar
Copy link

Oh, I misunderstood the 62 commits to master thinking that these commits are already included. Thanks.

@dejanskledar
Copy link

@etpinard Is there any other way to get the latest lib with #2094 included before the official release?

@etpinard
Copy link
Contributor

@dejanskledar please ask questions of the likes on https://community.plot.ly/

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants