BoxPlotWidget

class pandas_visual_analysis.widgets.boxplot.BoxPlotWidget(data_source, row, index, relative_size, max_height)[source]

Bases: pandas_visual_analysis.widgets.base_widget.BaseWidget

The BoxPlotWidget displays a box plot for a single column with additional information of mean and standard deviation as a diamond. Per default the plot shows all the points side-by-side in order to select points. This behaviour can be changed to show only the outliers as points or no points at all.

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

apply_size_constraints(widget)[source]

Adds styling to a widget to control the height, width, margin, padding and border. Sets min and max_width to conform to the relative size of the widget, minus the margin. Sets min and max_width to conform to the max_height parameter. Adds a margin to the widget and also a padding with the same size.

Parameters

widget – An IPython widget to which the layout should be applied.

Returns

The same widget with updated layout.

build()[source]

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

Return type

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.