Skip to content

Commit ee2d3d2

Browse files
committed
simplify horizon
1 parent de3fa60 commit ee2d3d2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The new *clip* mark option enables clipping to the plot frame. For example, this
1717
<img src="./img/horizon.png" width="640" alt="a horizon chart of unemployment rates by metro area; increases are shown in red, and decreases in blue">
1818

1919
```js
20-
d3.ticks(0, max, bands).map(t => Plot.areaY(traffic, {x: "date", y: d => d.value - t, fill: () => t, clip: true}))
20+
d3.ticks(0, max, bands).map(t => Plot.areaY(traffic, {x: "date", y: d => d.value - t, fill: t, clip: true}))
2121
```
2222

2323
Plot can now generate helpful warnings for common mistakes. Warnings are indicated ⚠️ in the top-right corner of the plot; open your browser’s developer console to read the warnings. For example, if you forget to parse strings to dates resulting in an *ordinal* scale rather than the desired *utc* scale, Plot will advise on how to fix the scale definition.

test/plots/traffic-horizon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default async function() {
3232
y: "name"
3333
},
3434
marks: [
35-
ticks.map(t => Plot.areaY(data, {x: "date", y: d => d.value - t, fill: () => t, clip: true})),
35+
ticks.map(t => Plot.areaY(data, {x: "date", y: d => d.value - t, fill: t, clip: true})),
3636
Plot.text(data, Plot.selectFirst({text: "name", frameAnchor: "left"}))
3737
]
3838
});

0 commit comments

Comments
 (0)