Skip to content

chart watermark + one-click PNG copy/download button - #1434

Merged
Flotapponnier merged 1 commit into
devfrom
feat/chart-watermark-and-copy
Jul 25, 2026
Merged

chart watermark + one-click PNG copy/download button#1434
Flotapponnier merged 1 commit into
devfrom
feat/chart-watermark-and-copy

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

DefiLlama-style attribution + easy sharing on every chart.

Watermark

Subtle "openchainbench.com" bottom-right of the chart (opacity 0.28 → visible but never competes with data). Renders inside SVG for time-series (<text> element) and as absolute-positioned HTML for the ranked bar chart. Survives Twitter/Slack recompression and can't be cropped out because it sits inside the chart bounds.

Copy/download

Split button in the chart header (icon-only on mobile, "Copy" + download icon on desktop). Click = PNG-to-clipboard via navigator.clipboard.write(ClipboardItem). Second half = PNG download. Retina 2x pixel ratio for legible zoomed screenshots. Fallbacks: Firefox / insecure contexts / older Safari → download flow, no error surfaced.

Impl notes

  • New shared components: chart-watermark.tsx (SVG + HTML variants) and chart-export-button.tsx
  • Dependency added: html-to-image@1.11.13 (12KB, handles SVG + HTML in one pass)
  • Filename pattern: openchainbench-<slug>-<range>.png for time-series, openchainbench-<slug>-ranking.png for ranked bar
  • Solid --color-paper background forced during capture so light-mode chat pastes don't get transparency artifacts

Test plan

  • Any bench page: click "Copy" → paste in Slack/Notes → sees PNG with watermark
  • Click download icon → gets openchainbench-<slug>-<range>.png
  • Watermark visible on-screen but subtle (opacity 0.28)
  • Works on Chrome (native clipboard) and Firefox (falls back to download)

@Flotapponnier
Flotapponnier merged commit b3a170a into dev Jul 25, 2026
1 check failed
@Flotapponnier
Flotapponnier deleted the feat/chart-watermark-and-copy branch July 25, 2026 19:51
Flotapponnier added a commit that referenced this pull request Jul 25, 2026
…rom dev (#1436)

* feat: chart watermark + copy/download button (openchainbench.com attribution + PNG export) (#1434)

Co-authored-by: Florent Tapponnier <contact@mobula.io>

* fix pnpm-lock: sync html-to-image entries so CI frozen-lockfile install passes (#1435)

Co-authored-by: Florent Tapponnier <contact@mobula.io>

---------

Co-authored-by: Florent Tapponnier <contact@mobula.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant