Skip to content

Commit fc88116

Browse files
committed
Update CHANGELOG
1 parent ec91e46 commit fc88116

File tree

5 files changed

+68
-27
lines changed

5 files changed

+68
-27
lines changed

CHANGELOG.md

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
*Not yet released. These are forthcoming changes in the main branch.*
66

7-
The new [arrow mark](./README.md#arrow) draws arrows connecting two pairs of points. It is similar to a [link mark](./README.md#link), except it is intended for directed edges (say for representing movement over time) and supports a configurable arrowhead. It even supports “swoopy” arrows with the *bend* option, together with insets for when arrows start or end with a [circle](./README.md#dot).
7+
The new [arrow mark](./README.md#arrow) draws arrows between pairs of points. It is similar to the [link mark](./README.md#link), except it is suitable for directed edges (say for representing change over time) and supports a configurable arrowhead. It also supports “swoopy” arrows with the *bend* option, and insets for arrows to shorten the arrow’s start or end.
88

99
[<img src="./img/arrow.png" width="660" alt="a scatterplot with arrows">](https://observablehq.com/@observablehq/plot-arrow)
1010

@@ -19,7 +19,7 @@ Plot.arrow(data, {
1919
})
2020
```
2121

22-
The new [vector mark](./README.md#vector) similarly draws arrows defined by a single position (*x* and *y*), magnitude (*length*), and direction (*rotate*). It is commonly used to visualize vector fields, such as a map of wind speed and direction.
22+
The new [vector mark](./README.md#vector) similarly draws arrows at the given position (*x* and *y*) with the given magnitude (*length*) and direction (*rotate*). It is intended to visualize vector fields, such as a map of wind speed and direction.
2323

2424
[<img src="./img/vector.png" width="660" alt="a vector field">](https://observablehq.com/@observablehq/plot-vector)
2525

@@ -30,49 +30,45 @@ Plot.vector((T => d3.cross(T, T))(d3.ticks(0, 2 * Math.PI, 20)), {
3030
})
3131
```
3232

33-
The [dot mark](./README.md#dot) now supports a *symbol* channel and option to control the displayed shape. The *symbol* channel can be used as an ordinal or categorical encoding. The the set of displayed symbols defaults based on whether the symbols are stroked or filled to improve differentiability and to give uniform visual weight. The symbol legend can also incorporate a redundant color encoding. Plot supports all of d3-shape’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). You can also specify a [custom symbol type](https://github.com/d3/d3-shape/blob/main/README.md#custom-symbol-types).
33+
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); you can also implement a [custom symbol type](https://github.com/d3/d3-shape/blob/main/README.md#custom-symbol-types).
3434

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

3737
```js
3838
Plot.dot(penguins, {x: "body_mass_g", y: "flipper_length_mm", stroke: "species", symbol: "species"})
3939
```
4040

41-
The [text mark](./README.md#text) now supports multiline text! New *lineAnchor* and *lineHeight* options
41+
The [text mark](./README.md#text) now supports multiline text! When a text value contains `\r`, `\r\n`, or `\n`, it will be split into multiple lines using tspan elements. The new *lineAnchor* and *lineHeight* options control how the lines are positioned relative to the given *xy* position. The text, dot, and image marks now also support a *frameAnchor* option for positioning relative to the frame rather than according to data. This is particularly useful for annotations.
4242

43-
When a text mark’s *text* channel, or the *title* channel on any mark, is specified as numbers or dates, the values are now automatically formatted (in the U.S. English locale) to improve readability. For the *text* channel, the default *fontVariant* option additionally changes to tabular-nums.
43+
[<img src="./img/poem.png" width="660" alt="This Is Just To Say, by William Carlos Williams">](https://observablehq.com/@observablehq/plot-text)
4444

45-
The text mark now additionally allows the *fontSize* to be specified as a CSS length (*e.g.*, “12pt”), keyword (*e.g.*, “x-large”), or percentage.
45+
```js
46+
Plot.plot({
47+
height: 200,
48+
marks: [
49+
Plot.frame(),
50+
Plot.text([`This Is Just To Say\nWilliam Carlos Williams, …`], {frameAnchor: "middle"})
51+
]
52+
})
53+
```
4654

47-
The text, dot, and image marks now support a *frameAnchor* option for positioning relative to the frame rather than according to data. This is particularly useful for annotations.
55+
When a text mark’s *text* channel, or the *title* channel on any mark, is specified as numbers or dates, the values are now automatically formatted (in the U.S. English locale) to improve readability. For the *text* channel, the default *fontVariant* option additionally changes to tabular-nums. The text mark now additionally allows the *fontSize* to be specified as a CSS length (*e.g.*, “12pt”), keyword (*e.g.*, “x-large”), or percentage.
4856

4957
All marks now support the new standard *href* channel and *target* option, turning the mark into a clickable link.
5058

51-
The new Plot.scale method allows you to construct a standalone scale for use independent of any chart, or across charts.
52-
53-
The bin and group transforms now propagate the *title* and *href* channels, if present, by default.
54-
55-
The bin transform now supports the following shorthand reducers for the bin extent: *x1*, *x2*, *y1*, and *y2*.
56-
57-
The window transform now supports the *first* and *last* reducers.
58-
59-
The *color* scale now defaults to *identity* if all associated defined values are valid CSS colors. Similarly, the new *symbol* scale defaults to *identity* if all associated defined values are valid symbol names (or symbol type objects).
60-
61-
The *swatches* legend now wraps correctly in narrow windows.
62-
63-
A top-level *clamp* option is now available to apply to all scales.
64-
65-
When the *buylrd* color scheme is applied to a (discrete) ordinal scale, it now has the expected colors (not *rdgy*).
59+
```js
60+
Plot.barY(alphabet, {x: "letter", y: "frequency", href: d => `https://en.wikipedia.org/wiki/${d.letter}`})
61+
```
6662

67-
When large margins or insets would result in a scale’s range being inverted, Plot now collapses the range instead of producing confusing output.
63+
The new [Plot.scale](./README.md#scale-options) method allows you to construct a standalone scale for use independent of any chart, or across charts.
6864

69-
When the *tickFormat* option is null, ticks will now be unlabeled (rather than using the default format).
65+
The bin and group transforms now propagate the *title* and *href* channels, if present, by default. The default reducer for the *title* channel automatically selects the top five distinct title values per bin by count. The bin transform now supports the following shorthand reducers for the bin extent: *x1*, *x2*, *y1*, and *y2*. The window transform now supports the *first* and *last* reducers to select the first or last element of the window, respectively.
7066

71-
Plot now ignores non-finite values when inferring the default domain for quantitative scales.
67+
The *color* scale now defaults to an *identity* scale if all associated defined values are valid CSS colors. Similarly, the new *symbol* scale defaults to *identity* if all associated defined values are valid symbol names (or symbol type objects). A top-level *clamp* option is now available to apply to all scales. When margins or insets would result in a scale’s range being inverted, Plot now collapses the range instead of producing confusing output. When the *buylrd* color scheme is applied to a (discrete) ordinal scale, it now has the expected colors (not *rdgy*). Plot now ignores non-finite values when inferring the default domain for quantitative scales.
7268

73-
Plot no longer crashes when you try to display a legend on an identity color scale.
69+
The *swatches* legend now wraps correctly in narrow windows. When the *tickFormat* option is null, ticks will now be unlabeled (rather than using the default format). Plot no longer crashes when you try to display a legend on an identity color scale.
7470

75-
Plot no longer uses circular imports, working around a limitation of popular bundlers such as webpack and Rollup.
71+
Plot no longer uses circular imports, working around a limitation (“temporal dead zone”) of popular bundlers such as webpack and Rollup.
7672

7773
[breaking] For consistency with other marks, the text mark now requires the *dx* and *dy* to be specified as numbers in pixels rather than typographic units such as ems; in addition, the *dx* and *dy* translation now happens prior to rotation (if any). To affect the typographic layout, use the new *lineAnchor* and *lineHeight* options.
7874

img/poem.png

52.9 KB
Loading

test/output/thisIsJustToSay.svg

Lines changed: 33 additions & 0 deletions
Loading

test/plots/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export {default as stargazersBinned} from "./stargazers-binned.js";
122122
export {default as stargazersHourly} from "./stargazers-hourly.js";
123123
export {default as stargazersHourlyGroup} from "./stargazers-hourly-group.js";
124124
export {default as stocksIndex} from "./stocks-index.js";
125+
export {default as thisIsJustToSay} from "./this-is-just-to-say.js";
125126
export {default as travelersYearOverYear} from "./travelers-year-over-year.js";
126127
export {default as uniformRandomDifference} from "./uniform-random-difference.js";
127128
export {default as untypedDateBin} from "./untyped-date-bin.js";

test/plots/this-is-just-to-say.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as Plot from "@observablehq/plot";
2+
3+
export default function() {
4+
return Plot.plot({
5+
height: 200,
6+
marks: [
7+
Plot.frame(),
8+
Plot.text([`This Is Just To Say\nWilliam Carlos Williams, 1934\n\nI have eaten\nthe plums\nthat were in\nthe icebox\n\nand which\nyou were probably\nsaving\nfor breakfast\n\nForgive me\nthey were delicious\nso sweet\nand so cold`], {frameAnchor: "middle"})
9+
]
10+
});
11+
}

0 commit comments

Comments
 (0)