feat(v0.11.0): export charts as PNG (logging + histogram) - #131
Merged
Conversation
Contributor
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
ROADMAP Ready-to-Claim item, Tier A frontend. - New Export PNG button on the logging chart header and in the histogram modal. - Both use Chart.js toBase64Image() -> a browser-native anchor download (data: URL); no Rust round-trip, no new dependency. - Buttons enable only once a chart exists (logging PNG mirrors btn-log-export enable points; histogram PNG enables in renderHistogram, disables on modal close). - Shared downloadDataUrl(filename, dataUrl) helper. Verification: npm run build passes (bundles build clean); node --check main.js OK; node --test 56 pass. No protected-path change.
ohgeeceee
force-pushed
the
feat/v0.11.0-chart-png-export
branch
from
July 19, 2026 16:45
d0a65d5 to
0459cf7
Compare
This was referenced Jul 21, 2026
ohgeeceee
added a commit
that referenced
this pull request
Jul 21, 2026
Mirrors the v0.11.0 PNG-export slice (#131) but as a vector format that survives a 4K forum upload and re-sizes cleanly for embedded post screenshots. - New src/js/svg_export.js: pure-data serializer (no DOM, no Chart.js) with chartToSvg(chart) and histogramToSvg({labels, counts, axisLabel}). Hand-rolled rather than pulling chartjs-plugin-svg-export / canvas2svg as a runtime dependency — for a forum-paste vector the goal is faithful vector, not pixel-perfect canvas mirror. - New src/js/svg_export.test.js: 10 tests covering null/empty inputs, single + multi-series rendering, NaN/Infinity point skipping, label thinning for dense histograms, XML special-char escaping, and the requested opts (width/height/viewBox). - src/index.html: new "Export SVG" button next to each existing PNG button (logging chart header + histogram modal actions), plus a <script> tag for svg_export.js before main.js. - src/main.js: button enable/disable mirrors PNG (startLogging + restoreSession + renderHistogram enable; histogram-close disable); click handlers reuse the existing downloadDataUrl helper with a URL-encoded data: URL (human-readable file content, ~33% smaller than base64). Verification: npm run build passes (MSI + NSIS bundles clean), node --check on the two new JS files, node --test 79 pass (was 56). No protected-path change. No new dependency. Co-authored-by: Jon currie1 <ohgeeceee@users.noreply.github.com>
This was referenced Jul 21, 2026
This was referenced Jul 31, 2026
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
ROADMAP "Ready to Claim" item — export charts as PNG. Tier A frontend, no protected path, no new dependency.
toBase64Image()→ a browser-native anchor download (data:URL). No Rust round-trip, no Tauri command, no new dep.btn-log-exportenable points; the histogram PNG enables insiderenderHistogramand disables on modal close.downloadDataUrl(filename, dataUrl)helper.Verification
npm run build(canonicaltauri build) — passes, bundles build clean.node --check src/js/main.js— OK.node --test src/js/test/*.test.cjs— 56 passing.Tier
A (frontend-only). 3 files:
src/js/main.js,src/index.html,CHANGELOG.md.Files