User feedback: SVG export preserves view state and Inkscape-compatible structure#17
Open
happykhan wants to merge 2 commits into
Open
User feedback: SVG export preserves view state and Inkscape-compatible structure#17happykhan wants to merge 2 commits into
happykhan wants to merge 2 commits into
Conversation
) The SVG export previously created a fresh renderer with no access to the user's current zoom level, pan offset, or dragged legend positions. This meant the exported image always showed the default 100% view regardless of what the user was looking at in the canvas preview. - Add PlotViewState interface and onViewStateChange callback to CircularPlot - Expose getLegendPositions() on CanvasPlotRenderer - Thread view state from CircularPlot -> Home -> ExportPanel -> SVG renderer - Both SVG and PNG exports now reproduce the exact canvas view Closes #14 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…re (#15) The SVG renderer now produces Inkscape-compatible output: - Add xmlns:inkscape namespace to the root <svg> element - Add id and inkscape:label attributes to all <g> elements so each ring, legend, and scale marker appears as a named layer/group in Inkscape - Hoist gradient <defs> from legend groups to the top-level <svg> element so gradient references resolve correctly when groups are moved - Add transparent background rects to GC and ring legend groups so they are selectable as a single unit in Inkscape - Accept SVGViewState in render() to apply zoom/pan transforms and user-dragged legend positions to the exported SVG Closes #15 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deploying brigx with
|
| Latest commit: |
05e141c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e999b5a2.brigx.pages.dev |
| Branch Preview URL: | https://fix-svg-export.brigx.pages.dev |
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
Fixes two user-reported issues with SVG/PNG export from BRIG plots.
Details
Issue #14: The
ExportPanelpreviously created a freshCircularPlotRendererwith no access to the zoom/pan/legend-drag state held inCircularPlot. NowCircularPlotexposes aPlotViewStatevia callback,Homethreads it toExportPanel, and the SVG renderer'srender()method accepts an optionalSVGViewStateto apply the same transforms.Issue #15: SVG groups now have meaningful
idandinkscape:labelattributes (e.g. "GC Content", "Ring: query_name", "Scale Markers"). Gradient<defs>are hoisted from legend groups to a top-level<defs id="defs">element so they resolve correctly when groups are moved. Legend groups have a transparent background rect so they can be selected as a unit.Test plan
npm run buildpasses (TypeScript + Vite)npm testpasses (132/132 unit tests)🤖 Generated with Claude Code