DataMapPlot API Reference

datamapplot.create_plot(data_map_coords, labels=None, *, title=None, sub_title=None, noise_label='Unlabelled', noise_color='#999999', color_label_text=True, color_label_arrows=False, label_wrap_width=16, label_color_map=None, figsize=(12, 12), dynamic_label_size=False, dpi=100.0, force_matplotlib=False, darkmode=False, highlight_labels=None, palette_hue_shift=0.0, palette_hue_radius_dependence=1.0, palette_min_lightness=10, use_medoids=False, cmap=None, marker_color_array=None, **render_plot_kwds)

Create a static plot from data_map_coords with text labels provided by labels. This is the primary function for DataMapPlot and provides the easiest interface to the static plotting functionality. This function provides a number of options, but also passes any further keyword options through to the lower level render_plot function so be sure to check the documentation for render_plot to discover further keyword arguments that can be used here as well.

Parameters:
data_map_coords: ndarray of floats of shape (n_samples, 2)

The 2D coordinates for the data map. Usually this is produced via a dimension reduction technique such as UMAP, t-SNE, PacMAP, PyMDE etc.

labels: ndarray of strings (object) of shape (n_samples,)

A string label each data point in the data map. There should ideally by only up to 64 unique labels. Noise or unlabelled points should have the same label as noise_label, which is “Unlabelled” by default.

title: str or None (optional, default=None)

A title for the plot. If None then no title is used for the plot. The title should be succint; three to seven words.

sub_title: str or None (optional, default=None)

A sub-title for the plot. If None then no sub-title is used for the plot. The sub-title can be significantly longer then the title and provide more information about the plot and data sources.

noise_label: str (optional, default=”Unlabelled”)

The string used in the labels array to identify the unlabelled or noise points in the dataset.

noise_color: str (optional, default=”#999999”)

The colour to use for unlabelled or noise points in the data map. This should usually be a muted or neutral colour to distinguish background points from the labelled clusters.

color_label_text: str or bool (optional, default=True)

Whether to use colours for the text labels generated in the plot. If False then the text labels will default to either black or white depending on darkmode. If a string is provided it should be a valid matplotlib colour specification and all text labels will be this colour.

color_label_arrows: str or bool (optional, default=True)

Whether to use colours for the arrows between the text labels and clusters. If False then the arrows will default to either black or white depending on darkmode. If a string is provided it should eb a valid matplotlib colour specification and all arrows will be this colour.

label_wrap_width: int (optional, default=16)

The number of characters to apply text-wrapping at when creating text labels for display in the plot. Note that long words will not be broken, so you can choose relatively small values if you want tight text-wrapping.

label_color_map: dict or None (optional, default=None)

A colour mapping to use to colour points/clusters in the data map. The mapping should be keyed by the unique cluster labels in labels and take values that are hex-string representations of colours. If None then a colour mapping will be auto-generated.

figsize: (int, int) (optional, default=(12,12))

How big to make the figure in inches (actual pixel size will depend on dpi).

dynamic_label_size: bool (optional, default=False)

Whether to dynamically resize the text labels based on the relative sizes of the clusters. This can be useful to help highlight larger clusters.

dpi: int (optional, default=plt.rcParams[“figure.dpi”])

The dots-per-inch setting usd when rendering the plot.

force_matplotlib: bool (optional, default=False)

Force using matplotlib instead of datashader for rendering the scatterplot of the data map. This can be useful if you wish to have a different marker_type, or variably sized markers based on a marker_size_array, neither of which are supported by the datashader based renderer.

darkmode: bool (optional, default=False)

Whether to render the plot in darkmode (with a dark background) or not.

highlight_labels: list of str or None (optional, default=None)

A list of unique labels that should have their text highlighted in the resulting plot. Arguments supported by render_plot can allow for control over how highlighted labels are rendered. By default they are simply rendered in bold text.

palette_hue_shift: float (optional, default=0.0)

A setting, in degrees clockwise, to shift the hue channel when generating a colour palette and color_mapping for the labels.

palette_hue_radius_dependence: float (optional, default=1.0)

A setting that determines how dependent on the radius the hue channel is. Larger values will result in more hue variation where there are more outlying points.

use_medoids: bool (optional, default=False)

Whether to use medoids instead of centroids to determine the “location” of the cluster, both for the label indicator line, and for palette colouring. Note that medoids are more computationally expensive, especially for large plots, so use with some caution.

cmap: matplotlib cmap or None (optional, default=None)

A linear matplotlib cmap colour map to use as the base for a generated colour mapping. This should be a matplotlib cmap that is smooth and linear, and cyclic (see the colorcet package for some good options). If not a cyclic cmap it will be “made” cyclic by reflecting it. If None then a custom method will be used instead.

**render_plot_kwds

All other keyword arguments are passed through the render_plot which provides significant further control over the aesthetics of the plot.

Returns:
fig: matplotlib.Figure

The figure that the resulting plot is rendered to.

ax: matpolotlib.Axes

The axes contained within the figure that the plot is rendered to.

datamapplot.render_plot(data_map_coords, color_list, label_text, label_locations, label_cluster_sizes, *, title=None, sub_title=None, figsize=(12, 12), dynamic_label_size=False, dynamic_label_size_scaling_factor=0.75, font_family='Roboto', font_weight=400, label_linespacing=0.95, label_font_size=None, label_text_colors=None, label_arrow_colors=None, highlight_colors=None, point_size=1, alpha=1.0, dpi=100.0, label_over_points=False, label_base_radius=None, label_margin_factor=1.5, min_font_size=4.0, max_font_size=24.0, min_font_weight=200, max_font_weight=800, highlight_labels=None, highlight_label_keywords={'fontweight': 1000}, add_glow=True, noise_color='#999999', glow_keywords={'approx_patch_size': 64, 'kernel': 'gaussian', 'kernel_bandwidth': 0.25}, darkmode=False, logo=None, logo_width=0.15, force_matplotlib=False, label_direction_bias=None, marker_type='o', marker_size_array=None, arrowprops={}, title_keywords=None, sub_title_keywords=None, pylabeladjust_speed=None, pylabeladjust_max_iterations=500, pylabeladjust_adjust_by_size=True, pylabeladjust_margin_percentage=7.5, pylabeladjust_radius_scale=1.05, ax=None, verbose=False)

Render a static data map plot with given colours and label locations and text. This is a lower level function, and should usually not be used directly unless there are specific reasons for digging in. This usually involves things like getting direct control over label locations, altering label texts to suit specific needs, or direct control over point colouring in the scatterplot.

All keyword arguments from create_plot are passed on to render_plot, so any keyword arguments here are also valid keyword arguments for create_plot.

Parameters:
data_map_coords: ndarray of floats of shape (n_samples, 2)

The 2D coordinates for the data map. Usually this is produced via a dimension reduction technique such as UMAP, t-SNE, PacMAP, PyMDE etc.

color_list: iterable of str of len n_samples

A list of hex-string colours, one per sample, for colouring points in the scatterplot of the data map.

label_text: list of str

A list of label text strings, one per unique label.

label_locations: ndarray of floats of shape (n_labels, 2)

An array of the “location” (usually centroid) of the cluster of the associated text label (see label_text).

title: str or None (optional, default=None)

A title for the plot. If None then no title is used for the plot. The title should be succint; three to seven words.

sub_title: str or None (optional, default=None)

A sub-title for the plot. If None then no sub-title is used for the plot. The sub-title can be significantly longer then the title and provide more information about the plot and data sources.

figsize: (int, int) (optional, default=(12,12))

How big to make the figure in inches (actual pixel size will depend on dpi).

dynamic_label_size: bool (optional, default=False)

Whether to use dynamic label sizing based on the sizes of the clusters.

dynamic_label_size_scaling_factor: float (optional, default=0.75)

The scaling factor to use when using dynamic label sizing based on the sizes of the clusters.

font_family: str (optional, default=”DejaVu Sans”)

The font_family to use for the plot – the labels and the title and sub-title unless explicitly over-ridden by title_keywords or sub_title_keywords.

label_linespacing: float (optional, default=0.95)

The line-spacing to use when rendering multi-line labels in the plot. The default of 0.95 keeps multi-line labels compact, but can be less than ideal for some fonts.

label_font_size: float or None (optional, default=None)

The font-size (in pts) to use for the text labels in the plot. If this is None then a heuristic will be used to try to find the best font size that can fit all the labels in.

label_text_colors: str or list of str or None (optional, default=None)

The colours of the text labels, one per text label. If None then the text labels will be either black or white depending on darkmode. If just a single string then it is assumed to be a fixed colour for all labels.

label_arrow_colors: str or list of str or None (optional, default=None)

The colours of the arrows between the text labels and clusters, one per text label. If None then the arrows will be either black or white depending on darkmode. If just a single string then it is assumed to be a fixed colour for all arrows.

highlight_colors: list of str or None (optional default=None)

The colours used if text labels are highlighted and a bounding box around the label is used. For example create_plot uses the cluster colours from the colour mapping that was passed or created.

point_size: int or float (optional, default=1)

How big to make points in the scatterplot rendering of the data map. Depending on whether you are in datashader mode or matplotlib mode this can either be an int (datashader) or a float (matplotlib). If in datashader mode this is explicitly the radius, in number of pixels, that each point should be. If in matplotlib mode this is the matplotlib scatterplot size, which can be relative to the plot-size

and other factors.

alpha: float (optional, default=1.0)

The alpha transparency value to use when rendering points.

dpi: int (optional, default=plt.rcParams[“figure.dpi”])

The dots-per-inch to use when rendering the plot.

label_over_points: bool (optional, default=False)

Whether to attempt tom place text labels directly on top of the points in clusters. This can result in severe over-packing, and this is remedied via pylabeladjust which can end up moving labels some distance. For smaller numbers of labels this is likely a good choice, for more than 20 labels this will require a small font. For larger numbers of labels still this may be sub-optimal.

label_base_radius: float or None (optional, default=None)

Labels are placed in rings around the data map. This value can explicitly control the radius (in data coordinates) of the innermost such ring.

label_margin_factor: float (optional, default=1.5)

The expansion factor to use when creating a bounding box around the label text to compute whether overlaps are occurring during the label placement adjustment phase.

min_font_size: float (optional, default=4.0)

The minimum font size to use when estimating the font size for the labels.

max_font_size: float (optional, default=24.0)

The maximum font size to use when estimating the font size for the labels.

min_font_weight: int (optional, default=200)

The minimum font weight to use when using dynamic label sizing (font weights will vary as well).

max_font_weight: int (optional, default=800)

The maximum font weight to use when using dynamic label sizing (font weights will vary as well).

highlight_labels: list of str or None (optional, default=None)

A list of the labels to be highlighted.

highlight_label_keywords: dict (optional, default={“fontweight”: “bold”})

Keywords for how to highlight the labels. This dict will be passed on as keyword arguments to the matplotlib annotate function. See the matplotlib documentation for more details on what can be done.

add_glow: bool (optional, default=True)

Whether to add a glow-effect using KDEs.

noise_color: str (optional, default=”#999999”)

The colour to use for unlabelled or noise points in the data map. This should usually be a muted or neutral colour to distinguish background points from the labelled clusters.

glow_keywords: dict (optional, default={“kernel”: “gaussian”,”kernel_bandwidth”: 0.25})

Keyword arguments that will be passed along to the add_glow_to_scatterplot function. See that function for more details.

darkmode: bool (optional, default=False)

Whether to render the plot in darkmode (with a dark background) or not.

logo: ndarray or None (optional, default=None)

A numpy array representation of an image (suitable for matplotlib’s imshow) to be used as a logo placed in the bottom right corner of the plot.

logo_width: float (optional, default=0.15)

The width, as a fraction of the total figure width, of the logo.

force_matplotlib: bool (optional, default=False)

Force using matplotlib instead of datashader for rendering the scatterplot of the data map. This can be useful if you wish to have a different marker_type, or variably sized markers based on a marker_size_array, neither of which are supported by the datashader based renderer.

label_direction_bias: float or None (optional, default=None)

When placing labels in rings, how much bias to place toward east-west compass points as opposed to north-south. A value of 1.0 provides no bias (uniform placement around the circle). Values larger than one will place more labels ion the east-west areas.

marker_type: str (optional, default=”o”)

The type of marker to use for rendering the scatterplot. This is only valid if matplotlib mode is being used. Valid marker_types are any matplotlib marker string. See the matplotlib marker documentation for more details.

marker_size_array: ndarray of shape (n_samples,) or None (optional, default=None)

The (variable) size or markers to use. This is only valid if matplotlib mode is being used. This should be an array of (matplotlib) marker sizes as you would use for the s argument in matplotlib.pyplot.scatterplot.

arrowprops: dict (optional default={})

A dict of keyword argumetns to pass through to the arrowprops argument of matplotlib.pyplot.annotate. This allows for control of arrow-styles, connection-styles, linewidths, colours etc. See the documentation of matplotlib’s annotate function for more details.

title_keywords: dict or None (optional, default=None)

A dictionary of keyword arguments to pass through to matplotlib’s suptitle fucntion. This includes things like fontfamily, fontsize, fontweight, color, etc.

sub_title_keywords: dict or None (optional, default=None)

A dictionary of keyword arguments to pass through to matplotlib’s title fucntion. This includes things like fontfamily, fontsize, fontweight, color, etc.

pylabeladjust_speed: None or float (optional, default=None)

pylabeladjust speed for adjusting label positioning when doing labels over points. If label_over_points is False then this will have no effect. If None then a good choice of speed will be approximated from the data.

pylabeladjust_max_iterations: int (optional, default=500)

The maximum number of pylabeladjust iterations for adjusting label positioning when doing labels over points. If label_over_points is False then this will have no effect.

pylabeladjust_adjust_by_size: bool (optional, default=True)

Whether to adjust the labels based on the size of the rectangles for adjusting label positioning when doing labels over points. If label_over_points is False then this will have no effect.

pylabeladjust_margin_percentage: float (optional, default=7.5)

The margin percentage for the repulsion radius for adjusting label positioning when doing labels over points. If label_over_points is False then this will have no effect.

pylabeladjust_radius_scale: float (optional, default=1.05)

The scale factor for the repulsion radius for adjusting label positioning when doing labels over points. If label_over_points is False then this will have no effect.

verbose: bool (optional, default=False)

Print progress as the plot is being created.

ax: None or matplotlib.axes (optional, default=None)

If not None, render the plot to this axis, otherwise create a new figure and axis.

Returns:
fig: matplotlib.Figure

The figure that the resulting plot is rendered to.

ax: matpolotlib.Axes

The axes contained within the figure that the plot is rendered to.

datamapplot.create_interactive_plot(data_map_coords, *label_layers, hover_text=None, inline_data=True, noise_label='Unlabelled', noise_color='#999999', color_label_text=True, label_wrap_width=16, label_color_map=None, width='100%', height=800, darkmode=False, palette_hue_shift=0.0, palette_hue_radius_dependence=1.0, cmap=None, marker_size_array=None, marker_color_array=None, use_medoids=False, cluster_boundary_polygons=False, color_cluster_boundaries=True, polygon_alpha=0.1, **render_html_kwds)
Parameters:
data_map_coords: ndarray of floats of shape (n_samples, 2)

The 2D coordinates for the data map. Usually this is produced via a dimension reduction technique such as UMAP, t-SNE, PacMAP, PyMDE etc.

*label_layers: np.ndarray

All remaining positional arguments are assumed to be labels, each at a different level of resolution. Ideally these should be ordered such that the most fine-grained resolution is first, and the coarsest resolution is last. The individual labels-layers should be formatted the same as for create_plot.

hover_text: list or np.ndarray or None (optional, default=None)

An iterable (usually a list of numpy array) of text strings, one for each data point in data_map_coords that can be used in a tooltip when hovering over points.

inline_data: bool (optional, default=True)

Whether to include data inline in the HTML file (compressed and base64 encoded) of whether to write data to separate files that will then be referenced by the HTML file – in the latter case you will need to ensure all the files are co-located and served over an http server or similar. Inline is the best default choice for easy portability and simplicity, but can result in very large file sizes.

noise_label: str (optional, default=”Unlabelled”)

The string used in the labels array to identify the unlabelled or noise points in the dataset.

noise_color: str (optional, default=”#999999”)

The colour to use for unlabelled or noise points in the data map. This should usually be a muted or neutral colour to distinguish background points from the labelled clusters.

color_label_text: bool (optional, default=True)

Whether to use colours for the text labels generated in the plot. If False then the text labels will default to either black or white depending on darkmode.

label_wrap_width: int (optional, default=16)

The number of characters to apply text-wrapping at when creating text labels for display in the plot. Note that long words will not be broken, so you can choose relatively small values if you want tight text-wrapping.

label_color_map: dict or None (optional, default=None)

A colour mapping to use to colour points/clusters in the data map. The mapping should be keyed by the unique cluster labels in labels and take values that are hex-string representations of colours. If None then a colour mapping will be auto-generated.

width: int or str (optional, default=”100%”)

The width of the plot when rendered in a notebook. This should be a valid HTML iframe width specification – either an integer number of pixels, or a string that can be properly interpreted in HTML.

height: int or str (optional, default=800)

The height of the plot when rendered in a notebook. This should be a valid HTML iframe height specification – either an integer number of pixels, or a string that can be properly interpreted in HTML.

darkmode: bool (optional, default=False)

Whether to render the plot in darkmode (with a dark background) or not.

palette_hue_shift: float (optional, default=0.0)

A setting, in degrees clockwise, to shift the hue channel when generating a colour palette and color_mapping for the labels.

palette_hue_radius_dependence: float (optional, default=1.0)

A setting that determines how dependent on the radius the hue channel is. Larger values will result in more hue variation where there are more outlying points.

cmap: matplotlib cmap or None (optional, default=None)

A linear matplotlib cmap colour map to use as the base for a generated colour mapping. This should be a matplotlib cmap that is smooth and linear, and cyclic (see the colorcet package for some good options). If not a cyclic cmap it will be “made” cyclic by reflecting it. If None then a custom method will be used instead.

marker_size_array: np.ndarray or None (optional, default=None)

An array of sizes for each of the points in the data map scatterplot.

use_medoids: bool (optional, default=False)

Whether to use medoids instead of centroids to determine the “location” of the cluster, both for the label indicator line, and for palette colouring. Note that medoids are more computationally expensive, especially for large plots, so use with some caution.

cluster_boundary_polygons: bool (optional, default=False)

Whether to draw alpha-shape generated boundary lines around clusters. This can be useful in highlighting clusters at different resolutions when using many different label_layers.

polygon_alpha: float (optional, default=0.1)

The alpha value to use when genrating alpha-shape based boundaries around clusters.

**render_html_kwds:

All other keyword arguments will be passed through the render_html function. Please see the docstring of that function for further options that can control the aesthetic results.

Returns:
datamapplot.render_html(point_dataframe, label_dataframe, inline_data=True, title=None, sub_title=None, title_font_size=36, sub_title_font_size=18, text_collision_size_scale=3, text_min_pixel_size=18, text_max_pixel_size=36, font_family='Roboto', font_weight=900, tooltip_font_family=None, tooltip_font_weight=300, logo=None, logo_width=256, color_label_text=True, line_spacing=0.95, min_fontsize=18, max_fontsize=28, text_outline_width=8, text_outline_color='#eeeeeedd', point_hover_color='#aa0000bb', point_radius_min_pixels=0.01, point_radius_max_pixels=24, point_line_width_min_pixels=0.1, point_line_width_max_pixels=8, point_line_width=0.001, cluster_boundary_line_width=1, initial_zoom_fraction=1.0, background_color=None, darkmode=False, offline_data_prefix=None, tooltip_css=None, hover_text_html_template=None, extra_point_data=None, enable_search=False, search_field='hover_text', on_click=None, custom_html=None, custom_css=None, custom_js=None)

Given data about points, and data about labels, render to an HTML file using Deck.GL to provide an interactive plot that can be zoomed, panned and explored.

Parameters:
point_dataframe: pandas.DataFrame

A Dataframe containing point information for rendering. At a minimum this should include columns “x”, “y”, “r”, “g”, “b” and “a” that provide the x,y position and r,g,b color for each point. Note that r,g,b,a values should be uint8 values.

label_dataframe: pandas.DataFrame

A Dataframe containing information about labels, and optionally bounding polygons, of clusters. At a minimum this should include columns “x”, “y”, “r”, “g”, “b” and “a” that provide the x,y position and r,g,b colour of the label.

inline_data: bool (optional, default=True)

Whether to include data inline in the HTML file (compressed and base64 encoded) of whether to write data to separate files that will then be referenced by the HTML file – in the latter case you will need to ensure all the files are co-located and served over an http server or similar. Inline is the best default choice for easy portability and simplicity, but can result in very large file sizes.

title: str or None (optional, default=None)

A title for the plot, to be placed in the top left corner. The title should be brief and to the point. More detail can be provided in the sub_title if required.

sub_title: str or None (optional, default=None)

A sub_title for the plot, to be placed in the top left corner.

title_font_size: int (optional, default=36)

The font-size of the title in points.

sub_title_font_size: int (optional, default=18)

The font-size of the sub-title in points.

text_collision_size_scale: float (optional, default=3.0)

How to scale text labels for the purpose of collision detection to determine which labels to display.

text_min_pixel_size: float (optional, default=12.0)

The minimum pixel size of label text. If text would be smaller than this in size then render the text to be at least this size.

text_max_pixel_size: float (optional, default=36.0)

The maximum pixel size of label text. If text would be larger than this in size then render the text to be at most this size.

font_family: str (optional, default=”Roboto”)

The font family to use for label text and titles. If the font family is a google font then the required google font api handling will automatically make the font available, so any google font family is acceptable.

font_weight: str or int (optional, default=900)

The font weight to use for the text labels within the plot. Either weight specification such as “thin”, “normal”, or “bold” or an integer value between 0 (ultra-thin) and 1000 (ultra-black).

tooltip_font_family: str (optional default=”Roboto”)

The font family to use in tooltips/hover text. If the font family is a google font then the required google font api handling will automatically make the font available, so any google font family is acceptable.

tooltip_font_weight: str or int (optional, default=400)

The font weight to use for the tooltip /hover text within the plot. Either weight specification such as “thin”, “normal”, or “bold” or an integer value between 0 (ultra-thin) and 1000 (ultra-black).

logo: str or None (optional, default=None)

A logo image to include in the bottom right corner of the map. This should be a URL to the image.

logo_width: int (optional, default=256)

The width, in pixels, of the logo to be included in the bottom right corner. The logo will retain it’s aspect ratio, so choose the width accordingly.

color_label_text: bool (optional, default=True)

Whether the text labels for clusters should be coloured or not. If set to False the labels will be either black or white depending on whether darkmode is set.

line_spacing: float (optional, default=0.95)

Line height spacing in label text.

min_fontsize: float (optional, default=12)

The minimum font size (in points) of label text. In general label text is scaled based on the size of the cluster the label if for; this will set the minimum value for that scaling.

max_fontsize: float (optional, default=24)

The maximum font size (in points) of label text. In general label text is scaled based on the size of the cluster the label if for; this will set the maximum value for that scaling.

text_outline_width: float (optional, default=8)

The size of the outline around the label text. The outline, in a contrasting colour, can make text more readable against the map background. Choosing larger sizes can help if text is less legible.

text_outline_color: str (optional, default=”#eeeeeedd”)

The colour of the outline around the label text. The outline should be a contrasting colour to the colour of the label text. By default this is white when darkmode is False and black when darkmode is True.

point_hover_color: str (optional, default=”#aa0000bb”)

The colour of the highlighted point a user is hovering over.

point_radius_min_pixels: float (optional, default=0.01)

The minimum number of pixels in radius of the points in the map; if zoomed out enough that a point would be smaller than this, it is instead rendered at this radius. This allows points to remain visible when zoomed out.

point_radius_max_pixels: float (optional, default=24)

The maximum number of pixels in radius of the points in the map; if zoomed in enough that a point would be larger than this, it is instead rendered at this radius. This allows zooming in to differentiate points that are otherwise overtop of one

another.

point_line_width_min_pixels: float (optional, default=0.1)

The minimum pixel width of the outline around points.

point_line_width_max_pixels: float (optional, default=8)

The maximum pixel width of the outline around points.

point_line_width: float (optional, default=0.001)

The absolute line-width in common coordinates of the outline around points.

cluster_boundary_line_width: float (optional, default=1.0)

The linewidth to use for cluster boundaries. Note that cluster boundaries scale with respect to cluster size, so this is a scaling factor applied over this.

initial_zoom_fraction: float (optional, default=1.0)

The fraction of the total zoom (containing allm the data) to start the map in. A lower value will initialize the plot zoomed in, while values larger than 1.0 will result in the initial start point being zoomed out.

background_color: str or None (optional, default=None)

A background colour (as a hex-string) for the data map. If None a background colour will be chosen automatically based on whether darkmode is set.

darkmode: bool (optional, default=False)

Whether to use darkmode.

offline_data_prefix: str or None (optional, default=None)

If inline_data=False a number of data files will be created storing data for the plot and referenced by the HTML file produced. If not none then this will provide a prefix on the filename of all the files created.

tooltip_css: str or None (optional, default=None)

Custom CSS used to fine the properties of the tooltip. If None a default CSS style will be used. This should simply be the required CSS directives specific to the tooltip.

hover_text_html_template: str or None (optional, default=None)

An html template allowing fine grained control of what is displayed in the hover tooltip. This should be HTML with placeholders of the form {hover_text} for the supplied hover text and {column_name} for columns from extra_point_data (see below).

extra_point_data: pandas.DataFrame or None (optional, default=None)

A dataframe of extra information about points. This should be a dataframe with one row per point. The information in this dataframe can be referenced by column-name by either hover_text_html_template or on_click for use in tooltips or on-click actions.

enable_search: bool (optional, default=False)

Whether to enable a text search that can highlight points with hover_text that include the given search string.

search_field: str (optional, default=”hover_text”)

If enable_search is True and extra_point_data is not None, then search this column of the extra_point_data dataframe, or use hover_text if set to "hover_text".

on_click: str or None (optional, default=None)

A javascript action to be taken if a point in the data map is clicked. The javascript can reference {hover_text} or columns from extra_point_data. For example one could provide "window.open(`http://google.com/search?q="{hover_text}"`)" to open a new window with a google search for the hover_text of the clicked point.

custom_css: str or None (optional, default=None)

A string of custom CSS code to be added to the style header of the output HTML. This can be used to provide custom styling of other features of the output HTML as required.

custom_html: str or None (optional, default=None)

A string of custom HTML to be added to the body of the output HTML. This can be used to add other custom elements to the interactive plot, including elements that can be interacted with via the on_click action for example.

custom_js: str or None (optional, default=None)

A string of custom Javascript code that is to be added after the code for rendering the scatterplot. This can include code to interact with the plot which is stored as deckgl.

Returns:
interactive_plot: InteractiveFigure

An interactive figure with hover, pan, and zoom. This will display natively in a notebook, and can be saved to an HTML file via the save method.