A community member is investigating integrating Marimo, a Python-based data analysis tool, into a web app. They want to embed Marimo as a pane and allow users to run Python code that interacts with the app's data and functionality. The community member has tried using Marimo's Islands feature but is unable to dynamically add/remove cells. They are looking for a way to define functions or objects in the Python scope that can call into JavaScript code to power the app. The community member has explored Marimo's documentation and source code but has not found a solution.
In the comments, another community member responds that this use case is somewhat out of scope for Marimo currently, but suggests exploring Marimo Blocks, a related project that may provide more control and customization options. The community member notes that Blocks is still fairly undeveloped, but encourages the original poster to file issues on the Blocks repository for specific feature requests, which they can then look into supporting.
<answer>yea this is somewhat out of scope / not possible today. you may want to explore: https://github.com/marimo-team/marimo-blocksthis if fairly undevloped, but if you file issues on this repo for particular feature requests. we can look into support it</answer>
Hello! I'm currently investigating Marimo for integration in a data analysis web app. Think something like a specialized Looker or Tableau. The goal is to embed Marimo in the app as a pane, allowing users to run Python and interact with the analytics app's data and functionality via Python. I've been trying out the Islands feature to set up this integration and have it minimally working (albeit without the ability to add/remove cells dynamically).
However, in order to make this happen, there needs to be a way to define functions or objects in the Python scope that can call into JS code to power the app. I imagine something like adding a global AppClient 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.
I've been digging through the docs and source code, but I've been unable to find a way to support something like this. I know that the the Pyodide instance is running on a worker thread and I can access the worker's scope from the Python side via import js, but there's not much of a way to access the main thread and hook functions there.
I found the 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.
Do you have any suggestions of how I might be able to achieve this kind of thing? I feel like this might be something that's out of scope of Marimo/islands goals, but I'm happy enough to write code, deal with internals, or even fork/contribute to Marimo if needed.
yea this is somewhat out of scope / not possible today.
you may want to explore: https://github.com/marimo-team/marimo-blocks this if fairly undevloped, but if you file issues on this repo for particular feature requests. we can look into support it
yea this is somewhat out of scope / not possible today.
you may want to explore: https://github.com/marimo-team/marimo-blocks this if fairly undevloped, but if you file issues on this repo for particular feature requests. we can look into support it
Tyvm for the response! That's fair - I figured that was the case.
Blocks looks very cool, I'll certainly check that out. At first glance it looks like there's a lot more control over the setup and possibility to interact with the setup and internals, that's great.
Ty again for the response and props for the really cool tools you're building