Skip to content

Commit d80aa09

Browse files
committed
Update CHANGELOG
1 parent ca50219 commit d80aa09

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44

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

7-
[breaking] Plot.windowX and Plot.windowY now return an aggregate value even when the window contains undefined values, for example at the beginning or at the end of a series. Use the new **strict: true** option to opt-in to the older behavior and return undefined in those cases.
7+
[<img src="./img/window-strict.png" width="640" height="398" alt="A smoothed line chart of Apple’s stock price">](https://observablehq.com/@observablehq/plot-window)
8+
9+
```js
10+
Plot.plot({
11+
marks: [
12+
Plot.lineY(aapl, {x: "Date", y: "Close", stroke: "#ccc", strokeWidth: 1}),
13+
Plot.lineY(aapl, Plot.windowY({k: 20, strict: false}, {x: "Date", y: "Close", stroke: "red"})),
14+
Plot.lineY(aapl, Plot.windowY({k: 20, strict: true}, {x: "Date", y: "Close"}))
15+
]
16+
})
17+
```
18+
19+
[breaking] [Plot.window](./README.md#plotwindowk), [Plot.windowX](./README.md#plotwindowxk-options) and [Plot.windowY](./README.md#plotwindowyk-options) now return an aggregate value even when the window contains undefined values, for example at the beginning or end of a series. Set the new **strict** option to true to instead return undefined if the window contains any undefined values.
820

921
Parts of the README have been incorporated throughout the codebase as JSDoc comments. This allows IDEs to display the documentation as tooltips.
1022

img/window-strict.png

55.6 KB
Loading

test/plots/aapl-close.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default async function () {
99
},
1010
marks: [
1111
Plot.areaY(AAPL, {x: "Date", y: "Close", fillOpacity: 0.1}),
12-
Plot.line(AAPL, {x: "Date", y: "Close"}),
12+
Plot.lineY(AAPL, {x: "Date", y: "Close"}),
1313
Plot.ruleY([0])
1414
]
1515
});

0 commit comments

Comments
 (0)