Skip to content

Lasso and select-box support for traces other than scatter marker and scatter text #170

Description

@etpinard

Lasso and select-box were added in #154

Adding support for other trace types should be as easy as adding a selectPoints to the other trace modules.

Activity

  1. self-assigned this
    on Jan 21, 2016
  2. removed their assignment
    on Feb 11, 2016
  3. etpinard commented on Jun 16, 2017

    @etpinard
    ContributorAuthor
  4. added this to the crossfilter milestone on Jul 21, 2017
  5. jackparmer commented on Jul 21, 2017

    @jackparmer
    Contributor

    Top ones for crossfilter project:

  6. modified the milestones: Dash, crossfilter on Jul 21, 2017
  7. modified the milestones: Dash, crossfilter on Jul 24, 2017
  8. jackparmer commented on Aug 2, 2017

    @jackparmer
    Contributor

    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?

  9. 16 remaining items

  10. jackparmer commented on May 15, 2018

    @jackparmer
    Contributor

    @tenshis Here's a mock for how we were considering plotly_selected in a heatmap:

    image

    Essentially if you lasso the centroid of the cell, the entire cell highlights as "selected."

  11. removed this from the crossfilter milestone on May 8, 2019
  12. destradafilm commented on May 13, 2019

    @destradafilm

    @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?

  13. NotInControl commented on Feb 13, 2020

    @NotInControl

    @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

  14. anhtram72 commented on May 28, 2020

    @anhtram72

    @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?

  15. archmoj commented on Jun 1, 2020

    @archmoj
    Contributor

    @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?

  16. alexcjohnson commented on Jun 1, 2020

    @alexcjohnson
    Collaborator

    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:

    index: trace._after2before ? trace._after2before[ny][nx] : [ny, nx],

    • Implement the selection by making a heatmap/selectedPoints routine - 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.
    • 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.
  17. thomashusebo commented on Jul 2, 2020

    @thomashusebo

    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


    from here

    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.

  18. jackparmer commented on Sep 10, 2020

    @jackparmer
    Contributor

    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.

  19. added a commit that references this issue on Mar 8, 2021
  20. MarcSkovMadsen commented on Sep 17, 2022

    @MarcSkovMadsen

    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

    BI Dashboard with crossfiltering

  21. NuclearPhoenixx commented on Mar 2, 2023

    @NuclearPhoenixx

    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.

  22. gvwilson commented on Jun 5, 2024

    @gvwilson
    Contributor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions