Skip to content

Commit

Permalink
Update after review
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnMarieW committed Dec 15, 2024
1 parent 7e1ff1c commit 4a091d2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 44 deletions.
2 changes: 1 addition & 1 deletion vizro-core/examples/dev/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ def multiple_cards(data_frame: pd.DataFrame, n_rows: Optional[int] = 1) -> html.
if __name__ == "__main__":
app = Vizro().build(dashboard)

banner = 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",
Expand Down
1 change: 1 addition & 0 deletions vizro-core/src/vizro/_vizro.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from vizro.managers import data_manager, model_manager
from vizro.models import Dashboard, Filter

# this can be removed when Dash uses React 18 as a default (likely V3.0 https://github.com/plotly/dash/pull/3093)
dash._dash_renderer._set_react_version("18.2.0")

logger = logging.getLogger(__name__)
Expand Down
17 changes: 1 addition & 16 deletions vizro-core/src/vizro/models/_components/form/date_picker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Literal, Optional, Union

import dash_mantine_components as dmc
from dash import ClientsideFunction, Input, Output, State, clientside_callback, dcc, html
from dash import Input, Output, State, dcc, html

try:
from pydantic.v1 import Field, PrivateAttr, validator
Expand Down Expand Up @@ -58,20 +58,6 @@ def build(self):
init_value = self.value or ([self.min, self.max] if self.range else self.min) # type: ignore[list-item]
date_range_picker_kwargs = {"allowSingleDateInRange": True} if self.range else {}

output = [
Output(self.id, "value"),
Output(f"{self.id}_input_store", "data"),
]
inputs = [
Input(self.id, "value"),
State(f"{self.id}_input_store", "data"),
]

clientside_callback(
ClientsideFunction(namespace="date_picker", function_name="update_date_picker_values"),
output=output,
inputs=inputs,
)

date_picker = dmc.DatePickerInput(
id=self.id,
Expand All @@ -89,6 +75,5 @@ def build(self):
children=[
dbc.Label(children=self.title, html_for=self.id) if self.title else None,
date_picker,
dcc.Store(id=f"{self.id}_input_store", storage_type="session", data=init_value),
],
)
27 changes: 0 additions & 27 deletions vizro-core/src/vizro/static/js/models/date_picker.js

This file was deleted.

0 comments on commit 4a091d2

Please sign in to comment.