Skip to content

Commit f0d9dfe

Browse files
author
Tim Shawver
authored
Updating the "what's new" section
1 parent 5e5339d commit f0d9dfe

File tree

1 file changed

+39
-20
lines changed

1 file changed

+39
-20
lines changed

README.rst

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,6 @@ Qgrid was developed for use in `Quantopian's hosted research environment
1515
<https://www.quantopian.com/posts/qgrid-now-available-in-research-an-interactive-grid-for-sorting-and-filtering-dataframes?utm_source=github&utm_medium=web&utm_campaign=qgrid-repo>`_
1616
and is available for use in that environment as of June 2018.
1717

18-
What's New
19-
----------
20-
**Improved MultiIndex Support (as of 1.0.6-beta.6)**:
21-
Qgrid now displays multi-indexed DataFrames with some of the index cells merged for readability, as is normally done when viewing DataFrames as a static html table. The following image shows qgrid displaying a multi-indexed DataFrame that was returned from Quantopian's `Pipeline API <https://www.quantopian.com/tutorials/pipeline?utm_source=github&utm_medium=web&utm_campaign=qgrid-repo>`_:
22-
23-
.. figure:: https://s3.amazonaws.com/quantopian-forums/pipeline_with_qgrid.png
24-
:align: left
25-
:target: https://s3.amazonaws.com/quantopian-forums/pipeline_with_qgrid.png
26-
:width: 100px
27-
28-
**Qgrid Events (as of 1.0.3)**:
29-
Qgrid has some new API methods which can be used to attach event handlers. Event handlers are callback methods that get called when certain events occur in the qgrid interface. In qgrid 1.0.3, event handlers can be attached with the ``on`` method and detached with the ``off`` method. There are ``on`` and ``off`` methods on both the ``qgrid`` module (see `qgrid.on <https://qgrid.readthedocs.io/en/latest/#qgrid.on>`_), and on individual QgridWidget instances (see `qgrid.QgridWidget.on <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.on>`_).
30-
31-
To get a better idea of how these methods might be used, see the `Events API`_ section below.
32-
3318
Demo
3419
----
3520
Click the badge below to try out the latest beta of qgrid in Quantopian's hosted research environment. If you're already signed into Quantopian you'll be brought directly to the demo notebook. Otherwise you'll be prompted to register (it's free):
@@ -71,15 +56,15 @@ Installing with pip::
7156

7257
pip install qgrid
7358
jupyter nbextension enable --py --sys-prefix qgrid
74-
59+
7560
# only required if you have not enabled the ipywidgets nbextension yet
7661
jupyter nbextension enable --py --sys-prefix widgetsnbextension
7762

7863
Installing with conda::
7964

8065
# only required if you have not added conda-forge to your channels yet
8166
conda config --add channels conda-forge
82-
67+
8368
conda install qgrid
8469

8570
Jupyterlab Installation
@@ -102,6 +87,40 @@ able to use qgrid in notebooks as you normally would.
10287
having trouble, try installing those versions. Feel free to file an issue if you find that qgrid isn't working
10388
with a newer version of either dependency.*
10489

90+
What's New
91+
----------
92+
**Column-specific options (as of 1.1.0)**:
93+
Thanks to a significant `PR from the community <https://github.com/quantopian/qgrid/pull/191>`_, Qgrid users now have the ability to set a number of options on a per column basis. This allows you to do things like explicitly specify which column should be sortable, filterable, editable, etc. For example, if you wanted to prevent filtering on all columns except for a column named `'A'`, you could do the following::
94+
95+
col_opts = { 'filterable': False }
96+
col_defs = { 'A': { 'filterable': True } }
97+
qgrid.show_grid(df, column_options=col_opts, column_definitions=col_defs)
98+
99+
See the updated `show_grid <https://qgrid.readthedocs.io/en/v1.1.0/#qgrid.show_grid>`_ documentation for more information.
100+
101+
**Disable editing on a per-row basis (as of 1.1.0)**:
102+
This feature can be thought of as the first row-specific option that qgrid supports. In particular it allows a user to specify, using python code, whether or not a particular row should be editable. For example, to make it so only rows in the grid where the `'status'` column is set to `'active'` are editable, you might use the following code::
103+
104+
def can_edit_row(row):
105+
return row['status'] == 'active'
106+
107+
qgrid.show_grid(df, row_edit_callback=can_edit_row)
108+
109+
**New API methods for dynamically updating an existing qgrid widget (as of 1.1.0)**:
110+
Adds the following new methods, which can be used to update the state of an existing Qgrid widget without having to call `show_grid` to completely rebuild the widget:
111+
112+
- `change_selection <https://qgrid.readthedocs.io/en/v1.1.0/#qgrid.QgridWidget.change_selection>`_
113+
- `toggle_editable <https://qgrid.readthedocs.io/en/v1.1.0/#qgrid.QgridWidget.toggle_editable>`_
114+
- `change_grid_option <https://qgrid.readthedocs.io/en/v1.1.0/#qgrid.QgridWidget.change_grid_option>`_ (experimental)
115+
116+
**Improved MultiIndex Support (as of 1.0.6-beta.6)**:
117+
Qgrid now displays multi-indexed DataFrames with some of the index cells merged for readability, as is normally done when viewing DataFrames as a static html table. The following image shows qgrid displaying a multi-indexed DataFrame that was returned from Quantopian's `Pipeline API <https://www.quantopian.com/tutorials/pipeline?utm_source=github&utm_medium=web&utm_campaign=qgrid-repo>`_:
118+
119+
.. figure:: https://s3.amazonaws.com/quantopian-forums/pipeline_with_qgrid.png
120+
:align: left
121+
:target: https://s3.amazonaws.com/quantopian-forums/pipeline_with_qgrid.png
122+
:width: 100px
123+
105124
Dependencies
106125
------------
107126

@@ -218,7 +237,7 @@ you open the ``index.html`` file in your browser, you should be able to preview
218237

219238
Events API
220239
----------
221-
As of qgrid 1.0.3 there are new ``on`` and ``off`` methods in qgrid which can be used to attach/detach event handlers. Previously the only way to listen for events was to use undocumented parts of the API.
240+
As of qgrid 1.0.3 there are new ``on`` and ``off`` methods in qgrid which can be used to attach/detach event handlers. They're available on both the ``qgrid`` module (see `qgrid.on <https://qgrid.readthedocs.io/en/latest/#qgrid.on>`_), and on individual QgridWidget instances (see `qgrid.QgridWidget.on <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.on>`_). Previously the only way to listen for events was to use undocumented parts of the API.
222241

223242
Having the ability to attach event handlers allows us to do some interesting things in terms of using qgrid in conjunction with other widgets/visualizations. One example is using qgrid to filter a DataFrame that's also being displayed by another visualization.
224243

@@ -252,10 +271,10 @@ The first gif shows how you can use qgrid to filter the data that's being shown
252271
:width: 600px
253272

254273
A brief demo showing qgrid hooked up to a matplotlib plot
255-
274+
256275
The second gif shows how you can move qgrid to a separate view in JupyterLab, which makes it more convenient
257276
to use in conjunction with other visualizations (in this case, a couple of ``Output`` widgets):
258-
277+
259278
.. figure:: docs/images/events_api.gif
260279
:align: left
261280
:target: docs/images/events_api.gif

0 commit comments

Comments
 (0)