-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Hint Mode: Start Coords] Build the foundation for adding start coord…
…s UI for angle graphs (#1492) ## Summary: This PR includes the foundation/prerequisites for adding the start coords UI for angle graphs. - Add the polygon graph type to start-coords-settings.tsx - Create a WORK IN PROGRESS start-coords-angle.tsx file. This will be properly filled in in the following PR, whose main purpose will be adding the body for the UI. - Add the start coords UI angle flag - Add a storybook story for angle graphs (and update polygon story to start with start coords) - Update the angle initializer to account for start coords Issue: https://khanacademy.atlassian.net/browse/LEMS-2073 ## Test plan: `yarn jest` Storybook - http://localhost:6006/?path=/story/perseuseditor-widgets-interactive-graph--interactive-graph-angle <img width="897" alt="image" src="https://github.com/user-attachments/assets/c448bcb2-ae47-4e55-8efb-e6f42e000466"> Author: nishasy Reviewers: Myranae, benchristel Required Reviewers: Approved By: Myranae Checks: ✅ gerald, ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ⏭️ Publish npm snapshot, ✅ Cypress (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald Pull Request URL: #1492
- Loading branch information
Showing
12 changed files
with
190 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@khanacademy/perseus": minor | ||
"@khanacademy/perseus-editor": minor | ||
--- | ||
|
||
[Hint Mode: Start Coords] Build the foundation for adding start coords UI for angle graphs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/perseus-editor/src/components/start-coords-angle.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {View} from "@khanacademy/wonder-blocks-core"; | ||
import * as React from "react"; | ||
|
||
import type {Coord, PerseusGraphType} from "@khanacademy/perseus"; | ||
|
||
type Props = { | ||
startCoords: [Coord, Coord, Coord]; | ||
onChange: (startCoords: PerseusGraphType["startCoords"]) => void; | ||
}; | ||
|
||
const StartCoordsAngle = (props: Props) => { | ||
const {startCoords} = props; | ||
return ( | ||
<View> | ||
WIP | ||
<br /> Start coords: | ||
{startCoords.map((coord, index) => { | ||
return ( | ||
<View key={index}> | ||
{`Point ${index + 1}: (${coord[0]}, ${coord[1]})`} | ||
</View> | ||
); | ||
})} | ||
</View> | ||
); | ||
}; | ||
|
||
export default StartCoordsAngle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters