enable persistence of selection info to the layout
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 18.3k
- フォーク
- 2k
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 28
説明
Part of #1851 - split out so we can discuss it separately
To make it possible to retain selections across redraws or create a new selection programmatically, the selection data should be part of the layout. This also means that when you finish a selection, in addition to the plotly_selected event you'll also get a plotly_relayout event. Probably no changes in the middle though (ie with plotly_selecting).
So what should these attributes look like? We need to describe the selection in data coordinates, including which axes / subplot we're selecting on; we need to support rectangular and lasso selections, as well as shift-select combinations of multiple regions and simultaneous selections on different subplots.
So I propose:
layout.selections = [{
subplot: 'xy',
type: 'rect',
x: [5, 10],
y: [-3, 6]
}, {
subplot: 'x2y2',
type: 'lasso',
x: [5, 6, 5, 4, 2, 3],
y: [9, 8, 7, 7, 8, 9]
}, {
subplot: 'geo3',
type: 'rect',
geo: [[-113, 72], [-108, 22]]
}]
One tricky case here around geo subplots: for many projections when you pan or zoom, what was a rectangle is no longer a rectangle, what was a straight line is no longer straight. We may need to either (a) convert rect to lasso, and increase the density of points on the lassos when you pan/zoom after making the selection, or (b) keep track of the projection parameters in effect when the selection was made, so we can transform it to an accurate representation in the new projection. Option (a) will never be perfect, and will have occasional edge cases where it breaks down spectacularly, but (b) means adding a complicated bunch of logic to the drawing and point selection routines, and may have performance implications. mapbox may have some of this issue, as it supports rotating and tilting, though straight lines are still pretty close to straight when the map is tilted even if they are no longer x/y aligned. polar too, in the case where users set a nonzero inner radius.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ファイル、テスト、エントリポイントは指定されていません。まず issue #1851 を確認し、矩形、ラッソ、複合、マルチサブプロットの選択を含む layout.selections スキーマを決定してください。パンまたはズーム後に geo、mapbox、polar 投影がどのように動作するかを定義してください。完了には、設計の確定と実装計画が必要です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- data-visualization
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 20/100