2015年3月10日 星期二

d3.Scales

In addition to linear scales (discussed earlier), D3 has several other built-in scale methods:
sqrt
A square root scale.
pow
A power scale (good for the gym, er, I mean, useful when working with exponential series of values, as in “to the power of” some exponent).
log
A logarithmic scale.
quantize
A linear scale with discrete values for its output range, for when you want to sort data into “buckets.”
quantile
Similar to quantize, but with discrete values for its input domain (when you already have “buckets”).
ordinal
Ordinal scales use nonquantitative values (like category names) for output; perfect for comparing apples and oranges.
d3.scale.category10()d3.scale.category20()d3.scale.category20b(), andd3.scale.category20c()
Handy preset ordinal scales that output either 10 or 20 categorical colors.
d3.time.scale()
A scale method for date and time values, with special handling of ticks for dates.

沒有留言:

張貼留言