Mafs

Mafs

React components for interactive math
GitHub
3.1k
Created 3 years ago, last commit 2 months ago
5 contributors
225 commits
Stars added on GitHub, month by month
12
1
2
3
4
5
6
7
8
9
10
11
2022
2023
Stars added on GitHub, per day, on average
Yesterday
=
Last week
+0.3 /day
Last month
+0.2 /day
Last 12 months
+7.6 /day
Package on NPM
mafs
0.17.1
Monthly downloads on NPM
12
1
2
3
4
5
6
7
8
9
10
11
2022
2023
README

Mafs

Mafs is a set of opinionated React components for creating math visualizations.

Visit the docs →


Development

Development is done inside of the Next.js documentation site, which directly imports Mafs components from src/. To start the development server, run:

pnpm install
pnpm start

Then visit localhost:3000.

Tests

Mafs uses unit, end-to-end, and visual regression testing to ensure consistency between updates. It takes literal screenshots of components as rendered by the browser, and compares them to a known "correct" screenshot. Two of the browsers may require a Mac to run (Safari and iOS Safari).

All examples on the documentation site are visually tested automatically—the test file is autogenerated.

pnpm test      # run both suites
pnpm test:unit # to run just the Jest tests
pnpm test:e2e  # to run Playwright (end-to-end and visual tests)
pnpm test -- --update-snapshots # to update the visual test baselines