ScatterWidget

class pandas_visual_analysis.widgets.scatter.ScatterWidget(data_source, row, index, relative_size, max_height)[source]

Bases: pandas_visual_analysis.widgets.base_widget.BaseWidget

The ScatterWidget displays a scatter plot to highlight the relation between two numerical, time-based or categorical dimensions. In addition to selecting the x- and y-axis, it is also possible show an additional dimension as the size.

Parameters
  • data_source (DataSource) – pandas_visual_analysis.data_source.DataSource for the widget.

  • row (int) – The row the widget is in.

  • index (int) – Index of the row the widget is in.

  • relative_size (float) – The space the widget has in a row which is then converted to the width. (e.g. 0.33 => 33%)

  • max_height (int) – height in pixels the plot has to have

build()[source]

This method returns an IPython Widget root node containing all the children for this widget.

observe_brush_indices_change(sender)[source]

This method observes the changes in the brush selection. In order to actually observe changes it has to be registered in set_observers().

Parameters

sender – The instance that sent the signal.

on_deselection(trace, points)[source]

This method implements the behaviour of changes in the deselection of this plot. Should reset the brushed selection of pandas_visual_analysis.data_source.DataSource in order to propagate the change.

Parameters
  • trace – The trace object which triggered the deselection.

  • points – The object containing the points in the ‘point_inds’ field.

on_selection(trace, points, state)[source]

This method implements the behaviour of changes in the selection of this plot. Should set the brushed indices property of pandas_visual_analysis.data_source.DataSource in order to propagate the change.

Parameters
  • trace – The trace object which triggered the selection.

  • points – The object containing the points in the ‘point_inds’ field.

  • state – State of the input device.

set_observers()[source]

This method adds the necessary callbacks to trait changes.