Skip to content

Commit e3eb4c6

Browse files
committed
Update README, CHANGELOG
1 parent 949f9b5 commit e3eb4c6

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

CHANGELOG.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,37 @@
44

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

7-
Mark initializers with the **initializer** option! Plot.initializer for creating custom initializers. [breaking] *mark*.initialize return signature.
7+
Plot now supports mark initializers via the **initializer** option; these can be used to transform or derive new channels. Unlike data transforms which operate in abstract data space, initializers can operate in screen space such as pixel coordinates and colors. For example, initializers can modify a marks’ positions to avoid occlusion. The new hexbin and dodge transforms are implemented as mark initializers.
88

9-
Hexbin transform. Hexgrid, circle, and hexagon marks. Mark channels can define a radius hint to set the upper bound of the default range of the *r* scale.
9+
The new hexbin transform functions similarly to the bin transform, except it aggregates both *x* and *y* into hexagonal bins before reducing. The size of the hexagons can be specified with the **binWidth** option, which controls the width of the (pointy-topped) hexagons.
1010

11-
Dodge transform.
11+
The new hexgrid decoration mark draws a hexagonal grid. It is intended to be used with the hexbin transform as an alternative to the default horizontal and vertical axis grid.
1212

13-
[breaking] Color scales with diverging color schemes now default to the *diverging* scale type instead of the *linear* scale type.
13+
The dot mark now supports the *hexagon* symbol type for pointy-topped hexagons. The new circle and hexagon marks are convenience shorthand for dot marks with the *circle* and *hexagon* symbol, respectively. The dotX, dotY, textX, and textY marks now support the **interval** option.
14+
15+
The new dodge transform can be used to produce beeswarm plots. Given an *x* channel representing the desired horizontal position of circles, the dodgeY transform derives a new *y* (vertical position) channel such that the circles do not overlap; the dodgeX transform similarly derives a new *x* channel given a *y* channel. If an *r* channel is specified, the circles may have varying radius.
1416

15-
The **sort** option now supports index sorting.
17+
The mark **sort** option now supports index sorting. For example, to sort dots by ascending radius:
1618

1719
~~~js
18-
Plot.dot(earthquakes, {x: "longitude", y: "latitude", r: "intensity", sort: {channel: "r", reverse: true}})
20+
Plot.dot(earthquakes, {x: "longitude", y: "latitude", r: "intensity", sort: {channel: "r"}})
1921
~~~
2022

2123
The dot mark now sorts by descending radius by default to reduce occlusion.
2224

23-
The dotX, dotY, textX, and textY marks now support the **interval** option.
24-
25-
Fix crash when using area shorthand (no options).
25+
The **zero** scale option (like the **nice** and **clamp** options) may now be specified as a top-level option, applying to all quantitative scales.
2626

2727
The rule mark now correctly respects the **dx** and **dy** options.
2828

29-
Improve performance of internal array operations and type coercion.
29+
Fix crash when using area mark shorthand.
30+
31+
Marks can now define a channel hint to set the default range of the *r* scale. This is used by the hexbin transform when producing an *r* output channel.
32+
33+
Improve performance of internal array operations, including type coercion.
34+
35+
[breaking] Color scales with diverging color schemes now default to the *diverging* scale type instead of the *linear* scale type.
36+
37+
[breaking] *mark*.initialize return signature.
3038

3139
## 0.4.3
3240

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ The **r** option can be specified as either a channel or constant. When the radi
10251025
10261026
The **stroke** defaults to none. The **fill** defaults to currentColor if the stroke is none, and to none otherwise. The **strokeWidth** defaults to 1.5. The **rotate** and **symbol** options can be specified as either channels or constants. When rotate is specified as a number, it is interpreted as a constant; otherwise it is interpreted as a channel. When symbol is a valid symbol name or symbol object (implementing the draw method), it is interpreted as a constant; otherwise it is interpreted as a channel.
10271027
1028-
The built-in **symbol** types are: *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 specify a D3 or custom symbol type as an object that implements the [*symbol*.draw(*context*, *size*)](https://github.com/d3/d3-shape/blob/main/README.md#custom-symbol-types) method.
1028+
The built-in **symbol** types are: *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)). The *hexagon* symbol is also supported. You can also specify a D3 or custom symbol type as an object that implements the [*symbol*.draw(*context*, *size*)](https://github.com/d3/d3-shape/blob/main/README.md#custom-symbol-types) method.
10291029
10301030
Dots are drawn in input order, with the last data drawn on top. If sorting is needed, say to mitigate overplotting by drawing the smallest dots on top, consider a [sort and reverse transform](#transforms).
10311031
@@ -1057,6 +1057,14 @@ Equivalent to [Plot.dot](#plotdotdata-options) except that if the **y** option i
10571057
10581058
If an **interval** is specified, such as d3.utcDay, **x** is transformed to (*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*.
10591059
1060+
#### Plot.circle(*data*, *options*)
1061+
1062+
Equivalent to [Plot.dot](#plotdotdata-options) except that the **symbol** option is set to *circle*.
1063+
1064+
#### Plot.hexagon(*data*, *options*)
1065+
1066+
Equivalent to [Plot.dot](#plotdotdata-options) except that the **symbol** option is set to *hexagon*.
1067+
10601068
### Hexgrid
10611069
10621070
The hexgrid mark can be used to support marks using the [hexbin](#hexbin) layout.

0 commit comments

Comments
 (0)