Skip to content

[ColorSync][Plotter] Add Plotter visual regression stories#3849

Open
nishasy wants to merge 4 commits into
mainfrom
plotter-regressions
Open

[ColorSync][Plotter] Add Plotter visual regression stories#3849
nishasy wants to merge 4 commits into
mainfrom
plotter-regressions

Conversation

@nishasy

@nishasy nishasy commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary:

There are no visual regression stories for Plotter yet. Adding them here. Also adding a generator function for Plotter to use within the renderer decorator.

Initial State stories:

  • Bar chart
  • Bar chart mobile
  • Dot plot
  • Dot plot mobile
  • Line plot
  • Line plot mobile
  • Histogram
  • Histogram mobile
  • Pictograph (with sample Earth image)
  • Pictograph (with sample Earth image) mobile

Interactions:

  • none recommended

Issue: https://khanacademy.atlassian.net/browse/LEMS-4296

Test plan:

Storybook

  • /?path=/story/widgets-plotter-visual-regression-tests-initial-state--bar-chart

nishasy added 2 commits June 29, 2026 16:34
…ion stories

There are no visual regression stories for Plotter yet. Adding them here.

Initial State stories:
- Bar chart
- Bar chart mobile
- Dot plot
- Line plot
- Line plot mobile
- Histogram
- Pictograph (with sample Earth image)

Interactions:
- none recommended

Issue: https://khanacademy.atlassian.net/browse/LEMS-4296

Test plan:
Storybook
- `/?path=/story/widgets-plotter-visual-regression-tests-initial-state--bar-chart`
@nishasy nishasy self-assigned this Jun 29, 2026
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (14317f5) and published it to npm. You
can install it using the tag PR3849.

Example:

pnpm add @khanacademy/perseus@PR3849

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3849

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3849

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Size Change: +46 B (+0.01%)

Total Size: 517 kB

📦 View Changed
Filename Size Change
packages/perseus-core/dist/es/index.js 27.7 kB +46 B (+0.17%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.6 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 6.31 kB
packages/math-input/dist/es/index.js 98.5 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 12.9 kB
packages/perseus-editor/dist/es/index.js 104 kB
packages/perseus-linter/dist/es/index.js 9.79 kB
packages/perseus-score/dist/es/index.js 9.86 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 204 kB
packages/perseus/dist/es/strings.js 12.4 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@nishasy nishasy marked this pull request as ready for review June 29, 2026 23:49
// Raphael). Wait until at least one is present in the DOM.
await waitFor(() => {
if (canvasElement.querySelectorAll("image").length === 0) {
throw new Error("Pictograph images have not rendered yet");

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.

Would this fail if there is legitimately no images to render? Not sure if the images exist as a preload before you could drag columns up and down but if the default values happened to [0,0,0,0] would that fail?

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.

It would look normal in manual storybook, but the Chromatic snapshot would show it as blank, since it would take the screenshot before the image has time to load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants