Skip to content

Timeline

Timeline

Timeline(
    *,
    height: int = 0,
    title: str = "",
    xscale: Literal["time", "sequence"] = "time",
    timezone: str | None = None,
    time_unit: str | None = None,
    lane_order: Sequence[Any] | None = None,
    sort: LaneSort | None = None,
    group_order: Sequence[Any] | None = None,
    align: Literal["time", "start"] = "time",
    lane_names: bool = True,
    renderer: Literal[
        "auto", "webgpu", "webgl2", "canvas2d"
    ] = "auto",
    tool: Literal["pan", "zoom", "select"] = "pan",
    font_size: int = 12,
    mark_scale: float = 1.0,
    dodge: bool = True,
    **kwargs: Any,
)

Bases: AnyWidget

An interactive timeline: layers of events on lanes, drawn on the GPU.

Add layers with events; show the plot by making it the last expression of a notebook cell. Click into the plot, then scroll to zoom time; drag to pan; double-click to reset.

Parameters:

  • height (int, default: 0 ) –

    Height in pixels; 0 sizes the plot to its lanes (at most 640 px).

  • title (str, default: '' ) –

    Shown above the plot.

  • xscale (Literal['time', 'sequence'], default: 'time' ) –

    "time" (events at their time) or "sequence" (events by rank, evenly spaced: the order in which they happened).

  • timezone (str | None, default: None ) –

    Time zone to show datetimes in (an IANA name such as "Europe/Amsterdam"). Default: the time column's own, else UTC.

  • time_unit (str | None, default: None ) –

    For numeric time columns: what one unit is ("s", "ms", "us", "ns"); the numbers are then durations. Without it they are plain numbers.

  • lane_order (Sequence[Any] | None, default: None ) –

    Lanes to show first, top to bottom.

  • sort (LaneSort | None, default: None ) –

    Lane order: "name" (natural sort), "first" / "last" (time of a lane's first / last event) or "count" (most events first).

  • lane_names (bool, default: True ) –

    Show the lanes' names left of the plot (False: a plot of one lane, a story, without the column of names).

  • group_order (Sequence[Any] | None, default: None ) –

    Groups (layers' group=) to show first, top to bottom; the others follow in natural order.

  • align (Literal['time', 'start'], default: 'time' ) –

    "time": all at their time; "start": each group's times from its first time (durations since then), so groups of different periods (days, runs, traces) compare from their start.

  • renderer (Literal['auto', 'webgpu', 'webgl2', 'canvas2d'], default: 'auto' ) –

    "auto" (WebGPU, then WebGL2, then Canvas 2D), or one of them.

  • tool (Literal['pan', 'zoom', 'select'], default: 'pan' ) –

    The tool the plot starts with: "pan", "zoom" or "select".

  • font_size (int, default: 12 ) –

    The size of the plot's text in pixels (8 to 24).

  • mark_scale (float, default: 1.0 ) –

    The size of event marks, as a factor of the layers' own (0.25 to 4).

  • dodge (bool, default: True ) –

    Spread events that would overlap over the lane's height (default), or draw them on the lane's line.

renderer class-attribute instance-attribute

renderer = traitlets.Enum(
    RENDERERS, default_value="auto"
).tag(sync=True)

The drawing backend; "auto" picks the first that works.

height class-attribute instance-attribute

height = traitlets.Int(0).tag(sync=True)

Height in pixels; 0 sizes the plot to its lanes.

title class-attribute instance-attribute

title = traitlets.Unicode('').tag(sync=True)

Shown above the plot.

xscale class-attribute instance-attribute

xscale = traitlets.Enum(XSCALES, default_value="time").tag(
    sync=True
)

"time" or "sequence"; also the Time / Order switch in the plot.

hover class-attribute instance-attribute

hover = traitlets.Bool(True).tag(sync=True)

Show a tooltip for the event under the pointer.

legend class-attribute instance-attribute

legend = traitlets.Bool(True).tag(sync=True)

Show the legend.

selection_mode class-attribute instance-attribute

selection_mode = traitlets.Enum(
    SELECTION_MODES, default_value="multiple"
).tag(sync=True)

"multiple": boxes, and Shift/Ctrl/Cmd-clicks that add; "single": one event; "none": no selection (the Select tool is not offered).

font_size class-attribute instance-attribute

font_size = traitlets.Int(12).tag(sync=True)

The size of the plot's text in pixels (8 to 24): lane names, the time axis, labels, legend, tooltips. Also in the toolbar's Display panel.

mark_scale class-attribute instance-attribute

mark_scale = traitlets.Float(1.0).tag(sync=True)

The size of event marks, as a factor of the sizes the layers give them (0.25 to 4): smaller marks overlap less in dense data. Also in the toolbar's Display panel.

dodge class-attribute instance-attribute

dodge = traitlets.Bool(True).tag(sync=True)

Spread events that would overlap over the lane's height (sub-rows), so ties and bursts stay countable; False draws every event on its lane's line. Layers with overlap="overlay" never spread. Also in the Display panel, and the key d.

tool class-attribute instance-attribute

tool = traitlets.Enum(TOOLS, default_value="pan").tag(
    sync=True
)

The plot's tool: "pan" (drag pans; Shift-drag zooms to a range; a plain click does nothing), "zoom" (drag zooms to a time range; click zooms in, Alt-click out) or "select" (drag selects a box; click selects an event). Also the toolbar and keys p, z, s.

selection class-attribute instance-attribute

selection = traitlets.Dict().tag(sync=True)

The selected events: layer name → sorted table rows.

perf class-attribute instance-attribute

perf = traitlets.Dict()

Renderer and timings reported by the browser.

layers property

layers: list[str]

The layers' names, in drawing order.

range property

range: tuple[Any, Any] | None

The visible time range, as the data's kind (datetime64, timedelta64 or numbers); None until the plot has been shown.

linked property

linked: list[Timeline]

The other plots this one is linked with.

events

events(
    data: Any,
    time: str | None = "time",
    *,
    lane: str | None = None,
    order: str | None = None,
    color: str | None = None,
    colormap: str | Sequence[str] | None = None,
    clim: Any = None,
    palette: Mapping[Any, str]
    | Sequence[str]
    | None = None,
    opacity: float = 1.0,
    symbol: str | None = None,
    symbols: Mapping[Any, str]
    | Sequence[str]
    | None = None,
    size: float | str | None = None,
    size_range: tuple[float, float] = (4.0, 16.0),
    text: str | None = None,
    tooltip: Sequence[str] | None = None,
    route: Route | str | None = None,
    overlap: Literal["dodge", "overlay"] = "dodge",
    labels: Literal["beside", "stems"] = "beside",
    stem_shape: Literal["straight", "curved"] = "straight",
    label_width: float | None = None,
    importance: str | None = None,
    group: str | None = None,
    hover: bool = True,
    select: bool = True,
    name: str = "events",
) -> Self

Add an event chart layer: one mark per event, at the moment it happened.

Parameters:

  • data (Any) –

    A table (Polars, pandas, PyArrow, DuckDB, ...) or a dict of arrays, one row per event.

  • time (str | None, default: 'time' ) –

    The column of times: datetimes, durations, or numbers. None with order=: events with an order but no clock time.

  • lane (str | None, default: None ) –

    The column whose values are the lanes (rows) of the plot.

  • order (str | None, default: None ) –

    A column that orders events with equal times (a sequence number), or that is the only order there is (with time=None).

  • color (str | None, default: None ) –

    A column (categories, or numbers through colormap) or one colour.

  • colormap (str | Sequence[str] | None, default: None ) –

    For numbers: a colormap name ("viridis", any matplotlib name) or a list of colours, lowest first.

  • clim (Any, default: None ) –

    For numbers: colour limits (low, high), or "robust".

  • palette (Mapping[Any, str] | Sequence[str] | None, default: None ) –

    For categories: colours in order, or a dict of value → colour.

  • opacity (float, default: 1.0 ) –

    0 to 1.

  • symbol (str | None, default: None ) –

    A column of categories, or one of SYMBOLS (default "circle").

  • symbols (Mapping[Any, str] | Sequence[str] | None, default: None ) –

    For a symbol column: symbol names in order, or a dict value → name.

  • size (float | str | None, default: None ) –

    A diameter in pixels, or a column of numbers (area over size_range).

  • size_range (tuple[float, float], default: (4.0, 16.0) ) –

    Smallest and largest diameter in pixels for a size column.

  • text (str | None, default: None ) –

    A column, or a template such as "{event}", shown beside marks where there is room.

  • tooltip (Sequence[str] | None, default: None ) –

    Columns shown when hovering an event (its time and lane always are).

  • route (Route | str | None, default: None ) –

    A column (or a Route) whose groups are joined by lines in the order their events happened.

  • overlap (Literal['dodge', 'overlay'], default: 'dodge' ) –

    "dodge": events that would overlap are spread over sub-rows of the lane; "overlay": drawn on top of each other.

  • labels (Literal['beside', 'stems'], default: 'beside' ) –

    Where the text (text=) goes. "beside": right of each mark, left out where it would overlap another. "stems": in boxes above and below the lane's line, at as many levels as needed so no two overlap, each joined to its event by a line (a story timeline: few events, the text matters); the events stay on the line. A line break ("{time:%H:%M}\n{title}") gives a box two lines.

  • stem_shape (Literal['straight', 'curved'], default: 'straight' ) –

    With labels="stems": "straight" stems (each box over its event) or "curved" ones (a box may move aside, its stem bending), which fits more boxes where events crowd. No stem ever passes behind a box.

  • label_width (float | None, default: None ) –

    With labels="stems": the widest a box gets, in pixels; longer titles wrap onto two lines (then end in "…"). By default 16 × the text size; 0 for no limit (one line, any width).

  • importance (str | None, default: None ) –

    A numeric column; where labels (text=) would overlap, the more important events keep theirs.

  • group (str | None, default: None ) –

    A column of groups (a host, a region, a day): each group gets a header lane with its own lanes under it, in the plot's lane order; groups fold.

  • hover (bool, default: True ) –

    Show tooltips for this layer.

  • select (bool, default: True ) –

    Whether its events can be selected.

  • name (str, default: 'events' ) –

    The layer's name; adding a layer with an existing name replaces it.

intervals

intervals(
    data: Any,
    start: str = "start",
    end: str | None = "end",
    *,
    duration: str | None = None,
    duration_unit: str | None = None,
    lane: str | None = None,
    id: str | None = None,
    depends: str | None = None,
    color: str | None = None,
    colormap: str | Sequence[str] | None = None,
    clim: Any = None,
    palette: Mapping[Any, str]
    | Sequence[str]
    | None = None,
    opacity: float = 1.0,
    text: str | None = None,
    tooltip: Sequence[str] | None = None,
    progress: str | None = None,
    overlap: Literal["pack", "overlay"] = "pack",
    height: float = 0.7,
    parent: str | None = None,
    label: str | None = None,
    expand: int | Literal["auto"] | None = "auto",
    critical_path: bool = False,
    durations: bool = False,
    group: str | None = None,
    hover: bool = True,
    select: bool = True,
    name: str = "intervals",
) -> Self

Add a layer of intervals: a bar per row from its start to its end, on lanes (a Gantt chart, a schedule, spans). For a Gantt chart in one call, see gantt.

A row whose start equals its end is a milestone, drawn as a diamond. A row without an end is open: its bar runs to the plot's last time and fades out.

Parameters:

  • data (Any) –

    A table (Polars, pandas, PyArrow, DuckDB, ...) or a dict of arrays, one row per interval.

  • start (str, default: 'start' ) –

    The column of start times: datetimes, durations or numbers.

  • end (str | None, default: 'end' ) –

    The column of end times, of the same kind. Pass end=None with duration=.

  • duration (str | None, default: None ) –

    Instead of end: a column of durations (timedelta), or of numbers in duration_unit.

  • duration_unit (str | None, default: None ) –

    What one unit of a numeric duration is: "d", "h", "min", "s", "ms", "us" or "ns". Not needed when the times are plain numbers (the durations are then in the same numbers).

  • lane (str | None, default: None ) –

    The column whose values are the lanes (a task, a machine, a person).

  • id (str | None, default: None ) –

    The column that names each bar, for depends; by default the lane.

  • depends (str | None, default: None ) –

    A column with, per bar, the bars it follows (their ids): one id, a list of ids, or ids separated by commas. An arrow runs from the end of each of them to the start of this bar.

  • color (str | None, default: None ) –

    A column (categories, or numbers through colormap) or one colour.

  • colormap (str | Sequence[str] | None, default: None ) –

    For numbers: a colormap name or a list of colours, lowest first.

  • clim (Any, default: None ) –

    For numbers: colour limits (low, high), or "robust".

  • palette (Mapping[Any, str] | Sequence[str] | None, default: None ) –

    For categories: colours in order, or a dict of value → colour.

  • opacity (float, default: 1.0 ) –

    0 to 1.

  • text (str | None, default: None ) –

    A column, or a template such as "{task}", written in each bar where it fits (milestones: next to the diamond).

  • tooltip (Sequence[str] | None, default: None ) –

    Columns shown when hovering a bar (its lane, start, end and duration always are).

  • progress (str | None, default: None ) –

    A column of how far each bar is done, 0 to 1: that part of the bar is filled, the rest drawn lighter.

  • overlap (Literal['pack', 'overlay'], default: 'pack' ) –

    "pack": bars of a lane that overlap in time are stacked in sub-rows; "overlay": drawn on top of each other.

  • height (float, default: 0.7 ) –

    The bars' height, as a fraction of the lane (above 0, at most 1).

  • parent (str | None, default: None ) –

    A column with each bar's parent (its id; missing for a top bar): the bars form a tree, each bar on its own lane under its parent, which you can fold. Needs id=; replaces lane=. Bars whose parent is not in the table are shown at the top.

  • label (str | None, default: None ) –

    With parent: the column that names each bar's lane (by default its id).

  • expand (int | Literal['auto'] | None, default: 'auto' ) –

    With parent: the levels shown at first (1: the top bars only), None for all, or "auto": as many as keep about 200 lanes. Click a lane's name to fold or unfold it.

  • critical_path (bool, default: False ) –

    With parent: mark the critical path of each top bar, the parts of bars its end waited for.

  • durations (bool, default: False ) –

    Write each bar's duration right of it.

  • group (str | None, default: None ) –

    A column of groups (a host, a region, a day): each group gets a header lane with its own lanes under it, in the plot's lane order; groups fold.

  • hover (bool, default: True ) –

    Show tooltips for this layer.

  • select (bool, default: True ) –

    Whether its bars can be selected.

  • name (str, default: 'intervals' ) –

    The layer's name; adding a layer with an existing name replaces it.

states

states(
    data: Any,
    time: str = "time",
    state: str = "state",
    *,
    lane: str | None = None,
    end: Any = None,
    color: str | None = None,
    palette: Mapping[Any, str]
    | Sequence[str]
    | None = None,
    opacity: float = 1.0,
    text: bool | str = True,
    tooltip: Sequence[str] | None = None,
    height: float = 0.8,
    group: str | None = None,
    hover: bool = True,
    select: bool = True,
    name: str = "states",
) -> Self

Add states: each lane is in one state at a time (a service up, degraded or down; a feature flag on or off; a phase), drawn as a band of colours.

The table has a row per change: from its time on, its lane is in its state, until the lane's next change. A row that repeats the state its lane is in changes nothing; a missing state is a gap (nothing known). A lane's last state runs to end, or to the plot's last time.

Parameters:

  • data (Any) –

    A table (Polars, pandas, PyArrow, ...) or a dict of arrays: a row per change.

  • time (str, default: 'time' ) –

    The column of times the states start.

  • state (str, default: 'state' ) –

    The column of states.

  • lane (str | None, default: None ) –

    The column of lanes (a service, a host); without it, one lane.

  • end (Any, default: None ) –

    When the lanes' last states end (one time); by default they run to the plot's last time.

  • color (str | None, default: None ) –

    Colour by another column, or one colour; by default by the state.

  • palette (Mapping[Any, str] | Sequence[str] | None, default: None ) –

    Colours for the states: in order, or a dict of state → colour (which also sets their order in the legend).

  • opacity (float, default: 1.0 ) –

    0 to 1.

  • text (bool | str, default: True ) –

    Write each state's name in its band where it fits (True), a template such as "{state} ({reason})", or False.

  • tooltip (Sequence[str] | None, default: None ) –

    More columns shown when hovering a state (its state, start, end and duration always are).

  • height (float, default: 0.8 ) –

    The band's height, as a fraction of the lane.

  • group (str | None, default: None ) –

    A column of groups (a host, a region, a day): each group gets a header lane with its own lanes under it, in the plot's lane order; groups fold.

  • hover (bool, default: True ) –

    Show tooltips for this layer.

  • select (bool, default: True ) –

    Whether its states can be selected (as the rows that start them).

  • name (str, default: 'states' ) –

    The layer's name; adding a layer with an existing name replaces it.

values

values(
    data: Any,
    time: str = "time",
    value: str = "value",
    *,
    lane: str | None = None,
    series: str | None = None,
    color: str | None = None,
    palette: Mapping[Any, str]
    | Sequence[str]
    | None = None,
    kind: Literal["line", "area", "step"] = "line",
    scale: Literal["lane", "shared"] = "lane",
    ylim: tuple[float, float]
    | Mapping[Any, tuple[float, float]]
    | None = None,
    width: float = 1.5,
    tooltip: Sequence[str] | None = None,
    group: str | None = None,
    hover: bool = True,
    name: str = "values",
) -> Self

Add values: a number over time in each lane (CPU, queue length, an error rate), drawn as a small chart in the lane's band, behind its events and bars.

Samples are not events: on the Order scale they take no places of their own, and are drawn between the events they fall between. Many samples are fine: each pixel column of a line shows the lowest and highest value in it.

Parameters:

  • data (Any) –

    A table (Polars, pandas, PyArrow, ...) or a dict of arrays: a row per sample.

  • time (str, default: 'time' ) –

    The column of sample times.

  • value (str, default: 'value' ) –

    The column of numbers; a missing value is a gap in the line.

  • lane (str | None, default: None ) –

    The column of lanes, the same as other layers' to draw the values behind their events; without it, a lane named after value.

  • series (str | None, default: None ) –

    A column that splits a lane into several lines (p50 and p99, a host).

  • color (str | None, default: None ) –

    One colour, or a column to colour the lines by; by default by series (one colour per series), else the theme's.

  • palette (Mapping[Any, str] | Sequence[str] | None, default: None ) –

    Colours for the series: in order, or a dict of series → colour.

  • kind (Literal['line', 'area', 'step'], default: 'line' ) –

    "line", "area" (filled below the line) or "step" (each value holds until the next sample: gauges, counters).

  • scale (Literal['lane', 'shared'], default: 'lane' ) –

    "lane": each lane from its own lowest to highest value; "shared": all lanes on one range.

  • ylim (tuple[float, float] | Mapping[Any, tuple[float, float]] | None, default: None ) –

    The range (low, high) for every lane, e.g. (0, 100) for percentages, or a dict of lane → range.

  • width (float, default: 1.5 ) –

    The line's width in pixels.

  • tooltip (Sequence[str] | None, default: None ) –

    Columns shown when hovering a sample (its time and value always are).

  • group (str | None, default: None ) –

    A column of groups (a host, a region, a day): each group gets a header lane with its own lanes under it, in the plot's lane order; groups fold.

  • hover (bool, default: True ) –

    Show the value under the pointer.

  • name (str, default: 'values' ) –

    The layer's name; adding a layer with an existing name replaces it.

spans

spans(
    data: Any,
    start: str = "start",
    end: str | None = "end",
    *,
    duration: str | None = None,
    duration_unit: str | None = None,
    id: str = "span_id",
    parent: str = "parent_id",
    label: str = "name",
    color: str | None = None,
    colormap: str | Sequence[str] | None = None,
    clim: Any = None,
    palette: Mapping[Any, str]
    | Sequence[str]
    | None = None,
    opacity: float = 1.0,
    text: str | None = None,
    tooltip: Sequence[str] | None = None,
    expand: int | Literal["auto"] | None = "auto",
    critical_path: bool = True,
    durations: bool = True,
    height: float = 0.6,
    group: str | None = None,
    hover: bool = True,
    select: bool = True,
    name: str = "spans",
) -> Self

Add the spans of traces: a waterfall with a lane per span, under its parent span, its duration beside it and the critical path of each trace marked. Lanes fold: click a span's name.

This is intervals set up for traces (OpenTelemetry, Jaeger, Zipkin): read them with read_otlp, or pass any table with a row per span. Events (logs, errors) of the spans go on their lanes with events(..., lane="span_id").

Parameters:

  • data (Any) –

    A table with a row per span.

  • start (str, default: 'start' ) –

    The column of start times.

  • end (str | None, default: 'end' ) –

    The column of end times; or end=None with duration=.

  • duration (str | None, default: None ) –

    A column of durations, or of numbers in duration_unit.

  • duration_unit (str | None, default: None ) –

    What one unit of a numeric duration is ("ms", "us", ...).

  • id (str, default: 'span_id' ) –

    The column of span ids, unique in the table.

  • parent (str, default: 'parent_id' ) –

    The column of parent span ids (missing for the root of a trace).

  • label (str, default: 'name' ) –

    The column that names each span's lane.

  • color (str | None, default: None ) –

    A column (the service, the status) or one colour.

  • colormap (str | Sequence[str] | None, default: None ) –

    For numbers: a colormap name or a list of colours.

  • clim (Any, default: None ) –

    For numbers: colour limits (low, high), or "robust".

  • palette (Mapping[Any, str] | Sequence[str] | None, default: None ) –

    For categories: colours in order, or a dict of value → colour.

  • opacity (float, default: 1.0 ) –

    0 to 1.

  • text (str | None, default: None ) –

    Written in each bar where it fits (a column or a template).

  • tooltip (Sequence[str] | None, default: None ) –

    Columns shown when hovering a span.

  • expand (int | Literal['auto'] | None, default: 'auto' ) –

    The levels shown at first (1: the roots only), None for all, or "auto": as many as keep about 200 lanes.

  • critical_path (bool, default: True ) –

    Mark the critical path of each trace.

  • durations (bool, default: True ) –

    Write each span's duration right of it.

  • height (float, default: 0.6 ) –

    The bars' height, as a fraction of the lane.

  • group (str | None, default: None ) –

    A column of groups (a host, a region, a day): each group gets a header lane with its own lanes under it, in the plot's lane order; groups fold.

  • hover (bool, default: True ) –

    Show tooltips for this layer.

  • select (bool, default: True ) –

    Whether its spans can be selected.

  • name (str, default: 'spans' ) –

    The layer's name.

marker

marker(
    time: Any, label: str = "", *, color: str | None = None
) -> Self

Draw a vertical line across the lanes at a time, such as now or a deadline.

Parameters:

  • time (Any) –

    A time of the data's kind (datetime, ISO text, duration or number).

  • label (str, default: '' ) –

    Written at the top of the line.

  • color (str | None, default: None ) –

    The line's colour (default: the selection colour).

clear_markers

clear_markers() -> Self

Remove every marker.

remove

remove(name: str) -> Self

Remove a layer.

clear

clear() -> Self

Remove every layer.

zoom_to

zoom_to(start: Any, end: Any) -> Self

Show the time range from start to end (datetimes, ISO strings, durations or numbers, as the data).

save_html

save_html(
    path: str | PathLike[str], *, title: str | None = None
) -> Path

Write the plot to one HTML file that opens in any browser, without Python or a network: its data, the drawing code and the styles are all in the file. Pan, zoom, hover (with the tooltip columns), Time / Order, folding and full screen work; selecting does not (it needs Python).

Parameters:

  • path (str | PathLike[str]) –

    The file to write (.html).

  • title (str | None, default: None ) –

    The page's title; by default the plot's title.

Returns:

  • Path –

    The path written.

link(
    *others: Timeline,
    align: Literal["time", "start"] = "time",
) -> Self

Link this plot with others: zooming or panning one moves the others to the same time, the pointer's time shows as a line in all of them, and their lane names and legends take the same width, so their time axes line up when they are shown one above the other.

Linking happens in the browser: it works between plots in a notebook, in a page from save_html, and in documentation.

Parameters:

  • others (Timeline, default: () ) –

    The plots to link with; plots linked with them already stay linked.

  • align (Literal['time', 'start'], default: 'time' ) –

    "time": the same times line up; "start": each plot's first time lines up, so plots of different periods (two traces, this week and last) compare from their start.

unlink() -> Self

Leave the group of linked plots (the others stay linked).

save_png

save_png(path: str | PathLike[str]) -> None

Save the plot as a PNG, as it is shown in the notebook (its view, zoom and folded lanes; title and legend; at twice the screen's resolution).

The picture is drawn in the browser, so the plot must be on screen, and the file is written when the browser sends it: in Jupyter right after the cell has run, not during it. The toolbar's Save as PNG button does the same as a download; use this where downloads are blocked (VS Code) or from code.

Parameters:

  • path (str | PathLike[str]) –

    The file to write (.png).

on_select

on_select(
    callback: Callable[[dict[str, list[int]]], Any],
    *,
    remove: bool = False,
) -> None

Call callback(selection) after every change of the selection made in the plot.

Pass remove=True to unregister it.