@app.cell def input_cell(mo): my_input = mo.ui.text() my_input return (my_input,) @app.cell def result_cell(my_input): my_input.value return
mo.ui.radio
for filtering a dataset as part of a larger ML model evaluation UI. I find that when I have a lot options using the inline option just makes a really wide element for the radio component. ncols
, nrows
or columns
for the UI element to define a little radio grid or similar argumentsuv
. If i were to install packages directly from the terminal using uv they would be added to pyproject.toml, it would be great to have packages added to the dependencies in pyproject toml when such file is available and if not running in a sandboxAppClient
or similar that can be used to pull data, display output through the app's existing visualization tools, etc. Because of this, embedding the full Marimo app via an iframe doesn't seem like an option.import js
, but there's not much of a way to access the main thread and hook functions there.window._marimo_private_IslandsPyodideBridge
which I can access from the main thread, but after looking through the various properties it exposes I don't see any option to achieve what I'm looking for. I feel like I might be missing something there though.from foo_notebook import basic_defs _, defs = basic_defs.run() # basic_defs is a mo.Cell count_mins = defs['count_mins'] #etc...
marimo-agents
to be able to collect information about all the cells + cell outputs above itunique: {unique_count}
brushable_widget
python package (available at pypi) so that I can draw an SVG with circles, brush those circles, and get the selected IDs back into marimo (python).circles1
and circles2
are arrays of circles based on the same datapoints but different axes.svg1 = SVG(width=200, height=200, elements=circles1) svg2 = SVG(width=200, height=200, elements=circles2)
plot1 = mo.ui.anywidget(BrushableWidget(svg=svg1.as_str(), selected_ids = [])) plot2 = mo.ui.anywidget(BrushableWidget(svg=svg2.as_str(), selected_ids = [])) mo.hstack([plot1, plot2])
selected_ids
trait of that widget is updated. And here's the thing: it should be propagated to the other widget.traitlets.link((plot1, "selected_ids"),(plot2, "selected_ids"))
plot1.selected_ids
is not updated in other marimo cells.get_selected, set_selected = mo.state([])
set_selected(plot1.selected_ids)
, plot1.selected_ids = get_selected()
, set_selected(plot2.selected_ids)
and plot2.selected_ids = get_selected()
will keep triggering each other.import marimo as mo import os ENV_ID = os.getenv(“ENV_ID”) app = marimo.App(html_head_file=f"head_{ENV_ID}.html")
.marimo.toml
.from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all"
df1=pd.DataFrame([[1,2],[3,4]],columns=['col1','col2']) df2=pd.DataFrame([[5,6],[7,8]],columns=['col3','col4']) df1.sample(2) df2.sample(2)
output
api. mo.output.append(df1.sample(2)) mo.output.append(df2.sample(2))
def run_agent(input): for event in agent.run(input): # if is tabular df = pd.DataFrame(event.content) **mo.state.register_datasource(df, event.name + event.tool_args + "_df") # <------ saves df to var "nearest_gene_tool_chr15_88569444_df"** mo.output.append(df) ... ...