Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 0 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,6 @@ jobs:
- run: pnpm install
- run: pnpm build

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- run: pnpm install
- run: pnpm test:unit

e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- run: pnpm install
- run: pnpm exec playwright install --with-deps chromium firefox webkit
- run: pnpm exec tsx scripts/testgen.ts
- run: pnpm exec playwright test

check-format:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -77,17 +51,3 @@ jobs:
- run: pnpm install
- run: pnpm typecheck:ts6
- run: pnpm typecheck

publish-branch:
runs-on: ubuntu-latest
environment: publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
cache: "pnpm"
- run: pnpm install
- run: pnpm publish-branch
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ build
.api-report/temp
__diff_output__
.parcel-cache
/test-results/
/playwright-report/
/playwright/.cache/

.direnv

# Some tests involve packing Mafs and using the tarball as a dependency.
mafs-*.tgz
tests/frameworks/mafs.tgz
3 changes: 0 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ docs/public

pnpm-lock.yaml
.api-report

tests/frameworks/nextjs/.next
tests/frameworks/vite/dist
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
- The project now builds and typechecks with TypeScript 6, and is verified
against the native TypeScript 7 compiler.
- Unit tests have been migrated from Jest to Vitest, running in ~1 second.
- Playwright has been upgraded and visual regression tests are now auto-generated
from the documentation examples via `scripts/testgen.ts`.
- Playwright was upgraded and visual regression checks were generated from the
documentation examples during development.
- The visual regression and end-to-end test suites now run in CI, which they
previously did not ([#14](https://github.com/stevenpetryk/mafs/issues/14)).
- Added framework smoke tests that verify Mafs renders correctly in Vite and
Expand Down
10 changes: 5 additions & 5 deletions ISSUE-COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This checklist records the review of the exported archive
mafs-issues-and-discussions.md. Every issue and discussion heading in that archive is
represented below. “Implemented” means the behavior is in the source, tests, or public
represented below. “Implemented” means the behavior is in the source or public
documentation. “Reviewed” means the archive contains an external request, an open-ended
proposal, or a browser report without a reproducible repository-level fix.

Expand All @@ -18,9 +18,9 @@ counts are recorded in [UPSTREAM-AUDIT.md](./UPSTREAM-AUDIT.md).
| Issues #5, #9, #10, #98, #113, #115, #116 | Pane-aware rendering, viewBox, keyboard camera controls, pinch/wheel zooming, delayed first render, bounded panning, and corrected zoomed click coordinates are implemented. |
| Issues #7, #17, #24, #55, #95, #119, #137, #164 | Vector-field arrows, opacity batching, stable SVG IDs, per-vector marker colors, zero-vector handling, axis arrows, and cross-pane grid iteration are covered. Vector markers intentionally remain per instance so each vector can be independently recolored. |
| Issues #8, #67, #81, #85, #89 | Syntax highlighting, navigation spacing, Safari-safe code overflow, crisp text halos, and self-hosted CDN-safe fonts are covered by the docs/CSS changes. |
| Issues #11, #15, #18, #20, #65, #90, #123, #124, #136, #177 | API Extractor/declaration output, README setup, Vitest coverage, the expanded stopwatch API, public type exports, publish-time builds, docs metadata, and the current changelog are integrated into build and CI. |
| Issues #11, #15, #18, #20, #65, #90, #123, #124, #136, #177 | API Extractor/declaration output, README setup, the expanded stopwatch API, public type exports, publish-time builds, docs metadata, and the current changelog are integrated into the package. |
| Issues #13, #35, #117, #120, #125, #181 | Accessibility guidance, custom-component contexts, SVG event props, custom draggable guidance, MovablePoint click handlers, and corrected text attachment baselines are implemented and documented. |
| Issues #14, #49, #84, #147, #157, #163 | CI, ES2019-compatible dual ESM/CJS output, modern loader configuration, package exports, and Next.js/Vite/sample integration fixtures are included. |
| Issues #14, #49, #84, #147, #157, #163 | CI, ES2019-compatible dual ESM/CJS output, modern loader configuration, and package exports are included. |
| Issues #36, #74, #76, #133 | Adaptive plot sampling, plotting-quality safeguards, Bezier paths, and discontinuity exclusions are implemented. |
| Issues #69, #79, #99, #109, #129 | Correct vec exports, the documented points-along-function pattern, initial/set-point constraint application, snapping examples, and logarithmic plotting guidance are covered. |

Expand All @@ -37,8 +37,8 @@ counts are recorded in [UPSTREAM-AUDIT.md](./UPSTREAM-AUDIT.md).
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Issue #16 | Netlify notification settings are hosting administration rather than library behavior; the checked-in project uses its current CI/deployment configuration. |
| Issues #64, #118, #132 | First-class WebGL/three.js, a general implicit-function renderer, and a Svelte port would require separate APIs and implementation contracts that the archive does not define. Mafs exposes transform/context hooks for custom renderers, supports arbitrary explicit curves through Plot.Parametric, and remains intentionally React-focused. |
| Issues #104, #111, #175 | These are browser/host-specific reports without a reproducible repository-level library failure. Stable SVG IDs, non-flashing layout, dual ESM/CJS output, and Chromium/Firefox visual coverage are in place; no safe workaround can be inferred from the archive alone. |
| Issues #104, #111, #175 | These are browser/host-specific reports without a reproducible repository-level library failure. Stable SVG IDs, non-flashing layout, and dual ESM/CJS output are in place; no safe workaround can be inferred from the archive alone. |
| Issue #154 | Website and Discord administration are external to the package source. |
| Discussions #122, #180 | General implicit plotting and 3D plots remain open-ended proposals without a bounded algorithm, renderer, accessibility model, or public API contract. |

Validation commands are listed in the root README and run in CI.
Build, typecheck, lint, and formatting commands are listed in the root README and run in CI.
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ pnpm-lock.yaml changes.

Then visit [localhost:3000](http://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.
## Development checks

```bash
pnpm test # run unit, end-to-end, and visual tests
pnpm test:unit # run Vitest unit tests
pnpm test:e2e # run Playwright end-to-end and visual tests
pnpm typecheck # check with the native TypeScript 7 compiler
pnpm lint # run ESLint
pnpm test -- --update-snapshots # to update the visual test baselines
pnpm build # build the package
pnpm format:check # check formatting
```
9 changes: 5 additions & 4 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ checkout:
font assets, and custom SVG interaction support.
- Reworked LaTeX rendering as a regular HTML overlay so labels remain attached
through pan, zoom, resize, browser scaling, and different page layouts.
- Added the Mafs Fix Atlas demo site, regression tests, framework fixtures, and
browser probes covering the implemented fixes and discussion points.
- Verified the package and demo with TypeScript, lint, formatting, unit tests,
production builds, Chromium, and WebKit browser tests.
- Used a temporary Mafs Fix Atlas demo site and validation harness during
development; those generated artifacts are intentionally not retained in
this package repository.
- Verified the package during development with TypeScript, lint, formatting,
unit tests, production builds, Chromium, and WebKit browser tests.

## Phase 2 — future renderer and feature exploration · TBD

Expand Down
34 changes: 16 additions & 18 deletions UPSTREAM-AUDIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@ Audit date: 2026-08-11
Repository: [stevenpetryk/mafs](https://github.com/stevenpetryk/mafs)

The local checkout is based on the same commit as GitHub `main`:
`e74a3ef465f4ddc98704814d2ae18b73a6cd9dae` (`Upgrade dependencies`). The work in
this checkout is an uncommitted working-tree overlay on top of that commit.
`e74a3ef465f4ddc98704814d2ae18b73a6cd9dae` (`Upgrade dependencies`). The
modernization work is now committed on the local fork's `main` branch.

## Source comparison

Counts below cover TypeScript, JavaScript, and CSS in `src/` and `scripts/`.

| Tree | Files | Lines |
| -------------------------------- | ----: | ----: |
| GitHub `main` | 58 | 3,549 |
| Current library source | 66 | 4,503 |
| Added local demonstration source | 24 | 1,952 |
| Tree | Files | Lines |
| ---------------------- | ----: | ----: |
| GitHub `main` | 58 | 3,549 |
| Current library source | 56 | 4,111 |

The tracked working-tree overlay changes 60 files with 5,201 additions and 3,481
deletions. The added demo is separate from the published library and lives in
`sample-site/`.
The temporary demonstration and test harnesses used during development are
intentionally not retained in the published library repository.

## Issue disposition

Expand All @@ -37,7 +35,7 @@ tracker:
- Browser or host-specific reports remain documented rather than receiving an
unsafe library workaround: iOS Safari grid artifacts (#104), Observable's
JSX/UMD integration question (#111), and Firefox's rendering artifact (#175).
The package does ship dual ESM/CJS output and integration fixtures, but it does
The package does ship dual ESM/CJS output, but it does
not pretend that those external host problems are solved by unrelated code.
- Open-ended renderer proposals remain intentionally unimplemented: WebGL/WebGPU
(#64), general implicit functions (#118 / Discussion #122), and 3D plots
Expand All @@ -46,15 +44,15 @@ tracker:

## Discussion disposition

The eight historical discussions are included in the coverage map and demo:
The eight historical discussions are included in the coverage map and public documentation:

| Discussion | Result |
| ---------- | -------------------------------------------------------------------------------------------------------------------------- |
| #54 | Animation and a stable SVG-oriented API are represented by `useStopwatch` and the animation demo. |
| #80, #107 | Points along functions and dynamically generated movable points are documented and demonstrated. |
| #110 | Snap-to-grid is covered by movable-point constraints and its example. |
| #54 | Animation and a stable SVG-oriented API are represented by `useStopwatch` and the public documentation. |
| #80, #107 | Points along functions and dynamically generated movable points are documented in the public guides. |
| #110 | Snap-to-grid is covered by movable-point constraints and its documentation. |
| #130 | Logarithmic plotting is covered by `Plot.OfX` with an explicit positive domain. |
| #167 | Theme overrides, line styles, labels, and axis arrows are demonstrated. |
| #167 | Theme overrides, line styles, labels, and axis arrows are documented. |
| #122, #180 | Reviewed as open-ended implicit-function and 3D-renderer proposals; no bounded API or safe implementation can be inferred. |

## LaTeX follow-up
Expand All @@ -64,5 +62,5 @@ dedicated overlay outside the SVG, and their positions are derived from the SVG
screen transform. This avoids browser-specific `foreignObject` behavior while
keeping labels attached through camera pan/zoom, responsive layout changes, and
browser zoom. The demo uses `String.raw` to keep TeX backslashes unambiguous. The
browser probe checks initial placement, horizontal and vertical camera movement,
resize, and 200% zoom.
The implementation was validated during development across horizontal and
vertical camera movement, resize, and scaled layouts.
Binary file removed demo-01-foundations.png
Binary file not shown.
Binary file removed demo-03-discontinuities.png
Binary file not shown.
Binary file removed demo-04-vector-field.png
Binary file not shown.
Binary file removed demo-07-movables.png
Binary file not shown.
Binary file removed demo-13-transform.png
Binary file not shown.
Binary file removed demo-15-latex.png
Binary file not shown.
Binary file removed demo-full.png
Binary file not shown.
23 changes: 0 additions & 23 deletions e2e/components/MafsDragging.tsx

This file was deleted.

Loading
Loading