Skip to content

Commit 0a57694

Browse files
Filmbostock
authored andcommitted
as const 🪄
1 parent 065ed2b commit 0a57694

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/plots/date-intervals.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ export async function intervalWeekMonth() {
66
return Plot.plot({
77
marginLeft: 80,
88
color: {type: "linear", scheme: "blues"},
9-
marks: [
10-
{label: "month", interval: "month" as Plot.TimeIntervalName},
11-
{label: "d3.utcMonth", interval: d3.utcMonth as Plot.IntervalImplementation<Date>},
12-
{label: "week", interval: "week" as Plot.TimeIntervalName},
13-
{label: "d3.utcWeek", interval: d3.utcWeek as Plot.IntervalImplementation<Date>}
14-
].map(({label, interval}: {label: string; interval: Plot.Interval<Date>}) =>
9+
marks: (
10+
[
11+
{label: "month", interval: "month"},
12+
{label: "d3.utcMonth", interval: d3.utcMonth},
13+
{label: "week", interval: "week"},
14+
{label: "d3.utcWeek", interval: d3.utcWeek}
15+
] as const
16+
).map(({label, interval}) =>
1517
Plot.barX(data, {
1618
x: "date",
1719
filter: (d) => d.industry === "Construction",

0 commit comments

Comments
 (0)