quantopian / qgrid

An interactive grid for sorting, filtering, and editing DataFrames in Jupyter notebooks
Apache License 2.0
3.03k stars 425 forks source link

No "Maximice" option at the moment of display dataframe in jupyter lab #182

Open jvaldiviezo9 opened 6 years ago

jvaldiviezo9 commented 6 years ago

Environment

Description of Issue

import numpy as np
import pandas as pd
import qgrid
randn = np.random.randn
df_types = pd.DataFrame({
    'A' : pd.Series(['2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04',
               '2013-01-05', '2013-01-06', '2013-01-07', '2013-01-08', '2013-01-09'],index=list(range(9)),dtype='datetime64[ns]'),
    'B' : pd.Series(randn(9),index=list(range(9)),dtype='float32'),
    'C' : pd.Categorical(["washington", "adams", "washington", "madison", "lincoln","jefferson", "hamilton", "roosevelt", "kennedy"]),
    'D' : ["foo", "bar", "buzz", "bippity","boppity", "foo", "foo", "bar", "zoo"] })
df_types['E'] = df_types['D'] == 'foo'
qgrid_widget = qgrid.QgridWidget(df=df_types, show_toolbar=True)
qgrid_widget

Anything else?

In Jupyter Notebook it works as expected, but in Jupyter Lab, that option is missing. I attach an image: image

...

TimShawver commented 6 years ago

Hi, this is a limitation of using Qgrid in Jupyterlab currently, because the way this feature is implemented depends on some javascript that's only available in the Jupyter notebook environment.

I'm not sure I'm going to add support for this feature in Jupyterlab because the Jupyterlab layout system provides some similar capabilities. For example if you right click in the left margin of the qgrid control, the context menu that appears has a "Create New View for Output" option, as seen here: screen shot 2018-03-25 at 10 35 50 pm

If you select that option you'll be able to see Qgrid in a separate tab which can dragged around the UI and placed in various locations, such as at the bottom of the screen:

screen shot 2018-03-25 at 10 38 24 pm

You can also put that Qgrid tab in "Single-Document Mode" using the following option on the View menu (or Shift + Cmd + Enter): screen shot 2018-03-25 at 10 40 43 pm

Which results in Qgrid taking up the whole screen: screen shot 2018-03-25 at 10 42 45 pm

I realize it's some extra clicks but you also get some more flexibility in terms of where you place the grid. Hopefully that satisfies your use case for now until I have time to figure out how to make the full screen button do these things with a single click.

jvaldiviezo9 commented 6 years ago

Thanks you so much @TimShawver for pointing this workaround ! I think It could satisface my needs by now

TimShawver commented 6 years ago

No problem...good to hear 👍