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

Have an option to make the tooltip align floating points (or at least align right) #216

Open
kanitw opened this issue Dec 6, 2018 · 10 comments

Comments

@kanitw
Copy link
Member

kanitw commented Dec 6, 2018

image

Currently it's a bit hard to compare.

@kanitw
Copy link
Member Author

kanitw commented Dec 6, 2018

We may also want to consider using a monospace font for numbers to facilitate alignment.

@domoritz
Copy link
Member

domoritz commented Dec 6, 2018

I agree! Ideally we align to the decimal point.

I don't know whether we have a way of knowing whether something is a number since we don't format them. It's all coming from Vega.

@kanitw
Copy link
Member Author

kanitw commented Dec 6, 2018

I think we can try to convert to number. If something is a number, then we won't get NaN. :)

@domoritz
Copy link
Member

domoritz commented Dec 6, 2018

wouldn't we throw away formatting like trailing 0s?

@kanitw
Copy link
Member Author

kanitw commented Dec 6, 2018

We can just do the conversion just to check if something is a number. Then align the dots in floating points in real time since there won't be that many variables to show on a tooltip anyway.

@domoritz
Copy link
Member

domoritz commented Dec 7, 2018

What if the locale dictates , instead of . to separate the non-fraction from the fraction part?

@kanitw
Copy link
Member Author

kanitw commented Dec 7, 2018

That's a bug that a German should fix. :p

@kanitw
Copy link
Member Author

kanitw commented Dec 7, 2018

Joke aside I'm sure one can read the locale and adjust the delimiter

@domoritz
Copy link
Member

domoritz commented Dec 7, 2018

Jep, just wanted to make sure we think through the potential problems.

@domoritz
Copy link
Member

We should also make sure numbers have the same width. See https://medium.com/mission-log/design-better-data-tables-430a30a00d8c (e.g. with font-variant-numeric: lining-nums tabular-nums;).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants