plot-saver 0.1.1__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {plot_saver-0.1.1 → plot_saver-0.1.2}/CHANGELOG.md +5 -0
- {plot_saver-0.1.1 → plot_saver-0.1.2}/PKG-INFO +1 -1
- {plot_saver-0.1.1 → plot_saver-0.1.2}/pyproject.toml +1 -1
- {plot_saver-0.1.1 → plot_saver-0.1.2}/src/plot_saver/anywidget_compat.py +6 -13
- {plot_saver-0.1.1 → plot_saver-0.1.2}/.github/workflows/publish.yml +0 -0
- {plot_saver-0.1.1 → plot_saver-0.1.2}/README.md +0 -0
- {plot_saver-0.1.1 → plot_saver-0.1.2}/src/plot_saver/__init__.py +0 -0
- {plot_saver-0.1.1 → plot_saver-0.1.2}/src/plot_saver/config.py +0 -0
- {plot_saver-0.1.1 → plot_saver-0.1.2}/src/plot_saver/figure_save_widget.css +0 -0
- {plot_saver-0.1.1 → plot_saver-0.1.2}/src/plot_saver/figure_save_widget.js +0 -0
- {plot_saver-0.1.1 → plot_saver-0.1.2}/src/plot_saver/resources/default_config.toml +0 -0
- {plot_saver-0.1.1 → plot_saver-0.1.2}/src/plot_saver/save_widget.py +0 -0
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
- Dropped wrapper-level anywidget UIElement caching so marimo rebuilds the plot saver widget with a fresh virtual-file JavaScript module on each rerun.
|
|
6
|
+
- Kept the widget comm initialization path so the underlying anywidget model id remains stable across marimo renders.
|
|
7
|
+
|
|
3
8
|
## 0.1.1
|
|
4
9
|
|
|
5
10
|
- Fixed the marimo anywidget compatibility layer to serve widget JavaScript through marimo-managed virtual files instead of embedding untrusted `data:` URLs.
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from weakref import WeakKeyDictionary
|
|
4
|
-
|
|
5
3
|
import marimo._output.data.data as mo_data
|
|
6
4
|
from marimo._plugins.ui._core.ui_element import UIElement
|
|
7
5
|
from marimo._plugins.ui._impl.from_anywidget import (
|
|
@@ -12,6 +10,8 @@ from marimo._utils.code import hash_code
|
|
|
12
10
|
|
|
13
11
|
|
|
14
12
|
class _StableAnyWidget(MarimoAnyWidget):
|
|
13
|
+
"""Marimo anywidget wrapper that keeps the widget model-id stable."""
|
|
14
|
+
|
|
15
15
|
def __init__(self, widget):
|
|
16
16
|
self.widget = widget
|
|
17
17
|
self._initialized = False
|
|
@@ -35,15 +35,8 @@ class _StableAnyWidget(MarimoAnyWidget):
|
|
|
35
35
|
on_change=None,
|
|
36
36
|
)
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
_WIDGET_CACHE: WeakKeyDictionary[object, _StableAnyWidget] = WeakKeyDictionary()
|
|
40
|
-
|
|
41
|
-
|
|
42
38
|
def wrap_anywidget(widget):
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
wrapped = _StableAnyWidget(widget)
|
|
48
|
-
_WIDGET_CACHE[widget] = wrapped
|
|
49
|
-
return wrapped
|
|
39
|
+
# Rebuild the marimo UIElement on each call so its virtual-file-backed
|
|
40
|
+
# JS module belongs to the current cell lifecycle. Caching the wrapper can
|
|
41
|
+
# leave a stale `@file/...js` URL behind after notebook reruns.
|
|
42
|
+
return _StableAnyWidget(widget)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|