plot icon indicating copy to clipboard operation
plot copied to clipboard

Crosshairs

Open tannerlinsley opened this issue 4 years ago • 10 comments

Similar to tooltips and an interaction layer, cursors would be 🔥 and IMO, fit pretty naturally into the API by possibly being able to bind arbitrary marks (like ruleX and text) to your current cursor position. This would probably share a lot of logic with whatever is needed to implement brushing, I would imagine 🤔

tannerlinsley avatar Jun 25 '21 03:06 tannerlinsley

Cursors are very helpful, especially if you could sync them across a faceted chart.

derekperkins avatar Jun 25 '21 21:06 derekperkins

Can you elaborate on what you mean by cursors? Is it like keyboard focus navigation of the plotted data (as opposed to pointer-based)?

mbostock avatar Jun 28 '21 15:06 mbostock

What I have in my mind is essentially x+y crosshairs that intersect at either your mouse/touch coords or (if we had an interaction model), the closest datum’s coords.

But now that you bring up, accessible keyboard-driven crosshairs would be awesome as well.

tannerlinsley avatar Jun 28 '21 16:06 tannerlinsley

Okay, retitled the issue to use the term that speaks more clearly to me. Did “pointer-bound marks” refer to something else, or was it to distinguish between crosshairs at the pointer vs. crosshairs that snap to the closest data point?

mbostock avatar Jun 28 '21 16:06 mbostock

No, it was mostly my own attempt to speak in "plot" vocabulary. I imagined the crosshairs as "marks" that were bound to the cursor position (or some interaction coordinate).

tannerlinsley avatar Jun 28 '21 16:06 tannerlinsley

And who knows, that may be the case for the implementation, but I agree that crosshairs is a bit more descriptive for the concept as a whole.

tannerlinsley avatar Jun 28 '21 16:06 tannerlinsley

Ah, I see, something more configurable… Interesting. Thanks for the additional context!

mbostock avatar Jun 28 '21 16:06 mbostock

You bet! I especially love how everything in Plot is "just a mark/transform/etc". This is just one situation where that's really helped me think more clearly about how the API could technically be more flexible/powerful by using the same language/api for everything else.

tannerlinsley avatar Jun 28 '21 17:06 tannerlinsley

sorry for begging. but i want this feature really and waited almost a year. :)

ryoqun avatar Apr 10 '22 15:04 ryoqun

Sorry I should have mentioned here that I made a prototype “reticule” plugin (in July 2021) to address this: https://observablehq.com/@fil/reticule-plot-plugin

Fil avatar Apr 11 '22 08:04 Fil