-
Notifications
You must be signed in to change notification settings - Fork 351
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
[Interactive Graph] Update protractor to new SVG #2263
Conversation
…s going in both directions
The old protractor looked awful. We got a request to use a protractor with two rows of numbers going in opposite directions (previously there was only one direction). - Update the protractor to a new SVG with numbers going both ways Note: The numbers are kind of hard to read over the axes. I tried to add white backgrounds to the numbers, but it's unfortunately not as easy as it looks. Since this is not a regression, I left it as is. Note 2: There is a noticable performance hit with this implementation. If someone has ideas for how to improve the performance, please let me know! Issue: https://khanacademy.atlassian.net/browse/LEMS-2863 Test plan: Storybook - https://khan.github.io/perseus/?path=/story/perseus-widgets-interactive-graph-visual-regression-tests--mafs-with-protractor
Size Change: +1 B (0%) Total Size: 872 kB
ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (67965da) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2263 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR2263 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I had two thoughts (neither of which are blocking):
- This increases the bundle size by about 45kb. Previously we loaded the protractor image remotely which meant that the image size didn't increase the main Perseus bundle size. Perhaps you could touch base with FEI to see their thoughts on something like this? I think it makes sense to embed the SVG ... and perhaps the gzip compression we apply when serving the JS bundles will negate the increase.
- Should we change the mouse cursor to the move handle instead the default arrow? I notice for other movables in the graph we do that, but not when moving the protractor. This seems like a new change, but it felt "off" that the mouse cursor didn't change to show I could drag the protractor (but it did for the double-ended arrow that allows me to rotate the protractor)
Also, for posterity, here's the Chromatic publish of Storybook with the new Protractor SVG: https://650db21c3f5d1b2f13c02952-bhaakpommq.chromatic.com/?path=/story/perseus-widgets-interactive-graph-visual-regression-tests--mafs-with-protractor
stroke: #808080; | ||
} | ||
|
||
.MafsView .interactive-graph-protractor .protractor-number { | ||
fill: #21242c; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these two colours represented in CSS variables? It's likely not worth the effort to create them if they don't exist given that the Protractor isn't a tool we want to encourage new usages of, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Round II. Still looks good. 😁
Summary:
The old protractor looked awful. We got a request to use a protractor
with two rows of numbers going in opposite directions (previously
there was only one direction).
Note: The numbers are kind of hard to read over the axes. I tried to add
white backgrounds to the numbers, but it's unfortunately not as easy as
it looks. Since this is not a regression, I left it as is.
Issue: https://khanacademy.atlassian.net/browse/LEMS-2863
Test plan:
Storybook