Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: propagate item pointermove and click events #1511

Merged
merged 6 commits into from
Jan 31, 2025

Conversation

silvester-pari
Copy link
Collaborator

@silvester-pari silvester-pari commented Jan 31, 2025

Implemented changes

This PR listens for the item pointermove and item click events inside of the Vega chart and propagates them as pointermove.item and click.item events. They do not trigger on anything else on the chart (axis, title etc.) - one can use the native pointermove or click event for that.

It can be tested in the storybook by observing the console. In the bar chart example, it correctly logs the hovered and clicked bar, and if hovered/clicked above, it logs the clicked GroupItem.

Screenshots/Videos

image
image

Checklist before requesting a review

@silvester-pari silvester-pari linked an issue Jan 31, 2025 that may be closed by this pull request
Copy link

netlify bot commented Jan 31, 2025

Deploy Preview for eoxelements ready!

Name Link
🔨 Latest commit 2f2a01f
🔍 Latest deploy log https://app.netlify.com/sites/eoxelements/deploys/679c8a39bed1e50008a9ec4f
😎 Deploy Preview https://deploy-preview-1511--eoxelements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@silvester-pari silvester-pari marked this pull request as ready for review January 31, 2025 07:38
@silvester-pari silvester-pari changed the title feat: propagate item click event feat: propagate item pointermove and click events Jan 31, 2025
@silvester-pari silvester-pari changed the title feat: propagate item pointermove and click events feat: propagate item pointermove and click events Jan 31, 2025
Copy link
Member

@StefanBrand StefanBrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general looks good. I've added some comments around naming of the events and testing.

elements/chart/test/general.cy.js Outdated Show resolved Hide resolved
elements/chart/src/main.js Outdated Show resolved Hide resolved
elements/chart/test/general.cy.js Outdated Show resolved Hide resolved
@silvester-pari silvester-pari merged commit 7e686b0 into main Jan 31, 2025
7 checks passed
@silvester-pari silvester-pari deleted the chart/feat/click-event branch January 31, 2025 08:41
@github-actions github-actions bot mentioned this pull request Jan 31, 2025
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.

Bubble up chart events
2 participants