observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

Improve SQL Cell table view #308

Closed domoritz closed 1 year ago

domoritz commented 2 years ago

Is your feature request related to a problem? Please describe.

The table view requires manual scrolling and looks overall not as polished (e.g. numbers are not right aligned).

Screen Shot 2021-12-05 at 14 26 26

Describe the solution you'd like

Inputs.table https://observablehq.com/@observablehq/input-table automatically loads more data and looks overall more polished. However, there are some things that are better in the SQL table: row numbers, better displays of nulls, and column sizing.

Screen Shot 2021-12-05 at 14 27 21
domoritz commented 2 years ago

The accuracy of numbers is also a bit excessive in many examples and it looks like the default font is not optimized for viewing numbers.

Screen Shot 2021-12-05 at 14 43 14 Screen Shot 2021-12-05 at 14 42 59
mbostock commented 2 years ago

šŸ‘ Thereā€™s definitely room for improvement in the current SQL cell table design. Weā€™re working on these improvements and it should be out in the near future. I would add the display of dates to the list. Any other specific suggestions you want to make would be welcome!

mootari commented 2 years ago

Another problem with the current implementation is, that the result table is not available in embedded notebooks. Instead, only the default Inspector output is shown.

Example: https://observablehq.com/embed/@observablehq/sql-cells?cell=*

In Observable: image

Embed: image

asg017 commented 2 years ago

Some other improvements I'd like to see on the SQL cell table view (I can file a new issue if needed):

kimmolinna commented 2 years ago

Just a couple of thing. 1) It would be nice to have Line numbers in SQL Cell queries because then it's easier to find line where the error is. 2) Inputs.tableis handling integers (big int) nicely but I have to cast all big ints to ints for SQL Cell tables

chriszs commented 2 years ago

Enjoying the visual refresh:

Screen Shot 2022-04-29 at 8 23 00 PM

Though the visual inconsistency between the two table styles is even more glaring and I totally second everything @asg017 said, especially the loading indicator, which might actually be harder to see with the new gray background?

chriszs commented 2 years ago

To be honest, I'm not sure why one takes a pagination approach and the other an infinite scroll approach.

CobusT commented 2 years ago

Many of the issues mentioned here have now been fixed:

Not done yet:

mbostock commented 2 years ago

BigInt is now supported, although I notice that we arenā€™t doing localized formatting for them yet. Weā€™ll fix that.

Screen Shot 2022-11-02 at 6 47 16 AM
mbostock commented 2 years ago

Number formatting is also improved in https://github.com/observablehq/feedback/issues/308#issuecomment-986288618:

Screen Shot 2022-11-02 at 6 56 03 AM
domoritz commented 2 years ago

That's excellent. Thank you for all the great improvements!

There seems to be an issue with floats from DuckDB that are not recognized (shown as type "other").

Screenshot 2022-11-02 at 11 22 51

This is from https://observablehq.com/@cmudig/duckdb.

mbostock commented 2 years ago

@domoritz It appears ā€œotherā€ is what the DuckDBClient is returning for the schema:

Screen Shot 2022-11-02 at 8 40 20 AM

Specifically, itā€™s because the DuckDBClient doesnā€™t recognize the Float32 type. I sent you a suggestion to fix this here:

https://observablehq.com/compare/357f1a71f976f173...447275d083e033c7

domoritz commented 2 years ago

Ahh, I see. I really need to make the observable client a proper module with tests and move it out of a notebook. @enjalot and I talked about it last week (https://github.com/duckdb/duckdb-wasm/issues/1056).