Skip to content

saemeon/dash-interact

Repository files navigation

PyPI Python License Dash Ruff uv ty prek

dash-interact

pyplot-style convenience layer for Plotly Dash — build interactive apps top-to-bottom with no boilerplate.

Installation

pip install dash-interact

Quick example

from dash_interact import page

page.H1("My App")

@page.interact
def sine_wave(amplitude: float = 1.0, frequency: float = 2.0):
    import numpy as np, plotly.graph_objects as go
    x = np.linspace(0, 6 * np.pi, 600)
    return go.Figure(go.Scatter(x=x, y=amplitude * np.sin(frequency * x)))

page.run()

The page API

page works like matplotlib.pyplot — a module-level singleton that accumulates content.

from dash_interact import page

page.H1("Title")          # adds html.H1
page.Hr()                 # adds html.Hr
@page.interact            # adds an interact panel
def my_fn(...): ...
page.run()                # builds the Dash app and starts the server

The interact family

Three levels mirroring ipywidgets:

from dash_interact import interact, interactive, interactive_output

# 1. Fire and forget — attaches to the current page
@interact
def plot(amplitude: float = 1.0): ...

# 2. Embeddable — place it yourself
panel = interactive(plot, amplitude=(0, 2, 0.1))

# 3. Fully decoupled — pre-built form, separate output
form = FnForm("plot", plot)
output = interactive_output(plot, form)

License

MIT

About

An introspection-based UI generator for Plotly Dash. Automatically transform type-hinted Python functions into reactive Dash forms.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages