[ Interactive Graph | Vector Graph ] PR1: Type Definitions and Schema#3433
[ Interactive Graph | Vector Graph ] PR1: Type Definitions and Schema#3433SonicScrewdriver wants to merge 2 commits intomainfrom
Conversation
… stubs for Vector graph
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.
🗄️ Schema Change: Changes Detected
|
|
Size Change: +127 B (+0.03%) Total Size: 495 kB
ℹ️ View Unchanged
|
🛠️ Item Splitting: Changes Detected
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (86bb5dd) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3433If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3433If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3433 |
Summary
This PR was created with the help of AI, albeit with heavy oversight and review.
This is part of a series of PRs implementing the vector graph type for the Interactive Graph widget:
PR2 – state management
PR3 – rendering & accessibility
PR4 – scoring
PR5 – editor support
Issue: LEMS-3971
Changes:
PerseusGraphTypeVector(type: "vector", coords: CollinearTuple | null, startCoords: CollinearTuple) andVectorGraphCorrect, and includes both in thePerseusGraphTypeandPerseusGraphCorrectTypeunions. The shape matchesPerseusGraphTypeRay— two coordinates representing tail and tip.parsePerseusGraphTypeVectorand registers it withparsePerseusGraphTypeso the new type round-trips through the parser.VectorGraphState(type: "vector", coords: PairOfPoints) and adds it to theInteractiveGraphStateunion.throw new Error("Not implemented")inrenderGraphElements(mafs-graph.tsx) andinitializeGraphState(initialize-graph-state.ts), and returns "" ingetEquationString(interactive-graph.tsx) to keep TypeScript exhaustiveness errors clear until subsequent PRs fill in the implementation.mergeGraphsswitch (interactive-graph-editor.tsx) andshouldShowStartCoordsUI(util.ts) to satisfy exhaustiveness checks in the editor.getGraphOptionsForPropsandgetUserInput), mafs-state-to-interactive-graph.ts (serialization), and interactive-graph-reducer.ts (movePointInFigureguard) for exhaustiveness.Test plan:
pnpm tsc— no new type errorspnpm lint— no lint errors