scipp / scipp/plopp

Tool `click` method does not work with button=2

Open Beginner friendly
#548 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
12
Forks
6
PR merge metrics
No merged PRs in 30d

Description

As the title mentions, this method currently does not seem to do anything when button=2 is used to simulate middle-clicks. Code-snippet to test:

import scipp as sc
import plopp as pp
data_array = sc.DataArray(data=sc.ones(dims=['y', 'x', 't'], shape=[6,6,10]))

def test(rect):
    print(f"deleting rectangle with ID {rect.id}")

figs = pp.inspector(data_array, mode='rectangle', orientation='vertical')
figs[0].toolbar['inspect']._tool.on_change(test)
figs[0].toolbar['inspect']._tool.start()
figs[0].toolbar['inspect']._tool.click(x=1, y=1, button=1)
figs[0].toolbar['inspect']._tool.click(x=5, y=5, button=1)
figs[0].toolbar['inspect']._tool.click(x=3, y=-3, button=2)
figs[0].toolbar['inspect']._tool.stop()
figs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the supplied Python reproduction and trace the tool's click method invoked through figs[0].toolbar['inspect']._tool. Check how button=1 is handled versus button=2, then verify that the middle-click interaction produces the expected tool behavior without changing the existing left-click behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.