Skip to content

Constrain simulator graph width to fix oversized text#4548

Open
chrislongros wants to merge 1 commit intoankitects:mainfrom
chrislongros:fix/simulator-ui-refinements
Open

Constrain simulator graph width to fix oversized text#4548
chrislongros wants to merge 1 commit intoankitects:mainfrom
chrislongros:fix/simulator-ui-refinements

Conversation

@chrislongros
Copy link

Partial fix for #4168 (complements #4535 which addresses the border-radius)

The FSRS simulator modal uses max-width: 100vw, causing the SVG graph to stretch across the full viewport. Since text inside the SVG scales with the viewBox, axis labels and legend text appear disproportionately large compared to surrounding UI elements.

This adds max-width: 800px to .svg-container, keeping the graph at a readable size consistent with the statistics page graphs.

Before/after screenshots to follow in comments.

@chrislongros chrislongros force-pushed the fix/simulator-ui-refinements branch 2 times, most recently from 6480a24 to 5808da5 Compare February 8, 2026 10:48
@chrislongros
Copy link
Author

Before:
Screenshot_20260208_114251

After:
Screenshot_20260208_114803

Partial fix for ankitects#4168

The simulator modal uses max-width: 100vw, causing the SVG graph
to stretch across the full viewport. Since text inside the SVG
scales with the viewBox, axis labels and legend text appear
disproportionately large compared to surrounding UI elements.

Adding max-width to svg-container keeps the graph at a readable
size consistent with graphs on the statistics page.
@chrislongros chrislongros force-pushed the fix/simulator-ui-refinements branch from 5808da5 to 1d28101 Compare February 8, 2026 14:50
@abdnh
Copy link
Collaborator

abdnh commented Feb 9, 2026

This doesn't look good with bigger screens:

image

This adds max-width: 800px to .svg-container, keeping the graph at a readable size consistent with the statistics page graphs.

We don't need to be consistent with the stats page here, as we only have a single graph, and having it fill available space is better for readability. Might be better to set a smaller font-size instead - See Graph.svelte for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants