Procházet zdrojové kódy

feat: 更新DataFrame组件宽度设置,支持自适应宽度

zhch158_admin před 1 měsícem
rodič
revize
241855ba0c

+ 2 - 2
streamlit_test/reports/container.py

@@ -185,7 +185,7 @@ def container_dataframe():
     })
     
     with st.container(height=300, border=True):
-        st.dataframe(wide_df, use_container_width=True)
+        st.dataframe(wide_df, width='stretch')
     
     st.write("☝️ DataFrame自动支持横向滚动")
 
@@ -250,7 +250,7 @@ def container_plotly_chart():
     )
     
     with st.container(height=450, border=True):
-        st.plotly_chart(fig, use_container_width=False)
+        st.plotly_chart(fig, width='content')
     
     st.write("☝️ Plotly图表在容器中自动支持横向滚动")
 

+ 0 - 1
streamlit_test/reports/table.py

@@ -111,7 +111,6 @@ def scrollable_dataframe_2_fixed():
         df, 
         height=400,
         width=1000,
-        use_container_width=False
     )
     
     st.write("Above is a dataframe.")