diff --git a/src/_components/Area-D3.svelte b/src/_components/Area-D3.svelte
index 88f84742..243b51e7 100644
--- a/src/_components/Area-D3.svelte
+++ b/src/_components/Area-D3.svelte
@@ -8,7 +8,7 @@
const { data, xGet, yGet, yScale } = getContext('LayerCake');
- /** @type {String} [fill='#ab00d610'] - The shape's fill color. This is technically optional because it comes with a default value but you'll likely want to replace it with your own color. */
+ /** @type {string} [fill='#ab00d610'] - The shape's fill color. This is technically optional because it comes with a default value but you'll likely want to replace it with your own color. */
export let fill = '#ab00d610';
/** @type {Function} [curve=curveLinear] - An optional D3 interpolation function. See [d3-shape](https://github.com/d3/d3-shape#curves) for options. Pass this function in uncalled, i.e. without the open-close parentheses. */
diff --git a/src/_components/Area.svelte b/src/_components/Area.svelte
index 9c499f5b..6b0a30ca 100644
--- a/src/_components/Area.svelte
+++ b/src/_components/Area.svelte
@@ -7,7 +7,7 @@
const { data, xGet, yGet, xScale, yScale, extents } = getContext('LayerCake');
- /** @type {String} [fill='#ab00d610'] The shape's fill color. This is technically optional because it comes with a default value but you'll likely want to replace it with your own color. */
+ /** @type {string} [fill='#ab00d610'] The shape's fill color. This is technically optional because it comes with a default value but you'll likely want to replace it with your own color. */
export let fill = '#ab00d610';
$: path =
@@ -18,7 +18,7 @@
})
.join('L');
- /** @type {String} **/
+ /** @type {string} **/
let area;
$: {
diff --git a/src/_components/ArrowheadMarker.svelte b/src/_components/ArrowheadMarker.svelte
index 40a9a85a..e19c81f6 100644
--- a/src/_components/ArrowheadMarker.svelte
+++ b/src/_components/ArrowheadMarker.svelte
@@ -3,10 +3,10 @@
Generates an SVG marker containing a marker for a triangle makes a nice arrowhead. Add it to the named slot called "defs" on the SVG layout component.
-->
diff --git a/src/_components/Arrows.svelte b/src/_components/Arrows.svelte
index b31272f2..818dabf8 100644
--- a/src/_components/Arrows.svelte
+++ b/src/_components/Arrows.svelte
@@ -9,10 +9,10 @@
/** @type {Array} annotations - A list of annotation objects. See the [Column](https://layercake.graphics/example/Column) chart example for the schema and options. */
export let annotations = [];
- /** @type {String} [annotationClass='.layercake-annotation'] - The class name of the text annotation divs. */
+ /** @type {string} [annotationClass='.layercake-annotation'] - The class name of the text annotation divs. */
export let containerClass = '.chart-container';
- /** @type {String} [containerClass='.chart-container'] - The class name / CSS selector of the parent element of the `` component. This is used to crawl the DOM for the text annotations. */
+ /** @type {string} [containerClass='.chart-container'] - The class name / CSS selector of the parent element of the `` component. This is used to crawl the DOM for the text annotations. */
export let annotationClass = '.layercake-annotation';
let container;
diff --git a/src/_components/AxisX.percent-range.html.svelte b/src/_components/AxisX.percent-range.html.svelte
index 424c702d..fe35fefe 100644
--- a/src/_components/AxisX.percent-range.html.svelte
+++ b/src/_components/AxisX.percent-range.html.svelte
@@ -39,7 +39,7 @@
/** @type {Number} [dy=0] - Any optional value passed to the `dy` attribute on the text label. */
export let dy = 0;
- /** @type {String} units - Whether this component should use percentage or pixel values. If `percentRange={true}` it defaults to `'%'`. Options: `'%'` or `'px'`. */
+ /** @type {string} units - Whether this component should use percentage or pixel values. If `percentRange={true}` it defaults to `'%'`. Options: `'%'` or `'px'`. */
export let units = $percentRange === true ? '%' : 'px';
$: tickLen = tickMarks === true ? tickMarkLength ?? 6 : 0;
diff --git a/src/_components/AxisXTop.percent-range.html.svelte b/src/_components/AxisXTop.percent-range.html.svelte
index 4eca4498..cd3d2828 100644
--- a/src/_components/AxisXTop.percent-range.html.svelte
+++ b/src/_components/AxisXTop.percent-range.html.svelte
@@ -39,7 +39,7 @@
/** @type {Number} [dy=0] - Any optional value passed to the `dy` attribute on the text label. */
export let dy = 0;
- /** @type {String} units - Whether this component should use percentage or pixel values. If `percentRange={true}` it defaults to `'%'`. Options: `'%'` or `'px'`. */
+ /** @type {string} units - Whether this component should use percentage or pixel values. If `percentRange={true}` it defaults to `'%'`. Options: `'%'` or `'px'`. */
export let units = $percentRange === true ? '%' : 'px';
$: tickLen = tickMarks === true ? tickMarkLength ?? 6 : 0;
diff --git a/src/_components/AxisY.percent-range.html.svelte b/src/_components/AxisY.percent-range.html.svelte
index 0001212c..4d0a391b 100644
--- a/src/_components/AxisY.percent-range.html.svelte
+++ b/src/_components/AxisY.percent-range.html.svelte
@@ -12,7 +12,7 @@
/** @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'. */
+ /** @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. */
@@ -42,7 +42,7 @@
/** @type {Number} [charPixelWidth=7.25] - Used to calculate the widest label length to offset labels. Adjust if the automatic tick length doesn't look right because you have a bigger font (or just set `tickMarkLength` to a pixel value). */
export let charPixelWidth = 7.25;
- /** @type {String} units - Whether this component should use percentage or pixel values. If `percentRange={true}` it defaults to `'%'`. Options: `'%'` or `'px'`. */
+ /** @type {string} units - Whether this component should use percentage or pixel values. If `percentRange={true}` it defaults to `'%'`. Options: `'%'` or `'px'`. */
export let units = $percentRange === true ? '%' : 'px';
$: isBandwidth = typeof $yScale.bandwidth === 'function';
@@ -57,7 +57,7 @@
: $yScale.ticks(ticks);
/** @param {Number} sum
- * @param {String} val */
+ * @param {string} val */
function calcStringLength(sum, val) {
if (val === ',' || val === '.') return sum + charPixelWidth * 0.5;
return sum + charPixelWidth;
diff --git a/src/_components/AxisY.svelte b/src/_components/AxisY.svelte
index 435819e3..2bf762bf 100644
--- a/src/_components/AxisY.svelte
+++ b/src/_components/AxisY.svelte
@@ -10,7 +10,7 @@
/** @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'. */
+ /** @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. */
@@ -52,7 +52,7 @@
: $yScale.ticks(ticks);
/** @param {Number} sum
- * @param {String} val */
+ * @param {string} val */
function calcStringLength(sum, val) {
if (val === ',' || val === '.') return sum + charPixelWidth * 0.5;
return sum + charPixelWidth;
diff --git a/src/_components/AxisYRight.percent-range.html.svelte b/src/_components/AxisYRight.percent-range.html.svelte
index f821c4b6..e220fa0a 100644
--- a/src/_components/AxisYRight.percent-range.html.svelte
+++ b/src/_components/AxisYRight.percent-range.html.svelte
@@ -12,7 +12,7 @@
/** @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'. */
+ /** @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. */
@@ -42,7 +42,7 @@
/** @type {Number} [charPixelWidth=7.25] - Used to calculate the widest label length to offset labels. Adjust if the automatic tick length doesn't look right because you have a bigger font (or just set `tickMarkLength` to a pixel value). */
export let charPixelWidth = 7.25;
- /** @type {String} units - Whether this component should use percentage or pixel values. If `percentRange={true}` it defaults to `'%'`. Options: `'%'` or `'px'`. */
+ /** @type {string} units - Whether this component should use percentage or pixel values. If `percentRange={true}` it defaults to `'%'`. Options: `'%'` or `'px'`. */
export let units = $percentRange === true ? '%' : 'px';
$: isBandwidth = typeof $yScale.bandwidth === 'function';
@@ -57,7 +57,7 @@
: $yScale.ticks(ticks);
/** @param {Number} sum
- * @param {String} val */
+ * @param {string} val */
function calcStringLength(sum, val) {
if (val === ',' || val === '.') return sum + charPixelWidth * 0.5;
return sum + charPixelWidth;
diff --git a/src/_components/AxisYRight.svelte b/src/_components/AxisYRight.svelte
index e343896e..50a51014 100644
--- a/src/_components/AxisYRight.svelte
+++ b/src/_components/AxisYRight.svelte
@@ -10,7 +10,7 @@
/** @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. */
+ /** @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. */
@@ -52,7 +52,7 @@
: $yScale.ticks(ticks);
/** @param {Number} sum
- * @param {String} val */
+ * @param {string} val */
function calcStringLength(sum, val) {
if (val === ',' || val === '.') return sum + charPixelWidth * 0.5;
return sum + charPixelWidth;
diff --git a/src/_components/Bar.svelte b/src/_components/Bar.svelte
index 9ff9cc9b..69513fdb 100644
--- a/src/_components/Bar.svelte
+++ b/src/_components/Bar.svelte
@@ -7,7 +7,7 @@
const { data, xGet, yGet, xScale, yScale } = getContext('LayerCake');
- /** @type {String} [fill='#00bbff'] - The shape's fill color. This is technically optional because it comes with a default value but you'll likely want to replace it with your own color. */
+ /** @type {string} [fill='#00bbff'] - The shape's fill color. This is technically optional because it comes with a default value but you'll likely want to replace it with your own color. */
export let fill = '#00bbff';
diff --git a/src/_components/Beeswarm.html.svelte b/src/_components/Beeswarm.html.svelte
index 86276cae..c9fa54f4 100644
--- a/src/_components/Beeswarm.html.svelte
+++ b/src/_components/Beeswarm.html.svelte
@@ -13,7 +13,7 @@
/** @type {Number} [strokeWidth=0] - The circle's stroke width in pixels. */
export let strokeWidth = 0;
- /** @type {String} [stroke='#fff'] - The circle's stroke color. */
+ /** @type {string} [stroke='#fff'] - The circle's stroke color. */
export let stroke = '#fff';
/** @type {Number} [spacing=1.5] - Spacing, in pixels, between each circle. */
diff --git a/src/_components/Beeswarm.svelte b/src/_components/Beeswarm.svelte
index 2f5f6091..0d423da4 100644
--- a/src/_components/Beeswarm.svelte
+++ b/src/_components/Beeswarm.svelte
@@ -13,7 +13,7 @@
/** @type {Number} [strokeWidth=0] - The circle's stroke width in pixels. */
export let strokeWidth = 0;
- /** @type {String} [stroke='#fff'] - The circle's stroke color. */
+ /** @type {string} [stroke='#fff'] - The circle's stroke color. */
export let stroke = '#fff';
/** @type {Number} [spacing=1.5] - Whitespace padding between each circle, in pixels */
diff --git a/src/_components/BeeswarmForce.html.svelte b/src/_components/BeeswarmForce.html.svelte
index 206c1bdb..739d6878 100644
--- a/src/_components/BeeswarmForce.html.svelte
+++ b/src/_components/BeeswarmForce.html.svelte
@@ -16,7 +16,7 @@
/** @type {Number} [strokeWidth=0.5] - The circle's stroke width in pixels. */
export let strokeWidth = 0.5;
- /** @type {String} [stroke='#fff'] - The circle's stroke color. */
+ /** @type {string} [stroke='#fff'] - The circle's stroke color. */
export let stroke = '#fff';
/** @type {Number} [xStrength=0.95] - The value passed into the `.strength` method on `forceX`, which is used as the `'x'` property on the simulation. See [the documentation](https://github.com/d3/d3-force#x_strength) for more. */
diff --git a/src/_components/BeeswarmForce.svelte b/src/_components/BeeswarmForce.svelte
index 7e5ac18c..a733fc0a 100644
--- a/src/_components/BeeswarmForce.svelte
+++ b/src/_components/BeeswarmForce.svelte
@@ -16,7 +16,7 @@
/** @type {Number} [strokeWidth=1] - The circle's stroke width in pixels. */
export let strokeWidth = 1;
- /** @type {String} [stroke='#fff'] - The circle's stroke color. */
+ /** @type {string} [stroke='#fff'] - The circle's stroke color. */
export let stroke = '#fff';
/** @type {Number} [xStrength=0.95] - The value passed into the `.strength` method on `forceX`. See [the documentation](https://github.com/d3/d3-force#x_strength). */
diff --git a/src/_components/CirclePack.html.svelte b/src/_components/CirclePack.html.svelte
index 4359cd83..adf8094a 100644
--- a/src/_components/CirclePack.html.svelte
+++ b/src/_components/CirclePack.html.svelte
@@ -9,31 +9,31 @@
const { width, height, data } = getContext('LayerCake');
- /** @type {String} [idKey='id'] - The key on each object where the id value lives. */
+ /** @type {string} [idKey='id'] - The key on each object where the id value lives. */
export let idKey = 'id';
- /** @type {String|undefined} [parentKey] - Set this if you want to define one parent circle. This will give you a [nested](https://layercake.graphics/example/CirclePackNested) graphic versus a [grouping of circles](https://layercake.graphics/example/CirclePack). */
+ /** @type {string|undefined} [parentKey] - Set this if you want to define one parent circle. This will give you a [nested](https://layercake.graphics/example/CirclePackNested) graphic versus a [grouping of circles](https://layercake.graphics/example/CirclePack). */
export let parentKey = undefined;
- /** @type {String} [valueKey='value'] - The key on each object where the data value lives. */
+ /** @type {string} [valueKey='value'] - The key on each object where the data value lives. */
export let valueKey = 'value';
/** @type {Function} [labelVisibilityThreshold=r => r > 25] - By default, only show the text inside a circle if its radius exceeds a certain size. Provide your own function for different behavior. */
export let labelVisibilityThreshold = r => r > 25;
- /** @type {String} [fill='#fff'] - The circle's fill color. */
+ /** @type {string} [fill='#fff'] - The circle's fill color. */
export let fill = '#fff';
- /** @type {String} [stroke='#999'] - The circle's stroke color. */
+ /** @type {string} [stroke='#999'] - The circle's stroke color. */
export let stroke = '#999';
/** @type {Number} [strokeWidth=1] - The circle's stroke width, in pixels. */
export let strokeWidth = 1;
- /** @type {String} [textColor='#333'] - The label text color. */
+ /** @type {string} [textColor='#333'] - The label text color. */
export let textColor = '#333';
- /** @type {String} [textStroke='#000'] - The label text's stroke color. */
+ /** @type {string} [textStroke='#000'] - The label text's stroke color. */
export let textStroke = '#000';
/** @type {Number} [textStrokeWidth=0] - The label text's stroke width, in pixels. */
diff --git a/src/_components/CirclePackForce.svelte b/src/_components/CirclePackForce.svelte
index aca57ece..b9a2da57 100644
--- a/src/_components/CirclePackForce.svelte
+++ b/src/_components/CirclePackForce.svelte
@@ -14,10 +14,10 @@
/** @type {Number} [xStrength=0.1] - The value passed into the `.strength` method on `forceX`, which is used as the `'x'` property on the simulation. See [the documentation](https://github.com/d3/d3-force#x_strength) for more. */
export let xStrength = 0.1;
- /** @type {String|undefined} [nodeColor] Set a color manually otherwise it will default to the `zScale`. */
+ /** @type {string|undefined} [nodeColor] Set a color manually otherwise it will default to the `zScale`. */
export let nodeColor = undefined;
- /** @type {String} [nodeStroke='#fff'] - The circle's stroke color. */
+ /** @type {string} [nodeStroke='#fff'] - The circle's stroke color. */
export let nodeStroke = '#fff';
/** @type {Number} [nodeStrokeWidth=1] - The circle's stroke width, in pixels. */
diff --git a/src/_components/Column.svelte b/src/_components/Column.svelte
index 43051dc9..01755470 100644
--- a/src/_components/Column.svelte
+++ b/src/_components/Column.svelte
@@ -7,10 +7,10 @@
const { data, xGet, yGet, x, yRange, xScale, y, height } = getContext('LayerCake');
- /** @type {String} [fill='#00e047'] - The shape's fill color. */
+ /** @type {string} [fill='#00e047'] - The shape's fill color. */
export let fill = '#00e047';
- /** @type {String} [stroke='#000'] - The shape's stroke color. */
+ /** @type {string} [stroke='#000'] - The shape's stroke color. */
export let stroke = '#000';
/** @type {Number} [strokeWidth=0] - The shape's stroke width. */
diff --git a/src/_components/Key.html.svelte b/src/_components/Key.html.svelte
index 7097b57e..cce79323 100644
--- a/src/_components/Key.html.svelte
+++ b/src/_components/Key.html.svelte
@@ -5,10 +5,10 @@
```
-### stack(data: `Array|Object`[, keys: `String[]`, { domain: `Array`, thresholds: `Array` }])
+### stack(data: `Array|Object`[, keys: `string[]`, { domain: `Array`, thresholds: `Array` }])
This function is a wrapper around the `stack` function in [d3-shape](https://github.com/d3/d3-shape#stacks).
@@ -455,10 +455,10 @@ The component has the following props:
- **data** `Array|Object`
- The data to be stacked.
-- **keys** `String[]`
+- **keys** `string[]`
- The series names to stack, passed to [`stack.keys()`](https://github.com/d3/d3-shape#stack_keys).
- **options** `Object` Options object
-- **options.value** `Function|String`
+- **options.value** `Function|string`
- Optional. An accessor function passed to [`stack.value()`](https://github.com/d3/d3-shape#stack_value). If this is a string, it will be transformed into an accessor for that key.
- **options.order** `Array|Function`
- Optional. The stack order passed to [`stack.order()`](https://github.com/d3/d3-shape#stack_order).
@@ -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`.
diff --git a/src/lib/LayerCake.svelte b/src/lib/LayerCake.svelte
index 37835a30..a0539cf8 100644
--- a/src/lib/LayerCake.svelte
+++ b/src/lib/LayerCake.svelte
@@ -25,7 +25,7 @@
export let ssr = false;
/** @type {Boolean} [pointerEvents=true] Whether to allow pointer events via CSS. Set this to `false` to set `pointer-events: none;` on all components, disabling all mouse interaction. */
export let pointerEvents = true;
- /** @type {String} [position='relative'] Determine the positioning of the wrapper div. Set this to `'absolute'` when you want to stack cakes. */
+ /** @type {string} [position='relative'] Determine the positioning of the wrapper div. Set this to `'absolute'` when you want to stack cakes. */
export let position = 'relative';
/** @type {Boolean} [percentRange=false] If `true`, set all scale ranges to `[0, 100]`. Ranges reversed via `xReverse`, `yReverse`, `zReverse` or `rReverse` props will continue to be reversed as usual. */
export let percentRange = false;
@@ -50,25 +50,25 @@
*
*/
- /** @type {String|Function|Number|Array|undefined} x The x accessor. The key in each row of data that corresponds to the x-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
+ /** @type {string|Function|Number|Array|undefined} x The x accessor. The key in each row of data that corresponds to the x-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
export let x = undefined;
- /** @type {String|Function|Number|Array|undefined} y The y accessor. The key in each row of data that corresponds to the y-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
+ /** @type {string|Function|Number|Array|undefined} y The y accessor. The key in each row of data that corresponds to the y-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
export let y = undefined;
- /** @type {String|Function|Number|Array|undefined} z The z accessor. The key in each row of data that corresponds to the z-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
+ /** @type {string|Function|Number|Array|undefined} z The z accessor. The key in each row of data that corresponds to the z-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
export let z = undefined;
- /** @type {String|Function|Number|Array|undefined} r The r accessor. The key in each row of data that corresponds to the r-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
+ /** @type {string|Function|Number|Array|undefined} r The r accessor. The key in each row of data that corresponds to the r-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
export let r = undefined;
/** @type {Array