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: add tooltip histograms and support for non-visual properties #96

Merged
merged 43 commits into from
Nov 26, 2023

Conversation

flekschas
Copy link
Owner

@flekschas flekschas commented Oct 5, 2023

This PR adds support for showing histograms in the tooltip and for displaying non-visualized properties.

Description

What was changed in this pull request?

The tooltip now features a histogram next to the values, which is visualized as either a bar chart (for numerical properties) or as a horizontal stacked bar (for categorical properties)

tooltip-1-dark

The histograms are shown by default, but if annoying, they can be turned off via scatter.tooltip(histograms=False).

Additionally, one can now show non-visualized properties (via their column names) in the tooltip via scatter.tooltip(contents=['x', 'y', 'color', 'A_COLUMN_NOT_VISUALIZED']). E.g.:

tooltip-3-dark

Why is it necessary?

The reason I added histograms is to give the user the ability to correlate how the hovered point compares to all other points. For the visual properties this might not be super important because one can see the distribution. But for non-visualized properties this can help clarify why a certain set of points form a cluster and how that cluster differs from others. This is also the reason why it's useful to show non-visualized properties in the tooltip.

Checklist

  • Provided a concise title as a semantic commit message (e.g. "fix: correctly handle undefined properties")
  • CHANGELOG.md updated
  • Tests added or updated
  • Documentation in API.md/README.md added or updated
  • Example(s) added or updated
  • Screenshot, gif, or video attached for visual changes

@flekschas flekschas requested a review from manzt October 5, 2023 22:20
@netlify
Copy link

netlify bot commented Oct 5, 2023

Deploy Preview for calm-platypus-50e85d canceled.

Name Link
🔨 Latest commit f5a335c
🔍 Latest deploy log https://app.netlify.com/sites/calm-platypus-50e85d/deploys/65622f666b49fa0008821ca0

@flekschas flekschas added the enhancement New feature or request label Oct 5, 2023
@flekschas
Copy link
Owner Author

@hamelin This might be useful for use cases like TNT. (Also, I haven't forgotten about #89 😅 I'll try to get that addressed before releasing the next version.)

Copy link
Collaborator

@manzt manzt left a comment

Choose a reason for hiding this comment

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

Really nice Fritz! Sorry for the delay on the review. I tried it out this morning and am very impressed. Just had a few comments about implementation, mostly in the front end.

docs/axes-legend-tooltip.md Outdated Show resolved Hide resolved
docs/axes-legend-tooltip.md Outdated Show resolved Hide resolved
docs/axes-legend-tooltip.md Outdated Show resolved Hide resolved
docs/axes-legend-tooltip.md Show resolved Hide resolved
js/src/histogram.js Outdated Show resolved Hide resolved
js/src/index.js Outdated Show resolved Hide resolved
js/src/index.js Outdated Show resolved Hide resolved
js/src/index.js Outdated Show resolved Hide resolved
jscatter/widget.py Show resolved Hide resolved
jscatter/widget.py Show resolved Hide resolved
flekschas and others added 2 commits October 8, 2023 17:13
Co-authored-by: Trevor Manz <trevor.j.manz@gmail.com>
Co-authored-by: Trevor Manz <trevor.j.manz@gmail.com>
@flekschas flekschas merged commit ea51da6 into main Nov 26, 2023
4 checks passed
@flekschas flekschas deleted the flekschas/tooltip-histograms branch November 26, 2023 12:59
@manzt
Copy link
Collaborator

manzt commented Nov 28, 2023

Congrats on merging this! Sorry I couldn't find the time to review sooner.

@flekschas
Copy link
Owner Author

No worries at all. I just merged it to get started on the final feature for the tool tip before releasing v0.15 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants