You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+23-27Lines changed: 23 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
*Not yet released. These are forthcoming changes in the main branch.*
6
6
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.
8
8
9
9
[<imgsrc="./img/arrow.png"width="660"alt="a scatterplot with arrows">](https://observablehq.com/@observablehq/plot-arrow)
10
10
@@ -19,7 +19,7 @@ Plot.arrow(data, {
19
19
})
20
20
```
21
21
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.
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).
34
34
35
35
[<imgsrc="./img/symbol.png"width="660"alt="a scatterplot of penguins by mass and flipper length">](https://observablehq.com/@observablehq/plot-dot)
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.
42
42
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
+
[<imgsrc="./img/poem.png"width="660"alt="This Is Just To Say, by William Carlos Williams">](https://observablehq.com/@observablehq/plot-text)
44
44
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
+
```
46
54
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.
48
56
49
57
All marks now support the new standard *href* channel and *target* option, turning the mark into a clickable link.
50
58
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*).
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.
68
64
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.
70
66
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.
72
68
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.
74
70
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.
76
72
77
73
[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.
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"})
0 commit comments