ScaleLog<Y> class
final
Log scales
Logarithmic (“log”) scales are like linear scales except that a logarithmic transform is applied to the input domain value before the output range value is computed.
The mapping to the range value y can be expressed as a function of the domain value x: y = m log(x) + b.
CAUTION: As log(0) = -∞, a log scale domain must be strictly-positive or strictly-negative; the domain must not include or cross zero. A log scale with a positive domain has a well-defined behavior for positive values, and a log scale with a negative domain has a well-defined behavior for negative values. (For a negative domain, input and output values are implicitly multiplied by -1.) The behavior of the scale is undefined if you pass a negative value to a log scale with a positive domain or vice versa.
- Implemented types
-
- Scale<
X, Y>
- Scale<
Constructors
-
ScaleLog.new({List<
num> domain = const [1, 10], required List<Y> range, required Interpolate<Y> interpolate}) -
Constructs a new log scale with the specified
domain
,range
andinterpolate
, the base 10, andclamp
ing disabled.
Properties
- base ↔ num
-
The scale's base.
getter/setter pairinherited
- clamp ↔ bool
-
Whether or not the scale currently clamps values to within the
range
.getter/setter pairinherited -
domain
↔ List<
num> -
The scale's domain that specifies the input values.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
interpolate
↔ Interpolate<
Y> -
The scale’s
range
interpolator factory.getter/setter pairinherited -
range
↔ List<
Y> -
The scale's range that specifies the output values.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unknown ↔ Y?
-
The output value of the scale for null (or double.nan) input values.
getter/setter pairinherited
Methods
-
call(
num? x) → Y? -
Given a value from the
domain
, returns the corresponding value from therange
.inherited -
copy(
) → ScaleLog< Y> -
Returns an exact copy of this scale.
override
-
nice(
[num count = 0]) → void -
Like
ScaleLinear.nice
, except extends the domain to integer powers ofbase
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
tickFormat(
[num count = 10, Object? specifier]) → String Function(num) -
Like
ScaleLinear.tickFormat
, but customized for a log scale.inherited -
ticks(
[num count = 10]) → List< num> -
Like
ScaleLinear.ticks
, but customized for a log scale.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited