mito-ds / mito

The mitosheet package, trymito.io, and other public Mito code.
https://trymito.io
Other
2.3k stars 158 forks source link

Make override of .head() .tail() etc optional in jupytelab #1336

Open DrBones opened 4 weeks ago

DrBones commented 4 weeks ago

Is your feature request related to a problem? Please describe. I like to be able to start a mitosheet and input some data or figure something out without googling the pandas documentation. However, I DO NOT want that every call to df, or df.head(), or df.tail, etc is intercepted by mitosheet and a full mitosheet is opened. I use thse commands all the time to quickly see if the data is sane and do not want or need the power of mitosheet every time.

Describe the solution you'd like I would like to have a toggle that disabled the spawing of mitosheets on the functions/commands I choose. Maybe in the Jupyterlab Settings Editor?

Describe alternatives you've considered I have looked into how the ipython display function is overwritten (hooked into?). But I am no expert in this and don't even know where to begin. Maybe it is even the df.style property? A hint would be much appreciated :D

Thanks! Additional context Add any other context or screenshots about the feature request here. Screenshot 2024-10-09 at 17 34 03@2x

aarondr77 commented 4 weeks ago

Hey @DrBones this is great feedback. Thanks for sharing + I totally agree that the mitosheet can sometimes be overkill.

I can think of a few fixes for this:

  1. Creating a global toggle so you can decide whether to have dataframes rendered in Mito by default or not
  2. Rendering in Mito by default and having a button at the top that says something like "view as normal pandas dataframe"
  3. Checking if the dataframe is a .head() or .tail() and defaulting those cases to the normal pandas dataframe output, keeping full dataframe outputs rendered in Mito.
  4. Creating a simpler dataframe output that still gives you the ability to scroll through your data, but it doesn't have the mito toolbar, if there are only a few rows of data it adjusts the height of the container so there is not a bunch of white space, etc.

How would you evaluate between these different approaches (or something else) for your workflow?