public class IdentityScale extends ContinuousQuantitativeScale<IdentityScale>
Scale.apply(double)
and its
ContinuousQuantitativeScale.invert(double)
method are both the identity function.
These scales are occasionally useful when working with pixel coordinates, say
in conjunction with the Axis
and Brush
components.
The methods Scale.domain(double...)
and Scale.range(double...)
have the
same effect of setting both the domain and range in the same time.
Modifier | Constructor and Description |
---|---|
protected |
IdentityScale() |
Modifier and Type | Method and Description |
---|---|
Formatter |
tickFormat(int count)
Returns a number format function suitable for displaying a tick value.
|
Formatter |
tickFormat(int count,
String formatSpecifier)
Returns a number format function suitable for displaying a tick value.
|
<T> Array<T> |
ticks()
Alias for
ticks(10) . |
<T> Array<T> |
ticks(int count)
Returns approximately count representative values from the scale's input
domain (or equivalently, output range).
|
clamp, clamp, invert, rangeRound, rangeRound, rangeRound
apply, apply, apply, copy, domain, domain, domain, domain, range, range, range, range
public final <T> Array<T> ticks(int count)
The returned tick values are uniformly spaced, have human-readable values (such as multiples of powers of 10), and are guaranteed to be within the extent of the input domain.
Ticks are often used to display reference lines, or tick marks, in conjunction with the visualized data.
The specified count is only a hint; the scale may return more or fewer values depending on the input domain.
public final Formatter tickFormat(int count)
The specified count should have the same value as the count that is used to generate the tick values you want to display.
You don't have to use the scale's built-in tick format, but it automatically computes the appropriate precision based on the fixed interval between tick values.
the
- number of ticks to take into account to create the
Formatter
.public final Formatter tickFormat(int count, String formatSpecifier)
This is the same as tickFormat(int)
, except that the format
argument allows a format specifier to be specified.
If the format specifier doesn’t have a defined precision, the precision will be set automatically by the scale, returning the appropriate format.
This provides a convenient, declarative way of specifying a format whose precision will be automatically set by the scale.
Copyright © 2015 gwt-d3. All rights reserved.