Constants
- getValueDomain ⇒
Array.<Number> Builds the domain for a value axis so that it always contains zero.
Charts whose marks grow from a baseline need that baseline inside the domain, otherwise a negative value scales to a coordinate outside the range and the mark is drawn with a negative width or height, which SVG rejects.
For data that is entirely non-negative this returns the same
[0, max]the charts used before, so nothing about existing charts changes.- getBaselineExtent ⇒
Object Where a mark that grows from the zero baseline starts, and how long it is.
Works for either axis: with a vertical scale
startis a y andsizea height, with a horizontal one they are an x and a width. Negative values come back on the other side of the baseline with a positive size, which is what SVG needs.
getValueDomain ⇒ Array.<Number>
Builds the domain for a value axis so that it always contains zero.
Charts whose marks grow from a baseline need that baseline inside the domain, otherwise a negative value scales to a coordinate outside the range and the mark is drawn with a negative width or height, which SVG rejects.
For data that is entirely non-negative this returns the same [0, max] the
charts used before, so nothing about existing charts changes.
Kind: global constant
Returns: Array.<Number> - [lower, upper], always spanning zero
| Param | Type | Description |
|---|---|---|
| values | Array.<Number> | Values the axis has to cover |
| ratio | Number | Headroom multiplier applied to the extent |
| emptyDomainMax | Number | Upper bound to use when every value is 0 |
getBaselineExtent ⇒ Object
Where a mark that grows from the zero baseline starts, and how long it is.
Works for either axis: with a vertical scale start is a y and size a
height, with a horizontal one they are an x and a width. Negative values come
back on the other side of the baseline with a positive size, which is what
SVG needs.
Kind: global constant
Returns: Object - { start, size }
| Param | Type | Description |
|---|---|---|
| scale | function | Linear scale for the value axis |
| value | Number | Value to place |