ex4nicegui 0.8.1__py3-none-any.whl → 0.8.2__py3-none-any.whl
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.
- ex4nicegui/reactive/EChartsComponent/ECharts.js +9 -1
- ex4nicegui/reactive/EChartsComponent/ECharts.py +4 -5
- ex4nicegui/reactive/base.py +2 -2
- ex4nicegui/reactive/officials/echarts.py +15 -1
- ex4nicegui/utils/proxy/string.py +14 -24
- {ex4nicegui-0.8.1.dist-info → ex4nicegui-0.8.2.dist-info}/METADATA +1 -1
- {ex4nicegui-0.8.1.dist-info → ex4nicegui-0.8.2.dist-info}/RECORD +9 -9
- {ex4nicegui-0.8.1.dist-info → ex4nicegui-0.8.2.dist-info}/LICENSE +0 -0
- {ex4nicegui-0.8.1.dist-info → ex4nicegui-0.8.2.dist-info}/WHEEL +0 -0
|
@@ -56,7 +56,8 @@ export default {
|
|
|
56
56
|
template: "<div></div>",
|
|
57
57
|
async mounted() {
|
|
58
58
|
await new Promise((resolve) => setTimeout(resolve, 0)); // wait for Tailwind classes to be applied
|
|
59
|
-
|
|
59
|
+
|
|
60
|
+
this.chart = echarts.init(this.$el, this.theme, this.initOptions);
|
|
60
61
|
this.resizeObs = new ResizeObserver(this.chart.resize)
|
|
61
62
|
|
|
62
63
|
// Prevent interruption of chart animations due to resize operations.
|
|
@@ -84,6 +85,11 @@ export default {
|
|
|
84
85
|
}
|
|
85
86
|
});
|
|
86
87
|
|
|
88
|
+
if (this.eventTasks) {
|
|
89
|
+
for (const [eventName, query] of Object.entries(this.eventTasks)) {
|
|
90
|
+
this.echarts_on(eventName, query);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
87
93
|
},
|
|
88
94
|
beforeDestroy() {
|
|
89
95
|
this.chart.dispose();
|
|
@@ -116,6 +122,8 @@ export default {
|
|
|
116
122
|
props: {
|
|
117
123
|
options: Object | undefined,
|
|
118
124
|
theme: String | Object | undefined,
|
|
125
|
+
initOptions: Object | undefined,
|
|
119
126
|
code: String | undefined,
|
|
127
|
+
eventTasks: Object | undefined,
|
|
120
128
|
},
|
|
121
129
|
};
|
|
@@ -16,7 +16,6 @@ import nicegui
|
|
|
16
16
|
from .types import (
|
|
17
17
|
_T_event_name,
|
|
18
18
|
)
|
|
19
|
-
from ex4nicegui.reactive.deferredTask import DeferredTask
|
|
20
19
|
from .utils import get_bound_event_args, create_event_handler_args
|
|
21
20
|
|
|
22
21
|
NG_ROOT = Path(nicegui.__file__).parent / "elements"
|
|
@@ -28,9 +27,9 @@ class echarts(Element, component="ECharts.js", dependencies=libraries): # type:
|
|
|
28
27
|
self,
|
|
29
28
|
options: Optional[dict] = None,
|
|
30
29
|
code: Optional[str] = None,
|
|
30
|
+
init_options: Optional[dict] = None,
|
|
31
31
|
) -> None:
|
|
32
32
|
super().__init__()
|
|
33
|
-
self.__deferred_task = DeferredTask()
|
|
34
33
|
|
|
35
34
|
if (options is None) and (bool(code) is False):
|
|
36
35
|
raise ValueError("At least one of options and code must be valid.")
|
|
@@ -45,6 +44,8 @@ class echarts(Element, component="ECharts.js", dependencies=libraries): # type:
|
|
|
45
44
|
|
|
46
45
|
self._props["options"] = options
|
|
47
46
|
self._props["code"] = code
|
|
47
|
+
self._props["initOptions"] = init_options
|
|
48
|
+
self._props["eventTasks"] = {}
|
|
48
49
|
|
|
49
50
|
def update_chart(
|
|
50
51
|
self,
|
|
@@ -107,9 +108,7 @@ class echarts(Element, component="ECharts.js", dependencies=libraries): # type:
|
|
|
107
108
|
ui_event_name = f"chart:{event_name}"
|
|
108
109
|
super().on(ui_event_name, org_handler, args=get_bound_event_args(event_name))
|
|
109
110
|
|
|
110
|
-
|
|
111
|
-
def _():
|
|
112
|
-
self.run_method("echarts_on", ui_event_name, query)
|
|
111
|
+
self._props["eventTasks"][ui_event_name] = query
|
|
113
112
|
|
|
114
113
|
def run_chart_method(
|
|
115
114
|
self, name: str, *args, timeout: float = 1
|
ex4nicegui/reactive/base.py
CHANGED
|
@@ -48,7 +48,7 @@ _T_bind_classes_type = Union[
|
|
|
48
48
|
_T_bind_classes_type_ref_dict,
|
|
49
49
|
_T_bind_classes_type_single,
|
|
50
50
|
_T_bind_classes_type_array,
|
|
51
|
-
Dict[str, bool],
|
|
51
|
+
Dict[str, TMaybeRef[bool]],
|
|
52
52
|
List[str],
|
|
53
53
|
]
|
|
54
54
|
|
|
@@ -271,7 +271,7 @@ class BindableUi(Generic[TWidget]):
|
|
|
271
271
|
def bind_classes(self, classes: Dict[str, TGetterOrReadonlyRef[bool]]) -> Self: ...
|
|
272
272
|
|
|
273
273
|
@overload
|
|
274
|
-
def bind_classes(self, classes: Dict[str, bool]) -> Self: ...
|
|
274
|
+
def bind_classes(self, classes: Dict[str, TMaybeRef[bool]]) -> Self: ...
|
|
275
275
|
|
|
276
276
|
@overload
|
|
277
277
|
def bind_classes(self, classes: TGetterOrReadonlyRef[Dict[str, bool]]) -> Self: ...
|
|
@@ -27,9 +27,23 @@ class EChartsBindableUi(BindableUi[echarts]):
|
|
|
27
27
|
options: Optional[TMaybeRef[Dict]] = None,
|
|
28
28
|
not_merge: TMaybeRef[Union[bool, None]] = None,
|
|
29
29
|
code: Optional[str] = None,
|
|
30
|
+
init_options: Optional[Dict] = None,
|
|
30
31
|
) -> None:
|
|
32
|
+
"""Create a new ECharts instance.
|
|
33
|
+
|
|
34
|
+
@see - https://github.com/CrystalWindSnake/ex4nicegui/blob/main/README.en.md#rxuiecharts
|
|
35
|
+
@中文文档 - https://gitee.com/carson_add/ex4nicegui#rxuiecharts
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
options (Optional[TMaybeRef[Dict]], optional): echart options. Defaults to None.
|
|
39
|
+
not_merge (TMaybeRef[Union[bool, None]], optional): merge options when chart update. Defaults to None.
|
|
40
|
+
code (Optional[str], optional): javascript code to initialize echart. Defaults to None.
|
|
41
|
+
init_options (Optional[Dict], optional): echart initialization options. Defaults to None.
|
|
42
|
+
"""
|
|
31
43
|
pc = ParameterClassifier(
|
|
32
|
-
locals(),
|
|
44
|
+
locals(),
|
|
45
|
+
maybeRefs=["options", "code", "init_options"],
|
|
46
|
+
exclude=["not_merge"],
|
|
33
47
|
)
|
|
34
48
|
|
|
35
49
|
value_kws = pc.get_values_kws()
|
ex4nicegui/utils/proxy/string.py
CHANGED
|
@@ -58,8 +58,8 @@ class StringProxy(Proxy, str):
|
|
|
58
58
|
def count(
|
|
59
59
|
self,
|
|
60
60
|
sub: str,
|
|
61
|
-
start: Optional[SupportsIndex] =
|
|
62
|
-
end: Optional[SupportsIndex] =
|
|
61
|
+
start: Optional[SupportsIndex] = None,
|
|
62
|
+
end: Optional[SupportsIndex] = None,
|
|
63
63
|
/,
|
|
64
64
|
) -> int:
|
|
65
65
|
return self._ref.value.count(sub, start, end)
|
|
@@ -70,8 +70,8 @@ class StringProxy(Proxy, str):
|
|
|
70
70
|
def endswith(
|
|
71
71
|
self,
|
|
72
72
|
suffix: Union[str, Tuple[str, ...]],
|
|
73
|
-
start: Optional[SupportsIndex] =
|
|
74
|
-
end: Optional[SupportsIndex] =
|
|
73
|
+
start: Optional[SupportsIndex] = None,
|
|
74
|
+
end: Optional[SupportsIndex] = None,
|
|
75
75
|
/,
|
|
76
76
|
) -> bool:
|
|
77
77
|
return self._ref.value.endswith(suffix, start, end)
|
|
@@ -88,8 +88,8 @@ class StringProxy(Proxy, str):
|
|
|
88
88
|
def find(
|
|
89
89
|
self,
|
|
90
90
|
sub: str,
|
|
91
|
-
start: Optional[SupportsIndex] =
|
|
92
|
-
end: Optional[SupportsIndex] =
|
|
91
|
+
start: Optional[SupportsIndex] = None,
|
|
92
|
+
end: Optional[SupportsIndex] = None,
|
|
93
93
|
/,
|
|
94
94
|
) -> int:
|
|
95
95
|
return self._ref.value.find(sub, start, end)
|
|
@@ -109,8 +109,8 @@ class StringProxy(Proxy, str):
|
|
|
109
109
|
def index(
|
|
110
110
|
self,
|
|
111
111
|
sub: str,
|
|
112
|
-
start: Optional[SupportsIndex] =
|
|
113
|
-
end: Optional[SupportsIndex] =
|
|
112
|
+
start: Optional[SupportsIndex] = None,
|
|
113
|
+
end: Optional[SupportsIndex] = None,
|
|
114
114
|
/,
|
|
115
115
|
) -> int:
|
|
116
116
|
return self._ref.value.index(sub, start, end)
|
|
@@ -230,8 +230,8 @@ class StringProxy(Proxy, str):
|
|
|
230
230
|
def rfind(
|
|
231
231
|
self,
|
|
232
232
|
sub: str,
|
|
233
|
-
start: Optional[SupportsIndex] =
|
|
234
|
-
end: Optional[SupportsIndex] =
|
|
233
|
+
start: Optional[SupportsIndex] = None,
|
|
234
|
+
end: Optional[SupportsIndex] = None,
|
|
235
235
|
/,
|
|
236
236
|
) -> int:
|
|
237
237
|
return self._ref.value.rfind(sub, start, end)
|
|
@@ -239,8 +239,8 @@ class StringProxy(Proxy, str):
|
|
|
239
239
|
def rindex(
|
|
240
240
|
self,
|
|
241
241
|
sub: str,
|
|
242
|
-
start: Optional[SupportsIndex] =
|
|
243
|
-
end: Optional[SupportsIndex] =
|
|
242
|
+
start: Optional[SupportsIndex] = None,
|
|
243
|
+
end: Optional[SupportsIndex] = None,
|
|
244
244
|
/,
|
|
245
245
|
) -> int:
|
|
246
246
|
return self._ref.value.rindex(sub, start, end)
|
|
@@ -263,16 +263,6 @@ class StringProxy(Proxy, str):
|
|
|
263
263
|
def rpartition(self, sep: str, /) -> Tuple[str, str, str]:
|
|
264
264
|
return self._ref.value.rpartition(sep)
|
|
265
265
|
|
|
266
|
-
@overload
|
|
267
|
-
def rsplit(
|
|
268
|
-
self: LiteralString,
|
|
269
|
-
sep: Optional[LiteralString] = None,
|
|
270
|
-
maxsplit: SupportsIndex = -1,
|
|
271
|
-
) -> List[LiteralString]: ...
|
|
272
|
-
@overload
|
|
273
|
-
def rsplit(
|
|
274
|
-
self, sep: Optional[str] = None, maxsplit: SupportsIndex = -1
|
|
275
|
-
) -> List[str]: ... # type: ignore[misc]
|
|
276
266
|
def rsplit(
|
|
277
267
|
self, sep: Optional[str] = None, maxsplit: SupportsIndex = -1
|
|
278
268
|
) -> List[str]:
|
|
@@ -312,8 +302,8 @@ class StringProxy(Proxy, str):
|
|
|
312
302
|
def startswith(
|
|
313
303
|
self,
|
|
314
304
|
prefix: Union[str, Tuple[str, ...]],
|
|
315
|
-
start: Optional[SupportsIndex] =
|
|
316
|
-
end: Optional[SupportsIndex] =
|
|
305
|
+
start: Optional[SupportsIndex] = None,
|
|
306
|
+
end: Optional[SupportsIndex] = None,
|
|
317
307
|
/,
|
|
318
308
|
) -> bool:
|
|
319
309
|
return self._ref.value.startswith(prefix, start, end)
|
|
@@ -71,12 +71,12 @@ ex4nicegui/libs/gsap/utils/matrix.js,sha256=77scrxbQZXx4ex5HkvnT9IkhMG1rQoDNp4TS
|
|
|
71
71
|
ex4nicegui/libs/gsap/utils/paths.js,sha256=2SPaRHQ7zgba9cH8hGhkTYPCZdrrEhE2qhh6ECAEvSA,49314
|
|
72
72
|
ex4nicegui/libs/gsap/utils/strings.js,sha256=47G9slz5ltG9mDSwrfQDtWzzdV5QJ-AIMLRMNK0VSiM,10472
|
|
73
73
|
ex4nicegui/reactive/__init__.py,sha256=_VDZ79Gp9lo2NlaKKKT6rvrMWVNkUzTBHQnn0e6Q8Gk,4374
|
|
74
|
-
ex4nicegui/reactive/base.py,sha256=
|
|
74
|
+
ex4nicegui/reactive/base.py,sha256=aaNgolaDQMuMy_c2XCAtdRpOSXsn2engdJZoWqj9WU8,15926
|
|
75
75
|
ex4nicegui/reactive/deferredTask.py,sha256=g78TTG1EIkBxjPih01xmrCZw9OxQG93veSVSELWKfcU,987
|
|
76
76
|
ex4nicegui/reactive/dropZone/dropZone.js,sha256=7rSpFJX-Fk_W_NGZhOTyuEw0bzR-YUc8ZYPzQG9KzE0,2713
|
|
77
77
|
ex4nicegui/reactive/dropZone/dropZone.py,sha256=hg9UKTayff8v8Ek-n38h_3wX1Qmiotvdyv1Hsqilh5Y,2590
|
|
78
|
-
ex4nicegui/reactive/EChartsComponent/ECharts.js,sha256=
|
|
79
|
-
ex4nicegui/reactive/EChartsComponent/ECharts.py,sha256=
|
|
78
|
+
ex4nicegui/reactive/EChartsComponent/ECharts.js,sha256=K9sX34SMnghwDMCkl-IA7WsntxyryeRsboihkIwDb84,3852
|
|
79
|
+
ex4nicegui/reactive/EChartsComponent/ECharts.py,sha256=jLRdKqJWCtKHzNlFAX9ePAmzP1WSXRzBQAO0KHHkfBA,4258
|
|
80
80
|
ex4nicegui/reactive/EChartsComponent/events.py,sha256=_BtmLRcAIZciDQT5i1eFc-r3e0pBnAabW1BSl6uzhCc,570
|
|
81
81
|
ex4nicegui/reactive/EChartsComponent/types.py,sha256=_7AekG0IyzRpDEBZMtKRiZ3o3dUCcn6btegBk8c9Fig,1001
|
|
82
82
|
ex4nicegui/reactive/EChartsComponent/utils.py,sha256=a5r2fghC6IIZbyfUUR8TEkpLj9HPbcf8QHEBatXaL2M,1463
|
|
@@ -105,7 +105,7 @@ ex4nicegui/reactive/officials/column.py,sha256=fllKknMEUw7uNhmP7w4pgBT7HTDbpkN-d
|
|
|
105
105
|
ex4nicegui/reactive/officials/date.py,sha256=lRiJNrgs_oNo9AZTfTX_66dYL7az4co5rfRyIzvGAIo,2440
|
|
106
106
|
ex4nicegui/reactive/officials/dialog.py,sha256=3dyrvsUwM1Q7jr_PgLKt92KDA6Hris0DH90-sKamfFE,1297
|
|
107
107
|
ex4nicegui/reactive/officials/drawer.py,sha256=_Ro6stOh8U3igYMeDwI4omBgi1nld5berrAk9Dv5RVw,2346
|
|
108
|
-
ex4nicegui/reactive/officials/echarts.py,sha256=
|
|
108
|
+
ex4nicegui/reactive/officials/echarts.py,sha256=xRBKVbcCUwUGA8n7bw2eJj9FBQIayL4t_rzXZrjD3Pc,10895
|
|
109
109
|
ex4nicegui/reactive/officials/element.py,sha256=-qsHcxfF3fMfU0sJlKtTksX_wYPMIPJ_AgFcZbbI754,412
|
|
110
110
|
ex4nicegui/reactive/officials/expansion.py,sha256=8xwJa0SpsVhFxbYwYRZtf1ul9m4oYTjgmtrRI_lqF_0,1822
|
|
111
111
|
ex4nicegui/reactive/officials/grid.py,sha256=Bq83jejsxQSYVc9O1IE6JUgUndUm1uexb4fq9EZWjHQ,921
|
|
@@ -169,7 +169,7 @@ ex4nicegui/utils/proxy/dict.py,sha256=r3qMT2RRvi2aUs8kzav2iNMGgBrFUWKsbHCAuz4P0F
|
|
|
169
169
|
ex4nicegui/utils/proxy/float.py,sha256=fdMUS7_xwypdDNscuZaUn3NA0vx8LGswAOc9kw0jK0c,5271
|
|
170
170
|
ex4nicegui/utils/proxy/int.py,sha256=0Y7L924Zzq6LWRZEmaTmoXf0J6kC0o5EtW--2Lk7SNw,7381
|
|
171
171
|
ex4nicegui/utils/proxy/list.py,sha256=bmjBMlO8UfJekL1nfGypMO21RKraIj1jw46-8QwfptE,4913
|
|
172
|
-
ex4nicegui/utils/proxy/string.py,sha256=
|
|
172
|
+
ex4nicegui/utils/proxy/string.py,sha256=BFZ5Uba47S68mMSoJFYFZqKjivJDz80vmEozxxfhUok,13861
|
|
173
173
|
ex4nicegui/utils/proxy/utils.py,sha256=8LawrZ8KmzP64iCmweFJh4kmwEvRxOp7MwV7AsnEMJM,148
|
|
174
174
|
ex4nicegui/utils/refComputed.py,sha256=Vb7fyi0wNieFeLfCjXl6wSzpws3i6_aeCka1s9dsc8E,4232
|
|
175
175
|
ex4nicegui/utils/refWrapper.py,sha256=gX5sdfC1P4UXmMYM6FwdImfLD39y02kq7Af6dIMDrZ8,1472
|
|
@@ -177,7 +177,7 @@ ex4nicegui/utils/scheduler.py,sha256=1gyq7Y2BkbwmPK_Q9kpRpc1MOC9H7xcpxuix-RZhN9k
|
|
|
177
177
|
ex4nicegui/utils/signals.py,sha256=Jz0jKFPrJIRV0Gye62Bgk2kGgod1KBvDhnF-W3lRm04,7373
|
|
178
178
|
ex4nicegui/utils/types.py,sha256=pE5WOSbcTHxaAhnT24FaZEd1B2Z_lTcsd46w0OKiMyc,359
|
|
179
179
|
ex4nicegui/version.py,sha256=NE7u1piESstg3xCtf5hhV4iedGs2qJQw9SiC3ZSpiio,90
|
|
180
|
-
ex4nicegui-0.8.
|
|
181
|
-
ex4nicegui-0.8.
|
|
182
|
-
ex4nicegui-0.8.
|
|
183
|
-
ex4nicegui-0.8.
|
|
180
|
+
ex4nicegui-0.8.2.dist-info/LICENSE,sha256=0KDDElS2dl-HIsWvbpy8ywbLzJMBFzXLev57LnMIZXs,1094
|
|
181
|
+
ex4nicegui-0.8.2.dist-info/METADATA,sha256=U0v4tjvnuTjqwgnb9sMNV-hLpvuyW7yYEgopZcEMxas,42343
|
|
182
|
+
ex4nicegui-0.8.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
183
|
+
ex4nicegui-0.8.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|