Widget

class Widget(type, id=None, placement=None, view_id=None, **kwargs)

Bases: JSONMixin

Represents a deck.gl widget, which are UI components around the WebGL2/WebGPU canvas to offer controls and information for a better user experience.

Please see the deck.gl Widget catalog to determine the particular parameters of your widget.

Parameters:
  • type (str, default None) – deck.gl widget to display, e.g., CompassWidget

  • id (str, default None) – Unique name for widget

  • placement (str, default top-left) – Placement of the widget on the map. Options are top-left, top-right, bottom-left, bottom-right, and fill. Note that not all widgets support custom placement.

  • view_id (str, default None) – ID of the view to which the widget should be added. The widget will be added to the default view if not specified. Note that not all widgets support custom view_id.

  • **kwargs – Any of the parameters passable to a deck.gl widget.

property type

The pydeck.Widget object follows the same convention as pydeck.Layer for styling keyword arguments and the type positional argument. Read Understanding keyword arguments in pydeck layers documentation for more information.