#-----------------------------------------------------------------------------# Copyright (c) Anaconda, Inc., and Bokeh Contributors.# All rights reserved.## The full license is in the file LICENSE.txt, distributed with this software.#-----------------------------------------------------------------------------''' Provide a base class for all Bokeh widget models.In addition to different kinds of plots, various kinds of UI controls (e.g.sliders, buttons, inputs, etc.) can be included in Bokeh documents. Thesewidgets can be used in conjunction with ``CustomJS`` callbacks that executein the browser, or with python callbacks that execute on a Bokeh server.'''#-----------------------------------------------------------------------------# Boilerplate#-----------------------------------------------------------------------------from__future__importannotationsimportlogging# isort:skiplog=logging.getLogger(__name__)#-----------------------------------------------------------------------------# Imports#-----------------------------------------------------------------------------# Standard library importsfromtypingimportAny# Bokeh importsfrom...core.has_propsimportabstractfrom...core.propertiesimportOverridefrom..layoutsimportLayoutDOM#-----------------------------------------------------------------------------# Globals and constants#-----------------------------------------------------------------------------__all__=('Widget',)#-----------------------------------------------------------------------------# General API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Dev API#-----------------------------------------------------------------------------
[docs]@abstractclassWidget(LayoutDOM):''' A base class for all interactive widget types. '''# explicit __init__ to support Init signaturesdef__init__(self,*args:Any,**kwargs:Any)->None:super().__init__(*args,**kwargs)margin=Override(default=5)