├── .gitattributes ├── .github ├── ISSUE_TEMPLATE.md ├── release-drafter-config.yml └── workflows │ ├── main.yml │ ├── master-merge.yml │ └── release.yml ├── .gitignore ├── CONTRIBUTING.rst ├── LICENSE ├── MANIFEST.in ├── README.rst ├── docs └── images │ ├── events_api.gif │ ├── linked_to_scatter.gif │ └── overview_demo.gif ├── examples └── tutorial.ipynb ├── js ├── package.json ├── src │ ├── embed.js │ ├── extension.js │ ├── index.js │ ├── jupyterlab-plugin.js │ ├── spreadsheet.booleanfilter.js │ ├── spreadsheet.css │ ├── spreadsheet.datefilter.js │ ├── spreadsheet.editors.js │ ├── spreadsheet.filterbase.js │ ├── spreadsheet.sliderfilter.js │ ├── spreadsheet.textfilter.js │ └── spreadsheet.widget.js └── webpack.config.js ├── modin_spreadsheet ├── __init__.py ├── _version.py ├── constants.py ├── grid.py └── tests │ ├── __init__.py │ └── test_grid.py ├── requirements.txt ├── setup.cfg ├── setup.py └── versioneer.py /.gitattributes: -------------------------------------------------------------------------------- 1 | modin_spreadsheet/_version.py export-subst 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Environment 2 | 3 | * Operating System: 4 | * Python Version: `$ python --version` 5 | * How did you install modin-spreadsheet: (`pip`, `conda`, or `other (please explain)`) 6 | * Python packages: `$ pip freeze` or `$ conda list` (please include modin-spreadsheet, notebook, and jupyterlab versions) 7 | * Jupyter lab packages (if applicable): `$ jupyter labextension list` 8 | 9 | ### Description of Issue 10 | 11 | * What did you expect to happen? 12 | * What happened instead? 13 | 14 | ### Reproduction Steps 15 | 16 | 1. 17 | 2. 18 | 3. 19 | ... 20 | 21 | ### What steps have you taken to resolve this already? 22 | 23 | ... 24 | 25 | ### Anything else? 26 | 27 | ... 28 | -------------------------------------------------------------------------------- /.github/release-drafter-config.yml: -------------------------------------------------------------------------------- 1 | name-template: 'v$NEXT_PATCH_VERSION 🌈' 2 | tag-template: 'v$NEXT_PATCH_VERSION' 3 | template: | 4 | ## What’s Changed 5 | 6 | $CHANGES -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | build: 13 | 14 | runs-on: ${{ matrix.os }} 15 | strategy: 16 | fail-fast: false 17 | matrix: 18 | os: [ubuntu-latest] 19 | python-version: [2.7, 3.5, 3.7, 3.8] 20 | include: 21 | - python-version: 2.7 22 | pandas: 0.18.1 23 | numpy: 1.11.3 24 | - python-version: 3.5 25 | pandas: 0.18.1 26 | numpy: 1.11.3 27 | - python-version: 3.7 28 | pandas: 1.0.1 29 | numpy: 1.18.1 30 | - python-version: 3.8 31 | pandas: 1.0.1 32 | numpy: 1.18.1 33 | 34 | steps: 35 | - uses: actions/checkout@v1 36 | - name: Set up Python ${{ matrix.python-version }} 37 | uses: actions/setup-python@v1 38 | with: 39 | python-version: ${{ matrix.python-version }} 40 | - uses: actions/cache@v1 41 | with: 42 | path: ~/.cache/pip 43 | key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pandas }}-${{ matrix.numpy }}-pip-${{ hashFiles('**/setup.py') }} 44 | - name: Install dependencies 45 | env: 46 | PYTHONWARNINGS: ignore:DEPRECATION::pip._internal.cli.base_command 47 | run: | 48 | python -m pip install --upgrade pip 49 | pip install pandas==${{ matrix.pandas }} numpy==${{ matrix.numpy }} 50 | pip install -e .[test] 51 | - name: Lint with flake8 52 | run: | 53 | flake8 54 | - name: Run the tests 55 | run: | 56 | pytest -------------------------------------------------------------------------------- /.github/workflows/master-merge.yml: -------------------------------------------------------------------------------- 1 | name: On Master Merge 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | draft-release-publish: 10 | name: Draft a new release 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Drafts your next Release notes as Pull Requests are merged into "master" 14 | - uses: release-drafter/release-drafter@v5 15 | with: 16 | config-name: release-drafter-config.yml 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Publish Python 🐍 distributions 📦 to PyPI 2 | on: 3 | release: 4 | types: [published] 5 | 6 | jobs: 7 | build-n-publish: 8 | name: Build and publish Python 🐍 distributions 📦 to TestPyPI 9 | runs-on: ubuntu-18.04 10 | steps: 11 | - uses: actions/checkout@master 12 | - name: Set up Python 3.7 13 | uses: actions/setup-python@v1 14 | with: 15 | python-version: 3.7 16 | 17 | - name: Build sdist 18 | run: python setup.py sdist 19 | 20 | - name: Publish distribution 📦 to Test PyPI 21 | uses: pypa/gh-action-pypi-publish@master 22 | with: 23 | password: ${{ secrets.test_pypi_password }} 24 | repository_url: https://test.pypi.org/legacy/ 25 | 26 | - name: Install from test and test running 27 | run: | 28 | python -m pip install --upgrade pip 29 | pip install --extra-index-url https://test.pypi.org/simple modin-spreadsheet 30 | python -c 'import modin_spreadsheet;print(modin_spreadsheet.__version__)' 31 | pip uninstall -y modin-spreadsheet 32 | 33 | - name: Publish distribution 📦 to PyPI 34 | uses: pypa/gh-action-pypi-publish@master 35 | with: 36 | password: ${{ secrets.pypi_password }} 37 | 38 | - name: Install and test running 39 | run: | 40 | pip install modin-spreadsheet 41 | python -c 'import modin_spreadsheet;print(modin_spreadsheet.__version__)' 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Python 2 | *.pyc 3 | # IntelliJ IDEA (IDE-related files) 4 | *.iml 5 | .idea/* 6 | .ipynb_checkpoints 7 | 8 | # Setuptools. 9 | dist 10 | *.egg-info 11 | 12 | # pytest 13 | .cache/* 14 | .pytest_cache/* 15 | 16 | # Jupyter notebook 17 | jupyterhub.sqlite 18 | jupyterhub_cookie_secret 19 | index.ipynb 20 | 21 | docs/_build/* 22 | 23 | build/ 24 | *.py[cod] 25 | node_modules/ 26 | package-lock.json 27 | js/package-lock.json 28 | jslab/package-lock.json 29 | 30 | # Compiled javascript 31 | modin_spreadsheet/static/ 32 | 33 | # OS X 34 | .DS_Store 35 | 36 | # Other 37 | site-packages/ 38 | env/ 39 | dask-worker-space/ 40 | .vscode -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | Contributing to Modin-spreadsheet 2 | ================================== 3 | For developers of modin-spreadsheet, people who want to contribute to the modin-spreadsheet codebase or documentation, or people who want 4 | to install from source and make local changes to their copy of modin-spreadsheet, please refer to the 5 | `Running from source & testing your changes`__ section of the `README`__ page for this repository. 6 | 7 | All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome. 8 | We `track issues`__ on `GitHub`__ and that's also the best place to ask any questions you may have. 9 | 10 | __ https://github.com/modin-project/modin-spreadsheet#running-from-source--testing-your-changes 11 | __ https://github.com/modin-project/modin-spreadsheet 12 | __ https://github.com/modin-project/modin-spreadsheet/issues 13 | __ https://github.com/ 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2018 Quantopian, Inc. 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst 2 | include LICENSE 3 | include requirements*.txt 4 | 5 | recursive-include modin_spreadsheet/static *.* 6 | include versioneer.py 7 | include modin_spreadsheet/_version.py 8 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | .. image:: https://github.com/modin-project/modin/blob/3d6368edf311995ad231ec5342a51cd9e4e3dc20/docs/img/MODIN_ver2_hrz.png?raw=true 2 | :target: https://modin.readthedocs.io 3 | :width: 77% 4 | :align: center 5 | :alt: Modin 6 | 7 | ================= 8 | Modin-spreadsheet 9 | ================= 10 | Modin-spreadsheet is the underlying package for the `Modin `_ Spreadsheet API. It renders 11 | DataFrames within a Jupyter notebook as a spreadsheet and makes it easy to explore with intuitive scrolling, sorting, 12 | and filtering controls. The spreadsheet allows click editing, adding/removing rows, etc. and can also be controlled 13 | using the API. Modin-spreadsheet also records the history of changes made so that you can share or reproduce your 14 | results. 15 | 16 | Modin-spreadsheet builds on top of `SlickGrid `_ and Modin to provide a highly 17 | responsive experience even on DataFrames with 100,000 rows. 18 | 19 | Modin-spreadsheet is forked from `Qgrid `_, which was developed by Quantopian. 20 | Some documentation will reference Qgrid documentation as we continue to build out our own documentation. To learn more 21 | about Qgrid, here is an `introduction on YouTube `_. 22 | 23 | Here is an example of the Modin-spreadsheet widget in action. 24 | 25 | .. figure:: docs/images/overview_demo.gif 26 | :align: left 27 | :target: docs/images/overview_demo.gif 28 | :width: 200px 29 | 30 | A brief demo showing the common use cases for Modin-spreadsheet: filtering, editing, sorting, generating 31 | reproducible code, and exporting the changed dataframe 32 | 33 | API Documentation 34 | ----------------- 35 | Full documentation for Modin-spreadsheet is still in progress. Most features are documented on Qgrid's readthedocs: `https://qgrid.readthedocs.io/ `_. 36 | 37 | Installation 38 | ------------ 39 | Modin-spreadsheet is intended be used through the `Modin Spreadsheet API `_ (Docs in progress...). Please install Modin and Modin-spreadsheet by running the following: :: 40 | 41 | pip install modin 42 | pip install modin[spreadsheet] 43 | 44 | To enable the Modin-spreadsheet widget, you may need to also run:: 45 | 46 | jupyter nbextension enable --py --sys-prefix modin_spreadsheet 47 | 48 | # only required if you have not enabled the ipywidgets nbextension yet 49 | jupyter nbextension enable --py --sys-prefix widgetsnbextension 50 | 51 | If needed, Modin-spreadsheet can be installed through PyPi. :: 52 | 53 | pip install modin-spreadsheet 54 | 55 | Features 56 | ---------- 57 | **Column-specific options**: 58 | The feature enables the ability to set options on a per column basis. This allows you to do things like explicitly 59 | specify which column should be sortable, editable, etc. For example, if you wanted to prevent editing on all columns 60 | except for a column named `'A'`, you could do the following:: 61 | 62 | col_opts = { 'editable': False } 63 | col_defs = { 'A': { 'editable': True } } 64 | modin_spreadsheet.show_grid(df, column_options=col_opts, column_definitions=col_defs) 65 | 66 | See the `show_grid `_ documentation for more information. 67 | 68 | **Disable editing on a per-row basis**: 69 | This feature allows a user to specify whether or not a particular row should be editable. For example, to make it so 70 | only rows in the grid where the `'status'` column is set to `'active'` are editable, you might use the following code:: 71 | 72 | def can_edit_row(row): 73 | return row['status'] == 'active' 74 | 75 | modin_spreadsheet.show_grid(df, row_edit_callback=can_edit_row) 76 | 77 | **Dynamically update an existing spreadsheet widget**: 78 | These API allow users to programmatically update the state of an existing spreadsheet widget: 79 | 80 | - `edit_cell `_ 81 | - `change_selection `_ 82 | - `toggle_editable `_ 83 | - `change_grid_option `_ (experimental) 84 | 85 | **MultiIndex Support**: 86 | Modin-spreadsheet displays multi-indexed DataFrames with some of the index cells merged for readability, as is normally 87 | done when viewing DataFrames as a static html table. The following image shows Modin-spreadsheet displaying a 88 | multi-indexed DataFrame: 89 | 90 | .. figure:: https://s3.amazonaws.com/quantopian-forums/pipeline_with_qgrid.png 91 | :align: left 92 | :target: https://s3.amazonaws.com/quantopian-forums/pipeline_with_qgrid.png 93 | :width: 100px 94 | 95 | Disclaimer: This is from the Qgrid documentation. 96 | 97 | **Events API**: 98 | The Events API provides ``on`` and ``off`` methods which can be used to attach/detach event handlers. They're available 99 | on both the ``modin_spreadsheet`` module (see `qgrid.on `_), and on 100 | individual SpreadsheetWidget instances (see `qgrid.QgridWidget.on `_). 101 | 102 | Having the ability to attach event handlers allows us to do some interesting things in terms of using Modin-spreadsheet 103 | in conjunction with other widgets/visualizations. One example is using Modin-spreadsheet to filter a DataFrame that's 104 | also being displayed by another visualization. 105 | 106 | Here's how you would use the ``on`` method to print the DataFrame every time there's a change made:: 107 | 108 | def handle_json_updated(event, spreadsheet_widget): 109 | # exclude 'viewport_changed' events since that doesn't change the DataFrame 110 | if (event['triggered_by'] != 'viewport_changed'): 111 | print(spreadsheet_widget.get_changed_df()) 112 | 113 | spreadsheet_widget.on('json_updated', handle_json_updated) 114 | 115 | Here are some examples of how the Events API can be applied. 116 | 117 | This shows how you can use Modin-spreadsheet to filter the data that's being shown by a matplotlib scatter plot: 118 | 119 | .. figure:: docs/images/linked_to_scatter.gif 120 | :align: left 121 | :target: docs/images/linked_to_scatter.gif 122 | :width: 600px 123 | 124 | Disclaimer: This is from the Qgrid documentation. 125 | 126 | This shows how events are recorded in real-time. The demo is recorded on JupyterLab, which is not yet supported, but 127 | the functionality is the same on Jupyter Notebook. 128 | 129 | .. figure:: docs/images/events_api.gif 130 | :align: left 131 | :target: docs/images/events_api.gif 132 | :width: 600px 133 | 134 | Disclaimer: This is from the Qgrid documentation. 135 | 136 | Running from source & testing your changes 137 | ------------------------------------------ 138 | 139 | If you'd like to contribute to Modin-spreadsheet, or just want to be able to modify the source code for your own purposes, you'll 140 | want to clone this repository and run Modin-spreadsheet from your local copy of the repository. The following steps explain how 141 | to do this. 142 | 143 | #. Clone the repository from GitHub and ``cd`` into the top-level directory:: 144 | 145 | git clone https://github.com/modin-project/modin-spreadsheet.git 146 | cd modin-spreadsheet 147 | 148 | #. Install the current project in `editable `_ 149 | mode:: 150 | 151 | pip install -e . 152 | 153 | #. Install the node packages that Modin-spreadsheet depends on and build Modin-spreadsheet's javascript using webpack:: 154 | 155 | cd js && npm install . 156 | 157 | #. Install and enable Modin-spreadsheet's javascript in your local jupyter notebook environment:: 158 | 159 | jupyter nbextension install --py --symlink --sys-prefix modin_spreadsheet && jupyter nbextension enable --py --sys-prefix modin_spreadsheet 160 | 161 | #. Run the notebook as you normally would with the following command:: 162 | 163 | jupyter notebook 164 | 165 | Manually testing server-side changes 166 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 167 | If the code you need to change is in Modin-spreadsheet's python code, then restart the kernel of the notebook you're in and 168 | rerun any Modin-spreadsheet cells to see your changes take effect. 169 | 170 | Manually testing client-side changes 171 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 172 | If the code you need to change is in Modin-spreadsheet's javascript or css code, repeat step 3 to rebuild Modin-spreadsheet's npm package, 173 | then refresh the browser tab where you're viewing your notebook to see your changes take effect. 174 | 175 | Running automated tests 176 | ^^^^^^^^^^^^^^^^^^^^^^^ 177 | There is a small python test suite which can be run locally by running the command ``pytest`` in the root folder 178 | of the repository. 179 | 180 | Contributing 181 | ------------ 182 | All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. See the 183 | `Running from source & testing your changes`_ section above for more details on local Modin-spreadsheet development. 184 | 185 | If you are looking to start working with the Modin-spreadsheet codebase, navigate to the GitHub issues tab and start looking 186 | through interesting issues. 187 | 188 | Feel free to ask questions by submitting an issue with your question. 189 | -------------------------------------------------------------------------------- /docs/images/events_api.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modin-project/modin-spreadsheet/49ffd89f683f54c311867d602c55443fb11bf2a5/docs/images/events_api.gif -------------------------------------------------------------------------------- /docs/images/linked_to_scatter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modin-project/modin-spreadsheet/49ffd89f683f54c311867d602c55443fb11bf2a5/docs/images/linked_to_scatter.gif -------------------------------------------------------------------------------- /docs/images/overview_demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modin-project/modin-spreadsheet/49ffd89f683f54c311867d602c55443fb11bf2a5/docs/images/overview_demo.gif -------------------------------------------------------------------------------- /examples/tutorial.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "attachments": { 5 | "image.png": { 6 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAsYAAACMCAYAAAB/NG+WAAAgAElEQVR4Ae2dCXhT15n3/+mSrUmTgCV5MrRNE4PvdTrzdUn6zXTaDk0nnel0Op2v07QzYYkBs682OyEpYQkhe9jJwg4JDpCwJMGBYDZbtmRjG+MYsMGLvGDL4A3jRZbP95yrK0e2JVm6V8uVefU8/0fSvVdX5/zO0dVfR+e8L0A3IkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkA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AEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACISMwP8Hv7YTqXgBBUUAAAAASUVORK5CYII=" 7 | } 8 | }, 9 | "cell_type": "markdown", 10 | "metadata": {}, 11 | "source": [ 12 | "![image.png](attachment:image.png)" 13 | ] 14 | }, 15 | { 16 | "cell_type": "markdown", 17 | "metadata": {}, 18 | "source": [ 19 | "## Modin-spreadsheet\n", 20 | "Modin-spreadsheet is a Jupyter notebook widget that allows users to interact with Modin DataFrames in a spreadsheet-like fashion while taking advantage of the underlying capabilities of Modin. The widget makes it quick and easy to explore, sort, filter, edit data and export reproducible code. \n", 21 | "\n", 22 | "This tutorial will showcase how to use modin-spreadsheet. To follow along, just run the cells; no editing required!" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": null, 28 | "metadata": {}, 29 | "outputs": [], 30 | "source": [ 31 | "# This notebook expects that Modin and Ray are installed, e.g. by `pip install modin[ray]`.\n", 32 | "# For all ways to install Modin see official documentation at:\n", 33 | "# https://modin.readthedocs.io/en/latest/installation.html\n", 34 | "import modin.pandas as pd\n", 35 | "\n", 36 | "# modin-spreadsheet is the pip distribution name, modin_spreadsheet is the import name\n", 37 | "import modin_spreadsheet" 38 | ] 39 | }, 40 | { 41 | "cell_type": "markdown", 42 | "metadata": {}, 43 | "source": [ 44 | "### Create a Modin DataFrame\n", 45 | "The following cells creates a DataFrame using a NYC taxi dataset." 46 | ] 47 | }, 48 | { 49 | "cell_type": "code", 50 | "execution_count": null, 51 | "metadata": {}, 52 | "outputs": [], 53 | "source": [ 54 | "columns_names = [\n", 55 | " \"trip_id\", \"vendor_id\", \"pickup_datetime\", \"dropoff_datetime\", \"store_and_fwd_flag\",\n", 56 | " \"rate_code_id\", \"pickup_longitude\", \"pickup_latitude\", \"dropoff_longitude\", \"dropoff_latitude\",\n", 57 | " \"passenger_count\", \"trip_distance\", \"fare_amount\", \"extra\", \"mta_tax\", \"tip_amount\",\n", 58 | " \"tolls_amount\", \"ehail_fee\", \"improvement_surcharge\", \"total_amount\", \"payment_type\",\n", 59 | " \"trip_type\", \"pickup\", \"dropoff\", \"cab_type\", \"precipitation\", \"snow_depth\", \"snowfall\",\n", 60 | " \"max_temperature\", \"min_temperature\", \"average_wind_speed\", \"pickup_nyct2010_gid\",\n", 61 | " \"pickup_ctlabel\", \"pickup_borocode\", \"pickup_boroname\", \"pickup_ct2010\",\n", 62 | " \"pickup_boroct2010\", \"pickup_cdeligibil\", \"pickup_ntacode\", \"pickup_ntaname\", \"pickup_puma\",\n", 63 | " \"dropoff_nyct2010_gid\", \"dropoff_ctlabel\", \"dropoff_borocode\", \"dropoff_boroname\",\n", 64 | " \"dropoff_ct2010\", \"dropoff_boroct2010\", \"dropoff_cdeligibil\", \"dropoff_ntacode\",\n", 65 | " \"dropoff_ntaname\", \"dropoff_puma\",\n", 66 | " ]\n", 67 | "parse_dates=[\"pickup_datetime\", \"dropoff_datetime\"]" 68 | ] 69 | }, 70 | { 71 | "cell_type": "code", 72 | "execution_count": null, 73 | "metadata": {}, 74 | "outputs": [], 75 | "source": [ 76 | "df = pd.read_csv('https://modin-datasets.s3.amazonaws.com/trips_data.csv', names=columns_names,\n", 77 | " header=None, parse_dates=parse_dates)" 78 | ] 79 | }, 80 | { 81 | "cell_type": "code", 82 | "execution_count": null, 83 | "metadata": { 84 | "scrolled": true 85 | }, 86 | "outputs": [], 87 | "source": [ 88 | "df" 89 | ] 90 | }, 91 | { 92 | "cell_type": "markdown", 93 | "metadata": {}, 94 | "source": [ 95 | "### Generate a spreadsheet widget with the DataFrame\n", 96 | "`modin-spreadsheet.show_grid` takes in a DataFrame, optional configuration options, and returns a `SpreadsheetWidget`, which contains all the logic for displaying the spreadsheet view of the DataFrame. The object returned will not be rendered unless displayed." 97 | ] 98 | }, 99 | { 100 | "cell_type": "code", 101 | "execution_count": null, 102 | "metadata": {}, 103 | "outputs": [], 104 | "source": [ 105 | "spreadsheet = modin_spreadsheet.show_grid(df, show_toolbar=True, grid_options={'forceFitColumns': False})" 106 | ] 107 | }, 108 | { 109 | "cell_type": "markdown", 110 | "metadata": {}, 111 | "source": [ 112 | "### Displaying the Spreadsheet\n", 113 | "The widget is displayed when the widget is returned by an input cell or passed to the `display` function e.g. `display(spreadsheet)`. When displayed, the SpreadsheetWidget will generate a transformation history cell that contains a record of the transformations applied to the DataFrame unless the cell already exists or the feature is disabled.\n", 114 | "\n", 115 | "### Basic Usage\n", 116 | "`Modin-spreadsheet` creates a copy of the input DataFrame, so changes do not alter the original DataFrame.\n", 117 | "\n", 118 | "**Filter** - Each column can be filtered according to its datatype using the filter button to the right of the column header. Any number of columns can be filtered simultaneously.\\\n", 119 | "**Sort** - Each column can be sorted by clicking on the column header. Assumptions on the order of the data should only be made according to the latest sort i.e. the 2nd last sort may not be in order even if grouped by the duplicates in the last sorted column.\\\n", 120 | "**Cell Edit** - Double click on a cell to edit its value.\\\n", 121 | "**Add Row**(toolbar) - Click on the `Add Row` button in the toolbar to duplicate the last row in the DataFrame.\\\n", 122 | "**Remove Row**(toolbar) - Select row(s) on the spreadsheet and click the `Remove Row` button in the toolbar to remove them.\\\n", 123 | "**Reset Filters**(toolbar) - Click on the `Reset Filters` button in the toolbar to remove all filters on the data.\\\n", 124 | "**Reset Sort**(toolbar) - Click on the `Reset Sort` button in the toolbar to remove any sorting on the data.\n", 125 | "\n", 126 | "### Transformation History and Reproducible Code\n", 127 | "The widget records the history of transformations, such as filtering, that occur on the spreadsheet. These transformations are updated in the `spreadsheet transformation history` cell as they happen and can be easily copied for reproducibility. The history can be cleared using the `Clear History` button in the toolbar.\n", 128 | "\n", 129 | "**Try making some changes to the spreadsheet!**" 130 | ] 131 | }, 132 | { 133 | "cell_type": "code", 134 | "execution_count": null, 135 | "metadata": { 136 | "scrolled": true 137 | }, 138 | "outputs": [], 139 | "source": [ 140 | "spreadsheet" 141 | ] 142 | }, 143 | { 144 | "cell_type": "markdown", 145 | "metadata": {}, 146 | "source": [ 147 | "## Modin-spreadsheet API\n", 148 | "The API on `SpreadsheetWidget` allows users to duplicate some of the functionality on the GUI, but also provides other functionality such as applying the history on another DataFrame or getting the DataFrame that matches the spreadsheet state." 149 | ] 150 | }, 151 | { 152 | "cell_type": "code", 153 | "execution_count": null, 154 | "metadata": {}, 155 | "outputs": [], 156 | "source": [ 157 | "# Duplicates the `Reset Filters` button\n", 158 | "spreadsheet.reset_filters()" 159 | ] 160 | }, 161 | { 162 | "cell_type": "code", 163 | "execution_count": null, 164 | "metadata": {}, 165 | "outputs": [], 166 | "source": [ 167 | "# Duplicates the `Reset Sort` button\n", 168 | "spreadsheet.reset_sort()" 169 | ] 170 | }, 171 | { 172 | "cell_type": "code", 173 | "execution_count": null, 174 | "metadata": { 175 | "qgrid6f69f373-ae0e-423e-8e26-429f52e1669d": true 176 | }, 177 | "outputs": [], 178 | "source": [ 179 | "# Duplicates the `Clear History` button\n", 180 | "spreadsheet.clear_history()" 181 | ] 182 | }, 183 | { 184 | "cell_type": "code", 185 | "execution_count": null, 186 | "metadata": {}, 187 | "outputs": [], 188 | "source": [ 189 | "# Gets the modified DataFrame that matches the changes to the spreadsheet\n", 190 | "spreadsheet.get_changed_df()" 191 | ] 192 | }, 193 | { 194 | "cell_type": "markdown", 195 | "metadata": {}, 196 | "source": [ 197 | "### Retrieving and Applying Transformation History \n", 198 | "The transformation history can be retrieved as a list of code snippets using the `get_history` API. The `apply_history` API will apply the transformations on the input DataFrame and return the resultant DataFrame." 199 | ] 200 | }, 201 | { 202 | "cell_type": "code", 203 | "execution_count": null, 204 | "metadata": { 205 | "scrolled": false 206 | }, 207 | "outputs": [], 208 | "source": [ 209 | "spreadsheet.get_history()" 210 | ] 211 | }, 212 | { 213 | "cell_type": "code", 214 | "execution_count": null, 215 | "metadata": {}, 216 | "outputs": [], 217 | "source": [ 218 | "another_df = df.copy()\n", 219 | "spreadsheet.apply_history(another_df)" 220 | ] 221 | } 222 | ], 223 | "metadata": { 224 | "kernelspec": { 225 | "display_name": "Python 3", 226 | "language": "python", 227 | "name": "python3" 228 | }, 229 | "language_info": { 230 | "codemirror_mode": { 231 | "name": "ipython", 232 | "version": 3 233 | }, 234 | "file_extension": ".py", 235 | "mimetype": "text/x-python", 236 | "name": "python", 237 | "nbconvert_exporter": "python", 238 | "pygments_lexer": "ipython3", 239 | "version": "3.8.5" 240 | } 241 | }, 242 | "nbformat": 4, 243 | "nbformat_minor": 4 244 | } 245 | -------------------------------------------------------------------------------- /js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "modin_spreadsheet", 3 | "version": "0.1.1", 4 | "description": "An implementation for the Spreadsheet API of Modin", 5 | "author": "Modin Maintainers", 6 | "main": "src/index.js", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/modin-project/modin-spreadsheet" 10 | }, 11 | "keywords": [ 12 | "jupyter", 13 | "widgets", 14 | "ipython", 15 | "ipywidgets" 16 | ], 17 | "scripts": { 18 | "clean": "rimraf dist/", 19 | "prepare": "webpack", 20 | "test": "echo \"Error: no test specified\" && exit 1" 21 | }, 22 | "devDependencies": { 23 | "css-loader": "^3.4.2", 24 | "expose-loader": "^0.7.5", 25 | "file-loader": "^6.0.0", 26 | "jshint": "^2.11.0", 27 | "json-loader": "^0.5.7", 28 | "rimraf": "^3.0.2", 29 | "style-loader": "^1.1.3", 30 | "webpack": "^4.42.0", 31 | "webpack-cli": "^3.3.11" 32 | }, 33 | "dependencies": { 34 | "@jupyter-widgets/base": "^1.1 || ^2 || ^3", 35 | "@jupyter-widgets/controls": "^1 || ^2", 36 | "jquery": "^3.2.1", 37 | "jquery-ui-dist": "^1.12.1", 38 | "moment": "^2.24.0", 39 | "slickgrid-qgrid": "0.0.5", 40 | "underscore": "^1.9.2" 41 | }, 42 | "jshintConfig": { 43 | "esversion": 6 44 | }, 45 | "files": [ 46 | "dist/", 47 | "src/" 48 | ], 49 | "jupyterlab": { 50 | "extension": "src/jupyterlab-plugin" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /js/src/embed.js: -------------------------------------------------------------------------------- 1 | // Entry point for the unpkg bundle containing custom model definitions. 2 | // 3 | // It differs from the notebook bundle in that it does not need to define a 4 | // dynamic baseURL for the static assets and may load some css that would 5 | // already be loaded by the notebook otherwise. 6 | 7 | // Export widget models and views, and the npm package version number. 8 | module.exports = require('./spreadsheet.widget.js'); 9 | module.exports.version = require('../package.json').version; 10 | -------------------------------------------------------------------------------- /js/src/extension.js: -------------------------------------------------------------------------------- 1 | // This file contains the javascript that is run when the notebook is loaded. 2 | // It contains some requirejs configuration and the `load_ipython_extension` 3 | // which is required for any notebook extension. 4 | 5 | // Configure requirejs 6 | if (window.require) { 7 | window.require.config({ 8 | map: { 9 | "*" : { 10 | "modin_spreadsheet": "nbextensions/modin_spreadsheet/index" 11 | } 12 | } 13 | }); 14 | } 15 | 16 | // Export the required load_ipython_extension 17 | module.exports = { 18 | load_ipython_extension: function() {} 19 | }; 20 | -------------------------------------------------------------------------------- /js/src/index.js: -------------------------------------------------------------------------------- 1 | // Entry point for the notebook bundle containing custom model definitions. 2 | // Export widget models and views, and the npm package version number. 3 | module.exports = require('./spreadsheet.widget.js'); 4 | module.exports.version = require('../package.json').version; 5 | -------------------------------------------------------------------------------- /js/src/jupyterlab-plugin.js: -------------------------------------------------------------------------------- 1 | var modin_spreadsheet = require('./index'); 2 | 3 | var base = require('@jupyter-widgets/base'); 4 | 5 | /** 6 | * The widget manager provider. 7 | */ 8 | module.exports = { 9 | id: 'modin_spreadsheet', 10 | requires: [base.IJupyterWidgetRegistry], 11 | activate: function(app, widgets) { 12 | widgets.registerWidget({ 13 | name: 'modin_spreadsheet', 14 | version: modin_spreadsheet.version, 15 | exports: modin_spreadsheet 16 | }); 17 | }, 18 | autoStart: true 19 | }; 20 | -------------------------------------------------------------------------------- /js/src/spreadsheet.booleanfilter.js: -------------------------------------------------------------------------------- 1 | var $ = require('jquery'); 2 | var filter_base = require('./spreadsheet.filterbase.js'); 3 | 4 | class BooleanFilter extends filter_base.FilterBase { 5 | 6 | get_filter_html() { 7 | return ` 8 |
9 |

10 | 11 | 12 |

13 | 26 | 29 |
30 | `; 31 | } 32 | 33 | update_min_max(col_info, has_active_filter) { 34 | this.values = col_info.values; 35 | this.length = col_info.length; 36 | if('filter_info' in col_info){ 37 | this.selected = col_info.filter_info.selected; 38 | } else { 39 | this.selected = null; 40 | } 41 | this.show_filter(); 42 | } 43 | 44 | initialize_controls() { 45 | super.initialize_controls(); 46 | this.radio_buttons = this.filter_elem.find('.bool-filter-radio'); 47 | 48 | this.filter_elem.find('label').click((e) => { 49 | var radio_id = $(e.currentTarget).attr('for'); 50 | this.radio_buttons.filter(`#${radio_id}`).click(); 51 | }); 52 | 53 | if (this.selected == null) { 54 | this.radio_buttons.prop('checked', false); 55 | } else { 56 | this.radio_buttons.filter( 57 | `#radio-${this.selected}` 58 | ).prop('checked', true); 59 | } 60 | 61 | this.radio_buttons.change(() => { 62 | var checked_radio = this.radio_buttons.filter(':checked'); 63 | var old_selected_value = this.selected; 64 | if (checked_radio.length == 0) { 65 | this.selected = null; 66 | } else { 67 | this.selected = checked_radio.val() == 'true'; 68 | } 69 | if (this.selected != old_selected_value) { 70 | this.send_filter_changed(); 71 | } 72 | }); 73 | } 74 | 75 | is_active() { 76 | return this.selected != null; 77 | } 78 | 79 | reset_filter() { 80 | this.radio_buttons.prop('checked', false); 81 | this.selected = null; 82 | this.send_filter_changed(); 83 | } 84 | 85 | get_filter_info() { 86 | return { 87 | "field": this.field, 88 | "type": "boolean", 89 | "selected": this.selected 90 | }; 91 | } 92 | } 93 | 94 | module.exports = {'BooleanFilter': BooleanFilter}; 95 | -------------------------------------------------------------------------------- /js/src/spreadsheet.css: -------------------------------------------------------------------------------- 1 | 2 | .spreadsheet-container * { 3 | -webkit-box-sizing: content-box; 4 | -moz-box-sizing: content-box; 5 | box-sizing: content-box; 6 | } 7 | 8 | .spreadsheet-container { 9 | position: relative; 10 | overflow-x: auto; 11 | width: auto; 12 | height: auto; 13 | border-radius: 4px; 14 | } 15 | 16 | .spreadsheet-container .hidden { 17 | display: none !important; 18 | } 19 | 20 | .spreadsheet-container a { 21 | color: #337ab7 !important; 22 | text-decoration: none; 23 | line-height: 20px; 24 | } 25 | 26 | .spreadsheet-container a:hover, 27 | .spreadsheet-container a:focus { 28 | color: #23527c; 29 | text-decoration: underline; 30 | } 31 | 32 | .spreadsheet-grid { 33 | position: relative; 34 | border: 1px solid #d3d3d3; 35 | margin-top: 6px; 36 | margin-bottom: 2px; 37 | box-sizing: border-box; 38 | } 39 | 40 | .spreadsheet-toolbar { 41 | margin: 4px 0 42 | } 43 | 44 | .spreadsheet-toolbar .btn { 45 | background-color: #EEEEEE; 46 | border-color: #E0E0E0; 47 | margin-right: 6px; 48 | padding: 4px 40px; 49 | /* taken from bootstrap's btn class, since 50 | jupyterlab doesn't include bootstrap css */ 51 | display: inline-block; 52 | margin-bottom: 0; 53 | font-weight: normal; 54 | text-align: center; 55 | vertical-align: middle; 56 | touch-action: manipulation; 57 | cursor: pointer; 58 | background-image: none; 59 | border: 1px solid #E0E0E0; 60 | white-space: nowrap; 61 | font-size: 13px; 62 | line-height: 1.42857143; 63 | border-radius: 2px; 64 | } 65 | 66 | .spreadsheet-toolbar .btn:hover { 67 | background-color: #DDDDDD; 68 | border-color: #CCCCCC; 69 | } 70 | 71 | .spreadsheet-toolbar .btn:focus { 72 | outline: none; 73 | } 74 | 75 | .spreadsheet-toolbar .close-modal-btn { 76 | display: none; 77 | } 78 | 79 | .spreadsheet-modal .spreadsheet-toolbar .close-modal-btn { 80 | display: block; 81 | } 82 | 83 | .spreadsheet-modal .full-screen-btn, 84 | .spreadsheet-modal .modal-header, 85 | .spreadsheet-modal .modal-footer { 86 | display: none; 87 | } 88 | 89 | .spreadsheet-modal { 90 | width: 100%; 91 | height: 100%; 92 | margin: 0px; 93 | } 94 | 95 | .spreadsheet-modal .modal-dialog { 96 | position: absolute; 97 | top: 20px; 98 | left: 20px; 99 | bottom: 20px; 100 | right: 20px; 101 | margin: 0px; 102 | width: auto; 103 | height: auto; 104 | } 105 | 106 | .spreadsheet-modal .modal-content { 107 | position: absolute; 108 | left: 0px; 109 | right: 0px; 110 | top: 0px; 111 | bottom: 0px; 112 | } 113 | 114 | .spreadsheet-modal .modal-body { 115 | position: absolute; 116 | padding: 15px; 117 | top: 0px; 118 | left: 0px; 119 | bottom: 0px; 120 | right: 0px; 121 | } 122 | 123 | .spreadsheet-modal .modal-body button.close { 124 | margin-top: 7px; 125 | margin-right: 14px; 126 | } 127 | 128 | .spreadsheet-modal .spreadsheet-container { 129 | bottom: 25px; 130 | left: 20px; 131 | right: 20px; 132 | position: absolute; 133 | top: 15px; 134 | } 135 | 136 | .spreadsheet-modal .spreadsheet-grid { 137 | position: absolute; 138 | top: 33px; 139 | bottom: 0px; 140 | left: 0px; 141 | right: 0px; 142 | height: auto !important; 143 | } 144 | 145 | .spreadsheet-toolbar .full-screen-btn, 146 | .spreadsheet-toolbar .close-modal-btn { 147 | height: 18px; 148 | width: 12px; 149 | padding: 4px 7px; 150 | float: right; 151 | margin-right: 0px; 152 | } 153 | 154 | .output_scroll .spreadsheet-grid { 155 | height: 315px !important; 156 | } 157 | 158 | .spreadsheet-toolbar { 159 | display: none; 160 | } 161 | 162 | .show-toolbar .spreadsheet-toolbar { 163 | display: block; 164 | } 165 | 166 | .output_scroll .show-toolbar .spreadsheet-grid { 167 | height: 284px !important; 168 | } 169 | 170 | .spreadsheet-grid.force-fit-columns .slick-viewport { 171 | overflow-x: hidden !important; 172 | } 173 | 174 | .spreadsheet-grid.hide-scrollbar > .slick-header { 175 | margin-bottom: -1px; 176 | } 177 | 178 | .spreadsheet-grid.hide-scrollbar > .slick-viewport { 179 | overflow-y: hidden !important; 180 | height: 100%; 181 | } 182 | 183 | .spreadsheet-grid.hide-scrollbar.force-fit-columns > .slick-viewport { 184 | overflow: hidden !important; 185 | } 186 | 187 | .spreadsheet-grid.hide-scrollbar > .slick-viewport > .grid-canvas { 188 | margin-top: 1px; 189 | } 190 | 191 | .spreadsheet-grid .slick-header { 192 | border-top: none; 193 | border-left: none; 194 | border-right: none; 195 | } 196 | 197 | .spreadsheet-grid .slick-header-columns, 198 | .text-filter-grid .slick-header-columns { 199 | background: none; 200 | background-color: rgb(245, 245, 245); 201 | border-bottom: none; 202 | } 203 | 204 | .spreadsheet-grid.force-fit-columns .slick-header-column:last-child .filter-button:hover, 205 | .spreadsheet-grid.force-fit-columns .slick-header-column.active:last-child .filter-button, 206 | .spreadsheet-grid.force-fit-columns .slick-header-column:last-child .filter-button.filter-active { 207 | border-right: 1px solid #ccc; 208 | margin-right: -4px; 209 | } 210 | 211 | .spreadsheet-grid.force-fit-columns .slick-header-column:last-child .filter-button { 212 | margin-right: -4px; 213 | border-right: 1px solid transparent; 214 | } 215 | 216 | .spreadsheet-grid.hide-scrollbar .slick-header-column:last-child .slick-resizable-handle { 217 | right: -4px; 218 | } 219 | 220 | .spreadsheet-grid.hide-scrollbar > .slick_header .slick-header-column:last-child .filter-button, 221 | .spreadsheet-grid.hide-scrollbar > .slick-header .slick-header-column:last-child .filter-button:hover, 222 | .spreadsheet-grid.hide-scrollbar > .slick-header .slick-header-column.active:last-child .filter-button:hover, 223 | .spreadsheet-grid.hide-scrollbar > .slick-header .slick-header-column.active:last-child .filter-button.filter-active { 224 | border-right: 1px solid transparent; 225 | } 226 | 227 | .spreadsheet-grid .slick-header-column .filter-button.filter-active, 228 | .spreadsheet-grid .slick-header-column .filter-button.filter-active:hover{ 229 | background-color: #deeaf7; 230 | border-left: 1px solid #cccccc; 231 | } 232 | 233 | .spreadsheet-grid .slick-header-column { 234 | background: rgb(245, 245, 245); 235 | color: #565656; 236 | border-right-style: none; 237 | font-size: 13px; 238 | font-weight: bold; 239 | padding: 6px 2px !important; 240 | } 241 | 242 | .spreadsheet-grid .slick-header-column.active { 243 | background-color: #deeaf7; 244 | } 245 | 246 | .spreadsheet-grid .slick-header-column-sorted { 247 | font-style: inherit !important; 248 | } 249 | 250 | .spreadsheet-grid .slick-header-column:first-child .slick-column-name { 251 | margin-left: 6px !important; 252 | } 253 | 254 | .spreadsheet-grid .slick-sort-indicator { 255 | height: 8px !important; 256 | margin-left: 6px; 257 | } 258 | 259 | .spreadsheet-grid .slick-sort-indicator.fa-sort-asc { 260 | margin-top: 4px; 261 | color: #5862ff; 262 | } 263 | 264 | .spreadsheet-grid .slick-sort-indicator.fa-sort-desc { 265 | margin-top: 1px; 266 | color: #5862ff; 267 | } 268 | 269 | .spreadsheet-grid .slick-sort-indicator.fa-spinner { 270 | height: auto !important;; 271 | width: auto !important;; 272 | margin-top: 3px; 273 | } 274 | 275 | .spreadsheet-grid .fa-check { 276 | color: #17a700; 277 | } 278 | 279 | .spreadsheet-grid .slick-column-name { 280 | margin-bottom: 0px; 281 | float: left; 282 | } 283 | 284 | .spreadsheet-grid .slick-resizable-handle { 285 | width: 1px; 286 | background-color: #c5c5c5; 287 | border-left: 3px solid rgb(245, 245, 245); 288 | border-right: 3px solid rgb(245, 245, 245); 289 | } 290 | 291 | .spreadsheet-grid .slick-resizable-handle.active { 292 | border-right-color: #deeaf7; 293 | } 294 | 295 | .spreadsheet-grid .slick-cell { 296 | border-bottom: 1px solid #e1e8ed; 297 | border-right: none; 298 | border-left: 1px solid transparent; 299 | font-size: 13px; 300 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 301 | padding-left: 0px; 302 | padding-top: 4px; 303 | border-top: none; 304 | } 305 | 306 | .spreadsheet-grid.highlight-selected-row .slick-cell.selected { 307 | background-color: #deeaf7; 308 | } 309 | 310 | .spreadsheet-grid.highlight-selected-cell .slick-cell.active { 311 | border: 2px solid rgb(65, 165, 245); 312 | padding-top: 2px; 313 | padding-bottom: 1px; 314 | padding-left: 3px; 315 | } 316 | 317 | .spreadsheet-grid .slick-cell.editable:not(.idx-col) { 318 | border: 2px solid rgb(65, 165, 245); 319 | padding-top: 2px; 320 | padding-bottom: 1px; 321 | padding-left: 3px !important; 322 | background-color: #FFF; 323 | -webkit-box-shadow: 0 2px 5px rgba(0,0,0,0.4); 324 | -moz-box-shadow: 0 2px 5px rgba(0,0,0,0.4); 325 | box-shadow: 0 2px 5px rgba(0,0,0,0.4); 326 | } 327 | 328 | .spreadsheet-grid .slick-cell.editable .editor-select:focus { 329 | outline-style: none; 330 | } 331 | 332 | .spreadsheet-grid .slick-cell.idx-col { 333 | font-weight: bold; 334 | margin-right: 3px; 335 | } 336 | 337 | .spreadsheet-grid .slick-cell.idx-col.last-idx-col { 338 | border-right: 1px solid rgb(225, 232, 237); 339 | } 340 | 341 | .spreadsheet-grid .slick-cell.idx-col:not(.first-idx-col) { 342 | font-weight: bold; 343 | border-left: 1px solid rgb(225, 232, 237); 344 | margin-right: 3px; 345 | } 346 | 347 | .spreadsheet-grid .idx-col.group-top { 348 | border-bottom-color: transparent; 349 | background-color: #FFF; 350 | } 351 | 352 | .spreadsheet-grid .idx-col.group-middle { 353 | border-top-color: transparent; 354 | border-bottom-color: transparent; 355 | color: transparent; 356 | background-color: #FFF; 357 | } 358 | 359 | .spreadsheet-grid .idx-col.group-bottom { 360 | border-top-color: transparent; 361 | color: transparent; 362 | background-color: #FFF; 363 | } 364 | 365 | .spreadsheet-grid .idx-col.group-single { 366 | background-color: transparent; 367 | } 368 | 369 | .spreadsheet-grid .slick-cell.l0.r0 { 370 | border-left: none; 371 | padding-left: 6px; 372 | z-index: 85; 373 | } 374 | 375 | .spreadsheet-grid .slick-cell.l1.r1 { 376 | z-index: 86; 377 | } 378 | 379 | .spreadsheet-grid .slick-cell.l2.r2 { 380 | z-index: 87; 381 | } 382 | 383 | .spreadsheet-grid .slick-cell.l3.r3 { 384 | z-index: 88; 385 | } 386 | 387 | .spreadsheet-grid .slick-cell.l4.r4 { 388 | z-index: 89; 389 | } 390 | 391 | .spreadsheet-grid .slick-cell.l5.r5 { 392 | z-index: 90; 393 | } 394 | 395 | .spreadsheet-grid .slick-cell.editable { 396 | z-index: 91 !important; 397 | } 398 | 399 | .spreadsheet-grid .slick-cell.selected { 400 | background-color: transparent; 401 | } 402 | 403 | /* Filter button */ 404 | 405 | .spreadsheet-grid .slick-header-column.active .filter-button, .filter-button:hover { 406 | background-color: #deeaf7; 407 | border-left: 1px solid #cccccc; 408 | } 409 | 410 | .spreadsheet-grid .slick-header-column.filter-button-disabled .filter-button { 411 | color: #bababa; 412 | } 413 | 414 | .spreadsheet-grid .filter-button { 415 | position: absolute; 416 | right: 4px; 417 | top: 0px; 418 | line-height: 29px; 419 | height: 28px; 420 | width: 21px; 421 | text-align: center; 422 | z-index: 10; 423 | background-image: none; 424 | margin-top: 0px; 425 | } 426 | 427 | .spreadsheet-grid .filter-button:hover { 428 | background-color: #efefef; 429 | border-left: 1px solid #cccccc; 430 | } 431 | 432 | /* Filter dropdowns */ 433 | 434 | .spreadsheet-container .grid-filter { 435 | z-index: 1000; 436 | position: absolute; 437 | padding: 0px; 438 | margin: 0px; 439 | max-height: 400px; 440 | display: block; 441 | border-radius: 0px; 442 | /* we previously got these style from bootstrap */ 443 | float: left; 444 | min-width: 160px; 445 | list-style: none; 446 | font-size: 13px; 447 | text-align: left; 448 | background-color: #fff; 449 | border: 1px solid rgba(0, 0, 0, 0.15); 450 | box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); 451 | background-clip: padding-box; 452 | } 453 | 454 | .spreadsheet-container .filter-error-msg { 455 | padding: 8px 14px; 456 | width: 160px; 457 | } 458 | 459 | .spreadsheet-container .grid-filter h3.spreadsheet-popover-title { 460 | padding: 5px 30px 5px 11px; 461 | border-bottom: 1px solid #d3d3d3; 462 | border-radius: 0px; 463 | /* we previously got these style from bootstrap */ 464 | margin: 0; 465 | font-size: 13px; 466 | background-color: #f7f7f7; 467 | font-family: inherit; 468 | font-weight: 500; 469 | line-height: 1.1; 470 | color: inherit; 471 | display: block; 472 | } 473 | 474 | .spreadsheet-container .grid-filter .dropdown-title { 475 | font-size: 13px; 476 | } 477 | 478 | .spreadsheet-container .grid-filter i.close-button { 479 | position: absolute; 480 | right: 11px; 481 | top: 7px; 482 | padding: 0; 483 | color: #ababab; 484 | cursor: pointer; 485 | background-image: none; 486 | margin-top: 0px; 487 | } 488 | 489 | .spreadsheet-container .grid-filter i.close-button:hover { 490 | color: #777777; 491 | } 492 | 493 | .spreadsheet-container .grid-filter .dropdown-footer { 494 | background-color: #f7f7f7; 495 | border-top: 1px solid #d3d3d3; 496 | padding: 4px 12px; 497 | height: 19px; 498 | } 499 | 500 | .spreadsheet-container .grid-filter .dropdown-footer a.reset-link { 501 | padding: 0px; 502 | float: right; 503 | } 504 | 505 | .spreadsheet-container .grid-filter .dropdown-footer a.select-all-link { 506 | padding: 0px; 507 | } 508 | 509 | .spreadsheet-container .date-range-filter .dropdown-body { 510 | margin: 15px 11px; 511 | width: 210px; 512 | } 513 | 514 | .spreadsheet-container .date-range-filter .start-date { 515 | margin-right: 4px; 516 | width: 80px; 517 | } 518 | 519 | .spreadsheet-container .date-range-filter .end-date { 520 | margin-left: 4px; 521 | width: 80px; 522 | } 523 | 524 | .spreadsheet-container .numerical-filter .dropdown-body { 525 | margin: 20px 23px 10px 20px; 526 | width: 207px; 527 | text-align: center; 528 | } 529 | 530 | .spreadsheet-container .numerical-filter .slider-range { 531 | margin-bottom: 4px; 532 | } 533 | 534 | 535 | .spreadsheet-container .numerical-filter .ui-slider-handle { 536 | width: 18px; 537 | padding: 0; 538 | } 539 | 540 | .spreadsheet-container .numerical-filter .range-separator { 541 | font-size: 28px; 542 | font-weight: 300; 543 | padding: 0 7px; 544 | color: #646a76; 545 | position: relative; 546 | top: 4px; 547 | } 548 | 549 | .text-filter-grid * { 550 | -webkit-box-sizing: border-box; 551 | -moz-box-sizing: border-box; 552 | box-sizing: border-box; 553 | } 554 | 555 | .text-filter .slick-viewport { 556 | overflow-y: auto !important; 557 | overflow-x: hidden !important; 558 | } 559 | 560 | .text-filter .input-area { 561 | padding: 12px; 562 | } 563 | 564 | .text-filter .no-results { 565 | margin-left: 12px; 566 | margin-bottom: 10px; 567 | } 568 | 569 | .text-filter .search-input { 570 | height: 30px; 571 | width: 100%; 572 | margin-bottom: 0px; 573 | box-sizing: border-box; 574 | } 575 | 576 | .text-filter .text-filter-grid { 577 | width: 300px; 578 | height: 250px; 579 | box-sizing: border-box; 580 | border-top: 1px solid #d3d3d3; 581 | } 582 | 583 | .text-filter .slick-header { 584 | border: none; 585 | } 586 | 587 | .text-filter .slick-header-columns { 588 | height: 0px; 589 | } 590 | 591 | .text-filter .slick-cell { 592 | line-height: 30px; 593 | border-left: none; 594 | border-right: none; 595 | background-color: #ffffff !important; 596 | border-bottom: 1px solid #e1e8ed !important; 597 | padding: 0; 598 | text-align: left; 599 | cursor: pointer; 600 | } 601 | 602 | .text-filter .slick-row.odd .slick-cell { 603 | background: #fafafa !important; 604 | } 605 | 606 | .text-filter .slick-row.active .slick-cell { 607 | background-color: #deeaf7 !important; 608 | border-top: 1px solid transparent !important; 609 | } 610 | 611 | .text-filter .check-box-cell { 612 | text-align: center; 613 | line-height: 28px; 614 | } 615 | 616 | .text-filter .check-box-cell input { 617 | margin: 0; 618 | } 619 | 620 | /* from custom-bootstrap *****************/ 621 | 622 | .spreadsheet-container input.datepicker { 623 | padding: 4px 4px 2px 4px; 624 | border: 1px solid lightgrey; 625 | font-size: 13px; 626 | line-height: 18px; 627 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 628 | } 629 | 630 | /* jquery-ui overrides */ 631 | 632 | .ui-widget, .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { 633 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 634 | font-size: 13px; 635 | } 636 | 637 | .ui-tooltip { 638 | opacity: 1.0 !important; 639 | } 640 | 641 | /* jquery-ui datepicker style overrides */ 642 | 643 | #ui-datepicker-div { 644 | z-index: 9999 !important; 645 | } 646 | 647 | #ui-datepicker-div.ui-datepicker { 648 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 649 | /*@include box-shadow(0 5px 10px rgba(0, 0, 0, 0.2))*/ 650 | z-index: 99 !important; 651 | padding: 0 !important; 652 | background-color: white; 653 | border: 1px solid gray; 654 | } 655 | 656 | #ui-datepicker-div.ui-datepicker .ui-icon { 657 | display: inline-block; 658 | font: normal normal normal 14px/1 FontAwesome; 659 | font-size: inherit; 660 | text-rendering: auto; 661 | -webkit-font-smoothing: antialiased; 662 | -moz-osx-font-smoothing: grayscale; 663 | text-indent: 0px; 664 | margin-left: -4px; 665 | margin-top: -6px; 666 | background-image: none; 667 | } 668 | 669 | #ui-datepicker-div.ui-datepicker .ui-icon-circle-triangle-w:before { 670 | content: "\f053"; 671 | } 672 | 673 | #ui-datepicker-div.ui-datepicker .ui-icon-circle-triangle-e:before { 674 | content: "\f054"; 675 | } 676 | 677 | 678 | /* from slickgrid editing example */ 679 | input.editor-text { 680 | width: 100%; 681 | height: 100%; 682 | border: 0; 683 | margin: -1px 0 0 0; 684 | background: transparent; 685 | outline: 0; 686 | padding: 0; 687 | } 688 | 689 | .ui-datepicker-trigger { 690 | width: 16px; 691 | height: 16px; 692 | margin-top: 2px; 693 | padding: 0; 694 | vertical-align: top; 695 | left: 4px; 696 | position: relative; 697 | } 698 | 699 | .slick-cell.boolean { 700 | text-align: center; 701 | } 702 | 703 | .bool-radio-wrapper { 704 | width: 150px; 705 | position: relative; 706 | margin: 8px auto 4px auto; 707 | } 708 | 709 | .label-true { 710 | padding: 4px 28px 4px 13px; 711 | } 712 | 713 | .label-false { 714 | padding: 4px 28px 4px 4px; 715 | margin-left: 15px; 716 | } 717 | 718 | input.bool-filter-radio { 719 | margin-left: -23px; 720 | } 721 | 722 | .slick-cell { 723 | -webkit-touch-callout: none; /* iOS Safari */ 724 | -webkit-user-select: none; /* Safari */ 725 | -khtml-user-select: none; /* Konqueror HTML */ 726 | -moz-user-select: none; /* Firefox */ 727 | -ms-user-select: none; /* Internet Explorer/Edge */ 728 | user-select: none; 729 | } 730 | 731 | .slick-row .slick-cell:not(:first-child) { 732 | padding-left: 5px; 733 | margin-left: -4px; 734 | } 735 | 736 | .spreadsheet-grid .slick-sort-indicator-desc, 737 | .spreadsheet-grid .slick-sort-indicator-asc { 738 | background-image: none; 739 | } 740 | 741 | .jupyter-widgets { 742 | overflow: auto !important; 743 | } 744 | -------------------------------------------------------------------------------- /js/src/spreadsheet.datefilter.js: -------------------------------------------------------------------------------- 1 | var $ = require('jquery'); 2 | var filter_base = require('./spreadsheet.filterbase.js'); 3 | 4 | class DateFilter extends filter_base.FilterBase { 5 | 6 | get_filter_html() { 7 | return ` 8 |
9 |

10 | 11 | 12 |

13 | 18 | 21 |
22 | `; 23 | } 24 | 25 | update_min_max(col_info, has_active_filter) { 26 | this.min_value = col_info.filter_min; 27 | this.max_value = col_info.filter_max; 28 | 29 | var filter_info = col_info.filter_info; 30 | if (filter_info) { 31 | this.filter_start_date = filter_info.min || this.min_value; 32 | this.filter_end_date = filter_info.max || this.max_value; 33 | } else { 34 | this.filter_start_date = this.min_value; 35 | this.filter_end_date = this.max_value; 36 | } 37 | 38 | this.has_multiple_values = this.min_value != this.max_value; 39 | this.show_filter(); 40 | if (has_active_filter) { 41 | this.update_filter_button_disabled(); 42 | } 43 | } 44 | 45 | reset_filter() { 46 | if (this.filter_elem) { 47 | this.start_date_control.datepicker("setDate", this.min_date); 48 | this.end_date_control.datepicker("setDate", this.max_date); 49 | 50 | this.start_date_control.datepicker("option", "maxDate", this.max_date); 51 | this.end_date_control.datepicker("option", "minDate", this.min_date); 52 | } 53 | 54 | this.filter_start_date = null; 55 | this.filter_end_date = null; 56 | this.send_filter_changed(); 57 | } 58 | 59 | initialize_controls() { 60 | super.initialize_controls(); 61 | this.min_date = new Date(this.min_value); 62 | this.max_date = new Date(this.max_value); 63 | 64 | this.start_date_control = this.filter_elem.find(".start-date"); 65 | this.end_date_control = this.filter_elem.find(".end-date"); 66 | 67 | var date_options = { 68 | "dayNamesMin": ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 69 | "prevText": "", 70 | "nextText": "", 71 | minDate: this.min_date, 72 | maxDate: this.max_date, 73 | beforeShow: (input, inst) => { 74 | // align the datepicker with the right edge of the input it drops down from 75 | var clicked_elem = $(inst); 76 | clicked_elem.closest(".spreadsheet-dropdown-menu").addClass("calendar-open"); 77 | 78 | var widget = clicked_elem.datepicker('widget'); 79 | widget.css('margin-left', $(input).outerWidth() - widget.outerWidth()); 80 | widget.addClass("stay-open-on-click filter-child-elem"); 81 | }, 82 | onSelect: (dateText, instance) => { 83 | // pull the values from the datepickers 84 | var start_date_string = this.start_date_control.val(); 85 | var end_date_string = this.end_date_control.val(); 86 | 87 | var start_date = new Date(start_date_string); 88 | var end_date = new Date(end_date_string); 89 | 90 | start_date = Date.UTC(start_date.getUTCFullYear(), start_date.getUTCMonth(), start_date.getUTCDate()); 91 | end_date = Date.UTC(end_date.getUTCFullYear(), end_date.getUTCMonth(), end_date.getUTCDate()); 92 | end_date += (1000 * 60 * 60 * 24) - 1; 93 | 94 | this.filter_start_date = start_date; 95 | this.filter_end_date = end_date; 96 | 97 | this.send_filter_changed(); 98 | 99 | var datepicker = $(instance.input); 100 | setTimeout((function () { 101 | datepicker.blur(); 102 | }), 100); 103 | 104 | if (datepicker.hasClass("start-date")) { 105 | // update the end date's min 106 | this.end_date_control.datepicker("option", "minDate", start_date); 107 | } 108 | if (datepicker.hasClass("end-date")) { 109 | // update the start date's max 110 | this.start_date_control.datepicker("option", "maxDate", new Date(end_date_string)); 111 | } 112 | } 113 | }; 114 | 115 | this.filter_elem.find(".datepicker").datepicker(date_options); 116 | 117 | if (this.filter_start_date != null){ 118 | this.start_date_control.datepicker("setDate", this.get_utc_date(this.filter_start_date)); 119 | } else { 120 | this.start_date_control.datepicker("setDate", this.min_date); 121 | } 122 | 123 | if (this.filter_end_date != null){ 124 | this.end_date_control.datepicker("setDate", this.get_utc_date(this.filter_end_date)); 125 | } else { 126 | this.end_date_control.datepicker("setDate", this.max_date); 127 | } 128 | } 129 | 130 | get_utc_date(date_ms) { 131 | var date = new Date(date_ms); 132 | return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()); 133 | } 134 | 135 | get_filter_info() { 136 | return { 137 | "field": this.field, 138 | "type": "date", 139 | "min": this.filter_start_date, 140 | "max": this.filter_end_date 141 | }; 142 | } 143 | 144 | is_active() { 145 | return this.filter_start_date || this.filter_end_date; 146 | } 147 | } 148 | 149 | module.exports = {'DateFilter': DateFilter}; 150 | -------------------------------------------------------------------------------- /js/src/spreadsheet.editors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Input handlers 3 | * 4 | * Adapted from https://github.com/mleibman/SlickGrid/blob/master/slick.editors.js 5 | * MIT License, Copyright (c) 2010 Michael Leibman 6 | */ 7 | var $ = require('jquery'); 8 | require('slickgrid-qgrid/slick.editors.js'); 9 | 10 | class IndexEditor { 11 | constructor(args){ 12 | this.column_info = args.column; 13 | this.$cell = $(args.container); 14 | this.$cell.attr('title', 15 | 'Editing index columns is not supported'); 16 | this.$cell.tooltip(); 17 | this.$cell.tooltip('enable'); 18 | this.$cell.tooltip("open"); 19 | // automatically hide it after 4 seconds 20 | setTimeout((event, ui) => { 21 | this.$cell.tooltip('destroy'); 22 | args.cancelChanges(); 23 | }, 3000); 24 | } 25 | 26 | destroy() {} 27 | 28 | focus() {} 29 | 30 | loadValue(item) { 31 | this.$cell.text( 32 | this.column_info.formatter( 33 | null, null, item[this.column_info.field], this.column_info, null 34 | ) 35 | ); 36 | } 37 | 38 | serializeValue() {} 39 | 40 | applyValue(item, state) {} 41 | 42 | isValueChanged() { 43 | return false; 44 | } 45 | 46 | validate() { 47 | return { 48 | valid: true, 49 | msg: null 50 | }; 51 | } 52 | } 53 | 54 | // http://stackoverflow.com/a/22118349 55 | class SelectEditor { 56 | constructor(args) { 57 | this.column_info = args.column; 58 | this.options = []; 59 | if (this.column_info.editorOptions.options) { 60 | this.options = this.column_info.editorOptions.options; 61 | } else { 62 | this.options = ["yes", "no"]; 63 | } 64 | 65 | var option_str = ""; 66 | 67 | this.elem = $(" 17 | 18 |
19 | 20 |
21 | 25 | 26 | `; 27 | } 28 | 29 | handle_msg(msg) { 30 | var column_info = msg.col_info; 31 | if (msg.type == 'update_data_view_filter'){ 32 | this.update_data_view(column_info); 33 | } 34 | super.handle_msg(msg); 35 | } 36 | 37 | update_min_max(col_info, has_active_filter) { 38 | this.values = col_info.values; 39 | this.length = col_info.length; 40 | this.value_range = col_info.value_range; 41 | this.selected_rows = []; 42 | for (var i = 0; i < col_info.selected_length; i++) { 43 | this.selected_rows.push(i); 44 | } 45 | this.ignore_selection_changed = true; 46 | this.show_filter(); 47 | this.ignore_selection_changed = false; 48 | } 49 | 50 | update_data_view(col_info) { 51 | if (this.update_timeout) { 52 | clearTimeout(this.update_timeout); 53 | } 54 | 55 | this.update_timeout = setTimeout(() => { 56 | this.values = col_info.values; 57 | this.length = col_info.length; 58 | this.value_range = col_info.value_range; 59 | 60 | if (this.length === 0) { 61 | this.filter_elem.find('.no-results').removeClass('hidden'); 62 | this.filter_grid_elem.addClass('hidden'); 63 | return; 64 | } 65 | 66 | this.filter_elem.find('.no-results').addClass('hidden'); 67 | this.filter_grid_elem.removeClass('hidden'); 68 | this.ignore_selection_changed = true; 69 | this.update_slick_grid_data(); 70 | this.filter_grid.setData(this.data_view); 71 | this.selected_rows = []; 72 | for (var i = 0; i < col_info.selected_length; i++) { 73 | this.selected_rows.push(i); 74 | this.row_selection_model.setSelectedRows(this.selected_rows); 75 | } 76 | this.filter_grid.render(); 77 | this.ignore_selection_changed = false; 78 | }, 100); 79 | } 80 | 81 | update_slick_grid_data() { 82 | this.grid_items = this.values.map(function (value, index) { 83 | return { 84 | id: value, 85 | value: value 86 | }; 87 | }); 88 | 89 | this.data_view = { 90 | getLength: () => { 91 | return this.length; 92 | }, 93 | getItem: (i) => { 94 | var default_row = { 95 | id: 'row' + i, 96 | value: '' 97 | }; 98 | if (i >= this.value_range[0] && i < this.value_range[1]) { 99 | return this.grid_items[i - this.value_range[0]] || default_row; 100 | } else { 101 | return default_row; 102 | } 103 | } 104 | }; 105 | } 106 | 107 | initialize_controls() { 108 | super.initialize_controls(); 109 | this.filter_grid_elem = this.filter_elem.find(".text-filter-grid"); 110 | this.search_string = ""; 111 | 112 | this.update_slick_grid_data(); 113 | 114 | this.sort_comparer = (x, y) => { 115 | var x_value = x.value; 116 | var y_value = y.value; 117 | 118 | // selected row should be sorted to the top 119 | if (x.selected != y.selected) { 120 | return x.selected ? -1 : 1; 121 | } 122 | 123 | return x_value > y_value ? 1 : -1; 124 | }; 125 | 126 | var text_filter = (item, args) => { 127 | if (this.search_string) { 128 | if (item.value.toLowerCase().indexOf(this.search_string.toLowerCase()) == -1) { 129 | return false; 130 | } 131 | } 132 | return true; 133 | }; 134 | 135 | var row_formatter = function (row, cell, value, columnDef, dataContext) { 136 | return "" + dataContext.value + ""; 137 | }; 138 | 139 | var checkboxSelector = new Slick.CheckboxSelectColumn({ 140 | cssClass: "check-box-cell" 141 | }); 142 | 143 | var columns = [ 144 | checkboxSelector.getColumnDefinition(), 145 | { 146 | id: "name", 147 | name: "Name", 148 | field: "name", 149 | formatter: row_formatter, 150 | sortable: true 151 | }]; 152 | 153 | var options = { 154 | enableCellNavigation: true, 155 | fullWidthRows: true, 156 | syncColumnCellResize: true, 157 | rowHeight: 32, 158 | forceFitColumns: true, 159 | enableColumnReorder: false 160 | }; 161 | 162 | var max_height = options.rowHeight * 8; 163 | // Subtract 110 from viewport height to account for the height of the header + search box + footer 164 | // of the filter control. This value can't be calculated dynamically because the filter control 165 | // hasn't been shown yet. 166 | var grid_viewport_height = this.column_header_elem.closest('.slick-header').siblings('.slick-viewport').height() - 115; 167 | if (grid_viewport_height < max_height) { 168 | max_height = grid_viewport_height; 169 | } 170 | 171 | var grid_height = max_height; 172 | // totalRowHeight is how tall the grid would have to be to fit all of the rows in the dataframe. 173 | var total_row_height = (this.grid_items.length) * options.rowHeight; 174 | 175 | if (total_row_height <= max_height) { 176 | grid_height = total_row_height; 177 | this.filter_grid_elem.addClass('hide-scrollbar'); 178 | } 179 | this.filter_grid_elem.height(grid_height); 180 | 181 | this.filter_grid = new Slick.Grid( 182 | this.filter_grid_elem, this.data_view, columns, options 183 | ); 184 | this.filter_grid.registerPlugin(checkboxSelector); 185 | 186 | this.row_selection_model = new Slick.RowSelectionModel({ 187 | selectActiveRow: false 188 | }); 189 | this.row_selection_model.onSelectedRangesChanged.subscribe( 190 | (e, args) => this.handle_selection_changed(e, args) 191 | ); 192 | 193 | this.filter_grid.setSelectionModel(this.row_selection_model); 194 | this.row_selection_model.setSelectedRows(this.selected_rows); 195 | 196 | if (this.column_type != 'any') { 197 | this.filter_grid.onViewportChanged.subscribe((e, args) => { 198 | if (this.viewport_timeout) { 199 | clearTimeout(this.viewport_timeout); 200 | } 201 | this.viewport_timeout = setTimeout(() => { 202 | var vp = args.grid.getViewport(); 203 | var msg = { 204 | 'type': 'change_filter_viewport', 205 | 'field': this.field, 206 | 'top': vp.top, 207 | 'bottom': vp.bottom 208 | }; 209 | this.widget_model.send(msg); 210 | this.viewport_timeout = null; 211 | }, 100); 212 | }); 213 | } 214 | 215 | this.filter_grid.render(); 216 | 217 | this.security_search = this.filter_elem.find(".search-input"); 218 | this.security_search.keyup((e) => this.handle_text_input_key_up(e)); 219 | this.security_search.click((e) => this.handle_text_input_click(e)); 220 | 221 | this.filter_grid.onClick.subscribe( 222 | (e, args) => this.handle_grid_clicked(e, args) 223 | ); 224 | this.filter_grid.onKeyDown.subscribe( 225 | (e, args) => this.handle_grid_key_down(e, args) 226 | ); 227 | 228 | this.filter_elem.find("a.select-all-link").click((e) => { 229 | this.ignore_selection_changed = true; 230 | this.reset_filter(); 231 | this.filter_list = "all"; 232 | var all_row_indices = []; 233 | for (var i = 0; i < this.length; i++) { 234 | all_row_indices.push(i); 235 | } 236 | this.row_selection_model.setSelectedRows(all_row_indices); 237 | this.ignore_selection_changed = false; 238 | this.send_filter_changed(); 239 | return false; 240 | }); 241 | 242 | setTimeout(() => { 243 | this.filter_grid.setColumns(this.filter_grid.getColumns()); 244 | this.filter_grid.resizeCanvas(); 245 | }, 10); 246 | } 247 | 248 | toggle_row_selected(row_index) { 249 | var old_selected_rows = this.row_selection_model.getSelectedRows(); 250 | // if the row is already selected, remove it from the selected rows array. 251 | var selected_rows = old_selected_rows.filter(function (word) { 252 | return word !== row_index; 253 | }); 254 | // otherwise add it to the selected rows array so it gets selected 255 | if (selected_rows.length == old_selected_rows.length) { 256 | selected_rows.push(row_index); 257 | } 258 | this.row_selection_model.setSelectedRows(selected_rows); 259 | } 260 | 261 | handle_grid_clicked(e, args) { 262 | this.toggle_row_selected(args.row); 263 | var active_cell = this.filter_grid.getActiveCell(); 264 | if (!active_cell) { 265 | e.stopImmediatePropagation(); 266 | } 267 | } 268 | 269 | handle_grid_key_down(e, args) { 270 | var active_cell = this.filter_grid.getActiveCell(); 271 | if (active_cell) { 272 | if (e.keyCode == 13) { // enter key 273 | this.toggle_row_selected(active_cell.row); 274 | return; 275 | } 276 | 277 | // focus on the search box for any key other than the up/down arrows 278 | if (e.keyCode != 40 && e.keyCode != 38) { 279 | this.focus_on_search_box(); 280 | return; 281 | } 282 | 283 | // also focus on the search box if we're at the top of the grid and this is the up arrow 284 | else if (active_cell.row == 0 && e.keyCode == 38) { 285 | this.focus_on_search_box(); 286 | e.preventDefault(); 287 | return; 288 | } 289 | } 290 | } 291 | 292 | focus_on_search_box() { 293 | this.security_search.focus().val(this.search_string); 294 | this.filter_grid.resetActiveCell(); 295 | } 296 | 297 | handle_text_input_key_up(e) { 298 | var old_search_string = this.search_string; 299 | if (e.keyCode == 40) { // down arrow 300 | this.filter_grid.focus(); 301 | this.filter_grid.setActiveCell(0, 0); 302 | return; 303 | } 304 | if (e.keyCode == 13) { // enter key 305 | if (this.security_grid.getDataLength() > 0) { 306 | this.toggle_row_selected(0); 307 | this.security_search.val(""); 308 | } 309 | } 310 | 311 | this.search_string = this.security_search.val(); 312 | if (old_search_string != this.search_string) { 313 | var msg = { 314 | 'type': 'show_filter_dropdown', 315 | 'field': this.field, 316 | 'search_val': this.search_string 317 | }; 318 | this.widget_model.send(msg); 319 | } 320 | } 321 | 322 | handle_text_input_click(e) { 323 | this.filter_grid.resetActiveCell(); 324 | } 325 | 326 | handle_selection_changed(e, args) { 327 | if (this.ignore_selection_changed) { 328 | return false; 329 | } 330 | 331 | var rows = this.row_selection_model.getSelectedRows(); 332 | rows = _.sortBy(rows, function (i) { 333 | return i; 334 | }); 335 | this.excluded_rows = []; 336 | if (this.filter_list == 'all') { 337 | var j = 0; 338 | for (var i = 0; i < this.data_view.getLength(); i++) { 339 | if (rows[j] == i) { 340 | j += 1; 341 | continue; 342 | } else { 343 | this.excluded_rows.push(i); 344 | } 345 | } 346 | } else { 347 | this.filter_list = rows.length > 0 ? rows : null; 348 | } 349 | 350 | this.send_filter_changed(); 351 | } 352 | 353 | is_active() { 354 | return this.filter_list != null; 355 | } 356 | 357 | reset_filter() { 358 | this.ignore_selection_changed = true; 359 | this.search_string = ""; 360 | this.excluded_rows = null; 361 | this.security_search.val(""); 362 | this.row_selection_model.setSelectedRows([]); 363 | this.filter_list = null; 364 | this.send_filter_changed(); 365 | // Refreshing filter dropdown is necessary for retrieving new search results 366 | if (this.filter_elem) { 367 | var msg = { 368 | 'type': 'show_filter_dropdown', 369 | 'field': this.field, 370 | 'search_val': this.search_string 371 | }; 372 | this.widget_model.send(msg); 373 | } 374 | this.ignore_selection_changed = false; 375 | } 376 | 377 | get_filter_info() { 378 | return { 379 | "field": this.field, 380 | "type": "text", 381 | "selected": this.filter_list, 382 | "excluded": this.excluded_rows 383 | }; 384 | } 385 | } 386 | 387 | module.exports = {'TextFilter': TextFilter}; 388 | -------------------------------------------------------------------------------- /js/src/spreadsheet.widget.js: -------------------------------------------------------------------------------- 1 | var widgets = require('@jupyter-widgets/base'); 2 | var _ = require('underscore'); 3 | var moment = require('moment'); 4 | window.$ = window.jQuery = require('jquery'); 5 | var date_filter = require('./spreadsheet.datefilter.js'); 6 | var slider_filter = require('./spreadsheet.sliderfilter.js'); 7 | var text_filter = require('./spreadsheet.textfilter.js'); 8 | var boolean_filter = require('./spreadsheet.booleanfilter.js'); 9 | var editors = require('./spreadsheet.editors.js'); 10 | var dialog = null; 11 | try { 12 | dialog = require('base/js/dialog'); 13 | } catch (e) { 14 | console.warn("Modin Spreadsheet was unable to load base/js/dialog. " + 15 | "Full screen button won't be available"); 16 | } 17 | var jquery_ui = require('jquery-ui-dist/jquery-ui.min.js'); 18 | 19 | require('slickgrid-qgrid/slick.core.js'); 20 | require('slickgrid-qgrid/lib/jquery.event.drag-2.3.0.js'); 21 | require('slickgrid-qgrid/plugins/slick.rowselectionmodel.js'); 22 | require('slickgrid-qgrid/plugins/slick.checkboxselectcolumn.js'); 23 | require('slickgrid-qgrid/slick.dataview.js'); 24 | require('slickgrid-qgrid/slick.grid.js'); 25 | require('slickgrid-qgrid/slick.editors.js'); 26 | require('style-loader!slickgrid-qgrid/slick.grid.css'); 27 | require('style-loader!slickgrid-qgrid/slick-default-theme.css'); 28 | require('style-loader!jquery-ui-dist/jquery-ui.min.css'); 29 | require('style-loader!./spreadsheet.css'); 30 | 31 | // Model for the modin-spreadsheet widget 32 | class ModinSpreadsheetModel extends widgets.DOMWidgetModel { 33 | defaults() { 34 | return _.extend(widgets.DOMWidgetModel.prototype.defaults(), { 35 | _model_name : 'ModinSpreadsheetModel', 36 | _view_name : 'ModinSpreadsheetView', 37 | _model_module : 'modin_spreadsheet', 38 | _view_module : 'modin_spreadsheet', 39 | _model_module_version : '^0.1.1', 40 | _view_module_version : '^0.1.1', 41 | _df_json: '', 42 | _columns: {} 43 | }); 44 | } 45 | } 46 | 47 | 48 | // View for the modin-spreadsheet widget 49 | class ModinSpreadsheetView extends widgets.DOMWidgetView { 50 | render() { 51 | // subscribe to incoming messages from the SpreadsheetWidget 52 | this.model.on('msg:custom', this.handle_msg, this); 53 | this.initialize_modin_spreadsheet(); 54 | } 55 | 56 | /** 57 | * Main entry point for drawing the widget, 58 | * including toolbar buttons if necessary. 59 | */ 60 | initialize_modin_spreadsheet() { 61 | this.$el.empty(); 62 | if (!this.$el.hasClass('spreadsheet-container')){ 63 | this.$el.addClass('spreadsheet-container'); 64 | } 65 | this.initialize_toolbar(); 66 | this.initialize_slick_grid(); 67 | this.initialize_history_cell(); 68 | } 69 | 70 | initialize_history_cell() { 71 | this.send({ 72 | 'type': 'initialize_history', 73 | }); 74 | } 75 | 76 | initialize_toolbar() { 77 | if (!this.model.get('show_toolbar')){ 78 | this.$el.removeClass('show-toolbar'); 79 | } else { 80 | this.$el.addClass('show-toolbar'); 81 | } 82 | 83 | if (this.toolbar){ 84 | return; 85 | } 86 | 87 | this.toolbar = $("
").appendTo(this.$el); 88 | 89 | let append_btn = (btn_info) => { 90 | return $(` 91 | 99 | `).appendTo(this.toolbar); 100 | }; 101 | 102 | append_btn({ 103 | loading_text: 'Adding...', 104 | event_type: 'add_row', 105 | text: 'Add Row' 106 | }); 107 | 108 | append_btn({ 109 | loading_text: 'Removing...', 110 | event_type: 'remove_row', 111 | text: 'Remove Row' 112 | }); 113 | 114 | append_btn({ 115 | loading_text: 'Clearing...', 116 | event_type: 'clear_history', 117 | text: 'Clear History' 118 | }); 119 | 120 | append_btn({ 121 | loading_text: 'Filtering...', 122 | event_type: 'filter_history', 123 | text: 'Filter History' 124 | }); 125 | 126 | append_btn({ 127 | loading_text: 'Resetting...', 128 | text: 'Reset Filters', 129 | handler_function: 'reset_all_filters' 130 | }); 131 | 132 | append_btn({ 133 | loading_text: 'Resetting...', 134 | text: 'Reset Sort', 135 | event_type: 'reset_sort' 136 | }); 137 | 138 | this.buttons = this.toolbar.find('.btn'); 139 | 140 | this.full_screen_btn = null; 141 | if (dialog) { 142 | this.full_screen_modal = $('body').find('.spreadsheet-modal'); 143 | if (this.full_screen_modal.length == 0) { 144 | this.full_screen_modal = $(` 145 | 152 | `).appendTo($('body')); 153 | } 154 | this.full_screen_btn = $(` 155 |