tickers#
Models for computing good tick locations on different kinds of plots.
- class AdaptiveTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate “nice” round ticks at any magnitude.
Creates ticks that are “base” multiples of a set of given mantissas. For example, with
base=10andmantissas=[1, 2, 5], the ticker will generate the sequence:..., 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, ...
- base#
The multiplier to use for scaling mantissas.
- mantissas#
The acceptable list numbers to generate multiples of.
- max_interval#
The largest allowable interval between two adjacent ticks.
Note
To specify an unbounded interval, set to
None.
- min_interval#
The smallest allowable interval between two adjacent ticks.
- class BasicTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate ticks on a linear scale.
Note
This class may be renamed to
LinearTickerin the future.
- class BinnedTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Ticker that aligns ticks exactly at bin boundaries of a scanning color mapper.
- mapper#
A scanning color mapper (e.g.
EqHistColorMapper) to use.
- num_major_ticks#
The number of major tick positions to show or “auto” to use the number of bins provided by the mapper.
- class CategoricalTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate ticks for categorical ranges.
- class CompositeTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Combine different tickers at different scales.
Uses the
min_intervalandmax_intervalinterval attributes of the tickers to select the appropriate ticker at different scales.- tickers#
A list of
Tickerobjects to combine at different scales in order to generate tick values. The supplied tickers should be in order. Specifically, if S comes before T, then it should be the case that:S.get_max_interval() < T.get_min_interval()
- class ContinuousTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
A base class for non-categorical ticker types.
Note
This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.
- desired_num_ticks#
A desired target number of major tick positions to generate across the plot range.
- num_minor_ticks#
The number of minor tick positions to generate between adjacent major tick values.
- class CustomJSTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate tick locations that are computed by a user-defined function.
A
CustomJSTickermay be used with either a continuous (numeric) axis, or a categorical axis. However, only basic, non-hierarchical categorical axes (i.e. with a single level of factors) are supported.Warning
The explicit purpose of this Bokeh Model is to embed raw JavaScript code for a browser to execute. If any part of the code is derived from untrusted user inputs, then you must take appropriate care to sanitize the user input prior to passing to Bokeh.
- args#
A mapping of names to Python objects. In particular those can be bokeh’s models. These objects are made available to the ticker’s code snippet as the values of named parameters to the callback.
- major_code#
Callback code to run in the browser to compute minor tick locations for the current viewport.
The
cb_dataparameter that is available to the callback code will contain four specific fields:startthe computed start coordinate of the axis
endthe computed end of the axis
rangethe Range model for this axis
cross_locthe coordinate that this axis intersects the orthogonal axis
- minor_code#
Callback code to run in the browser to compute minor tick locations for the current viewport.
Note
Minor ticks are not used for categorical axes. This property will be ignored when the range is a
FactorRange.The
cb_dataparameter that is available to the callback code will contain five specific fields:major_ticksthe list of the current computed major tick locations
startthe computed start coordinate of the axis
endthe computed end of the axis
rangethe Range model for this axis
cross_locthe coordinate that this axis intersects the orthogonal axis
- class DatetimeTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate nice ticks across different date and time scales.
- class DaysTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate ticks spaced apart by specific, even multiples of days.
- days#
The intervals of days to use.
- class FixedTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate ticks at fixed, explicitly supplied locations.
Note
The
desired_num_ticksproperty is ignored by this Ticker.- minor_ticks#
List of minor tick locations.
- ticks#
List of major tick locations.
- class LogTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate ticks on a log scale.
- class MercatorTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate nice lat/lon ticks form underlying WebMercator coordinates.
- dimension#
Specify whether to generate ticks for Latitude or Longitude.
Projected coordinates are not separable, computing Latitude and Longitude tick locations from Web Mercator requires considering coordinates from both dimensions together. Use this property to specify which result should be returned.
Typically, if the ticker is for an x-axis, then dimension should be
"lon"and if the ticker is for a y-axis, then the dimension should be “lat”`.In order to prevent hard to debug errors, there is no default value for dimension. Using an un-configured
MercatorTickerwill result in a validation error and a JavaScript console error.
- class MonthsTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate ticks spaced apart by specific, even multiples of months.
- months#
The intervals of months to use.
- class SingleIntervalTicker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
Generate evenly spaced ticks at a fixed interval regardless of scale.
- interval#
The interval between adjacent ticks.
- class Ticker(*args: Any, id: ID | None = None, **kwargs: Any)[source]#
A base class for all ticker types.
Note
This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.