Skip to content

fix(erd): cap PNG export size, make SVG export look like the screen #1153

Description

@ZhuchkaTriplesix

Problem

  • PNG export has no size cap (erd_view.dart:152): the whole canvas is rendered at pixelRatio: 2. A schema of 150–200 tables gives a canvas of several thousand px per side, i.e. an image over 10 000 px per side; this can exhaust memory or exceed the GPU texture limit.
  • SVG does not look like the screen (erd_export.dart): positions and routes match, but there are no crow's foot / bar end markers, no rounded corners, PK / FK are [PK] text instead of icons, the header has no tint, and long types run past the card edge (no clipping).

Scope

  • PNG: pick pixelRatio so that the longest side is at most 8192 px (fall back to 1 or below); if even that is too big, say so and offer SVG.
  • SVG: the same markers (crow's foot at the FK end, bar at the referenced end), rounded corners (same roundedPath geometry), header tint, PK / FK glyphs, types clipped to the card (clipPath or truncation with …).
  • The relation <title> stays.

Acceptance

  • Unit test: the PNG ratio for a 20 000 × 9 000 canvas keeps the longest side ≤ 8192.
  • Golden-style test on the SVG string: markers present for every relation, no text wider than its card.

Activity

  1. added
    bugSomething isn't working
    frontendTheme parser epic label: frontend
    uiUser interface components and widgets
    P2Medium priority / Parity & Refactoring
    on Oct 8, 2026
  2. added 4 commits that reference this issue on Oct 9, 2026
  3. ZhuchkaTriplesix commented on Oct 9, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Closed by #1247.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority / Parity & RefactoringbugSomething isn't workingfrontendTheme parser epic label: frontenduiUser interface components and widgets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions