Common enumerations to be used together with Enum property.
Enum
This module provides many pre-defined enumerations, as well as functions for creating new enumerations.
New enumerations can be created using the enumeration() function:
enumeration()
#: Specify a nautically named side, port or starboard MyEnum = enumeration("port", "starboard")
Typically, enumerations are used to define Enum properties:
from bokeh.model import Model from bokeh.core.properties import Enum class MyModel(Model): location = Enum(MyEnum, help=""" Whether the thing should be a port or starboard. """)
Enumerations have a defined order and support iteration:
>>> for loc in MyEnum: ... print(loc) ... port starboard
as well as containment tests:
>>> "port" in MyEnum True
Enumerations can be easily documented in Sphinx documentation with the bokeh_enum Sphinx extension.
enumeration
Create an enumeration() object from a sequence of values.
Call enumeration with a sequence of (unique) strings to create an Enumeration object:
#: Specify the horizontal alignment for rendering text TextAlign = enumeration("left", "right", "center")
values (str) –
string enumeration values, passed as positional arguments
The order of arguments is the order of the enumeration, and the first element will be considered the default value when used to create Enum properties.
case_sensitive (bool, optional) – Whether validation should consider case or not (default: True)
quote (bool, optional) – Whether values should be quoted in the string representations (default: False)
ValueError if values empty, if any value is not a string or not unique –
Enumeration
Align
Alignment (vertical or horizontal) of a child item
Anchor
Specify an anchor position on a box/frame
AngleUnits
Specify the units for an angle value
ButtonType
Specify a style for button widgets
CalendarPosition
Specify a position for the DatePicker calendar to display
DashPattern
Specify a named dashing patter for stroking lines
DateFormat
Specify a format for printing dates
DatetimeUnits
Specify a date/time scale
Dimension
Specify a vertical/horizontal dimension
Dimensions
Specify a vertical/horizontal dimensions
Direction
Specify a stroke direction for circles, wedges, etc.
FontStyle
Specify the font style for rendering text
HatchPattern
Specify one of the built-in patterns for hatching fills
Enumeration(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)
HatchPatternAbbreviation
Specify one of the built-in patterns for hatching fills with a one-letter abbreviation
The abbreviations are mapped as follows:
" " : blank "." : dot "o" : ring "-" : horizontal_line "|" : vertical_line "+" : cross '"' : horizontal_dash ":" : vertical_dash "@" : spiral "/" : right_diagonal_line "\\" : left_diagonal_line "x" : diagonal_cross "," : right_diagonal_dash "`" : left_diagonal_dash "v" : horizontal_wave ">" : vertical_wave "*" : criss_cross
HoldPolicy
Specify whether events should be combined or collected as-is when a Document hold is in effect
HorizontalLocation
Specify a horizontal location in plot layouts
JitterRandomDistribution
Specify a distribution to use for the Jitter class
LatLon
Specify whether a dimension or coordinate is latitude or longitude
LegendClickPolicy
Specify how a legend should respond to click events
LegendLocation
Specify a fixed location for a Bokeh legend
LineCap
Specify how stroked lines should be terminated
LineDash
Specify a named dash pattern for stroking lines
LineJoin
Specify how stroked lines should be joined together
Location
Specify a location in plot layouts
MapType
Specify a style for a Google map
MarkerType
Specify one of the built-in marker types
Enumeration(asterisk, circle, circle_cross, circle_dot, circle_x, circle_y, cross, dash, diamond, diamond_cross, diamond_dot, dot, hex, hex_dot, inverted_triangle, plus, square, square_cross, square_dot, square_pin, square_x, triangle, triangle_dot, triangle_pin, x, y)
NamedColor
Specify one of the 137 named CSS colors
Enumeration(aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, darkgrey, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, green, greenyellow, grey, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgreen, lightgrey, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen)
NumeralLanguage
Specify a locale for printing numeric values
Orientation
Specify a vertical/horizontal orientation for something
OutputBackend
Specify an output backend to render a plot area onto
PaddingUnits
Whether range padding should be interpreted a percentage or and absolute quantity
Palette
Specify the name of a palette from bokeh.palettes
Enumeration(Accent3, Accent4, Accent5, Accent6, Accent7, Accent8, Blues3, Blues4, Blues5, Blues6, Blues7, Blues8, Blues9, Blues256, BrBG3, BrBG4, BrBG5, BrBG6, BrBG7, BrBG8, BrBG9, BrBG10, BrBG11, BuGn3, BuGn4, BuGn5, BuGn6, BuGn7, BuGn8, BuGn9, BuPu3, BuPu4, BuPu5, BuPu6, BuPu7, BuPu8, BuPu9, Category10_3, Category10_4, Category10_5, Category10_6, Category10_7, Category10_8, Category10_9, Category10_10, Category20_3, Category20_4, Category20_5, Category20_6, Category20_7, Category20_8, Category20_9, Category20_10, Category20_11, Category20_12, Category20_13, Category20_14, Category20_15, Category20_16, Category20_17, Category20_18, Category20_19, Category20_20, Category20b3, Category20b4, Category20b5, Category20b6, Category20b7, Category20b8, Category20b9, Category20b10, Category20b11, Category20b12, Category20b13, Category20b14, Category20b15, Category20b16, Category20b17, Category20b18, Category20b19, Category20b20, Category20c3, Category20c4, Category20c5, Category20c6, Category20c7, Category20c8, Category20c9, Category20c10, Category20c11, Category20c12, Category20c13, Category20c14, Category20c15, Category20c16, Category20c17, Category20c18, Category20c19, Category20c20, Cividis3, Cividis4, Cividis5, Cividis6, Cividis7, Cividis8, Cividis9, Cividis10, Cividis11, Cividis256, Colorblind3, Colorblind4, Colorblind5, Colorblind6, Colorblind7, Colorblind8, Dark2_3, Dark2_4, Dark2_5, Dark2_6, Dark2_7, Dark2_8, GnBu3, GnBu4, GnBu5, GnBu6, GnBu7, GnBu8, GnBu9, Greens3, Greens4, Greens5, Greens6, Greens7, Greens8, Greens9, Greens256, Greys3, Greys4, Greys5, Greys6, Greys7, Greys8, Greys9, Greys256, Inferno3, Inferno4, Inferno5, Inferno6, Inferno7, Inferno8, Inferno9, Inferno10, Inferno11, Inferno256, Magma3, Magma4, Magma5, Magma6, Magma7, Magma8, Magma9, Magma10, Magma11, Magma256, OrRd3, OrRd4, OrRd5, OrRd6, OrRd7, OrRd8, OrRd9, Oranges3, Oranges4, Oranges5, Oranges6, Oranges7, Oranges8, Oranges9, Oranges256, PRGn3, PRGn4, PRGn5, PRGn6, PRGn7, PRGn8, PRGn9, PRGn10, PRGn11, Paired3, Paired4, Paired5, Paired6, Paired7, Paired8, Paired9, Paired10, Paired11, Paired12, Pastel1_3, Pastel1_4, Pastel1_5, Pastel1_6, Pastel1_7, Pastel1_8, Pastel1_9, Pastel2_3, Pastel2_4, Pastel2_5, Pastel2_6, Pastel2_7, Pastel2_8, PiYG3, PiYG4, PiYG5, PiYG6, PiYG7, PiYG8, PiYG9, PiYG10, PiYG11, Plasma3, Plasma4, Plasma5, Plasma6, Plasma7, Plasma8, Plasma9, Plasma10, Plasma11, Plasma256, PuBu3, PuBu4, PuBu5, PuBu6, PuBu7, PuBu8, PuBu9, PuBuGn3, PuBuGn4, PuBuGn5, PuBuGn6, PuBuGn7, PuBuGn8, PuBuGn9, PuOr3, PuOr4, PuOr5, PuOr6, PuOr7, PuOr8, PuOr9, PuOr10, PuOr11, PuRd3, PuRd4, PuRd5, PuRd6, PuRd7, PuRd8, PuRd9, Purples3, Purples4, Purples5, Purples6, Purples7, Purples8, Purples9, Purples256, RdBu3, RdBu4, RdBu5, RdBu6, RdBu7, RdBu8, RdBu9, RdBu10, RdBu11, RdGy3, RdGy4, RdGy5, RdGy6, RdGy7, RdGy8, RdGy9, RdGy10, RdGy11, RdPu3, RdPu4, RdPu5, RdPu6, RdPu7, RdPu8, RdPu9, RdYlBu3, RdYlBu4, RdYlBu5, RdYlBu6, RdYlBu7, RdYlBu8, RdYlBu9, RdYlBu10, RdYlBu11, RdYlGn3, RdYlGn4, RdYlGn5, RdYlGn6, RdYlGn7, RdYlGn8, RdYlGn9, RdYlGn10, RdYlGn11, Reds3, Reds4, Reds5, Reds6, Reds7, Reds8, Reds9, Reds256, Set1_3, Set1_4, Set1_5, Set1_6, Set1_7, Set1_8, Set1_9, Set2_3, Set2_4, Set2_5, Set2_6, Set2_7, Set2_8, Set3_3, Set3_4, Set3_5, Set3_6, Set3_7, Set3_8, Set3_9, Set3_10, Set3_11, Set3_12, Spectral3, Spectral4, Spectral5, Spectral6, Spectral7, Spectral8, Spectral9, Spectral10, Spectral11, Turbo3, Turbo4, Turbo5, Turbo6, Turbo7, Turbo8, Turbo9, Turbo10, Turbo11, Turbo256, Viridis3, Viridis4, Viridis5, Viridis6, Viridis7, Viridis8, Viridis9, Viridis10, Viridis11, Viridis256, YlGn3, YlGn4, YlGn5, YlGn6, YlGn7, YlGn8, YlGn9, YlGnBu3, YlGnBu4, YlGnBu5, YlGnBu6, YlGnBu7, YlGnBu8, YlGnBu9, YlOrBr3, YlOrBr4, YlOrBr5, YlOrBr6, YlOrBr7, YlOrBr8, YlOrBr9, YlOrRd3, YlOrRd4, YlOrRd5, YlOrRd6, YlOrRd7, YlOrRd8, YlOrRd9)
RenderLevel
Specify a position in the render order for a Bokeh renderer
RenderMode
Specify a render mode for renderers that support both Canvas or CSS rendering
ResetPolicy
What reset actions should occur on a Plot reset
RoundingFunction
Specify a policy for how numbers should be rounded
SelectionMode
Selection modes
SizingMode
Sizing mode policies
SizingPolicy
Individual sizing mode policies
SortDirection
Specify sorting directions
SpatialUnits
Specify units for mapping values
StartEnd
Specify a start/end value
StepMode
Specify a mode for stepwise interpolation
TextAlign
Specify the horizontal alignment for rendering text
TextBaseline
Specify the baseline location for rendering text
TextureRepetition
Specify how textures used as canvas patterns should repeat
TickLabelOrientation
Specify how axis tick labels are oriented with respect to the axis
TooltipAttachment
Specify an attachment for tooltips
TooltipFieldFormatter
Specify how a format string for a tooltip field should be interpreted
TrackPolicy
Grid track (row/column) sizing policies
VerticalAlign
Specify the vertical alignment for rendering text
VerticalLocation
Specify a vertical location in plot layouts
Represent an enumerated collection of values.
Note
Instances of Enumeration typically should not be constructed directly. Instead, use the enumeration() function.