-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add support for multi-data tooltips #382
Conversation
Take arrays and run augment_encoding_type on the internal components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, that does look correct to me!
Could you maybe add a test that exercises this new code path?
I think eventually we would probably also want a simple =[:foo, :bar]
to work, but we can do that in a follow-up PR.
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #382 +/- ##
==========================================
+ Coverage 76.90% 78.92% +2.01%
==========================================
Files 12 12
Lines 433 427 -6
==========================================
+ Hits 333 337 +4
+ Misses 100 90 -10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Changes made:
As for the test, I wasn't sure what to really test, or where to put it. I added a test that ran a @vlplot macro with tooltip array, and checked that the tooltip encoding is an array.
It works just fine as is! Let me know if there are any further changes to be made! |
Would it be possible to review and merge this sometime in the near future? It obviously hasn't been urgent, but a new issue was created about (#415) multiple field tool-tips. |
Bump on this PR. Would love to see this merged. @noahrhodes @davidanthoff |
Setting tooltips for multiple components was not working (see #332)
augument_encoding_type
did not run correctly for an array that was passed in as the tooltip information.this change adds
augment_encoding_type(x::Array, data::Vega.DataValuesNode)
for array types. It takes arrays and runsaugment_encoding_type
on the internal componentsThis code snippet now works:
There is a line in the
docs/src/examples/examples_table_based_plots.md
that can be updated if this change is added#tooltip=[{field="Origin",type="nominal"},{field="Cylinders",type="quantitative"}] #array not supported
This is my first contribution to the package. Is there anything else I should add to this pull request?
This fixes the problem and passes the tests, but I am unsure if there are other implications. This may not even be the correct way to fix this problem, and I am happy to take pointers to a different approach.