-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Translate applications into express syntax where possible - Remove examples which have been superceded by Component galleries --------- Co-authored-by: Garrick Aden-Buie <[email protected]> Co-authored-by: Winston Chang <[email protected]>
- Loading branch information
1 parent
a941a51
commit 91172d6
Showing
24 changed files
with
694 additions
and
1,115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
/venv/ | ||
**/.venv/ | ||
**/.DS_store/ | ||
/node_modules/ | ||
/packages/*.whl | ||
/dist/ | ||
|
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 |
---|---|---|
@@ -1,26 +1,13 @@ | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
from shiny import App, render, ui | ||
from shiny.express import ui, input, render | ||
|
||
app_ui = ui.page_fluid( | ||
ui.layout_sidebar( | ||
ui.panel_sidebar( | ||
ui.input_slider("n", "N", 0, 100, 20), | ||
), | ||
ui.panel_main( | ||
ui.output_plot("histogram"), | ||
), | ||
), | ||
) | ||
with ui.sidebar(): | ||
ui.input_slider("n", "N", 0, 100, 20) | ||
|
||
|
||
def server(input, output, session): | ||
@output | ||
@render.plot(alt="A histogram") | ||
def histogram(): | ||
np.random.seed(19680801) | ||
x = 100 + 15 * np.random.randn(437) | ||
plt.hist(x, input.n(), density=True) | ||
|
||
|
||
app = App(app_ui, server, debug=True) | ||
@render.plot(alt="A histogram") | ||
def histogram(): | ||
np.random.seed(19680801) | ||
x = 100 + 15 * np.random.randn(437) | ||
plt.hist(x, input.n(), density=True) |
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 |
---|---|---|
@@ -1,16 +1,9 @@ | ||
from shiny import App, render, ui | ||
from shiny.express import ui, input, render | ||
|
||
app_ui = ui.page_fluid( | ||
ui.input_slider("n", "N", 0, 100, 20), | ||
ui.output_text_verbatim("txt"), | ||
) | ||
|
||
ui.input_slider("n", "N", 0, 100, 20), | ||
|
||
def server(input, output, session): | ||
@output | ||
@render.text | ||
def txt(): | ||
return f"n*2 is {input.n() * 2}" | ||
|
||
|
||
app = App(app_ui, server) | ||
@render.text | ||
def txt(): | ||
return f"n*2 is {input.n() * 2}" |
Oops, something went wrong.