Returns an adjusted log10 value for graphing purposes. The first adjustment is that negative values are changed to positive during the calculations, and then the answer is negated at the end. The second is that, for values less than 10, an increasingly large (0 to 1) scaling factor is added such that at 0 the value is adjusted to 1, resulting in a returned result of 0.
How many ticks does the range [lower, upper] deserve?
e.g. if your domain was [10, 1000] and I asked _howManyTicks(10, 100), I would get 1/2 of the ticks. The range 10, 100 takes up 1/2 of the distance when plotted.
Return an appropriate number of ticks from lower to upper.
This will first try to fit as many powers of this.base as it can from lower to upper.
If it still has ticks after that, it will generate ticks in "clusters", e.g. [20, 30, ... 90, 100] would be a cluster, [200, 300, ... 900, 1000] would be another cluster.
This function will generate clusters as large as it can while not drastically exceeding its number of ticks.
Adds an IncludedValuesProvider to the Scale.
Adds a padding exception provider. If one end of the domain is set to an excepted value as a result of autoDomain()-ing, that end of the domain will not be padded.
The provider function.
Gets the upper end of the domain.
Sets the upper end of the domain.
Gets the lower end of the domain.
Sets the lower end of the domain.
Removes a callback that would be called when the Scale updates.
Adds a callback to be called when the Scale updates.
Gets the padding proportion.
Sets the padding porportion. When autoDomain()-ing, the computed domain will be expanded by this proportion, then rounded to human-readable values.
The padding proportion. Passing 0 disables padding.
Gets the range.
The current range.
Sets the range.
Removes the IncludedValuesProvider from the Scale.
Removes the padding exception provider.
The provider function.
Gets whether or not the scale snaps its domain to nice values.
Sets whether or not the scale snaps its domain to nice values.
Gets the TickGenerator.
Sets the TickGenerator
Generated using TypeDoc
A ModifiedLog Scale acts as a regular log scale for large numbers. As it approaches 0, it gradually becomes linear. Consequently, a ModifiedLog Scale can process 0 and negative numbers.
For x >= base, scale(x) = log(x).
For 0 < x < base, scale(x) will become more and more linear as it approaches 0.
At x == 0, scale(x) == 0.
For negative values, scale(-x) = -scale(x).
The range and domain for the scale should also be set, using the range() and domain() accessors, respectively.
range, provide a two-element array giving the minimum and maximum of values produced when scaling.
domainprovide a two-element array giving the minimum and maximum of the values that will be scaled.