nushell / demo

Experimental wasm-based Nu playground
https://www.nushell.sh/demo/
MIT License
24 stars 10 forks source link

add button to pivot overflowing tables #49

Closed jzaefferer closed 4 years ago

jzaefferer commented 4 years ago

Also uses rename to give the (likely) two columns nicer names.

Fixes #29

Table with overflow:

Screenshot 2020-08-01 at 13 11 05

After running with the extra | pivot | rename key value:

Screenshot 2020-08-01 at 13 11 14
fdncred commented 4 years ago

I don't think this is a good idea If this pivots automatically. I think it'll just confuse people because if you're building a pipeline you rely on column names. So, if we auto-pivot that goes away. If we have a "hint" box that says, "We've noticed your table has a lot of columns, if you'd like to see all the data in two columns, add | pivot to your expression", I think it would be better. Or if it's a button called pivot that adds | pivot to the expression. I think that's ok too.

jzaefferer commented 4 years ago

This implementation detects the overflow, then adds a button (first screenshot). When clicked, it runs the same command, while adding the pivot and rename commands to the end of the pipeline (2nd screenshot).

I think that's the behavior you're looking for, isn't it?

fdncred commented 4 years ago

Yes. Sorry. I misread your post and screenshots. Thanks and keep up the good work.

jzaefferer commented 4 years ago

No problem. I originally skipped that description here, since I assumed the discussion in the issue was clear enough; but that's been a while :D

sophiajt commented 4 years ago

Cool, I like it 👍