#-----------------------------------------------------------------------------# 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.#-----------------------------------------------------------------------------''''''#-----------------------------------------------------------------------------# Boilerplate#-----------------------------------------------------------------------------from__future__importannotationsimportlogging# isort:skiplog=logging.getLogger(__name__)#-----------------------------------------------------------------------------# Imports#-----------------------------------------------------------------------------# Bokeh importsfrom..core.has_propsimportabstractfrom.transformsimportTransform#-----------------------------------------------------------------------------# Globals and constants#-----------------------------------------------------------------------------__all__=('CategoricalScale','LinearScale','LogScale','Scale',)#-----------------------------------------------------------------------------# General API#-----------------------------------------------------------------------------
[docs]@abstractclassScale(Transform):''' Base class for ``Scale`` models that represent an invertible computation to be carried out on the client-side. JavaScript implementations should implement the following methods: .. code-block compute(x: number): number { # compute and return the transform of a single value } v_compute(xs: Arrayable<number>): Arrayable<number> { # compute and return the transform of an array of values } invert(sx: number): number { # compute and return the inverse transform of a single value } v_invert(sxs: Arrayable<number>): Arrayable<number> { # compute and return the inverse transform of an array of values } '''pass
classContinuousScale(Scale):''' Represent a scale transformation between continuous ranges. '''pass
[docs]classLinearScale(ContinuousScale):''' Represent a linear scale transformation between continuous ranges. '''pass
[docs]classLogScale(ContinuousScale):''' Represent a log scale transformation between continuous ranges. '''pass
[docs]classCategoricalScale(Scale):''' Represent a scale transformation between a categorical source range and continuous target range. '''pass
#-----------------------------------------------------------------------------# Dev API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Private API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Code#-----------------------------------------------------------------------------