Skip to content

Commit

Permalink
Change "mouse" to "pointer" everywhere (#3363)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelostblom authored Mar 16, 2024
1 parent bb357e3 commit 1ce3823
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion altair/vegalite/v5/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def selection_interval(
pressing the left/right arrow keys) will be supported in future
versions.
The default value is True, which corresponds to
[mousedown, window:mouseup] > window:mousemove!
[pointerdown, window:pointerup] > window:pointermove!
This default allows users to click and drag within an interval
selection to reposition it.
zoom : string or boolean (optional)
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide/compound_charts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ layered chart with a hover selection:

.. altair-plot::

hover = alt.selection_point(on='mouseover', nearest=True, empty=False)
hover = alt.selection_point(on='pointerover', nearest=True, empty=False)

base = alt.Chart(iris).encode(
x='petalLength:Q',
Expand Down
8 changes: 4 additions & 4 deletions doc/user_guide/interactions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,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 on mouseover rather than on
By changing some arguments, we can select points on pointerover rather than on
click. We can also set the ``nearest`` flag to ``True`` so that the nearest
point is highlighted:

.. altair-plot::

point_nearest = alt.selection_point(on='mouseover', nearest=True)
point_nearest = alt.selection_point(on='pointerover', nearest=True)
make_example(point_nearest)

Point selections also allow for multiple chart objects to be selected.
Expand Down Expand Up @@ -470,11 +470,11 @@ selection
.. altair-plot::

alex = alt.selection_interval(
on="[mousedown[event.altKey], mouseup] > mousemove",
on="[pointerdown[event.altKey], pointerup] > pointermove",
name='alex'
)
morgan = alt.selection_interval(
on="[mousedown[event.shiftKey], mouseup] > mousemove",
on="[pointerdown[event.shiftKey], pointerup] > pointermove",
mark=alt.BrushConfig(fill="#fdbb84", fillOpacity=0.5, stroke="#e34a33"),
name='morgan'
)
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide/marks/geoshape.rst
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ We use here an elegant way to access the nested point coordinates from the geome
# define parameters
range0 = alt.binding_range(min=-180, max=180, step=5, name='rotate longitude ')
rotate0 = alt.param(value=120, bind=range0)
hover = alt.selection_point(on="mouseover", clear="mouseout")
hover = alt.selection_point(on="pointerover", clear="pointerout")

# world disk
sphere = alt.Chart(alt.sphere()).mark_geoshape(
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide/marks/line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ We can further apply selection to highlight a certain line on hover.
source = data.stocks()

highlight = alt.selection_point(
on="mouseover", fields=["symbol"], nearest=True
on="pointerover", fields=["symbol"], nearest=True
)

base = alt.Chart(source).encode(
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide/transform/pivot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ values on multiple lines:
base = alt.Chart(source).encode(x='date:T')
columns = sorted(source.symbol.unique())
selection = alt.selection_point(
fields=['date'], nearest=True, on='mouseover', empty=False, clear='mouseout'
fields=['date'], nearest=True, on='pointerover', empty=False, clear='mouseout'
)

lines = base.mark_line().encode(y='price:Q', color='symbol:N')
Expand Down
6 changes: 3 additions & 3 deletions tests/examples_arguments_syntax/airport_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-------------------------------------------
This example shows all the connections between major U.S. airports. Lookup transformations
are used to find the coordinates of each airport and connecting airports. Connections
are displayed on mouseover via a single selection.
are displayed on pointerover via a single selection.
"""
# category: case studies
import altair as alt
Expand All @@ -15,9 +15,9 @@

states = alt.topo_feature(data.us_10m.url, feature="states")

# Create mouseover selection
# Create pointerover selection
select_city = alt.selection_point(
on="mouseover", nearest=True, fields=["origin"], empty=False
on="pointerover", nearest=True, fields=["origin"], empty=False
)

# Define which attributes to lookup from airports.csv
Expand Down
4 changes: 2 additions & 2 deletions tests/examples_arguments_syntax/multiline_highlight.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Multi-Line Highlight
====================
This multi-line chart uses an invisible Voronoi tessellation to handle mouseover to
This multi-line chart uses an invisible Voronoi tessellation to handle pointerover to
identify the nearest point and then highlight the line on which the point falls.
It is adapted from the Vega-Lite example found at
https://bl.ocks.org/amitkaps/fe4238e716db53930b2f1a70d3401701
Expand All @@ -12,7 +12,7 @@

source = data.stocks()

highlight = alt.selection_point(on='mouseover',
highlight = alt.selection_point(on='pointerover',
fields=['symbol'], nearest=True)

base = alt.Chart(source).encode(
Expand Down
2 changes: 1 addition & 1 deletion tests/examples_arguments_syntax/multiline_tooltip.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
source = source.reset_index().melt("x", var_name="category", value_name="y")

# Create a selection that chooses the nearest point & selects based on x-value
nearest = alt.selection_point(nearest=True, on="mouseover",
nearest = alt.selection_point(nearest=True, on="pointerover",
fields=["x"], empty=False)

# The basic line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
source = source.reset_index().melt("x", var_name="category", value_name="y")

# Create a selection that chooses the nearest point & selects based on x-value
nearest = alt.selection_point(nearest=True, on="mouseover",
nearest = alt.selection_point(nearest=True, on="pointerover",
fields=["x"], empty=False)

# The basic line
Expand Down
2 changes: 1 addition & 1 deletion tests/examples_arguments_syntax/us_state_capitals.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
).project('albersUsa')

# Points and text
hover = alt.selection_point(on='mouseover', nearest=True,
hover = alt.selection_point(on='pointerover', nearest=True,
fields=['lat', 'lon'])

base = alt.Chart(capitals).encode(
Expand Down
6 changes: 3 additions & 3 deletions tests/examples_methods_syntax/airport_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-------------------------------------------
This example shows all the connections between major U.S. airports. Lookup transformations
are used to find the coordinates of each airport and connecting airports. Connections
are displayed on mouseover via a single selection.
are displayed on pointerover via a single selection.
"""
# category: case studies
import altair as alt
Expand All @@ -15,9 +15,9 @@

states = alt.topo_feature(data.us_10m.url, feature="states")

# Create mouseover selection
# Create pointerover selection
select_city = alt.selection_point(
on="mouseover", nearest=True, fields=["origin"], empty=False
on="pointerover", nearest=True, fields=["origin"], empty=False
)

# Define which attributes to lookup from airports.csv
Expand Down
4 changes: 2 additions & 2 deletions tests/examples_methods_syntax/multiline_highlight.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Multi-Line Highlight
====================
This multi-line chart uses an invisible Voronoi tessellation to handle mouseover to
This multi-line chart uses an invisible Voronoi tessellation to handle pointerover to
identify the nearest point and then highlight the line on which the point falls.
It is adapted from the Vega-Lite example found at
https://bl.ocks.org/amitkaps/fe4238e716db53930b2f1a70d3401701
Expand All @@ -12,7 +12,7 @@

source = data.stocks()

highlight = alt.selection_point(on='mouseover', fields=['symbol'], nearest=True)
highlight = alt.selection_point(on='pointerover', fields=['symbol'], nearest=True)

base = alt.Chart(source).encode(
x='date:T',
Expand Down
2 changes: 1 addition & 1 deletion tests/examples_methods_syntax/multiline_tooltip.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
source = source.reset_index().melt("x", var_name="category", value_name="y")

# Create a selection that chooses the nearest point & selects based on x-value
nearest = alt.selection_point(nearest=True, on="mouseover",
nearest = alt.selection_point(nearest=True, on="pointerover",
fields=["x"], empty=False)

# The basic line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
source = source.reset_index().melt("x", var_name="category", value_name="y")

# Create a selection that chooses the nearest point & selects based on x-value
nearest = alt.selection_point(nearest=True, on="mouseover",
nearest = alt.selection_point(nearest=True, on="pointerover",
fields=["x"], empty=False)

# The basic line
Expand Down
2 changes: 1 addition & 1 deletion tests/examples_methods_syntax/us_state_capitals.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
).project('albersUsa')

# Points and text
hover = alt.selection_point(on='mouseover', nearest=True,
hover = alt.selection_point(on='pointerover', nearest=True,
fields=['lat', 'lon'])

base = alt.Chart(capitals).encode(
Expand Down

0 comments on commit 1ce3823

Please sign in to comment.