class InteractivePlot(ResponsivePlot): (source)
Known subclasses: fiftyone.core.plots.matplotlib.InteractiveMatplotlibPlot
, fiftyone.core.plots.plotly.PlotlyInteractivePlot
Constructor: InteractivePlot(link_type, init_view, label_fields, selection_mode, init_fcn)
Base class for plots that support selection of their points.
Whenever a selection is made in an InteractivePlot
, the plot will
invoke any selection callback(s) registered on it, reporting to its
listeners the IDs of its selected points.
Conversely, the state of an InteractivePlot
can be updated by
external parties by calling its select_ids
method.
Parameters | |
link | whether this plot is linked to "samples", "frames", or "labels" |
init | a fiftyone.core.collections.SampleCollection
defining an initial view from which to derive selection views when
points are selected in the plot. This view will also be shown when
the plot is in its default state (no selection) |
label | a label field or list of label fields to which points in this plot correspond. Only applicable when link_type == "labels" |
selection | the initial selection mode to use when updating
connected sessions in response to selections in this plot. See
selection_mode for details |
init | a function that can be called with init_view as
its argument that returns a
fiftyone.core.collections.SampleCollection defining an
initial view from which to derive certain types of selection views.
See selection_mode for details |
Static Method | recommend |
Recommends a link type for the given info. |
Method | __init__ |
Undocumented |
Method | register |
Registers a callback that can disconnect this plot from a SessionPlot connected to it. |
Method | register |
Registers a selection callback for this plot. |
Method | register |
Registers a callback that can sync this plot with a SessionPlot connected to it. |
Method | reset |
Resets the plot to its default state. |
Method | select |
Selects the points with the given IDs in this plot. |
Method | selection |
Undocumented |
Instance Variable | label |
Undocumented |
Property | init |
A fiftyone.core.collections.SampleCollection defining the initial view from which to derive selection views when points are selected in the plot. |
Property | selected |
A list of IDs of the currently selected points. |
Property | selection |
The current selection mode of the plot. |
Method | _register |
Undocumented |
Method | _register |
Undocumented |
Method | _register |
Undocumented |
Method | _select |
Undocumented |
Instance Variable | _disconnect |
Undocumented |
Instance Variable | _init |
Undocumented |
Instance Variable | _init |
Undocumented |
Instance Variable | _init |
Undocumented |
Instance Variable | _selection |
Undocumented |
Instance Variable | _selection |
Undocumented |
Instance Variable | _sync |
Undocumented |
Property | _selected |
Undocumented |
Inherited from ResponsivePlot
:
Method | connect |
Connects this plot, if necessary. |
Method | disconnect |
Disconnects the plot, if necessary. |
Method | freeze |
Freezes the plot, replacing it with a static image. |
Method | show |
Shows the plot. |
Property | is |
Whether this plot is currently connected. |
Property | is |
Whether this plot is currently disconnected. |
Property | is |
Whether this plot is currently frozen. |
Property | supports |
Whether this plot supports automatic updates in response to session changes. |
Method | _connect |
Undocumented |
Method | _disconnect |
Undocumented |
Method | _freeze |
Undocumented |
Method | _reopen |
Undocumented |
Method | _show |
Undocumented |
Instance Variable | _connected |
Undocumented |
Instance Variable | _disconnected |
Undocumented |
Instance Variable | _frozen |
Undocumented |
Instance Variable | _link |
Undocumented |
Inherited from Plot
(via ResponsivePlot
):
Method | save |
Saves the plot. |
Method | _repr |
Undocumented |
Recommends a link type for the given info.
Parameters | |
labelNone | the label field, if any |
samples:None | the
fiftyone.core.collections.SampleCollection , if known |
Returns | |
a (link_type, label_fields, selection_mode, init_fcn) tuple |
fiftyone.core.plots.matplotlib.InteractiveMatplotlibPlot
, fiftyone.core.plots.plotly.PlotlyInteractivePlot
Undocumented
Registers a callback that can disconnect this plot from a
SessionPlot
connected to it.
The typical use case for this function is to serve as the callback for a disconnect button on the plot.
Parameters | |
callback | a function with no arguments |
Registers a selection callback for this plot.
Selection callbacks are functions that take a single argument containing the list of currently selected IDs.
If a selection callback is registered, this plot should invoke it each time their selection is updated.
Parameters | |
callback | a selection callback |
Registers a callback that can sync this plot with a
SessionPlot
connected to it.
The typical use case for this function is to serve as the callback for a sync button on the plot.
Parameters | |
callback | a function with no arguments |
Selects the points with the given IDs in this plot.
Parameters | |
ids | a list of IDs, or None to reset the plot to its default state |
view:None | the fiftyone.core.view.DatasetView
corresponding to the given IDs, if available |
fiftyone.core.plots.plotly.InteractiveHeatmap
A fiftyone.core.collections.SampleCollection
defining the
initial view from which to derive selection views when points are
selected in the plot.
This view will also be shown when the plot is in its default state (no selection).
A list of IDs of the currently selected points.
An empty list means all points are deselected, and None means default state (nothing selected or unselected).
If the plot is not connected, returns None.
The current selection mode of the plot.
This property controls how the current view is updated in response to
updates from InteractivePlot
instances that are linked to
labels or frames.
When link_type is "frames", the supported values are:
- "select": show video samples with labels only for the selected frames
- "match": show unfiltered video samples containing at least one selected frame
- "frames": show only the selected frames in a frames view
When link_type is "labels", the supported values are:
- "select": show only the selected labels
- "match": show unfiltered samples containing at least one selected label
- "patches": show the selected labels in a patches view
Note
In order to use "patches" selection mode, you must have
provided an init_fcn when constructing this plot that defines
how to create the base patches view. This usually involves
to_patches()
or
to_evaluation_patches()
Note
In order to use "frames" selection mode, you must have
provided an init_fcn when constructing this plot that defines
how to create the base frames view. This usually involves
to_frames()