L ihddlmZddlmZmZddlmZddlm Z ddl m Z erddl mZGddZy ) ) annotations) TYPE_CHECKINGcast)Empty)Skeleton)gather_metrics)DeltaGeneratorc`eZdZedddZedddd dZeddZy) EmptyMixinemptycNt}|jjd|S)uInsert a single-element container. Inserts a container into your app that can be used to hold a single element. This allows you to, for example, remove elements at any point, or replace several elements at once (using a child multi-element container). To insert/replace/clear an element on the returned container, you can use ``with`` notation or just call methods directly on the returned object. See examples below. Examples -------- Inside a ``with st.empty():`` block, each displayed element will replace the previous one. >>> import streamlit as st >>> import time >>> >>> with st.empty(): ... for seconds in range(10): ... st.write(f"⏳ {seconds} seconds have passed") ... time.sleep(1) ... st.write(":material/check: 10 seconds over!") ... st.button("Rerun") .. output:: https://doc-empty.streamlit.app/ height: 220px You can use an ``st.empty`` to replace multiple elements in succession. Use ``st.container`` inside ``st.empty`` to display (and later replace) a group of elements. >>> import streamlit as st >>> import time >>> >>> st.button("Start over") >>> >>> placeholder = st.empty() >>> placeholder.markdown("Hello") >>> time.sleep(1) >>> >>> placeholder.progress(0, "Wait for it...") >>> time.sleep(1) >>> placeholder.progress(50, "Wait for it...") >>> time.sleep(1) >>> placeholder.progress(100, "Wait for it...") >>> time.sleep(1) >>> >>> with placeholder.container(): ... st.line_chart({"data": [1, 5, 2, 6]}) ... time.sleep(1) ... st.markdown("3...") ... time.sleep(1) ... st.markdown("2...") ... time.sleep(1) ... st.markdown("1...") ... time.sleep(1) >>> >>> placeholder.markdown("Poof!") >>> time.sleep(1) >>> >>> placeholder.empty() .. output:: https://doc-empty-placeholder.streamlit.app/ height: 600px r ) EmptyProtodg_enqueue)self empty_protos ^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/elements/empty.pyr zEmptyMixin.emptys#N!l ww55 _skeletonN)heightc`t}|r||_|jjd|S)aInsert a single-element container which displays a "skeleton" placeholder. Inserts a container into your app that can be used to hold a single element. This allows you to, for example, remove elements at any point, or replace several elements at once (using a child multi-element container). To insert/replace/clear an element on the returned container, you can use ``with`` notation or just call methods directly on the returned object. See some of the examples below. This is an internal method and should not be used directly. Parameters ---------- height: int or None Desired height of the skeleton expressed in pixels. If None, a default height is used. skeleton) SkeletonProtorrr)rrskeleton_protos rrzEmptyMixin._skeletonfs-(' $*N !ww N;;rctd|S)zGet our DeltaGenerator.r )r)rs rrz EmptyMixin.dgs$d++r)returnr )rz int | Nonerr )__name__ __module__ __qualname__rr rpropertyrrrr r sLGG6G6RK 04<!<0,,rr N) __future__rtypingrrstreamlit.proto.Empty_pb2rrstreamlit.proto.Skeleton_pb2rrstreamlit.runtime.metrics_utilrstreamlit.delta_generatorr r r!rrr(s(#&9B98g,g,r