-
Notifications
You must be signed in to change notification settings - Fork 350
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
View Locked Function in the Interactive Graph #1383
View Locked Function in the Interactive Graph #1383
Conversation
Add test data for locked function.
Add Storybook stories for locked function. Add tests.
Add unit test for plot axis references.
Size Change: +268 B (+0.03%) Total Size: 849 kB
ℹ️ View Unchanged
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1383 +/- ##
==========================================
+ Coverage 69.56% 70.86% +1.29%
==========================================
Files 493 498 +5
Lines 104305 104465 +160
Branches 5293 10617 +5324
==========================================
+ Hits 72563 74032 +1469
+ Misses 31626 30433 -1193
+ Partials 116 0 -116
... and 127 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
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 SO EXCITING! A few small comments, but nothing blocking.
packages/perseus/src/widgets/interactive-graphs/interactive-graph-question-builder.ts
Show resolved
Hide resolved
Add comment to clarify difference between "equation" and "equationParsed".
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (8578b70) and published it to npm. You Example: yarn add @khanacademy/perseus@PR1383 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR1383 |
color: LockedFigureColor; | ||
strokeStyle: "solid" | "dashed"; | ||
equation: string; // This is the user-defined equation (as it was typed) | ||
equationParsed?: { |
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.
@mark-fitzgerald The types in this file represent the "at rest" data representations for Perseus Data. As such, I try to avoid having keys that would never show up in Perseus JSON/data.
As I read this PR, this key would be created the first time this locked figure was rendered and then "cached" here for future renders, right?
My concern is folks thinking they can put data into this key in Perseus JSON and beginning to misuse the intent of this key (which I read as a memoization/cache of the parsed equation).
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, thanks for that clarification. I wasn't aware of this. I will refactor this accordingly when I implement the add/edit capability.
style: strokeStyle, | ||
domain, | ||
}; | ||
const equation = props.equationParsed || KAS.parse(props.equation).expr; |
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.
When is equationParsed
populated?
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 was initially thinking that it would be populated when the content editor types the equation. I'm not sure how that would persist, though, so I'm rethinking the timing/management of this.
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/[email protected] ### Minor Changes - [#1384](#1384) [`5de483386`](5de4833) Thanks [@catandthemachines](https://github.com/catandthemachines)! - Updating TabBar experience in to use arrow-key navigation to access the other TabItems. This will ensure the Expression Widget in perseus has proper keyboard navigation for users. ## @khanacademy/[email protected] ### Minor Changes - [#1383](#1383) [`4b56e10de`](4b56e10) Thanks [@mark-fitzgerald](https://github.com/mark-fitzgerald)! - View Locked Functions in the Interactive Graph - [#1392](#1392) [`b710d07db`](b710d07) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Creation of new angle graph for Mafs interactive graph widget ### Patch Changes - [#1390](#1390) [`7e6ccf38d`](7e6ccf3) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Move graphing-agnostic, mathy functions in the interactive graph code to a math/ folder. - Updated dependencies \[[`5de483386`](5de4833)]: - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - [#1383](#1383) [`4b56e10de`](4b56e10) Thanks [@mark-fitzgerald](https://github.com/mark-fitzgerald)! - View Locked Functions in the Interactive Graph - [#1390](#1390) [`7e6ccf38d`](7e6ccf3) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Move graphing-agnostic, mathy functions in the interactive graph code to a math/ folder. - [#1392](#1392) [`b710d07db`](b710d07) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Creation of new angle graph for Mafs interactive graph widget - Updated dependencies \[[`4b56e10de`](4b56e10), [`7e6ccf38d`](7e6ccf3), [`5de483386`](5de4833), [`b710d07db`](b710d07)]: - @khanacademy/[email protected] - @khanacademy/[email protected] ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`5de483386`](5de4833)]: - @khanacademy/[email protected]
Summary:
Existing locked figures include lines that are straight. The need exists to also have lines that follow a function/equation. Plotting arbitrary functions as a locked figure will provide content creators with a powerful drawing tool for interactive graphs.
Issue: LEMS-1944
Test plan:
Examples:
Quadratic
Sine
Logarithmic