Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions example/parametricStudy/dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@


import marimo

__generated_with = "0.13.3"
app = marimo.App(width="medium")


@app.cell
def _():
import marimo as mo
import pandas as pd
import plotly.express as px
return mo, pd, px


@app.cell
def _(pd):
forces = pd.read_csv("results/forces.csv")
return (forces,)


@app.cell
def _(forces, mo):

x = mo.ui.dropdown(options=forces.columns, label="x",value=forces.columns[0])
y = mo.ui.dropdown(options=forces.columns, label="y",value=forces.columns[0])
row = mo.ui.dropdown(options=forces.columns, label="row")
col = mo.ui.dropdown(options=forces.columns, label="col")
color = mo.ui.dropdown(options=forces.columns, label="color")


return col, color, row, x, y


@app.cell
def _(col, color, forces, mo, px, row, x, y):
kwargs = {
"x": x.value,
"y": y.value,
"color": None if color.value == "--" else color.value,
# "size": None if size.value == "--" else size.value,
# "facet_row": None if row.value == "--" else row.value,
# "facet_col": None if col.value == "--" else col.value,
# "symbol": None if shape.value == "--" else shape.value,
}

#fig_func = plot_types[mark.value]
fig = px.line(forces, **{k: v for k, v in kwargs.items() if v is not None})
fig.update_layout(height=600)

mo.hstack([
mo.vstack([mo.md("### Encodings"),x, y, row, col,mo.md("### Encodings"),color],align="end"),
mo.ui.plotly(fig)
])
return


if __name__ == "__main__":
app.run()
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ parameter_sweep = [
"pydantic>=2.0.0,<3",
"defusedxml>=0.7.1,<0.8",
]
dashboard = [
"pydantic>=2.0.0,<3",
"marimo",
]
lint = ["ruff"]
typing = [
"mypy>=1,<2",
Expand All @@ -65,6 +69,7 @@ docs = [
]
dev = [
{include-group = "parameter_sweep"},
{include-group = "dashboard"},
{include-group = "lint"},
{include-group = "typing"},
{include-group = "test"},
Expand Down
Loading