Skip to content

Commit

Permalink
after secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
denisecase committed May 30, 2023
1 parent 2e04ba5 commit 7744897
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
9 changes: 9 additions & 0 deletions SHINY.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ If it won't stop, close the terminal window.
Reopen the terminal window and be sure the virtual environment is activated
before running the app again.

## Deploy the App

Verify repository name in .github/workflows/deploy.yml.
Login to [shinyapps.io](https://www.shinyapps.io/) then Account / Tokens to find values for 3 repo secrets.
See the earlier [SHINYAPPS.md](https://github.com/denisecase/cintel-02-app/blob/main/SHINYAPPS.md) for details.

- Name: SHINYAPPS_ACCOUNT, Secret: Paste shinyapps.io account name
- Name: SHINYAPPS_TOKEN, Secret: (paste token )
- Name: SHINYAPPS_SECRET, Secret: (paste secret)

-----

Expand Down
8 changes: 4 additions & 4 deletions flights_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_flights_server_functions(input, output, session):
"""Define functions to create UI outputs."""

p = pathlib.Path(__file__).parent.joinpath("data").joinpath("flights.xlsx")
#logger.info(f"Reading data from {p}")
# logger.info(f"Reading data from {p}")
original_df = pd.read_excel(p)

# create new field with year as a string and month together
Expand All @@ -45,7 +45,7 @@ def _():
"""Reactive effect to update the filtered dataframe when inputs change.
It doesn't need a name, because no one calls it directly."""

#logger.info("UI inputs changed. Updating flights reactive df")
# logger.info("UI inputs changed. Updating flights reactive df")

df = original_df.copy()

Expand All @@ -72,10 +72,10 @@ def _():
@output
@render.text
def flights_record_count_string():
#logger.debug("Triggered: flights_filter_record_count_string")
# logger.debug("Triggered: flights_filter_record_count_string")
filtered_count = len(reactive_df.get())
message = f"Showing {filtered_count} of {total_count} records"
#logger.debug(f"filter message: {message}")
# logger.debug(f"filter message: {message}")
return message

@output
Expand Down
4 changes: 2 additions & 2 deletions mtcars_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_mtcars_server_functions(input, output, session):
"""Define functions to create UI outputs."""

p = pathlib.Path(__file__).parent.joinpath("data").joinpath("mtcars.csv")
#logger.info(f"Reading data from {p}")
# logger.info(f"Reading data from {p}")
original_df = pd.read_csv(p)
total_count = len(original_df)

Expand Down Expand Up @@ -59,7 +59,7 @@ def mtcars_record_count_string():
filtered_df = reactive_df.get()
filtered_count = len(filtered_df)
message = f"Showing {filtered_count} of {total_count} records"
#logger.debug(f"filter message: {message}")
# logger.debug(f"filter message: {message}")
return message

@output
Expand Down
10 changes: 5 additions & 5 deletions penguins_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
def get_penguins_server_functions(input, output, session):
"""Define functions to create UI outputs."""

p = (pathlib.Path(__file__).parent.joinpath("data").joinpath("penguins.xlsx"))
#logger.info(f"Reading data from {p}")
p = pathlib.Path(__file__).parent.joinpath("data").joinpath("penguins.xlsx")
# logger.info(f"Reading data from {p}")
original_df = pd.read_excel(p)
total_count = len(original_df)

Expand All @@ -48,7 +48,7 @@ def _():
This is the only way to set a reactive value (after initialization).
It doesn't need a name, because no one calls it directly."""

#logger.info("UI inputs changed. Updating penguins reactive df")
# logger.info("UI inputs changed. Updating penguins reactive df")

df = original_df.copy()

Expand Down Expand Up @@ -90,10 +90,10 @@ def _():
@output
@render.text
def penguins_record_count_string():
#logger.debug("Triggered: penguins_filter_record_count_string")
# logger.debug("Triggered: penguins_filter_record_count_string")
filtered_count = len(reactive_df.get())
message = f"Showing {filtered_count} of {total_count} records"
#logger.debug(f"filter message: {message}")
# logger.debug(f"filter message: {message}")
return message

@output
Expand Down
2 changes: 1 addition & 1 deletion relationships_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_relationships_server_functions(input, output, session):
@render_widget
def relationships_output_widget1():
if input.RELATIONSHIPS_SHOW_TOGGLE():
#logger.info("UI inputs changed. Updating relationships output widget2")
# logger.info("UI inputs changed. Updating relationships output widget2")

# create a chord diagram from the links and the nodes
# value = (5, None) only links with a value 5+ will be shown
Expand Down

0 comments on commit 7744897

Please sign in to comment.