#-----------------------------------------------------------------------------# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.# All rights reserved.## The full license is in the file LICENSE.txt, distributed with this software.#-----------------------------------------------------------------------------''' Display a variety of visual shapes whose attributes can be associatedwith data columns from ``ColumnDataSources``.All these glyphs share a minimal common interface through their base class``Glyph``:.. autoclass:: Glyph :members:'''#-----------------------------------------------------------------------------# Boilerplate#-----------------------------------------------------------------------------from__future__importannotationsimportlogging# isort:skiplog=logging.getLogger(__name__)#-----------------------------------------------------------------------------# Imports#-----------------------------------------------------------------------------# Bokeh importsfrom..core.has_propsimportabstractfrom..core.propertiesimportInstance,Listfrom..modelimportModelfrom.graphicsimportDecoration#-----------------------------------------------------------------------------# Globals and constants#-----------------------------------------------------------------------------__all__=('ConnectedXYGlyph','Glyph','XYGlyph',)#-----------------------------------------------------------------------------# General API#-----------------------------------------------------------------------------
[docs]@abstractclassGlyph(Model):''' Base class for all glyph models. '''# explicit __init__ to support Init signaturesdef__init__(self,*args,**kwargs)->None:super().__init__(*args,**kwargs)decorations=List(Instance(Decoration),default=[],help=""" A collection of glyph decorations, e.g. arrow heads. Use ``GlyphRenderer.add_decoration()`` for easy setup for all glyphs of a glyph renderer. Use this property when finer control is needed. .. note:: Decorations are only for aiding visual appearance of a glyph, but they don't participate in hit testing, etc. """)
@abstractclassXYGlyph(Glyph):''' Base class of glyphs with `x` and `y` coordinate attributes. '''# explicit __init__ to support Init signaturesdef__init__(self,*args,**kwargs)->None:super().__init__(*args,**kwargs)@abstractclassConnectedXYGlyph(XYGlyph):''' Base class of glyphs with `x` and `y` coordinate attributes and a connected topology. '''# explicit __init__ to support Init signaturesdef__init__(self,*args,**kwargs)->None:super().__init__(*args,**kwargs)@abstractclassLineGlyph(Glyph):''' Glyphs with line properties '''# explicit __init__ to support Init signaturesdef__init__(self,*args,**kwargs)->None:super().__init__(*args,**kwargs)@abstractclassFillGlyph(Glyph):''' Glyphs with fill properties '''# explicit __init__ to support Init signaturesdef__init__(self,*args,**kwargs)->None:super().__init__(*args,**kwargs)@abstractclassTextGlyph(Glyph):''' Glyphs with text properties '''# explicit __init__ to support Init signaturesdef__init__(self,*args,**kwargs)->None:super().__init__(*args,**kwargs)@abstractclassHatchGlyph(Glyph):''' Glyphs with Hatch properties '''# explicit __init__ to support Init signaturesdef__init__(self,*args,**kwargs)->None:super().__init__(*args,**kwargs)#-----------------------------------------------------------------------------# Dev API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Private API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Code#-----------------------------------------------------------------------------