Mix-in classes that bulk add groups of properties to Bokeh models.
Some groups of properties often show up in Bokeh models together. For instance, any model that exposes a fill color property for use when rendering will almost always want to expose a fill alpha as well. To reduce boilerplate code and simplify defining models with these sets of properties, use the mix-in classes in this module:
FillProps — properties for fill color and alpha
FillProps
HatchProps — properties for hatching pattern, color, alpha, etc.
HatchProps
LineProps — properties for line color, dashing, width, etc.
LineProps
TextProps — properties for text color, font, etc.
TextProps
To include these properties in a Bokeh model, use the Include property as shown here:
Include
class SomeGlyph(Glyph): fill_props = Include(FillProps, use_prefix=False, help=""" The %s values for the annular wedges. """)
This adds all the fill properties fill_color and fill_alpha to this model with one simple statement. Note that the help string contains a placeholder format %s. When docs for this class are rendered by the bokeh_model Sphinx extension, the placeholder will be replaced with more information specific to each property. The setting use_prefix means that the names of the properties added to SomeGlyph are exactly fill_alpha and fill_color. Some situations require a different usage, for more information see the docs for Include.
fill_color
fill_alpha
use_prefix
SomeGlyph
Properties relevant to rendering fill regions.
Mirrors the BokehJS properties.Fill class.
properties.Fill
property type: NumberSpec
NumberSpec
An alpha value to use to fill paths with.
Acceptable values are floating point numbers between 0 (transparent) and 1 (opaque).
property type: ColorSpec
ColorSpec
A color to use to fill paths with.
Acceptable values are:
any of the 147 named CSS colors, e.g 'green', 'indigo'
'green'
'indigo'
an RGB(A) hex value, e.g., '#FF0000', '#44444444'
'#FF0000'
'#44444444'
a 3-tuple of integers (r,g,b) between 0 and 255
a 4-tuple of (r,g,b,a) where r,g,b are integers between 0..255 and a is between 0..1
Mirrors the BokehJS properties.Hatch class.
properties.Hatch
hatch_alpha
An alpha value to use to hatching with.
hatch_color
A color to use to hatching with.
hatch_pattern
property type: HatchPatternSpec
HatchPatternSpec
Built-in patterns are can either be specified as long names:
blank, dot, ring, horizontal_line, vertical_line, cross, horizontal_dash, vertical_dash, spiral, right_diagonal_line, left_diagonal_line, diagonal_cross, right_diagonal_dash, left_diagonal_dash, horizontal_wave, vertical_wave, criss_cross
or as one-letter abbreviations:
‘ ‘, ‘.’, ‘o’, ‘-‘, ‘|’, ‘+’, ‘”’, ‘:’, ‘@’, ‘/’, ‘', ‘x’, ‘,’, ‘`’, ‘v’, ‘>’, ‘*’
hatch_scale
A rough measure of the ‘size’ of the hatching pattern. Generally speaking, the higher the number, the more spread out the pattern will be.
hatch_weight
A width value for line-strokes used in hatching.
Properties relevant to rendering path operations.
Mirrors the BokehJS properties.Line class.
properties.Line
line_alpha
An alpha value to use to stroke paths with.
line_color
A color to use to stroke paths with.
line_width
Stroke width in units of pixels.
Properties relevant to rendering text.
Mirrors the BokehJS properties.Text class.
properties.Text
Note
There is currently only support for filling text. An interface to stroke the outlines of text has not yet been exposed.
text_alpha
An alpha value to use to fill text with.
text_color
A color to use to fill text with.
ScalarFillProps
property type: Percent
Percent
An alpha value to use to %s with.
property type: Color
Color
ScalarHatchProps
property type: String
String
property type: Size
Size
ScalarLineProps
property type: Float
Float
ScalarTextProps