Widgets




class pandas_visual_analysis.widgets.registry.WidgetClassRegistry(*args, **kwargs)[source]

The WidgetClassRegistry contains all names and the corresponding classes of the widgets that have been registered.

The registry keeps track of all widgets.

add(cls)[source]

Adds a widget to the registry. The class has to end with ‘Widget’ in order to be registered, which is then removed from the name. This means ‘TestWidget’ will be registered as ‘Test’.

Parameters

cls – Widget class to add.

Raises

ValueError – if class name does not end with ‘Widget’

get_widget_class(name)[source]

Gets the class of a widget that has been registered.

Parameters

name (str) – Class name of the widget without the ‘Widget’-suffix.

Raises

KeyError – if the name was not registered.

Returns

Returns the class of the widget.

has_widget(name)[source]

Checks if a widget has been registered by name.

Parameters

name (str) – Class name of the widget.

Return type

bool

Returns

True iff the widget name is contained in the registry, False otherwise.

property widget_list
Return type

List[str]

Returns

Returns the list of names of all widgets registered in this object.

property widget_set
Return type

Set[str]

Returns

The set of names of all widgets registered in this object.

pandas_visual_analysis.widgets.registry.register_widget(cls)[source]

Class decorator to add a widget class to the widget registry.

Parameters

cls – The class to add. The class name has to end in ‘Widget’.

Returns

The widget class.