Get help from the marimo community

To write maths and science more easily, I use some common latex packages, like amsmath, mhchem, siunitx...

These packages have a mathjax version or equivalent.
In jupyter I can require those in mardown cells or use a custom.js.

I must be blind but I couldn't find docs on how to do that with marimo.
6 comments
M
L
I often get asked if Marimo can do a wizard style UI to guide the user through the workflow. I'm thinking the closest it can do is https://docs.marimo.io/api/layouts/carousel.html. But in order to be a true wizard, I would like to prevent the user from moving on until a certain task has been completed (fill in form, press button etc.). Could you add this type of logic to the component?
1 comment
M
I want to give a hint to the user, that they need to press a submit button, if they have made changes to some parts of the inputs. To do this, I want to nudge them by changing the color of the button to red. I tried with callout, but it seems a bit excessive as it just places a large box around my element. Instead I want to make it more subtle, but still visibly different from the standard button color
1 comment
M
Likely Issue
Can't get marimo to display multiple dataframes in a single cell by default.

Context:
  • By default, jupyter prints only the output of the last evaluated expression in a single cell. Working with multiple data frames, its tiresome to only look at a single frame in one cell.
  • Known work around for jupyter: if you run the following script in cell, it starts displaying output of all the expressions.
Plain Text
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"


Details
For the following sample code:
Plain Text
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)

My expectation is that marimo renders 2 frames, one below another if I execute the same property update..

alternatively, I can achieve the same(render 2 dataframe in same cell) by using the output api.
Plain Text
mo.output.append(df1.sample(2))
mo.output.append(df2.sample(2))

I was wondering if there is a simpler way to do this for all expressions in a cell.

Apologies if I am missing something obvious.
2 comments
M
u
Say I have a python call that returns a dataframe. without assigning it to a variable within the notebook itself, is there a way I can register it as a data source? like from a module i'm importing?

Example:
Plain Text
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)
      ...
    ...
9 comments
M
s
A
Would be useful if time range is provided as part of datetime column filter
3 comments
M
l
I'm really enjoying working with marimo, but I've been finding it tricky to conveniently share results with different audiences via html (some like to see the code, some are terrified of it and just want a clean looking report).

When using 'Download as HTML' or the super-convenient 'Auto-download HTML' from marimo edit, it would be good to be able to specify the following options:
  1. Code cells collapsed by default.
  2. All code hidden (basically app view).
  3. Remove the "This is a static Python notebook built using marimo..." header.
I'm aware of the 'marimo export' command with the --no-include-code option, but this requires re-running the notebook from scratch (some of my notebooks take a long time to execute), and I feel it would be much more convenient to have these options accessible directly in the editor UI

Thanks for reading my suggestion & congratulations to Akshay & Myles and the rest of the development team on building such an impressive tool!
4 comments
A
M
r
H
The inline matplotlib plots are shown as png and look blurry on my 4k monitor. Increasing the plots dpi only scales it up. Is it possible to display them as a svg instead?

I already tried locally changing:
marimo/_output/mpl.py
Plain Text
def _internal_show(canvas: FigureCanvasBase) -> None:
    buf = io.BytesIO()
    buf.seek(0)
    canvas.figure.savefig(buf, format="png", bbox_inches="tight")
    plt.close(canvas.figure)
    mimetype: KnownMimeType = "image/png"
    plot_bytes = base64.b64encode(buf.getvalue())
    CellOp.broadcast_console_output(
        channel=CellChannel.MEDIA,
        mimetype=mimetype,
        data=build_data_url(mimetype=mimetype, data=plot_bytes),
        cell_id=None,
        status=None,
    )

to
Plain Text
def _internal_show(canvas: FigureCanvasBase) -> None:
    buf = io.BytesIO()
    buf.seek(0)
    canvas.figure.savefig(buf, format="svg", bbox_inches="tight")
    plt.close(canvas.figure)
    mimetype: KnownMimeType = "image/svg+xml"
    plot_bytes = base64.b64encode(buf.getvalue())
    CellOp.broadcast_console_output(
        channel=CellChannel.MEDIA,
        mimetype=mimetype,
        data=build_data_url(mimetype=mimetype, data=plot_bytes),
        cell_id=None,
        status=None,
    )

but it still shows up as a png.
2 comments
M
H
I would like the user to be able to see a Table input object, but also to be able to change some of its value (like an Excel Sheet) with the requirements that some cells of the sheet should be locked.
My understanding is that we can't do it with the table UI element (there is a onchange method but I am not sure if it is for this purpose?), I found ipyaggrid, itables, and maybe there are some polars widget to do it. Before investigating further, I was wondering if anything was tried and what would be the best practice from a marimo perspective? Thanks
2 comments
M
l
I would like to have a second slider point so that I can define a range based on a stop and start slider.

Currently the default min range seems like it can only be set at the start slider.
12 comments
M
0
A
first, thanks for creating marimo, i'm having fun developing with it. however, i can't seem to get my ruff pyproject.toml config to work.

might be something with my setup defaulting to black? i can't easily remove black since i installed marimo with conda (through pixi) and black is set as a required dependency.

would be useful to be able to manually select between the two.
14 comments
M
l
R
I want to create a batch element, where a drop-down lets the user configure the content of the batch elements, such as having additional features revealed if choosing to do so by the user. For that to work, I need to re-run the cell that generates the batch element. Is there a method to re-run the same cell? I was thinking I could use states to trigger this, but if states are set from the same cell, they dont trigger an update. I couldn't find any documentation about this type of reactivity, as it seems cells can only trigger other cells and not themselves.
2 comments
A
@penj , continuing the conversation

We have some utilities to make multi-page notebooks/apps.

1 comment
p