Skip to content

Commit 3e587ab

Browse files
authored
Add rsconnect json files(shinyapps.io tests) and folium tests (#928)
1 parent f926cc3 commit 3e587ab

File tree

37 files changed

+341
-24
lines changed

37 files changed

+341
-24
lines changed

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ test =
8383
missingno
8484
rsconnect-python
8585
scikit-learn
86+
folium
8687

8788
dev =
8889
black>=23.1.0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import datetime
2+
3+
from shiny import render, ui
4+
from shiny.express import input, layout
5+
6+
with layout.card(id="card"):
7+
ui.input_slider("val", "slider", 0, 100, 50)
8+
"Text outside of render display call"
9+
ui.tags.br()
10+
f"Rendered time: {str(datetime.datetime.now())}"
11+
12+
@render.display
13+
def render_display():
14+
"Text inside of render display call"
15+
ui.tags.br()
16+
"Dynamic slider value: "
17+
input.val()
18+
ui.tags.br()
19+
f"Display's rendered time: {str(datetime.datetime.now())}"
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
2-
"https://rsc.radixu.com/": {
3-
"server_url": "https://rsc.radixu.com/",
4-
"filename": "/Users/karangathani/Documents/GitHub/py-shiny/tests/playwright/deploys/apps/plotly_app",
5-
"app_url": "https://rsc.radixu.com/content/fc82dde5-c4ba-4748-971b-aacc09613faa/",
6-
"app_id": "fc82dde5-c4ba-4748-971b-aacc09613faa",
7-
"app_guid": "fc82dde5-c4ba-4748-971b-aacc09613faa",
2+
"https://api.shinyapps.io": {
3+
"server_url": "https://api.shinyapps.io",
4+
"app_url": "https://testing-apps.shinyapps.io/example_deploy_app_a1/",
5+
"app_id": 10800241,
6+
"app_guid": null,
87
"title": "example_deploy_app_A",
98
"app_mode": "python-shiny",
109
"app_store_version": 1
1110
}
12-
}
11+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
git+https://github.com/posit-dev/py-shiny.git#egg=shiny
1+
git+https://github.com/posit-dev/py-shiny
22
git+https://github.com/posit-dev/py-htmltools.git#egg=htmltools
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"https://api.shinyapps.io": {
3+
"server_url": "https://api.shinyapps.io",
4+
"app_url": "https://testing-apps.shinyapps.io/shiny_express_accordion/",
5+
"app_id": 10800240,
6+
"app_guid": null,
7+
"title": "shiny_express_accordion",
8+
"app_mode": "python-shiny",
9+
"app_store_version": 1
10+
}
11+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import pandas as pd
2+
3+
from shiny import render
4+
from shiny.express import ui
5+
6+
data = {
7+
"A": [1, 2, 3, 4, 5, 6],
8+
"B": ["a", "b", "c", "d", "e", "f"],
9+
"C": [10.1, 20.2, 30.3, 40.4, 50.5, 60.6],
10+
"D": ["apple", "banana", "cherry", "date", "elderberry", "fig"],
11+
"E": [True, False, True, False, True, False],
12+
"F": ["John", "Jane", "Jim", "Jessie", "Jack", "Jill"],
13+
}
14+
15+
df = pd.DataFrame(data)
16+
17+
ui.page_opts(fillable=True)
18+
19+
with ui.card(id="card"):
20+
ui.h2("Below is a sample dataframe")
21+
22+
@render.data_frame
23+
def sample_data_frame(id: str = "dataframe"):
24+
return df
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
git+https://github.com/posit-dev/py-shiny
2+
git+https://github.com/posit-dev/py-htmltools.git#egg=htmltools
3+
pandas
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"https://api.shinyapps.io": {
3+
"server_url": "https://api.shinyapps.io",
4+
"app_url": "https://testing-apps.shinyapps.io/shiny-express-dataframe/",
5+
"app_id": 10800260,
6+
"app_guid": null,
7+
"title": "shiny-express-dataframe",
8+
"app_mode": "python-shiny",
9+
"app_store_version": 1
10+
}
11+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import folium # pyright: ignore[reportMissingTypeStubs]
2+
3+
from shiny import render
4+
from shiny.express import input, ui
5+
6+
locations_coords = {
7+
"San Francisco": (37.79554, -122.39348),
8+
"Los Angeles": (34.05026, -118.25768),
9+
"New York": (40.71222, -74.00490),
10+
}
11+
ui.page_opts(full_width=False)
12+
13+
with ui.card(id="card"):
14+
"Static Map"
15+
folium.Map(
16+
location=locations_coords["San Francisco"], tiles="USGS.USTopo", zoom_start=12
17+
)
18+
ui.input_radio_buttons(
19+
"location", "Location", ["San Francisco", "New York", "Los Angeles"]
20+
)
21+
22+
@render.display
23+
def folium_map():
24+
"Map inside of render display call"
25+
folium.Map(
26+
location=locations_coords[input.location()],
27+
tiles="cartodb positron",
28+
zoom_start=12,
29+
)
30+
input.location()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
git+https://github.com/posit-dev/py-shiny
2+
git+https://github.com/posit-dev/py-htmltools.git#egg=htmltools
3+
folium

0 commit comments

Comments
 (0)