Skip to content

Marks

bqplot.marks

Bars

Bases: Mark

Bar mark.

Warning

In the case of the Bars mark, scales for 'x' and 'y' must be provided. The scales of other data attributes are optional. In the case where another data attribute than 'x' or 'y' is provided but the corresponding scale is missing, the data attribute is ignored.

Data Attributes
ATTRIBUTE DESCRIPTION
x

abscissas of the data points (1d array)

TYPE: numpy.ndarray (default: [])

y

ordinates of the values for the data points

TYPE: numpy.ndarray (default: [])

color

color of the data points (1d array). Defaults to default_color when not provided or when a value is NaN

TYPE: numpy.ndarray or None (default: None)

Style Attributes
ATTRIBUTE DESCRIPTION
icon

font-awesome icon for that mark

TYPE: string (class-level attribute)

name

user-friendly name of the mark

TYPE: string (class-level attribute)

color_mode

Specify how default colors are applied to bars. The 'group' mode means colors are assigned per group. If the list of colors is shorter than the number of groups, colors are reused. The 'element' mode means colors are assigned per group element. If the list of colors is shorter than the number of bars in a group, colors are reused. The 'no_group' mode means colors are assigned per bar, discarding the fact that there are groups or stacks. If the list of colors is shorter than the total number of bars, colors are reused.

TYPE: {auto, group, element, no_group}

opacity_mode

Same as the color_mode attribute, but for the opacity.

TYPE: {auto, group, element, no_group}

type

whether 2-dimensional bar charts should appear grouped or stacked.

TYPE: {stacked, grouped}

colors

list of colors for the bars.

TYPE: list of colors (default: ['steelblue'])

orientation

Specifies whether the bar chart is drawn horizontally or vertically. If a horizontal bar chart is drawn, the x data is drawn vertically.

TYPE: {horizontal, vertical}

padding

Attribute to control the spacing between the bars value is specified as a percentage of the width of the bar

TYPE: float (default: 0.05)

fill

Whether to fill the bars or not

TYPE: Bool (default: True)

stroke

Stroke color for the bars

TYPE: Color or None (default: None)

stroke_width

Stroke width of the bars

TYPE: Float (default: 0.)

opacities

Opacities for the bars. Defaults to 1 when the list is too short, or the element of the list is set to None.

TYPE: list of floats (default: [])

base

reference value from which the bars are drawn. defaults to 0.0

TYPE: float (default: 0.0)

align

alignment of bars with respect to the tick value

TYPE: {center, left, right}

label_display

whether or not to display bar data labels

TYPE: bool (default: False)

label_display_format

format for displaying values.

TYPE: string (default: .2f)

label_font_style

CSS style for the text of each cell

TYPE: dict

label_display_vertical_offset

vertical offset value for the label display

TYPE: float

label_display_horizontal_offset

horizontal offset value for the label display

TYPE: float

Note

  • The fields which can be passed to the default tooltip are:
    • All the data attributes
    • index: index of the bar being hovered on
    • sub_index: if data is two dimensional, this is the minor index

Bins

Bases: Bars

Backend histogram mark.

A Bars instance that bins sample data.

It is very similar in purpose to the Hist mark, the difference being that the binning is done in the backend (python), which avoids large amounts of data being shipped back and forth to the frontend. It should therefore be preferred for large data. The binning method is the numpy histogram method.

The following documentation is in part taken from the numpy documentation.

Data Attributes
ATTRIBUTE DESCRIPTION
sample

sample of which the histogram must be computed.

TYPE: numpy.ndarray (default: [])

Style Attributes
ATTRIBUTE DESCRIPTION
icon

font-awesome icon for that mark

TYPE: string (class-level attribute)

name

user-friendly name of the mark

TYPE: string (class-level attribute)

bins

or {'auto', 'fd', 'doane', 'scott', 'rice', 'sturges', 'sqrt'} If bins is an int, it defines the number of equal-width bins in the given range (10, by default). If bins is a string (method name), histogram will use the method chosen to calculate the optimal bin width and consequently the number of bins (see Notes for more detail on the estimators) from the data that falls within the requested range.

TYPE: nonnegative int (default: 10)

density

If False, the height of each bin is the number of samples in it. If True, the height of each bin is the value of the probability density function at the bin, normalized such that the integral over the range is 1. Note that the sum of the histogram values will not be equal to 1 unless bins of unity width are chosen; it is not a probability mass function.

TYPE: bool (default: `False`)

min

The lower range of the bins. If not provided, lower range is simply x.min().

TYPE: float (default: None)

max

The upper range of the bins. If not provided, lower range is simply x.max().

TYPE: float (default: None)

Note

  • The fields which can be passed to the default tooltip are:
    • All the Bars data attributes (x, y, color)
    • index: index of the bin

Boxplot

Bases: Mark

Boxplot marks.

Data Attributes
ATTRIBUTE DESCRIPTION

abscissas of the data points (1d array)

TYPE: numpy.ndarray (default: [])

y

Sample data points (2d array)

TYPE: numpy.ndarray (default: [[]])

Style Attributes
ATTRIBUTE DESCRIPTION
stroke

stroke color of the marker

TYPE: Color or None

color

fill color of the box

TYPE: Color

opacities

Opacities for the markers of the boxplot. Defaults to 1 when the list is too short, or the element of the list is set to None.

TYPE: list of floats (default: [])

outlier-color

color for the outlier

TYPE: color

box_width

width of the box in pixels. The minimum value is 5. If set to None, box_with is auto calculated

TYPE: int (default: None)

auto_detect_outliers

Flag to toggle outlier auto-detection

TYPE: bool (default: True)

FlexLine

Bases: Mark

Lines mark with the possibility to change the line width and color for each segment.

Warning

In the case of the FlexLines mark, scales for 'x' and 'y' must be provided. Scales for the color and width data attributes are optional. In the case where another data attribute than 'x' or 'y' is provided but the corresponding scale is missing, the data attribute is ignored.

Data Attributes
ATTRIBUTE DESCRIPTION
x

abscissas of the data points (1d array)

TYPE: numpy.ndarray (default: [])

y

ordinates of the data points (1d array)

TYPE: numpy.ndarray (default: [])

color

Array controlling the color of the data points

TYPE: numpy.ndarray or None (default: None)

width

Array controlling the widths of the Lines.

TYPE: numpy.ndarray or None (default: None)

Style Attributes
ATTRIBUTE DESCRIPTION
name

user-friendly name of the mark

TYPE: string (class-level attributes)

colors

List of colors for the Lines

TYPE: list of colors (default: CATEGORY10)

stroke_width

Default stroke width of the Lines

TYPE: float (default: 1.5)

Graph

Bases: Mark

Graph with nodes and links.

Data Attributes
ATTRIBUTE DESCRIPTION
x

abscissas of the node data points (1d array)

TYPE: numpy.ndarray (default: [])

y

ordinates of the node data points (1d array)

TYPE: numpy.ndarray (default: [])

color

color of the node data points (1d array).

TYPE: numpy.ndarray or None (default: None)

link_color

link data passed as 2d matrix

TYPE: numpy.ndarray of shape(len(nodes), len(nodes))

Style Attributes
ATTRIBUTE DESCRIPTION
node_data

list of node attributes for the graph

TYPE: List

link_matrix

link data passed as 2d matrix

TYPE: numpy.ndarray of shape(len(nodes), len(nodes))

link_data

list of link attributes for the graph

TYPE: List

charge

charge of force layout. Will be ignored when x and y data attributes are set

TYPE: int (default: -600)

static

whether the graph is static or not

TYPE: bool (default: False)

link_distance

link distance in pixels between nodes. Will be ignored when x and y data attributes are set

TYPE: float (default: 100)

link_type

Enum representing link type

TYPE: {'arc', 'line', 'slant_line'} (default: 'arc')

directed

directed or undirected graph

TYPE: bool (default: True)

highlight_links

highlights incoming and outgoing links when hovered on a node

TYPE: bool (default: True)

colors

list of node colors

TYPE: list (default: CATEGORY10)

GridHeatMap

Bases: Mark

GridHeatMap mark.

Alignment: The tiles can be aligned so that the data matches either the start, the end or the midpoints of the tiles. This is controlled by the align attribute.

Suppose the data passed is a m-by-n matrix. If the scale for the rows is Ordinal, then alignment is by default the mid points. For a non-ordinal scale, the data cannot be aligned to the mid points of the rectangles.

If it is not ordinal, then two cases arise. If the number of rows passed is m, then align attribute can be used. If the number of rows passed is m+1, then the data are the boundaries of the m rectangles.

If rows and columns are not passed, and scales for them are also not passed, then ordinal scales are generated for the rows and columns.

Data Attributes
ATTRIBUTE DESCRIPTION
color

color of the data points (2d array). The number of elements in this array correspond to the number of cells created in the heatmap.

TYPE: numpy.ndarray or None (default: None)

row

labels for the rows of the color array passed. The length of this can be no more than 1 away from the number of rows in color. This is a scaled attribute and can be used to affect the height of the cells as the entries of row can indicate the start or the end points of the cells. Refer to the property row_align. If this property is None, then a uniformly spaced grid is generated in the row direction.

TYPE: numpy.ndarray or None (default: None)

column

labels for the columns of the color array passed. The length of this can be no more than 1 away from the number of columns in color This is a scaled attribute and can be used to affect the width of the cells as the entries of column can indicate the start or the end points of the cells. Refer to the property column_align. If this property is None, then a uniformly spaced grid is generated in the column direction.

TYPE: numpy.ndarray or None (default: None)

Style Attributes
ATTRIBUTE DESCRIPTION
row_align

This is only valid if the number of entries in row exactly match the number of rows in color and the row_scale is not OrdinalScale. start aligns the row values passed to be aligned with the start of the tiles and end aligns the row values to the end of the tiles.

TYPE: Enum([start, end])

column_align

This is only valid if the number of entries in column exactly match the number of columns in color and the column_scale is not OrdinalScale. start aligns the column values passed to be aligned with the start of the tiles and end aligns the column values to the end of the tiles.

TYPE: Enum(['start', end'])

anchor_style

Controls the style for the element which serves as the anchor during selection.

TYPE: dict (default: {})

display_format

format for displaying values. If None, then values are not displayed

TYPE: string (default: None)

font_style

CSS style for the text of each cell

TYPE: dict

HeatMap

Bases: Mark

HeatMap mark.

Data Attributes
ATTRIBUTE DESCRIPTION
color

color of the data points (2d array).

TYPE: numpy.ndarray or None (default: None)

x

labels for the columns of the color array passed. The length of this has to be the number of columns in color. This is a scaled attribute.

TYPE: numpy.ndarray or None (default: None)

y

labels for the rows of the color array passed. The length of this has to be the number of rows in color. This is a scaled attribute.

TYPE: numpy.ndarray or None (default: None)

Hist

Bases: Mark

Histogram mark.

Warning

In the case of the Hist mark, scales for 'sample' and 'count' must be provided.

Data Attributes
ATTRIBUTE DESCRIPTION
sample

sample of which the histogram must be computed.

TYPE: numpy.ndarray (default: [])

count

number of sample points per bin. It is a read-only attribute.

TYPE: ndarray(read - only)

Style Attributes
ATTRIBUTE DESCRIPTION
icon

font-awesome icon for that mark

TYPE: string (class-level attribute)

name

user-friendly name of the mark

TYPE: string (class-level attribute)

bins

number of bins in the histogram

TYPE: nonnegative int (default: 10)

normalized

Boolean attribute to return normalized values which sum to 1 or direct counts for the count attribute. The scale of count attribute is determined by the value of this flag.

TYPE: bool (default: False)

colors

List of colors of the Histogram. If the list is shorter than the number of bins, the colors are reused.

TYPE: list of colors (default: ['steelblue'])

stroke

Stroke color of the histogram

TYPE: Color or None (default: None)

opacities

Opacity for the bins of the histogram. Defaults to 1 when the list is too short, or the element of the list is set to None.

TYPE: list of floats (default: [])

midpoints

midpoints of the bins of the histogram. It is a read-only attribute.

TYPE: list (default: [])

Note

  • The fields which can be passed to the default tooltip are:
    • midpoint: mid-point of the bin related to the rectangle hovered on
    • count: number of elements in the bin hovered on
    • bin_start: start point of the bin
    • bin_end: end point of the bin
    • index: index of the bin

Image

Bases: Mark

Image mark, based on the ipywidgets image

If no scales are passed, uses the parent Figure scales.

Data Attributes
ATTRIBUTE DESCRIPTION
image

Image to be displayed

TYPE: Instance of ipywidgets.Image

x

abscissas of the left and right-hand side of the image in the format (x0, x1)

TYPE: tuple (default: (0, 1))

y

ordinates of the bottom and top side of the image in the format (y0, y1)

TYPE: tuple (default: (0, 1))

Label

Bases: _ScatterBase

Label mark.

Data Attributes
ATTRIBUTE DESCRIPTION
x

horizontal position of the labels, in data coordinates or in figure coordinates

TYPE: numpy.ndarray (default: [])

y

vertical position of the labels, in data coordinates or in figure coordinates

TYPE: numpy.ndarray (default: [])

color

label colors

TYPE: numpy.ndarray or None (default: None)

size

label sizes

TYPE: numpy.ndarray or None (default: None)

rotation

label rotations

TYPE: numpy.ndarray or None (default: None)

opacity

label opacities

TYPE: numpy.ndarray or None (default: None)

Style Attributes
ATTRIBUTE DESCRIPTION
x_offset

horizontal offset in pixels from the stated x location

TYPE: int (default: 0)

y_offset

vertical offset in pixels from the stated y location

TYPE: int (default: 0)

text

text to be displayed

TYPE: string (default: '')

default_size

font size in px, em or ex

TYPE: string (default: '14px')

font_weight

font weight of the caption

TYPE: {bold, normal, bolder}

drag_size

Ratio of the size of the dragged label font size to the default label font size.

TYPE: nonnegative float (default: 1.)

align

alignment of the text with respect to the provided location enable_move: Bool (default: False) Enable the label to be moved by dragging. Refer to restrict_x, restrict_y for more options.

TYPE: {start, middle, end}

restrict_x

Restricts movement of the label to only along the x axis. This is valid only when enable_move is set to True. If both restrict_x and restrict_y are set to True, the label cannot be moved.

TYPE: bool (default: False)

restrict_y

Restricts movement of the label to only along the y axis. This is valid only when enable_move is set to True. If both restrict_x and restrict_y are set to True, the label cannot be moved.

TYPE: bool (default: False)

Lines

Bases: Mark

Lines mark.

Warning

In the case of the Lines mark, scales for 'x' and 'y' must be provided.

Data Attributes
ATTRIBUTE DESCRIPTION
x

abscissas of the data points (1d or 2d array)

TYPE: numpy.ndarray (default: [])

y

ordinates of the data points (1d or 2d array)

TYPE: numpy.ndarray (default: [])

color

colors of the different lines based on data. If it is [], then the colors from the colors attribute are used. Each line has a single color and if the size of colors is less than the number of lines, the remaining lines are given the default colors.

TYPE: numpy.ndarray (default: None)

Style Attributes
ATTRIBUTE DESCRIPTION
icon

Font-awesome icon for the respective mark

TYPE: string (class-level attribute)

name

User-friendly name of the mark

TYPE: string (class-level attribute)

colors

List of colors of the Lines. If the list is shorter than the number of lines, the colors are reused.

TYPE: list of colors (default: CATEGORY10)

close_path

Whether to close the paths or not.

TYPE: bool (default: False)

fill

Fill in the area defined by the curves

TYPE: {none, bottom, top, inside, between}

fill_colors

Fill colors for the areas. Defaults to stroke-colors when no color provided

TYPE: list of colors (default: [])

opacities

Opacity for the lines and patches. Defaults to 1 when the list is too short, or the element of the list is set to None.

TYPE: list of floats (default: [])

fill_opacities

Opacity for the areas. Defaults to 1 when the list is too short, or the element of the list is set to None.

TYPE: list of floats (default: [])

stroke_width

Stroke width of the Lines

TYPE: float (default: 2)

labels_visibility

Visibility of the curve labels

TYPE: {none, label}

curves_subset

If set to None, all the lines are displayed. Otherwise, only the items in the list will have full opacity, while others will be faded.

TYPE: list of integers or None (default: [])

line_style

Line style.

TYPE: {solid, dashed, dotted, dash_dotted}

interpolation

TYPE: {'linear', 'basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open',

'cardinal-closed', 'monotone', 'step-before', 'step-after'}

Interpolation scheme used for interpolation between the data points provided. Please refer to the svg interpolate documentation for details about the different interpolation schemes.

marker

Marker shape

TYPE: {circle, cross, diamond, square, triangle - down, triangle - up, arrow, rectangle, ellipse, plus, crosshair, point}

marker_size

Default marker size in pixels

TYPE: nonnegative int (default: 64)

Note

  • The fields which can be passed to the default tooltip are:
    • name: label of the line
    • index: index of the line being hovered on
    • color: data attribute for the color of the line
  • The following are the events which can trigger interactions:
    • click: left click of the mouse
    • hover: mouse-over an element
  • The following are the interactions which can be linked to the above events:
    • tooltip: display tooltip

Map

Bases: Mark

Map mark.

Data Attributes
ATTRIBUTE DESCRIPTION
color

dictionary containing the data associated with every country for the color scale

TYPE: Dict or None (default: None)

Style Attributes
ATTRIBUTE DESCRIPTION
colors

default colors for items of the map when no color data is passed. The dictionary should be indexed by the id of the element and have the corresponding colors as values. The key default_color controls the items for which no color is specified.

TYPE: Dict (default: {})

selected_styles

TYPE: Dict (default: {'selected_fill': 'Red',

selected_stroke

Dictionary containing the styles for selected subunits

TYPE: None, 'selected_stroke_width': 2.0})

hovered_styles

TYPE: Dict (default: {'hovered_fill': 'Orange',

hovered_stroke

Dictionary containing the styles for hovered subunits

TYPE: None, 'hovered_stroke_width': 2.0})

hover_highlight

boolean to control if the map should be aware of which country is being hovered on.

TYPE: bool (default: True)

map_data

a topojson-formatted dictionary with the objects to map under the key 'subunits'.

TYPE: dict (default: topo_load("map_data/WorldMap.json"))

Mark

Bases: Widget

The base mark class.

Traitlet mark attributes may be decorated with metadata.

Data Attribute Decoration

Data attributes are decorated with the following values:

  • scaled: bool Indicates whether the considered attribute is a data attribute which must be associated with a scale in order to be taken into account.
  • rtype: string Range type of the associated scale.
  • atype: string Key in bqplot's axis registry of the recommended axis type to represent this scale. When not specified, the default is 'bqplot.Axis'.
Style Attributes
ATTRIBUTE DESCRIPTION
display_name

Holds a user-friendly name for the trait attribute.

TYPE: string

mark_types

A registry of existing mark types.

TYPE: dict (class-level attribute)

scales

A dictionary of scales holding scales for each data attribute. - If a mark holds a scaled attribute named 'x', the scales dictionary must have a corresponding scale for the key 'x'. - The scale's range type should be equal to the scaled attribute's range type (rtype).

TYPE: Dict of scales (default: {})

scales_metadata

A dictionary of dictionaries holding metadata on the way scales are used by the mark. For example, a linear scale may be used to count pixels horizontally or vertically. The content of this dictionary may change dynamically. It is an instance-level attribute.

TYPE: Dict (default: {})

preserve_domain

Indicates if this mark affects the domain(s) of the specified scale(s). The keys of this dictionary are the same as the ones of the "scales" attribute, and values are boolean. If a key is missing, it is considered as False.

TYPE: dict (default: {})

display_legend

Display toggle for the mark legend in the general figure legend

TYPE: bool (default: False)

labels

Labels of the items of the mark. This attribute has different meanings depending on the type of mark.

TYPE: list of unicode strings (default: [])

apply_clip

Indicates whether the items that are beyond the limits of the chart should be clipped.

TYPE: bool (default: True)

visible

Visibility toggle for the mark.

TYPE: bool (default: True)

selected_style

CSS style to be applied to selected items in the mark.

TYPE: dict (default: {})

unselected_style

CSS style to be applied to items that are not selected in the mark, when a selection exists.

TYPE: dict (default: {})

selected

Indices of the selected items in the mark.

TYPE: list of integers or None (default: None)

tooltip

Widget to be displayed as tooltip when elements of the scatter are hovered on

TYPE: DOMWidget or None (default: None)

tooltip_style

Styles to be applied to the tooltip widget

TYPE: Dictionary (default: {'opacity': 0.9})

enable_hover

Boolean attribute to control the hover interaction for the scatter. If this is false, the on_hover custom mssg is not sent back to the python side

TYPE: Bool (default: True)

interactions

Dictionary listing the different interactions for each mark. The key is the event which triggers the interaction and the value is the kind of interactions. Keys and values can only take strings from separate enums for each mark.

TYPE: Dictionary (default: {'hover': 'tooltip'})

tooltip_location

Enum specifying the location of the tooltip. 'mouse' places the tooltip at the location of the mouse when the tooltip is activated and 'center' places the tooltip at the center of the figure. If tooltip is linked to a click event, 'mouse' places the tooltip at the location of the click that triggered the tooltip to be visible.

TYPE: {'mouse', 'center'} (default: 'mouse')

METHOD DESCRIPTION
Attributes
----------
on_hover

Register a callback that will be triggered on hover.

on_click

Register a callback that will be triggered on click.

on_legend_hover

Register a callback that will be triggered on legend hover.

on_legend_click

Register a callback that will be triggered on legend click.

on_element_click

Register a callback that will be triggered on element click.

on_background_click

Register a callback that will be triggered on background click.

OHLC

Bases: Mark

Open/High/Low/Close marks.

Data Attributes
ATTRIBUTE DESCRIPTION
x

abscissas of the data points (1d array)

TYPE: ndarray

y

Open/High/Low/Close ordinates of the data points (2d array)

TYPE: ndarrays

Style Attributes
ATTRIBUTE DESCRIPTION
icon

font-awesome icon for that mark

TYPE: string (class-level attribute)

name

user-friendly name of the mark

TYPE: string (class-level attribute)

marker

marker type

TYPE: {candle, bar}

stroke

stroke color of the marker

TYPE: color (default: None)

stroke_width

stroke width of the marker

TYPE: float (default: 1.0)

colors

fill colors for the markers (up/down)

TYPE: List of colors (default: ['limegreen', 'red'])

opacities

Opacities for the markers of the OHLC mark. Defaults to 1 when the list is too short, or the element of the list is set to None.

TYPE: list of floats (default: [])

format

description of y data being passed supports all permutations of the strings 'ohlc', 'oc', and 'hl'

TYPE: string (default: 'ohlc')

Note

  • The fields which can be passed to the default tooltip are:
    • x: the x value associated with the bar/candle
    • open: open value for the bar/candle
    • high: high value for the bar/candle
    • low: low value for the bar/candle
    • close: close value for the bar/candle
    • index: index of the bar/candle being hovered on

Pie

Bases: Mark

Piechart mark.

Data Attributes
ATTRIBUTE DESCRIPTION
sizes

proportions of the pie slices

TYPE: numpy.ndarray (default: [])

color

color of the data points. Defaults to colors when not provided.

TYPE: numpy.ndarray or None (default: None)

Style Attributes
ATTRIBUTE DESCRIPTION
colors

list of colors for the slices.

TYPE: list of colors (default: CATEGORY10)

stroke

stroke color for the marker

TYPE: color (default: 'white')

opacities

Opacities for the slices of the Pie mark. Defaults to 1 when the list is too short, or the element of the list is set to None.

TYPE: list of floats (default: [])

sort

sort the pie slices by descending sizes

TYPE: bool (default: False)

x

horizontal position of the pie center, in data coordinates or in figure coordinates

TYPE: Float (default: 0.5) or Date

y

vertical y position of the pie center, in data coordinates or in figure coordinates

TYPE: Float (default: 0.5)

radius

radius of the pie, in pixels

TYPE: Float

inner_radius

inner radius of the pie, in pixels

TYPE: Float

start_angle

start angle of the pie (from top), in degrees

TYPE: Float (default: 0.0)

end_angle

end angle of the pie (from top), in degrees

TYPE: Float (default: 360.0)

display_labels

label display options

TYPE: {'none', 'inside', 'outside'} (default: 'inside')

display_values

if True show values along with labels

TYPE: bool (default: False)

values_format

format for displaying values

TYPE: string (default: '.2f')

label_color

color of the labels

TYPE: Color or None (default: None)

font_size

label font size in px, em or ex

TYPE: string (default: '14px')

font_weight

label font weight

TYPE: {'bold', 'normal', 'bolder'} (default: 'normal')

Scatter

Bases: _ScatterBase

Scatter mark.

Warning

In the case of the Scatter mark, scales for 'x' and 'y' must be provided. The scales of other data attributes are optional. In the case where another data attribute than 'x' or 'y' is provided but the corresponding scale is missing, the data attribute is ignored.

Data Attributes
ATTRIBUTE DESCRIPTION
x

abscissas of the data points (1d array)

TYPE: numpy.ndarray (default: [])

y

ordinates of the data points (1d array)

TYPE: numpy.ndarray (default: [])

color

color of the data points (1d array). Defaults to default_color when not provided or when a value is NaN

TYPE: numpy.ndarray or None (default: None)

opacity

opacity of the data points (1d array). Defaults to default_opacity when not provided or when a value is NaN

TYPE: numpy.ndarray or None (default: None)

size

size of the data points. Defaults to default_size when not provided or when a value is NaN

TYPE: numpy.ndarray or None (default: None)

skew

skewness of the markers representing the data points. Defaults to default_skew when not provided or when a value is NaN

TYPE: numpy.ndarray or None (default: None)

rotation

orientation of the markers representing the data points. The rotation scale's range is [0, 180] Defaults to 0 when not provided or when a value is NaN.

TYPE: numpy.ndarray or None (default: None)

Style Attributes
ATTRIBUTE DESCRIPTION
icon

Font-awesome icon for that mark

TYPE: string (class-level attribute)

name

User-friendly name of the mark

TYPE: string (class-level attribute)

marker

Marker shape

TYPE: {circle, cross, diamond, square, triangle - down, triangle - up, arrow, rectangle, ellipse, plus, crosshair, point}

colors

List of colors of the markers. If the list is shorter than the number of points, the colors are reused.

TYPE: list of colors (default: ['steelblue'])

default_colors

Same as colors, deprecated as of version 0.8.4

TYPE: Deprecated

fill

Whether to fill the markers or not

TYPE: Bool (default: True)

stroke

Stroke color of the marker

TYPE: Color or None (default: None)

stroke_width

Stroke width of the marker

TYPE: Float (default: 1.5)

opacities

Default opacities of the markers. If the list is shorter than the number of points, the opacities are reused.

TYPE: list of floats (default: [1.0])

default_skew

Default skew of the marker. This number is validated to be between 0 and 1.

TYPE: float (default: 0.5)

default_size

Default marker size in pixel. If size data is provided with a scale, default_size stands for the maximal marker size (i.e. the maximum value for the 'size' scale range)

TYPE: nonnegative int (default: 64)

drag_size

Ratio of the size of the dragged scatter size to the default scatter size.

TYPE: nonnegative float (default: 5.)

names

Labels for the points of the chart

TYPE: numpy.ndarray (default: None)

display_names

Controls whether names are displayed for points in the scatter

TYPE: bool (default: True)

label_display_horizontal_offset

Adds an offset, in pixels, to the horizontal positioning of the 'names' label above each data point

TYPE: float (default: None)

label_display_vertical_offset

Adds an offset, in pixels, to the vertical positioning of the 'names' label above each data point

TYPE: float (default: None)

enable_move

Controls whether points can be moved by dragging. Refer to restrict_x, restrict_y for more options.

TYPE: bool (default: False)

restrict_x

Restricts movement of the point to only along the x axis. This is valid only when enable_move is set to True. If both restrict_x and restrict_y are set to True, the point cannot be moved.

TYPE: bool (default: False)

restrict_y

Restricts movement of the point to only along the y axis. This is valid only when enable_move is set to True. If both restrict_x and restrict_y are set to True, the point cannot be moved.

TYPE: bool (default: False)

Note

  • The fields which can be passed to the default tooltip are:
    • All the data attributes (x, y, color, opacity, size, skew, rotation)
    • index: index of the marker being hovered on
  • The following are the events which can trigger interactions:
    • click: left click of the mouse
    • hover: mouse-over an element
  • The following are the interactions which can be linked to the above events:
    • tooltip: display tooltip
    • add: add new points to the scatter (can only linked to click)