Skip to content

962 dataframe#1186

Merged
abidlabs merged 14 commits into
mainfrom
962-dataframe
May 9, 2022
Merged

962 dataframe#1186
abidlabs merged 14 commits into
mainfrom
962-dataframe

Conversation

@pngwn
Copy link
Copy Markdown
Member

@pngwn pngwn commented May 7, 2022

This is the refreshed dataframe and captures most the changes that have been discussed.

Short version: i changed the dataframe. Try it by running demo/blocks_outputs, I added a few dataframes there.

API

  • col_width has been removed (Dataframe Improvements #962)
  • row_count can now take a int or a tuple of (int, 'fixed' | 'dynamic') (Dataframe Improvements #962)
  • col_count can now take a int or a tuple of (int, 'fixed' | 'dynamic') (Dataframe Improvements #962)
  • A small amount of validation is done to check col_count and the length headers are the same. We could probably do more validation but I think this is enough to start with.

UX

  • You can drop a valid TSV or CSV onto the dataframe to populate it. Valid basically means not malformed + it needes headers. There isn't any error handling right now.
    • When you drag the table fades slightly and the border goes green.
    • If you have set col_count=(n, 'fixed') then that is how many columns will show up. Data is trimmed or blanks are filled in as needed.
    • If you set col_count=(n, 'fixed') then that is how many rows will show up. Data is trimmed or blanks are filled in as needed.
  • Clicking or Tabbing a cell 'selects' it, from here you can move around the cell with arrow keys or tab. Shift + tab goes backwards. Tabbing out of the table carries on the normal tab flow of the page, ditto for shift tab.
  • When selecting a cell you can type any printable key to erase current content and start editing.
  • When selecting a cell you can press return to continue editing a cell
  • When selecting a cell you can press Shift + Return to create a new row at your current position. This allows you create Rows in between rows.
  • When editing a cell, clicking outside of the cell, pressing escape, return or tab will cancel editing of that cell.
  • Single clicking a cell selects it, double clicking a cell edits it (without clearing it).
  • If you set If you set col_count=(n, 'fixed') the "New Column" button is hidden and the action prevented.
  • If you set row_count=(n, 'fixed') the "New Row" button is hidden and the action is prevents.

Bugs

  • many bugs have been fixed
  • many new bugs were created
  • they were then fixed
  • there are probably more bugs

The only thing that hasn't been done is removing rows + cols. There is an open issue for that which we will get to later, it will need some UX work but I don't think it needs to block 3.0

Closes #753. Closes #868. Closes #1065. Closes #945. Closes #962. Closes #745.

(need to double check #745 is fixed by this)

@pngwn pngwn marked this pull request as ready for review May 7, 2022 20:31
@abidlabs
Copy link
Copy Markdown
Member

abidlabs commented May 9, 2022

Wow took me a while to review all of the fixes and new features. Great work, especially love the drag-and-drop csv!

There are a couple of minor issues that I noticed -- for example, dataframe examples don't adjust the number of rows in the dataframe UI when clicked, which can cause problems if the number of rows in the example < the number of rows in the dataframe UI. But these are pretty minor things we can address post 3.0 launch, overall LGTM.

Pushed a few tweaks to make everything work, and will go ahead and merge so that we can release a new version.

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

Labels

None yet

Projects

None yet

2 participants