Skip to content

Commit

Permalink
update types for x, y, z and r domain props per #117
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Mar 6, 2023
1 parent 7337c0b commit 0c9b3dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/content/guide/02-layercake-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Same as [xScale](/guide#xscale) but for the z scale. The default is `d3.scaleLin

Same as [xScale](/guide#xscale) but for the r scale. The default is [`d3.scaleSqrt()`](https://github.com/d3/d3-scale#scalesqrt).

### xDomain `Array:[min: ?Number, max: ?Number]|String[]|Number[]|Function`
### xDomain `Array:[min: ?Number|null, max: ?Number|null]|String[]|Number[]|Function`

Set a min or max on the x scale. If you want to inherit the value from the data's extent, set that value to `null`.

Expand Down Expand Up @@ -165,15 +165,15 @@ If you set a [`scaleBand`](https://github.com/d3/d3-scale#scaleband), [`scalePoi
>
```

### yDomain `Array:[min: Number, max: Number]|String[]|Number[]|Function`
### yDomain `Array:[min: ?Number|null, max: ?Number|null]|String[]|Number[]|Function`

Same as [xDomain](/guide#xdomain) but for the y scale.

### zDomain `Array:[min: Number, max: Number]|String[]|Number[]|Function`
### zDomain `Array:[min: ?Number|null, max: ?Number|null]|String[]|Number[]|Function`

Same as [xDomain](/guide#xdomain) but for the z scale.

### rDomain `Array:[min: Number, max: Number]|String[]|Number[]|Function`
### rDomain `Array:[min: ?Number|null, max: ?Number|null]|String[]|Number[]|Function`

Same as [xDomain](/guide#xdomain) but for the r scale.

Expand Down
8 changes: 4 additions & 4 deletions src/lib/LayerCake.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
/** @type {Array|Object} [data=[]] If `data` is not a flat array of objects and you want to use any of the scales, set a flat version of the data via the `flatData` prop. */
export let data = [];
/** @type {[min: ?Number, max: ?Number]|String[]|Number[]|Function} [xDomain] Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
/** @type {[min: ?Number|null, max: ?Number|null]|String[]|Number[]|Function} [xDomain] Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
export let xDomain = undefined;
/** @type {[min: ?Number, max: ?Number]|String[]|Number[]|Function} [yDomain] Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
/** @type {[min: ?Number|null, max: ?Number|null]|String[]|Number[]|Function} [yDomain] Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
export let yDomain = undefined;
/** @type {[min: ?Number, max: ?Number]|String[]|Number[]|Function} [zDomain] Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
/** @type {[min: ?Number|null, max: ?Number|null]|String[]|Number[]|Function} [zDomain] Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
export let zDomain = undefined;
/** @type {[min: ?Number, max: ?Number]|String[]|Number[]|Function} [rDomain] Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
/** @type {[min: ?Number|null, max: ?Number|null]|String[]|Number[]|Function} [rDomain] Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
export let rDomain = undefined;
/** @type {Boolean|Number} [xNice=false] Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the x domain. */
export let xNice = false;
Expand Down

0 comments on commit 0c9b3dd

Please sign in to comment.