Skip to content
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

Add functionality behind annotations eraser #115

Closed
hannahker opened this issue Sep 20, 2023 · 0 comments
Closed

Add functionality behind annotations eraser #115

hannahker opened this issue Sep 20, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@hannahker
Copy link
Collaborator

hannahker commented Sep 20, 2023

See plotly/plotly.js#6679

Based on an updated understanding of how the erase mode works, the ui will need to be updated. The eraser actually only works when you have a selected shape. We should re-implement this by:

  • removing the eraser from the toolbar (as it's not a "mode" per-se)
  • adding a callback attached to the "delete" keybind which will delete an active shape.

The syntax of the clientside callback also needs to be updated slightly as the version referenced in the PR doesn't work.

This is the (hacky) workaround:

    """
    function deleteShape(_, graph_id) {
        var gd = document.getElementsByClassName('js-plotly-plot')[0];
        Plotly.deleteActiveShape(gd)
        return dash_clientside.no_update
    }
    """,
@hannahker hannahker added the enhancement New feature or request label Sep 20, 2023
@hannahker hannahker self-assigned this Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant