Closed adampinky85 closed 3 months ago
Can repro here, this is what I see in the JS console:
Looks like a fix for this was merged a few days ago in altair https://github.com/altair-viz/altair/pull/3364
Does installing the development version from GitHub fix it?
pip install git+https://github.com/altair-viz/altair.git
@cpsievert That changes things but doesn't completely fix it (app looks broken in the same way):
Ah, I missed that error message, I'll look into it
It looks like at the time that _maybeResize is called: https://github.com/posit-dev/py-shinywidgets/blob/6719b0ede22069af3871b19a4c80a4c7f575df0e/js/src/output.ts#L113
lmWidget.children.length is 0. If I delay _maybeResize
by a bit with a setTimeout
, the error and problem go away.
BTW, the plots aren't rendering correctly in Safari even when they look good in Chrome:
https://github.com/posit-dev/py-shinywidgets/assets/129551/ae0b2bdf-85a2-4d86-902f-5ea1a30fa32f
@jcheng5 looks like the safari thing is a separate issue. I started a new issue for that in https://github.com/posit-dev/py-shinywidgets/issues/144
Description
Hi team,
We dynamically generate a variable number of charts depending on the dataset. Following upgrading version, our Altair charts no longer rendering correctly.
In the minimal example below, the code generates three charts and renders those on the dashboard. The version upgrade installed anywidget
0.9.1
and now only the first of the three Altair charts renders. Interestingly, the three Plotly charts still renders as expected.I'd really appreciate your help as I'm not entirely sure what is causing this issue? Many thanks!
Versions
Python: 3.11.6 OS: Ubuntu 22.04.4 LTS altair==5.2.0 anywidget==0.9.1 <-- working in 0.9.0, failing in 0.9.1 pandas==2.2.1 plotly==5.19.0 shiny==0.8.1 shinyswatch==0.5.1 shinywidgets==0.3.1
Minimal Example