Skip to content

Commit ab65fd8

Browse files
committed
update CHANGELOG
1 parent d612b03 commit ab65fd8

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

CHANGELOG.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,30 +126,32 @@ Plot.plot({
126126
})
127127
```
128128

129-
Empty facets, which can occur when faceting in both *x* and *y*, or when the *fx* or *fy* domain is explicitly specified and includes values not present in the data, are no longer rendered. When the facet *data* is null, a better error message is thrown.
129+
Empty facets, which can occur when faceting in both *x* and *y*, or when the specified *fx* or *fy* domain includes values not present in the data, are no longer rendered. When the facet *data* is null, a better error message is thrown.
130130

131131
### Transforms
132132

133-
The bin and group transforms now support new *filter*, *sort* and *reverse* options on the *outputs* object. By setting the *filter* to null, the bin transform will now return all bins, including the empty ones; this is useful with marks such as lines and areas that require zeroes to be present, rather than interpolating across the missing bins. (The *z*, *fill* or *stroke* channels, when used for grouping, are propagated to empty bins.) The *outputs* argument to the bin and group transforms is now optional; it defaults to the *count* reducer for *y*, *x* and *fill* for Plot.binX, Plot.binY, and Plot.bin respectively, and the same for the group transforms.
133+
The bin and group transforms now support new *filter*, *sort* and *reverse* options on the *outputs* object. By setting the *filter* to null, the bin transform will now return all bins, even if empty; this is useful with marks such as lines and areas that require zeroes to be present, rather than interpolating across the missing bins. (The *z*, *fill* or *stroke* channels, when used for grouping, are propagated to empty bins.)
134134

135-
<img width="640" alt="a one-dimensional scatterplot hightlighting empty bins" src="https://user-images.githubusercontent.com/7001/130244527-6b3191c3-4d8f-4cb7-8209-7ab47f02e871.png">
135+
<img width="641" alt="a stacked area chart showing the count of covid cases resulting in deaths over time for San Francisco, broken down by transmission category; if empty bins were not present, this chart would render incorrectly" src="https://user-images.githubusercontent.com/230541/130282717-01fb2979-0c8b-415b-8a67-bef169b9c6b5.png">
136136

137137
```js
138138
Plot.plot({
139139
marks: [
140-
Plot.rect(
141-
penguins,
142-
Plot.binX(
143-
{ filter: (bin) => !bin.length },
144-
{ x: "bill_length", thresholds: 100, fill: "#ddd" }
145-
)
146-
),
147-
Plot.dotX(penguins, { x: "bill_length", y: Math.random, fill: "#aaa", r: 2 })
148-
],
149-
height: 80
140+
Plot.areaY(cases, Plot.binX({y: "sum", filter: null}, {
141+
x: "specimen_collection_date",
142+
y: "case_count",
143+
filter: d => d.case_disposition === "Death",
144+
fill: "transmission_category",
145+
curve: "step",
146+
thresholds: d3.utcWeek
147+
})),
148+
Plot.ruleY([0])
149+
]
150150
})
151151
```
152152

153+
The *outputs* argument to the bin and group transforms is now optional; it defaults to the *count* reducer for *y*, *x* and *fill* for Plot.binX, Plot.binY, and Plot.bin respectively, and the same for the group transforms.
154+
153155
The bin and group transforms now support new *distinct*, *mode*, *min-index*, and *max-index* reducers. The *distinct* reducer counts the number of distinct values in each group, while the *mode* reducer returns the most frequent value in each group. The *min-index* and *max-index* reducers are similar to *min* and *max*, except they return the zero-based index of the minimum and maximum value, respectively; for example, this is useful to sort time series by the date of each series’ peak.
154156

155157
The default *thresholds* option for the bin transforms is now *auto* instead of *scott*. The *auto* option applies a maximum limit of 200 bins to Scott’s rule. This reduces the risk of producing vanishing rects when they are too numerous and thin to be visible. (Note, however, that it is still possible to produce invisible rects if the insets are larger than the width.)

0 commit comments

Comments
 (0)