-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 1ba1dc9.
- Loading branch information
Showing
11 changed files
with
619 additions
and
422 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,6 +1,4 @@ | ||
/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,14 +1,26 @@ | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
from shiny import render | ||
from shiny.express import ui, input | ||
from shiny import App, render, ui | ||
|
||
with ui.sidebar(): | ||
ui.input_slider("n", "N", 0, 100, 20) | ||
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"), | ||
), | ||
), | ||
) | ||
|
||
|
||
@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) | ||
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) |
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,10 +1,16 @@ | ||
from shiny import render | ||
from shiny.express import ui, input | ||
from shiny import App, render, ui | ||
|
||
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}" | ||
|
||
@render.text | ||
def txt(): | ||
return f"n*2 is {input.n() * 2}" | ||
|
||
app = App(app_ui, server) |
Oops, something went wrong.