View Source Plox.Scale protocol (Plox v0.2.1)
A protocol for graph scales.
Any graph scale must implement this protocol in order to be used by the
Plox.graph
component.
Summary
Functions
Converts a specific scale value to a number within the requested range
Returns an enumerable of the "labeled values" in a scale
Types
@type t() :: any()
Any struct that implements this protocol
Built in implementations are:
Functions
Converts a specific scale value to a number within the requested range
The destination range must be a valid integer range.
@spec values(scale :: t(), opts :: map()) :: Enumerable.t()
Returns an enumerable of the "labeled values" in a scale
Note: the returned values don't necessarily represent all the values in the scale, just the values meant to be labeled and rendered on the corresponding axis. e.g. the final value might not be equal to the scale's configured max.