public class Scales
extends com.google.gwt.core.client.JavaScriptObject
Scale
s.
Scales are functions that map from an input domain to an output range. There is 3 kind of scales:
D3.time()
.
Modifier | Constructor and Description |
---|---|
protected |
Scales() |
Modifier and Type | Method and Description |
---|---|
OrdinalScale |
category10()
Constructs a new ordinal scale with a range of ten categorical colors:
#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf.
|
OrdinalScale |
category20()
Constructs a new ordinal scale with a range of twenty categorical colors:
#1f77b4 #aec7e8 #ff7f0e #ffbb78 #2ca02c #98df8a #d62728 #ff9896 #9467bd #c5b0d5 #8c564b #c49c94 #e377c2 #f7b6d2 #7f7f7f #c7c7c7 #bcbd22 #dbdb8d #17becf #9edae5.
|
OrdinalScale |
category20b()
Constructs a new ordinal scale with a range of twenty categorical colors:
#393b79 #5254a3 #6b6ecf #9c9ede #637939 #8ca252 #b5cf6b #cedb9c #8c6d31 #bd9e39 #e7ba52 #e7cb94 #843c39 #ad494a #d6616b #e7969c #7b4173 #a55194 #ce6dbd #de9ed6.
|
OrdinalScale |
category20c()
Constructs a new ordinal scale with a range of twenty categorical colors:
#3182bd #6baed6 #9ecae1 #c6dbef #e6550d #fd8d3c #fdae6b #fdd0a2 #31a354 #74c476 #a1d99b #c7e9c0 #756bb1 #9e9ac8 #bcbddc #dadaeb #636363 #969696 #bdbdbd #d9d9d9.
|
static Scales |
get() |
IdentityScale |
identity()
Constructs a new identity scale with the default domain [0,1] and the
default range [0,1].
|
LinearScale |
linear()
Constructs a new linear scale with the default domain [0,1] and the
default range [0,1].
|
LogScale |
log()
Constructs a new log scale with the default domain [1,10], the default
range [0,1], and the base 10.
|
OrdinalScale |
ordinal()
Constructs a new ordinal scale with an empty domain and an empty range.
|
PowScale |
pow()
Constructs a new power scale with the default domain [0,1], the default
range [0,1], and the default exponent 1.
|
QuantileScale |
quantile()
Constructs a new quantile scale with an empty domain and an empty range.
|
QuantizeScale |
quantize()
Constructs a new quantize scale with the default domain [0,1] and the
default range [0,1].
|
PowScale |
sqrt()
Constructs a new power scale with the default domain [0,1], the default
range [0,1], and the exponent .5.
|
ThresholdScale |
threshold()
Constructs a new threshold scale with the default domain [.5] and the
default range [0,1].
|
public final LinearScale linear()
public final IdentityScale identity()
public final LogScale log()
public final PowScale pow()
Thus, the default power scale is equivalent to the identity function for numbers; for example pow(0.5) returns 0.5.
public final PowScale sqrt()
D3.scale.pow().exponent(.5);
The returned scale is a function that takes a single argument x
representing a value in the input domain; the return value is the
corresponding value in the output range. Thus, the returned scale is
equivalent to the Math.sqrt(double)
function for numbers; for
example sqrt(0.25) returns 0.5.
public final QuantizeScale quantize()
Thus, the default quantize scale is equivalent to the round function for numbers; for example quantize(0.49) returns 0, and quantize(0.51) returns 1.
public final QuantileScale quantile()
The quantile scale is invalid until both a domain and range are specified.
public final OrdinalScale ordinal()
The ordinal scale is invalid (always returning undefined) until an output range is specified.
public final ThresholdScale threshold()
Thus, the default threshold scale is equivalent to the round function for numbers; for example threshold(0.49) returns 0, and threshold(0.51) returns 1.
public final OrdinalScale category10()
Constructs a new ordinal scale with a range of ten categorical colors: #1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf.
OrdinalScale
public final OrdinalScale category20()
Constructs a new ordinal scale with a range of twenty categorical colors: #1f77b4 #aec7e8 #ff7f0e #ffbb78 #2ca02c #98df8a #d62728 #ff9896 #9467bd #c5b0d5 #8c564b #c49c94 #e377c2 #f7b6d2 #7f7f7f #c7c7c7 #bcbd22 #dbdb8d #17becf #9edae5.
OrdinalScale
public final OrdinalScale category20b()
Constructs a new ordinal scale with a range of twenty categorical colors: #393b79 #5254a3 #6b6ecf #9c9ede #637939 #8ca252 #b5cf6b #cedb9c #8c6d31 #bd9e39 #e7ba52 #e7cb94 #843c39 #ad494a #d6616b #e7969c #7b4173 #a55194 #ce6dbd #de9ed6.
OrdinalScale
public final OrdinalScale category20c()
Constructs a new ordinal scale with a range of twenty categorical colors: #3182bd #6baed6 #9ecae1 #c6dbef #e6550d #fd8d3c #fdae6b #fdd0a2 #31a354 #74c476 #a1d99b #c7e9c0 #756bb1 #9e9ac8 #bcbddc #dadaeb #636363 #969696 #bdbdbd #d9d9d9.
OrdinalScale
public static final Scales get()
Copyright © 2015 gwt-d3. All rights reserved.