Comments (7)
This appears to be almost functional already. Here are the steps:
- After importing qgrid and running
nbinstall
at the top of your notebook, add the following line to set some options:qgrid.set_defaults(remote_js=True, show_toolbar=True)
- Render a qgrid and notice the Export button above it.
- Click Export to generate a version of the grid that can be rendered outside of the jupyter notebook. You'll actually see two grids there at this point, and that's OK.
- Click save to save your notebook.
- Go to File, Download As, Html to download your notebook as a standalone HTML file.
The only thing that didn't work for me is the filter icons in the column headers of the grid were missing in the resulting HTML file. The grid appeared to be totally functional other than that.
from qgrid.
I would really like to use qgrid outside of Jupyter notebooks to save dataframes as interactive html tables.
It would be great if you had to first create a qgrid object which has methods show_grid and export.
Currently, it looks like we'd have to create another method that is very similar to save_grid just to have the grid object accessible for the grid.export() call.
from qgrid.
I tried above steps in the hope to get this working for reveal slides (jupyter nbconvert presentation.ipynb --to slides --post serve
). Unfortunately, it does not give a useful output yet: once I add more than four columns, the table becomes garbled (in the slides, not in the notebook) with all columns of extremely small width. Also the filter icon image is broken in the slides.
from qgrid.
Please re-open this issue until a method that works with latest qgrid works :)
qgrid.set_defaults(remote_js=True, show_toolbar=True)
yields TypeError: set_defaults() got an unexpected keyword argument 'remote_js'
.
I tried exporting using embed_minimal_html:
import pandas as pd
import qgrid
from ipywidgets.embed import embed_minimal_html
from IPython.display import IFrame
df = pd.read_csv(
"https://gist.githubusercontent.com/rgbkrk/a7984a8788a73e2afb8fd4b89c8ec6de/raw/db8d1db9f878ed448c3cac3eb3c9c0dc5e80891e/2015.csv"
)
view = qgrid.show_grid(df)
embed_minimal_html('qgrid.html', views=[view], title='QGrid')
While this results in a standalone web-page (can be displayed with IFrame("qgrid.html", width=1000, height=400)
), its interactivity is broken. It tries to include non-existing qgrid.js
and base/js/dialog.js
relative to the current directory.
from qgrid.
Aha, just read #110 (comment) - worth including here as well:
The export button is gone in qgrid 1.0 and it's no longer possible to export a fully functional version of qgrid to static html, because in the new version of qgrid the sorting/filtering logic is done on the server. That being said, you should still be able to export a partially functional version of qgrid where sorting/filtering is broken (and only 200 rows are included) once jupyter-widgets/ipywidgets#1597 is fixed.
I realize that's probably not all that useful to people so another alternative that might be a better option is to use the new "binder" service for rendering live notebooks. I'm using it to host the demo notebook for qgrid and it's been great so far: https://beta.mybinder.org/v2/gh/quantopian/qgrid-notebooks/master?filepath=index.ipynb
I'm going to close this since I no longer plan to provide full support for static html exporting, and I think "binder" will be a suitable alternative for a lot of users.
from qgrid.
Hi @motin
I am running a jupyter notebook and hosting it via binder.
Do you experience your server connection dropping frequently? If so how did you manage this?
Did you have any issues rendering your QgridWidget. If so do you have a suggestion for how you solved this?
After looking at JS console. I see these errors:
Failed to load resource: https://hub.gke.mybinder.org/user/name-of-my-repository-xxb6b9w8/static/qgrid.js?v=20191001215319
the server responded with a status of 404 ()
manager-base.js:273 Could not instantiate widget
(anonymous) @ manager-base.js:273
utils.js:119 Error: Could not create a model.
at utils.js:119
(anonymous) @ utils.js:119
3kernel.js:1008 Couldn't process kernel message Error: Script error for "qgrid"
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js?v=951f856e81496aaeec2e71a1c2c0d51f:168)
at HTMLScriptElement.onScriptError (require.js?v=951f856e81496aaeec2e71a1c2c0d51f:1735)
(anonymous) @ kernel.js:1008
from qgrid.
will open this issue elsewhere
from qgrid.
Related Issues (20)
- grid does not support add_rows on an empty dataframe. Could we stop the user from removing the last row?
- qgrid incompatible with ipywidgets==8.0.0a6 due to decorator usage HOT 1
- Qgrid working with Modern Jupyter Lab (3.2 and beyond)
- Set Formatter for Column Definitions
- AttributeError: 'DataFrame' object has no attribute 'map'
- [Security] Workflow main.yml is using vulnerable action actions/checkout
- missing 1 required positional argument: 'widget' HOT 3
- qgrid not working in Binder notebook
- update for ipywidgets 8 compatibility HOT 1
- qgrid post link fails on environment build HOT 2
- REPO IS NO LONGER MAINTAINED AND DOES NOT SUPPORT JUPYTERLAB>=3.0.0 HOT 8
- QGrid is not working with NB-viewer.
- Internet connection required for qgrid 1.1.3 HOT 1
- Here, working version HOT 12
- filter_changed is not recognised in .on() HOT 1
- "ImportError: cannot import name 'Mapping' from 'collections' (C:\ProgramData\anaconda3\lib\collections\__init__.py)"
- post-link script failed for package conda-forge::qgrid-1.3.1-py39hcbf5309_2
- Filter not working HOT 1
- Detecting row selected in Python shiny
- Cannot edit the table using responsive setting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qgrid.