Skip to content

Commit

Permalink
Merge pull request #2 from mbostock/patch-1
Browse files Browse the repository at this point in the history
fix x-domain
  • Loading branch information
jaanli authored Mar 19, 2024
2 parents a80b848 + 217930b commit cb7fb31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/income.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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" } }
}
)
),
Expand All @@ -74,4 +74,4 @@ function incomeChart(income, width) {
${yearInput}
</div>
${resize((width) => incomeChart(income, width))}
</div>
</div>

0 comments on commit cb7fb31

Please sign in to comment.