megaplot icon indicating copy to clipboard operation
megaplot copied to clipboard

Support brushing with a .brush() API

Open RyanMullins opened this issue 3 years ago • 0 comments

Building on #6 and #7, it appears that .hitTest() supports rudimentary brushing by supplying a width and height parameter in addition to the x and y coordinates.

Since brushing is always expected to. return as array of Sprites, it seems like it would be possible to add a .brush() API, similar to D3's version but locked into a 2D context, to Scenes and Selections. This API would eliminate MegaPlot user errors and frustrations by correctly setting up the drag event handlers on the <canvas> for them, and provide a simple and consistent API for interacting with the results of the .hitTest(). And the .hitTest() method would still be there if a user wanted to support another drag-based behavior.

RyanMullins avatar May 09 '22 14:05 RyanMullins