streamlit-nightly 1.32.3.dev20240331__py2.py3-none-any.whl → 1.32.3.dev20240402__py2.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.
- streamlit/elements/arrow_altair.py +2 -16
- streamlit/elements/html.py +7 -3
- streamlit/elements/image.py +4 -2
- streamlit/elements/media.py +73 -21
- streamlit/runtime/fragment.py +102 -31
- streamlit/runtime/runtime_util.py +1 -42
- streamlit/static/asset-manifest.json +3 -3
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{43.76c54963.chunk.js → 43.9ae03282.chunk.js} +1 -1
- streamlit/static/static/js/{main.356407e8.js → main.6d659dbc.js} +2 -2
- streamlit/testing/v1/app_test.py +10 -4
- streamlit/testing/v1/element_tree.py +4 -0
- {streamlit_nightly-1.32.3.dev20240331.dist-info → streamlit_nightly-1.32.3.dev20240402.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.32.3.dev20240331.dist-info → streamlit_nightly-1.32.3.dev20240402.dist-info}/RECORD +19 -19
- /streamlit/static/static/js/{main.356407e8.js.LICENSE.txt → main.6d659dbc.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.32.3.dev20240331.data → streamlit_nightly-1.32.3.dev20240402.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.32.3.dev20240331.dist-info → streamlit_nightly-1.32.3.dev20240402.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.32.3.dev20240331.dist-info → streamlit_nightly-1.32.3.dev20240402.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.32.3.dev20240331.dist-info → streamlit_nightly-1.32.3.dev20240402.dist-info}/top_level.txt +0 -0
@@ -1171,20 +1171,6 @@ def _get_opacity_encoding(
|
|
1171
1171
|
return None
|
1172
1172
|
|
1173
1173
|
|
1174
|
-
def _get_scale(df: pd.DataFrame, column_name: str | None) -> alt.Scale:
|
1175
|
-
import altair as alt
|
1176
|
-
|
1177
|
-
# Set the X and Y axes' scale to "utc" if they contain date values.
|
1178
|
-
# This causes time data to be displayed in UTC, rather the user's local
|
1179
|
-
# time zone. (By default, vega-lite displays time data in the browser's
|
1180
|
-
# local time zone, regardless of which time zone the data specifies:
|
1181
|
-
# https://vega.github.io/vega-lite/docs/timeunit.html#output).
|
1182
|
-
if _is_date_column(df, column_name):
|
1183
|
-
return alt.Scale(type="utc")
|
1184
|
-
|
1185
|
-
return alt.Scale()
|
1186
|
-
|
1187
|
-
|
1188
1174
|
def _get_axis_config(df: pd.DataFrame, column_name: str | None, grid: bool) -> alt.Axis:
|
1189
1175
|
import altair as alt
|
1190
1176
|
from pandas.api.types import is_integer_dtype
|
@@ -1266,7 +1252,7 @@ def _get_x_encoding(
|
|
1266
1252
|
x_field,
|
1267
1253
|
title=x_title,
|
1268
1254
|
type=_get_x_encoding_type(df, chart_type, x_column),
|
1269
|
-
scale=
|
1255
|
+
scale=alt.Scale(),
|
1270
1256
|
axis=_get_axis_config(df, x_column, grid=False),
|
1271
1257
|
)
|
1272
1258
|
|
@@ -1305,7 +1291,7 @@ def _get_y_encoding(
|
|
1305
1291
|
field=y_field,
|
1306
1292
|
title=y_title,
|
1307
1293
|
type=_get_y_encoding_type(df, y_column),
|
1308
|
-
scale=
|
1294
|
+
scale=alt.Scale(),
|
1309
1295
|
axis=_get_axis_config(df, y_column, grid=True),
|
1310
1296
|
)
|
1311
1297
|
|
streamlit/elements/html.py
CHANGED
@@ -34,10 +34,14 @@ class HtmlMixin:
|
|
34
34
|
"""Insert HTML into your app.
|
35
35
|
|
36
36
|
Adding custom HTML to your app impacts safety, styling, and
|
37
|
-
maintainability.
|
38
|
-
|
37
|
+
maintainability. We sanitize HTML with `DOMPurify
|
38
|
+
<https://github.com/cure53/DOMPurify>`_, but inserting HTML remains a
|
39
|
+
developer risk. Passing untrusted code to ``st.html`` or dynamically
|
40
|
+
loading external code can increase the risk of vulnerabilities in your
|
41
|
+
app.
|
39
42
|
|
40
|
-
|
43
|
+
``st.html`` content is **not** iframed. Executing JavaScript is not
|
44
|
+
supported at this time.
|
41
45
|
|
42
46
|
Parameters
|
43
47
|
----------
|
streamlit/elements/image.py
CHANGED
@@ -52,7 +52,7 @@ MAXIMUM_CONTENT_WIDTH: Final[int] = 2 * 730
|
|
52
52
|
PILImage: TypeAlias = Union[
|
53
53
|
"ImageFile.ImageFile", "Image.Image", "GifImagePlugin.GifImageFile"
|
54
54
|
]
|
55
|
-
AtomicImage: TypeAlias = Union[PILImage, "npt.NDArray[Any]", io.BytesIO, str]
|
55
|
+
AtomicImage: TypeAlias = Union[PILImage, "npt.NDArray[Any]", io.BytesIO, str, bytes]
|
56
56
|
ImageOrImageList: TypeAlias = Union[AtomicImage, List[AtomicImage]]
|
57
57
|
UseColumnWith: TypeAlias = Union[Literal["auto", "always", "never"], bool, None]
|
58
58
|
Channels: TypeAlias = Literal["RGB", "BGR"]
|
@@ -296,7 +296,9 @@ def _ensure_image_size_and_format(
|
|
296
296
|
if width > 0 and actual_width > width:
|
297
297
|
# We need to resize the image.
|
298
298
|
new_height = int(1.0 * actual_height * width / actual_width)
|
299
|
-
pil_image = pil_image.resize(
|
299
|
+
pil_image = pil_image.resize(
|
300
|
+
(width, new_height), resample=Image.Resampling.BILINEAR
|
301
|
+
)
|
300
302
|
return _PIL_to_bytes(pil_image, format=image_format, quality=90)
|
301
303
|
|
302
304
|
if pil_image.format != image_format:
|
streamlit/elements/media.py
CHANGED
@@ -30,7 +30,7 @@ from streamlit.proto.Audio_pb2 import Audio as AudioProto
|
|
30
30
|
from streamlit.proto.Video_pb2 import Video as VideoProto
|
31
31
|
from streamlit.runtime import caching
|
32
32
|
from streamlit.runtime.metrics_util import gather_metrics
|
33
|
-
from streamlit.
|
33
|
+
from streamlit.time_util import time_to_seconds
|
34
34
|
|
35
35
|
if TYPE_CHECKING:
|
36
36
|
from typing import Any
|
@@ -84,29 +84,63 @@ class MediaMixin:
|
|
84
84
|
http://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx
|
85
85
|
|
86
86
|
format : str
|
87
|
-
The mime type for the audio file. Defaults to
|
87
|
+
The mime type for the audio file. Defaults to ``"audio/wav"``.
|
88
88
|
See https://tools.ietf.org/html/rfc4281 for more info.
|
89
89
|
|
90
|
-
start_time: int
|
91
|
-
The time from which
|
92
|
-
|
90
|
+
start_time: int, float, timedelta, str, or None
|
91
|
+
The time from which the element should start playing. This can be
|
92
|
+
one of the following:
|
93
|
+
|
94
|
+
* ``None`` (default): The element plays from the beginning.
|
95
|
+
* An``int`` or ``float`` specifying the time in seconds. ``float``
|
96
|
+
values are rounded down to whole seconds.
|
97
|
+
* A string specifying the time in a format supported by `Pandas'
|
98
|
+
Timedelta constructor <https://pandas.pydata.org/docs/reference/api/pandas.Timedelta.html>`_,
|
99
|
+
e.g. ``"2 minute"``, ``"20s"``, or ``"1m14s"``.
|
100
|
+
* A ``timedelta`` object from `Python's built-in datetime library
|
101
|
+
<https://docs.python.org/3/library/datetime.html#timedelta-objects>`_,
|
102
|
+
e.g. ``timedelta(seconds=70)``.
|
93
103
|
sample_rate: int or None
|
94
104
|
The sample rate of the audio data in samples per second. Only required if
|
95
105
|
``data`` is a numpy array.
|
96
|
-
end_time: int
|
97
|
-
The time at which
|
106
|
+
end_time: int, float, timedelta, str, or None
|
107
|
+
The time at which the element should stop playing. This can be
|
108
|
+
one of the following:
|
109
|
+
|
110
|
+
* ``None`` (default): The element plays through to the end.
|
111
|
+
* An ``int`` or ``float`` specifying the time in seconds. ``float``
|
112
|
+
values are rounded down to whole seconds.
|
113
|
+
* A string specifying the time in a format supported by `Pandas'
|
114
|
+
Timedelta constructor <https://pandas.pydata.org/docs/reference/api/pandas.Timedelta.html>`_,
|
115
|
+
e.g. ``"2 minute"``, ``"20s"``, or ``"1m14s"``.
|
116
|
+
* A ``timedelta`` object from `Python's built-in datetime library
|
117
|
+
<https://docs.python.org/3/library/datetime.html#timedelta-objects>`_,
|
118
|
+
e.g. ``timedelta(seconds=70)``.
|
98
119
|
loop: bool
|
99
120
|
Whether the audio should loop playback.
|
100
121
|
|
101
|
-
|
102
|
-
|
122
|
+
Examples
|
123
|
+
--------
|
124
|
+
To display an audio player for a local file, specify the file's string
|
125
|
+
path and format.
|
126
|
+
|
127
|
+
>>> import streamlit as st
|
128
|
+
>>>
|
129
|
+
>>> st.audio("cat-purr.mp3", format="audio/mpeg", loop=True)
|
130
|
+
|
131
|
+
.. output::
|
132
|
+
https://doc-audio-purr.streamlit.app/
|
133
|
+
height: 250px
|
134
|
+
|
135
|
+
You can also pass ``bytes`` or ``numpy.ndarray`` objects to ``st.audio``.
|
136
|
+
|
103
137
|
>>> import streamlit as st
|
104
138
|
>>> import numpy as np
|
105
139
|
>>>
|
106
|
-
>>> audio_file = open(
|
140
|
+
>>> audio_file = open("myaudio.ogg", "rb")
|
107
141
|
>>> audio_bytes = audio_file.read()
|
108
142
|
>>>
|
109
|
-
>>> st.audio(audio_bytes, format=
|
143
|
+
>>> st.audio(audio_bytes, format="audio/ogg")
|
110
144
|
>>>
|
111
145
|
>>> sample_rate = 44100 # 44100 samples per second
|
112
146
|
>>> seconds = 2 # Note duration of 2 seconds
|
@@ -177,9 +211,19 @@ class MediaMixin:
|
|
177
211
|
The mime type for the video file. Defaults to ``"video/mp4"``.
|
178
212
|
See https://tools.ietf.org/html/rfc4281 for more info.
|
179
213
|
|
180
|
-
start_time: int
|
181
|
-
The time from which
|
182
|
-
|
214
|
+
start_time: int, float, timedelta, str, or None
|
215
|
+
The time from which the element should start playing. This can be
|
216
|
+
one of the following:
|
217
|
+
|
218
|
+
* ``None`` (default): The element plays from the beginning.
|
219
|
+
* An``int`` or ``float`` specifying the time in seconds. ``float``
|
220
|
+
values are rounded down to whole seconds.
|
221
|
+
* A string specifying the time in a format supported by `Pandas'
|
222
|
+
Timedelta constructor <https://pandas.pydata.org/docs/reference/api/pandas.Timedelta.html>`_,
|
223
|
+
e.g. ``"2 minute"``, ``"20s"``, or ``"1m14s"``.
|
224
|
+
* A ``timedelta`` object from `Python's built-in datetime library
|
225
|
+
<https://docs.python.org/3/library/datetime.html#timedelta-objects>`_,
|
226
|
+
e.g. ``timedelta(seconds=70)``.
|
183
227
|
subtitles: str, bytes, Path, io.BytesIO, or dict
|
184
228
|
Optional subtitle data for the video, supporting several input types:
|
185
229
|
|
@@ -204,9 +248,19 @@ class MediaMixin:
|
|
204
248
|
in a dictrionary's first pair: ``{"None": "", "English": "path/to/english.vtt"}``
|
205
249
|
|
206
250
|
Not supported for YouTube videos.
|
207
|
-
|
208
|
-
|
209
|
-
|
251
|
+
end_time: int, float, timedelta, str, or None
|
252
|
+
The time at which the element should stop playing. This can be
|
253
|
+
one of the following:
|
254
|
+
|
255
|
+
* ``None`` (default): The element plays through to the end.
|
256
|
+
* An ``int`` or ``float`` specifying the time in seconds. ``float``
|
257
|
+
values are rounded down to whole seconds.
|
258
|
+
* A string specifying the time in a format supported by `Pandas'
|
259
|
+
Timedelta constructor <https://pandas.pydata.org/docs/reference/api/pandas.Timedelta.html>`_,
|
260
|
+
e.g. ``"2 minute"``, ``"20s"``, or ``"1m14s"``.
|
261
|
+
* A ``timedelta`` object from `Python's built-in datetime library
|
262
|
+
<https://docs.python.org/3/library/datetime.html#timedelta-objects>`_,
|
263
|
+
e.g. ``timedelta(seconds=70)``.
|
210
264
|
loop: bool
|
211
265
|
Whether the video should loop playback.
|
212
266
|
|
@@ -484,7 +538,7 @@ def _parse_start_time_end_time(
|
|
484
538
|
"""Parse start_time and end_time and return them as int."""
|
485
539
|
|
486
540
|
try:
|
487
|
-
maybe_start_time =
|
541
|
+
maybe_start_time = time_to_seconds(start_time, coerce_none_to_inf=False)
|
488
542
|
if maybe_start_time is None:
|
489
543
|
raise ValueError
|
490
544
|
start_time = int(maybe_start_time)
|
@@ -495,9 +549,7 @@ def _parse_start_time_end_time(
|
|
495
549
|
raise StreamlitAPIException(error_msg) from None
|
496
550
|
|
497
551
|
try:
|
498
|
-
|
499
|
-
# when PR #8343 is merged.
|
500
|
-
end_time = duration_to_seconds(end_time, coerce_none_to_inf=False)
|
552
|
+
end_time = time_to_seconds(end_time, coerce_none_to_inf=False)
|
501
553
|
if end_time is not None:
|
502
554
|
end_time = int(end_time)
|
503
555
|
except StreamlitAPIException:
|
streamlit/runtime/fragment.py
CHANGED
@@ -119,43 +119,114 @@ def fragment(
|
|
119
119
|
*,
|
120
120
|
run_every: int | float | timedelta | str | None = None,
|
121
121
|
) -> Callable[[F], F] | F:
|
122
|
-
"""
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
122
|
+
"""Decorator to turn a function into a fragment which can rerun independently\
|
123
|
+
of the full script.
|
124
|
+
|
125
|
+
When a user interacts with an input widget created by a fragment, Streamlit
|
126
|
+
only reruns the fragment instead of the full script. If ``run_every`` is set,
|
127
|
+
Streamlit will also rerun the fragment at the specified interval while the
|
128
|
+
session is active, even if the user is not interacting with your app.
|
129
|
+
|
130
|
+
To trigger a full script rerun from inside a fragment, call ``st.rerun()``
|
131
|
+
directly. Any values from the fragment that need to be accessed from
|
132
|
+
the wider app should generally be stored in Session State.
|
133
|
+
|
134
|
+
When Streamlit element commands are called directly in a fragment, the
|
135
|
+
elements are cleared and redrawn on each fragment rerun, just like all
|
136
|
+
elements are redrawn on each full-script rerun. The rest of the app is
|
137
|
+
persisted during a fragment rerun. When a fragment renders elements into
|
138
|
+
externally created containers, the elements will not be cleared with each
|
139
|
+
fragment rerun. In this case, elements will accumulate in those containers
|
140
|
+
with each fragment rerun, until the next full-script rerun.
|
141
|
+
|
142
|
+
Calling `st.sidebar` in a fragment is not supported. To write elements to
|
143
|
+
the sidebar with a fragment, call your fragment funciton inside a
|
144
|
+
`with st.sidebar` context manager.
|
145
|
+
|
146
|
+
Fragment code can interact with Session State, imported modules, and
|
147
|
+
other Streamlit elements created outside the fragment. Note that these
|
148
|
+
interactions are additive across multiple fragment reruns. You are
|
149
|
+
responsible for handling any side effects of that behavior.
|
127
150
|
|
128
151
|
Parameters
|
129
152
|
----------
|
130
|
-
|
131
|
-
|
132
|
-
time interval.
|
153
|
+
func: callable
|
154
|
+
The function to turn into a fragment.
|
133
155
|
|
134
|
-
|
135
|
-
|
156
|
+
run_every: int, float, timedelta, str, or None
|
157
|
+
The time interval between automatic fragment reruns. This can be one of
|
158
|
+
the following:
|
159
|
+
|
160
|
+
* ``None`` (default).
|
161
|
+
* An ``int`` or ``float`` specifying the interval in seconds.
|
162
|
+
* A string specifying the time in a format supported by `Pandas'
|
163
|
+
Timedelta constructor <https://pandas.pydata.org/docs/reference/api/pandas.Timedelta.html>`_,
|
164
|
+
e.g. ``"1d"``, ``"1.5 days"``, or ``"1h23s"``.
|
165
|
+
* A ``timedelta`` object from `Python's built-in datetime library
|
166
|
+
<https://docs.python.org/3/library/datetime.html#timedelta-objects>`_,
|
167
|
+
e.g. ``timedelta(days=1)``.
|
168
|
+
|
169
|
+
If ``run_every`` is ``None``, the fragment will only rerun from
|
170
|
+
user-triggered events.
|
171
|
+
|
172
|
+
Examples
|
173
|
+
--------
|
136
174
|
The following example demonstrates basic usage of ``@st.experimental_fragment``. In
|
137
|
-
this app, clicking
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
fragment
|
175
|
+
this app, clicking "Rerun full script" will increment both counters and
|
176
|
+
update all values displayed in the app. In contrast, clicking "Rerun fragment"
|
177
|
+
will only increment the counter within the fragment. In this case, the
|
178
|
+
``st.write`` command inside the fragment will update the app's frontend,
|
179
|
+
but the two ``st.write`` commands outside the fragment will not update the
|
180
|
+
frontend.
|
181
|
+
|
182
|
+
>>> import streamlit as st
|
183
|
+
>>>
|
184
|
+
>>> if "script_runs" not in st.session_state:
|
185
|
+
>>> st.session_state.script_runs = 0
|
186
|
+
>>> st.session_state.fragment_runs = 0
|
187
|
+
>>>
|
188
|
+
>>> @st.experimental_fragment
|
189
|
+
>>> def fragment():
|
190
|
+
>>> st.session_state.fragment_runs += 1
|
191
|
+
>>> st.button("Rerun fragment")
|
192
|
+
>>> st.write(f"Fragment says it ran {st.session_state.fragment_runs} times.")
|
193
|
+
>>>
|
194
|
+
>>> st.session_state.script_runs += 1
|
195
|
+
>>> fragment()
|
196
|
+
>>> st.button("Rerun full script")
|
197
|
+
>>> st.write(f"Full script says it ran {st.session_state.script_runs} times.")
|
198
|
+
>>> st.write(f"Full script sees that fragment ran {st.session_state.fragment_runs} times.")
|
199
|
+
|
200
|
+
.. output::
|
201
|
+
https://doc-fragment.streamlit.app/
|
202
|
+
height: 400px
|
203
|
+
|
204
|
+
You can also trigger a full-script rerun from inside a fragment by calling
|
205
|
+
``st.rerun``.
|
206
|
+
|
207
|
+
>>> import streamlit as st
|
208
|
+
>>>
|
209
|
+
>>> if "clicks" not in st.session_state:
|
210
|
+
>>> st.session_state.clicks = 0
|
211
|
+
>>>
|
212
|
+
>>> @st.experimental_fragment
|
213
|
+
>>> def count_to_five():
|
214
|
+
>>> if st.button("Plus one!"):
|
215
|
+
>>> st.session_state.clicks += 1
|
216
|
+
>>> if st.session_state.clicks % 5 == 0:
|
217
|
+
>>> st.rerun()
|
218
|
+
>>> return
|
219
|
+
>>>
|
220
|
+
>>> count_to_five()
|
221
|
+
>>> st.header(f"Multiples of five clicks: {st.session_state.clicks // 5}")
|
222
|
+
>>>
|
223
|
+
>>> if st.button("Check click count"):
|
224
|
+
>>> st.toast(f"## Total clicks: {st.session_state.clicks}")
|
225
|
+
|
226
|
+
.. output::
|
227
|
+
https://doc-fragment-rerun.streamlit.app/
|
228
|
+
height: 400px
|
154
229
|
|
155
|
-
st.button("rerun full script")
|
156
|
-
st.write(f"full script runs: {st.session_state.script_runs}")
|
157
|
-
st.session_state.script_runs += 1
|
158
|
-
```
|
159
230
|
"""
|
160
231
|
|
161
232
|
if func is None:
|
@@ -16,9 +16,7 @@
|
|
16
16
|
|
17
17
|
from __future__ import annotations
|
18
18
|
|
19
|
-
import
|
20
|
-
from datetime import timedelta
|
21
|
-
from typing import Any, Literal, overload
|
19
|
+
from typing import Any
|
22
20
|
|
23
21
|
from streamlit import config
|
24
22
|
from streamlit.errors import MarkdownFormattedException, StreamlitAPIException
|
@@ -75,45 +73,6 @@ def is_cacheable_msg(msg: ForwardMsg) -> bool:
|
|
75
73
|
return msg.ByteSize() >= int(config.get_option("global.minCachedMessageSize"))
|
76
74
|
|
77
75
|
|
78
|
-
@overload
|
79
|
-
def duration_to_seconds(
|
80
|
-
ttl: float | timedelta | str | None, *, coerce_none_to_inf: Literal[False]
|
81
|
-
) -> float | None:
|
82
|
-
...
|
83
|
-
|
84
|
-
|
85
|
-
@overload
|
86
|
-
def duration_to_seconds(ttl: float | timedelta | str | None) -> float:
|
87
|
-
...
|
88
|
-
|
89
|
-
|
90
|
-
def duration_to_seconds(
|
91
|
-
ttl: float | timedelta | str | None, *, coerce_none_to_inf: bool = True
|
92
|
-
) -> float | None:
|
93
|
-
"""
|
94
|
-
Convert a ttl value to a float representing "number of seconds".
|
95
|
-
"""
|
96
|
-
if coerce_none_to_inf and ttl is None:
|
97
|
-
return math.inf
|
98
|
-
if isinstance(ttl, timedelta):
|
99
|
-
return ttl.total_seconds()
|
100
|
-
if isinstance(ttl, str):
|
101
|
-
import numpy as np
|
102
|
-
import pandas as pd
|
103
|
-
|
104
|
-
try:
|
105
|
-
out: float = pd.Timedelta(ttl).total_seconds()
|
106
|
-
except ValueError as ex:
|
107
|
-
raise BadDurationStringError(ttl) from ex
|
108
|
-
|
109
|
-
if np.isnan(out):
|
110
|
-
raise BadDurationStringError(ttl)
|
111
|
-
|
112
|
-
return out
|
113
|
-
|
114
|
-
return ttl
|
115
|
-
|
116
|
-
|
117
76
|
def serialize_forward_msg(msg: ForwardMsg) -> bytes:
|
118
77
|
"""Serialize a ForwardMsg to send to a client.
|
119
78
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"files": {
|
3
3
|
"main.css": "./static/css/main.bf304093.css",
|
4
|
-
"main.js": "./static/js/main.
|
4
|
+
"main.js": "./static/js/main.6d659dbc.js",
|
5
5
|
"static/js/9336.2d95d840.chunk.js": "./static/js/9336.2d95d840.chunk.js",
|
6
6
|
"static/js/9330.d29313d4.chunk.js": "./static/js/9330.d29313d4.chunk.js",
|
7
7
|
"static/js/7217.d970c074.chunk.js": "./static/js/7217.d970c074.chunk.js",
|
@@ -9,7 +9,7 @@
|
|
9
9
|
"static/css/3092.95a45cfe.chunk.css": "./static/css/3092.95a45cfe.chunk.css",
|
10
10
|
"static/js/3092.ad569cc8.chunk.js": "./static/js/3092.ad569cc8.chunk.js",
|
11
11
|
"static/css/43.e3b876c5.chunk.css": "./static/css/43.e3b876c5.chunk.css",
|
12
|
-
"static/js/43.
|
12
|
+
"static/js/43.9ae03282.chunk.js": "./static/js/43.9ae03282.chunk.js",
|
13
13
|
"static/js/8427.44d27448.chunk.js": "./static/js/8427.44d27448.chunk.js",
|
14
14
|
"static/js/7323.2808d029.chunk.js": "./static/js/7323.2808d029.chunk.js",
|
15
15
|
"static/js/4185.78230b2a.chunk.js": "./static/js/4185.78230b2a.chunk.js",
|
@@ -152,6 +152,6 @@
|
|
152
152
|
},
|
153
153
|
"entrypoints": [
|
154
154
|
"static/css/main.bf304093.css",
|
155
|
-
"static/js/main.
|
155
|
+
"static/js/main.6d659dbc.js"
|
156
156
|
]
|
157
157
|
}
|
streamlit/static/index.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.6d659dbc.js"></script><link href="./static/css/main.bf304093.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[43],{10043:(t,e,o)=>{o.r(e),o.d(e,{default:()=>
|
1
|
+
"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[43],{10043:(t,e,o)=>{o.r(e),o.d(e,{default:()=>D});var n=o(66845),i=o(25621),a=o(41558),s=o(95199),r=o(60784),l=o(23849),d=o(62622),c=o(63765),h=o(28391),g=o(96825),u=o.n(g),m=o(99394),f=o.n(m),p=o(92627);function b(t,e){const o={font:e.genericFonts.bodyFont,background:e.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:e.colors.headingColor,titleFontStyle:"normal",fontWeight:e.fontWeights.bold,fontSize:e.fontSizes.smPx+2,orient:"top",offset:26},header:{titleFontWeight:e.fontWeights.normal,titleFontSize:e.fontSizes.mdPx,titleColor:(0,p.Xy)(e),titleFontStyle:"normal",labelFontSize:e.fontSizes.twoSmPx,labelFontWeight:e.fontWeights.normal,labelColor:(0,p.Xy)(e),labelFontStyle:"normal"},axis:{labelFontSize:e.fontSizes.twoSmPx,labelFontWeight:e.fontWeights.normal,labelColor:(0,p.Xy)(e),labelFontStyle:"normal",titleFontWeight:e.fontWeights.normal,titleFontSize:e.fontSizes.smPx,titleColor:(0,p.Xy)(e),titleFontStyle:"normal",ticks:!1,gridColor:(0,p.ny)(e),domain:!1,domainWidth:1,domainColor:(0,p.ny)(e),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:e.spacing.lgPx,labelPadding:e.spacing.lgPx,labelSeparation:e.spacing.twoXSPx,labelOverlap:!0},legend:{labelFontSize:e.fontSizes.smPx,labelFontWeight:e.fontWeights.normal,labelColor:(0,p.Xy)(e),titleFontSize:e.fontSizes.smPx,titleFontWeight:e.fontWeights.normal,titleFontStyle:"normal",titleColor:(0,p.Xy)(e),titlePadding:5,labelPadding:e.spacing.lgPx,columnPadding:e.spacing.smPx,rowPadding:e.spacing.twoXSPx,padding:7,symbolStrokeWidth:4},range:{category:(0,p.iY)(e),diverging:(0,p.ru)(e),ramp:(0,p.Gy)(e),heatmap:(0,p.Gy)(e)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,...(0,p.Iy)(e)?{color:"#0068C9"}:{color:"#83C9FF"}},bar:{binSpacing:e.spacing.twoXSPx,discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return t?f()({},o,t,((t,e)=>Array.isArray(e)?e:void 0)):o}const y=(0,o(1515).Z)("div",{target:"egd2k5h0"})((t=>{let{theme:e}=t;return{"&.vega-embed":{"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&.has-actions":{paddingRight:0},".vega-actions":{zIndex:e.zIndices.popupMenu,backgroundColor:e.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:"1px solid ".concat(e.colors.fadedText10),a:{fontFamily:e.genericFonts.bodyFont,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.md,margin:0,padding:"".concat(e.spacing.twoXS," ").concat(e.spacing.twoXL),color:e.colors.bodyText},"a:hover":{backgroundColor:e.colors.secondaryBg,color:e.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},summary:{opacity:0,height:"auto",zIndex:e.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:e.radii.lg,color:e.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms","&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:e.colors.bodyText,opacity:"1 !important",background:e.colors.darkenedBgMix25}}}}}),"");var w=o(40864);const v={DATAFRAME_INDEX:"(index)"},x="source",S=new Set([h.GI.DatetimeIndex,h.GI.Float64Index,h.GI.Int64Index,h.GI.RangeIndex,h.GI.UInt64Index]);class F extends n.PureComponent{constructor(){super(...arguments),this.vegaView=void 0,this.vegaFinalizer=void 0,this.defaultDataName=x,this.element=null,this.state={error:void 0},this.finalizeView=()=>{this.vegaFinalizer&&this.vegaFinalizer(),this.vegaFinalizer=void 0,this.vegaView=void 0},this.generateSpec=()=>{var t,e;const{element:o,theme:n}=this.props,i=JSON.parse(o.spec),{useContainerWidth:a}=o;if("streamlit"===o.vegaLiteTheme?i.config=b(i.config,n):"streamlit"===(null===(t=i.usermeta)||void 0===t||null===(e=t.embedOptions)||void 0===e?void 0:e.theme)?(i.config=b(i.config,n),i.usermeta.embedOptions.theme=void 0):i.config=function(t,e){const{colors:o,fontSizes:n,genericFonts:i}=e,a={labelFont:i.bodyFont,titleFont:i.bodyFont,labelFontSize:n.twoSmPx,titleFontSize:n.twoSmPx},s={background:o.bgColor,axis:{labelColor:o.bodyText,titleColor:o.bodyText,gridColor:(0,p.ny)(e),...a},legend:{labelColor:o.bodyText,titleColor:o.bodyText,...a},title:{color:o.bodyText,subtitleColor:o.bodyText,...a},header:{labelColor:o.bodyText,titleColor:o.bodyText,...a},view:{stroke:(0,p.ny)(e),continuousHeight:350,continuousWidth:400},mark:{tooltip:!0}};return t?u()({},s,t):s}(i.config,n),this.props.height?(i.width=this.props.width,i.height=this.props.height):a&&(i.width=this.props.width),i.padding||(i.padding={}),null==i.padding.bottom&&(i.padding.bottom=20),i.datasets)throw new Error("Datasets should not be passed as part of the spec");return i}}async componentDidMount(){try{await this.createView()}catch(t){const e=(0,c.b)(t);this.setState({error:e})}}componentWillUnmount(){this.finalizeView()}async componentDidUpdate(t){const{element:e,theme:o}=t,{element:n,theme:i}=this.props,a=e.spec,{spec:s}=n;if(!this.vegaView||a!==s||o!==i||t.width!==this.props.width||t.height!==this.props.height||t.element.vegaLiteTheme!==this.props.element.vegaLiteTheme){(0,l.ji)("Vega spec changed.");try{await this.createView()}catch(u){const t=(0,c.b)(u);this.setState({error:t})}return}const r=e.data,{data:d}=n;(r||d)&&this.updateData(this.defaultDataName,r,d);const h=z(e)||{},g=z(n)||{};for(const[l,c]of Object.entries(g)){const t=l||this.defaultDataName,e=h[t];this.updateData(t,e,c)}for(const l of Object.keys(h))g.hasOwnProperty(l)||l===this.defaultDataName||this.updateData(l,null,null);this.vegaView.resize().runAsync()}updateData(t,e,o){if(!this.vegaView)throw new Error("Chart has not been drawn yet");if(!o||0===o.data.numRows){return void(this.vegaView._runtime.data.hasOwnProperty(t)&&this.vegaView.remove(t,s.truthy))}if(!e||0===e.data.numRows)return void this.vegaView.insert(t,C(o));const{dataRows:n,dataColumns:i}=e.dimensions,{dataRows:a,dataColumns:r}=o.dimensions;if(function(t,e,o,n,i,a){if(o!==a)return!1;if(e>=i)return!1;if(0===e)return!1;const s=a-1,r=e-1;if(t.getDataValue(0,s)!==n.getDataValue(0,s)||t.getDataValue(r,s)!==n.getDataValue(r,s))return!1;return!0}(e,n,i,o,a,r))n<a&&this.vegaView.insert(t,C(o,n));else{const e=s.changeset().remove(s.truthy).insert(C(o));this.vegaView.change(t,e),(0,l.ji)("Had to clear the ".concat(t," dataset before inserting data through Vega view."))}}async createView(){if((0,l.ji)("Creating a new Vega view."),!this.element)throw Error("Element missing.");this.finalizeView();const t=this.props.element,e=this.generateSpec(),o={ast:!0,expr:r.N,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:n,view:i,finalize:s}=await(0,a.ZP)(this.element,e,o);this.vegaView=i,this.vegaFinalizer=s;const d=function(t){const e=z(t);if(null==e)return null;const o={};for(const[n,i]of Object.entries(e))o[n]=C(i);return o}(t),c=d?Object.keys(d):[];if(1===c.length){const[t]=c;this.defaultDataName=t}else 0===c.length&&n.data&&(this.defaultDataName=x);const h=function(t){const e=t.data;if(!e||0===e.data.numRows)return null;return C(e)}(t);if(h&&i.insert(this.defaultDataName,h),d)for(const[a,r]of Object.entries(d))i.insert(a,r);await i.runAsync(),this.vegaView.resize().runAsync()}render(){if(this.state.error)throw this.state.error;return(0,w.jsx)(y,{"data-testid":"stArrowVegaLiteChart",ref:t=>{this.element=t}})}}function z(t){var e;if(0===(null===(e=t.datasets)||void 0===e?void 0:e.length))return null;const o={};return t.datasets.forEach((t=>{if(!t)return;const e=t.hasName?t.name:null;o[e]=t.data})),o}function C(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.isEmpty())return[];const o=[],{dataRows:n,dataColumns:i}=t.dimensions,a=h.fu.getTypeName(t.types.index[0]),s=S.has(a);for(let r=e;r<n;r++){const e={};if(s){const o=t.getIndexValue(r,0);e[v.DATAFRAME_INDEX]="bigint"===typeof o?Number(o):o}for(let o=0;o<i;o++){const n=t.getDataValue(r,o),i=t.types.data[o],a=h.fu.getTypeName(i);if("datetimetz"!==a&&(n instanceof Date||Number.isFinite(n))&&(a.startsWith("datetime")||"date"===a)){const i=60*new Date(n).getTimezoneOffset()*1e3;e[t.columns[0][o]]=n.valueOf()+i}else e[t.columns[0][o]]="bigint"===typeof n?Number(n):n}o.push(e)}return o}const D=(0,i.b)((0,d.Z)(F))}}]);
|