Skip to content

Commit

Permalink
Merge pull request #228 from rgieseke/lower-case-type-synonym-boolean
Browse files Browse the repository at this point in the history
Lower-case Boolean type synonym
  • Loading branch information
mhkeller authored Aug 26, 2024
2 parents d3beb5e + 4c25c94 commit e65d6b8
Show file tree
Hide file tree
Showing 25 changed files with 79 additions and 79 deletions.
2 changes: 1 addition & 1 deletion src/_components/AnnotationsData.html.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/** @type {Function} [getText=d => d.text] - An accessor function to get the field to display. */
export let getText = d => d.text;
/** @type {Boolean} [percentRange=false] - If `true` will set the `top` and `left` CSS positions to percentages instead of pixels. */
/** @type {boolean} [percentRange=false] - If `true` will set the `top` and `left` CSS positions to percentages instead of pixels. */
export let pr = $percentRange;
$: units = pr === true ? '%' : 'px';
Expand Down
8 changes: 4 additions & 4 deletions src/_components/AxisX.percent-range.html.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
const { xScale, percentRange } = getContext('LayerCake');
/** @type {Boolean} [tickMarks=false] - Show a vertical mark for each tick. */
/** @type {boolean} [tickMarks=false] - Show a vertical mark for each tick. */
export let tickMarks = false;
/** @type {Boolean} [gridlines=true] - Show gridlines extending into the chart area. */
/** @type {boolean} [gridlines=true] - Show gridlines extending into the chart area. */
export let gridlines = true;
/** @type {Number} [tickMarkLength=6] - The length of the tick mark. */
export let tickMarkLength = 6;
/** @type {Boolean} [baseline=false] – Show a solid line at the bottom. */
/** @type {boolean} [baseline=false] – Show a solid line at the bottom. */
export let baseline = false;
/** @type {Boolean} [snapLabels=false] - Instead of centering the text labels on the first and the last items, align them to the edges of the chart. */
/** @type {boolean} [snapLabels=false] - Instead of centering the text labels on the first and the last items, align them to the edges of the chart. */
export let snapLabels = false;
/** @type {(d: any) => string} [format=d => d] - A function that passes the current tick value and expects a nicely formatted value in return. */
Expand Down
10 changes: 5 additions & 5 deletions src/_components/AxisX.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
const { width, height, xScale, yRange } = getContext('LayerCake');
/** @type {Boolean} [tickMarks=false] - Show a vertical mark for each tick. */
/** @type {boolean} [tickMarks=false] - Show a vertical mark for each tick. */
export let tickMarks = false;
/** @type {Boolean} [gridlines=true] - Show gridlines extending into the chart area. */
/** @type {boolean} [gridlines=true] - Show gridlines extending into the chart area. */
export let gridlines = true;
/** @type {Number} [tickMarkLength=6] - The length of the tick mark. */
export let tickMarkLength = 6;
/** @type {Boolean} [baseline=false] – Show a solid line at the bottom. */
/** @type {boolean} [baseline=false] – Show a solid line at the bottom. */
export let baseline = false;
/** @type {Boolean} [snapLabels=false] - Instead of centering the text labels on the first and the last items, align them to the edges of the chart. */
/** @type {boolean} [snapLabels=false] - Instead of centering the text labels on the first and the last items, align them to the edges of the chart. */
export let snapLabels = false;
/** @type {(d: any) => string} [format=d => d] - A function that passes the current tick value and expects a nicely formatted value in return. */
Expand All @@ -38,7 +38,7 @@
export let dy = 12;
/**@param {Number} i
* @param {Boolean} sl */
* @param {boolean} sl */
function textAnchor(i, sl) {
if (sl === true) {
if (i === 0) {
Expand Down
8 changes: 4 additions & 4 deletions src/_components/AxisXTop.percent-range.html.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
const { xScale, percentRange } = getContext('LayerCake');
/** @type {Boolean} [tickMarks=false] - Show a vertical mark for each tick. */
/** @type {boolean} [tickMarks=false] - Show a vertical mark for each tick. */
export let tickMarks = false;
/** @type {Boolean} [gridlines=true] - Show gridlines extending into the chart area. */
/** @type {boolean} [gridlines=true] - Show gridlines extending into the chart area. */
export let gridlines = true;
/** @type {Number} [tickMarkLength=6] - The length of the tick mark. */
export let tickMarkLength = 6;
/** @type {Boolean} [baseline=false] – Show a solid line at the bottom. */
/** @type {boolean} [baseline=false] – Show a solid line at the bottom. */
export let baseline = false;
/** @type {Boolean} [snapLabels=false] - Instead of centering the text labels on the first and the last items, align them to the edges of the chart. */
/** @type {boolean} [snapLabels=false] - Instead of centering the text labels on the first and the last items, align them to the edges of the chart. */
export let snapLabels = false;
/** @type {(d: any) => string} [format=d => d] - A function that passes the current tick value and expects a nicely formatted value in return. */
Expand Down
10 changes: 5 additions & 5 deletions src/_components/AxisXTop.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
const { width, height, xScale, yRange } = getContext('LayerCake');
/** @type {Boolean} [tickMarks=false] - Show a vertical mark for each tick. */
/** @type {boolean} [tickMarks=false] - Show a vertical mark for each tick. */
export let tickMarks = false;
/** @type {Boolean} [gridlines=true] - Show gridlines extending into the chart area. */
/** @type {boolean} [gridlines=true] - Show gridlines extending into the chart area. */
export let gridlines = true;
/** @type {Number} [tickMarkLength=6] - The length of the tick mark. */
export let tickMarkLength = 6;
/** @type {Boolean} [baseline=false] – Show a solid line at the bottom. */
/** @type {boolean} [baseline=false] – Show a solid line at the bottom. */
export let baseline = false;
/** @type {Boolean} [snapLabels=false] - Instead of centering the text labels on the first and the last items, align them to the edges of the chart. */
/** @type {boolean} [snapLabels=false] - Instead of centering the text labels on the first and the last items, align them to the edges of the chart. */
export let snapLabels = false;
/** @type {(d: any) => string} [format=d => d] - A function that passes the current tick value and expects a nicely formatted value in return. */
Expand All @@ -38,7 +38,7 @@
export let dy = -4;
/**@param {Number} i
* @param {Boolean} sl */
* @param {boolean} sl */
function textAnchor(i, sl) {
if (sl === true) {
if (i === 0) {
Expand Down
6 changes: 3 additions & 3 deletions src/_components/AxisY.percent-range.html.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
const { xRange, yScale, percentRange } = getContext('LayerCake');
/** @type {Boolean} [tickMarks=false] - Show marks next to the tick label. */
/** @type {boolean} [tickMarks=false] - Show marks next to the tick label. */
export let tickMarks = false;
/** @type {String} [labelPosition='even'] - Whether the label sits even with its value ('even') or sits on top ('above') the tick mark. Default is 'even'. */
export let labelPosition = 'even';
/** @type {Boolean} [snapBaselineLabel=false] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
/** @type {boolean} [snapBaselineLabel=false] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
export let snapBaselineLabel = false;
/** @type {Boolean} [gridlines=true] - Show gridlines extending into the chart area. */
/** @type {boolean} [gridlines=true] - Show gridlines extending into the chart area. */
export let gridlines = true;
/** @type {Number|undefined} [tickMarkLength=undefined] - The length of the tick mark. If not set, becomes the length of the widest tick. */
Expand Down
6 changes: 3 additions & 3 deletions src/_components/AxisY.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
const { xRange, yScale, width } = getContext('LayerCake');
/** @type {Boolean} [tickMarks=false] - Show marks next to the tick label. */
/** @type {boolean} [tickMarks=false] - Show marks next to the tick label. */
export let tickMarks = false;
/** @type {String} [labelPosition='even'] - Whether the label sits even with its value ('even') or sits on top ('above') the tick mark. Default is 'even'. */
export let labelPosition = 'even';
/** @type {Boolean} [snapBaselineLabel=false] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
/** @type {boolean} [snapBaselineLabel=false] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
export let snapBaselineLabel = false;
/** @type {Boolean} [gridlines=true] - Show gridlines extending into the chart area. */
/** @type {boolean} [gridlines=true] - Show gridlines extending into the chart area. */
export let gridlines = true;
/** @type {Number|undefined} [tickMarkLength=undefined] - The length of the tick mark. If not set, becomes the length of the widest tick. */
Expand Down
6 changes: 3 additions & 3 deletions src/_components/AxisYRight.percent-range.html.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
const { xRange, yScale, width, percentRange } = getContext('LayerCake');
/** @type {Boolean} [tickMarks=true] - Show marks next to the tick label. */
/** @type {boolean} [tickMarks=true] - Show marks next to the tick label. */
export let tickMarks = true;
/** @type {String} [labelPosition='even'] - Whether the label sits even with its value ('even') or sits on top ('above') the tick mark. Default is 'even'. */
export let labelPosition = 'even';
/** @type {Boolean} [snapBaselineLabel=false] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
/** @type {boolean} [snapBaselineLabel=false] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
export let snapBaselineLabel = false;
/** @type {Boolean} [gridlines=true] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
/** @type {boolean} [gridlines=true] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
export let gridlines = true;
/** @type {Number|undefined} [tickMarkLength=undefined] - The length of the tick mark. If not set, becomes the length of the widest tick. */
Expand Down
6 changes: 3 additions & 3 deletions src/_components/AxisYRight.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
const { xRange, yScale, width } = getContext('LayerCake');
/** @type {Boolean} [tickMarks=false] - Show marks next to the tick label. */
/** @type {boolean} [tickMarks=false] - Show marks next to the tick label. */
export let tickMarks = false;
/** @type {String} [labelPosition='above'] - Whether the label sits even with its value ('even') or sits on top ('above') the tick mark. */
export let labelPosition = 'above';
/** @type {Boolean} [snapBaselineLabel=false] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
/** @type {boolean} [snapBaselineLabel=false] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
export let snapBaselineLabel = false;
/** @type {Boolean} [gridlines=true] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
/** @type {boolean} [gridlines=true] - When labelPosition='even', adjust the lowest label so that it sits above the tick mark. */
export let gridlines = true;
/** @type {Number|undefined} [tickMarkLength=undefined] - The length of the tick mark. If not set, becomes the length of the widest tick. */
Expand Down
2 changes: 1 addition & 1 deletion src/_components/CirclePackForce.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/** @type {Number} [nodeStrokeWidth=1] - The circle's stroke width, in pixels. */
export let nodeStrokeWidth = 1;
/** @type {Boolean} [groupBy=true] - Group the nodes by the return value of the x-scale. If `false`, align all the nodes to the canvas center. */
/** @type {boolean} [groupBy=true] - Group the nodes by the return value of the x-scale. If `false`, align all the nodes to the canvas center. */
export let groupBy = true;
/* --------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/_components/Column.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/** @type {Number} [strokeWidth=0] - The shape's stroke width. */
export let strokeWidth = 0;
/** @type {Boolean} [false] - Show the numbers for each column */
/** @type {boolean} [false] - Show the numbers for each column */
export let showLabels = false;
$: columnWidth = d => {
Expand Down
2 changes: 1 addition & 1 deletion src/_components/Key.html.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/** @type {Function|Object|undefined} [lookup] - Either a function that takes the value and returns a formatted string, or an object of values. If a given value is not present in a lookup object, it returns the original value. */
export let lookup = undefined;
/** @type {Boolean} [capitalize=true] - Capitalize the first character. */
/** @type {boolean} [capitalize=true] - Capitalize the first character. */
export let capitalize = true;
const { zDomain, zScale } = getContext('LayerCake');
Expand Down
30 changes: 15 additions & 15 deletions src/content/guide/03-layercake-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Same as [x](/guide#x) but for the z dimension.

Same as [x](/guide#x) but for the r dimension.

### debug `Boolean`
### debug `boolean`

If this is `true`, Layer Cake will print to the control a helpful debug message.

Expand Down Expand Up @@ -223,21 +223,21 @@ Same as [xDomain](/guide#xdomain) but for the z scale.

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

### xDomainSort `Boolean=true`
### xDomainSort `boolean=true`

Taken into account only when the x-scale is ordinal. It sets whether the calculated unique items come back sorted. It uses [d3.ascending](https://d3js.org/d3-array/sort#ascending) to do the sort calculation.

Set this to `false` if you want the unique items to appear in the order they were found in the data.

### yDomainSort `Boolean=true`
### yDomainSort `boolean=true`

Same as [xDomainSort](/guide#xdomainsort) but for the y domain.

### zDomainSort `Boolean=true`
### zDomainSort `boolean=true`

Same as [xDomainSort](/guide#xdomainsort) but for the z domain.

### rDomainSort `Boolean=true`
### rDomainSort `boolean=true`

Same as [xDomainSort](/guide#xdomainsort) but for the r domain.

Expand Down Expand Up @@ -265,19 +265,19 @@ Same as [xPadding](/guide#xpadding) but for the z domain.

Same as [xPadding](/guide#xpadding) but for the r domain.

### xNice `Boolean=false|Number`
### xNice `boolean=false|Number`

Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the x domain. This is a separate option instead of being one you can apply to a passed in scale because D3's "nice" transformation only works on existing domains and does not use a state to be able to tell if your existing scale wants to be nice. Can also pass `count` number as argument for greater control.

### yNice `Boolean=false|Number`
### yNice `boolean=false|Number`

Same as [xNice](/guide#xnice) but for the y domain.

### zNice `Boolean=false|Number`
### zNice `boolean=false|Number`

Same as [xNice](/guide#xnice) but for the z domain.

### rNice `Boolean=false|Number`
### rNice `boolean=false|Number`

Same as [xNice](/guide#xnice) but for the r domain.

Expand Down Expand Up @@ -319,25 +319,25 @@ Same as [xRange](/guide#xrange) but for the r scale. Override the default y rang

This overrides setting [rReverse](/guide#rreverse) to `true`.

### xReverse `Boolean=false`
### xReverse `boolean=false`

Reverse the default x range. By default this is `false` and the range is `[0, width]`.

This is ignored if you set [xRange](/guide#xrange).

### yReverse `Boolean=true`
### yReverse `boolean=true`

Reverse the default y range. By default this is `true` and the range is `[height, 0]` unless using `scaleBand` for yScale in which case this is `false`.

This is ignored if you set [yRange](/guide#yrange).

### zReverse `Boolean=false`
### zReverse `boolean=false`

Reverse the default z range. By default this is `false` and the range is `[0, width]`.

This is ignored if you set [zRange](/guide#zrange).

### rReverse `Boolean=false`
### rReverse `boolean=false`

Reverse the default r range. By default this is `false` and the range is `[1, 25]`.

Expand Down Expand Up @@ -409,13 +409,13 @@ Here's an example showing passing different data formats for extent calculation
</style>
```

### ssr `Boolean=false`
### ssr `boolean=false`

Set whether this chart should be rendered server side. This is best used in conjunction with the [ScaledSvg](guide#scaledsvg) component or HTML components that are set to use percentage scales since you won't know the size of the container at render time.

Use it in conjunction with [`percentRange={true}`](guide#percentrange) to easily set up your scales for a percent coordinate systems.

### percentRange `Boolean=false`
### percentRange `boolean=false`

When rendering charts server side, you pretty much always want your scale range to be `[0, 100]` since you won't be able to base the range off of the target container's width. Use this convenience helper to set the ranges for any field that has an accessor to just that.

Expand Down
4 changes: 2 additions & 2 deletions src/content/guide/06-layout-component-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Layout component props
In addition to the [accessibility props](guide#accessibility) described above, all layout components accept the following props:

- [zIndex](guide#zindex) `Number|String`
- [pointerEvents](guide#pointerevents) `Boolean`
- [pointerEvents](guide#pointerevents) `boolean`

The Svg and ScaledSvg layout components also accept:

Expand Down Expand Up @@ -62,7 +62,7 @@ This lets you fine-tune your layering and is useful if you want your layers to b
</LayerCake>
```

### pointerEvents `Boolean|undefined`
### pointerEvents `boolean|undefined`

Useful for tooltip layers that need to be display above chart elements but not capture mouse events. Defaults to no `pointer-events` CSS being set. Set to `false` to set `pointer-events: none;`

Expand Down
4 changes: 2 additions & 2 deletions src/content/guide/99-helper-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ console.log(extents);
*/
```

### calcUniques(flatData: `Array`, fields: `{x?: Function, y?: Function, z?: Function, r?: Function}`[, sortOptions: { sort: `Boolean`, x: `Boolean`, y: `Boolean`, z: `Boolean`, r: `Boolean` }])
### calcUniques(flatData: `Array`, fields: `{x?: Function, y?: Function, z?: Function, r?: Function}`[, sortOptions: { sort: `boolean`, x: `boolean`, y: `boolean`, z: `boolean`, r: `boolean` }])

The same API and behavior as `calcExtents` but instead of a two-value array of `[min, max]` values, it returns an array of unique items.

Expand Down Expand Up @@ -495,7 +495,7 @@ stack(data, ['apples', 'bananas', 'cherries', 'dates'])
]
```

### uniques(data: `Array`[, accessor: `String|Function`, transform: `Boolean=true`])
### uniques(data: `Array`[, accessor: `String|Function`, transform: `boolean=true`])

A function to get the unique values from a list. If **accessor** is specified, the uniqueness will be compared using that and, by default, the values in the returned list of unique values will be values returned by the accessor. Accessor can also be the string name of the key. Pass `false` to the **transform** argument if you want to return the original elements, which will be the first one that appears for every unique value. The default for **transform** is `true`.

Expand Down
Loading

0 comments on commit e65d6b8

Please sign in to comment.