Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/angry-zoos-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@khanacademy/perseus": minor
"@khanacademy/perseus-core": minor
"@khanacademy/perseus-editor": minor
---

Creation of new Vector graph and subcomponents.
52 changes: 52 additions & 0 deletions packages/perseus/src/strings.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: once this is release, please keep an eye out on the translation PR comment in frontend release and request for the new strings based on our process timeline is two weeks after it is requested, it should be still within timeline before our next internal and content play test.

Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,30 @@ export type PerseusStrings = {
point2X: string;
point2Y: string;
}) => string;
srVectorGraph: string;
srVectorPoints: ({
tailX,
tailY,
tipX,
tipY,
}: {
tailX: string;
tailY: string;
tipX: string;
tipY: string;
}) => string;
srVectorTipPoint: ({x, y}: {x: string; y: string}) => string;
srVectorGrabHandle: ({
tailX,
tailY,
tipX,
tipY,
}: {
tailX: string;
tailY: string;
tipX: string;
tipY: string;
}) => string;
srQuadraticGraph: string;
srQuadraticFaceUp: string;
srQuadraticFaceDown: string;
Expand Down Expand Up @@ -1033,6 +1057,28 @@ export const strings = {
"Aria label for the point that determines the direction of the Ray in the interactive graph widget. The ray passes through this point.",
message: "Through point at %(x)s comma %(y)s.",
},
srVectorGraph: {
context:
"Screen reader description for the container containing a Vector in the interactive graph widget.",
message: "A vector on a coordinate plane.",
},
srVectorPoints: {
context:
"Screen reader description for the tail and tip of a vector in the interactive graph widget.",
message:
"The tail is at %(tailX)s comma %(tailY)s and the tip is at %(tipX)s comma %(tipY)s.",
},
srVectorTipPoint: {
context:
"Aria label for the tip point of a Vector (the point with the arrowhead) in the interactive graph widget.",
message: "Tip point at %(x)s comma %(y)s.",
},
srVectorGrabHandle: {
context:
"Aria label for the interactive segment that allows the user to move the whole Vector in the interactive graph widget.",
message:
"Vector from %(tailX)s comma %(tailY)s to %(tipX)s comma %(tipY)s.",
},
srQuadraticGraph: {
context:
"Aria label for the container containing a Quadratic function in the interactive graph widget.",
Expand Down Expand Up @@ -1604,6 +1650,12 @@ export const mockStrings: PerseusStrings = {
`Ray with endpoint ${point1X} comma ${point1Y} going through point ${point2X} comma ${point2Y}.`,
srRayEndpoint: ({x, y}) => `Endpoint at ${x} comma ${y}.`,
srRayTerminalPoint: ({x, y}) => `Through point at ${x} comma ${y}.`,
srVectorGraph: "A vector on a coordinate plane.",
srVectorPoints: ({tailX, tailY, tipX, tipY}) =>
`The tail is at ${tailX} comma ${tailY} and the tip is at ${tipX} comma ${tipY}.`,
srVectorTipPoint: ({x, y}) => `Tip point at ${x} comma ${y}.`,
srVectorGrabHandle: ({tailX, tailY, tipX, tipY}) =>
`Vector from ${tailX} comma ${tailY} to ${tipX} comma ${tipY}.`,
srQuadraticGraph: "A parabola on a 4-quadrant coordinate plane.",
srQuadraticFaceUp: "The parabola opens upward.",
srQuadraticFaceDown: "The parabola opens downward.",
Expand Down
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't forget to add the regression story for this, as a followup PR after all 5 PRs are landed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops thought I had one!

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
logarithmQuestion,
sinusoidQuestion,
tangentQuestion,
vectorQuestion,
segmentWithLockedEllipses,
segmentWithLockedVectors,
segmentWithLockedPolygons,
Expand Down Expand Up @@ -100,6 +101,12 @@ export const Ray: Story = {
},
};

export const Vector: Story = {
args: {
item: generateTestPerseusItem({question: vectorQuestion}),
},
};

export const Segment: Story = {
args: {
item: generateTestPerseusItem({question: segmentQuestion}),
Expand Down

This file was deleted.

This file was deleted.

Loading