Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of new nested SVGs and Tick Labels for Interactive Graph to solve Safari rendering issues. #1452

Merged
merged 27 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0fb7393
Testing prototype of new SVG axis tick labels + clipping mask
SonicScrewdriver Jul 25, 2024
331d985
Updating prototype for Safari testing
SonicScrewdriver Aug 8, 2024
f3f1bc3
Updating prototype to solve a couple small bugs before recording demo
SonicScrewdriver Aug 8, 2024
cdb2d4b
wip
SonicScrewdriver Aug 13, 2024
4c802a2
You put the svg in the svg and you line it all up
SonicScrewdriver Aug 14, 2024
034e2b3
Solved ALL of the clipping mask issues!
SonicScrewdriver Aug 21, 2024
ae564a9
Added more edge cases, and started refactoring. Everything appears to…
SonicScrewdriver Aug 22, 2024
f86a725
Committing stories
SonicScrewdriver Aug 22, 2024
5c05560
Clean up!
SonicScrewdriver Aug 23, 2024
cfdc26b
Refactoring + cleanup
SonicScrewdriver Aug 27, 2024
b915554
Tidying up comment errors
SonicScrewdriver Aug 27, 2024
a1e668a
Fixing "magic numbers" as much as possible
SonicScrewdriver Aug 27, 2024
cab392f
Fussing about comments
SonicScrewdriver Aug 27, 2024
d06b55c
Removing old tests
SonicScrewdriver Aug 27, 2024
97048f4
Cleaning up storybook + css comment
SonicScrewdriver Aug 27, 2024
e572d62
Fixing minor negative 1 bug as we still want the tick
SonicScrewdriver Aug 28, 2024
71f449a
Adding a test for a simple function
SonicScrewdriver Aug 28, 2024
a6b7bd7
Fixing weird editor save bugs + renaming function
SonicScrewdriver Aug 28, 2024
88f0b47
Fixing PR to fully use X/Y and MIN/MAX
SonicScrewdriver Aug 28, 2024
c90b86c
Clean up + Fixing Safari Zoom bug + using KaTeX font
SonicScrewdriver Sep 4, 2024
b9e6109
Adjusting spacing as KaTeX seems to have a shorter xHeight
SonicScrewdriver Sep 4, 2024
eb4f90c
Cleanup + Added tests
SonicScrewdriver Sep 5, 2024
bc5f425
Retested SVG w/ CSS + minor visual improvements
SonicScrewdriver Sep 5, 2024
8d82012
Clean up storybook
SonicScrewdriver Sep 5, 2024
98ec076
[Locked Labels] Make a mafs sandwich so that labels can have backgrounds
nishasy Sep 10, 2024
e89727e
Revert "[Locked Labels] Make a mafs sandwich so that labels can have …
nishasy Sep 10, 2024
2b2e503
fallback fonts
SonicScrewdriver Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wet-students-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": minor
---

Implementation of SVG-based Axis Tick Labels for Interactive Graph
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ export default function AxisArrows() {

const axisColor = "var(--mafs-fg)";

// Only render the arrows if the axis is within the visible range
// as otherwise the arrows will be rendered outside the graph
return (
<>
<Arrowhead color={axisColor} tip={[xMin, 0]} angle={180} />
<Arrowhead color={axisColor} tip={[xMax, 0]} angle={0} />
<Arrowhead color={axisColor} tip={[0, yMin]} angle={90} />
<Arrowhead color={axisColor} tip={[0, yMax]} angle={270} />
{!(yMin > 0 || yMax < 0) && (
<>
<Arrowhead color={axisColor} tip={[xMin, 0]} angle={180} />
<Arrowhead color={axisColor} tip={[xMax, 0]} angle={0} />
</>
)}
{!(xMin > 0 || xMax < 0) && (
<>
<Arrowhead color={axisColor} tip={[0, yMin]} angle={90} />
<Arrowhead color={axisColor} tip={[0, yMax]} angle={270} />
</>
)}
</>
);
}

This file was deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is no longer needed, as the labels were able to be reintegrated with the axis-ticks themselves.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is no longer necessary, as we're pairing the ticks and labels back together within the SVG.

This file was deleted.

Loading