streamlit 1.50.0__py3-none-any.whl → 1.52.0__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/__init__.py +5 -1
- streamlit/commands/execution_control.py +89 -14
- streamlit/commands/navigation.py +4 -6
- streamlit/commands/page_config.py +4 -6
- streamlit/components/v1/component_arrow.py +7 -7
- streamlit/components/v2/__init__.py +514 -0
- streamlit/components/v2/bidi_component/__init__.py +20 -0
- streamlit/components/v2/bidi_component/constants.py +29 -0
- streamlit/components/v2/bidi_component/main.py +534 -0
- streamlit/components/v2/bidi_component/serialization.py +272 -0
- streamlit/components/v2/bidi_component/state.py +92 -0
- streamlit/components/v2/component_definition_resolver.py +143 -0
- streamlit/components/v2/component_file_watcher.py +403 -0
- streamlit/components/v2/component_manager.py +439 -0
- streamlit/components/v2/component_manifest_handler.py +122 -0
- streamlit/components/v2/component_path_utils.py +245 -0
- streamlit/components/v2/component_registry.py +426 -0
- streamlit/components/v2/get_bidi_component_manager.py +51 -0
- streamlit/components/v2/manifest_scanner.py +615 -0
- streamlit/components/v2/presentation.py +198 -0
- streamlit/components/v2/types.py +324 -0
- streamlit/config.py +456 -53
- streamlit/config_option.py +4 -1
- streamlit/config_util.py +650 -1
- streamlit/connections/snowflake_connection.py +1 -1
- streamlit/connections/snowpark_connection.py +1 -1
- streamlit/dataframe_util.py +33 -26
- streamlit/delta_generator.py +13 -4
- streamlit/delta_generator_singletons.py +11 -15
- streamlit/deprecation_util.py +17 -6
- streamlit/elements/alert.py +16 -0
- streamlit/elements/arrow.py +68 -10
- streamlit/elements/bokeh_chart.py +10 -78
- streamlit/elements/code.py +2 -2
- streamlit/elements/deck_gl_json_chart.py +98 -40
- streamlit/elements/dialog_decorator.py +2 -1
- streamlit/elements/exception.py +4 -2
- streamlit/elements/form.py +27 -0
- streamlit/elements/graphviz_chart.py +1 -3
- streamlit/elements/heading.py +63 -10
- streamlit/elements/html.py +13 -2
- streamlit/elements/image.py +3 -5
- streamlit/elements/layouts.py +59 -33
- streamlit/elements/lib/built_in_chart_utils.py +50 -19
- streamlit/elements/lib/color_util.py +9 -19
- streamlit/elements/lib/column_config_utils.py +9 -12
- streamlit/elements/lib/column_types.py +40 -12
- streamlit/elements/lib/dialog.py +2 -2
- streamlit/elements/lib/image_utils.py +3 -5
- streamlit/elements/lib/layout_utils.py +100 -13
- streamlit/elements/lib/mutable_status_container.py +2 -2
- streamlit/elements/lib/options_selector_utils.py +2 -2
- streamlit/elements/lib/pandas_styler_utils.py +17 -9
- streamlit/elements/lib/shortcut_utils.py +152 -0
- streamlit/elements/lib/utils.py +4 -4
- streamlit/elements/map.py +80 -37
- streamlit/elements/markdown.py +50 -3
- streamlit/elements/media.py +5 -7
- streamlit/elements/metric.py +34 -6
- streamlit/elements/pdf.py +2 -4
- streamlit/elements/plotly_chart.py +197 -20
- streamlit/elements/progress.py +2 -4
- streamlit/elements/space.py +113 -0
- streamlit/elements/spinner.py +1 -1
- streamlit/elements/text.py +20 -3
- streamlit/elements/toast.py +2 -0
- streamlit/elements/vega_charts.py +356 -149
- streamlit/elements/widgets/audio_input.py +12 -11
- streamlit/elements/widgets/button.py +280 -43
- streamlit/elements/widgets/button_group.py +60 -9
- streamlit/elements/widgets/camera_input.py +3 -5
- streamlit/elements/widgets/chat.py +307 -43
- streamlit/elements/widgets/color_picker.py +8 -1
- streamlit/elements/widgets/data_editor.py +88 -44
- streamlit/elements/widgets/file_uploader.py +9 -11
- streamlit/elements/widgets/multiselect.py +4 -3
- streamlit/elements/widgets/number_input.py +4 -4
- streamlit/elements/widgets/radio.py +10 -3
- streamlit/elements/widgets/select_slider.py +8 -5
- streamlit/elements/widgets/selectbox.py +6 -3
- streamlit/elements/widgets/slider.py +38 -42
- streamlit/elements/widgets/text_widgets.py +2 -0
- streamlit/elements/widgets/time_widgets.py +587 -21
- streamlit/elements/write.py +27 -6
- streamlit/emojis.py +1 -1
- streamlit/errors.py +137 -0
- streamlit/git_util.py +1 -1
- streamlit/hello/hello.py +8 -0
- streamlit/hello/utils.py +2 -1
- streamlit/material_icon_names.py +1 -1
- streamlit/navigation/page.py +11 -1
- streamlit/net_util.py +2 -2
- streamlit/proto/Alert_pb2.pyi +3 -3
- streamlit/proto/AppPage_pb2.pyi +7 -1
- streamlit/proto/ArrowData_pb2.py +27 -0
- streamlit/proto/ArrowData_pb2.pyi +52 -0
- streamlit/proto/ArrowNamedDataSet_pb2.pyi +7 -1
- streamlit/proto/ArrowVegaLiteChart_pb2.pyi +7 -1
- streamlit/proto/Arrow_pb2.py +10 -10
- streamlit/proto/Arrow_pb2.pyi +19 -12
- streamlit/proto/AudioInput_pb2.pyi +7 -1
- streamlit/proto/Audio_pb2.pyi +7 -1
- streamlit/proto/AuthRedirect_pb2.pyi +7 -1
- streamlit/proto/AutoRerun_pb2.pyi +7 -1
- streamlit/proto/BackMsg_pb2.py +4 -2
- streamlit/proto/BackMsg_pb2.pyi +34 -4
- streamlit/proto/Balloons_pb2.pyi +7 -1
- streamlit/proto/BidiComponent_pb2.py +34 -0
- streamlit/proto/BidiComponent_pb2.pyi +159 -0
- streamlit/proto/Block_pb2.py +7 -7
- streamlit/proto/Block_pb2.pyi +39 -36
- streamlit/proto/BokehChart_pb2.pyi +7 -1
- streamlit/proto/ButtonGroup_pb2.pyi +9 -9
- streamlit/proto/Button_pb2.py +2 -2
- streamlit/proto/Button_pb2.pyi +11 -2
- streamlit/proto/CameraInput_pb2.pyi +7 -1
- streamlit/proto/ChatInput_pb2.py +6 -6
- streamlit/proto/ChatInput_pb2.pyi +18 -6
- streamlit/proto/Checkbox_pb2.pyi +3 -3
- streamlit/proto/ClientState_pb2.pyi +10 -4
- streamlit/proto/Code_pb2.pyi +7 -1
- streamlit/proto/ColorPicker_pb2.pyi +7 -1
- streamlit/proto/Common_pb2.py +3 -3
- streamlit/proto/Common_pb2.pyi +35 -23
- streamlit/proto/Components_pb2.pyi +19 -13
- streamlit/proto/DataFrame_pb2.pyi +55 -49
- streamlit/proto/DateInput_pb2.pyi +7 -1
- streamlit/proto/DateTimeInput_pb2.py +28 -0
- streamlit/proto/DateTimeInput_pb2.pyi +92 -0
- streamlit/proto/DeckGlJsonChart_pb2.py +10 -4
- streamlit/proto/DeckGlJsonChart_pb2.pyi +12 -6
- streamlit/proto/Delta_pb2.pyi +7 -1
- streamlit/proto/DocString_pb2.pyi +10 -4
- streamlit/proto/DownloadButton_pb2.py +2 -2
- streamlit/proto/DownloadButton_pb2.pyi +16 -2
- streamlit/proto/Element_pb2.py +7 -3
- streamlit/proto/Element_pb2.pyi +33 -5
- streamlit/proto/Empty_pb2.pyi +7 -1
- streamlit/proto/Exception_pb2.pyi +7 -1
- streamlit/proto/Favicon_pb2.pyi +7 -1
- streamlit/proto/FileUploader_pb2.pyi +7 -1
- streamlit/proto/ForwardMsg_pb2.py +12 -10
- streamlit/proto/ForwardMsg_pb2.pyi +42 -15
- streamlit/proto/GapSize_pb2.pyi +4 -4
- streamlit/proto/GitInfo_pb2.pyi +3 -3
- streamlit/proto/GraphVizChart_pb2.pyi +7 -1
- streamlit/proto/Heading_pb2.pyi +7 -1
- streamlit/proto/HeightConfig_pb2.py +2 -2
- streamlit/proto/HeightConfig_pb2.pyi +13 -4
- streamlit/proto/Html_pb2.py +2 -2
- streamlit/proto/Html_pb2.pyi +11 -2
- streamlit/proto/IFrame_pb2.pyi +7 -1
- streamlit/proto/Image_pb2.pyi +10 -4
- streamlit/proto/Json_pb2.pyi +7 -1
- streamlit/proto/LabelVisibilityMessage_pb2.pyi +3 -3
- streamlit/proto/LinkButton_pb2.py +2 -2
- streamlit/proto/LinkButton_pb2.pyi +15 -2
- streamlit/proto/Logo_pb2.pyi +7 -1
- streamlit/proto/Markdown_pb2.pyi +3 -3
- streamlit/proto/Metric_pb2.pyi +7 -7
- streamlit/proto/MetricsEvent_pb2.pyi +10 -4
- streamlit/proto/MultiSelect_pb2.pyi +7 -1
- streamlit/proto/NamedDataSet_pb2.pyi +7 -1
- streamlit/proto/Navigation_pb2.pyi +3 -3
- streamlit/proto/NewSession_pb2.py +18 -18
- streamlit/proto/NewSession_pb2.pyi +59 -40
- streamlit/proto/NumberInput_pb2.pyi +3 -3
- streamlit/proto/PageConfig_pb2.pyi +7 -7
- streamlit/proto/PageInfo_pb2.pyi +7 -1
- streamlit/proto/PageLink_pb2.py +2 -2
- streamlit/proto/PageLink_pb2.pyi +11 -2
- streamlit/proto/PageNotFound_pb2.pyi +7 -1
- streamlit/proto/PageProfile_pb2.pyi +13 -7
- streamlit/proto/PagesChanged_pb2.pyi +7 -1
- streamlit/proto/ParentMessage_pb2.pyi +7 -1
- streamlit/proto/PlotlyChart_pb2.py +8 -6
- streamlit/proto/PlotlyChart_pb2.pyi +9 -7
- streamlit/proto/Progress_pb2.pyi +7 -1
- streamlit/proto/Radio_pb2.pyi +7 -1
- streamlit/proto/RootContainer_pb2.pyi +1 -1
- streamlit/proto/Selectbox_pb2.pyi +7 -1
- streamlit/proto/SessionEvent_pb2.pyi +7 -1
- streamlit/proto/SessionStatus_pb2.pyi +7 -1
- streamlit/proto/Skeleton_pb2.pyi +3 -3
- streamlit/proto/Slider_pb2.pyi +5 -5
- streamlit/proto/Snow_pb2.pyi +7 -1
- streamlit/proto/Space_pb2.py +27 -0
- streamlit/proto/Space_pb2.pyi +48 -0
- streamlit/proto/Spinner_pb2.pyi +7 -1
- streamlit/proto/TextAlignmentConfig_pb2.py +29 -0
- streamlit/proto/TextAlignmentConfig_pb2.pyi +68 -0
- streamlit/proto/TextArea_pb2.pyi +7 -1
- streamlit/proto/TextInput_pb2.pyi +3 -3
- streamlit/proto/Text_pb2.pyi +7 -1
- streamlit/proto/TimeInput_pb2.pyi +7 -1
- streamlit/proto/Toast_pb2.pyi +7 -1
- streamlit/proto/VegaLiteChart_pb2.pyi +7 -1
- streamlit/proto/Video_pb2.pyi +6 -6
- streamlit/proto/WidgetStates_pb2.py +2 -2
- streamlit/proto/WidgetStates_pb2.pyi +23 -7
- streamlit/proto/WidthConfig_pb2.py +2 -2
- streamlit/proto/WidthConfig_pb2.pyi +13 -4
- streamlit/proto/openmetrics_data_model_pb2.pyi +52 -52
- streamlit/runtime/app_session.py +65 -2
- streamlit/runtime/caching/cache_data_api.py +5 -5
- streamlit/runtime/caching/cache_errors.py +4 -1
- streamlit/runtime/caching/cache_resource_api.py +5 -4
- streamlit/runtime/caching/cache_utils.py +3 -2
- streamlit/runtime/caching/cached_message_replay.py +3 -3
- streamlit/runtime/caching/hashing.py +4 -5
- streamlit/runtime/caching/legacy_cache_api.py +2 -1
- streamlit/runtime/connection_factory.py +1 -3
- streamlit/runtime/download_data_util.py +53 -0
- streamlit/runtime/forward_msg_queue.py +5 -1
- streamlit/runtime/fragment.py +2 -1
- streamlit/runtime/media_file_manager.py +178 -2
- streamlit/runtime/memory_media_file_storage.py +1 -1
- streamlit/runtime/metrics_util.py +91 -3
- streamlit/runtime/runtime.py +14 -0
- streamlit/runtime/scriptrunner/exec_code.py +2 -1
- streamlit/runtime/scriptrunner/script_runner.py +5 -3
- streamlit/runtime/scriptrunner_utils/script_run_context.py +3 -6
- streamlit/runtime/secrets.py +2 -4
- streamlit/runtime/session_manager.py +3 -1
- streamlit/runtime/state/common.py +30 -5
- streamlit/runtime/state/presentation.py +85 -0
- streamlit/runtime/state/query_params.py +80 -29
- streamlit/runtime/state/safe_session_state.py +2 -2
- streamlit/runtime/state/session_state.py +221 -17
- streamlit/runtime/state/widgets.py +19 -3
- streamlit/runtime/websocket_session_manager.py +3 -1
- streamlit/source_util.py +2 -2
- streamlit/static/index.html +2 -2
- streamlit/static/manifest.json +557 -239
- streamlit/static/static/css/{index.CIiu7Ygf.css → index.BpABIXK9.css} +1 -1
- streamlit/static/static/css/index.DgR7E2CV.css +1 -0
- streamlit/static/static/js/{ErrorOutline.esm.DUpR0_Ka.js → ErrorOutline.esm.ZJDbmVTx.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.CN4j9-1w.js → FileDownload.esm.Dx0vI3vH.js} +1 -1
- streamlit/static/static/js/{FileHelper.CaIUKG91.js → FileHelper.B7Ero7qQ.js} +3 -3
- streamlit/static/static/js/{FormClearHelper.DTcdrasw.js → FormClearHelper.CG2XN1_g.js} +1 -1
- streamlit/static/static/js/IFrameUtil.DefezniK.js +1 -0
- streamlit/static/static/js/InputInstructions.Cj5-1zf6.js +1 -0
- streamlit/static/static/js/Particles.BfWfv0Aw.js +1 -0
- streamlit/static/static/js/{ProgressBar.DetlP5aY.js → ProgressBar.CGQ8OgfO.js} +2 -2
- streamlit/static/static/js/StreamlitSyntaxHighlighter.DTKLpwhl.js +20 -0
- streamlit/static/static/js/{Toolbar.C77ar7rq.js → Toolbar.B2qFUmd9.js} +1 -1
- streamlit/static/static/js/_arrayIncludes.B19Iyn2B.js +1 -0
- streamlit/static/static/js/_baseIndexOf.BTknn6Gb.js +1 -0
- streamlit/static/static/js/{base-input.BQft14La.js → base-input.o9tL8MDP.js} +4 -4
- streamlit/static/static/js/{checkbox.yZOfXCeX.js → checkbox.0BeV1IBL.js} +1 -1
- streamlit/static/static/js/{createSuper.Dh9w1cs8.js → createSuper.RBO59fEm.js} +1 -1
- streamlit/static/static/js/data-grid-overlay-editor.CiTkUy0t.js +1 -0
- streamlit/static/static/js/{downloader.MeHtkq8r.js → downloader.DwNZg3Mw.js} +1 -1
- streamlit/static/static/js/embed.XT9xNd3F.js +195 -0
- streamlit/static/static/js/{es6.VpBPGCnM.js → es6.x9KsYQg-.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.yMw_ARIL.js → iframeResizer.contentWindow.ZVXpMPi0.js} +1 -1
- streamlit/static/static/js/index.5VPOamri.js +1 -0
- streamlit/static/static/js/index.8HslT92O.js +14 -0
- streamlit/static/static/js/index.AnXMIBz3.js +7 -0
- streamlit/static/static/js/index.B0yp3bM1.js +6 -0
- streamlit/static/static/js/index.B1fRb5wF.js +1 -0
- streamlit/static/static/js/index.B527JZdO.js +3 -0
- streamlit/static/static/js/index.BHgV-yW4.js +1 -0
- streamlit/static/static/js/index.BQr-XwGV.js +1 -0
- streamlit/static/static/js/index.BTtmaLDB.js +1 -0
- streamlit/static/static/js/index.BWB_91TA.js +1 -0
- streamlit/static/static/js/index.BfEKaEmw.js +1 -0
- streamlit/static/static/js/index.BfXjTO8b.js +1 -0
- streamlit/static/static/js/index.Bjy4NRu9.js +3 -0
- streamlit/static/static/js/index.Bu5JWpT_.js +1 -0
- streamlit/static/static/js/index.BuCx76ZV.js +1 -0
- streamlit/static/static/js/index.BxjzhVUb.js +2 -0
- streamlit/static/static/js/index.By55VdPY.js +1 -0
- streamlit/static/static/js/index.CF5MxTbK.js +1 -0
- streamlit/static/static/js/index.CLmq_z9K.js +1 -0
- streamlit/static/static/js/index.CNH4rdSz.js +1 -0
- streamlit/static/static/js/{index.B0H9IXUJ.js → index.CTgm_-jO.js} +10 -41
- streamlit/static/static/js/index.C_rK-Swb.js +188 -0
- streamlit/static/static/js/index.CjozwSzS.js +1 -0
- streamlit/static/static/js/{index.CH1tqnSs.js → index.CkGVt6-G.js} +1 -1
- streamlit/static/static/js/index.CuvXOyER.js +2 -0
- streamlit/static/static/js/{index.FFOzOWzC.js → index.CyUHWoCC.js} +2 -2
- streamlit/static/static/js/index.CyroQtI4.js +2 -0
- streamlit/static/static/js/index.D6HmkoDm.js +263 -0
- streamlit/static/static/js/index.DAqCNvsO.js +1 -0
- streamlit/static/static/js/index.DB_w_CZQ.js +1 -0
- streamlit/static/static/js/index.DBalctjj.js +2 -0
- streamlit/static/static/js/index.DK0RFJUG.js +11 -0
- streamlit/static/static/js/index.DMxc2XFp.js +151 -0
- streamlit/static/static/js/index.DO5utP74.js +2 -0
- streamlit/static/static/js/index.DS7lf09n.js +1 -0
- streamlit/static/static/js/index.DWexTVLY.js +1 -0
- streamlit/static/static/js/index.DXxnU5ej.js +1 -0
- streamlit/static/static/js/index.DcU3uDvB.js +2 -0
- streamlit/static/static/js/index.DlltaH7J.js +1 -0
- streamlit/static/static/js/index.DpNTZz82.js +27 -0
- streamlit/static/static/js/index.Dr9HIhQw.js +1 -0
- streamlit/static/static/js/index.DsgAU5lc.js +1 -0
- streamlit/static/static/js/{index.64ejlaaT.js → index.KfXqjDYy.js} +1 -1
- streamlit/static/static/js/index.PaidgjCs.js +1 -0
- streamlit/static/static/js/index.RJZuWCGA.js +1 -0
- streamlit/static/static/js/{index.Ctn27_AE.js → index.hbeqcRTn.js} +53 -122
- streamlit/static/static/js/index.q5hIQwAY.js +1 -0
- streamlit/static/static/js/index.rORSX6IW.js +1 -0
- streamlit/static/static/js/index.uSX757_v.js +1 -0
- streamlit/static/static/js/index.x_QRaLMd.js +1 -0
- streamlit/static/static/js/{input.s6pjQ49A.js → input.D5oh9-aB.js} +2 -2
- streamlit/static/static/js/main.q9oGOg0H.js +13 -0
- streamlit/static/static/js/{memory.Cuvsdfrl.js → memory.5kCSFUJS.js} +1 -1
- streamlit/static/static/js/moment.C3j7ZXd7.js +4 -0
- streamlit/static/static/js/number-overlay-editor.Cn_LsK8N.js +9 -0
- streamlit/static/static/js/pandasStylerUtils.BqhXt51_.js +1 -0
- streamlit/static/static/js/{possibleConstructorReturn.CqidKeei.js → possibleConstructorReturn.DD9NK1Z8.js} +1 -1
- streamlit/static/static/js/record.B-tDciZb.js +1 -0
- streamlit/static/static/js/{sandbox.CCQREcJx.js → sandbox.DACSyz29.js} +1 -1
- streamlit/static/static/js/styled-components.C3R090At.js +1 -0
- streamlit/static/static/js/threshold.Q1mXg5rX.js +1 -0
- streamlit/static/static/js/throttle.B0GR3Iyz.js +1 -0
- streamlit/static/static/js/{timepicker.mkJF97Bb.js → timepicker.BdhzPxrv.js} +1 -1
- streamlit/static/static/js/timer.C2hYhUse.js +1 -0
- streamlit/static/static/js/{toConsumableArray.De7I7KVR.js → toConsumableArray.Db2pdqM2.js} +1 -1
- streamlit/static/static/js/uniqueId.CtqIr-Yh.js +1 -0
- streamlit/static/static/js/urls.BwSlolu9.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.CedkNjUW.js → useBasicWidgetState.Bfp6TnSw.js} +1 -1
- streamlit/static/static/js/useIntlLocale.hRV75Xgj.js +12 -0
- streamlit/static/static/js/{useTextInputAutoExpand.Ca7w8dVs.js → useTextInputAutoExpand.QepX7n8Y.js} +1 -1
- streamlit/static/static/js/useUpdateUiValue.DHx8TzX6.js +1 -0
- streamlit/static/static/js/useWaveformController.WxVzpzEX.js +1 -0
- streamlit/static/static/js/value.B4vHRSi7.js +1 -0
- streamlit/static/static/js/wavesurfer.esm.vI8Eid4k.js +73 -0
- streamlit/static/static/js/withCalculatedWidth.DcKeRSWJ.js +1 -0
- streamlit/static/static/js/withFullScreenWrapper.CrHddARq.js +1 -0
- streamlit/static/static/media/MaterialSymbols-Rounded.C7IFxh57.woff2 +0 -0
- streamlit/string_util.py +9 -4
- streamlit/testing/v1/app_test.py +17 -2
- streamlit/testing/v1/element_tree.py +85 -9
- streamlit/testing/v1/util.py +2 -2
- streamlit/type_util.py +3 -4
- streamlit/url_util.py +1 -3
- streamlit/user_info.py +1 -2
- streamlit/util.py +3 -1
- streamlit/watcher/event_based_path_watcher.py +23 -12
- streamlit/watcher/local_sources_watcher.py +11 -1
- streamlit/watcher/path_watcher.py +9 -6
- streamlit/watcher/polling_path_watcher.py +4 -1
- streamlit/watcher/util.py +2 -2
- streamlit/web/bootstrap.py +24 -0
- streamlit/web/cli.py +51 -22
- streamlit/web/server/bidi_component_request_handler.py +193 -0
- streamlit/web/server/component_file_utils.py +97 -0
- streamlit/web/server/component_request_handler.py +8 -21
- streamlit/web/server/oauth_authlib_routes.py +5 -2
- streamlit/web/server/oidc_mixin.py +3 -1
- streamlit/web/server/routes.py +2 -2
- streamlit/web/server/server.py +9 -0
- streamlit/web/server/server_util.py +3 -1
- streamlit/web/server/upload_file_request_handler.py +19 -1
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/METADATA +10 -7
- streamlit-1.52.0.dist-info/RECORD +620 -0
- streamlit/static/static/css/index.CHEnSPGk.css +0 -1
- streamlit/static/static/js/Hooks.BRba_Own.js +0 -1
- streamlit/static/static/js/InputInstructions.xnSDuYeQ.js +0 -1
- streamlit/static/static/js/Particles.CElH0XX2.js +0 -1
- streamlit/static/static/js/data-grid-overlay-editor.DcuHuCyW.js +0 -1
- streamlit/static/static/js/index.6xX1278W.js +0 -975
- streamlit/static/static/js/index.B-hiXRzw.js +0 -1
- streamlit/static/static/js/index.B4cAbHP6.js +0 -1
- streamlit/static/static/js/index.B4dUQfni.js +0 -1
- streamlit/static/static/js/index.BPQo7BKk.js +0 -1
- streamlit/static/static/js/index.Baqa90pe.js +0 -2
- streamlit/static/static/js/index.Bj9JgOEC.js +0 -1
- streamlit/static/static/js/index.BjCwMzj4.js +0 -3
- streamlit/static/static/js/index.Bm3VbPB5.js +0 -1
- streamlit/static/static/js/index.Bxz2yX3P.js +0 -1
- streamlit/static/static/js/index.BycLveZ4.js +0 -1
- streamlit/static/static/js/index.C9BdUqTi.js +0 -1
- streamlit/static/static/js/index.CFMf5_ez.js +0 -197
- streamlit/static/static/js/index.CGYqqs6j.js +0 -1
- streamlit/static/static/js/index.CMItVsFA.js +0 -1
- streamlit/static/static/js/index.CTBk8Vk2.js +0 -1
- streamlit/static/static/js/index.CiAQIz1H.js +0 -7
- streamlit/static/static/js/index.Cj7DSzVR.js +0 -73
- streamlit/static/static/js/index.Ck8rQ9OL.js +0 -1
- streamlit/static/static/js/index.ClELlchS.js +0 -1617
- streamlit/static/static/js/index.Cnpi3o3E.js +0 -1
- streamlit/static/static/js/index.D2QEXQq_.js +0 -1
- streamlit/static/static/js/index.DH71Ezyj.js +0 -1
- streamlit/static/static/js/index.DHh-U0dK.js +0 -3
- streamlit/static/static/js/index.DK7hD7_w.js +0 -1
- streamlit/static/static/js/index.DKv_lNO7.js +0 -2
- streamlit/static/static/js/index.DNLrMXgm.js +0 -12
- streamlit/static/static/js/index.DW0Grddz.js +0 -1
- streamlit/static/static/js/index.Dbe-Q3C-.js +0 -2
- streamlit/static/static/js/index.DcPNYEUo.js +0 -1
- streamlit/static/static/js/index.DuxqVQpd.js +0 -1
- streamlit/static/static/js/index.GRUzrudl.js +0 -1
- streamlit/static/static/js/number-overlay-editor.DdgVR5m3.js +0 -9
- streamlit/static/static/js/uniqueId.RI1LJdtz.js +0 -1
- streamlit/static/static/js/useUpdateUiValue.DeXelfRH.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.C3561XxJ.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.DeCZgS-4.woff2 +0 -0
- streamlit-1.50.0.dist-info/RECORD +0 -557
- {streamlit-1.50.0.data → streamlit-1.52.0.data}/scripts/streamlit.cmd +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/WHEEL +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/top_level.txt +0 -0
streamlit/elements/map.py
CHANGED
|
@@ -21,6 +21,10 @@ import json
|
|
|
21
21
|
from typing import TYPE_CHECKING, Any, Final, cast
|
|
22
22
|
|
|
23
23
|
from streamlit import config, dataframe_util
|
|
24
|
+
from streamlit.deprecation_util import (
|
|
25
|
+
make_deprecated_name_warning,
|
|
26
|
+
show_deprecation_warning,
|
|
27
|
+
)
|
|
24
28
|
from streamlit.elements import deck_gl_json_chart
|
|
25
29
|
from streamlit.elements.lib.color_util import (
|
|
26
30
|
Color,
|
|
@@ -28,6 +32,13 @@ from streamlit.elements.lib.color_util import (
|
|
|
28
32
|
is_color_like,
|
|
29
33
|
to_int_color_tuple,
|
|
30
34
|
)
|
|
35
|
+
from streamlit.elements.lib.layout_utils import (
|
|
36
|
+
HeightWithoutContent,
|
|
37
|
+
LayoutConfig,
|
|
38
|
+
WidthWithoutContent,
|
|
39
|
+
validate_height,
|
|
40
|
+
validate_width,
|
|
41
|
+
)
|
|
31
42
|
from streamlit.errors import StreamlitAPIException
|
|
32
43
|
from streamlit.proto.DeckGlJsonChart_pb2 import DeckGlJsonChart as DeckGlJsonChartProto
|
|
33
44
|
from streamlit.runtime.metrics_util import gather_metrics
|
|
@@ -85,9 +96,9 @@ class MapMixin:
|
|
|
85
96
|
color: None | str | Color = None,
|
|
86
97
|
size: None | str | float = None,
|
|
87
98
|
zoom: int | None = None,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
99
|
+
width: WidthWithoutContent = "stretch",
|
|
100
|
+
height: HeightWithoutContent = 500,
|
|
101
|
+
use_container_width: bool | None = None,
|
|
91
102
|
) -> DeltaGenerator:
|
|
92
103
|
"""Display a map with a scatterplot overlaid onto it.
|
|
93
104
|
|
|
@@ -163,28 +174,42 @@ class MapMixin:
|
|
|
163
174
|
Zoom level as specified in
|
|
164
175
|
https://wiki.openstreetmap.org/wiki/Zoom_levels.
|
|
165
176
|
|
|
166
|
-
|
|
177
|
+
width : "stretch" or int
|
|
178
|
+
The width of the chart element. This can be one of the following:
|
|
179
|
+
|
|
180
|
+
- ``"stretch"`` (default): The width of the element matches the
|
|
181
|
+
width of the parent container.
|
|
182
|
+
- An integer specifying the width in pixels: The element has a
|
|
183
|
+
fixed width. If the specified width is greater than the width of
|
|
184
|
+
the parent container, the width of the element matches the width
|
|
185
|
+
of the parent container.
|
|
186
|
+
|
|
187
|
+
height : "stretch" or int
|
|
188
|
+
The height of the chart element. This can be one of the following:
|
|
189
|
+
|
|
190
|
+
- An integer specifying the height in pixels: The element has a
|
|
191
|
+
fixed height. If the content is larger than the specified
|
|
192
|
+
height, scrolling is enabled. This is ``500`` by default.
|
|
193
|
+
- ``"stretch"``: The height of the element matches the height of
|
|
194
|
+
its content or the height of the parent container, whichever is
|
|
195
|
+
larger. If the element is not in a parent container, the height
|
|
196
|
+
of the element matches the height of its content.
|
|
197
|
+
|
|
198
|
+
use_container_width : bool or None
|
|
167
199
|
Whether to override the map's native width with the width of
|
|
168
|
-
the parent container.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
Streamlit sets the width of the
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
To use ``width``, you must set ``use_container_width=False``.
|
|
183
|
-
|
|
184
|
-
height : int or None
|
|
185
|
-
Desired height of the chart expressed in pixels. If ``height`` is
|
|
186
|
-
``None`` (default), Streamlit sets the height of the chart to fit
|
|
187
|
-
its contents according to the plotting library.
|
|
200
|
+
the parent container. This can be one of the following:
|
|
201
|
+
|
|
202
|
+
- ``None`` (default): Streamlit will use the map's default behavior.
|
|
203
|
+
- ``True``: Streamlit sets the width of the map to match the
|
|
204
|
+
width of the parent container.
|
|
205
|
+
- ``False``: Streamlit sets the width of the map to fit its
|
|
206
|
+
contents according to the plotting library, up to the width of
|
|
207
|
+
the parent container.
|
|
208
|
+
|
|
209
|
+
.. deprecated::
|
|
210
|
+
``use_container_width`` is deprecated and will be removed in a
|
|
211
|
+
future release. For ``use_container_width=True``, use
|
|
212
|
+
``width="stretch"``.
|
|
188
213
|
|
|
189
214
|
Examples
|
|
190
215
|
--------
|
|
@@ -231,12 +256,35 @@ class MapMixin:
|
|
|
231
256
|
height: 600px
|
|
232
257
|
|
|
233
258
|
"""
|
|
259
|
+
# Handle use_container_width deprecation (for elements that already had width parameter)
|
|
260
|
+
if use_container_width is not None:
|
|
261
|
+
show_deprecation_warning(
|
|
262
|
+
make_deprecated_name_warning(
|
|
263
|
+
"use_container_width",
|
|
264
|
+
"width",
|
|
265
|
+
"2025-12-31",
|
|
266
|
+
"For `use_container_width=True`, use `width='stretch'`. "
|
|
267
|
+
"For `use_container_width=False`, specify an integer width.",
|
|
268
|
+
include_st_prefix=False,
|
|
269
|
+
),
|
|
270
|
+
show_in_browser=False,
|
|
271
|
+
)
|
|
272
|
+
if use_container_width:
|
|
273
|
+
width = "stretch"
|
|
274
|
+
# For use_container_width=False, preserve any integer width that was set.
|
|
275
|
+
|
|
276
|
+
validate_width(width, allow_content=False)
|
|
277
|
+
validate_height(height, allow_content=False)
|
|
278
|
+
|
|
234
279
|
map_proto = DeckGlJsonChartProto()
|
|
235
280
|
deck_gl_json = to_deckgl_json(data, latitude, longitude, size, color, zoom)
|
|
236
|
-
|
|
237
|
-
|
|
281
|
+
|
|
282
|
+
marshall(map_proto, deck_gl_json)
|
|
283
|
+
|
|
284
|
+
layout_config = LayoutConfig(width=width, height=height)
|
|
285
|
+
return self.dg._enqueue(
|
|
286
|
+
"deck_gl_json_chart", map_proto, layout_config=layout_config
|
|
238
287
|
)
|
|
239
|
-
return self.dg._enqueue("deck_gl_json_chart", map_proto)
|
|
240
288
|
|
|
241
289
|
@property
|
|
242
290
|
def dg(self) -> DeltaGenerator:
|
|
@@ -464,18 +512,13 @@ def _get_zoom_level(distance: float) -> int:
|
|
|
464
512
|
def marshall(
|
|
465
513
|
pydeck_proto: DeckGlJsonChartProto,
|
|
466
514
|
pydeck_json: str,
|
|
467
|
-
use_container_width: bool,
|
|
468
|
-
height: int | None = None,
|
|
469
|
-
width: int | None = None,
|
|
470
515
|
) -> None:
|
|
471
|
-
|
|
472
|
-
pydeck_proto.use_container_width = use_container_width
|
|
473
|
-
|
|
474
|
-
if width:
|
|
475
|
-
pydeck_proto.width = width
|
|
476
|
-
if height:
|
|
477
|
-
pydeck_proto.height = height
|
|
516
|
+
"""Marshall a map proto with the given pydeck JSON specification.
|
|
478
517
|
|
|
518
|
+
Layout configuration (width, height, etc.) is handled by the LayoutConfig
|
|
519
|
+
system and not through proto fields.
|
|
520
|
+
"""
|
|
521
|
+
pydeck_proto.json = pydeck_json
|
|
479
522
|
pydeck_proto.id = ""
|
|
480
523
|
|
|
481
524
|
mapbox_token = config.get_option("mapbox.token")
|
streamlit/elements/markdown.py
CHANGED
|
@@ -18,6 +18,7 @@ from typing import TYPE_CHECKING, Final, Literal, cast
|
|
|
18
18
|
|
|
19
19
|
from streamlit.elements.lib.layout_utils import (
|
|
20
20
|
LayoutConfig,
|
|
21
|
+
TextAlignment,
|
|
21
22
|
Width,
|
|
22
23
|
WidthWithoutContent,
|
|
23
24
|
validate_width,
|
|
@@ -44,6 +45,7 @@ class MarkdownMixin:
|
|
|
44
45
|
*, # keyword-only arguments:
|
|
45
46
|
help: str | None = None,
|
|
46
47
|
width: Width = "stretch",
|
|
48
|
+
text_alignment: TextAlignment = "left",
|
|
47
49
|
) -> DeltaGenerator:
|
|
48
50
|
r"""Display string formatted as Markdown.
|
|
49
51
|
|
|
@@ -129,6 +131,22 @@ class MarkdownMixin:
|
|
|
129
131
|
the parent container, the width of the element matches the width
|
|
130
132
|
of the parent container.
|
|
131
133
|
|
|
134
|
+
text_alignment : "left", "center", "right", or "justify"
|
|
135
|
+
The horizontal alignment of the text within the element. This can
|
|
136
|
+
be one of the following:
|
|
137
|
+
|
|
138
|
+
- ``"left"`` (default): Text is aligned to the left edge.
|
|
139
|
+
- ``"center"``: Text is centered.
|
|
140
|
+
- ``"right"``: Text is aligned to the right edge.
|
|
141
|
+
- ``"justify"``: Text is justified (stretched to fill the available
|
|
142
|
+
width with the last line left-aligned).
|
|
143
|
+
|
|
144
|
+
.. note::
|
|
145
|
+
For text alignment to have a visible effect, the element's
|
|
146
|
+
width must be wider than its content. If you use
|
|
147
|
+
``width="content"`` with short text, the alignment may not be
|
|
148
|
+
noticeable.
|
|
149
|
+
|
|
132
150
|
Examples
|
|
133
151
|
--------
|
|
134
152
|
>>> import streamlit as st
|
|
@@ -161,7 +179,7 @@ class MarkdownMixin:
|
|
|
161
179
|
markdown_proto.help = help
|
|
162
180
|
|
|
163
181
|
validate_width(width, allow_content=True)
|
|
164
|
-
layout_config = LayoutConfig(width=width)
|
|
182
|
+
layout_config = LayoutConfig(width=width, text_alignment=text_alignment)
|
|
165
183
|
|
|
166
184
|
return self.dg._enqueue("markdown", markdown_proto, layout_config=layout_config)
|
|
167
185
|
|
|
@@ -173,6 +191,7 @@ class MarkdownMixin:
|
|
|
173
191
|
*, # keyword-only arguments:
|
|
174
192
|
help: str | None = None,
|
|
175
193
|
width: Width = "stretch",
|
|
194
|
+
text_alignment: TextAlignment = "left",
|
|
176
195
|
) -> DeltaGenerator:
|
|
177
196
|
"""Display text in small font.
|
|
178
197
|
|
|
@@ -224,6 +243,22 @@ class MarkdownMixin:
|
|
|
224
243
|
the parent container, the width of the element matches the width
|
|
225
244
|
of the parent container.
|
|
226
245
|
|
|
246
|
+
text_alignment : "left", "center", "right", or "justify"
|
|
247
|
+
The horizontal alignment of the text within the element. This can
|
|
248
|
+
be one of the following:
|
|
249
|
+
|
|
250
|
+
- ``"left"`` (default): Text is aligned to the left edge.
|
|
251
|
+
- ``"center"``: Text is centered.
|
|
252
|
+
- ``"right"``: Text is aligned to the right edge.
|
|
253
|
+
- ``"justify"``: Text is justified (stretched to fill the available
|
|
254
|
+
width with the last line left-aligned).
|
|
255
|
+
|
|
256
|
+
.. note::
|
|
257
|
+
For text alignment to have a visible effect, the element's
|
|
258
|
+
width must be wider than its content. If you use
|
|
259
|
+
``width="content"`` with short text, the alignment may not be
|
|
260
|
+
noticeable.
|
|
261
|
+
|
|
227
262
|
Examples
|
|
228
263
|
--------
|
|
229
264
|
>>> import streamlit as st
|
|
@@ -241,7 +276,7 @@ class MarkdownMixin:
|
|
|
241
276
|
caption_proto.help = help
|
|
242
277
|
|
|
243
278
|
validate_width(width, allow_content=True)
|
|
244
|
-
layout_config = LayoutConfig(width=width)
|
|
279
|
+
layout_config = LayoutConfig(width=width, text_alignment=text_alignment)
|
|
245
280
|
|
|
246
281
|
return self.dg._enqueue("markdown", caption_proto, layout_config=layout_config)
|
|
247
282
|
|
|
@@ -370,6 +405,7 @@ class MarkdownMixin:
|
|
|
370
405
|
"primary",
|
|
371
406
|
] = "blue",
|
|
372
407
|
width: Width = "content",
|
|
408
|
+
help: str | None = None,
|
|
373
409
|
) -> DeltaGenerator:
|
|
374
410
|
"""Display a colored badge with an icon and label.
|
|
375
411
|
|
|
@@ -437,6 +473,14 @@ class MarkdownMixin:
|
|
|
437
473
|
the parent container, the width of the element matches the width
|
|
438
474
|
of the parent container.
|
|
439
475
|
|
|
476
|
+
help : str or None
|
|
477
|
+
A tooltip to display when hovering over the badge. If this is
|
|
478
|
+
``None`` (default), no tooltip is displayed.
|
|
479
|
+
|
|
480
|
+
The tooltip can optionally contain GitHub-flavored Markdown,
|
|
481
|
+
including the Markdown directives described in the ``body``
|
|
482
|
+
parameter of ``st.markdown``.
|
|
483
|
+
|
|
440
484
|
Examples
|
|
441
485
|
--------
|
|
442
486
|
Create standalone badges with ``st.badge`` (with or without icons). If
|
|
@@ -452,7 +496,7 @@ class MarkdownMixin:
|
|
|
452
496
|
>>> ":violet-badge[:material/star: Favorite] :orange-badge[⚠️ Needs review] :gray-badge[Deprecated]"
|
|
453
497
|
>>> )
|
|
454
498
|
|
|
455
|
-
.. output
|
|
499
|
+
.. output::
|
|
456
500
|
https://doc-badge.streamlit.app/
|
|
457
501
|
height: 220px
|
|
458
502
|
|
|
@@ -466,6 +510,9 @@ class MarkdownMixin:
|
|
|
466
510
|
badge_proto.body = f":{color}-badge[{icon_str}{escaped_label}]"
|
|
467
511
|
badge_proto.element_type = MarkdownProto.Type.NATIVE
|
|
468
512
|
|
|
513
|
+
if help is not None:
|
|
514
|
+
badge_proto.help = help
|
|
515
|
+
|
|
469
516
|
validate_width(width, allow_content=True)
|
|
470
517
|
layout_config = LayoutConfig(width=width)
|
|
471
518
|
|
streamlit/elements/media.py
CHANGED
|
@@ -18,9 +18,7 @@ import io
|
|
|
18
18
|
import re
|
|
19
19
|
from datetime import timedelta
|
|
20
20
|
from pathlib import Path
|
|
21
|
-
from typing import TYPE_CHECKING, Final, Union, cast
|
|
22
|
-
|
|
23
|
-
from typing_extensions import TypeAlias
|
|
21
|
+
from typing import TYPE_CHECKING, Final, TypeAlias, Union, cast
|
|
24
22
|
|
|
25
23
|
from streamlit import runtime, type_util, url_util
|
|
26
24
|
from streamlit.elements.lib.layout_utils import WidthWithoutContent, validate_width
|
|
@@ -53,11 +51,11 @@ MediaData: TypeAlias = Union[
|
|
|
53
51
|
None,
|
|
54
52
|
]
|
|
55
53
|
|
|
56
|
-
SubtitleData: TypeAlias =
|
|
57
|
-
str
|
|
58
|
-
|
|
54
|
+
SubtitleData: TypeAlias = (
|
|
55
|
+
str | Path | bytes | io.BytesIO | dict[str, str | Path | bytes | io.BytesIO] | None
|
|
56
|
+
)
|
|
59
57
|
|
|
60
|
-
MediaTime: TypeAlias =
|
|
58
|
+
MediaTime: TypeAlias = int | float | timedelta | str
|
|
61
59
|
|
|
62
60
|
TIMEDELTA_PARSE_ERROR_MESSAGE: Final = (
|
|
63
61
|
"Failed to convert '{param_name}' to a timedelta. "
|
streamlit/elements/metric.py
CHANGED
|
@@ -16,9 +16,7 @@ from __future__ import annotations
|
|
|
16
16
|
|
|
17
17
|
from dataclasses import dataclass
|
|
18
18
|
from textwrap import dedent
|
|
19
|
-
from typing import TYPE_CHECKING, Any, Literal,
|
|
20
|
-
|
|
21
|
-
from typing_extensions import TypeAlias
|
|
19
|
+
from typing import TYPE_CHECKING, Any, Literal, TypeAlias, cast
|
|
22
20
|
|
|
23
21
|
from streamlit.dataframe_util import OptionSequence, convert_anything_to_list
|
|
24
22
|
from streamlit.elements.lib.layout_utils import (
|
|
@@ -33,7 +31,7 @@ from streamlit.elements.lib.utils import (
|
|
|
33
31
|
LabelVisibility,
|
|
34
32
|
get_label_visibility_proto_value,
|
|
35
33
|
)
|
|
36
|
-
from streamlit.errors import StreamlitAPIException
|
|
34
|
+
from streamlit.errors import StreamlitAPIException, StreamlitValueError
|
|
37
35
|
from streamlit.proto.Metric_pb2 import Metric as MetricProto
|
|
38
36
|
from streamlit.runtime.metrics_util import gather_metrics
|
|
39
37
|
from streamlit.string_util import AnyNumber, clean_text, from_number
|
|
@@ -42,9 +40,10 @@ if TYPE_CHECKING:
|
|
|
42
40
|
from streamlit.delta_generator import DeltaGenerator
|
|
43
41
|
|
|
44
42
|
|
|
45
|
-
Value: TypeAlias =
|
|
46
|
-
Delta: TypeAlias =
|
|
43
|
+
Value: TypeAlias = AnyNumber | str | None
|
|
44
|
+
Delta: TypeAlias = AnyNumber | str | None
|
|
47
45
|
DeltaColor: TypeAlias = Literal["normal", "inverse", "off"]
|
|
46
|
+
DeltaArrow: TypeAlias = Literal["auto", "up", "down", "off"]
|
|
48
47
|
|
|
49
48
|
|
|
50
49
|
@dataclass(frozen=True)
|
|
@@ -69,6 +68,7 @@ class MetricMixin:
|
|
|
69
68
|
height: Height = "content",
|
|
70
69
|
chart_data: OptionSequence[Any] | None = None,
|
|
71
70
|
chart_type: Literal["line", "bar", "area"] = "line",
|
|
71
|
+
delta_arrow: DeltaArrow = "auto",
|
|
72
72
|
) -> DeltaGenerator:
|
|
73
73
|
r"""Display a metric in big bold font, with an optional indicator of how the metric changed.
|
|
74
74
|
|
|
@@ -174,6 +174,17 @@ class MetricMixin:
|
|
|
174
174
|
- ``"area"``: A sparkline with area shading.
|
|
175
175
|
- ``"bar"``: A bar chart.
|
|
176
176
|
|
|
177
|
+
delta_arrow : "auto", "up", "down", or "off"
|
|
178
|
+
Controls the direction of the delta indicator arrow. This can be
|
|
179
|
+
one of the following strings:
|
|
180
|
+
|
|
181
|
+
- ``"auto"`` (default): The arrow direction follows the sign of
|
|
182
|
+
``delta``.
|
|
183
|
+
- ``"up"`` or ``"down"``: The arrow is forced to point in the
|
|
184
|
+
specified direction.
|
|
185
|
+
- ``"off"``: No arrow is shown, but the delta value remains
|
|
186
|
+
visible.
|
|
187
|
+
|
|
177
188
|
Examples
|
|
178
189
|
--------
|
|
179
190
|
**Example 1: Show a metric**
|
|
@@ -282,6 +293,17 @@ class MetricMixin:
|
|
|
282
293
|
)
|
|
283
294
|
metric_proto.color = color_and_direction.color
|
|
284
295
|
metric_proto.direction = color_and_direction.direction
|
|
296
|
+
parsed_delta_arrow = _parse_delta_arrow(
|
|
297
|
+
cast("DeltaArrow", clean_text(delta_arrow))
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
if parsed_delta_arrow != "auto":
|
|
301
|
+
if parsed_delta_arrow == "off":
|
|
302
|
+
metric_proto.direction = MetricProto.MetricDirection.NONE
|
|
303
|
+
elif parsed_delta_arrow == "up":
|
|
304
|
+
metric_proto.direction = MetricProto.MetricDirection.UP
|
|
305
|
+
elif parsed_delta_arrow == "down":
|
|
306
|
+
metric_proto.direction = MetricProto.MetricDirection.DOWN
|
|
285
307
|
metric_proto.label_visibility.value = get_label_visibility_proto_value(
|
|
286
308
|
label_visibility
|
|
287
309
|
)
|
|
@@ -324,6 +346,12 @@ def _parse_chart_type(
|
|
|
324
346
|
return MetricProto.ChartType.LINE
|
|
325
347
|
|
|
326
348
|
|
|
349
|
+
def _parse_delta_arrow(delta_arrow: DeltaArrow) -> DeltaArrow:
|
|
350
|
+
if delta_arrow not in {"auto", "up", "down", "off"}:
|
|
351
|
+
raise StreamlitValueError("delta_arrow", ["auto", "up", "down", "off"])
|
|
352
|
+
return delta_arrow
|
|
353
|
+
|
|
354
|
+
|
|
327
355
|
def _parse_label(label: str) -> str:
|
|
328
356
|
if not isinstance(label, str):
|
|
329
357
|
raise TypeError(
|
streamlit/elements/pdf.py
CHANGED
|
@@ -16,9 +16,7 @@ from __future__ import annotations
|
|
|
16
16
|
|
|
17
17
|
import io
|
|
18
18
|
from pathlib import Path
|
|
19
|
-
from typing import TYPE_CHECKING, Any,
|
|
20
|
-
|
|
21
|
-
from typing_extensions import TypeAlias
|
|
19
|
+
from typing import TYPE_CHECKING, Any, TypeAlias, cast
|
|
22
20
|
|
|
23
21
|
from streamlit import url_util
|
|
24
22
|
from streamlit.elements.lib.layout_utils import validate_height
|
|
@@ -29,7 +27,7 @@ if TYPE_CHECKING:
|
|
|
29
27
|
from streamlit.delta_generator import DeltaGenerator
|
|
30
28
|
from streamlit.elements.lib.layout_utils import HeightWithoutContent
|
|
31
29
|
|
|
32
|
-
PdfData: TypeAlias =
|
|
30
|
+
PdfData: TypeAlias = str | Path | bytes | io.BytesIO
|
|
33
31
|
|
|
34
32
|
|
|
35
33
|
def _get_pdf_component() -> Any | None:
|