Skip to content

tooltip: true #1525

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

Closed
wants to merge 1 commit into from
Closed

tooltip: true #1525

wants to merge 1 commit into from

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented May 5, 2023

In this branch, I’m trying to figure out how we could provide shorthand syntax for tooltips. So, rather than needing to repeat the channel definitions when declaring a tooltip, we could derive a tooltip from an existing mark (and possibly allow some overrides, say to suppress certain channels from appearing in the tooltip, or altering how the values are formatted).

As a first cut, I recycled the concept of channel aliases from the earlier PR #798. However, I don’t think this will be sufficient for initializers such as hexbin, because initializers can populate channels that are not declared in mark.channels, and thus we can’t create static aliases. That suggests that either we’d need to run the initializer on the tooltip mark (which is a bummer because it is duplicate effort and wouldn’t work with a nondeterministic initializer), or the tooltip should instead have a reference to the mark whose channel values we want to show in the tooltip. I think the latter is the way to go, but it’ll require some more plumbing to figure out how that would work… and also we should retain the ability to render an independent tooltip (attached to itself, in effect).

Getting this working is probably a blocker for #1304 because we shouldn’t land the proposed tooltip mark if we’ll have to redesign it substantially to support shorthand. But I think we’re pretty close to figuring this out.

@mbostock mbostock requested a review from Fil May 5, 2023 23:31
@mbostock mbostock mentioned this pull request May 6, 2023
41 tasks
@mbostock mbostock force-pushed the mbostock/tooltip-true branch from fe36567 to 56dc402 Compare May 6, 2023 16:59
@mbostock mbostock mentioned this pull request May 7, 2023
57 tasks
@mbostock
Copy link
Member Author

Superseded by #1527 which, while the syntax is not final, demonstrates how the underlying mechanism will work.

@mbostock mbostock closed this May 10, 2023
@mbostock mbostock deleted the mbostock/tooltip-true branch May 10, 2023 19:28
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.

1 participant