Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove apps #96

Merged
merged 3 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/venv/
**/.venv/
**/.DS_Store
/node_modules/
/packages/*.whl
/dist/
Expand Down
50 changes: 12 additions & 38 deletions examples/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
"category": "Featured",
"apps": [
"cpuinfo",
"orbit",
"regularization",
"wordle",
"plotly",
"ipyleaflet",
"camera"
"ipyleaflet"
]
},
{
Expand All @@ -27,45 +24,11 @@
"file_download",
"insert_ui",
"input_update",
"modules",
"extra_packages",
"static_content",
"fetch",
"ipywidgets"
]
},
{
"category": "Inputs",
"apps": [
"input_text",
"input_numeric",
"input_slider",
"input_checkbox",
"input_switch",
"input_checkbox_group",
"input_select",
"input_radio",
"input_text_area",
"input_date",
"input_date_range",
"input_password"
]
},
{
"category": "Outputs",
"apps": [
"output_text",
"output_text_verbatim",
"output_ui",
"output_plot",
"output_table",
"output_data_frame_grid"
]
},
{
"category": "Layout",
"apps": ["shinyswatch", "layout_sidebar", "layout_two_column"]
},
{
"category": "Reactivity",
"apps": [
Expand All @@ -75,6 +38,17 @@
"reactive_value"
]
},
{
"category": "Shiny Core",
"apps": [
"modules",
"plot_interact_basic",
"plot_interact_exclude",
"orbit",
"wordle",
"static_content"
]
},
{
"category": "Interactive plots",
"apps": [
Expand Down
30 changes: 9 additions & 21 deletions examples/python/app_with_plot/app.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
import matplotlib.pyplot as plt
import numpy as np
from shiny import App, render, ui
from shiny import render
from shiny.express import ui, input

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)
18 changes: 6 additions & 12 deletions examples/python/basic_app/app.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
from shiny import App, render, ui
from shiny import render
from shiny.express import ui, input

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}"
Loading