Skip to content

Commit

Permalink
Remove trailing commas
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordon Shotwell committed Jan 24, 2024
1 parent 915a425 commit f783409
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 44 deletions.
4 changes: 2 additions & 2 deletions shiny/api-examples/input_action_link/app-express.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from shiny import reactive
from shiny.express import input, render, ui

ui.input_slider("n", "Number of observations", min=0, max=1000, value=500),
ui.input_action_link("go", "Go!"),
ui.input_slider("n", "Number of observations", min=0, max=1000, value=500)
ui.input_action_link("go", "Go!")


@render.plot(alt="A histogram")
Expand Down
2 changes: 1 addition & 1 deletion shiny/api-examples/input_checkbox/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_checkbox("somevalue", "Some value", False),
ui.input_checkbox("somevalue", "Some value", False)


@render.ui
Expand Down
14 changes: 7 additions & 7 deletions shiny/api-examples/input_date/app-express.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

from shiny.express import ui

ui.input_date("date1", "Date:", value="2016-02-29"),
ui.input_date("date1", "Date:", value="2016-02-29")
# Default value is the date in client's time zone
ui.input_date("date2", "Date:"),
ui.input_date("date2", "Date:")
# value is always yyyy-mm-dd, even if the display format is different
ui.input_date("date3", "Date:", value="2016-02-29", format="mm/dd/yy"),
ui.input_date("date3", "Date:", value="2016-02-29", format="mm/dd/yy")
# Pass in a Date object
ui.input_date("date4", "Date:", value=date(2016, 2, 29)),
ui.input_date("date4", "Date:", value=date(2016, 2, 29))
# Use different language and different first day of week
ui.input_date("date5", "Date:", language="ru", weekstart=1),
ui.input_date("date5", "Date:", language="ru", weekstart=1)
# Start with decade view instead of default month view
ui.input_date("date6", "Date:", startview="decade"),
ui.input_date("date6", "Date:", startview="decade")
# Disable Mondays and Tuesdays.
ui.input_date("date7", "Date:", daysofweekdisabled=[1, 2]),
ui.input_date("date7", "Date:", daysofweekdisabled=[1, 2])
# Disable specific dates.
ui.input_date(
"date8",
Expand Down
38 changes: 38 additions & 0 deletions shiny/api-examples/input_date_range/app-express.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from datetime import date

from shiny import App, Inputs, Outputs, Session, 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"),
)


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


app = App(app_ui, server)
57 changes: 23 additions & 34 deletions shiny/api-examples/input_date_range/app.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 input, 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")

0 comments on commit f783409

Please sign in to comment.