mckinsey / vizro

Vizro is a toolkit for creating modular data visualization applications.
https://vizro.readthedocs.io/en/stable/
Apache License 2.0
2.49k stars 112 forks source link

[QA] Add unit tests and docs for `DatePicker` #319

Closed nadijagraca closed 4 months ago

nadijagraca commented 5 months ago

Description

Here are the latest changes to the core code and tests that should allow DatePicker to run smoothly. NB: Filter interaction where the source is data in the datetime format will be implemented separately.

Relevant description

Added temporal selector DatePicker for Filter and Parameter.

DatePicker is a single model, but based on value of argument range will either return dmc.DatePicker or dmc.DateRangePicker. Default value of range is True and the model will return dmc.DateRangePicker if range is not provided, or if the selector is not defined.

Options where DateRangePicker is returned:

  1. User does not define the Filter.selector but filter column is datetime dtype.
  2. User defines vm.DatePicker as Filter.selector without specifying range argument or by setting range=True

Option where DatePicker is returned:

  1. User defines vm.DatePicker as Filter.selector and sets vm.DatePicker range argument as False.

vm.DatePicker.value supported format are all inputs that could be translated to datetime.date. See more here

Screenshot

image
image

Notice