-
Notifications
You must be signed in to change notification settings - Fork 796
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
How to link local vega-tooltip repo to altair #3222
Comments
Thanks for the question! Would it be satisfying to just make your Altair chart I really am not sure what the right approach is beyond that, hopefully someone else can chime in. I think these lines seem somewhat promising, but I must admit I don't fully understand this section of the Altair code: https://github.com/altair-viz/altair/blob/0ca83784e2455f2b84d0f6d789af2abbe8814348/altair/utils/html.py#L163-L164 |
@ChristopherDavisUCI Thanks Christopher! This definitely worths a look. To be honest, currently I simply hard-code the vega-tooltip to filter zeros and sort the values: vega/vega-tooltip#820. And I can reflect the changes in vega-editor. From my understanding, altair only generates chart specifications and isn't involved in rendering at all. That said, if I want to reflect this hard-coded change in software like Streamlit, I need to point its renderer to use my modified repo? Also, I'm not an expert in vega or vega-lite schemas. Do you have any comments on how to add new parameters in altair (and they will become part of the new schema) to control whether to filter or whether to sort? Thanks! |
Thanks for the reply @sfc-gh-cheliu! Regarding your last question:
My understanding is that most of the new parameters should be added on the Vega-Lite side, and then Altair should be directed to the relevant Vega-Lite schema. Currently I believe you can use code like the following in Altair: I'm not saying it is easy to make these changes, but my impression is that most of them are automated on the Altair side, and dependent on the Vega-Lite schema like what is stored here. See also the notes here: I hope others with more recent experience can correct me! |
@ChristopherDavisUCI Hi Christopher, I hope you are doing well! Thanks for the info. Now I understand that we should add new parameters in Vega-Lite, and Altair actually just works following this schema. On the other hand, I'm trying to understand after adding this parameter, how Vega-Lite controls the Vega-Tooltip (the renderer). Since after adding a parameter, we need to tell it how to use this param. Are you familiar with this part? I searched a little bit and found this: |
Hi @sfc-gh-cheliu, Hmm, I'm not totally sure. Based on the screenshots you provided here, it looks like your changes are working in the Vega-Editor, so I don't think there's anything else you need to do on the Vega-Lite side. I could definitely be wrong (not very familiar with the Vega side...). |
@ChristopherDavisUCI Haha that's because I hard-coded to achieve what I want - the tooltip will always filter out 0 and sort the values. However, I guess to merge this PR I need to make this generic, something like a parameter/condition to control what to filter, and a parameter to control whether to sort/how to sort. |
@sfc-gh-cheliu Unfortunately I think we've reached the limits of my understanding! I tried to look a little more closely just now, and actually hadn't noticed before that your code lives in the Vega Tooltip repository... I had thought it was happening in the Vega-Lite repository. I don't know that repository at all! |
@ChristopherDavisUCI Yah one of the maintainer said it's a vega-tooltip issue: Though I agree we can hard-code This is printed from the output of And this is the output of I think there must be a step to convert the complex specification in cc: @domoritz |
There are multiple issues and PRs in various repos this duplicates. |
@dangotbanned Thanks for following up on this, I put all related tickets/PRs here: vega/vega#3816 |
Hi altair folks,
Related to this vega/vega-tooltip#820. I can test it in vega editor. But I'd like to know how can I test the changes in vega-tooltip using altair? That said, how can I configure such that altair is calling the local vega-tooltip or vega-lite repo to generate the tooltip? I've tried
yarn link
vega-tooltip and vega-lite repos to altair but seems not work. Or, is this related to which vega-tooltip/vega-lite version/repo the renderer refers to? Appreciate if you can help. Thanks!The text was updated successfully, but these errors were encountered: