-
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
[Hint Mode: Start Coords] Add start coords UI for quadratic graphs #1469
Conversation
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
Size Change: +407 B (+0.05%) Total Size: 852 kB
ℹ️ View Unchanged
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1469 +/- ##
==========================================
+ Coverage 69.93% 70.56% +0.62%
==========================================
Files 508 512 +4
Lines 105287 105468 +181
Branches 5364 10771 +5407
==========================================
+ Hits 73636 74422 +786
+ Misses 31534 31046 -488
+ Partials 117 0 -117
... and 128 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ |
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.
NIT: Grrr. Same styling as all the other "start-coords-*" implementations.
No need to change anything in this PR.
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.
Ah, I did admittedly copy/paste the entire sinusoid file and build off of it. I should probably break out Tile
into a separate component. Maybe in a different PR.
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.
LGTM
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.
LGTM!
// Act | ||
const equation = getQuadraticEquation([point1, point2, point3]); | ||
|
||
expect(equation).toBe("Division by zero error"); |
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.
This is an interesting case! Thanks for testing it.
I am curious: how does the graph preview render in this case? What happens to the graph when the start coords aren't valid?
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.
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.
I'm not too worried about it because I think this is within the "trust the content authors" territory
(p2[0] * p3[0] * (p2[0] - p3[0]) * p1[1] + | ||
p3[0] * p1[0] * (p3[0] - p1[0]) * p2[1] + | ||
p1[0] * p2[0] * (p1[0] - p2[0]) * p3[1]) / | ||
denom; |
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.
This is copied from InteractiveGraph.getQuadraticCoefficients
?
I wish we had a central place where this logic could live, and both perseus
and perseus-editor
could import it from there. I think kmath
is probably the best candidate that place. Would it be too hard to move getQuadraticCoefficients
to kmath
?
If you don't want to move it in this PR, I can move it once this is landed.
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.
Yes, that would be awesome! Sorry, I didn't see your comment before landing.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/perseus@27.2.0 ### Minor Changes - [#1468](#1468) [`af68a9e08`](af68a9e) Thanks [@nishasy](https://github.com/nishasy)! - [Hint Mode: Start Coords] Add start coords UI for sinusoid graphs - [#1469](#1469) [`6e1ec850c`](6e1ec85) Thanks [@nishasy](https://github.com/nishasy)! - [Hint Mode: Start Coords] Add start coords UI for quadratic graphs ### Patch Changes - [#1470](#1470) [`942b0a9a5`](942b0a9) Thanks [@nishasy](https://github.com/nishasy)! - [Interactive Graph Locked Figures] Remove m2 flag from the code - [#1465](#1465) [`94ad04fee`](94ad04f) Thanks [@nishasy](https://github.com/nishasy)! - [Hint Mode: Start Coords] Add separate flags for graph types - [#1432](#1432) [`ed6737025`](ed67370) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Bug fix to ensure that new angle graphs are scored correctly. ## @khanacademy/perseus-editor@11.2.0 ### Minor Changes - [#1468](#1468) [`af68a9e08`](af68a9e) Thanks [@nishasy](https://github.com/nishasy)! - [Hint Mode: Start Coords] Add start coords UI for sinusoid graphs - [#1469](#1469) [`6e1ec850c`](6e1ec85) Thanks [@nishasy](https://github.com/nishasy)! - [Hint Mode: Start Coords] Add start coords UI for quadratic graphs ### Patch Changes - [#1470](#1470) [`942b0a9a5`](942b0a9) Thanks [@nishasy](https://github.com/nishasy)! - [Interactive Graph Locked Figures] Remove m2 flag from the code - [#1465](#1465) [`94ad04fee`](94ad04f) Thanks [@nishasy](https://github.com/nishasy)! - [Hint Mode: Start Coords] Add separate flags for graph types - Updated dependencies \[[`af68a9e08`](af68a9e), [`942b0a9a5`](942b0a9), [`6e1ec850c`](6e1ec85), [`94ad04fee`](94ad04f), [`ed6737025`](ed67370)]: - @khanacademy/perseus@27.2.0
Summary:
Add the UI to specify start coords for Quadratic graph type.
than the static method on InteractiveGraph that does the same)
Issue: https://khanacademy.atlassian.net/browse/LEMS-2210
Test plan:
yarn jest
Storybook