box_select for line glyphs
See original GitHub issueThis issue is to open discussion of implementing box_select for line glyphs. My proposal is to follow the example of box_select for patches and multi_polygons (see also #2325), which does two things: 1) adds a _hit_rect
to the glyph that selects glyphs that are completely contained by the box_select; and 2) adds a note about the box_select behavior to the glyph documentation.
I have found that copying _hit_rect
from box.ts is a simple solution and adequate for this selection behavior:
protected _hit_rect(geometry: RectGeometry): Selection {
return this._hit_rect_against_index(geometry)
}
While it could be desirable to allow for partial overlap selections, this is a good place to start since it follows the pattern already established by the box, patches, and multi_polygons glyphs.
If this proposal is received favorably I can prepare a PR with the changes.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top GitHub Comments
As a temporary workaround while it’s not yet implemented i do as follow:
Loos like a line only:
Selected by BoxSelectTool:
The idea as you see to add the dot glyphs with the same line color and select only their renderer.
I left it here as the issue is easily found in google search and it might be helpful for those who work with the line plot and similar plot type selection.
Perhaps you are right that partial overlap is a better general solution for lines. For my use case (selecting time ranges of audio waveforms) the distinction is not very important since the time scale of a typical plot does not allow the viewer to select between individual samples anyway, and either behavior could be acceptable.
In informal testing the box.ts
_hit_rect
did not select partial overlaps, but I will check again.