Skip to content

Add 3D/embed/perf features#18

Open
CSSFrancis wants to merge 2 commits into
mainfrom
feat/3d-gpu-embed-perf
Open

Add 3D/embed/perf features#18
CSSFrancis wants to merge 2 commits into
mainfrom
feat/3d-gpu-embed-perf

Conversation

@CSSFrancis

Copy link
Copy Markdown
Owner

Major additions across rendering, embedding, and performance:

Rendering & plot types

  • True-colour RGB imshow ((H,W,3|4) arrays)
  • 3D voxels geometry + draggable PlaneWidget slice selectors
  • scatter3d per-point colours, set_highlight, reference sphere, bounds
  • Turntable 3D camera (matplotlib azim/elev; reaches any viewpoint)
  • Mini-TeX label formatting (superscripts/Greek/symbols) + fontsize control
  • IPF and voxel-grain explorer examples; label-formatting example

Embedding (no Jupyter required)

  • anyplotlib.embed: figure_state/to_html/save_html/esm_path + FigureBridge
  • figure_esm.js mount() API for Electron / plain web pages
  • docs/embedding.rst guide

WebGPU (progressive enhancement, canvas fallback)

  • Instanced points + voxels on the GPU via gpu="auto"; airtight Canvas2D fallback (no navigator.gpu / null adapter / device loss). No JS deps.
  • Hardware-verified on NVIDIA Pascal; WEBGPU_PLAN.md tracks phases.

Performance (smoothness under Pyodide)

  • Figure.batch() coalesces panel pushes (one per panel per frame)
  • Geometry channel: heavy buffers ride a separate hash-gated trait, re-sent only on change — view updates (highlight/camera/planes) no longer retransmit geometry. Voxel explorer per-frame traffic -65%.
  • Voxel sprite cache + typed-array projection; RGB imshow skips LUT rebuild

Packaging

  • LICENSE (MIT), wheel excludes tests/baselines, py3.13 classifier
  • RELEASE_PLAN.md; committed uv.lock

Tests: +~90 across labels, embed, RGB, voxels/planes, GPU fallback, batch, geometry channel. Full suite 1323 passed / 58 skipped.

Major additions across rendering, embedding, and performance:

Rendering & plot types
- True-colour RGB imshow ((H,W,3|4) arrays)
- 3D voxels geometry + draggable PlaneWidget slice selectors
- scatter3d per-point colours, set_highlight, reference sphere, bounds
- Turntable 3D camera (matplotlib azim/elev; reaches any viewpoint)
- Mini-TeX label formatting (superscripts/Greek/symbols) + fontsize control
- IPF and voxel-grain explorer examples; label-formatting example

Embedding (no Jupyter required)
- anyplotlib.embed: figure_state/to_html/save_html/esm_path + FigureBridge
- figure_esm.js mount() API for Electron / plain web pages
- docs/embedding.rst guide

WebGPU (progressive enhancement, canvas fallback)
- Instanced points + voxels on the GPU via gpu="auto"; airtight Canvas2D
  fallback (no navigator.gpu / null adapter / device loss). No JS deps.
- Hardware-verified on NVIDIA Pascal; WEBGPU_PLAN.md tracks phases.

Performance (smoothness under Pyodide)
- Figure.batch() coalesces panel pushes (one per panel per frame)
- Geometry channel: heavy buffers ride a separate hash-gated trait, re-sent
  only on change — view updates (highlight/camera/planes) no longer
  retransmit geometry. Voxel explorer per-frame traffic -65%.
- Voxel sprite cache + typed-array projection; RGB imshow skips LUT rebuild

Packaging
- LICENSE (MIT), wheel excludes tests/baselines, py3.13 classifier
- RELEASE_PLAN.md; committed uv.lock

Tests: +~90 across labels, embed, RGB, voxels/planes, GPU fallback,
batch, geometry channel. Full suite 1323 passed / 58 skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.63%. Comparing base (8a9d6fd) to head (d9c8ef5).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
anyplotlib/embed.py 93.61% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
- Coverage   90.84%   90.63%   -0.21%     
==========================================
  Files          31       33       +2     
  Lines        2501     2744     +243     
==========================================
+ Hits         2272     2487     +215     
- Misses        229      257      +28     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The default 11px bold 2D title was drawn strip-tight (12px strip, centered),
leaving ~0px top margin.  macOS Chromium hints fonts ~1px taller than the
Windows dev box, so on macOS CI the title ascender reached row 0 of the
title canvas and test_no_clipping flagged it as clipped.

Clamp the drawn title size to padT-4 (reserve ~4px total vertical margin).
Since _padT grows for large/TeX titles, this only affects the 12px default
strip, capping an 11px title to ~8px — a sub-pixel change well within the
visual-regression tolerance (all 24 baselines still match).  Now ~2px top
and bottom margin on the dev box, which absorbs the cross-platform hinting
variance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants