Source code for bokeh.models.annotations.annotation
#-----------------------------------------------------------------------------# Copyright (c) Anaconda, Inc., and Bokeh Contributors.# All rights reserved.## The full license is in the file LICENSE.txt, distributed with this software.#-----------------------------------------------------------------------------''''''#-----------------------------------------------------------------------------# Boilerplate#-----------------------------------------------------------------------------from__future__importannotationsimportlogging# isort:skiplog=logging.getLogger(__name__)#-----------------------------------------------------------------------------# Imports#-----------------------------------------------------------------------------# Bokeh importsfrom...core.has_propsimportabstractfrom...core.propertiesimportInstance,InstanceDefault,Overridefrom..renderers.rendererimportCompositeRendererfrom..sourcesimportColumnDataSource,DataSource#-----------------------------------------------------------------------------# Globals and constants#-----------------------------------------------------------------------------__all__=('Annotation',)#-----------------------------------------------------------------------------# General API#-----------------------------------------------------------------------------
[docs]@abstractclassAnnotation(CompositeRenderer):''' Base class for all annotation models. '''# explicit __init__ to support Init signaturesdef__init__(self,*args,**kwargs)->None:super().__init__(*args,**kwargs)level=Override(default="annotation")
@abstractclassDataAnnotation(Annotation):''' Base class for annotations that utilize a data source. '''# explicit __init__ to support Init signaturesdef__init__(self,*args,**kwargs)->None:super().__init__(*args,**kwargs)source=Instance(DataSource,default=InstanceDefault(ColumnDataSource),help=""" Local data source to use when rendering annotations on the plot. """)#-----------------------------------------------------------------------------# Dev API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Private API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Code#-----------------------------------------------------------------------------