Refactor chart export to use SVG to canvas PNG pipeline#667
Open
bencap wants to merge 1 commit intorelease-2026.2.1from
Open
Refactor chart export to use SVG to canvas PNG pipeline#667bencap wants to merge 1 commit intorelease-2026.2.1from
bencap wants to merge 1 commit intorelease-2026.2.1from
Conversation
- Remove dom-to-image dependency; rewrite saveChartAsPng using a native SVG serialization → <img> → canvas → blob pipeline - Parse canvas dimensions from SVG width/height attrs and viewBox to fix incorrect sizing on clipped scroll-container heatmaps - Add scale guard (MAX_CANVAS_DIMENSION / MAX_CANVAS_AREA) to prevent allocation overflow on large charts - Add useChartExport composable with reactive svgInProgress / pngInProgress state and yieldToRenderer() to guarantee a painted frame before blocking export work runs - Replace single Export PButtons in ScoreSetView with SplitButtons (SVG primary action, PNG dropdown) wired to the new composable; show spinner while export is in progress - Move chart export buttons out of ScoreSetDownloads; panel now only handles file downloads; remove histogramExportFn, heatmapExportFn, heatmapExists props - Resolve CSS custom properties in histogram shader gradients via getComputedStyle so SVG <stop> colors render correctly on export
This was
linked to
issues
May 1, 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.
This pull request refactors and improves the chart export functionality for histograms and heatmaps in the score set view. It replaces the old single-action export buttons with split buttons for SVG and PNG export, adds user feedback (spinners) during export operations, and centralizes export logic with a new composable. It also removes unused dependencies from
package.json.This pipeline improvement to chart export fixes bugs related to chart coloring on exported images, SVG validity in common editing programs, and browser to browser nuances in ability to export while adding back PNG export as an option.
Chart Export Refactor and UI Improvements:
SplitButton) that allow users to export charts as either SVG or PNG, and displays a spinner during export operations for better user feedback. (src/components/screens/ScoreSetView.vue[1] [2] [3]ScoreSetHistogram.vueandScoreSetHeatmap.vueto provide both SVG and PNG export functions via a newbuildExportFnsmethod, replacing the old singleexportChartmethod. (src/components/score-set/ScoreSetHistogram.vue[1] [2] [3];src/components/score-set/ScoreSetHeatmap.vue[4] [5] [6]src/components/score-set/ScoreSetDownloads.vue[1] [2] [3];src/components/screens/ScoreSetView.vue[4] [5] [6]Centralized Export Logic:
useChartExport, which manages in-progress state and export methods, ensuring UI updates (like spinners) are visible before heavy export work starts. (src/composables/use-chart-export.tssrc/composables/use-chart-export.tsR1-R81)src/components/screens/ScoreSetView.vue[1] [2] [3]Dependency Cleanup:
dom-to-imageandnative-file-system-adapterfrompackage.json. [1] [2]