Skip to content

fix: include legend and overlay in correlation PNG export#314

Merged
itsDNNS merged 1 commit intomainfrom
fix/correlation-png-legend
Apr 3, 2026
Merged

fix: include legend and overlay in correlation PNG export#314
itsDNNS merged 1 commit intomainfrom
fix/correlation-png-legend

Conversation

@itsDNNS
Copy link
Copy Markdown
Owner

@itsDNNS itsDNNS commented Apr 3, 2026

Summary

  • PNG export now includes chart legend labels and overlay canvas (crosshairs/pins)
  • Builds an off-screen composite canvas that layers chart + overlay + legend text
  • Legend items read from visible DOM state, respecting toggle/filter selections
  • Handles event labels with nested elements (badge/gear icon) by extracting text nodes only
  • Scales font and gap down when legend overflows the chart width

Test plan

  • Navigate to /#correlation with data loaded
  • Toggle some legend items off, export PNG - verify only visible items appear
  • Check export with events enabled - verify no gear icon or filter badge in label
  • Compare export at different browser zoom levels (DPR handling)
  • Export with all metrics enabled - verify legend fits without clipping

Closes #313

The PNG export only captured the chart canvas, missing the legend
(rendered as HTML) and overlay (crosshairs/pins). Build an off-screen
composite canvas that layers chart + overlay + programmatic legend text
read from the visible DOM items.

Handles edge cases: event labels with nested badge/gear elements
(extracts text nodes only), legend overflow (scales font/gap down),
and DPR-aware compositing.

Closes #313
@itsDNNS itsDNNS merged commit 899296f into main Apr 3, 2026
7 checks passed
@itsDNNS itsDNNS deleted the fix/correlation-png-legend branch April 3, 2026 14:25
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.

Small. Cross-Source Correlation. PNG export missing labels

1 participant