From 217930b48458624d6ec5ab0285daf5bcb1feeeb5 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Sun, 17 Mar 2024 12:28:34 -0700 Subject: [PATCH] fix x-domain --- docs/income.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/income.md b/docs/income.md index 49c6b27..8b61c19 100644 --- a/docs/income.md +++ b/docs/income.md @@ -40,7 +40,7 @@ function incomeChart(income, width) { return Plot.plot({ width, marginLeft: 60, - x: { type: "log" }, + x: { type: "log", domain: [2_200, 1_000_000] }, y: { axis: null }, // Hide the y-axis color: { legend: "swatches", columns: 6, domain: orderSectors }, marks: [ @@ -55,8 +55,8 @@ function incomeChart(income, width) { order: orderSectors, thresholds: d3 .ticks(Math.log10(2_000), Math.log10(1_000_000), 40) - .map((d) => +(10 ** d).toPrecision(3)), - tip: true, + .map((d) => 10 ** d), + tip: { format: { x: ",.3r" } } } ) ), @@ -74,4 +74,4 @@ function incomeChart(income, width) { ${yearInput} ${resize((width) => incomeChart(income, width))} - \ No newline at end of file +