Skip to content

Commit

Permalink
always start dist y scale from 0
Browse files Browse the repository at this point in the history
  • Loading branch information
berekuk committed Jan 18, 2024
1 parent 60f6983 commit d728852
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,7 @@ const InnerDistributionsChart: FC<{
]);

const yScale = sqScaleToD3(plot.yScale);
yScale.domain([
Math.max(Math.min(...domain.map((p) => p.y)), 0), // min value, but at least 0
Math.max(...domain.map((p) => p.y)),
]);
yScale.domain([0, Math.max(...domain.map((p) => p.y))]);

return { xScale, yScale };
}, [domain, plot.xScale, plot.yScale]);
Expand Down

0 comments on commit d728852

Please sign in to comment.