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

Visually distinguish integer and text columns #729

Closed
simonw opened this issue Apr 20, 2020 · 8 comments
Closed

Visually distinguish integer and text columns #729

simonw opened this issue Apr 20, 2020 · 8 comments

Comments

@simonw
Copy link
Owner

simonw commented Apr 20, 2020

It would be useful if I could tell from looking at the table page if a column was a integer or a text (or a float I guess?). This is particularly important for knowing if it safe to sort by that column.

@simonw
Copy link
Owner Author

simonw commented May 15, 2020

Not sure the best way to do this. Here's an example using very subtle colour changes - but I'm worried it's not at all discoverable:

fixtures__sortable__201_rows

That's with #4c0077 for floats and #666666 for integers.

@simonw
Copy link
Owner Author

simonw commented May 15, 2020

I like the gray. The purple is a bit confusing.

I could have both integers and floats show up as gray? The floating point should help show which is which.

Maybe I could default floating point columns with integer values in them to 11.0 just to make it clear that they are floats?

@simonw
Copy link
Owner Author

simonw commented May 15, 2020

Turns out 1.0 and 2 stored in a float column already displays like that:

echo '[{"foo": 1.0, "bar": 1}, {"foo": 2, "bar": 2}]' | sqlite-utils insert /tmp/db.db t -

db__t__2_rows

@simonw
Copy link
Owner Author

simonw commented May 15, 2020

I'm going to make all integers AND floats show up as #666666.

@simonw simonw closed this as completed in 5041963 May 15, 2020
@simonw
Copy link
Owner Author

simonw commented May 15, 2020

type-pk is a more accurate name than type-link - since people might assume that type-link refers to columns containing a link or a URL or similar.

@simonw simonw reopened this May 15, 2020
@simonw simonw closed this as completed in 5ea8c6d May 15, 2020
@simonw
Copy link
Owner Author

simonw commented May 15, 2020

@simonw
Copy link
Owner Author

simonw commented May 15, 2020

4F8D336A-ECEB-4C68-A859-C8A3DA546E9C

I don't like how the column headers themselves are no longer black in mobile view.

@simonw simonw reopened this May 15, 2020
@simonw simonw closed this as completed in faea509 May 15, 2020
simonw added a commit to simonw/covid-19-datasette that referenced this issue May 18, 2020
I want to be able to visually distinguish numeric columns, see simonw/datasette#729
@simonw
Copy link
Owner Author

simonw commented May 18, 2020

Deployed here: https://covid-19.datasettes.com/covid/economist_excess_deaths - and it helped me spot a bug! The floating point numbers there were being treated as strings:

covid__economist_excess_deaths__2_559_rows

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

1 participant