-
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
[SR] Circle - Add the interactive elements circle description to the whole graph container #2060
base: main
Are you sure you want to change the base?
Conversation
…whole graph container
Size Change: +189 B (+0.01%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
@@ -221,3 +207,59 @@ function crossProduct<A, B>(as: A[], bs: B[]): [A, B][] { | |||
} | |||
return result; | |||
} | |||
|
|||
function CircleGraphDescription({state}: {state: CircleGraphState}) { | |||
// CircleGraphDescription needs to the `usePerseusI18n`, hook so it has] |
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.
?
// CircleGraphDescription needs to the `usePerseusI18n`, hook so it has] | |
// CircleGraphDescription needs the `usePerseusI18n` hook so it has |
@@ -221,3 +207,59 @@ function crossProduct<A, B>(as: A[], bs: B[]): [A, B][] { | |||
} | |||
return result; | |||
} | |||
|
|||
function CircleGraphDescription({state}: {state: CircleGraphState}) { |
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 the same as state: CircleGraphState
? Or is there an additional benefit to the destructing in this case?
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 think that works too. I think the reason it was done this way (I was following what Ben did for the point description) is so it follows the prop structure the way they're standardly written for other functional components.
// Exported for testing | ||
export function describeCircleGraph( | ||
state: CircleGraphState, | ||
i18n: {strings: PerseusStrings; locale: string}, |
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.
theres a I18nContextType
that might be worth exporting to use here and around in the other graphs as needed. Alternatively, we could create a type in a utility file and destructure
{strings: PerseusStrings; locale: string}: I18ContextType
then remove line 225
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (1c1c88e) and published it to npm. You Example: yarn add @khanacademy/perseus@PR2060 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR2060 |
Summary:
Add the interactive Circle graph description to the full graph container.
This adds the "Interactive elements: Circle..." description to the outermost graph container.
Issue: https://khanacademy.atlassian.net/browse/LEMS-1706
Test plan: