Skip to content

Commit

Permalink
Elaborate on the "on" parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
joelostblom committed Oct 3, 2024
1 parent 27f841c commit 6a8edb0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions doc/user_guide/interactions/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,13 @@ via mouse actions. By default, points are selected on click:
point = alt.selection_point()
make_example(point)

By changing some arguments, we can select points when hovering over them rather than on
click. We can also set the ``nearest`` flag to ``True`` so that the nearest
point is highlighted:
By changing the ``on`` parameter to `'pointerover'`, we can select points when hovering over them rather than on
click.
The ``on`` parameter accepts `any "Event Stream Selector" supported by Vega
<https://vega.github.io/vega/docs/event-streams/#selector>`_
and you can see more elaborate example at the end of the :ref:`parameter-composition` section.
We can also set the ``nearest`` flag to ``True`` so that the nearest
point is highlighted instead of when the pointer is directly touching a point:

.. altair-plot::

Expand Down

0 comments on commit 6a8edb0

Please sign in to comment.