From 1b251dfd351f617a73f319505e1cf0c6190a814b Mon Sep 17 00:00:00 2001 From: Duane Millar Barlow Date: Wed, 21 Sep 2022 17:11:36 -0400 Subject: [PATCH 01/23] jsdoc snapshot --- src/marks/area.js | 14 +++ src/marks/arrow.js | 3 + src/marks/bar.js | 11 +++ src/marks/box.js | 11 +++ src/marks/cell.js | 14 +++ src/marks/delaunay.js | 25 +++++ src/marks/density.js | 8 ++ src/marks/dot.js | 20 ++++ src/marks/image.js | 3 + src/marks/line.js | 14 +++ src/marks/linearRegression.js | 11 +++ src/marks/link.js | 3 + src/marks/rect.js | 14 +++ src/marks/rule.js | 11 +++ src/marks/text.js | 14 +++ src/marks/tick.js | 11 +++ src/marks/tree.js | 11 +++ src/marks/vector.js | 14 +++ src/plot.js | 6 ++ src/types.ts | 178 ++++++++++++++++++++++++++++++++++ 20 files changed, 396 insertions(+) create mode 100644 src/types.ts diff --git a/src/marks/area.js b/src/marks/area.js index 1234b16e2c..2d44f4e7fe 100644 --- a/src/marks/area.js +++ b/src/marks/area.js @@ -14,6 +14,11 @@ import {maybeDenseIntervalX, maybeDenseIntervalY} from "../transforms/bin.js"; import {maybeIdentityX, maybeIdentityY} from "../transforms/identity.js"; import {maybeStackX, maybeStackY} from "../transforms/stack.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "area", strokeWidth: 1, @@ -85,6 +90,9 @@ export class Area extends Mark { * [Plot.areaX](https://github.com/observablehq/plot/blob/main/README.md#plotareaxdata-options) * is used in the vertical orientation where the baseline and topline share *y* * values. + * + * @param {Data} data + * @param {MarkOptions} options */ export function area(data, options) { if (options === undefined) return areaY(data, {x: first, y: second}); @@ -121,6 +129,9 @@ export function area(data, options) { * The **interval** option is recommended to “regularize” sampled data; for * example, if your data represents timestamped temperature measurements and you * expect one sample per day, use d3.utcDay as the interval. + * + * @param {Data} data + * @param {MarkOptions} options */ export function areaX(data, options) { const {y = indexOf, ...rest} = maybeDenseIntervalY(options); @@ -157,6 +168,9 @@ export function areaX(data, options) { * The **interval** option is recommended to “regularize” sampled data; for * example, if your data represents timestamped temperature measurements and you * expect one sample per day, use d3.utcDay as the interval. + * + * @param {Data} data + * @param {MarkOptions} options */ export function areaY(data, options) { const {x = indexOf, ...rest} = maybeDenseIntervalX(options); diff --git a/src/marks/arrow.js b/src/marks/arrow.js index 79fbefa392..139a1f20d3 100644 --- a/src/marks/arrow.js +++ b/src/marks/arrow.js @@ -182,6 +182,9 @@ function circleCircleIntersect([ax, ay, ar], [bx, by, br], sign) { * ``` * * Returns a new arrow with the given *data* and *options*. + * + * @param {import("../types.js").Data} data + * @param {import("../types.js").MarkOptions} options */ export function arrow(data, options = {}) { let {x, x1, x2, y, y1, y2, ...remainingOptions} = options; diff --git a/src/marks/bar.js b/src/marks/bar.js index 0a3874f981..b526973b26 100644 --- a/src/marks/bar.js +++ b/src/marks/bar.js @@ -14,6 +14,11 @@ import {maybeIdentityX, maybeIdentityY} from "../transforms/identity.js"; import {maybeIntervalX, maybeIntervalY} from "../transforms/interval.js"; import {maybeStackX, maybeStackY} from "../transforms/stack.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + export class AbstractBar extends Mark { constructor(data, channels, options = {}, defaults) { super(data, channels, options, defaults); @@ -163,6 +168,9 @@ export class BarY extends AbstractBar { * * If the **y** channel is not specified, the bar will span the full vertical * extent of the plot (or facet). + * + * @param {Data} data + * @param {MarkOptions} options */ export function barX(data, options = {y: indexOf, x2: identity}) { return new BarX(data, maybeStackX(maybeIntervalX(maybeIdentityX(options)))); @@ -203,6 +211,9 @@ export function barX(data, options = {y: indexOf, x2: identity}) { * * If the **x** channel is not specified, the bar will span the full horizontal * extent of the plot (or facet). + * + * @param {Data} data + * @param {MarkOptions} options */ export function barY(data, options = {x: indexOf, y2: identity}) { return new BarY(data, maybeStackY(maybeIntervalY(maybeIdentityY(options)))); diff --git a/src/marks/box.js b/src/marks/box.js index 6f18204d57..680e5258bd 100644 --- a/src/marks/box.js +++ b/src/marks/box.js @@ -7,6 +7,11 @@ import {dot} from "./dot.js"; import {ruleX, ruleY} from "./rule.js"; import {tickX, tickY} from "./tick.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + /** * ```js * Plot.boxX(simpsons.map(d => d.imdb_rating)) @@ -16,6 +21,9 @@ import {tickX, tickY} from "./tick.js"; * defaults to the identity function, as when *data* is an array of numbers. If * the **y** option is not specified, it defaults to null; if the **y** option * is specified, it should represent an ordinal (discrete) value. + * + * @param {Data} data + * @param {MarkOptions} options */ export function boxX(data, options = {}) { // Returns a composite mark for producing a horizontal box plot, applying the @@ -49,6 +57,9 @@ export function boxX(data, options = {}) { * defaults to the identity function, as when *data* is an array of numbers. If * the **x** option is not specified, it defaults to null; if the **x** option * is specified, it should represent an ordinal (discrete) value. + * + * @param {Data} data + * @param {MarkOptions} options */ export function boxY(data, options = {}) { // Returns a composite mark for producing a vertical box plot, applying the diff --git a/src/marks/cell.js b/src/marks/cell.js index 6df7557432..42cba28e23 100644 --- a/src/marks/cell.js +++ b/src/marks/cell.js @@ -2,6 +2,11 @@ import {identity, indexOf, maybeColorChannel, maybeTuple} from "../options.js"; import {applyTransform} from "../style.js"; import {AbstractBar} from "./bar.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "cell" }; @@ -33,6 +38,9 @@ export class Cell extends AbstractBar { * nor **y** options are specified, *data* is assumed to be an array of pairs * [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, * *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + * + * @param {Data} data + * @param {MarkOptions} options */ export function cell(data, options = {}) { let {x, y, ...remainingOptions} = options; @@ -51,6 +59,9 @@ export function cell(data, options = {}) { * …], and if the **fill** option is not specified and **stroke** is not a * channel, the fill defaults to the identity function and assumes that *data* = * [*x₀*, *x₁*, *x₂*, …]. + * + * @param {Data} data + * @param {MarkOptions} options */ export function cellX(data, options = {}) { let {x = indexOf, fill, stroke, ...remainingOptions} = options; @@ -69,6 +80,9 @@ export function cellX(data, options = {}) { * …], and if the **fill** option is not specified and **stroke** is not a * channel, the fill defaults to the identity function and assumes that *data* = * [*y₀*, *y₁*, *y₂*, …]. + * + * @param {Data} data + * @param {MarkOptions} options */ export function cellY(data, options = {}) { let {y = indexOf, fill, stroke, ...remainingOptions} = options; diff --git a/src/marks/delaunay.js b/src/marks/delaunay.js index e80603db4f..8eeab2a8e2 100644 --- a/src/marks/delaunay.js +++ b/src/marks/delaunay.js @@ -12,6 +12,11 @@ import { } from "../style.js"; import {markers, applyMarkers} from "./marker.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const delaunayLinkDefaults = { ariaLabel: "delaunay link", fill: "none", @@ -289,6 +294,10 @@ function delaunayMark(DelaunayMark, data, {x, y, ...options} = {}) { * * If a **z** channel is specified, the input points are grouped by *z*, and * separate Delaunay triangulations are constructed for each group. + * + * @param {Data} data + * @param {MarkOptions} options + * @returns {DelaunayLink} */ export function delaunayLink(data, options) { return delaunayMark(DelaunayLink, data, options); @@ -304,6 +313,10 @@ export function delaunayLink(data, options) { * * If a **z** channel is specified, the input points are grouped by *z*, and * separate Delaunay triangulations are constructed for each group. + * + * @param {Data} data + * @param {MarkOptions} options + * @returns {DelaunayMesh} */ export function delaunayMesh(data, options) { return delaunayMark(DelaunayMesh, data, options); @@ -320,6 +333,10 @@ export function delaunayMesh(data, options) { * separate convex hulls are constructed for each group. If the **z** channel is * not specified, it defaults to either the **fill** channel, if any, or the * **stroke** channel, if any. + * + * @param {Data} data + * @param {MarkOptions} options + * @returns {Hull} */ export function hull(data, options) { return delaunayMark(Hull, data, options); @@ -331,6 +348,10 @@ export function hull(data, options) { * * If a **z** channel is specified, the input points are grouped by *z*, and * separate Voronoi tesselations are constructed for each group. + * + * @param {Data} data + * @param {MarkOptions} options + * @returns {Voronoi} */ export function voronoi(data, options) { return delaunayMark(Voronoi, data, options); @@ -346,6 +367,10 @@ export function voronoi(data, options) { * * If a **z** channel is specified, the input points are grouped by *z*, and * separate Voronoi tesselations are constructed for each group. + * + * @param {Data} data + * @param {MarkOptions} options + * @returns {VoronoiMesh} */ export function voronoiMesh(data, options) { return delaunayMark(VoronoiMesh, data, options); diff --git a/src/marks/density.js b/src/marks/density.js index a8d9cf2d93..d1aa914dde 100644 --- a/src/marks/density.js +++ b/src/marks/density.js @@ -12,6 +12,11 @@ import { } from "../style.js"; import {initializer} from "../transforms/basic.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "density", fill: "none", @@ -84,6 +89,9 @@ export class Density extends Mark { * series. If the **stroke** or **fill** is specified as *density*, a color * channel is constructed with values representing the density threshold value * of each contour. + * + * @param {Data} data + * @param {MarkOptions} options */ export function density(data, options = {}) { let {x, y, ...remainingOptions} = options; diff --git a/src/marks/dot.js b/src/marks/dot.js index 6b3e380cc5..35e9fdaad4 100644 --- a/src/marks/dot.js +++ b/src/marks/dot.js @@ -14,6 +14,11 @@ import {maybeSymbolChannel} from "../symbols.js"; import {sort} from "../transforms/basic.js"; import {maybeIntervalMidX, maybeIntervalMidY} from "../transforms/interval.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "dot", fill: "none", @@ -122,6 +127,9 @@ export class Dot extends Mark { * nor **y** nor **frameAnchor** options are specified, *data* is assumed to be * an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that * **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + * + * @param {Data} data + * @param {MarkOptions} options */ export function dot(data, options = {}) { let {x, y, ...remainingOptions} = options; @@ -143,6 +151,9 @@ export function dot(data, options = {}) { * (*interval*.floor(*y*) + *interval*.offset(*interval*.floor(*y*))) / 2. If * the interval is specified as a number *n*, *y* will be the midpoint of two * consecutive multiples of *n* that bracket *y*. + * + * @param {Data} data + * @param {MarkOptions} options */ export function dotX(data, options = {}) { const {x = identity, ...remainingOptions} = options; @@ -163,6 +174,9 @@ export function dotX(data, options = {}) { * (*interval*.floor(*x*) + *interval*.offset(*interval*.floor(*x*))) / 2. If * the interval is specified as a number *n*, *x* will be the midpoint of two * consecutive multiples of *n* that bracket *x*. + * + * @param {Data} data + * @param {MarkOptions} options */ export function dotY(data, options = {}) { const {y = identity, ...remainingOptions} = options; @@ -173,6 +187,9 @@ export function dotY(data, options = {}) { * Equivalent to * [Plot.dot](https://github.com/observablehq/plot/blob/main/README.md#plotdotdata-options) * except that the **symbol** option is set to *circle*. + * + * @param {Data} data + * @param {MarkOptions} options */ export function circle(data, options) { return dot(data, {...options, symbol: "circle"}); @@ -182,6 +199,9 @@ export function circle(data, options) { * Equivalent to * [Plot.dot](https://github.com/observablehq/plot/blob/main/README.md#plotdotdata-options) * except that the **symbol** option is set to *hexagon*. + * + * @param {Data} data + * @param {MarkOptions} options */ export function hexagon(data, options) { return dot(data, {...options, symbol: "hexagon"}); diff --git a/src/marks/image.js b/src/marks/image.js index efe203a40f..656beaad46 100644 --- a/src/marks/image.js +++ b/src/marks/image.js @@ -118,6 +118,9 @@ export class Image extends Mark { * nor **y** nor **frameAnchor** options are specified, *data* is assumed to be * an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that * **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + * + * @param {import("../types.js").Data} data + * @param {import("../types.js").MarkOptions} options */ export function image(data, options = {}) { let {x, y, ...remainingOptions} = options; diff --git a/src/marks/line.js b/src/marks/line.js index a4db931266..5d5f1ef6ab 100644 --- a/src/marks/line.js +++ b/src/marks/line.js @@ -13,6 +13,11 @@ import { import {maybeDenseIntervalX, maybeDenseIntervalY} from "../transforms/bin.js"; import {applyGroupedMarkers, markers} from "./marker.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "line", fill: "none", @@ -79,6 +84,9 @@ export class Line extends Mark { * nor **y** options are specified, *data* is assumed to be an array of pairs * [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, * *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + * + * @param {Data} data + * @param {MarkOptions} options */ export function line(data, options = {}) { let {x, y, ...remainingOptions} = options; @@ -111,6 +119,9 @@ export function line(data, options = {}) { * The **interval** option is recommended to “regularize” sampled data; for * example, if your data represents timestamped temperature measurements and you * expect one sample per day, use d3.utcDay as the interval. + * + * @param {Data} data + * @param {MarkOptions} options */ export function lineX(data, options = {}) { const {x = identity, y = indexOf, ...remainingOptions} = options; @@ -142,6 +153,9 @@ export function lineX(data, options = {}) { * The **interval** option is recommended to “regularize” sampled data; for * example, if your data represents timestamped temperature measurements and you * expect one sample per day, use d3.utcDay as the interval. + * + * @param {Data} data + * @param {MarkOptions} options */ export function lineY(data, options = {}) { const {x = indexOf, y = identity, ...remainingOptions} = options; diff --git a/src/marks/linearRegression.js b/src/marks/linearRegression.js index 7cdd44902d..dcce422119 100644 --- a/src/marks/linearRegression.js +++ b/src/marks/linearRegression.js @@ -6,6 +6,11 @@ import {qt} from "../stats.js"; import {applyDirectStyles, applyGroupedChannelStyles, applyIndirectStyles, applyTransform, groupZ} from "../style.js"; import {maybeDenseIntervalX, maybeDenseIntervalY} from "../transforms/bin.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "linear-regression", fill: "currentColor", @@ -129,6 +134,9 @@ class LinearRegressionY extends LinearRegression { * * Returns a linear regression mark where *x* is the dependent variable and *y* * is the independent variable. + * + * @param {Data} data + * @param {MarkOptions} options */ export function linearRegressionX(data, options = {}) { const { @@ -148,6 +156,9 @@ export function linearRegressionX(data, options = {}) { * * Returns a linear regression mark where *y* is the dependent variable and *x* * is the independent variable. + * + * @param {Data} data + * @param {MarkOptions} options */ export function linearRegressionY(data, options = {}) { const { diff --git a/src/marks/link.js b/src/marks/link.js index b4d9529c7d..3b799e63a4 100644 --- a/src/marks/link.js +++ b/src/marks/link.js @@ -64,6 +64,9 @@ export class Link extends Mark { * ``` * * Returns a new link with the given *data* and *options*. + * + * @param {import("../types.js").Data} data + * @param {import("../types.js").MarkOptions} options */ export function link(data, options = {}) { let {x, x1, x2, y, y1, y2, ...remainingOptions} = options; diff --git a/src/marks/rect.js b/src/marks/rect.js index b7a18b0192..6a0921472f 100644 --- a/src/marks/rect.js +++ b/src/marks/rect.js @@ -14,6 +14,11 @@ import {maybeIdentityX, maybeIdentityY} from "../transforms/identity.js"; import {maybeTrivialIntervalX, maybeTrivialIntervalY} from "../transforms/interval.js"; import {maybeStackX, maybeStackY} from "../transforms/stack.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "rect" }; @@ -94,6 +99,9 @@ export class Rect extends Mark { * ``` * * Returns a new rect with the given *data* and *options*. + * + * @param {Data} data + * @param {MarkOptions} options */ export function rect(data, options) { return new Rect(data, maybeTrivialIntervalX(maybeTrivialIntervalY(options))); @@ -112,6 +120,9 @@ export function rect(data, options) { * this is the typical configuration for a histogram with rects aligned at *x* = * 0. If the **x** option is not specified, it defaults to the identity * function. + * + * @param {Data} data + * @param {MarkOptions} options */ export function rectX(data, options = {y: indexOf, interval: 1, x2: identity}) { return new Rect(data, maybeStackX(maybeTrivialIntervalY(maybeIdentityX(options)))); @@ -130,6 +141,9 @@ export function rectX(data, options = {y: indexOf, interval: 1, x2: identity}) { * this is the typical configuration for a histogram with rects aligned at *y* = * 0. If the **y** option is not specified, it defaults to the identity * function. + * + * @param {Data} data + * @param {MarkOptions} options */ export function rectY(data, options = {x: indexOf, interval: 1, y2: identity}) { return new Rect(data, maybeStackY(maybeTrivialIntervalX(maybeIdentityY(options)))); diff --git a/src/marks/rule.js b/src/marks/rule.js index caedd29d89..b5c9c9c4f1 100644 --- a/src/marks/rule.js +++ b/src/marks/rule.js @@ -5,6 +5,11 @@ import {isCollapsed} from "../scales.js"; import {applyDirectStyles, applyIndirectStyles, applyTransform, applyChannelStyles, offset} from "../style.js"; import {maybeIntervalX, maybeIntervalY} from "../transforms/interval.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "rule", fill: null, @@ -137,6 +142,9 @@ export class RuleY extends Mark { * *y1*, and *interval*.offset(*y1*) is invoked for each *y1* to produce *y2*. * If the interval is specified as a number *n*, *y1* and *y2* are taken as the * two consecutive multiples of *n* that bracket *y*. + * + * @param {Data} data + * @param {MarkOptions} options */ export function ruleX(data, options) { let {x = identity, y, y1, y2, ...rest} = maybeIntervalY(options); @@ -175,6 +183,9 @@ export function ruleX(data, options) { * *x1*, and *interval*.offset(*x1*) is invoked for each *x1* to produce *x2*. * If the interval is specified as a number *n*, *x1* and *x2* are taken as the * two consecutive multiples of *n* that bracket *x*. + * + * @param {Data} data + * @param {MarkOptions} options */ export function ruleY(data, options) { let {y = identity, x, x1, x2, ...rest} = maybeIntervalX(options); diff --git a/src/marks/text.js b/src/marks/text.js index 8295272930..87c0e8253a 100644 --- a/src/marks/text.js +++ b/src/marks/text.js @@ -28,6 +28,11 @@ import { } from "../style.js"; import {maybeIntervalMidX, maybeIntervalMidY} from "../transforms/interval.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "text", strokeLinejoin: "round", @@ -162,6 +167,9 @@ function applyMultilineText(selection, {monospace, lineAnchor, lineHeight, lineW * **x** nor **y** nor **frameAnchor** options are specified, *data* is assumed * to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such * that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + * + * @param {Data} data + * @param {MarkOptions} options */ export function text(data, options = {}) { let {x, y, ...remainingOptions} = options; @@ -179,6 +187,9 @@ export function text(data, options = {}) { * (*interval*.floor(*y*) + *interval*.offset(*interval*.floor(*y*))) / 2. If * the interval is specified as a number *n*, *y* will be the midpoint of two * consecutive multiples of *n* that bracket *y*. + * + * @param {Data} data + * @param {MarkOptions} options */ export function textX(data, options = {}) { const {x = identity, ...remainingOptions} = options; @@ -195,6 +206,9 @@ export function textX(data, options = {}) { * (*interval*.floor(*x*) + *interval*.offset(*interval*.floor(*x*))) / 2. If * the interval is specified as a number *n*, *x* will be the midpoint of two * consecutive multiples of *n* that bracket *x*. + * + * @param {Data} data + * @param {MarkOptions} options */ export function textY(data, options = {}) { const {y = identity, ...remainingOptions} = options; diff --git a/src/marks/tick.js b/src/marks/tick.js index 9303b7c46d..3e83f23a46 100644 --- a/src/marks/tick.js +++ b/src/marks/tick.js @@ -3,6 +3,11 @@ import {identity, number} from "../options.js"; import {Mark} from "../plot.js"; import {applyDirectStyles, applyIndirectStyles, applyTransform, applyChannelStyles, offset} from "../style.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "tick", fill: null, @@ -116,6 +121,9 @@ export class TickY extends AbstractTick { * * If the **y** channel is not specified, the tick will span the full vertical * extent of the plot (or facet). + * + * @param {Data} data + * @param {MarkOptions} options */ export function tickX(data, options = {}) { const {x = identity, ...remainingOptions} = options; @@ -139,6 +147,9 @@ export function tickX(data, options = {}) { * * If the **x** channel is not specified, the tick will span the full vertical * extent of the plot (or facet). + * + * @param {Data} data + * @param {MarkOptions} options */ export function tickY(data, options = {}) { const {y = identity, ...remainingOptions} = options; diff --git a/src/marks/tree.js b/src/marks/tree.js index 736c5d2338..5436230931 100644 --- a/src/marks/tree.js +++ b/src/marks/tree.js @@ -6,6 +6,11 @@ import {dot} from "./dot.js"; import {link} from "./link.js"; import {text} from "./text.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + /** * A convenience compound mark for rendering a tree diagram, including a * [link](https://github.com/observablehq/plot/blob/main/README.md#link) to @@ -42,6 +47,9 @@ import {text} from "./text.js"; * * Any additional *options* are passed through to the constituent link, dot, and * text marks and their corresponding treeLink or treeNode transform. + * + * @param {Data} data + * @param {MarkOptions} options */ export function tree(data, options = {}) { let { @@ -108,6 +116,9 @@ export function tree(data, options = {}) { * [Plot.tree](https://github.com/observablehq/plot/blob/main/README.md#plottreedata-options), * except sets the **treeLayout** option to D3’s cluster (dendrogram) algorithm, * which aligns leaf nodes. + * + * @param {Data} data + * @param {MarkOptions} options */ export function cluster(data, options) { return tree(data, {...options, treeLayout: Cluster}); diff --git a/src/marks/vector.js b/src/marks/vector.js index 7dc00e5700..f7bf53377f 100644 --- a/src/marks/vector.js +++ b/src/marks/vector.js @@ -10,6 +10,11 @@ import { applyTransform } from "../style.js"; +/** + * @typedef {import("../types.js").Data} Data + * @typedef {import("../types.js").MarkOptions} MarkOptions + */ + const defaults = { ariaLabel: "vector", fill: null, @@ -83,6 +88,9 @@ export class Vector extends Mark { * **x** nor **y** options are specified, *data* is assumed to be an array of * pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, * *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + * + * @param {Data} data + * @param {MarkOptions} options */ export function vector(data, options = {}) { let {x, y, ...remainingOptions} = options; @@ -95,6 +103,9 @@ export function vector(data, options = {}) { * [Plot.vector](https://github.com/observablehq/plot/blob/main/README.md#plotvectordata-options) * except that if the **x** option is not specified, it defaults to the identity * function and assumes that *data* = [*x₀*, *x₁*, *x₂*, …]. + * + * @param {Data} data + * @param {MarkOptions} options */ export function vectorX(data, options = {}) { const {x = identity, ...remainingOptions} = options; @@ -106,6 +117,9 @@ export function vectorX(data, options = {}) { * [Plot.vector](https://github.com/observablehq/plot/blob/main/README.md#plotvectordata-options) * except that if the **y** option is not specified, it defaults to the identity * function and assumes that *data* = [*y₀*, *y₁*, *y₂*, …]. + * + * @param {Data} data + * @param {MarkOptions} options */ export function vectorY(data, options = {}) { const {y = identity, ...remainingOptions} = options; diff --git a/src/plot.js b/src/plot.js index 0e53efdce0..9d966e2acd 100644 --- a/src/plot.js +++ b/src/plot.js @@ -368,6 +368,9 @@ import {consumeWarnings, warn} from "./warnings.js"; * const color = plot.scale("color"); // retrieve the color scale object * console.log(color.range); // inspect the color scale’s range, ["red", "blue"] * ``` + * + * @param {import("../types.js").PlotOptions} options + * @returns {Element} */ export function plot(options = {}) { const {facet, style, caption, ariaLabel, ariaDescription} = options; @@ -713,6 +716,9 @@ export class Mark { * [box mark * implementation](https://github.com/observablehq/plot/blob/main/src/marks/box.js) * for an example. + * + * @param {Mark[]} marks + * @returns {Mark} */ export function marks(...marks) { marks.plot = Mark.prototype.plot; diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000000..ab0988fa86 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,178 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +export type Row = Record; + +export type Data = Row[]; + +export type Accessor = (d: any) => any; + +export type Channel = string | Accessor; + +export interface MarkOptions { + x?: Channel; + y?: Channel; + fill?: Channel; + fillOpacity?: Channel; + stroke?: Channel; + strokeOpacity?: Channel; + strokeWidth?: Channel; + opacity?: Channel; + title?: Channel; + href?: Channel; + ariaLabel?: Channel; +} + +export interface ScaleOptions { + domain?: any[]; + range?: any[]; + type?: + | "time" + | "utc" + | "diverging" + | "diverging-sqrt" + | "diverging-pow" + | "diverging-log" + | "diverging-symlog" + | "categorical" + | "ordinal" + | "cyclical" + | "sequential" + | "linear" + | "sqrt" + | "threshold" + | "quantile" + | "quantize" + | "pow" + | "log" + | "symlog" + | "utc" + | "time" + | "point" + | "band" + | "identity"; + unknown?: any; + reverse?: boolean; + interval?: any; + tickFormat?: string | ((d: any) => any); + base?: number; + exponent?: number; + clamp?: boolean; + nice?: boolean; + zero?: boolean; + percent?: boolean; + transform?: (t: any) => any; + inset?: number; + round?: boolean; + insetLeft?: number; + insetRight?: number; + insetTop?: number; + insetBottom?: number; + padding?: number; + align?: number; + paddingInner?: number; + paddingOuter?: number; + axis?: "top" | "bottom" | "left" | "right" | null; + ticks?: number; + tickSize?: number; + tickPadding?: number; + tickRotate?: number; + line?: boolean; + label?: string; + labelAnchor?: "top" | "right" | "bottom" | "left" | "center"; + labelOffset?: number; + legend?: boolean; + fontVariant?: string; + ariaLabel?: string; + ariaDescription?: string; +} + +export interface ColorScaleOptions { + scheme?: + | "accent" + | "category10" + | "dark2" + | "paired" + | "pastel1" + | "pastel2" + | "set1" + | "set2" + | "set3" + | "tableau10" + | "brbg" + | "prgn" + | "piyg" + | "puor" + | "rdbu" + | "rdgy" + | "rdylbu" + | "rdylgn" + | "spectral" + | "burd" + | "buylrd" + | "blues" + | "greens" + | "greys" + | "oranges" + | "purples" + | "reds" + | "turbo" + | "viridis" + | "magma" + | "inferno" + | "plasma" + | "cividis" + | "cubehelix" + | "warm" + | "cool" + | "bugn" + | "bupu" + | "gnbu" + | "orrd" + | "pubu" + | "pubugn" + | "purd" + | "rdpu" + | "ylgn" + | "ylgnbu" + | "ylorbr" + | "ylorrd" + | "rainbow" + | "sinebow"; + interpolate?: "number" | "rgb" | "hsl" | "hcl" | "lab" | ((t: number) => string); + pivot?: number; +} + +export interface PlotOptions { + marginTop?: number; + marginRight?: number; + marginBottom?: number; + marginLeft?: number; + margin?: number; + width?: number; + height?: number; + marks?: any[]; + style?: Record; + caption?: string | Element; + x?: ScaleOptions; + y?: ScaleOptions; + r?: ScaleOptions; + color?: ScaleOptions & ColorScaleOptions; + opacity?: ScaleOptions; + length?: ScaleOptions; + symbol?: ScaleOptions; + grid?: boolean; + facet?: FacetOptions; +} + +export interface FacetOptions { + data: any; + x?: any; + y?: any; + marginTop?: number; + marginRight?: number; + marginBottom?: number; + marginLeft?: number; + margin?: number; + grid?: boolean; + label?: string; +} From 1a1383e3513b8d4d97657f6437ddeed4e5831349 Mon Sep 17 00:00:00 2001 From: Duane Millar Barlow Date: Fri, 23 Sep 2022 09:18:17 -0400 Subject: [PATCH 02/23] yarn readme:update --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/README.md b/README.md index 16c0e4b641..800551de5b 100644 --- a/README.md +++ b/README.md @@ -408,6 +408,7 @@ const color = plot.scale("color"); // retrieve the color scale object console.log(color.range); // inspect the color scale’s range, ["red", "blue"] ``` + #### Plot.scale(*options*) @@ -978,6 +979,7 @@ Returns an array of marks that implements the *mark*.plot function. See the implementation](https://github.com/observablehq/plot/blob/main/src/marks/box.js) for an example. + ### Area @@ -1025,6 +1027,7 @@ share *x* values, while is used in the vertical orientation where the baseline and topline share *y* values. + #### Plot.areaX(*data*, *options*) @@ -1059,6 +1062,7 @@ The **interval** option is recommended to “regularize” sampled data; for example, if your data represents timestamped temperature measurements and you expect one sample per day, use d3.utcDay as the interval. + #### Plot.areaY(*data*, *options*) @@ -1093,6 +1097,7 @@ The **interval** option is recommended to “regularize” sampled data; for example, if your data represents timestamped temperature measurements and you expect one sample per day, use d3.utcDay as the interval. + ### Arrow @@ -1131,6 +1136,7 @@ Plot.arrow(inequality, {x1: "POP_1980", y1: "R90_10_1980", x2: "POP_2015", y2: " Returns a new arrow with the given *data* and *options*. + ### Bar @@ -1179,6 +1185,7 @@ following optional channels are supported: If the **y** channel is not specified, the bar will span the full vertical extent of the plot (or facet). + #### Plot.barY(*data*, *options*) @@ -1218,6 +1225,7 @@ following optional channels are supported: If the **x** channel is not specified, the bar will span the full horizontal extent of the plot (or facet). + ### Box @@ -1245,6 +1253,8 @@ The given *options* are passed through to these underlying marks, with the excep #### Plot.boxX(*data*, *options*) + + ```js Plot.boxX(simpsons.map(d => d.imdb_rating)) ``` @@ -1254,6 +1264,7 @@ defaults to the identity function, as when *data* is an array of numbers. If the **y** option is not specified, it defaults to null; if the **y** option is specified, it should represent an ordinal (discrete) value. + #### Plot.boxY(*data*, *options*) @@ -1267,6 +1278,7 @@ defaults to the identity function, as when *data* is an array of numbers. If the **x** option is not specified, it defaults to null; if the **x** option is specified, it should represent an ordinal (discrete) value. + ### Cell @@ -1297,6 +1309,7 @@ nor **y** options are specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + #### Plot.cellX(*data*, *options*) @@ -1312,6 +1325,7 @@ except that if the **x** option is not specified, it defaults to [0, 1, 2, channel, the fill defaults to the identity function and assumes that *data* = [*x₀*, *x₁*, *x₂*, …]. + #### Plot.cellY(*data*, *options*) @@ -1327,6 +1341,7 @@ except that if the **y** option is not specified, it defaults to [0, 1, 2, channel, the fill defaults to the identity function and assumes that *data* = [*y₀*, *y₁*, *y₂*, …]. + ### Delaunay @@ -1349,6 +1364,7 @@ channel value from one of its two endpoints arbitrarily. If a **z** channel is specified, the input points are grouped by *z*, and separate Delaunay triangulations are constructed for each group. + #### Plot.delaunayMesh(*data*, *options*) @@ -1363,6 +1379,7 @@ points arbitrarily. If a **z** channel is specified, the input points are grouped by *z*, and separate Delaunay triangulations are constructed for each group. + #### Plot.hull(*data*, *options*) @@ -1378,6 +1395,7 @@ separate convex hulls are constructed for each group. If the **z** channel is not specified, it defaults to either the **fill** channel, if any, or the **stroke** channel, if any. + #### Plot.voronoi(*data*, *options*) @@ -1388,6 +1406,7 @@ by the **x** and **y** channels. If a **z** channel is specified, the input points are grouped by *z*, and separate Voronoi tesselations are constructed for each group. + #### Plot.voronoiMesh(*data*, *options*) @@ -1402,6 +1421,7 @@ value from one of its constituent points arbitrarily. If a **z** channel is specified, the input points are grouped by *z*, and separate Voronoi tesselations are constructed for each group. + ### Density @@ -1433,6 +1453,7 @@ series. If the **stroke** or **fill** is specified as *density*, a color channel is constructed with values representing the density threshold value of each contour. + ### Dot @@ -1479,6 +1500,7 @@ nor **y** nor **frameAnchor** options are specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + #### Plot.dotX(*data*, *options*) @@ -1497,6 +1519,7 @@ If an **interval** is specified, such as d3.utcDay, **y** is transformed to the interval is specified as a number *n*, *y* will be the midpoint of two consecutive multiples of *n* that bracket *y*. + #### Plot.dotY(*data*, *options*) @@ -1515,6 +1538,7 @@ If an **interval** is specified, such as d3.utcDay, **x** is transformed to the interval is specified as a number *n*, *x* will be the midpoint of two consecutive multiples of *n* that bracket *x*. + #### Plot.circle(*data*, *options*) @@ -1523,6 +1547,7 @@ Equivalent to [Plot.dot](#plotdotdata-options) except that the **symbol** option is set to *circle*. + #### Plot.hexagon(*data*, *options*) @@ -1531,6 +1556,7 @@ Equivalent to [Plot.dot](#plotdotdata-options) except that the **symbol** option is set to *hexagon*. + ### Hexgrid @@ -1587,6 +1613,7 @@ nor **y** nor **frameAnchor** options are specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + ### Linear regression @@ -1616,6 +1643,7 @@ Plot.linearRegressionX(mtcars, {y: "wt", x: "hp"}) Returns a linear regression mark where *x* is the dependent variable and *y* is the independent variable. + #### Plot.linearRegressionY(*data*, *options*) @@ -1627,6 +1655,7 @@ Plot.linearRegressionY(mtcars, {x: "wt", y: "hp"}) Returns a linear regression mark where *y* is the dependent variable and *x* is the independent variable. + ### Line @@ -1665,6 +1694,7 @@ nor **y** options are specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + #### Plot.lineX(*data*, *options*) @@ -1694,6 +1724,7 @@ The **interval** option is recommended to “regularize” sampled data; for example, if your data represents timestamped temperature measurements and you expect one sample per day, use d3.utcDay as the interval. + #### Plot.lineY(*data*, *options*) @@ -1723,6 +1754,7 @@ The **interval** option is recommended to “regularize” sampled data; for example, if your data represents timestamped temperature measurements and you expect one sample per day, use d3.utcDay as the interval. + ### Link @@ -1754,6 +1786,7 @@ Plot.link(inequality, {x1: "POP_1980", y1: "R90_10_1980", x2: "POP_2015", y2: "R Returns a new link with the given *data* and *options*. + ### Rect @@ -1785,6 +1818,7 @@ Plot.rect(athletes, Plot.bin({fill: "count"}, {x: "weight", y: "height"})) Returns a new rect with the given *data* and *options*. + #### Plot.rectX(*data*, *options*) @@ -1802,6 +1836,7 @@ this is the typical configuration for a histogram with rects aligned at *x* = 0. If the **x** option is not specified, it defaults to the identity function. + #### Plot.rectY(*data*, *options*) @@ -1819,6 +1854,7 @@ this is the typical configuration for a histogram with rects aligned at *y* = 0. If the **y** option is not specified, it defaults to the identity function. + ### Rule @@ -1863,6 +1899,7 @@ derived from **y**: *interval*.floor(*y*) is invoked for each *y* to produce If the interval is specified as a number *n*, *y1* and *y2* are taken as the two consecutive multiples of *n* that bracket *y*. + #### Plot.ruleY(*data*, *options*) @@ -1898,6 +1935,7 @@ derived from **x**: *interval*.floor(*x*) is invoked for each *x* to produce If the interval is specified as a number *n*, *x1* and *x2* are taken as the two consecutive multiples of *n* that bracket *x*. + ### Text @@ -1953,6 +1991,7 @@ Returns a new text mark with the given *data* and *options*. If neither the to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + #### Plot.textX(*data*, *options*) @@ -1967,6 +2006,7 @@ If an **interval** is specified, such as d3.utcDay, **y** is transformed to the interval is specified as a number *n*, *y* will be the midpoint of two consecutive multiples of *n* that bracket *y*. + #### Plot.textY(*data*, *options*) @@ -1981,6 +2021,7 @@ If an **interval** is specified, such as d3.utcDay, **x** is transformed to the interval is specified as a number *n*, *x* will be the midpoint of two consecutive multiples of *n* that bracket *x*. + ### Tick @@ -2011,6 +2052,7 @@ The following optional channels are supported: If the **y** channel is not specified, the tick will span the full vertical extent of the plot (or facet). + #### Plot.tickY(*data*, *options*) @@ -2032,6 +2074,7 @@ The following optional channels are supported: If the **x** channel is not specified, the tick will span the full vertical extent of the plot (or facet). + ### Vector @@ -2077,6 +2120,7 @@ Returns a new vector with the given *data* and *options*. If neither the pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. + #### Plot.vectorX(*data*, *options*) @@ -2086,6 +2130,7 @@ Equivalent to except that if the **x** option is not specified, it defaults to the identity function and assumes that *data* = [*x₀*, *x₁*, *x₂*, …]. + #### Plot.vectorY(*data*, *options*) @@ -2095,6 +2140,7 @@ Equivalent to except that if the **y** option is not specified, it defaults to the identity function and assumes that *data* = [*y₀*, *y₁*, *y₂*, …]. + ## Decorations @@ -2995,6 +3041,8 @@ passed two node arguments, the child and the parent. #### Plot.tree(*data*, *options*) + + A convenience compound mark for rendering a tree diagram, including a [link](#link) to render links from parent to child, an optional @@ -3031,6 +3079,7 @@ The following options are supported: Any additional *options* are passed through to the constituent link, dot, and text marks and their corresponding treeLink or treeNode transform. + #### Plot.cluster(*data*, *options*) @@ -3040,6 +3089,7 @@ Like except sets the **treeLayout** option to D3’s cluster (dendrogram) algorithm, which aligns leaf nodes. + ### Custom transforms From 60dae7509ad82c0e34e99040877b154cfb361b7e Mon Sep 17 00:00:00 2001 From: Duane Millar Barlow Date: Fri, 23 Sep 2022 09:29:06 -0400 Subject: [PATCH 03/23] remove updates to readme --- README.md | 43 ----------------------------------- src/marks/area.js | 3 --- src/marks/arrow.js | 1 - src/marks/bar.js | 2 -- src/marks/box.js | 2 -- src/marks/cell.js | 3 --- src/marks/delaunay.js | 5 ---- src/marks/density.js | 1 - src/marks/dot.js | 5 ---- src/marks/image.js | 1 - src/marks/line.js | 3 --- src/marks/linearRegression.js | 2 -- src/marks/link.js | 1 - src/marks/rect.js | 3 --- src/marks/rule.js | 2 -- src/marks/text.js | 3 --- src/marks/tick.js | 2 -- src/marks/vector.js | 3 --- src/plot.js | 1 - 19 files changed, 86 deletions(-) diff --git a/README.md b/README.md index 800551de5b..4f1389d710 100644 --- a/README.md +++ b/README.md @@ -979,7 +979,6 @@ Returns an array of marks that implements the *mark*.plot function. See the implementation](https://github.com/observablehq/plot/blob/main/src/marks/box.js) for an example. - ### Area @@ -1027,7 +1026,6 @@ share *x* values, while is used in the vertical orientation where the baseline and topline share *y* values. - #### Plot.areaX(*data*, *options*) @@ -1062,7 +1060,6 @@ The **interval** option is recommended to “regularize” sampled data; for example, if your data represents timestamped temperature measurements and you expect one sample per day, use d3.utcDay as the interval. - #### Plot.areaY(*data*, *options*) @@ -1097,7 +1094,6 @@ The **interval** option is recommended to “regularize” sampled data; for example, if your data represents timestamped temperature measurements and you expect one sample per day, use d3.utcDay as the interval. - ### Arrow @@ -1136,7 +1132,6 @@ Plot.arrow(inequality, {x1: "POP_1980", y1: "R90_10_1980", x2: "POP_2015", y2: " Returns a new arrow with the given *data* and *options*. - ### Bar @@ -1185,7 +1180,6 @@ following optional channels are supported: If the **y** channel is not specified, the bar will span the full vertical extent of the plot (or facet). - #### Plot.barY(*data*, *options*) @@ -1225,7 +1219,6 @@ following optional channels are supported: If the **x** channel is not specified, the bar will span the full horizontal extent of the plot (or facet). - ### Box @@ -1264,7 +1257,6 @@ defaults to the identity function, as when *data* is an array of numbers. If the **y** option is not specified, it defaults to null; if the **y** option is specified, it should represent an ordinal (discrete) value. - #### Plot.boxY(*data*, *options*) @@ -1278,7 +1270,6 @@ defaults to the identity function, as when *data* is an array of numbers. If the **x** option is not specified, it defaults to null; if the **x** option is specified, it should represent an ordinal (discrete) value. - ### Cell @@ -1309,7 +1300,6 @@ nor **y** options are specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - #### Plot.cellX(*data*, *options*) @@ -1325,7 +1315,6 @@ except that if the **x** option is not specified, it defaults to [0, 1, 2, channel, the fill defaults to the identity function and assumes that *data* = [*x₀*, *x₁*, *x₂*, …]. - #### Plot.cellY(*data*, *options*) @@ -1341,7 +1330,6 @@ except that if the **y** option is not specified, it defaults to [0, 1, 2, channel, the fill defaults to the identity function and assumes that *data* = [*y₀*, *y₁*, *y₂*, …]. - ### Delaunay @@ -1364,7 +1352,6 @@ channel value from one of its two endpoints arbitrarily. If a **z** channel is specified, the input points are grouped by *z*, and separate Delaunay triangulations are constructed for each group. - #### Plot.delaunayMesh(*data*, *options*) @@ -1379,7 +1366,6 @@ points arbitrarily. If a **z** channel is specified, the input points are grouped by *z*, and separate Delaunay triangulations are constructed for each group. - #### Plot.hull(*data*, *options*) @@ -1395,7 +1381,6 @@ separate convex hulls are constructed for each group. If the **z** channel is not specified, it defaults to either the **fill** channel, if any, or the **stroke** channel, if any. - #### Plot.voronoi(*data*, *options*) @@ -1406,7 +1391,6 @@ by the **x** and **y** channels. If a **z** channel is specified, the input points are grouped by *z*, and separate Voronoi tesselations are constructed for each group. - #### Plot.voronoiMesh(*data*, *options*) @@ -1421,7 +1405,6 @@ value from one of its constituent points arbitrarily. If a **z** channel is specified, the input points are grouped by *z*, and separate Voronoi tesselations are constructed for each group. - ### Density @@ -1453,7 +1436,6 @@ series. If the **stroke** or **fill** is specified as *density*, a color channel is constructed with values representing the density threshold value of each contour. - ### Dot @@ -1500,7 +1482,6 @@ nor **y** nor **frameAnchor** options are specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - #### Plot.dotX(*data*, *options*) @@ -1519,7 +1500,6 @@ If an **interval** is specified, such as d3.utcDay, **y** is transformed to the interval is specified as a number *n*, *y* will be the midpoint of two consecutive multiples of *n* that bracket *y*. - #### Plot.dotY(*data*, *options*) @@ -1538,7 +1518,6 @@ If an **interval** is specified, such as d3.utcDay, **x** is transformed to the interval is specified as a number *n*, *x* will be the midpoint of two consecutive multiples of *n* that bracket *x*. - #### Plot.circle(*data*, *options*) @@ -1547,7 +1526,6 @@ Equivalent to [Plot.dot](#plotdotdata-options) except that the **symbol** option is set to *circle*. - #### Plot.hexagon(*data*, *options*) @@ -1556,7 +1534,6 @@ Equivalent to [Plot.dot](#plotdotdata-options) except that the **symbol** option is set to *hexagon*. - ### Hexgrid @@ -1613,7 +1590,6 @@ nor **y** nor **frameAnchor** options are specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - ### Linear regression @@ -1643,7 +1619,6 @@ Plot.linearRegressionX(mtcars, {y: "wt", x: "hp"}) Returns a linear regression mark where *x* is the dependent variable and *y* is the independent variable. - #### Plot.linearRegressionY(*data*, *options*) @@ -1655,7 +1630,6 @@ Plot.linearRegressionY(mtcars, {x: "wt", y: "hp"}) Returns a linear regression mark where *y* is the dependent variable and *x* is the independent variable. - ### Line @@ -1694,7 +1668,6 @@ nor **y** options are specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - #### Plot.lineX(*data*, *options*) @@ -1724,7 +1697,6 @@ The **interval** option is recommended to “regularize” sampled data; for example, if your data represents timestamped temperature measurements and you expect one sample per day, use d3.utcDay as the interval. - #### Plot.lineY(*data*, *options*) @@ -1754,7 +1726,6 @@ The **interval** option is recommended to “regularize” sampled data; for example, if your data represents timestamped temperature measurements and you expect one sample per day, use d3.utcDay as the interval. - ### Link @@ -1786,7 +1757,6 @@ Plot.link(inequality, {x1: "POP_1980", y1: "R90_10_1980", x2: "POP_2015", y2: "R Returns a new link with the given *data* and *options*. - ### Rect @@ -1818,7 +1788,6 @@ Plot.rect(athletes, Plot.bin({fill: "count"}, {x: "weight", y: "height"})) Returns a new rect with the given *data* and *options*. - #### Plot.rectX(*data*, *options*) @@ -1836,7 +1805,6 @@ this is the typical configuration for a histogram with rects aligned at *x* = 0. If the **x** option is not specified, it defaults to the identity function. - #### Plot.rectY(*data*, *options*) @@ -1854,7 +1822,6 @@ this is the typical configuration for a histogram with rects aligned at *y* = 0. If the **y** option is not specified, it defaults to the identity function. - ### Rule @@ -1899,7 +1866,6 @@ derived from **y**: *interval*.floor(*y*) is invoked for each *y* to produce If the interval is specified as a number *n*, *y1* and *y2* are taken as the two consecutive multiples of *n* that bracket *y*. - #### Plot.ruleY(*data*, *options*) @@ -1935,7 +1901,6 @@ derived from **x**: *interval*.floor(*x*) is invoked for each *x* to produce If the interval is specified as a number *n*, *x1* and *x2* are taken as the two consecutive multiples of *n* that bracket *x*. - ### Text @@ -1991,7 +1956,6 @@ Returns a new text mark with the given *data* and *options*. If neither the to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - #### Plot.textX(*data*, *options*) @@ -2006,7 +1970,6 @@ If an **interval** is specified, such as d3.utcDay, **y** is transformed to the interval is specified as a number *n*, *y* will be the midpoint of two consecutive multiples of *n* that bracket *y*. - #### Plot.textY(*data*, *options*) @@ -2021,7 +1984,6 @@ If an **interval** is specified, such as d3.utcDay, **x** is transformed to the interval is specified as a number *n*, *x* will be the midpoint of two consecutive multiples of *n* that bracket *x*. - ### Tick @@ -2052,7 +2014,6 @@ The following optional channels are supported: If the **y** channel is not specified, the tick will span the full vertical extent of the plot (or facet). - #### Plot.tickY(*data*, *options*) @@ -2074,7 +2035,6 @@ The following optional channels are supported: If the **x** channel is not specified, the tick will span the full vertical extent of the plot (or facet). - ### Vector @@ -2120,7 +2080,6 @@ Returns a new vector with the given *data* and *options*. If neither the pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - #### Plot.vectorX(*data*, *options*) @@ -2130,7 +2089,6 @@ Equivalent to except that if the **x** option is not specified, it defaults to the identity function and assumes that *data* = [*x₀*, *x₁*, *x₂*, …]. - #### Plot.vectorY(*data*, *options*) @@ -2140,7 +2098,6 @@ Equivalent to except that if the **y** option is not specified, it defaults to the identity function and assumes that *data* = [*y₀*, *y₁*, *y₂*, …]. - ## Decorations diff --git a/src/marks/area.js b/src/marks/area.js index 2d44f4e7fe..77138230b7 100644 --- a/src/marks/area.js +++ b/src/marks/area.js @@ -90,7 +90,6 @@ export class Area extends Mark { * [Plot.areaX](https://github.com/observablehq/plot/blob/main/README.md#plotareaxdata-options) * is used in the vertical orientation where the baseline and topline share *y* * values. - * * @param {Data} data * @param {MarkOptions} options */ @@ -129,7 +128,6 @@ export function area(data, options) { * The **interval** option is recommended to “regularize” sampled data; for * example, if your data represents timestamped temperature measurements and you * expect one sample per day, use d3.utcDay as the interval. - * * @param {Data} data * @param {MarkOptions} options */ @@ -168,7 +166,6 @@ export function areaX(data, options) { * The **interval** option is recommended to “regularize” sampled data; for * example, if your data represents timestamped temperature measurements and you * expect one sample per day, use d3.utcDay as the interval. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/arrow.js b/src/marks/arrow.js index 139a1f20d3..463ef6b8ab 100644 --- a/src/marks/arrow.js +++ b/src/marks/arrow.js @@ -182,7 +182,6 @@ function circleCircleIntersect([ax, ay, ar], [bx, by, br], sign) { * ``` * * Returns a new arrow with the given *data* and *options*. - * * @param {import("../types.js").Data} data * @param {import("../types.js").MarkOptions} options */ diff --git a/src/marks/bar.js b/src/marks/bar.js index b526973b26..cad6cacc84 100644 --- a/src/marks/bar.js +++ b/src/marks/bar.js @@ -168,7 +168,6 @@ export class BarY extends AbstractBar { * * If the **y** channel is not specified, the bar will span the full vertical * extent of the plot (or facet). - * * @param {Data} data * @param {MarkOptions} options */ @@ -211,7 +210,6 @@ export function barX(data, options = {y: indexOf, x2: identity}) { * * If the **x** channel is not specified, the bar will span the full horizontal * extent of the plot (or facet). - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/box.js b/src/marks/box.js index 680e5258bd..a9d6beab1c 100644 --- a/src/marks/box.js +++ b/src/marks/box.js @@ -21,7 +21,6 @@ import {tickX, tickY} from "./tick.js"; * defaults to the identity function, as when *data* is an array of numbers. If * the **y** option is not specified, it defaults to null; if the **y** option * is specified, it should represent an ordinal (discrete) value. - * * @param {Data} data * @param {MarkOptions} options */ @@ -57,7 +56,6 @@ export function boxX(data, options = {}) { * defaults to the identity function, as when *data* is an array of numbers. If * the **x** option is not specified, it defaults to null; if the **x** option * is specified, it should represent an ordinal (discrete) value. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/cell.js b/src/marks/cell.js index 42cba28e23..ca5a25da19 100644 --- a/src/marks/cell.js +++ b/src/marks/cell.js @@ -38,7 +38,6 @@ export class Cell extends AbstractBar { * nor **y** options are specified, *data* is assumed to be an array of pairs * [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, * *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - * * @param {Data} data * @param {MarkOptions} options */ @@ -59,7 +58,6 @@ export function cell(data, options = {}) { * …], and if the **fill** option is not specified and **stroke** is not a * channel, the fill defaults to the identity function and assumes that *data* = * [*x₀*, *x₁*, *x₂*, …]. - * * @param {Data} data * @param {MarkOptions} options */ @@ -80,7 +78,6 @@ export function cellX(data, options = {}) { * …], and if the **fill** option is not specified and **stroke** is not a * channel, the fill defaults to the identity function and assumes that *data* = * [*y₀*, *y₁*, *y₂*, …]. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/delaunay.js b/src/marks/delaunay.js index 8eeab2a8e2..752183249c 100644 --- a/src/marks/delaunay.js +++ b/src/marks/delaunay.js @@ -294,7 +294,6 @@ function delaunayMark(DelaunayMark, data, {x, y, ...options} = {}) { * * If a **z** channel is specified, the input points are grouped by *z*, and * separate Delaunay triangulations are constructed for each group. - * * @param {Data} data * @param {MarkOptions} options * @returns {DelaunayLink} @@ -313,7 +312,6 @@ export function delaunayLink(data, options) { * * If a **z** channel is specified, the input points are grouped by *z*, and * separate Delaunay triangulations are constructed for each group. - * * @param {Data} data * @param {MarkOptions} options * @returns {DelaunayMesh} @@ -333,7 +331,6 @@ export function delaunayMesh(data, options) { * separate convex hulls are constructed for each group. If the **z** channel is * not specified, it defaults to either the **fill** channel, if any, or the * **stroke** channel, if any. - * * @param {Data} data * @param {MarkOptions} options * @returns {Hull} @@ -348,7 +345,6 @@ export function hull(data, options) { * * If a **z** channel is specified, the input points are grouped by *z*, and * separate Voronoi tesselations are constructed for each group. - * * @param {Data} data * @param {MarkOptions} options * @returns {Voronoi} @@ -367,7 +363,6 @@ export function voronoi(data, options) { * * If a **z** channel is specified, the input points are grouped by *z*, and * separate Voronoi tesselations are constructed for each group. - * * @param {Data} data * @param {MarkOptions} options * @returns {VoronoiMesh} diff --git a/src/marks/density.js b/src/marks/density.js index d1aa914dde..a3f89dacb1 100644 --- a/src/marks/density.js +++ b/src/marks/density.js @@ -89,7 +89,6 @@ export class Density extends Mark { * series. If the **stroke** or **fill** is specified as *density*, a color * channel is constructed with values representing the density threshold value * of each contour. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/dot.js b/src/marks/dot.js index 35e9fdaad4..2c01c05de1 100644 --- a/src/marks/dot.js +++ b/src/marks/dot.js @@ -127,7 +127,6 @@ export class Dot extends Mark { * nor **y** nor **frameAnchor** options are specified, *data* is assumed to be * an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that * **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - * * @param {Data} data * @param {MarkOptions} options */ @@ -151,7 +150,6 @@ export function dot(data, options = {}) { * (*interval*.floor(*y*) + *interval*.offset(*interval*.floor(*y*))) / 2. If * the interval is specified as a number *n*, *y* will be the midpoint of two * consecutive multiples of *n* that bracket *y*. - * * @param {Data} data * @param {MarkOptions} options */ @@ -174,7 +172,6 @@ export function dotX(data, options = {}) { * (*interval*.floor(*x*) + *interval*.offset(*interval*.floor(*x*))) / 2. If * the interval is specified as a number *n*, *x* will be the midpoint of two * consecutive multiples of *n* that bracket *x*. - * * @param {Data} data * @param {MarkOptions} options */ @@ -187,7 +184,6 @@ export function dotY(data, options = {}) { * Equivalent to * [Plot.dot](https://github.com/observablehq/plot/blob/main/README.md#plotdotdata-options) * except that the **symbol** option is set to *circle*. - * * @param {Data} data * @param {MarkOptions} options */ @@ -199,7 +195,6 @@ export function circle(data, options) { * Equivalent to * [Plot.dot](https://github.com/observablehq/plot/blob/main/README.md#plotdotdata-options) * except that the **symbol** option is set to *hexagon*. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/image.js b/src/marks/image.js index 656beaad46..eb41a69a08 100644 --- a/src/marks/image.js +++ b/src/marks/image.js @@ -118,7 +118,6 @@ export class Image extends Mark { * nor **y** nor **frameAnchor** options are specified, *data* is assumed to be * an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that * **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - * * @param {import("../types.js").Data} data * @param {import("../types.js").MarkOptions} options */ diff --git a/src/marks/line.js b/src/marks/line.js index 5d5f1ef6ab..5ed889d5f2 100644 --- a/src/marks/line.js +++ b/src/marks/line.js @@ -84,7 +84,6 @@ export class Line extends Mark { * nor **y** options are specified, *data* is assumed to be an array of pairs * [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, * *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - * * @param {Data} data * @param {MarkOptions} options */ @@ -119,7 +118,6 @@ export function line(data, options = {}) { * The **interval** option is recommended to “regularize” sampled data; for * example, if your data represents timestamped temperature measurements and you * expect one sample per day, use d3.utcDay as the interval. - * * @param {Data} data * @param {MarkOptions} options */ @@ -153,7 +151,6 @@ export function lineX(data, options = {}) { * The **interval** option is recommended to “regularize” sampled data; for * example, if your data represents timestamped temperature measurements and you * expect one sample per day, use d3.utcDay as the interval. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/linearRegression.js b/src/marks/linearRegression.js index dcce422119..7ca5db02c0 100644 --- a/src/marks/linearRegression.js +++ b/src/marks/linearRegression.js @@ -134,7 +134,6 @@ class LinearRegressionY extends LinearRegression { * * Returns a linear regression mark where *x* is the dependent variable and *y* * is the independent variable. - * * @param {Data} data * @param {MarkOptions} options */ @@ -156,7 +155,6 @@ export function linearRegressionX(data, options = {}) { * * Returns a linear regression mark where *y* is the dependent variable and *x* * is the independent variable. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/link.js b/src/marks/link.js index 3b799e63a4..5a2b10b5c9 100644 --- a/src/marks/link.js +++ b/src/marks/link.js @@ -64,7 +64,6 @@ export class Link extends Mark { * ``` * * Returns a new link with the given *data* and *options*. - * * @param {import("../types.js").Data} data * @param {import("../types.js").MarkOptions} options */ diff --git a/src/marks/rect.js b/src/marks/rect.js index 6a0921472f..30f6864dd2 100644 --- a/src/marks/rect.js +++ b/src/marks/rect.js @@ -99,7 +99,6 @@ export class Rect extends Mark { * ``` * * Returns a new rect with the given *data* and *options*. - * * @param {Data} data * @param {MarkOptions} options */ @@ -120,7 +119,6 @@ export function rect(data, options) { * this is the typical configuration for a histogram with rects aligned at *x* = * 0. If the **x** option is not specified, it defaults to the identity * function. - * * @param {Data} data * @param {MarkOptions} options */ @@ -141,7 +139,6 @@ export function rectX(data, options = {y: indexOf, interval: 1, x2: identity}) { * this is the typical configuration for a histogram with rects aligned at *y* = * 0. If the **y** option is not specified, it defaults to the identity * function. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/rule.js b/src/marks/rule.js index b5c9c9c4f1..9bb4645d93 100644 --- a/src/marks/rule.js +++ b/src/marks/rule.js @@ -142,7 +142,6 @@ export class RuleY extends Mark { * *y1*, and *interval*.offset(*y1*) is invoked for each *y1* to produce *y2*. * If the interval is specified as a number *n*, *y1* and *y2* are taken as the * two consecutive multiples of *n* that bracket *y*. - * * @param {Data} data * @param {MarkOptions} options */ @@ -183,7 +182,6 @@ export function ruleX(data, options) { * *x1*, and *interval*.offset(*x1*) is invoked for each *x1* to produce *x2*. * If the interval is specified as a number *n*, *x1* and *x2* are taken as the * two consecutive multiples of *n* that bracket *x*. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/text.js b/src/marks/text.js index 87c0e8253a..60acfc8c09 100644 --- a/src/marks/text.js +++ b/src/marks/text.js @@ -167,7 +167,6 @@ function applyMultilineText(selection, {monospace, lineAnchor, lineHeight, lineW * **x** nor **y** nor **frameAnchor** options are specified, *data* is assumed * to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such * that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - * * @param {Data} data * @param {MarkOptions} options */ @@ -187,7 +186,6 @@ export function text(data, options = {}) { * (*interval*.floor(*y*) + *interval*.offset(*interval*.floor(*y*))) / 2. If * the interval is specified as a number *n*, *y* will be the midpoint of two * consecutive multiples of *n* that bracket *y*. - * * @param {Data} data * @param {MarkOptions} options */ @@ -206,7 +204,6 @@ export function textX(data, options = {}) { * (*interval*.floor(*x*) + *interval*.offset(*interval*.floor(*x*))) / 2. If * the interval is specified as a number *n*, *x* will be the midpoint of two * consecutive multiples of *n* that bracket *x*. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/tick.js b/src/marks/tick.js index 3e83f23a46..c26507752a 100644 --- a/src/marks/tick.js +++ b/src/marks/tick.js @@ -121,7 +121,6 @@ export class TickY extends AbstractTick { * * If the **y** channel is not specified, the tick will span the full vertical * extent of the plot (or facet). - * * @param {Data} data * @param {MarkOptions} options */ @@ -147,7 +146,6 @@ export function tickX(data, options = {}) { * * If the **x** channel is not specified, the tick will span the full vertical * extent of the plot (or facet). - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/marks/vector.js b/src/marks/vector.js index f7bf53377f..8c23fda6ed 100644 --- a/src/marks/vector.js +++ b/src/marks/vector.js @@ -88,7 +88,6 @@ export class Vector extends Mark { * **x** nor **y** options are specified, *data* is assumed to be an array of * pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, * *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …]. - * * @param {Data} data * @param {MarkOptions} options */ @@ -103,7 +102,6 @@ export function vector(data, options = {}) { * [Plot.vector](https://github.com/observablehq/plot/blob/main/README.md#plotvectordata-options) * except that if the **x** option is not specified, it defaults to the identity * function and assumes that *data* = [*x₀*, *x₁*, *x₂*, …]. - * * @param {Data} data * @param {MarkOptions} options */ @@ -117,7 +115,6 @@ export function vectorX(data, options = {}) { * [Plot.vector](https://github.com/observablehq/plot/blob/main/README.md#plotvectordata-options) * except that if the **y** option is not specified, it defaults to the identity * function and assumes that *data* = [*y₀*, *y₁*, *y₂*, …]. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/plot.js b/src/plot.js index 9d966e2acd..96971fad63 100644 --- a/src/plot.js +++ b/src/plot.js @@ -716,7 +716,6 @@ export class Mark { * [box mark * implementation](https://github.com/observablehq/plot/blob/main/src/marks/box.js) * for an example. - * * @param {Mark[]} marks * @returns {Mark} */ From f363cb398a23ab9df4315fffc1174b466f6caf1a Mon Sep 17 00:00:00 2001 From: Duane Millar Barlow Date: Fri, 23 Sep 2022 09:37:57 -0400 Subject: [PATCH 04/23] update comments --- README.md | 3 --- src/marks/tree.js | 2 -- src/plot.js | 1 - 3 files changed, 6 deletions(-) diff --git a/README.md b/README.md index 4f1389d710..f86831ae24 100644 --- a/README.md +++ b/README.md @@ -408,7 +408,6 @@ const color = plot.scale("color"); // retrieve the color scale object console.log(color.range); // inspect the color scale’s range, ["red", "blue"] ``` - #### Plot.scale(*options*) @@ -3036,7 +3035,6 @@ The following options are supported: Any additional *options* are passed through to the constituent link, dot, and text marks and their corresponding treeLink or treeNode transform. - #### Plot.cluster(*data*, *options*) @@ -3046,7 +3044,6 @@ Like except sets the **treeLayout** option to D3’s cluster (dendrogram) algorithm, which aligns leaf nodes. - ### Custom transforms diff --git a/src/marks/tree.js b/src/marks/tree.js index 5436230931..e4e7a2f6d1 100644 --- a/src/marks/tree.js +++ b/src/marks/tree.js @@ -47,7 +47,6 @@ import {text} from "./text.js"; * * Any additional *options* are passed through to the constituent link, dot, and * text marks and their corresponding treeLink or treeNode transform. - * * @param {Data} data * @param {MarkOptions} options */ @@ -116,7 +115,6 @@ export function tree(data, options = {}) { * [Plot.tree](https://github.com/observablehq/plot/blob/main/README.md#plottreedata-options), * except sets the **treeLayout** option to D3’s cluster (dendrogram) algorithm, * which aligns leaf nodes. - * * @param {Data} data * @param {MarkOptions} options */ diff --git a/src/plot.js b/src/plot.js index 96971fad63..55cf786f2c 100644 --- a/src/plot.js +++ b/src/plot.js @@ -368,7 +368,6 @@ import {consumeWarnings, warn} from "./warnings.js"; * const color = plot.scale("color"); // retrieve the color scale object * console.log(color.range); // inspect the color scale’s range, ["red", "blue"] * ``` - * * @param {import("../types.js").PlotOptions} options * @returns {Element} */ From f5b23f0ba80c6e3a928587b01320ef8700619b05 Mon Sep 17 00:00:00 2001 From: Duane Millar Barlow Date: Fri, 23 Sep 2022 09:41:13 -0400 Subject: [PATCH 05/23] why was this necessary? --- test/plots/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plots/index.html b/test/plots/index.html index 9f94ddb72b..f51ed23e0f 100644 --- a/test/plots/index.html +++ b/test/plots/index.html @@ -1,6 +1,6 @@ - +