show_in_dash

Contents

show_in_dash#

tollan.plot.plotly.show_in_dash(data_items: list[dict[str, Any]], title_text: str | None = None, host: str | None = None, port: int | None = None, **kwargs: Any) None[source]#

Display data items in an interactive Dash application.

Starts a local Flask server with a Dash app to display data items in tabs. The server runs until the user confirms to stop it.

Parameters:
  • data_items (list[dict]) – List of dictionaries, each containing: - ‘title_text’: str - Tab label - ‘data’: Any - Data to display (Plotly figure or other)

  • title_text (str, optional) – Main title displayed at the top of the dashboard.

  • host (str, optional) – Server host address. Defaults to ‘localhost’.

  • port (int, optional) – Server port number. Defaults to 8050.

  • **kwargs (dict) – Additional arguments passed to Dash constructor.

Examples

>>> import plotly.graph_objects as go
>>> fig = go.Figure(data=[go.Scatter(x=[1,2,3], y=[4,5,6])])
>>> show_in_dash(
...     [{'title_text': 'My Plot', 'data': fig}],
...     title_text='Dashboard'
... )