Coil schematic display + schematic playground#6
Merged
Conversation
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>
9457685 to
6bd9799
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Frontend coil-schematic rendering: shows the schematic above Winding Construction Steps, adds
/schematic_playground, plus theming and dev wiring.Screenshots — new
/schematic_playgroundPick a mock coil → Generate TikZ → Render compiles it to an inline SVG (via the backend
/process_latex_svg).Commits
/schematic_playgroundto render coil schematicsNotes
pr-assetsbranch (out of the PR diff).🤖 Generated with Claude Code