-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Hover format or skip #2377
Hover format or skip #2377
Conversation
I'm a bit surprised by the test failure on python 2.7 (why would a hovertemplate be different with python 2.7 and python 3?) |
ahhh thank you :-). I'll change the test then. Python 3 users won't have the problem since dicts are insertion-ordered, and py2 users can always use an OrderedDict instead. |
So this approach looks pretty good. I don't love the string manipulations, although they seem pretty safe! One wrinkle: we support two different kinds of formatting... d3-format for numbers and d3-time-format for dates, and the delimiter between the attribute name and the formatting string is different ( |
Sure, let's add the delimiter. As for string manipulations, maybe there's a cleaner way to do it, this was a first pass to see if it worked. |
@nicolaskruchten I think this one is ready for review. |
Can we also accept something like |
I could maybe be convinced, but I liked the idea that the value is a formatting information, except when it's a tuple, in which case it's (formatting, data). It's also the logics which I have used in the code, converting everything to tuples internally. |
Right, but I feel like if we've already got a |
…ly.py into hover-format-or-skip
Not quite done the review, but it looks great so far! We need to merge this in before #2336, as I think I'll have an easier time rebasing :) |
So when we iterate through an "array attrable" and it's a dict, it sort of "just works" :) nice! |
short-circuit instead of bypass flag
Yes when you iterate through a dict it iterates through its keys. Simple and elegant ;-). |
OK, this is awesome :) 💃 |
Thanks for the 💃 let me just add the changelog entry and I'll merge. |
Closes #1774
Still need to add doc (and probably more tests), but early feedback is welcome.