Skip to content

Add action buttons for data export and chart visualization#947

Merged
hustcc merged 2 commits intoaifrom
copilot/enhance-chart-iframe-ui
Feb 5, 2026
Merged

Add action buttons for data export and chart visualization#947
hustcc merged 2 commits intoaifrom
copilot/enhance-chart-iframe-ui

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

Implements download/copy actions for data preview and chart visualization sections as requested in issue #941.

Changes

DataPreview Component

  • Removed filter button, retained only download action
  • Implemented RFC 4180 compliant CSV export with proper escaping for commas, quotes, and newlines
  • Downloads as timestamped file: data_{timestamp}.csv

Visualization Component

  • Added hover overlay on chart iframe with Copy and Download buttons
  • Copy: Copies chart HTML to clipboard via navigator.clipboard.writeText with 2s success feedback
  • Download: Downloads chart HTML as chart_{timestamp}.html
  • Styled with glassmorphism effect (backdrop blur, semi-transparent white background, shadow)

Implementation Notes

Helper functions handle:

  • CSV generation with value escaping
  • Blob creation and URL lifecycle management
  • Clipboard API with fallback error handling

Screenshots

Data Preview with Download Button:
Data Preview

Chart Hover State with Action Buttons:
Chart Actions

Copy Success Feedback:
Copy Success

Original prompt

This PR addresses issue #941. The goal is to enhance the user interface by implementing the following:

  1. Adjust the chart "iframe" in the visualization section to display two action buttons in the top-right corner on hover:
    • Download: When clicked, the chart should be downloadable as an image.
    • Copy: Adds the ability to copy the chart information to the clipboard.
  2. Include user-facing visuals hint & customizations

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance chart iframe UI with download and copy buttons Add action buttons for data export and chart visualization Feb 4, 2026
Copilot AI requested a review from hustcc February 4, 2026 17:01
@hustcc hustcc marked this pull request as ready for review February 4, 2026 17:05
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🎊 PR Preview 3e5c47e has been successfully built and deployed to https://antvis-AVA-preview-pr-947.surge.sh

🕐 Build time: 0.011s

🤖 By surge-preview

@hustcc hustcc merged commit 836846a into ai Feb 5, 2026
3 checks passed
@hustcc hustcc deleted the copilot/enhance-chart-iframe-ui branch February 5, 2026 01:23
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.

2 participants