Skip to content

Commit

Permalink
Trailing commas
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon Shotwell committed Jan 24, 2024
1 parent f783409 commit 6541998
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 38 deletions.
2 changes: 1 addition & 1 deletion shiny/api-examples/input_date/app-express.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
"Date:",
value="2016-02-29",
datesdisabled=["2016-03-01", "2016-03-02"],
),
)
57 changes: 23 additions & 34 deletions shiny/api-examples/input_date_range/app-express.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
from datetime import date

from shiny import App, Inputs, Outputs, Session, ui
from shiny.express import ui

app_ui = ui.page_fluid(
ui.input_date_range(
"daterange1", "Date range:", start="2001-01-01", end="2010-12-31"
),
# Default start and end is the current date in the client's time zone
ui.input_date_range("daterange2", "Date range:"),
# start and end are always specified in yyyy-mm-dd, even if the display
# format is different
ui.input_date_range(
"daterange3",
"Date range:",
start="2001-01-01",
end="2010-12-31",
min="2001-01-01",
max="2012-12-21",
format="mm/dd/yy",
separator=" - ",
),
# Pass in Date objects
ui.input_date_range(
"daterange4", "Date range:", start=date(2001, 1, 1), end=date(2010, 12, 31)
),
# Use different language and different first day of week
ui.input_date_range("daterange5", "Date range:", language="de", weekstart=1),
# Start with decade view instead of default month view
ui.input_date_range("daterange6", "Date range:", startview="decade"),
ui.input_date_range("daterange1", "Date range:", start="2001-01-01", end="2010-12-31")
# Default start and end is the current date in the client's time zone
ui.input_date_range("daterange2", "Date range:")
# start and end are always specified in yyyy-mm-dd, even if the display
# format is different
ui.input_date_range(
"daterange3",
"Date range:",
start="2001-01-01",
end="2010-12-31",
min="2001-01-01",
max="2012-12-21",
format="mm/dd/yy",
separator=" - ",
)


def server(input: Inputs, output: Outputs, session: Session):
pass


app = App(app_ui, server)
# Pass in Date objects
ui.input_date_range(
"daterange4", "Date range:", start=date(2001, 1, 1), end=date(2010, 12, 31)
)
# Use different language and different first day of week
ui.input_date_range("daterange5", "Date range:", language="de", weekstart=1)
# Start with decade view instead of default month view
ui.input_date_range("daterange6", "Date range:", startview="decade")
2 changes: 1 addition & 1 deletion shiny/api-examples/input_slider/app-express.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from shiny.express import input, render, ui

ui.input_slider("obs", "Number of bins:", min=10, max=100, value=30),
ui.input_slider("obs", "Number of bins:", min=10, max=100, value=30)


@render.plot
Expand Down
2 changes: 1 addition & 1 deletion shiny/api-examples/input_switch/app-express.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from shiny.express import input, render, ui

ui.input_switch("somevalue", "Some value", False),
ui.input_switch("somevalue", "Some value", False)


@render.text
Expand Down
2 changes: 1 addition & 1 deletion shiny/api-examples/input_text/app-express.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from shiny.express import input, render, ui

ui.input_text("caption", "Caption:", "Data summary"),
ui.input_text("caption", "Caption:", "Data summary")


@render.code
Expand Down

0 comments on commit 6541998

Please sign in to comment.