streamlit-nightly 1.41.2.dev20241222__py2.py3-none-any.whl → 1.41.2.dev20241224__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.
@@ -38,7 +38,7 @@ class BokehMixin:
38
38
  def bokeh_chart(
39
39
  self,
40
40
  figure: Figure,
41
- use_container_width: bool = False,
41
+ use_container_width: bool = True,
42
42
  ) -> DeltaGenerator:
43
43
  """Display an interactive Bokeh chart.
44
44
 
@@ -60,11 +60,11 @@ class BokehMixin:
60
60
 
61
61
  use_container_width : bool
62
62
  Whether to override the figure's native width with the width of
63
- the parent container. If ``use_container_width`` is ``False``
64
- (default), Streamlit sets the width of the chart to fit its contents
65
- according to the plotting library, up to the width of the parent
66
- container. If ``use_container_width`` is ``True``, Streamlit sets
67
- the width of the figure to match the width of the parent container.
63
+ the parent container. If ``use_container_width`` is ``True`` (default),
64
+ Streamlit sets the width of the figure to match the width of the parent
65
+ container. If ``use_container_width`` is ``False``, Streamlit sets the
66
+ width of the chart to fit its contents according to the plotting library,
67
+ up to the width of the parent container.
68
68
 
69
69
  Example
70
70
  -------
@@ -77,7 +77,7 @@ class BokehMixin:
77
77
  >>> p = figure(title="simple line example", x_axis_label="x", y_axis_label="y")
78
78
  >>> p.line(x, y, legend_label="Trend", line_width=2)
79
79
  >>>
80
- >>> st.bokeh_chart(p, use_container_width=True)
80
+ >>> st.bokeh_chart(p)
81
81
 
82
82
  .. output::
83
83
  https://doc-bokeh-chart.streamlit.app/
@@ -264,7 +264,7 @@ class PydeckMixin:
264
264
  self,
265
265
  pydeck_obj: Deck | None = None,
266
266
  *,
267
- use_container_width: bool = False,
267
+ use_container_width: bool = True,
268
268
  width: int | None = None,
269
269
  height: int | None = None,
270
270
  selection_mode: Literal[
@@ -279,7 +279,7 @@ class PydeckMixin:
279
279
  self,
280
280
  pydeck_obj: Deck | None = None,
281
281
  *,
282
- use_container_width: bool = False,
282
+ use_container_width: bool = True,
283
283
  width: int | None = None,
284
284
  height: int | None = None,
285
285
  selection_mode: SelectionMode = "single-object",
@@ -292,7 +292,7 @@ class PydeckMixin:
292
292
  self,
293
293
  pydeck_obj: Deck | None = None,
294
294
  *,
295
- use_container_width: bool = False,
295
+ use_container_width: bool = True,
296
296
  width: int | None = None,
297
297
  height: int | None = None,
298
298
  selection_mode: SelectionMode = "single-object",
@@ -331,11 +331,11 @@ class PydeckMixin:
331
331
  Object specifying the PyDeck chart to draw.
332
332
  use_container_width : bool
333
333
  Whether to override the figure's native width with the width of
334
- the parent container. If ``use_container_width`` is ``False``
335
- (default), Streamlit sets the width of the chart to fit its contents
336
- according to the plotting library, up to the width of the parent
337
- container. If ``use_container_width`` is ``True``, Streamlit sets
338
- the width of the figure to match the width of the parent container.
334
+ the parent container. If ``use_container_width`` is ``True`` (default),
335
+ Streamlit sets the width of the figure to match the width of the parent
336
+ container. If ``use_container_width`` is ``False``, Streamlit sets the
337
+ width of the chart to fit its contents according to the plotting library,
338
+ up to the width of the parent container.
339
339
  width : int or None
340
340
  Desired width of the chart expressed in pixels. If ``width`` is
341
341
  ``None`` (default), Streamlit sets the width of the chart to fit
@@ -273,7 +273,7 @@ class PlotlyMixin:
273
273
  def plotly_chart(
274
274
  self,
275
275
  figure_or_data: FigureOrData,
276
- use_container_width: bool = False,
276
+ use_container_width: bool = True,
277
277
  *,
278
278
  theme: Literal["streamlit"] | None = "streamlit",
279
279
  key: Key | None = None,
@@ -290,7 +290,7 @@ class PlotlyMixin:
290
290
  def plotly_chart(
291
291
  self,
292
292
  figure_or_data: FigureOrData,
293
- use_container_width: bool = False,
293
+ use_container_width: bool = True,
294
294
  *,
295
295
  theme: Literal["streamlit"] | None = "streamlit",
296
296
  key: Key | None = None,
@@ -307,7 +307,7 @@ class PlotlyMixin:
307
307
  def plotly_chart(
308
308
  self,
309
309
  figure_or_data: FigureOrData,
310
- use_container_width: bool = False,
310
+ use_container_width: bool = True,
311
311
  *,
312
312
  theme: Literal["streamlit"] | None = "streamlit",
313
313
  key: Key | None = None,
@@ -342,11 +342,11 @@ class PlotlyMixin:
342
342
 
343
343
  use_container_width : bool
344
344
  Whether to override the figure's native width with the width of
345
- the parent container. If ``use_container_width`` is ``False``
346
- (default), Streamlit sets the width of the chart to fit its contents
347
- according to the plotting library, up to the width of the parent
348
- container. If ``use_container_width`` is ``True``, Streamlit sets
349
- the width of the figure to match the width of the parent container.
345
+ the parent container. If ``use_container_width`` is ``True`` (default),
346
+ Streamlit sets the width of the figure to match the width of the parent
347
+ container. If ``use_container_width`` is ``False``, Streamlit sets the
348
+ width of the chart to fit its contents according to the plotting library,
349
+ up to the width of the parent container.
350
350
 
351
351
  theme : "streamlit" or None
352
352
  The theme of the chart. If ``theme`` is ``"streamlit"`` (default),
@@ -431,7 +431,7 @@ class PlotlyMixin:
431
431
  ... hist_data, group_labels, bin_size=[.1, .25, .5])
432
432
  >>>
433
433
  >>> # Plot!
434
- >>> st.plotly_chart(fig, use_container_width=True)
434
+ >>> st.plotly_chart(fig)
435
435
 
436
436
  .. output::
437
437
  https://doc-plotly-chart.streamlit.app/
@@ -243,7 +243,7 @@ class VegaLiteStateSerde:
243
243
 
244
244
  def _prepare_vega_lite_spec(
245
245
  spec: VegaLiteSpec,
246
- use_container_width: bool = False,
246
+ use_container_width: bool,
247
247
  **kwargs,
248
248
  ) -> VegaLiteSpec:
249
249
  if len(kwargs):
@@ -1467,7 +1467,7 @@ class VegaChartsMixin:
1467
1467
  self,
1468
1468
  altair_chart: alt.Chart,
1469
1469
  *,
1470
- use_container_width: bool = False,
1470
+ use_container_width: bool | None = None,
1471
1471
  theme: Literal["streamlit"] | None = "streamlit",
1472
1472
  key: Key | None = None,
1473
1473
  on_select: Literal["ignore"], # No default value here to make it work with mypy
@@ -1479,7 +1479,7 @@ class VegaChartsMixin:
1479
1479
  self,
1480
1480
  altair_chart: alt.Chart,
1481
1481
  *,
1482
- use_container_width: bool = False,
1482
+ use_container_width: bool | None = None,
1483
1483
  theme: Literal["streamlit"] | None = "streamlit",
1484
1484
  key: Key | None = None,
1485
1485
  on_select: Literal["rerun"] | WidgetCallback = "rerun",
@@ -1491,7 +1491,7 @@ class VegaChartsMixin:
1491
1491
  self,
1492
1492
  altair_chart: alt.Chart,
1493
1493
  *,
1494
- use_container_width: bool = False,
1494
+ use_container_width: bool | None = None,
1495
1495
  theme: Literal["streamlit"] | None = "streamlit",
1496
1496
  key: Key | None = None,
1497
1497
  on_select: Literal["rerun", "ignore"] | WidgetCallback = "ignore",
@@ -1510,13 +1510,17 @@ class VegaChartsMixin:
1510
1510
  https://altair-viz.github.io/gallery/ for examples of graph
1511
1511
  descriptions.
1512
1512
 
1513
- use_container_width : bool
1513
+ use_container_width : bool or None
1514
1514
  Whether to override the figure's native width with the width of
1515
- the parent container. If ``use_container_width`` is ``False``
1516
- (default), Streamlit sets the width of the chart to fit its contents
1515
+ the parent container. If ``use_container_width`` is None (default),
1516
+ Streamlit will set it to True for all charts except for facet,
1517
+ horizontal concatenation, and repeat charts (note that for these chart
1518
+ types, ``use_container_width=True`` doesn't work properly). If
1519
+ ``use_container_width`` is ``True``, Streamlit sets the width of the
1520
+ figure to match the width of the parent container. If ``use_container_width``
1521
+ is ``False``, Streamlit sets the width of the chart to fit its contents
1517
1522
  according to the plotting library, up to the width of the parent
1518
- container. If ``use_container_width`` is ``True``, Streamlit sets
1519
- the width of the figure to match the width of the parent container.
1523
+ container.
1520
1524
 
1521
1525
  theme : "streamlit" or None
1522
1526
  The theme of the chart. If ``theme`` is ``"streamlit"`` (default),
@@ -1596,7 +1600,7 @@ class VegaChartsMixin:
1596
1600
  ... .encode(x="a", y="b", size="c", color="c", tooltip=["a", "b", "c"])
1597
1601
  ... )
1598
1602
  >>>
1599
- >>> st.altair_chart(c, use_container_width=True)
1603
+ >>> st.altair_chart(c)
1600
1604
 
1601
1605
  .. output::
1602
1606
  https://doc-vega-lite-chart.streamlit.app/
@@ -1618,7 +1622,7 @@ class VegaChartsMixin:
1618
1622
  data: Data = None,
1619
1623
  spec: VegaLiteSpec | None = None,
1620
1624
  *,
1621
- use_container_width: bool = False,
1625
+ use_container_width: bool | None = None,
1622
1626
  theme: Literal["streamlit"] | None = "streamlit",
1623
1627
  key: Key | None = None,
1624
1628
  on_select: Literal["ignore"], # No default value here to make it work with mypy
@@ -1632,7 +1636,7 @@ class VegaChartsMixin:
1632
1636
  data: Data = None,
1633
1637
  spec: VegaLiteSpec | None = None,
1634
1638
  *,
1635
- use_container_width: bool = False,
1639
+ use_container_width: bool | None = None,
1636
1640
  theme: Literal["streamlit"] | None = "streamlit",
1637
1641
  key: Key | None = None,
1638
1642
  on_select: Literal["rerun"] | WidgetCallback = "rerun",
@@ -1646,7 +1650,7 @@ class VegaChartsMixin:
1646
1650
  data: Data = None,
1647
1651
  spec: VegaLiteSpec | None = None,
1648
1652
  *,
1649
- use_container_width: bool = False,
1653
+ use_container_width: bool | None = None,
1650
1654
  theme: Literal["streamlit"] | None = "streamlit",
1651
1655
  key: Key | None = None,
1652
1656
  on_select: Literal["rerun", "ignore"] | WidgetCallback = "ignore",
@@ -1670,13 +1674,17 @@ class VegaChartsMixin:
1670
1674
  to both ``data`` and ``spec``. See
1671
1675
  https://vega.github.io/vega-lite/docs/ for more info.
1672
1676
 
1673
- use_container_width : bool
1677
+ use_container_width : bool or None
1674
1678
  Whether to override the figure's native width with the width of
1675
- the parent container. If ``use_container_width`` is ``False``
1676
- (default), Streamlit sets the width of the chart to fit its contents
1679
+ the parent container. If ``use_container_width`` is None (default),
1680
+ Streamlit will set it to True for all charts except for facet,
1681
+ horizontal concatenation, and repeat charts (note that for these chart
1682
+ types, ``use_container_width=True`` doesn't work properly). If
1683
+ ``use_container_width`` is ``True``, Streamlit sets the width of the
1684
+ figure to match the width of the parent container. If ``use_container_width``
1685
+ is ``False``, Streamlit sets the width of the chart to fit its contents
1677
1686
  according to the plotting library, up to the width of the parent
1678
- container. If ``use_container_width`` is ``True``, Streamlit sets
1679
- the width of the figure to match the width of the parent container.
1687
+ container.
1680
1688
 
1681
1689
  theme : "streamlit" or None
1682
1690
  The theme of the chart. If ``theme`` is ``"streamlit"`` (default),
@@ -1788,7 +1796,7 @@ class VegaChartsMixin:
1788
1796
  def _altair_chart(
1789
1797
  self,
1790
1798
  altair_chart: alt.Chart | alt.LayerChart,
1791
- use_container_width: bool = False,
1799
+ use_container_width: bool | None = None,
1792
1800
  theme: Literal["streamlit"] | None = "streamlit",
1793
1801
  key: Key | None = None,
1794
1802
  on_select: Literal["rerun", "ignore"] | WidgetCallback = "ignore",
@@ -1824,7 +1832,7 @@ class VegaChartsMixin:
1824
1832
  self,
1825
1833
  data: Data = None,
1826
1834
  spec: VegaLiteSpec | None = None,
1827
- use_container_width: bool = False,
1835
+ use_container_width: bool | None = None,
1828
1836
  theme: Literal["streamlit"] | None = "streamlit",
1829
1837
  key: Key | None = None,
1830
1838
  on_select: Literal["rerun", "ignore"] | WidgetCallback = "ignore",
@@ -1875,6 +1883,22 @@ class VegaChartsMixin:
1875
1883
  if spec is None:
1876
1884
  spec = {}
1877
1885
 
1886
+ # Set the default value for `use_container_width`.
1887
+ if use_container_width is None:
1888
+ # Some multi-view charts (facet, horizontal concatenation, and repeat;
1889
+ # see https://altair-viz.github.io/user_guide/compound_charts.html)
1890
+ # don't work well with `use_container_width=True`, so we disable it for
1891
+ # those charts (see https://github.com/streamlit/streamlit/issues/9091).
1892
+ # All other charts (including vertical concatenation) default to
1893
+ # `use_container_width=True`.
1894
+ is_facet_chart = "facet" in spec or (
1895
+ "encoding" in spec
1896
+ and (any(x in spec["encoding"] for x in ["row", "column", "facet"]))
1897
+ )
1898
+ use_container_width = not (
1899
+ is_facet_chart or "hconcat" in spec or "repeat" in spec
1900
+ )
1901
+
1878
1902
  vega_lite_proto = ArrowVegaLiteChartProto()
1879
1903
 
1880
1904
  spec = _prepare_vega_lite_spec(spec, use_container_width, **kwargs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: streamlit-nightly
3
- Version: 1.41.2.dev20241222
3
+ Version: 1.41.2.dev20241224
4
4
  Summary: A faster way to build and share data apps
5
5
  Home-page: https://streamlit.io
6
6
  Author: Snowflake Inc
@@ -59,9 +59,9 @@ streamlit/elements/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQg
59
59
  streamlit/elements/alert.py,sha256=qUmNTG6oPFX7unoIfBvA4aK2Aq9mxrPTY9bLpr3V1ic,7424
60
60
  streamlit/elements/arrow.py,sha256=cV0UCPHjHa6-rNGHzYD2xyzPNjqdRQjizyPxPX4maI0,34781
61
61
  streamlit/elements/balloons.py,sha256=QnORgG96Opga1SVg8tUBOm-l3nMpKWmjvy1crcS2XaU,1482
62
- streamlit/elements/bokeh_chart.py,sha256=UdHeycYHEa_99Q54jalBXlo-h1xA26p2pAzwS1YaMqs,4315
62
+ streamlit/elements/bokeh_chart.py,sha256=X1uX7jVOoZLu9yEDo5B1furwKinVwYVIpfk06huipR4,4288
63
63
  streamlit/elements/code.py,sha256=Ew5A8W8Xa9fCaGx6s_SIncIsVfwAtEuHZ4Uhc7iMPoE,3763
64
- streamlit/elements/deck_gl_json_chart.py,sha256=3j8oZjtMK4IxiVW_ISlXPfu56X3UfEQhV55cGGgCWsI,20267
64
+ streamlit/elements/deck_gl_json_chart.py,sha256=yEm2WCRwxNz5Z39ExvNJV6xgyX-OorSl5dv6pe8l36g,20264
65
65
  streamlit/elements/dialog_decorator.py,sha256=12lIbNyinnfk_VvSWB8xauAMCT8PPfdn157aIMtudbg,10052
66
66
  streamlit/elements/doc_string.py,sha256=IuCqpXX0GqKIjCMcaOOHr-fmOixFlCdvCT8d8EIYEAE,16024
67
67
  streamlit/elements/empty.py,sha256=O0UGJsTsij2ZFk1bNP877vxdDkViXM04Q-lp9HMhs0U,4615
@@ -78,14 +78,14 @@ streamlit/elements/map.py,sha256=eMRitKUnggv2Q2pZ_0iniLEkfnjzHu5Jgo0VmA7ESWw,172
78
78
  streamlit/elements/markdown.py,sha256=KCbvmvUsX3nRcRY3c8_ri2IfTcS4vfj6qMQxz6aBwYg,10871
79
79
  streamlit/elements/media.py,sha256=TvXLmaZijVg68r9XjMBVzZNB-Aytke495PE-x8flKMw,31303
80
80
  streamlit/elements/metric.py,sha256=62fn-RZSs-EfXHMscnQ_jEr_wky6KUzwKoydZOx3EJ4,10829
81
- streamlit/elements/plotly_chart.py,sha256=YZUtp8ykFyHb7yzHiGXbDEvLb68X05eCxSLLggMpZM0,19635
81
+ streamlit/elements/plotly_chart.py,sha256=Idg0z39LrZFJYJ68qR0HDb68fBJ_RR08_mL0STDELKM,19606
82
82
  streamlit/elements/progress.py,sha256=yIS2pUk2BWNrgIqJ1HU4BJaTOeoq7vGakopuT-vJOzk,5323
83
83
  streamlit/elements/pyplot.py,sha256=Vy8pCxWQoJSNAQcU3M0HdrdTpsm46-xylSro2VftoAw,6475
84
84
  streamlit/elements/snow.py,sha256=WHqk8zmfOr5iD0R-wLlAdlIkDDbiaayguTVmA4e7V_Q,1439
85
85
  streamlit/elements/spinner.py,sha256=qhA0DZo3ZEYQswFYuNdaXltenvmJR_18mqDQA64bK_Q,2934
86
86
  streamlit/elements/text.py,sha256=W-F2LgQ-Z9T0ACQCSJKD7ugQJX1PMsgaHL7jz5xbE4c,2164
87
87
  streamlit/elements/toast.py,sha256=ePBhi3Cix48zK8AG1KC0tVOPYgz6WckoPf-PDrGOLxc,3711
88
- streamlit/elements/vega_charts.py,sha256=kF2vqkCqWONK0ut7ycEtsoBEJbkiKZw081IlLIZpbck,77472
88
+ streamlit/elements/vega_charts.py,sha256=SRaudX1E2SUmj7u-pddqEob1tGt_dhYUJmxtUUvUyMw,78919
89
89
  streamlit/elements/write.py,sha256=pVeGNoYG0ayaqTp8d5HzjQxs2mf21d1_GUlsLV5CEa0,22124
90
90
  streamlit/elements/lib/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
91
91
  streamlit/elements/lib/built_in_chart_utils.py,sha256=Dsq57Nyj1ykKU3AYarthUxnjHbKSz70T4--UEs1AC9k,38714
@@ -548,9 +548,9 @@ streamlit/web/server/server_util.py,sha256=ioIHkXNlA_ujj2Q3isziM8r5glKxgK2JZRoCD
548
548
  streamlit/web/server/stats_request_handler.py,sha256=e144zIhzLTB1PN4CwTCxElCoWMuo9IsBEPex2exHCQ0,3641
549
549
  streamlit/web/server/upload_file_request_handler.py,sha256=ftyKpARrUjOpRcFETIXuoTyOG_mo-ToOw5NI0y_W4lE,5003
550
550
  streamlit/web/server/websocket_headers.py,sha256=uUxypj04ondEC4ocBiYCndX_N06Zwe1Mt690Vupe08Y,2232
551
- streamlit_nightly-1.41.2.dev20241222.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
552
- streamlit_nightly-1.41.2.dev20241222.dist-info/METADATA,sha256=Jc8fH9lcqfI7dtieTwylL-FOP_wr0zYSiB251wbdRpg,8707
553
- streamlit_nightly-1.41.2.dev20241222.dist-info/WHEEL,sha256=pxeNX5JdtCe58PUSYP9upmc7jdRPgvT0Gm9kb1SHlVw,109
554
- streamlit_nightly-1.41.2.dev20241222.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
555
- streamlit_nightly-1.41.2.dev20241222.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
556
- streamlit_nightly-1.41.2.dev20241222.dist-info/RECORD,,
551
+ streamlit_nightly-1.41.2.dev20241224.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
552
+ streamlit_nightly-1.41.2.dev20241224.dist-info/METADATA,sha256=xueyQWWJ5IA4_yz7Dsm_epKwT4lWdaWQEoPvXx6DCF4,8707
553
+ streamlit_nightly-1.41.2.dev20241224.dist-info/WHEEL,sha256=pxeNX5JdtCe58PUSYP9upmc7jdRPgvT0Gm9kb1SHlVw,109
554
+ streamlit_nightly-1.41.2.dev20241224.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
555
+ streamlit_nightly-1.41.2.dev20241224.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
556
+ streamlit_nightly-1.41.2.dev20241224.dist-info/RECORD,,