-
Notifications
You must be signed in to change notification settings - Fork 945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug with ipywidgets or gmaps, not sure #3448
Comments
The issue is with The issue is that the states (widgets?) are copied and saved multiple times. Probably because new objects are generated with new
For example, calling So,
Then, we fetch all widgets:
Something must create new widgets somewhere before or
|
I'm slightly surprised by this. While it's true that we keep a dict of all widgets created (you need to manually close them, or use something like https://github.com/widgetti/reacton)
However, the embed_minimal_html doesn't seem to use that. The right fix would be for embed_minimal_html to use the dependency_state function. |
Thank you for your insights! I created #3699 and it seems to solve the issue |
The original intention was that including the full state was the safe assumption for ipywidgets to make. While embed_minimal_html(p.as_posix(), views=[fig], state=dependency_state([fig])) I think adding some enum-like values for the state flag as in your proposed PR ('complete', 'dependent') makes a lot of sense, but changing the default might be something to discuss more in depth, as it is strictly speaking a backwards incompatible change. |
During the generation of multiple heatmaps at the same location, I noticed the generated html files keep increasing in size without an equivalent increase in the volume at a given map. Here are the resulting file sizes when I generate the same map with the same data for 200 times:
Result:
A temporary fix to the issue is to add the following to the code:
And to include this line in the loop:
As
gmaps.figure
for some reason uses this object and keeps storing additional figure data inside it disregarding whether they are still needed. If this behavior is unintentional, I can issue a pr with the fix if there is one.Result:
The text was updated successfully, but these errors were encountered: