class InteractiveHeatmap(PlotlyInteractivePlot): (source)
Constructor: InteractiveHeatmap(Z, ids, xlabels, ylabels, ...)
An interactive Plotly heatmap.
Unfortunately, the Plotly team has not gotten around to adding native selection utilities to plot types such as heatmaps: https://github.com/plotly/plotly.js/issues/170.
In lieu of this feature, we provide a homebrewed heatmap that supports two types of interactivity:
- Individual cells can be selected by clicking on them
- Groups of cells can be lasso- or box-selected by including their cell centers in a selection
The following events will cause the selection to be cleared:
- Clicking any cell, if there are currently multiple cells selected
- Clicking the selected cell, if there is only one cell selected
When heatmap contents are selected via
InteractiveHeatmap.select_ids
, the heatmap is updated to reflect
the proportions of each cell included in the selection.
Parameters | |
Z | a num_cols x num_rows array-like of heatmap values |
ids | an array-like of same shape as Z whose elements contain lists of IDs for the heatmap cells |
xlabels | a num_rows array of x labels |
ylabels | a num_cols array of y labels |
zlim | a [zmin, zmax] limit to use for the colorbar |
values | the semantic meaning of the heatmap values. Used for tooltips |
gt | the name of the ground truth field, if known. Used for tooltips |
pred | the name of the predictions field, if known. Used for tooltips |
colorscale | a plotly colorscale to use |
grid | an opacity value for the grid points |
bg | an opacity value for background (unselected) cells |
**kwargs | keyword arguments for the
fiftyone.core.plots.base.InteractivePlot constructor |
Method | __init__ |
Undocumented |
Instance Variable | bg |
Undocumented |
Instance Variable | colorscale |
Undocumented |
Instance Variable | grid |
Undocumented |
Instance Variable | gt |
Undocumented |
Instance Variable | ids |
Undocumented |
Instance Variable | pred |
Undocumented |
Instance Variable | values |
Undocumented |
Instance Variable | xlabels |
Undocumented |
Instance Variable | ylabels |
Undocumented |
Instance Variable | Z |
Undocumented |
Instance Variable | zlim |
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 | supports |
Whether this plot supports automatic updates in response to session changes. |
Method | _connect |
Undocumented |
Method | _deselect |
Undocumented |
Method | _disconnect |
Undocumented |
Method | _init |
Undocumented |
Method | _make |
Undocumented |
Method | _make |
Undocumented |
Method | _on |
Undocumented |
Method | _on |
Undocumented |
Method | _reopen |
Undocumented |
Method | _select |
Undocumented |
Method | _select |
Undocumented |
Method | _update |
Undocumented |
Instance Variable | _bgw |
Undocumented |
Instance Variable | _cells |
Undocumented |
Instance Variable | _curr |
Undocumented |
Instance Variable | _curr |
Undocumented |
Instance Variable | _curr_ |
Undocumented |
Instance Variable | _curr |
Undocumented |
Instance Variable | _figure |
Undocumented |
Instance Variable | _gridw |
Undocumented |
Instance Variable | _selected |
Undocumented |
Instance Variable | _selectedw |
Undocumented |
Instance Variable | _widget |
Undocumented |
Property | _selected |
Undocumented |
Inherited from PlotlyInteractivePlot
:
Method | show |
Shows the plot. |
Method | update |
Updates the layout of the plot. |
Inherited from PlotlyWidgetMixin
(via PlotlyInteractivePlot
):
Method | save |
Saves the plot as an image or HTML. |
Method | _freeze |
Undocumented |
Method | _screenshot |
Undocumented |
Method | _show |
Undocumented |
Method | _update |
Undocumented |
Instance Variable | _handle |
Undocumented |
Inherited from InteractivePlot
(via PlotlyInteractivePlot
, PlotlyWidgetMixin
):
Static Method | recommend |
Recommends a link type for the given info. |
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 | 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 |
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 |
Inherited from ResponsivePlot
(via PlotlyInteractivePlot
, PlotlyWidgetMixin
, InteractivePlot
):
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. |
Property | is |
Whether this plot is currently connected. |
Property | is |
Whether this plot is currently disconnected. |
Property | is |
Whether this plot is currently frozen. |
Instance Variable | _connected |
Undocumented |
Instance Variable | _disconnected |
Undocumented |
Instance Variable | _frozen |
Undocumented |
Instance Variable | _link |
Undocumented |
Inherited from Plot
(via PlotlyInteractivePlot
, PlotlyWidgetMixin
, InteractivePlot
, ResponsivePlot
):
Method | _repr |
Undocumented |
Undocumented
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).