Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Li Nguyen <[email protected]>
  • Loading branch information
AnnMarieW and huong-li-nguyen authored Dec 12, 2024
1 parent 7ff1b73 commit efbd801
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions vizro-core/examples/dev/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,12 +821,12 @@ def multiple_cards(data_frame: pd.DataFrame, n_rows: Optional[int] = 1) -> html.
if __name__ == "__main__":
app = Vizro().build(dashboard)

new_link = dbc.NavLink(
banner = dbc.NavLink(
["Made with ", html.Img(src=get_asset_url("logo.svg"), id="banner", alt="Vizro logo"), "vizro"],
href="https://github.com/mckinsey/vizro",
target="_blank",
className="anchor-container",
)
app.dash.layout.children = [app.dash.layout.children, new_link]
app.dash.layout.children = [app.dash.layout.children, banner]
server = app.dash.server
app.run()
9 changes: 6 additions & 3 deletions vizro-core/src/vizro/_vizro.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ def __init__(self, **kwargs):
suppress_callback_exceptions=True,
title="Vizro",
use_pages=True,
# This is added here temporarily for testing. These stylesheets are required for certain dmc components.
# It may be better to include these stylesheets in the css folder.
external_stylesheets=dmc.styles.ALL,
)

# Ensure external_stylesheets is a list and append the additional stylesheet
external_stylesheets = self.dash.config.external_stylesheets
self.dash.config.external_stylesheets = external_stylesheets if isinstance(external_stylesheets, list) else [
external_stylesheets]
self.dash.config.external_stylesheets.append(dmc.styles.DATES)

# When Vizro is used as a framework, we want to include the library and framework resources.
# Dash serves resources in the order 1. external_stylesheets/scripts; 2. library resources from the
Expand Down
4 changes: 2 additions & 2 deletions vizro-core/src/vizro/models/_components/form/date_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DatePicker(VizroBaseModel):
[`dmc.DateRangePicker`](https://www.dash-mantine-components.com/components/datepicker#daterangepicker).
Args:
type (Literal["default", "range", "multiple"]): Defaults to A single date picker allowing the selection of one date.
type (Literal["date_picker"]): Defaults to `"date_picker"`.
min (Optional[date]): Start date for date picker. Defaults to `None`.
max (Optional[date]): End date for date picker. Defaults to `None`.
value (Union[list[date], date]): Default date/dates for date picker. Defaults to `None`.
Expand All @@ -36,7 +36,7 @@ class DatePicker(VizroBaseModel):
"""

type: Literal["default", "range", "multiple"] = "default"
type: Literal["date_picker"] = "date_picker"
min: Optional[date] = Field(None, description="Start date for date picker.")
max: Optional[date] = Field(None, description="End date for date picker.")
value: Optional[Union[list[date], date]] = Field(None, description="Default date for date picker")
Expand Down

0 comments on commit efbd801

Please sign in to comment.