Skip to content

Commit 5aa1905

Browse files
committed
DOCS-quantopian#22: Move Events API into features
Signed-off-by: Richard Lin <richard.lin.047@berkeley.edu>
1 parent b24a3bf commit 5aa1905

File tree

1 file changed

+40
-42
lines changed

1 file changed

+40
-42
lines changed

README.rst

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -51,47 +51,6 @@ If needed, Modin-spreadsheet can be installed through PyPi. ::
5151

5252
pip install modin-spreadsheet
5353

54-
Features
55-
----------
56-
**Column-specific options**:
57-
The feature enables the ability to set options on a per column basis. This allows you to do things like explicitly
58-
specify which column should be sortable, editable, etc. For example, if you wanted to prevent editing on all columns
59-
except for a column named `'A'`, you could do the following::
60-
61-
col_opts = { 'editable': False }
62-
col_defs = { 'A': { 'editable': True } }
63-
modin_spreadsheet.show_grid(df, column_options=col_opts, column_definitions=col_defs)
64-
65-
See the `show_grid <https://qgrid.readthedocs.io/en/v1.1.0/#qgrid.show_grid>`_ documentation for more information.
66-
67-
**Disable editing on a per-row basis**:
68-
This feature allows a user to specify whether or not a particular row should be editable. For example, to make it so
69-
only rows in the grid where the `'status'` column is set to `'active'` are editable, you might use the following code::
70-
71-
def can_edit_row(row):
72-
return row['status'] == 'active'
73-
74-
modin_spreadsheet.show_grid(df, row_edit_callback=can_edit_row)
75-
76-
**Dynamically update an existing spreadsheet widget**:
77-
These API allow users to programmatically update the state of an existing spreadsheet widget:
78-
79-
- `edit_cell <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.edit_cell>`_
80-
- `change_selection <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.change_selection>`_
81-
- `toggle_editable <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.toggle_editable>`_
82-
- `change_grid_option <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.change_grid_option>`_ (experimental)
83-
84-
**MultiIndex Support**:
85-
Modin-spreadsheet displays multi-indexed DataFrames with some of the index cells merged for readability, as is normally
86-
done when viewing DataFrames as a static html table. The following image shows Modin-spreadsheet displaying a
87-
multi-indexed DataFrame:
88-
89-
.. figure:: https://s3.amazonaws.com/quantopian-forums/pipeline_with_qgrid.png
90-
:align: left
91-
:target: https://s3.amazonaws.com/quantopian-forums/pipeline_with_qgrid.png
92-
:width: 100px
93-
94-
9554
Running from source & testing your changes
9655
------------------------------------------
9756

@@ -136,8 +95,47 @@ Running automated tests
13695
There is a small python test suite which can be run locally by running the command ``pytest`` in the root folder
13796
of the repository.
13897

139-
Events API
98+
Features
14099
----------
100+
**Column-specific options**:
101+
The feature enables the ability to set options on a per column basis. This allows you to do things like explicitly
102+
specify which column should be sortable, editable, etc. For example, if you wanted to prevent editing on all columns
103+
except for a column named `'A'`, you could do the following::
104+
105+
col_opts = { 'editable': False }
106+
col_defs = { 'A': { 'editable': True } }
107+
modin_spreadsheet.show_grid(df, column_options=col_opts, column_definitions=col_defs)
108+
109+
See the `show_grid <https://qgrid.readthedocs.io/en/v1.1.0/#qgrid.show_grid>`_ documentation for more information.
110+
111+
**Disable editing on a per-row basis**:
112+
This feature allows a user to specify whether or not a particular row should be editable. For example, to make it so
113+
only rows in the grid where the `'status'` column is set to `'active'` are editable, you might use the following code::
114+
115+
def can_edit_row(row):
116+
return row['status'] == 'active'
117+
118+
modin_spreadsheet.show_grid(df, row_edit_callback=can_edit_row)
119+
120+
**Dynamically update an existing spreadsheet widget**:
121+
These API allow users to programmatically update the state of an existing spreadsheet widget:
122+
123+
- `edit_cell <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.edit_cell>`_
124+
- `change_selection <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.change_selection>`_
125+
- `toggle_editable <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.toggle_editable>`_
126+
- `change_grid_option <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.change_grid_option>`_ (experimental)
127+
128+
**MultiIndex Support**:
129+
Modin-spreadsheet displays multi-indexed DataFrames with some of the index cells merged for readability, as is normally
130+
done when viewing DataFrames as a static html table. The following image shows Modin-spreadsheet displaying a
131+
multi-indexed DataFrame:
132+
133+
.. figure:: https://s3.amazonaws.com/quantopian-forums/pipeline_with_qgrid.png
134+
:align: left
135+
:target: https://s3.amazonaws.com/quantopian-forums/pipeline_with_qgrid.png
136+
:width: 100px
137+
138+
**Events API**:
141139
The Events API provides ``on`` and ``off`` methods which can be used to attach/detach event handlers. They're available
142140
on both the ``modin_spreadsheet`` module (see `qgrid.on <https://qgrid.readthedocs.io/en/latest/#qgrid.on>`_), and on
143141
individual SpreadsheetWidget instances (see `qgrid.QgridWidget.on <https://qgrid.readthedocs.io/en/latest/#qgrid.QgridWidget.on>`_).

0 commit comments

Comments
 (0)