diff --git a/docs/.vitepress/theme/VersionBadge.vue b/docs/.vitepress/theme/VersionBadge.vue new file mode 100644 index 0000000000..f9f9924e6b --- /dev/null +++ b/docs/.vitepress/theme/VersionBadge.vue @@ -0,0 +1,12 @@ + + diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 5849c74989..2586ce3da3 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -3,6 +3,7 @@ import {useData} from "vitepress"; import {watch} from "vue"; import PlotRender from "../../components/PlotRender.js"; import CustomLayout from "./CustomLayout.vue"; +import VersionBadge from "./VersionBadge.vue"; import "./custom.css"; export default { @@ -11,6 +12,7 @@ export default { enhanceApp({app, router}) { Object.defineProperty(app.config.globalProperties, "$dark", {get: () => useData().isDark.value}); app.component("PlotRender", PlotRender); + app.component("VersionBadge", VersionBadge); enableAnalytics(router); } }; diff --git a/docs/components/links.js b/docs/components/links.js index 02c325810c..ed46b5fdfe 100644 --- a/docs/components/links.js +++ b/docs/components/links.js @@ -2,13 +2,14 @@ import {readdir, readFile, stat} from "fs/promises"; // Anchors can be derived from headers, or explicitly written as {#names}. export function getAnchors(text) { + text = text.replace(/<(?:Version)?Badge[^/]*\/>/g, ""); // ignore badges const anchors = []; for (const [, header] of text.matchAll(/^#+ ([*\w][*().,\w\d -]+)\n/gm)) { anchors.push( header - .replaceAll(/[^\w\d\s]+/g, " ") + .replace(/[^\w\d\s]+/g, " ") .trim() - .replaceAll(/ +/g, "-") + .replace(/ +/g, "-") .toLowerCase() ); } diff --git a/docs/features/curves.md b/docs/features/curves.md index 1f6969df49..a01780b4c5 100644 --- a/docs/features/curves.md +++ b/docs/features/curves.md @@ -79,7 +79,7 @@ The following named curve methods are supported: * *step* - a piecewise constant function where *y* changes at the midpoint of *x* * *step-after* - a piecewise constant function where *y* changes after *x* * *step-before* - a piecewise constant function where *x* changes after *y* -* *auto* - like *linear*, but use the (possibly spherical) [projection](./projections.md), if any +* *auto* - like *linear*, but use the (possibly spherical) [projection](./projections.md), if any If **curve** is a function, it will be invoked with a given *context* in the same fashion as a [D3 curve factory](https://d3js.org/d3-shape/curve#custom-curves). The *auto* curve is only available for the [line mark](../marks/line.md) and [link mark](../marks/link.md) and is typically used in conjunction with a spherical [projection](./projections.md) to interpolate along [geodesics](https://en.wikipedia.org/wiki/Geodesic). diff --git a/docs/features/facets.md b/docs/features/facets.md index a4bf230f69..565cb4fcab 100644 --- a/docs/features/facets.md +++ b/docs/features/facets.md @@ -232,7 +232,7 @@ Plot.plot({ ## Mark facet options -Facets can be defined for each mark via the **fx** or **fy** channels. The **fx** and **fy** channels are computed prior to the [mark’s transform](./transforms.md), if any (*i.e.*, facet channels are not transformed). Alternatively, the [**facet** plot option](#plot-facet-options) allows top-level faceting based on data. +Facets can be defined for each mark via the **fx** or **fy** channels. The **fx** and **fy** channels are computed prior to the [mark’s transform](./transforms.md), if any (*i.e.*, facet channels are not transformed). Alternatively, the [**facet** plot option](#plot-facet-options) allows top-level faceting based on data. Faceting can be explicitly enabled or disabled on a mark with the **facet** option, which accepts the following values: @@ -245,7 +245,7 @@ Faceting can be explicitly enabled or disabled on a mark with the **facet** opti When mark-level faceting is used, the default *auto* setting is equivalent to *include*: the mark will be faceted if either the **fx** or **fy** channel option (or both) is specified. The null or false option will disable faceting, while *exclude* draws the subset of the mark’s data *not* in the current facet. When a mark uses *super* faceting, it is not allowed to use position scales (*x*, *y*, *fx*, or *fy*); *super* faceting is intended for decorations, such as labels and legends. -The **facetAnchor** option controls the placement of the mark with respect to the facets. Based on the value, the mark will be displayed on: +The **facetAnchor** option controls the placement of the mark with respect to the facets. Based on the value, the mark will be displayed on: * null - non-empty facets * *top*, *right*, *bottom*, or *left* - the given side diff --git a/docs/features/legends.md b/docs/features/legends.md index 60587c2afc..c9ed5d4e3b 100644 --- a/docs/features/legends.md +++ b/docs/features/legends.md @@ -89,7 +89,7 @@ Categorical and ordinal color legends are rendered as swatches, unless the **leg * **columns** - the number of swatches per row * **marginLeft** - the legend’s left margin * **className** - a class name, that defaults to a randomly generated string scoping the styles -* **opacity** - the swatch fill opacity +* **opacity** - the swatch fill opacity * **width** - the legend’s width (in pixels) Symbol legends are rendered as swatches and support the options above in addition to the following options: diff --git a/docs/features/marks.md b/docs/features/marks.md index b32370e633..c93c7e28a7 100644 --- a/docs/features/marks.md +++ b/docs/features/marks.md @@ -476,7 +476,7 @@ All marks support the following style options: * **strokeDashoffset** - the [stroke dash offset](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset) (typically in pixels) * **opacity** - object opacity (a number between 0 and 1) * **mixBlendMode** - the [blend mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) (*e.g.*, *multiply*) -* **imageFilter** - a CSS [filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) (*e.g.*, *blur(5px)*) +* **imageFilter** - a CSS [filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) (*e.g.*, *blur(5px)*) * **shapeRendering** - the [shape-rendering mode](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering) (*e.g.*, *crispEdges*) * **paintOrder** - the [paint order](https://developer.mozilla.org/en-US/docs/Web/CSS/paint-order) (*e.g.*, *stroke*) * **dx** - horizontal offset (in pixels; defaults to 0) @@ -486,7 +486,7 @@ All marks support the following style options: * **ariaHidden** - if true, hide this content from the accessibility tree * **pointerEvents** - the [pointer events](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events) (*e.g.*, *none*) * **clip** - whether and how to clip the mark -* **tip** - whether to generate an implicit [pointer](../interactions/pointer.md) [tip](../marks/tip.md) +* **tip** - whether to generate an implicit [pointer](../interactions/pointer.md) [tip](../marks/tip.md) If the **clip** option is *frame* (or equivalently true), the mark is clipped to the frame’s dimensions; if the **clip** option is null (or equivalently false), the mark is not clipped. If the **clip** option is *sphere*, then a [geographic projection](./projections.md) is required and the mark will be clipped to the projected sphere (_e.g._, the front hemisphere when using the orthographic projection). diff --git a/docs/features/plots.md b/docs/features/plots.md index 4096b287f1..1770965608 100644 --- a/docs/features/plots.md +++ b/docs/features/plots.md @@ -218,7 +218,7 @@ The default **width** is 640. On Observable, the width can be set to the [standa Plot does not adjust margins automatically to make room for long tick labels. If your *y* axis labels are too long, you can increase the **marginLeft** to make more room. Also consider using a different **tickFormat** for short labels (*e.g.*, `s` for SI prefix notation), or a scale **transform** (say to convert units to millions or billions). ::: -The **aspectRatio** option, if not null, computes a default **height** such that a variation of one unit in the *x* dimension is represented by the corresponding number of pixels as a variation in the *y* dimension of one unit. +The **aspectRatio** option , if not null, computes a default **height** such that a variation of one unit in the *x* dimension is represented by the corresponding number of pixels as a variation in the *y* dimension of one unit.