Skip to content

Commit

Permalink
Merge pull request #3311 from quantified-uncertainty/chart-fix
Browse files Browse the repository at this point in the history
X axis positioning fix
  • Loading branch information
berekuk authored Jun 6, 2024
2 parents b24a917 + 38676f8 commit b6e6696
Show file tree
Hide file tree
Showing 4 changed files with 1,271 additions and 1,060 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-dingos-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@quri/squiggle-components": patch
---

Fix x axis position in charts
10 changes: 5 additions & 5 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
"@lezer/highlight": "^1.2.0",
"@lezer/lr": "^1.4.1",
"@quri/configs": "workspace:*",
"@storybook/addon-essentials": "^8.1.5",
"@storybook/addon-links": "^8.0.9",
"@storybook/react": "^8.1.5",
"@storybook/react-vite": "^8.0.9",
"@storybook/addon-essentials": "^8.1.6",
"@storybook/addon-links": "^8.1.6",
"@storybook/react": "^8.1.6",
"@storybook/react-vite": "^8.1.6",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.6",
"@testing-library/user-event": "^14.5.2",
Expand Down Expand Up @@ -84,7 +84,7 @@
"react": "^18.2.0",
"react-dom": "^18.3.1",
"rollup-plugin-node-builtins": "^2.1.2",
"storybook": "^8.1.5",
"storybook": "^8.1.6",
"tailwindcss": "^3.4.3",
"typescript": "^5.3.3",
"vite": "^5.2.10"
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/lib/draw/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function drawAxes({
_frame || makeCartesianFrame({ context, padding, width, height });

xScale.range([0, frame.width]);
yScale.range([0, frame.height]);
yScale.range([0, frame.height]).clamp(true);

// x axis
if (showXAxis) {
Expand Down
Loading

0 comments on commit b6e6696

Please sign in to comment.