Skip to content

Commit cb7fb31

Browse files
authored
Merge pull request #2 from mbostock/patch-1
fix x-domain
2 parents a80b848 + 217930b commit cb7fb31

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/income.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function incomeChart(income, width) {
4040
return Plot.plot({
4141
width,
4242
marginLeft: 60,
43-
x: { type: "log" },
43+
x: { type: "log", domain: [2_200, 1_000_000] },
4444
y: { axis: null }, // Hide the y-axis
4545
color: { legend: "swatches", columns: 6, domain: orderSectors },
4646
marks: [
@@ -55,8 +55,8 @@ function incomeChart(income, width) {
5555
order: orderSectors,
5656
thresholds: d3
5757
.ticks(Math.log10(2_000), Math.log10(1_000_000), 40)
58-
.map((d) => +(10 ** d).toPrecision(3)),
59-
tip: true,
58+
.map((d) => 10 ** d),
59+
tip: { format: { x: ",.3r" } }
6060
}
6161
)
6262
),
@@ -74,4 +74,4 @@ function incomeChart(income, width) {
7474
${yearInput}
7575
</div>
7676
${resize((width) => incomeChart(income, width))}
77-
</div>
77+
</div>

0 commit comments

Comments
 (0)