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

Editable Dataframe - feature requests and bugs #1268

Open
4 of 12 tasks
karangattu opened this issue Mar 29, 2024 · 5 comments
Open
4 of 12 tasks

Editable Dataframe - feature requests and bugs #1268

karangattu opened this issue Mar 29, 2024 · 5 comments
Assignees
Labels
data frame Related to @render.data_frame

Comments

@karangattu
Copy link
Collaborator

karangattu commented Mar 29, 2024

Find below all the feature requests for future releases of editable dataframes

  • Allow users to use Shift Key + multiple rows to highlight multiple rows when row_selection is configured to be multiple
  • During edit mode, py-shiny should perform validation when user attempts to enter data that conflicts with the data type of the column in question.
  • Allow users to move columns around for ease of use or better readability when working with dataframes
  • Option for users to use pagination i.e. show 10, 25 or 50 entries in the table instead of infinite scroll if the data is being populated by calling an API.
  • Allow users to undo or redo the changes made to a cell.
  • Color in darkly mode is subtle and user might not recognize the highlighted cells.
  • Have a way where users can move between different cells without editing each cell. In short when user clicks on a cell, do not turn on editing, only when user presses return/Enter key or double click on the cell.
  • Hitting tab currently allows to shift focus to the next cell on the right in the same row. When it reaches end of line for that row, hitting Tab should allow to switch to the first cell in the next row.
  • Allow copying across multiple cells by either dragging the selected cell or pasting when a selected row is in focus.

Find below all the issues found during the initial exploratory testing of editable dataframes

@schloerke schloerke added the data frame Related to @render.data_frame label Apr 2, 2024
@schloerke schloerke mentioned this issue Apr 3, 2024
72 tasks
@schloerke
Copy link
Collaborator

schloerke commented Apr 4, 2024

@mdaeron
Copy link

mdaeron commented Apr 17, 2024

May I suggest the following features?

  • ability to paste multi-row, tab-delimited data (basically, enable straightforward copy-and-paste from Office-like spreadsheet software)
  • automatically add rows when pasting such data

These two things would go a long way towards building apps that everyone can use, even without any coding background.

@nh-cadmus
Copy link

nh-cadmus commented May 14, 2024

I would like to suggest the following additional functionality:

  • Ability to define which columns should be editable (or which columns should be read-only)
  • Different input controls for different data types, e.g. a boolean field should contain checkboxes, a timestamp field should contain a date picker, etc.
  • Ability to define a custom dropdown list of available values for a column
  • Data validation options - perhaps the ability to define a custom validation function for a column and/or a row, which gets called when data is added/updated and if it returns false shows an error message. Would allow for simple validation like a numeric range for number columns, and more complex custom validation for fields that might have special requirements.

@schloerke
Copy link
Collaborator

@nh-cadmus Data validation options - 🕺 Check out:

@df_original.set_patch_fn
def _(*, patch: render.CellPatch) -> render.CellValue:
if patch["column_index"] in [0, 2]:
return float(patch["value"])
return int(patch["value"])
. If you need full control:
@my_data_frame.set_patches_fn
def _(*, patches: list[render.CellPatch]) -> list[render.CellPatch]:
for patch in patches:
if patch["column_index"] in [0, 2]:
patch["value"] = float(patch["value"])
else:
patch["value"] = int(patch["value"])
# "Save to the database" by writing the edited data to a CSV file
df = edited_df().copy()
for patch in patches:
df.iloc[patch["row_index"], patch["column_index"]] = patch["value"]
edited_df.set(df)
df.to_csv(here / "mtcars.csv", index=False)
print("Saved the edited data to './mtcars.csv'")
return patches
. Feel free to raise errors within either function.

@davidchall
Copy link

Feature requests to help end users create their own table, rather than editing an existing table:

  • Ability to add row
  • Ability to delete row(s)
  • Ability to add column
  • Ability to delete column(s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data frame Related to @render.data_frame
Projects
None yet
Development

No branches or pull requests

5 participants