-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: sort routes in create_asgi_app (#1067)
* fix: sort routes in create_asgi_app * Update marimo/_server/asgi.py Co-authored-by: Akshay Agrawal <[email protected]> --------- Co-authored-by: Akshay Agrawal <[email protected]>
- Loading branch information
Showing
3 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import marimo | ||
|
||
__generated_with = "0.3.8" | ||
app = marimo.App(width="full") | ||
|
||
|
||
@app.cell | ||
def __(): | ||
import marimo as mo | ||
import plotly.express as px | ||
return mo, px | ||
|
||
|
||
@app.cell | ||
def __(mo): | ||
mo.md("# Issue 1064") | ||
return | ||
|
||
|
||
@app.cell | ||
def __(px): | ||
plot1 = px.scatter(x=[0, 1, 4, 9, 16], y=[0, 1, 2, 3, 4]) | ||
plot2 = px.scatter(x=[2, 3, 6, 11, 18], y=[2, 3, 4, 5, 6]) | ||
return plot1, plot2 | ||
|
||
|
||
@app.cell | ||
def __(mo): | ||
tabs = mo.ui.tabs( | ||
{ | ||
"💾 Tab 1": "", | ||
"💾 Tab 2": "", | ||
} | ||
) | ||
return tabs, | ||
|
||
|
||
@app.cell | ||
def __(mo, plot1, plot2, tabs): | ||
def render_tab_content(): | ||
if tabs.value == "💾 Tab 1": | ||
return plot1 | ||
elif tabs.value == "💾 Tab 2": | ||
return plot2 | ||
else: | ||
return "" | ||
|
||
|
||
mo.vstack([tabs.center(), render_tab_content()]) | ||
return render_tab_content, | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters