[Interactive Graph] Add logarithm graph option in the Interactive Graph Editor#3425
Conversation
🗄️ Schema Change: No Changes ✅ |
🛠️ Item Splitting: No Changes ✅ |
|
Size Change: +540 B (+0.11%) Total Size: 497 kB
ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (53155ac) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3425If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3425If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3425 |
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
@claude review once |
.../perseus-editor/src/widgets/interactive-graph-editor/start-coords/start-coords-logarithm.tsx
Outdated
Show resolved
Hide resolved
7c67738 to
8976066
Compare
fd16188 to
ada2fad
Compare
8976066 to
680fbf2
Compare
…: Add logarithm graph option in the Interactive Graph Editor
…aph] Add logarithm graph option in the Interactive Graph Editor
63f729e to
53155ac
Compare
SonicScrewdriver
left a comment
There was a problem hiding this comment.
A couple of small suggestions, mostly about the project at large, but nothing blocking imo.
However, I'm not able to test the editor for this PR's chromatic storybook snapshot. I could have sworn I got Exponential working, but I don't see that available either. It'd be great to be able to test the full widget editors in storybook for additional confidence. Given that we're doing a couple rounds of play testing, I'm still alright to approve anyway.
| @@ -0,0 +1,36 @@ | |||
| /* We have to use !important until wonder blocks is in the shared layer. */ | |||
There was a problem hiding this comment.
I honestly wonder how many of these !importants are necessary. I would love it if we made a task to clean up as many of these as possible as part of our project (aka before LEMS-3686, which might be a while).
| const {coords, asymptote} = startCoords; | ||
|
|
||
| // Local state for the asymptote x-value text field so the user can type | ||
| // freely without the field resetting mid-keystroke. Pattern from StartCoordsCircle. |
There was a problem hiding this comment.
The AI really likes to say where it stole things from, but I'm not sure "Pattern from StartCoordsCircle." is particularly helpful
Summary:
PR series to add logarithm graph support to the Interactive Graph widget:
Add logarithm graph option in the Interactive Graph Editor
StartCoordsLogarithmcomponent for configuring logarithm start coordinates in the editorinteractive-graph-logarithmfeature flaggetLogarithmCoordsfor use by the editorDetails
This PR enables content creators to configure logarithm exercises in the Interactive Graph editor, following the exponential editor pattern.
StartCoordsLogarithm component:
y = a * ln(b*x + c)with computed coefficient valuesstart-coords-exponential.module.cssFeature flag: "Logarithm function" appears in the graph type selector only when
interactive-graph-logarithmis enabled, preventing content creators from selecting it until it's ready for launch.Editor validation: The start asymptote x-value is validated — it cannot fall between or on the x-coordinates of the curve's start points (mirrors exponential's y-axis validation but for x-axis).
Exports:
getLogarithmCoords()is now exported frominitialize-graph-state.tsand re-exported from@khanacademy/perseusfor use by the editor's start-coords UI.Co-Authored by Claude Code (Opus)
Issue: LEMS-3969
Test plan:
pnpm tscpassespnpm knippassespnpm lintpassespnpm prettier . --checkpasses