mljar / mercury

Convert Jupyter Notebooks to Web Apps
https://RunMercury.com
GNU Affero General Public License v3.0
3.91k stars 248 forks source link

Using ipyaggrid with mercury is not rendering the grid #314

Open gmouawad opened 1 year ago

gmouawad commented 1 year ago

Hello,

I created a cloud tenant of Mercury and I have added a grid using the Python library called ipyaagrid. On my local jupyter notebook, the grid is displaying but on mercury the grid is not rendering. I added to my site files a requirements.txt file and I included ipyaagrid in it.

thanks

pplonski commented 1 year ago

I was checking this package last week. It will work after calling display on it. I will be back in the office in 1 hour, i will send you code example.

gmouawad commented 1 year ago

I was checking this package last week. It will work after calling display on it. I will be back in the office in 1 hour, i will send you code example.

weird, I used a display call and it didnt render. OK thanks a lot appreciate it

pplonski commented 1 year ago

To use ipyaggrid in Mercury please use the following code for display:

from IPython.display import HTML
HTML(g.export_html(build=True))

The ipyaggrid demo: ipyaggrid

The alternative to ipyaggrid might be itables https://github.com/mwouts/itables

Demo of itables: itables

@gmouawad if you found Mercury valuable please start a repository and share the information about the framework with your friends, so we can get more users. Thanks!

gmouawad commented 1 year ago

with ipyaggrid I am getting a js error on the mercury cloud:

[Open Browser Console for more detailed log - Double click to close this message] Failed to load model class 'AgGridModel' from module 'ipyaggrid' TypeError: Cannot read properties of undefined (reading 'AgGridModel') at https://unpkg.com/@jupyter-widgets/html-manager@*/dist/embed-amd.js:16:642643 at async rl.loadModelClass (https://unpkg.com/@jupyter-widgets/html-manager@*/dist/embed-amd.js:16:329116) at async rl._make_model (https://unpkg.com/@jupyter-widgets/html-manager@*/dist/embed-amd.js:16:325601)

pplonski commented 1 year ago

I will check it. Is it working for you locally?

gmouawad commented 1 year ago

I will check it. Is it working for you locally?

on my jupyter notebook yes, but local mercury is not yet ready due to an issue with the ssl as mentioned in issue #311

pplonski commented 1 year ago

Do you have Jupyter Notebook running on remote machine? If you are running Jupyter Notebook on your local machine then you can test app in Mercury with the command mercury run. It will start local dev server for you.

gmouawad commented 1 year ago

yeah it works locally, thank you

gmouawad commented 1 year ago

Do you have Jupyter Notebook running on remote machine? If you are running Jupyter Notebook on your local machine then you can test app in Mercury with the command mercury run. It will start local dev server for you.

Hello @pplonski let me know if I need to create a new issue for the below question or it is ok to post it here:

I am running mercury locally on my jupyter notebook as you suggested above. Exporting to pdf didn't work even after installing Pyppeteer image

pplonski commented 1 year ago

Yes, please create a new issue. You need to install Chromium, it can be done with pyppeteer-install command. What operating system are you using?

gmouawad commented 1 year ago

Yes, please create a new issue. You need to install Chromium, it can be done with pyppeteer-install command. What operating system are you using?

Windows 10

pplonski commented 1 year ago

Im closing the issue. If you have still a problem please reopen.

gmouawad commented 1 year ago

Im closing the issue. If you have still a problem please reopen.

Hi Piotr, yes the issue is still valid.

it shows an error once the notebook is implemented on the docker container image

pplonski commented 1 year ago

Is it working locally? Do you have problem only in docker environment?

Why would you like to use ipyaggrid? I was testing recenlty itables package, and it was working very good with Mercury. Do you need any special feature from ipyaggrid?

gmouawad commented 1 year ago

I was testing it. It is not working on the cloud tenant nor docker.

I will check itable

gmouawad commented 1 year ago

@pplonski I want a grid that has sorting and filtering on a column level, itable doesn't have the filtering capability. or at least I couldn't do it