Comments (4)
1.
A marimo island like the one below, which tries to import a package with micropip that is not locally-installed will pre-render with errors until pyodide gets initialized
I don't think this is an issue by itself, you could do:
# imports
import marimo as mo
import sys
if "pyodide" in sys.modules:
import micropip
await micropip.install('cowsay')
else:
import pip
pip.main(['install', 'cowsay'])
or just return a callout saying that micropip hasn't installed packages yet
But absolutely agree that errors should be rendered more nicely on static export.
Particular to this problem, there might be a way to inject deps prior for pyodide load.
2.
Is slightly inconsisent with the rest of marimo (which does not store outputs, and instead only saves the necessary .py files)
Yeah, I think that's just the nature of the saved state, unfortunately.
I think this could help be mitigated with a feature like: #1306
I like the prerender- maybe removing it could just be optional?
For islands in particular, I think it should be possible to prune all nonreactive/nonreactive-dependent cells, dump the partially computed state to a binary, and then lazy load it over the network.
I haven't done anything with this yet, but just an idea.
3.
There is no indication to the user when pyodide has initialized and is ready to use
I agree! I mentioned this before, but I might have failed to follow up.
Islands also needs the banner for running on file://
, maybe both should have the same design language
from marimo.
@gvarnavi Have you tried out the editable cells yet? I think on my wishlist is a state indicate for stale cells
from marimo.
I don't think this is an issue by itself, you could do:
# imports import marimo as mo import sys if "pyodide" in sys.modules: import micropip await micropip.install('cowsay') else: import pip pip.main(['install', 'cowsay'])
Hmm, not sure about installing packages in the environment during the html stubs generations..
Like I suspect there's a use-case where someone who wants to deploy a marimo island embedding uses the online playground to code their app and then simply has a minimal marimo env locally to convert the downloaded .py file to reactive html (or better yet export from the dropdown menu - when we add that functionality).
or just return a callout saying that micropip hasn't installed packages yet
Yes, I reckon a callout that pyodide hasn't loaded yet and/or an initialization indicator would be my preference.
Particular to this problem, there might be a way to inject deps prior for pyodide load.
+1
I like the prerender- maybe removing it could just be optional?
Yeah, I like it too - but was giving a workshop this morning with marimo islands, and several folks thought it wasn't working on their end simply because it 'looked' functional (and you can in-fact interact w/ UI elements), but the app hadn't loaded yet. I suspect the callout/initialization indicator would fix these concerns.
from marimo.
Just realized all these might be super easy to address with (already existing) css.
Replacing the first <marimo-cell-output>
with something like the following
<marimo-cell-output>
<div class="marimo">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="animate-spin">
<path d="M21 12a9 9 0 1 1-6.219-8.56"></path>
</svg>
<div>Initializing...</div>
</div>
</marimo-cell-output>
will use the animate-spin
class from the imported marimo css file to animate any svg (here the same icon as in marimo.app), while Pyodide initializes. Once it's initialized, the <marimo-cell-output>
tag will get replaced by the appropriate output, displaying the app as intended.
Here's a quick demo, with the cowsay example from above.
I'll make a PR with an option for this in the island generator python code tomorrow.
from marimo.
Related Issues (20)
- ui.table: full-table sorting HOT 4
- Admonition casing is o
- Download as button is not responsive
- Include html headings in `View outline` HOT 1
- Notebooks with large dataframes hang when opening HOT 1
- Output goes stale in run and edit mode (app view mode) HOT 1
- Pre-load assets causing error when trying to deploy to Domino Data Labs HOT 8
- Opening "Home" in directory of only markdown notebooks is not navigable. External directory in general not navigable. HOT 4
- marimo altair_chart not displaying log scaled altair chart correctly HOT 2
- Code coverage timings bottlenecked by endpoint testing HOT 4
- Plots return 404 when using --base-url option in docker container HOT 1
- DataFrameLike False Positive When __getattr__ Presents HOT 1
- ui.dataframe with Ibis support HOT 1
- marimo edit stops working when left open for multiple days (fd limit too low) HOT 1
- Multiple cells actions HOT 3
- Publish VSCode extension to Open VSX HOT 5
- h4 - h6 missing from TOC panel HOT 2
- Better tracebacks when running as a script
- WebSocketDisconnect (kernel not found) when using marimo edit HOT 3
- marimo.app_meta.theme HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marimo.