Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add UID as a classname to bar trace #7328 #7329

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

Open
gregdeback wants to merge 2 commits into plotly:master
base: master
Choose a base branch
Loading
from gregdeback:pr_7328

Conversation

Copy link

@gregdeback gregdeback commented Jan 7, 2025

Feature

Scatter traces have always 3 classnames: trace scatter trace{UID} where UID is the trace unique ID (trace.uid).
Now bar traces can have it too: trace bars trace{UID}.

archmoj reacted with heart emoji
Copy link
Collaborator

Curious what you want this for? We don’t generally consider DOM structure like this to be part of the public API so in principle it’s subject to change at any time, though in practice it has likely been very stable.

archmoj reacted with heart emoji

Copy link
Author

It's because I'm working on a project where we would like the hovered bar series to be highlighted (by changing the opacity of the others). It's easy to retrieve the UID of the hovered trace, so for scatter (& line) traces it's easy to access the <g>roup (using querySelector('.trace' + point.uid))... but not for bar traces.
Or maybe there is an easier way to retrieve the <g>roup from the hovered point (or its trace)?

archmoj reacted with heart emoji

@gvwilson gvwilson changed the title (削除) Feature: Add UID as a classname to bar trace #7328 (削除ここまで) (追記) Add UID as a classname to bar trace #7328 (追記ここまで) Jan 7, 2025
@gvwilson gvwilson added feature something new community community contribution labels Jan 7, 2025
@@ -0,0 +1 @@
- Add `trace{UID}` to bar traces as for scatter ones [[#7328](https://github.com/plotly/plotly.js/issues/7328)]
Copy link
Contributor

@archmoj archmoj Apr 3, 2025

Choose a reason for hiding this comment

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

Suggested change
- Add `trace{UID}` to bartraces as for scatter ones [[#7328](https://github.com/plotly/plotly.js/issues/7328)]
- Add `trace{UID}` to bar, histogram, funnel and waterfall traces as for scatter ones [[#7328](https://github.com/plotly/plotly.js/issues/7328)],
with thanks to @gregdeback for the contribution!

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

@archmoj archmoj archmoj left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
community community contribution feature something new
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /