You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lasso and select-box support for traces other than scatter marker and scatter text #170
For bar chart and histogram selection, I think just touching a bar should include it in a selection. Thoughts @cpsievert based on plotly.js selections in Shiny apps?
@etpinard@jackparmer Since this feature isn't yet available. Is there a way to stylize heatmap cells individually? Like ability to specify the color of a certain cell, or add a marker line for a cell?
@etpinard is this supported for pie charts? Dont see it in the code myself but cant say I fully understand the plotly code base either. Could you please help point me in the right direction on how to get select events working on a pie chart.
@tenshis not currently - it would be great if you could work on this!
I am interested to work on this. How to participate to work on this issue?
@alexcjohnson this seems to be related to adding selection to heatmap which could be little tricky.
If so, how about starting a new issue as a place holder just for that?
Let's keep the discussion here for now. Looking at @jackparmer's comment #170 (comment) the only remaining items are heatmap and line - is that right or is there anything else people would like add selections to? I'm not sure what this would look like for lines so for now I'm just going to talk about heatmaps.
I think what will be needed is:
attributes for selection styling - as far as I can see the only thing that really makes sense would be unselected.opacity. Or perhaps it wouldn't really be an opacity, if we implement this by overlaying a shape that partially masks the heatmap? Then it could be something like unselected.fade and unselected.bgcolor?
figure out what the selectedpoints attribute should look like for heatmap traces - I guess when the heatmap came from all 1D arrays it can just be an array of indices, but when z is a 2D array, the equivalent of an array of point indices would be an array of length-2 arrays, [row, column]? This line from hover (that controls hover and click event data) looks like the behavior to match:
Implement drawing the selection within heatmap/plot or heatmap/style. The two general ways I can imagine doing this are: (1) alter the colors of the image we draw for the heatmap itself, or (2) mask the image element. (1) would be pretty easy to implement, but I don't think it'll do what we need: it would mean redrawing the whole heatmap every time a new element is added to or removed from the selection (heatmap/plot), and it would make blurred edges with zsmooth: fast. (2) will be trickier to implement but can go in heatmap/style and would have crisp edges regardless of zsmooth.
Selecting multiple cells in the heatmap is done by plotting a scatter of the heatmap values along with the heatmap. Thus the lasso tool selects points from the scatter. The points from the scatter are in the center of the heatmap cells, thus the cells of the heatmap will appear to be chosen if the center of the cell is within the lasso
Don't know if this sufficient for what is needed, but this was my workaround for using lasso tool on heatmaps. Would be really nice to have this work without having to plot twice.
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)
Funny thing is that you can force the selection box modebar button on even in pure scatter traces (without markers and text), and it works pretty much perfectly fine. However, it's still spamming errors in the console and the selection is not retained on Plotly.react calls. Other than that I couldn't see any real differences to normal use.
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson
Reacted by Matthias, tribohr, Abram Fleishman, Jonas Van Der Donckt and Petar Pejovic
Activity
etpinard commentedon Jun 16, 2017
cc @dfcreative @chriddyp @jackwluo
jackparmer commentedon Jul 21, 2017
Top ones for crossfilter project:
boxpoints: 'all'done in Box points hover & select #2094zsmotth: falsebricks)jackparmer commentedon Aug 2, 2017
For bar chart and histogram selection, I think just touching a bar should include it in a selection. Thoughts @cpsievert based on plotly.js selections in Shiny apps?
16 remaining items
jackparmer commentedon May 15, 2018
@tenshis Here's a mock for how we were considering
plotly_selectedin a heatmap:Essentially if you lasso the centroid of the cell, the entire cell highlights as "selected."
destradafilm commentedon May 13, 2019
@etpinard @jackparmer Since this feature isn't yet available. Is there a way to stylize heatmap cells individually? Like ability to specify the color of a certain cell, or add a marker line for a cell?
NotInControl commentedon Feb 13, 2020
@etpinard is this supported for pie charts? Dont see it in the code myself but cant say I fully understand the plotly code base either. Could you please help point me in the right direction on how to get select events working on a pie chart.
Thanks
anhtram72 commentedon May 28, 2020
I am interested to work on this. How to participate to work on this issue?
archmoj commentedon Jun 1, 2020
@alexcjohnson this seems to be related to adding selection to
heatmapwhich could be little tricky.If so, how about starting a new issue as a place holder just for that?
alexcjohnson commentedon Jun 1, 2020
Let's keep the discussion here for now. Looking at @jackparmer's comment #170 (comment) the only remaining items are heatmap and line - is that right or is there anything else people would like add selections to? I'm not sure what this would look like for lines so for now I'm just going to talk about heatmaps.
I think what will be needed is:
unselected.opacity. Or perhaps it wouldn't really be an opacity, if we implement this by overlaying a shape that partially masks the heatmap? Then it could be something likeunselected.fadeandunselected.bgcolor?selectedpointsattribute should look like forheatmaptraces - I guess when the heatmap came from all 1D arrays it can just be an array of indices, but whenzis a 2D array, the equivalent of an array of point indices would be an array of length-2 arrays,[row, column]? This line from hover (that controls hover and click event data) looks like the behavior to match:plotly.js/src/traces/heatmap/hover.js
Line 115 in 5b8b1db
heatmap/selectedPointsroutine - the PRs linked in Lasso and select-box support for traces other than scatter marker and scatter text #170 (comment) should give a good idea how to implement this and expose it in the trace module.heatmap/plotorheatmap/style. The two general ways I can imagine doing this are: (1) alter the colors of the image we draw for the heatmap itself, or (2) mask the image element. (1) would be pretty easy to implement, but I don't think it'll do what we need: it would mean redrawing the whole heatmap every time a new element is added to or removed from the selection (heatmap/plot), and it would make blurred edges withzsmooth: fast. (2) will be trickier to implement but can go inheatmap/styleand would have crisp edges regardless ofzsmooth.thomashusebo commentedon Jul 2, 2020
Don't know if this sufficient for what is needed, but this was my workaround for using lasso tool on heatmaps. Would be really nice to have this work without having to plot twice.
jackparmer commentedon Sep 10, 2020
This issue has been tagged with
NEEDS SPON$ORA 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:
Please include the link to this issue when contacting us to discuss.
allow selections with result table
MarcSkovMadsen commentedon Sep 17, 2022
I would also love to have the Box Select option for heat maps so that I could use Plotly as the plotting backend for the below example
NuclearPhoenixx commentedon Mar 2, 2023
Funny thing is that you can force the selection box modebar button on even in pure scatter traces (without markers and text), and it works pretty much perfectly fine. However, it's still spamming errors in the console and the selection is not retained on Plotly.react calls. Other than that I couldn't see any real differences to normal use.
gvwilson commentedon Jun 5, 2024
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson