inspect_viz.interactor
Selection
interval_x
Select a continuous 1D interval selection over the x scale domain.
def interval_x(
target: Selection,
field: str | None = None,
pixel_size: float | None = None,
peers: bool | None = None,
brush: Brush | None = None,
) -> InteractortargetSelection-
The target selection. A clause of the form
field BETWEEN lo AND hiis added for the currently selected interval [lo, hi]. fieldstr | None-
The name of the field (database column) over which the interval selection should be defined. If unspecified, the channel field of the first valid prior mark definition is used.
pixel_sizefloat | None-
The size of an interative pixel (default
1). Larger pixel sizes reduce the brush resolution, which can reduce the size of pre-aggregated materialized views. peersbool | None-
A flag indicating if peer (sibling) marks are excluded when cross-filtering (default
true). If set, peer marks will not be filtered by this interactor’s selection in cross-filtering setups. brushBrush | None-
CSS styles for the brush (SVG
rect) element.
interval_y
Select a continuous 1D interval selection over the y scale domain.
def interval_y(
target: Selection,
field: str | None = None,
pixel_size: float | None = None,
peers: bool | None = None,
brush: Brush | None = None,
) -> InteractortargetSelection-
The target selection. A clause of the form
field BETWEEN lo AND hiis added for the currently selected interval [lo, hi]. fieldstr | None-
The name of the field (database column) over which the interval selection should be defined. If unspecified, the channel field of the first valid prior mark definition is used.
pixel_sizefloat | None-
The size of an interative pixel (default
1). Larger pixel sizes reduce the brush resolution, which can reduce the size of pre-aggregated materialized views. peersbool | None-
A flag indicating if peer (sibling) marks are excluded when cross-filtering (default
true). If set, peer marks will not be filtered by this interactor’s selection in cross-filtering setups. brushBrush | None-
CSS styles for the brush (SVG
rect) element.
interval_xy
Select a continuous 2D interval selection over the x and y scale domains.
def interval_xy(
target: Selection,
xfield: str | None = None,
yfield: str | None = None,
pixel_size: float | None = None,
peers: bool | None = None,
brush: Brush | None = None,
) -> InteractortargetSelection-
The target selection. A clause of the form
(xfield BETWEEN x1 AND x2) AND (yfield BETWEEN y1 AND y2)is added for the currently selected intervals. xfieldstr | None-
The name of the field (database column) over which the
x-component of the interval selection should be defined. If unspecified, thexchannel field of the first valid prior mark definition is used. yfieldstr | None-
The name of the field (database column) over which the
y-component of the interval selection should be defined. If unspecified, theychannel field of the first valid prior mark definition is used. pixel_sizefloat | None-
The size of an interative pixel (default
1). Larger pixel sizes reduce the brush resolution, which can reduce the size of pre-aggregated materialized views. peersbool | None-
A flag indicating if peer (sibling) marks are excluded when cross-filtering (default
true). If set, peer marks will not be filtered by this interactor’s selection in cross-filtering setups. brushBrush | None-
CSS styles for the brush (SVG
rect) element.
nearest_x
Select values from the mark closest to the pointer x location.
def nearest_x(
target: Selection,
channels: list[str] | None = None,
fields: list[str] | None = None,
max_radius: float | None = None,
) -> InteractortargetSelection-
The target selection. A clause of the form
field = valueis added for the currently nearest value. channelslist[str] | None-
The encoding channels whose domain values should be selected. For example, a setting of
['color']selects the data value backing the color channel, whereas['x', 'z']selects both x and z channel domain values. If unspecified, the selected channels default to match the current pointer settings: anearestXinteractor selects the['x']channels, while anearestinteractor selects the['x', 'y']channels. fieldslist[str] | None-
The fields (database column names) to use in generated selection clause predicates. If unspecified, the fields backing the selected channels in the first valid prior mark definition are used by default.
max_radiusfloat | None-
The maximum radius of a nearest selection (default 40). Marks with (x, y) coordinates outside this radius will not be selected as nearest points.
nearest_y
Select values from the mark closest to the pointer y location.
def nearest_y(
target: Selection,
channels: list[str] | None = None,
fields: list[str] | None = None,
max_radius: float | None = None,
) -> InteractortargetSelection-
The target selection. A clause of the form
field = valueis added for the currently nearest value. channelslist[str] | None-
The encoding channels whose domain values should be selected. For example, a setting of
['color']selects the data value backing the color channel, whereas['x', 'z']selects both x and z channel domain values. If unspecified, the selected channels default to match the current pointer settings: anearestXinteractor selects the['x']channels, while anearestinteractor selects the['x', 'y']channels. fieldslist[str] | None-
The fields (database column names) to use in generated selection clause predicates. If unspecified, the fields backing the selected channels in the first valid prior mark definition are used by default.
max_radiusfloat | None-
The maximum radius of a nearest selection (default 40). Marks with (x, y) coordinates outside this radius will not be selected as nearest points.
toggle
Select individal values.
def toggle(
target: Selection,
channels: list[str],
peers: bool | None = None,
) -> InteractortargetSelection-
The target selection. A clause of the form
(field = value1) OR (field = value2) ...is added for the currently selected values. channelslist[str]-
The encoding channels over which to select values. For a selected mark, selection clauses will cover the backing data fields for each channel.
peersbool | None-
A flag indicating if peer (sibling) marks are excluded when cross-filtering (default
true). If set, peer marks will not be filtered by this interactor’s selection in cross-filtering setups.
toggle_x
Select individal values in the x scale domain. Clicking or touching a mark toggles its selection status.
def toggle_x(
target: Selection,
peers: bool | None = None,
) -> InteractortargetSelection-
The target selection. A clause of the form
(field = value1) OR (field = value2) ...is added for the currently selected values. peersbool | None-
A flag indicating if peer (sibling) marks are excluded when cross-filtering (default
true). If set, peer marks will not be filtered by this interactor’s selection in cross-filtering setups.
toggle_y
Toggle interactor over the "y" encoding channel only.
def toggle_y(
target: Selection,
peers: bool | None = None,
) -> InteractortargetSelection-
The target selection. A clause of the form
(field = value1) OR (field = value2) ...is added for the currently selected values. peersbool | None-
A flag indicating if peer (sibling) marks are excluded when cross-filtering (default
true). If set, peer marks will not be filtered by this interactor’s selection in cross-filtering setups.
toggle_color
Select individal values in the color scale domain. Clicking or touching a mark toggles its selection status.
def toggle_color(
target: Selection,
peers: bool | None = None,
) -> InteractortargetSelection-
The target selection. A clause of the form
(field = value1) OR (field = value2) ...is added for the currently selected values. peersbool | None-
A flag indicating if peer (sibling) marks are excluded when cross-filtering (default
true). If set, peer marks will not be filtered by this interactor’s selection in cross-filtering setups.
region
Select aspects of individual marks within a 2D range.
def region(
target: Selection,
channels: list[str],
peers: bool | None = None,
brush: Brush | None = None,
) -> InteractortargetSelection-
The target selection. A clause of the form
(field = value1) OR (field = value2) ...is added for the currently selected values. channelslist[str]-
The encoding channels over which to select values (e.g. “x”, “y”, “color”, etc.). For a selected mark, selection clauses will cover the backing data fields for each channel.
peersbool | None-
A flag indicating if peer (sibling) marks are excluded when cross-filtering (default
true). If set, peer marks will not be filtered by this interactor’s selection in cross-filtering setups. brushBrush | None-
CSS styles for the brush (SVG
rect) element.
highlight
Highlight individual visualized data points based on a Selection.
Selected values keep their normal appearance. Unselected values are deemphasized.
def highlight(
by: Selection,
opacity: float | None = None,
fill_opacity: float | None = None,
stroke_opacity: float | None = None,
fill: str | None = None,
stroke: str | None = None,
) -> InteractorbySelection-
The input selection. Unselected marks are deemphasized.
opacityfloat | None-
The overall opacity of deemphasized marks. By default the opacity is set to 0.2.
fill_opacityfloat | None-
The fill opacity of deemphasized marks. By default the fill opacity is unchanged.
stroke_opacityfloat | None-
The stroke opacity of deemphasized marks. By default the stroke opacity is unchanged.
fillstr | None-
The fill color of deemphasized marks. By default the fill is unchanged.
strokestr | None-
The stroke color of deemphasized marks. By default the stroke is unchanged.
Types
Interactor
Interactors imbue plots with interactive behavior, such as selecting or highlighting values, and panning or zooming the display.
class Interactor(Component)Brush
Brush options.
class Brush(TypedDict, total=False)Attributes
fillstr-
The fill color of the brush rectangle.
fill_opacityfloat-
The fill opacity of the brush rectangle.
opacityfloat-
The overall opacity of the brush rectangle.
strokestr-
The stroke color of the brush rectangle.
stroke_dasharraystr-
The stroke dash array of the brush rectangle.
stroke_opacityfloat-
The stroke opacity of the brush rectangle.