Skip to content

Commit 8d55724

Browse files
committed
prettier
1 parent f437968 commit 8d55724

22 files changed

+45
-45
lines changed

docs/ex/d3/bivariate-choropleth.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,6 @@
124124
</script>
125125
<script id="379" type="module" pinned="">
126126
const us = await FileAttachment("data/us-counties-albers-10m.json").json();
127-
const states = display(new Map(us.objects.states.geometries.map(d => [d.id, d.properties])));
127+
const states = display(new Map(us.objects.states.geometries.map((d) => [d.id, d.properties])));
128128
</script>
129129
</notebook>

docs/ex/d3/brushable-scatterplot-matrix.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
.rangeRound([padding / 2, size - padding / 2]))
3333

3434
// Define the companion vertical scales (one for each column).
35-
const y = x.map(x => x.copy().range([size - padding / 2, padding / 2]));
35+
const y = x.map((x) => x.copy().range([size - padding / 2, padding / 2]));
3636

3737
// Define the color scale.
3838
const color = d3.scaleOrdinal()

docs/ex/d3/brushable-scatterplot.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
const [[x0, y0], [x1, y1]] = s;
8282
value = dot
8383
.style("stroke", "gray")
84-
.filter(d => x0 <= x(d["Miles_per_Gallon"]) && x(d["Miles_per_Gallon"]) < x1
84+
.filter((d) => x0 <= x(d["Miles_per_Gallon"]) && x(d["Miles_per_Gallon"]) < x1
8585
&& y0 <= y(d["Horsepower"]) && y(d["Horsepower"]) < y1)
8686
.style("stroke", "steelblue")
8787
.data();

docs/ex/d3/chord.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090

9191
function groupTicks(d, step) {
9292
const k = (d.endAngle - d.startAngle) / d.value;
93-
return d3.range(0, d.value, step).map(value => {
93+
return d3.range(0, d.value, step).map((value) => {
9494
return {value: value, angle: value * k + d.startAngle};
9595
});
9696
}

docs/ex/d3/hertzsprung-russell.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
// Create the axes.
4848
svg.append("g")
4949
.attr("transform", `translate(${marginLeft},0)`)
50-
.call(d3.axisLeft(d3.scaleLog(y.domain().map(m => Math.pow(10, 4.83 - m)), y.range())));
50+
.call(d3.axisLeft(d3.scaleLog(y.domain().map((m) => Math.pow(10, 4.83 - m)), y.range())));
5151

5252
svg.append("g")
5353
.attr("transform", `translate(${width - marginRight},0)`)
@@ -117,7 +117,7 @@
117117
: bv < 1.5 ? (t = (bv - 0.4) / 1.1, 1 - (0.47 * t) + (0.1 * t * t))
118118
: bv < 1.94 ? (t = (bv - 1.5) / 0.44, 0.63 - (0.6 * t * t))
119119
: 0
120-
].map(t => Math.round(t * 255).toString(16).padStart(2, "0")).join("")}`;
120+
].map((t) => Math.round(t * 255).toString(16).padStart(2, "0")).join("")}`;
121121
}
122122

123123
function temperature(color) {

docs/ex/d3/hierarchical-edge-bundling-2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
});
8181
const root = d3.hierarchy(rootData);
8282
const nodeById = new Map(root.leaves().map((d) => [id(d), d]));
83-
for (const d of root.leaves()) d.incoming = [], d.outgoing = d.data.imports.map(i => [d, nodeById.get(i)]);
83+
for (const d of root.leaves()) d.incoming = [], d.outgoing = d.data.imports.map((i) => [d, nodeById.get(i)]);
8484
for (const d of root.leaves()) for (const o of d.outgoing) o[1].incoming.push(o);
8585
root.sort((a, b) => d3.ascending(a.height, b.height) || d3.ascending(a.data.name, b.data.name));
8686
return root;

docs/ex/d3/hierarchical-edge-bundling.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929
.selectAll()
3030
.data(root.leaves())
3131
.join("g")
32-
.attr("transform", d => `rotate(${d.x * 180 / Math.PI - 90}) translate(${d.y},0)`)
32+
.attr("transform", (d) => `rotate(${d.x * 180 / Math.PI - 90}) translate(${d.y},0)`)
3333
.append("text")
3434
.attr("dy", "0.31em")
35-
.attr("x", d => d.x < Math.PI ? 6 : -6)
36-
.attr("text-anchor", d => d.x < Math.PI ? "start" : "end")
37-
.attr("transform", d => d.x >= Math.PI ? "rotate(180)" : null)
35+
.attr("x", (d) => d.x < Math.PI ? 6 : -6)
36+
.attr("text-anchor", (d) => d.x < Math.PI ? "start" : "end")
37+
.attr("transform", (d) => d.x >= Math.PI ? "rotate(180)" : null)
3838
.text((d) => d.data.name)
3939
.each(function(d) { d.text = this; })
4040
.on("mouseover", overed)
4141
.on("mouseout", outed)
42-
.call(text => text.append("title").text((d) => `${id(d)}
42+
.call((text) => text.append("title").text((d) => `${id(d)}
4343
${d.outgoing.length} outgoing
4444
${d.incoming.length} incoming`));
4545

@@ -52,7 +52,7 @@
5252
.attr("stroke", colornone)
5353
.attr("fill", "none")
5454
.selectAll()
55-
.data(root.leaves().flatMap(leaf => leaf.outgoing))
55+
.data(root.leaves().flatMap((leaf) => leaf.outgoing))
5656
.join("path")
5757
.style("mix-blend-mode", "multiply")
5858
.attr("d", ([i, o]) => line(i.path(o)))
@@ -96,7 +96,7 @@
9696
});
9797
const root = d3.hierarchy(rootData);
9898
const nodeById = new Map(root.leaves().map((d) => [id(d), d]));
99-
for (const d of root.leaves()) d.incoming = [], d.outgoing = d.data.imports.map(i => [d, nodeById.get(i)]);
99+
for (const d of root.leaves()) d.incoming = [], d.outgoing = d.data.imports.map((i) => [d, nodeById.get(i)]);
100100
for (const d of root.leaves()) for (const o of d.outgoing) o[1].incoming.push(o);
101101
root.sort((a, b) => d3.ascending(a.height, b.height) || d3.ascending(a.data.name, b.data.name));
102102
return root;

docs/ex/d3/icelandic-population-by-age.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@
8484
.duration(delay);
8585

8686
rect = rect
87-
.data(data.filter(d => d.year === year), (d) => `${d.sex}:${d.year - d.age}`)
87+
.data(data.filter((d) => d.year === year), (d) => `${d.sex}:${d.year - d.age}`)
8888
.join(
89-
enter => enter.append("rect")
89+
(enter) => enter.append("rect")
9090
.style("mix-blend-mode", "darken")
9191
.attr("fill", (d) => color(d.sex))
9292
.attr("x", (d) => x(d.age) + dx)
9393
.attr("y", (d) => y(0))
9494
.attr("width", x.bandwidth() + 1)
9595
.attr("height", 0),
96-
update => update,
97-
exit => exit.call(rect => rect.transition(t).remove()
96+
(update) => update,
97+
(exit) => exit.call((rect) => rect.transition(t).remove()
9898
.attr("y", y(0))
9999
.attr("height", 0))
100100
);

docs/ex/d3/impact-of-vaccines.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
.attr("transform", `translate(0,${height - marginBottom + 4})`)
8787
.call(d3.axisBottom(x)
8888
.tickValues([year])
89-
.tickFormat(x => x)
89+
.tickFormat((x) => x)
9090
.tickSize(marginTop + marginBottom - height - 10))
9191
.call((g) => g.select(".tick text")
9292
.clone()

docs/ex/d3/index-chart.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
svg.append("g")
6868
.attr("transform", `translate(${marginLeft},0)`)
6969
.call(d3.axisLeft(y)
70-
.ticks(null, x => +x.toFixed(6) + "×"))
70+
.ticks(null, (x) => +x.toFixed(6) + "×"))
7171
.call((g) => g.selectAll(".tick line").clone()
7272
.attr("stroke-opacity", (d) => d === 1 ? null : 0.2)
7373
.attr("x2", width - marginLeft - marginRight))

0 commit comments

Comments
 (0)