Skip to content

Commit

Permalink
link to d3js.org
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Aug 5, 2023
1 parent cfb3d74 commit 0d3a4dd
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG-2022.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Plot.plot({
})
```

In addition to the included basic projections, Plot’s projection system can be extended using any projection implementation compatible with D3’s [projection stream interface](https://github.com/d3/d3-geo/blob/main/README.md#streams). This includes all the projections provided by the [d3-geo-projection](https://github.com/d3/d3-geo-projection) and [d3-geo-polygon](https://github.com/d3/d3-geo-polygon) libraries! For example, here is a world map using Goode’s interrupted homolosine projection.
In addition to the included basic projections, Plot’s projection system can be extended using any projection implementation compatible with D3’s [projection stream interface](https://d3js.org/d3-geo/stream). This includes all the projections provided by the [d3-geo-projection](https://github.com/d3/d3-geo-projection) and [d3-geo-polygon](https://github.com/d3/d3-geo-polygon) libraries! For example, here is a world map using Goode’s interrupted homolosine projection.

[<img src="./img/goode.png" width="640" alt="A world map using Goode’s interrupted homolosine projection">](https://observablehq.com/@observablehq/plot-extended-projections)

Expand Down Expand Up @@ -583,7 +583,7 @@ Plot.vector((T => d3.cross(T, T))(d3.ticks(0, 2 * Math.PI, 20)), {
})
```

The [dot mark](./README.md#dot) now supports a *symbol* option to control the displayed shape, which defaults to *circle*. The *symbol* channel (and associated *symbol* scale) can also be used as an categorical encoding. The default symbol set is based on whether symbols are stroked or filled, improving differentiability and giving uniform weight. Plot supports all of D3’s built-in symbol types: *circle*, *cross*, *diamond*, *square*, *star*, *triangle*, and *wye* (for fill) and *circle*, *plus*, *times*, *triangle2*, *asterisk*, *square2*, and *diamond2* (for stroke, based on [Heman Robinson’s research](https://www.tandfonline.com/doi/abs/10.1080/10618600.2019.1637746)); you can also implement a [custom symbol type](https://github.com/d3/d3-shape/blob/main/README.md#custom-symbol-types).
The [dot mark](./README.md#dot) now supports a *symbol* option to control the displayed shape, which defaults to *circle*. The *symbol* channel (and associated *symbol* scale) can also be used as an categorical encoding. The default symbol set is based on whether symbols are stroked or filled, improving differentiability and giving uniform weight. Plot supports all of D3’s built-in symbol types: *circle*, *cross*, *diamond*, *square*, *star*, *triangle*, and *wye* (for fill) and *circle*, *plus*, *times*, *triangle2*, *asterisk*, *square2*, and *diamond2* (for stroke, based on [Heman Robinson’s research](https://www.tandfonline.com/doi/abs/10.1080/10618600.2019.1637746)); you can also implement a [custom symbol type](https://d3js.org/d3-shape/symbol#custom-symbols).

[<img src="./img/symbol.png" width="660" alt="a scatterplot of penguins by mass and flipper length">](https://observablehq.com/@observablehq/plot-dot)

Expand Down
22 changes: 12 additions & 10 deletions src/curve.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ export interface CurveOptions extends CurveAutoOptions {
* * *step-before* - a piecewise constant function where *x* changes after *y*
*
* If *curve* is a function, it will be invoked with a given CanvasPath
* *context* in the same fashion as a [D3 curve
* factory](https://github.com/d3/d3-shape/blob/main/README.md#custom-curves).
* *context* in the same fashion as a [D3 curve factory][1].
*
* [1]: https://d3js.org/d3-shape/curve#custom-curves
*/
curve?: Curve;
}
Expand Down Expand Up @@ -92,21 +93,22 @@ export interface CurveAutoOptions {
* The *auto* curve is typically used in conjunction with a spherical
* projection to interpolate along geodesics. If *curve* is a function, it
* will be invoked with a given CanvasPath *context* in the same fashion as a
* [D3 curve
* factory](https://github.com/d3/d3-shape/blob/main/README.md#custom-curves).
* [D3 curve factory][1].
*
* [1]: https://d3js.org/d3-shape/curve#custom-curves
*/
curve?: Curve | "auto";

/**
* The tension option only has an effect on bundle, cardinal and Catmull–Rom
* splines (*bundle*, *cardinal*, *cardinal-open*, *cardinal-closed*,
* *catmull-rom*, *catmull-rom-open*, and *catmull-rom-closed*). For bundle
* splines, it corresponds to
* [beta](https://github.com/d3/d3-shape/blob/main/README.md#curveBundle_beta);
* for cardinal splines,
* [tension](https://github.com/d3/d3-shape/blob/main/README.md#curveCardinal_tension);
* for Catmull–Rom splines,
* [alpha](https://github.com/d3/d3-shape/blob/main/README.md#curveCatmullRom_alpha).
* splines, it corresponds to [beta][1]; for cardinal splines, [tension][2];
* for Catmull–Rom splines, [alpha][3].
*
* [1]: https://d3js.org/d3-shape/curve#curveBundle_beta
* [2]: https://d3js.org/d3-shape/curve#curveCardinal_tension
* [3]: https://d3js.org/d3-shape/curve#curveCatmullRom_alpha
*/
tension?: number;
}
4 changes: 2 additions & 2 deletions src/legends.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export interface LegendOptions {
* domain is dates, the tick format may also be expressed as a [d3-time-format
* string][2].
*
* [1]: https://github.com/d3/d3-format/blob/main/README.md#locale_format
* [2]: https://github.com/d3/d3-time-format/blob/main/README.md#locale_format
* [1]: https://d3js.org/d3-format#locale_format
* [2]: https://d3js.org/d3-time-format#locale_format
*/
tickFormat?: ScaleOptions["tickFormat"];

Expand Down
2 changes: 1 addition & 1 deletion src/marks/geo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function sphere(options?: GeoOptions): Geo;
* a spherical **projection** only.) For more control, use [d3.geoGraticule][1]
* with the geo mark.
*
* [1]: https://github.com/d3/d3-geo/blob/main/README.md#geoGraticule
* [1]: https://d3js.org/d3-geo/shape#geoGraticule
*/
export function graticule(options?: GeoOptions): Geo;

Expand Down
2 changes: 1 addition & 1 deletion src/marks/raster.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export const interpolateNone: RasterInterpolateFunction;
* congruential generator][2] with a fixed seed (for deterministic results).
*
* [1]: https://en.wikipedia.org/wiki/Barycentric_coordinate_system
* [2]: https://github.com/d3/d3-random/blob/main/README.md#randomLcg
* [2]: https://d3js.org/d3-random#randomLcg
*/
export function interpolatorBarycentric(options?: {random?: RandomSource}): RasterInterpolateFunction;

Expand Down
4 changes: 2 additions & 2 deletions src/marks/tree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface TreeOptions extends DotOptions, LinkOptions, TextOptions, TreeT
* slash by default); then executes a tree layout algorithm, by default
* [Reingold–Tilford’s “tidy” algorithm][1].
*
* [1]: https://github.com/d3/d3-hierarchy/blob/main/README.md#tree
* [1]: https://d3js.org/d3-hierarchy/tree
*/
export function tree(data?: Data, options?: TreeOptions): CompoundMark;

Expand All @@ -51,6 +51,6 @@ export function tree(data?: Data, options?: TreeOptions): CompoundMark;
* Plot.tree(data, {...options, treeLayout: d3.cluster, textLayout: "mirrored"})
* ```
*
* [1]: https://github.com/d3/d3-hierarchy/blob/main/README.md#cluster
* [1]: https://d3js.org/d3-hierarchy/cluster
*/
export function cluster(data?: Data, options?: TreeOptions): CompoundMark;
4 changes: 2 additions & 2 deletions src/projection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ export interface ProjectionOptions extends InsetOptions {
/**
* The [standard parallels][1]. For conic projections only.
*
* [1]: https://github.com/d3/d3-geo/blob/main/README.md#conic_parallels
* [1]: https://d3js.org/d3-geo/conic#conic_parallels
*/
parallels?: [y1: number, y2: number];

/**
* The projection’s [sampling threshold][1].
*
* [1]: https://github.com/d3/d3-geo/blob/main/README.md#projection_precision
* [1]: https://d3js.org/d3-geo/projection#projection_precision
*/
precision?: number;

Expand Down
4 changes: 2 additions & 2 deletions src/transforms/bin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export type ThresholdsFunction<T = any> = (values: T[], min: T, max: T) => Range
* built-in thresholds implementations, [d3.ticks][1] is used for numeric
* domains and [d3.utcTicks][2] is used for temporal domains.
*
* [1]: https://github.com/d3/d3-array/blob/main/README.md#ticks
* [2]: https://github.com/d3/d3-time/blob/main/README.md#utcTicks
* [1]: https://d3js.org/d3-array/ticks
* [2]: https://d3js.org/d3-time#utcTicks
*/
export type Thresholds<T = any> = ThresholdsName | ThresholdsFunction<T> | RangeInterval<T> | T[] | number;

Expand Down
8 changes: 4 additions & 4 deletions src/transforms/tree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export interface TreeTransformOptions {
* Reingold–Tilford “tidy” algorithm. Use [d3.cluster][2] instead to align
* leaf nodes; see also Plot.cluster.
*
* [1]: https://github.com/d3/d3-hierarchy/blob/main/README.md#tree
* [2]: https://github.com/d3/d3-hierarchy/blob/main/README.md#cluster
* [1]: https://d3js.org/d3-hierarchy/tree
* [2]: https://d3js.org/d3-hierarchy/cluster
*/
treeLayout?: () => any;

Expand All @@ -44,7 +44,7 @@ export interface TreeTransformOptions {
* in the hierarchy and returns the desired (relative) amount of separation;
* see [d3-hierarchy’s _tree_.separation][1] for more.
*
* [1]: https://github.com/d3/d3-hierarchy/blob/main/README.md#tree_separation
* [1]: https://d3js.org/d3-hierarchy/tree#tree_separation
*/
treeSeparation?: CompareFunction | null;

Expand All @@ -58,7 +58,7 @@ export interface TreeTransformOptions {
* node value such as *node:name*.
*
* [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
* [2]: https://github.com/d3/d3-hierarchy/blob/main/README.md#node_sort
* [2]: https://d3js.org/d3-hierarchy/hierarchy#node_sort
*/
treeSort?: CompareFunction | {node: (node: any) => any} | string | null;
}
Expand Down

0 comments on commit 0d3a4dd

Please sign in to comment.