Skip to content

Linked pointers #1795

Closed
Closed
@yurivish

Description

@yurivish

Edit: Here's a notebook with a simplified demo of the question below

I've been experimenting with using multiple "coordinated" pointers for more complex hover scenarios like this one:

Without hover:

image

With hover:

image

It's really wonderful to have interactivity right in Plot, and the decoupling of interactions from specific marks like the tip has opened up the potential for lots of very exciting possibilities.

I did notice an issue with one kind of more complex use case, though, and wanted to ask – it's something that comes up when hovering in the region where the green curve exists, but the pink one doesn't – in that case, it is possible for the individual pointers to become uncoordinated, leading to scenarios like the following:

image

This happens because there is a background rect in each x-column, but the filled circles, arrow, and text marks only appear in those x-columns where the pink and green lines both exist. Since the green line extends beyond the pink, the nearest rect is the one for that column, but the nearest arrow/circles/text are from the column next to it.

I initially tried controlling this with the radius option, but I think that one operates in screen space, rather than data space, so it is trickier to compute it to prevent this issue since I think it would require inverting the x scale (accounting for margins, etc.).

Since the pointer transforms wrap the options object of an individual mark, I haven't been able to see a way to wrap up multiple marks in a single pointer interaction and I'm curious about whether there's an alternative approach that would allow this kind of composite interaction, where either all or none of the pointers are shown at any given time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions