matplotlib / matplotlib/matplotlib

[ENH]: Add multiple span selector

未關閉
#28,484 3 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

New feature topic: widgets/UI
主要語言
Python
星號
23.2k
分支
8.5k
平均合併
1 天 6 小時
30 天內合併 PR
66

描述

### Problem

`matplotlib.widgets.SpanSelector` is a useful widget, however only supports one span to be created because of how the class functionality tracks movement and positioning on a screen.

### Proposed solution

Would there be interest in an `NSpanSelector`, which would generalize SpanSelector to N many spans controlled by a single object?
I've written a demo for `NSpanSelector` which is subclass of `SpanSelector`, that corrects the handling functionality for multiple spans. I haven't contributed to many open source projects before. I'm not sure if something like this would even be wanted by others - I had a particular use case where two selectors were needed simultaneously. But since I've written it I'm happy to contribute it!

Here's a snapshot of my example implementation.
![image](https://github.com/matplotlib/matplotlib/assets/2296818/91aa4be4-47f2-409e-8726-c6465d2e92e9)

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先檢視 matplotlib.widgets.SpanSelector,以及 issue 中描述的 NSpanSelector 示範提案。在實作之前,釐清是否需要多 span API、其互動模型,以及哪些測試或範例可以定義完成標準。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
matplotlib, python
領域
data-visualization
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。