streamlit-nightly 1.39.1.dev20241030__py2.py3-none-any.whl → 1.39.1.dev20241101__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/commands/logo.py +3 -3
- streamlit/commands/navigation.py +48 -3
- streamlit/commands/page_config.py +3 -3
- streamlit/elements/image.py +26 -441
- streamlit/elements/layouts.py +12 -7
- streamlit/elements/lib/image_utils.py +433 -0
- streamlit/elements/markdown.py +6 -0
- streamlit/elements/metric.py +8 -5
- streamlit/elements/progress.py +2 -1
- streamlit/elements/pyplot.py +3 -5
- streamlit/elements/text.py +1 -1
- streamlit/elements/widgets/audio_input.py +12 -11
- streamlit/elements/widgets/button.py +20 -16
- streamlit/elements/widgets/button_group.py +146 -121
- streamlit/elements/widgets/camera_input.py +13 -11
- streamlit/elements/widgets/chat.py +2 -2
- streamlit/elements/widgets/checkbox.py +30 -24
- streamlit/elements/widgets/color_picker.py +15 -13
- streamlit/elements/widgets/file_uploader.py +12 -12
- streamlit/elements/widgets/multiselect.py +33 -31
- streamlit/elements/widgets/number_input.py +15 -12
- streamlit/elements/widgets/radio.py +15 -12
- streamlit/elements/widgets/select_slider.py +15 -12
- streamlit/elements/widgets/selectbox.py +19 -14
- streamlit/elements/widgets/slider.py +15 -12
- streamlit/elements/widgets/text_widgets.py +33 -27
- streamlit/elements/widgets/time_widgets.py +33 -25
- streamlit/hello/{Animation_Demo.py → animation_demo.py} +9 -10
- streamlit/hello/{Dataframe_Demo.py → dataframe_demo.py} +9 -15
- streamlit/hello/{Hello.py → hello.py} +7 -12
- streamlit/hello/{Mapping_Demo.py → mapping_demo.py} +10 -13
- streamlit/hello/{Plotting_Demo.py → plotting_demo.py} +9 -10
- streamlit/hello/streamlit_app.py +24 -6
- streamlit/proto/Image_pb2.pyi +1 -1
- streamlit/web/server/server.py +6 -1
- {streamlit_nightly-1.39.1.dev20241030.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.39.1.dev20241030.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/RECORD +41 -40
- {streamlit_nightly-1.39.1.dev20241030.data → streamlit_nightly-1.39.1.dev20241101.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.39.1.dev20241030.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.39.1.dev20241030.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.39.1.dev20241030.dist-info → streamlit_nightly-1.39.1.dev20241101.dist-info}/top_level.txt +0 -0
@@ -139,8 +139,9 @@ class TextWidgetsMixin:
|
|
139
139
|
label : str
|
140
140
|
A short label explaining to the user what this input is for.
|
141
141
|
The label can optionally contain GitHub-flavored Markdown of the
|
142
|
-
following types: Bold, Italics, Strikethroughs, Inline Code,
|
143
|
-
|
142
|
+
following types: Bold, Italics, Strikethroughs, Inline Code, Links,
|
143
|
+
and Images. Images display like icons, with a max height equal to
|
144
|
+
the font height.
|
144
145
|
|
145
146
|
Unsupported Markdown elements are unwrapped so only their children
|
146
147
|
(text contents) render. Display unsupported elements as literal
|
@@ -150,9 +151,9 @@ class TextWidgetsMixin:
|
|
150
151
|
See the ``body`` parameter of |st.markdown|_ for additional,
|
151
152
|
supported Markdown directives.
|
152
153
|
|
153
|
-
For accessibility reasons, you should never set an empty label
|
154
|
-
|
155
|
-
empty labels by raising an exception.
|
154
|
+
For accessibility reasons, you should never set an empty label, but
|
155
|
+
you can hide it with ``label_visibility`` if needed. In the future,
|
156
|
+
we may disallow empty labels by raising an exception.
|
156
157
|
|
157
158
|
.. |st.markdown| replace:: ``st.markdown``
|
158
159
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
@@ -176,7 +177,9 @@ class TextWidgetsMixin:
|
|
176
177
|
masks the user's typed value). Defaults to "default".
|
177
178
|
|
178
179
|
help : str
|
179
|
-
An optional tooltip that gets displayed next to the
|
180
|
+
An optional tooltip that gets displayed next to the widget label.
|
181
|
+
Streamlit only displays the tooltip when
|
182
|
+
``label_visibility="visible"``.
|
180
183
|
|
181
184
|
autocomplete : str
|
182
185
|
An optional value that will be passed to the <input> element's
|
@@ -198,14 +201,14 @@ class TextWidgetsMixin:
|
|
198
201
|
no text is displayed.
|
199
202
|
|
200
203
|
disabled : bool
|
201
|
-
An optional boolean
|
202
|
-
The default is False
|
204
|
+
An optional boolean that disables the text input if set to
|
205
|
+
``True``. The default is ``False``.
|
203
206
|
|
204
207
|
label_visibility : "visible", "hidden", or "collapsed"
|
205
|
-
The visibility of the label.
|
206
|
-
is
|
207
|
-
|
208
|
-
"
|
208
|
+
The visibility of the label. The default is ``"visible"``. If this
|
209
|
+
is ``"hidden"``, Streamlit displays an empty spacer instead of the
|
210
|
+
label, which can help keep the widget alligned with other widgets.
|
211
|
+
If this is ``"collapsed"``, Streamlit displays no label or spacer.
|
209
212
|
|
210
213
|
Returns
|
211
214
|
-------
|
@@ -410,8 +413,9 @@ class TextWidgetsMixin:
|
|
410
413
|
label : str
|
411
414
|
A short label explaining to the user what this input is for.
|
412
415
|
The label can optionally contain GitHub-flavored Markdown of the
|
413
|
-
following types: Bold, Italics, Strikethroughs, Inline Code,
|
414
|
-
|
416
|
+
following types: Bold, Italics, Strikethroughs, Inline Code, Links,
|
417
|
+
and Images. Images display like icons, with a max height equal to
|
418
|
+
the font height.
|
415
419
|
|
416
420
|
Unsupported Markdown elements are unwrapped so only their children
|
417
421
|
(text contents) render. Display unsupported elements as literal
|
@@ -421,22 +425,22 @@ class TextWidgetsMixin:
|
|
421
425
|
See the ``body`` parameter of |st.markdown|_ for additional,
|
422
426
|
supported Markdown directives.
|
423
427
|
|
424
|
-
For accessibility reasons, you should never set an empty label
|
425
|
-
|
426
|
-
empty labels by raising an exception.
|
428
|
+
For accessibility reasons, you should never set an empty label, but
|
429
|
+
you can hide it with ``label_visibility`` if needed. In the future,
|
430
|
+
we may disallow empty labels by raising an exception.
|
427
431
|
|
428
432
|
.. |st.markdown| replace:: ``st.markdown``
|
429
433
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
430
434
|
|
431
|
-
|
432
435
|
value : object or None
|
433
436
|
The text value of this widget when it first renders. This will be
|
434
437
|
cast to str internally. If ``None``, will initialize empty and
|
435
438
|
return ``None`` until the user provides input. Defaults to empty string.
|
436
439
|
|
437
440
|
height : int or None
|
438
|
-
Desired height of the UI element expressed in pixels. If
|
439
|
-
default
|
441
|
+
Desired height of the UI element expressed in pixels. If this is
|
442
|
+
``None`` (default), the widget's initial height fits three lines.
|
443
|
+
The height must be at least 68 pixels, which fits two lines.
|
440
444
|
|
441
445
|
max_chars : int or None
|
442
446
|
Maximum number of characters allowed in text area.
|
@@ -447,7 +451,9 @@ class TextWidgetsMixin:
|
|
447
451
|
based on its content. No two widgets may have the same key.
|
448
452
|
|
449
453
|
help : str
|
450
|
-
An optional tooltip that gets displayed next to the
|
454
|
+
An optional tooltip that gets displayed next to the widget label.
|
455
|
+
Streamlit only displays the tooltip when
|
456
|
+
``label_visibility="visible"``.
|
451
457
|
|
452
458
|
on_change : callable
|
453
459
|
An optional callback invoked when this text_area's value changes.
|
@@ -463,14 +469,14 @@ class TextWidgetsMixin:
|
|
463
469
|
no text is displayed.
|
464
470
|
|
465
471
|
disabled : bool
|
466
|
-
An optional boolean
|
467
|
-
The default is False
|
472
|
+
An optional boolean that disables the text area if set to ``True``.
|
473
|
+
The default is ``False``.
|
468
474
|
|
469
475
|
label_visibility : "visible", "hidden", or "collapsed"
|
470
|
-
The visibility of the label.
|
471
|
-
is
|
472
|
-
|
473
|
-
"
|
476
|
+
The visibility of the label. The default is ``"visible"``. If this
|
477
|
+
is ``"hidden"``, Streamlit displays an empty spacer instead of the
|
478
|
+
label, which can help keep the widget alligned with other widgets.
|
479
|
+
If this is ``"collapsed"``, Streamlit displays no label or spacer.
|
474
480
|
Returns
|
475
481
|
-------
|
476
482
|
str or None
|
@@ -312,8 +312,9 @@ class TimeWidgetsMixin:
|
|
312
312
|
label : str
|
313
313
|
A short label explaining to the user what this time input is for.
|
314
314
|
The label can optionally contain GitHub-flavored Markdown of the
|
315
|
-
following types: Bold, Italics, Strikethroughs, Inline Code,
|
316
|
-
|
315
|
+
following types: Bold, Italics, Strikethroughs, Inline Code, Links,
|
316
|
+
and Images. Images display like icons, with a max height equal to
|
317
|
+
the font height.
|
317
318
|
|
318
319
|
Unsupported Markdown elements are unwrapped so only their children
|
319
320
|
(text contents) render. Display unsupported elements as literal
|
@@ -323,9 +324,9 @@ class TimeWidgetsMixin:
|
|
323
324
|
See the ``body`` parameter of |st.markdown|_ for additional,
|
324
325
|
supported Markdown directives.
|
325
326
|
|
326
|
-
For accessibility reasons, you should never set an empty label
|
327
|
-
|
328
|
-
empty labels by raising an exception.
|
327
|
+
For accessibility reasons, you should never set an empty label, but
|
328
|
+
you can hide it with ``label_visibility`` if needed. In the future,
|
329
|
+
we may disallow empty labels by raising an exception.
|
329
330
|
|
330
331
|
.. |st.markdown| replace:: ``st.markdown``
|
331
332
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
@@ -342,7 +343,9 @@ class TimeWidgetsMixin:
|
|
342
343
|
based on its content. No two widgets may have the same key.
|
343
344
|
|
344
345
|
help : str
|
345
|
-
An optional tooltip that gets displayed next to the
|
346
|
+
An optional tooltip that gets displayed next to the widget label.
|
347
|
+
Streamlit only displays the tooltip when
|
348
|
+
``label_visibility="visible"``.
|
346
349
|
|
347
350
|
on_change : callable
|
348
351
|
An optional callback invoked when this time_input's value changes.
|
@@ -354,14 +357,14 @@ class TimeWidgetsMixin:
|
|
354
357
|
An optional dict of kwargs to pass to the callback.
|
355
358
|
|
356
359
|
disabled : bool
|
357
|
-
An optional boolean
|
358
|
-
The default is False
|
360
|
+
An optional boolean that disables the time input if set to
|
361
|
+
``True``. The default is ``False``.
|
359
362
|
|
360
363
|
label_visibility : "visible", "hidden", or "collapsed"
|
361
|
-
The visibility of the label.
|
362
|
-
is
|
363
|
-
|
364
|
-
"
|
364
|
+
The visibility of the label. The default is ``"visible"``. If this
|
365
|
+
is ``"hidden"``, Streamlit displays an empty spacer instead of the
|
366
|
+
label, which can help keep the widget alligned with other widgets.
|
367
|
+
If this is ``"collapsed"``, Streamlit displays no label or spacer.
|
365
368
|
|
366
369
|
step : int or timedelta
|
367
370
|
The stepping interval in seconds. Defaults to 900, i.e. 15 minutes.
|
@@ -534,13 +537,17 @@ class TimeWidgetsMixin:
|
|
534
537
|
) -> DateWidgetReturn:
|
535
538
|
r"""Display a date input widget.
|
536
539
|
|
540
|
+
The first day of the week is determined from the user's locale in their
|
541
|
+
browser.
|
542
|
+
|
537
543
|
Parameters
|
538
544
|
----------
|
539
545
|
label : str
|
540
546
|
A short label explaining to the user what this date input is for.
|
541
547
|
The label can optionally contain GitHub-flavored Markdown of the
|
542
|
-
following types: Bold, Italics, Strikethroughs, Inline Code,
|
543
|
-
|
548
|
+
following types: Bold, Italics, Strikethroughs, Inline Code, Links,
|
549
|
+
and Images. Images display like icons, with a max height equal to
|
550
|
+
the font height.
|
544
551
|
|
545
552
|
Unsupported Markdown elements are unwrapped so only their children
|
546
553
|
(text contents) render. Display unsupported elements as literal
|
@@ -550,9 +557,9 @@ class TimeWidgetsMixin:
|
|
550
557
|
See the ``body`` parameter of |st.markdown|_ for additional,
|
551
558
|
supported Markdown directives.
|
552
559
|
|
553
|
-
For accessibility reasons, you should never set an empty label
|
554
|
-
|
555
|
-
empty labels by raising an exception.
|
560
|
+
For accessibility reasons, you should never set an empty label, but
|
561
|
+
you can hide it with ``label_visibility`` if needed. In the future,
|
562
|
+
we may disallow empty labels by raising an exception.
|
556
563
|
|
557
564
|
.. |st.markdown| replace:: ``st.markdown``
|
558
565
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
@@ -578,7 +585,9 @@ class TimeWidgetsMixin:
|
|
578
585
|
based on its content. No two widgets may have the same key.
|
579
586
|
|
580
587
|
help : str
|
581
|
-
An optional tooltip that gets displayed next to the
|
588
|
+
An optional tooltip that gets displayed next to the widget label.
|
589
|
+
Streamlit only displays the tooltip when
|
590
|
+
``label_visibility="visible"``.
|
582
591
|
|
583
592
|
on_change : callable
|
584
593
|
An optional callback invoked when this date_input's value changes.
|
@@ -595,15 +604,14 @@ class TimeWidgetsMixin:
|
|
595
604
|
You may also use a period (.) or hyphen (-) as separators.
|
596
605
|
|
597
606
|
disabled : bool
|
598
|
-
An optional boolean
|
599
|
-
The default is False
|
607
|
+
An optional boolean that disables the date input if set to
|
608
|
+
``True``. The default is ``False``.
|
600
609
|
|
601
610
|
label_visibility : "visible", "hidden", or "collapsed"
|
602
|
-
The visibility of the label.
|
603
|
-
is
|
604
|
-
|
605
|
-
"
|
606
|
-
|
611
|
+
The visibility of the label. The default is ``"visible"``. If this
|
612
|
+
is ``"hidden"``, Streamlit displays an empty spacer instead of the
|
613
|
+
label, which can help keep the widget alligned with other widgets.
|
614
|
+
If this is ``"collapsed"``, Streamlit displays no label or spacer.
|
607
615
|
|
608
616
|
Returns
|
609
617
|
-------
|
@@ -57,7 +57,7 @@ def animation_demo() -> None:
|
|
57
57
|
N[M] = i
|
58
58
|
|
59
59
|
# Update the image placeholder by calling the image() function on it.
|
60
|
-
image.image(1.0 - (N / N.max()),
|
60
|
+
image.image(1.0 - (N / N.max()), use_container_width=True)
|
61
61
|
|
62
62
|
# We clear elements by calling empty on them.
|
63
63
|
progress_bar.empty()
|
@@ -66,18 +66,17 @@ def animation_demo() -> None:
|
|
66
66
|
# Streamlit widgets automatically run the script from top to bottom. Since
|
67
67
|
# this button is not connected to any other logic, it just causes a plain
|
68
68
|
# rerun.
|
69
|
-
st.button("
|
69
|
+
st.button("Rerun")
|
70
70
|
|
71
71
|
|
72
|
-
st.set_page_config(page_title="Animation
|
73
|
-
st.
|
74
|
-
st.sidebar.header("Animation Demo")
|
72
|
+
st.set_page_config(page_title="Animation demo", page_icon=":material/animation:")
|
73
|
+
st.title("Animation demo")
|
75
74
|
st.write(
|
76
|
-
"""
|
77
|
-
|
78
|
-
|
75
|
+
"""
|
76
|
+
This app shows how you can use Streamlit to build cool animations.
|
77
|
+
It displays an animated fractal based on the the Julia Set. Use the slider
|
78
|
+
to tune different parameters.
|
79
|
+
"""
|
79
80
|
)
|
80
|
-
|
81
81
|
animation_demo()
|
82
|
-
|
83
82
|
show_code(animation_demo)
|
@@ -38,7 +38,8 @@ def data_frame_demo():
|
|
38
38
|
else:
|
39
39
|
data = df.loc[countries]
|
40
40
|
data /= 1000000.0
|
41
|
-
st.
|
41
|
+
st.subheader("Gross agricultural production ($B)")
|
42
|
+
st.dataframe(data.sort_index())
|
42
43
|
|
43
44
|
data = data.T.reset_index()
|
44
45
|
data = pd.melt(data, id_vars=["index"]).rename(
|
@@ -55,23 +56,16 @@ def data_frame_demo():
|
|
55
56
|
)
|
56
57
|
st.altair_chart(chart, use_container_width=True)
|
57
58
|
except URLError as e:
|
58
|
-
st.error(
|
59
|
-
"""
|
60
|
-
**This demo requires internet access.**
|
61
|
-
Connection error: %s
|
62
|
-
"""
|
63
|
-
% e.reason
|
64
|
-
)
|
59
|
+
st.error(f"This demo requires internet access. Connection error: {e.reason}")
|
65
60
|
|
66
61
|
|
67
|
-
st.set_page_config(page_title="DataFrame
|
68
|
-
st.
|
69
|
-
st.sidebar.header("DataFrame Demo")
|
62
|
+
st.set_page_config(page_title="DataFrame demo", page_icon=":material/table:")
|
63
|
+
st.title("DataFrame demo")
|
70
64
|
st.write(
|
71
|
-
"""
|
72
|
-
|
65
|
+
"""
|
66
|
+
This demo shows how to use `st.dataframe` to visualize a Pandas DataFrame.
|
67
|
+
Data courtesy of the [UN Data Explorer](http://data.un.org/Explorer.aspx).
|
68
|
+
"""
|
73
69
|
)
|
74
|
-
|
75
70
|
data_frame_demo()
|
76
|
-
|
77
71
|
show_code(data_frame_demo)
|
@@ -14,29 +14,24 @@
|
|
14
14
|
|
15
15
|
import streamlit as st
|
16
16
|
|
17
|
-
st.set_page_config(
|
18
|
-
|
19
|
-
|
20
|
-
)
|
21
|
-
|
22
|
-
st.write("# Welcome to Streamlit! 👋")
|
23
|
-
|
24
|
-
st.sidebar.success("Select a demo above.")
|
25
|
-
|
26
|
-
st.markdown(
|
17
|
+
st.set_page_config(page_title="Hello", page_icon=":material/waving_hand:")
|
18
|
+
st.title("Welcome to Streamlit! 👋")
|
19
|
+
st.write(
|
27
20
|
"""
|
28
21
|
Streamlit is an open-source app framework built specifically for
|
29
|
-
|
22
|
+
machine learning and data science projects.
|
30
23
|
**👈 Select a demo from the sidebar** to see some examples
|
31
24
|
of what Streamlit can do!
|
25
|
+
|
32
26
|
### Want to learn more?
|
33
27
|
- Check out [streamlit.io](https://streamlit.io)
|
34
28
|
- Jump into our [documentation](https://docs.streamlit.io)
|
35
29
|
- Ask a question in our [community
|
36
30
|
forums](https://discuss.streamlit.io)
|
31
|
+
|
37
32
|
### See more complex demos
|
38
33
|
- Use a neural net to [analyze the Udacity Self-driving Car Image
|
39
34
|
Dataset](https://github.com/streamlit/demo-self-driving)
|
40
35
|
- Explore a [New York City rideshare dataset](https://github.com/streamlit/demo-uber-nyc-pickups)
|
41
|
-
"""
|
36
|
+
"""
|
42
37
|
)
|
@@ -32,7 +32,7 @@ def mapping_demo():
|
|
32
32
|
|
33
33
|
try:
|
34
34
|
ALL_LAYERS = {
|
35
|
-
"Bike
|
35
|
+
"Bike rentals": pdk.Layer(
|
36
36
|
"HexagonLayer",
|
37
37
|
data=from_data_file("bike_rental_stats.json"),
|
38
38
|
get_position=["lon", "lat"],
|
@@ -41,7 +41,7 @@ def mapping_demo():
|
|
41
41
|
elevation_range=[0, 1000],
|
42
42
|
extruded=True,
|
43
43
|
),
|
44
|
-
"Bart
|
44
|
+
"Bart stop exits": pdk.Layer(
|
45
45
|
"ScatterplotLayer",
|
46
46
|
data=from_data_file("bart_stop_stats.json"),
|
47
47
|
get_position=["lon", "lat"],
|
@@ -49,7 +49,7 @@ def mapping_demo():
|
|
49
49
|
get_radius="[exits]",
|
50
50
|
radius_scale=0.05,
|
51
51
|
),
|
52
|
-
"Bart
|
52
|
+
"Bart stop names": pdk.Layer(
|
53
53
|
"TextLayer",
|
54
54
|
data=from_data_file("bart_stop_stats.json"),
|
55
55
|
get_position=["lon", "lat"],
|
@@ -58,7 +58,7 @@ def mapping_demo():
|
|
58
58
|
get_size=10,
|
59
59
|
get_alignment_baseline="'bottom'",
|
60
60
|
),
|
61
|
-
"Outbound
|
61
|
+
"Outbound flow": pdk.Layer(
|
62
62
|
"ArcLayer",
|
63
63
|
data=from_data_file("bart_path_stats.json"),
|
64
64
|
get_source_position=["lon", "lat"],
|
@@ -72,7 +72,7 @@ def mapping_demo():
|
|
72
72
|
width_max_pixels=30,
|
73
73
|
),
|
74
74
|
}
|
75
|
-
st.sidebar.
|
75
|
+
st.sidebar.subheader("Map layers")
|
76
76
|
selected_layers = [
|
77
77
|
layer
|
78
78
|
for layer_name, layer in ALL_LAYERS.items()
|
@@ -103,15 +103,12 @@ def mapping_demo():
|
|
103
103
|
)
|
104
104
|
|
105
105
|
|
106
|
-
st.set_page_config(page_title="Mapping
|
107
|
-
st.
|
108
|
-
st.sidebar.header("Mapping Demo")
|
106
|
+
st.set_page_config(page_title="Mapping demo", page_icon=":material/public:")
|
107
|
+
st.title("Mapping demo")
|
109
108
|
st.write(
|
110
|
-
"""
|
111
|
-
|
112
|
-
|
109
|
+
"""
|
110
|
+
This demo shows how to use `st.pydeck_chart` to display geospatial data.
|
111
|
+
"""
|
113
112
|
)
|
114
|
-
|
115
113
|
mapping_demo()
|
116
|
-
|
117
114
|
show_code(mapping_demo)
|
@@ -28,7 +28,7 @@ def plotting_demo():
|
|
28
28
|
|
29
29
|
for i in range(1, 101):
|
30
30
|
new_rows = last_rows[-1, :] + np.random.randn(5, 1).cumsum(axis=0)
|
31
|
-
status_text.text("%
|
31
|
+
status_text.text(f"{i}% complete")
|
32
32
|
chart.add_rows(new_rows)
|
33
33
|
progress_bar.progress(i)
|
34
34
|
last_rows = new_rows
|
@@ -39,18 +39,17 @@ def plotting_demo():
|
|
39
39
|
# Streamlit widgets automatically run the script from top to bottom. Since
|
40
40
|
# this button is not connected to any other logic, it just causes a plain
|
41
41
|
# rerun.
|
42
|
-
st.button("
|
42
|
+
st.button("Rerun")
|
43
43
|
|
44
44
|
|
45
|
-
st.set_page_config(page_title="Plotting
|
46
|
-
st.
|
47
|
-
st.sidebar.header("Plotting Demo")
|
45
|
+
st.set_page_config(page_title="Plotting demo", page_icon=":material/show_chart:")
|
46
|
+
st.title("Plotting demo")
|
48
47
|
st.write(
|
49
|
-
"""
|
50
|
-
|
51
|
-
|
48
|
+
"""
|
49
|
+
This demo illustrates a combination of plotting and animation with
|
50
|
+
Streamlit. We're generating a bunch of random numbers in a loop for around
|
51
|
+
5 seconds. Enjoy!
|
52
|
+
"""
|
52
53
|
)
|
53
|
-
|
54
54
|
plotting_demo()
|
55
|
-
|
56
55
|
show_code(plotting_demo)
|
streamlit/hello/streamlit_app.py
CHANGED
@@ -19,17 +19,35 @@ import streamlit as st
|
|
19
19
|
dir_path = Path(__file__).parent
|
20
20
|
|
21
21
|
|
22
|
+
# Note that this needs to be in a method so we can have an e2e playwright test.
|
22
23
|
def run():
|
23
24
|
page = st.navigation(
|
24
25
|
[
|
25
|
-
st.Page(
|
26
|
-
|
27
|
-
|
28
|
-
st.Page(
|
29
|
-
|
26
|
+
st.Page(
|
27
|
+
dir_path / "hello.py", title="Hello", icon=":material/waving_hand:"
|
28
|
+
),
|
29
|
+
st.Page(
|
30
|
+
dir_path / "dataframe_demo.py",
|
31
|
+
title="DataFrame demo",
|
32
|
+
icon=":material/table:",
|
33
|
+
),
|
34
|
+
st.Page(
|
35
|
+
dir_path / "plotting_demo.py",
|
36
|
+
title="Plotting demo",
|
37
|
+
icon=":material/show_chart:",
|
38
|
+
),
|
39
|
+
st.Page(
|
40
|
+
dir_path / "mapping_demo.py",
|
41
|
+
title="Mapping demo",
|
42
|
+
icon=":material/public:",
|
43
|
+
),
|
44
|
+
st.Page(
|
45
|
+
dir_path / "animation_demo.py",
|
46
|
+
title="Animation demo",
|
47
|
+
icon=":material/animation:",
|
48
|
+
),
|
30
49
|
]
|
31
50
|
)
|
32
|
-
|
33
51
|
page.run()
|
34
52
|
|
35
53
|
|
streamlit/proto/Image_pb2.pyi
CHANGED
@@ -61,7 +61,7 @@ class ImageList(google.protobuf.message.Message):
|
|
61
61
|
IMGS_FIELD_NUMBER: builtins.int
|
62
62
|
WIDTH_FIELD_NUMBER: builtins.int
|
63
63
|
width: builtins.int
|
64
|
-
"""@see
|
64
|
+
"""@see WidthBehavior on the backend
|
65
65
|
@see WidthBehavior on the frontend
|
66
66
|
The width of each image.
|
67
67
|
>0 sets the image width explicitly
|
streamlit/web/server/server.py
CHANGED
@@ -369,7 +369,12 @@ class Server:
|
|
369
369
|
routes.extend(
|
370
370
|
[
|
371
371
|
(
|
372
|
-
|
372
|
+
# We want to remove paths with a trailing slash, but if the path
|
373
|
+
# starts with a double slash //, the redirect will point
|
374
|
+
# the browser to the wrong host.
|
375
|
+
make_url_path_regex(
|
376
|
+
base, "(?!/)(.*)", trailing_slash="required"
|
377
|
+
),
|
373
378
|
RemoveSlashHandler,
|
374
379
|
),
|
375
380
|
(
|