From 5fdbeb980880f9239696633934c2bd95b4931db6 Mon Sep 17 00:00:00 2001 From: Ben Christel Date: Mon, 1 Jul 2024 16:07:23 -0700 Subject: [PATCH] Add `mafs.point` flag to Renderer prop types (#1386) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary: Perseus renders point graphs with fixed numbers of points using Mafs when the `mafs.point` flag is on. Previously, however, the apiOptions type (used in the Renderer props) did not allow this flag to be passed. This commit makes it so the flag can be passed without a type error. Issue: none ## Test plan: - Check out this webapp PR: https://github.com/Khan/webapp/pull/23239 - Upgrade Perseus to the dev version built by CI for this pull request. - Run the typechecker in webapp's static service. - There should be no errors. Author: benchristel Reviewers: nishasy, #perseus, mark-fitzgerald, SonicScrewdriver Required Reviewers: Approved By: nishasy Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ gerald, ❌ Upload Coverage (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald Pull Request URL: https://github.com/Khan/perseus/pull/1386 --- .changeset/curvy-singers-check.md | 5 +++++ packages/perseus/src/types.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/curvy-singers-check.md diff --git a/.changeset/curvy-singers-check.md b/.changeset/curvy-singers-check.md new file mode 100644 index 0000000000..9dc3a98b26 --- /dev/null +++ b/.changeset/curvy-singers-check.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/perseus": minor +--- + +Add `mafs.point` flag to ApiOptions type diff --git a/packages/perseus/src/types.ts b/packages/perseus/src/types.ts index a9da4fb8e0..819996494c 100644 --- a/packages/perseus/src/types.ts +++ b/packages/perseus/src/types.ts @@ -134,7 +134,7 @@ export const MafsGraphTypeFlags = [ "linear-system", /** Enables the `ray` interactive-graph type. */ "ray", - /** Enables the `polygon` interactive-graph type. */ + /** Enables the `polygon` interactive-graph type a fixed number of sides. */ "polygon", /** Enables the `circle` interactive-graph type. */ "circle", @@ -142,6 +142,8 @@ export const MafsGraphTypeFlags = [ "quadratic", /** Enables the `sinusoid` interactive-graph type. */ "sinusoid", + /** Enables the `point` interactive-graph type with a fixed number of points. */ + "point", ] as const; export const InteractiveGraphLockedFeaturesFlags = [