Skip to content

Coil schematic display + schematic playground#6

Merged
gpitel merged 11 commits into
mainfrom
feature/coil-schematic-tikz
Jun 24, 2026
Merged

Coil schematic display + schematic playground#6
gpitel merged 11 commits into
mainfrom
feature/coil-schematic-tikz

Conversation

@gpitel

@gpitel gpitel commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Frontend coil-schematic rendering: shows the schematic above Winding Construction Steps, adds /schematic_playground, plus theming and dev wiring.

Screenshots — new /schematic_playground

Pick a mock coil → Generate TikZRender compiles it to an inline SVG (via the backend /process_latex_svg).

Before (click Render) After (rendered)

Commits

  • Render schematic as inline SVG (white-on-dark) above Winding Construction Steps
  • Add /schematic_playground to render coil schematics
  • Style schematic playground to the OM theme; label isolation rows "Winding N"
  • Self-host Font Awesome instead of the account-locked kit
  • Dev-only: point frontend/playground at the local fork backend (:8001)

Notes

  • Several commits are dev-environment config (pointing at :8001). Squash/drop those if this ever targets upstream.
  • Screenshots are hosted on the pr-assets branch (out of the PR diff).

🤖 Generated with Claude Code

grantpitel and others added 9 commits June 19, 2026 14:11
New dev view: pick or paste a MAS coil, generate its electrical schematic as
TikZ via the shared coilToTikz util, and render it to PDF through the existing
/process_latex endpoint (graceful fallback to the TikZ source if unreachable).
Registers the route and exempts it from the WASM engine-loader guard, since the
playground needs no engine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Local dev has no /process_latex backend (the cloud API serves it in production),
so rendering 404'd. When VITE_API_ENDPOINT is unset, default the endpoint to the
standalone local render server (magneticdesigner scripts/latex_render_server.py on
:8765); production still uses VITE_API_ENDPOINT/process_latex. Endpoint stays editable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the external render-server fallback; default the dev endpoint to the OM
backend (docker compose up backend -> :8000), which exposes the same
/process_latex. Production still uses VITE_API_ENDPOINT; the field stays editable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The canonical :8000 is occupied by the prebuilt reference container in this dev
setup, so the OM WebBackend (with /process_latex) runs on :8001. Point the dev
default there so rendering works without editing the field.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use the OpenMagnetics palette (teal #539796 primary, #1a1a1a background,
#2a2a2a panels, #d4d4d4 text, #ff8800 error) -- dark teal-bordered panels,
teal pill chips, outlined/filled teal buttons. Hard-coded hex rather than the
--bs-* vars: those are only populated after the engine-loader init, which this
route deliberately skips, so the vars resolve empty here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Playground POSTs /process_latex_svg and shows the returned SVG inline (v-html)
with a CSS invert, so it reads as white lines on the dark theme -- matching how
OM displays its plot SVGs. Replaces the PDF iframe; scales to fill the pane.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In the Magnetic Summary, render the current design's coil to an inline SVG
(coilToTikz -> /process_latex_svg, white-on-dark via CSS invert) and place it as
a "Schematic" section just above the Winding Construction Steps. Renders only when
the coil has a functional description and the SVG backend is reachable; otherwise
it's silently omitted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The hardcoded kit (kit.fontawesome.com/d5a40d6941.js) is domain-locked to the
upstream account, so it returns 403 on any fork origin and no icons render.
Add @fortawesome/fontawesome-free, import its CSS in main.js, and drop the kit
<script> injection in Header.vue. Icons now load locally (no external/account
dependency, works offline).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add .env.development with VITE_API_ENDPOINT=http://localhost:8001 so the dev
frontend's backend calls (insert_intermediate_mas, core-material reads, latex
render, etc.) hit the local compose backend instead of resolving to
"undefined/..." and 404ing. Production uses its own VITE_API_ENDPOINT.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gpitel gpitel force-pushed the feature/coil-schematic-tikz branch from 9457685 to 6bd9799 Compare June 24, 2026 22:48
grantpitel and others added 2 commits June 24, 2026 18:49
d5f558a reindented the whole file while adding the schematic block. This
restores main's formatting so the net change is only the +24 real lines
(functionally identical; whitespace-ignored diff is empty).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The playground renders purely via the backend, so it belongs in the
existing nonDataViews list (like home / insulation_adviser) rather than
being hardcoded into the engine-loader guard. Reverts the guard line to
its original form; keeps the playground loadable without the WASM engine.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gpitel gpitel merged commit 6a5f5cc into main Jun 24, 2026
0 of 2 checks passed
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.

1 participant