From bbb17acf1abdc0f7917d107dd63e62124cd1c43f Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Tue, 28 Nov 2023 09:58:56 -0800 Subject: [PATCH 01/29] meta tags example --- vizro-core/examples/assets/logo.png | Bin 0 -> 16384 bytes vizro-core/examples/default/app.py | 5 +++++ vizro-core/src/vizro/models/_dashboard.py | 7 ++++++- vizro-core/src/vizro/models/_page.py | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 vizro-core/examples/assets/logo.png diff --git a/vizro-core/examples/assets/logo.png b/vizro-core/examples/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e871127854bdafcc9edd6b32b2b925eacbee3e11 GIT binary patch literal 16384 zcmdUWhdY-2AGU}h>#-`NC9`BFS)nB>BqZ4hA!LPYQK+Pnl_bd~A)Am*c1Q@x$|mbQ zujlz4$NMk5@9($|KRxdIy1&==`x)owJkKjgUG*Fd6)P192?@=G^NJcIB&6c_y=5l_ zelm&j`{Mt$JIG(q+KK+%-+q(_{n)qT6q%EmG@_ay)OUm3{Ro`jn++&}U{MvO71VT$`fL~?TcFgNaO2i9JD z;SlADukw5`UAoYfPvc9BSb%%Hp~BM9J?7@J{W06CV}%-*hl2jMw1>Fc+}%6$LZ!(9 zxV@_Gygj%d-||F_$@)ur6+^>pTmJ>FcAb4pme?953Mz5ankT#mmMY}xvu+Gbx4+T& zZ%h4fm3T+i`&Ff~El->*zu3HKyZJ_g_l-vK_8KR;Pu<+i}e)4IC4OS=#HO(KG` z56AD!G~Qt&?c)0C$ic#Y9#s9XFUTw?pv>!~iE9o#?>9d5PK)o7t}bP+9!-Q2d4awv z(jeOk>k6x*{vdkQJFxlYt0O(datFMorfykVTbJ47ncTWXLmPOQ&HD8v^Io-Nt=F$# zld^_TNXF2HgoLzM=C)Xf(o^~Wu#<4zjG>ng-bT(gmoP+$5So@Imno%7EwoT3?b-Ld z-ak2+x39#5ZFqRNyRT1Cg8l5F$6q)uY$L&Kgw>FR)hJxMwvU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n+ChSSh(|z8(Qy?$vmJgE} z+Boq>C`F%groFf9d@nFIHddjxjqi9l*B)~xOFU5-)>!tD7$d(PgkTLDC<^f6;vMkV zll2o|ML=Q6rF5X&P1RfBF{#A=jH00I^*=dMLIZ%`ssi2zDUN3E>oiw*nEt1^!A`8E zrsh<1G1*|`dr;AKHe0XA_FLJcu_UhqHhITQcehi?>C)a;a*Vz-8s3Kf0!W{e*4xwB z(-Q>UEgp~9{Ag-&mEr*U191lyM%4-fGIRp#f5vP~<=<+jNdI{owECuP98W(vNsC~? z)R^<_3!)=JKLE#oJTj%yt}?#uM5zyYDXJ4R? zksI{|NDD$YU>Gn4cwaJ<0pf`veN|cYc?N4du6lgCqbP}rG?15I&w`f8)F(P~o|6=P5)M(h1CQDWH5dC!2=g{J z-#fY}NVj3A&(}{U?gC0V3`vN}YvcofQn082IsqR=+in5Zf;mGYdhWjOMekITXX&Y! zrpeM%c$f~>mC^w^_`bj3{*;3Y Date: Thu, 14 Dec 2023 08:09:56 -0800 Subject: [PATCH 02/29] add infer_image function --- .../examples/assets/{logo.png => images/app.jpeg} | Bin vizro-core/examples/assets/images/logo.svg | 3 +++ vizro-core/src/vizro/models/_dashboard.py | 10 ++++++++++ vizro-core/src/vizro/models/_page.py | 2 ++ 4 files changed, 15 insertions(+) rename vizro-core/examples/assets/{logo.png => images/app.jpeg} (100%) create mode 100644 vizro-core/examples/assets/images/logo.svg diff --git a/vizro-core/examples/assets/logo.png b/vizro-core/examples/assets/images/app.jpeg similarity index 100% rename from vizro-core/examples/assets/logo.png rename to vizro-core/examples/assets/images/app.jpeg diff --git a/vizro-core/examples/assets/images/logo.svg b/vizro-core/examples/assets/images/logo.svg new file mode 100644 index 000000000..0904b87de --- /dev/null +++ b/vizro-core/examples/assets/images/logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/vizro-core/src/vizro/models/_dashboard.py b/vizro-core/src/vizro/models/_dashboard.py index 1d71adf27..fc7777f16 100644 --- a/vizro-core/src/vizro/models/_dashboard.py +++ b/vizro-core/src/vizro/models/_dashboard.py @@ -2,6 +2,7 @@ import logging from functools import partial +from pathlib import Path from typing import TYPE_CHECKING, List, Literal, Optional, cast import dash @@ -69,6 +70,7 @@ def pre_build(self): order=order, layout=partial(self._make_page_layout, page), description=page.description, + image=page.image if page.image else self._infer_image("app") or self._infer_image("logo"), ) dash.register_page(module=MODULE_PAGE_404, layout=self._make_page_404_layout()) @@ -144,3 +146,11 @@ def _make_page_404_layout(): ], className="page_error_container", ) + + def _infer_image(self, basename: str): + valid_extensions = [".apng", ".avif", ".gif", ".jpeg", ".jpg", ".png", ".svg", ".webp"] + assets_folder = Path(dash.get_app().config.assets_folder) + if assets_folder.is_dir(): + for path in Path(assets_folder).rglob(f"{basename}.*"): + if path.suffix in valid_extensions: + return str(path.relative_to(assets_folder)) diff --git a/vizro-core/src/vizro/models/_page.py b/vizro-core/src/vizro/models/_page.py index 03315e8e5..be1d1b4bd 100644 --- a/vizro-core/src/vizro/models/_page.py +++ b/vizro-core/src/vizro/models/_page.py @@ -23,6 +23,7 @@ class Page(VizroBaseModel): has to be provided. title (str): Title to be displayed. description (str): Description for meta tags. + image (str): Image filename in the assets folder for meta tags. layout (Optional[Layout]): Layout to place components in. Defaults to `None`. controls (List[ControlType]): See [ControlType][vizro.models.types.ControlType]. Defaults to `[]`. path (Optional[str]): Path to navigate to page. Defaults to `None`. @@ -34,6 +35,7 @@ class Page(VizroBaseModel): components: List[ComponentType] title: str = Field(..., description="Title to be displayed.") description: Optional[str] = Field(None, description="Page description for meta tags.") + image: Optional[str] = Field(None, description="Image filename in the assets folder for meta tags.") layout: Optional[Layout] controls: List[ControlType] = [] path: Optional[str] = Field(None, description="Path to navigate to page.") From 7dd22740ee19a94f94da2a492f94262f56986b30 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Tue, 28 Nov 2023 09:58:56 -0800 Subject: [PATCH 03/29] meta tags example --- vizro-core/examples/assets/logo.png | Bin 0 -> 16384 bytes vizro-core/examples/default/app.py | 5 +++++ vizro-core/src/vizro/models/_dashboard.py | 7 ++++++- vizro-core/src/vizro/models/_page.py | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 vizro-core/examples/assets/logo.png diff --git a/vizro-core/examples/assets/logo.png b/vizro-core/examples/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e871127854bdafcc9edd6b32b2b925eacbee3e11 GIT binary patch literal 16384 zcmdUWhdY-2AGU}h>#-`NC9`BFS)nB>BqZ4hA!LPYQK+Pnl_bd~A)Am*c1Q@x$|mbQ zujlz4$NMk5@9($|KRxdIy1&==`x)owJkKjgUG*Fd6)P192?@=G^NJcIB&6c_y=5l_ zelm&j`{Mt$JIG(q+KK+%-+q(_{n)qT6q%EmG@_ay)OUm3{Ro`jn++&}U{MvO71VT$`fL~?TcFgNaO2i9JD z;SlADukw5`UAoYfPvc9BSb%%Hp~BM9J?7@J{W06CV}%-*hl2jMw1>Fc+}%6$LZ!(9 zxV@_Gygj%d-||F_$@)ur6+^>pTmJ>FcAb4pme?953Mz5ankT#mmMY}xvu+Gbx4+T& zZ%h4fm3T+i`&Ff~El->*zu3HKyZJ_g_l-vK_8KR;Pu<+i}e)4IC4OS=#HO(KG` z56AD!G~Qt&?c)0C$ic#Y9#s9XFUTw?pv>!~iE9o#?>9d5PK)o7t}bP+9!-Q2d4awv z(jeOk>k6x*{vdkQJFxlYt0O(datFMorfykVTbJ47ncTWXLmPOQ&HD8v^Io-Nt=F$# zld^_TNXF2HgoLzM=C)Xf(o^~Wu#<4zjG>ng-bT(gmoP+$5So@Imno%7EwoT3?b-Ld z-ak2+x39#5ZFqRNyRT1Cg8l5F$6q)uY$L&Kgw>FR)hJxMwvU2>;?HQ5?a7j)|xUrKEGWpPNph^?Sx^L z&W}a6|1ZIu5J{)h8wbwM0ulOPEv6F z{y5(xjqn|DzsUf6ReL*AXJ_Y<+0^Q)Yxk7Xio4ADM2+{k2mRdX$fFblB8;6ZwfB|z z1r>ZP{!QYe#iP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A`8E zrsh<1G1*|`dr;AKHe0XA_FLJcu_UhqHhITQcehi?>C)a;a*Vz-8s3Kf0!W{e*4xwB z(-Q>UEgp~9{Ag-&mEr*U191lyM%4-fGIRp#f5vP~<=<+jNdI{owECuP98W(vNsC~? z)R^<_3!)=JKLE#oJTj%yt}?#uM5zyYDXJ4R? zksI{|NDD$YU>Gn4cwaJ<0pf`veN|cYc?N4du6lgCqbP}rG?15I&w`f8)F(P~o|6=P5)M(h1CQDWH5dC!2=g{J z-#fY}NVj3A&(}{U?gC0V3`vN}YvcofQn082IsqR=+in5Zf;mGYdhWjOMekITXX&Y! zrpeM%c$f~>mC^w^_`bj3{*;3Y Date: Thu, 14 Dec 2023 08:47:23 -0800 Subject: [PATCH 04/29] fixed conflicts --- .../examples/assets/{logo.png => images/app.jpeg} | Bin vizro-core/examples/assets/images/logo.svg | 3 +++ vizro-core/src/vizro/models/_dashboard.py | 10 ++++++++++ vizro-core/src/vizro/models/_page.py | 4 +++- 4 files changed, 16 insertions(+), 1 deletion(-) rename vizro-core/examples/assets/{logo.png => images/app.jpeg} (100%) create mode 100644 vizro-core/examples/assets/images/logo.svg diff --git a/vizro-core/examples/assets/logo.png b/vizro-core/examples/assets/images/app.jpeg similarity index 100% rename from vizro-core/examples/assets/logo.png rename to vizro-core/examples/assets/images/app.jpeg diff --git a/vizro-core/examples/assets/images/logo.svg b/vizro-core/examples/assets/images/logo.svg new file mode 100644 index 000000000..0904b87de --- /dev/null +++ b/vizro-core/examples/assets/images/logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/vizro-core/src/vizro/models/_dashboard.py b/vizro-core/src/vizro/models/_dashboard.py index 683c94d5f..483b64eba 100644 --- a/vizro-core/src/vizro/models/_dashboard.py +++ b/vizro-core/src/vizro/models/_dashboard.py @@ -2,6 +2,7 @@ import logging from functools import partial +from pathlib import Path from typing import TYPE_CHECKING, List, Literal import dash @@ -75,6 +76,7 @@ def pre_build(self): order=order, layout=partial(self._make_page_layout, page), description=page.description, + image=page.image if page.image else self._infer_image("app") or self._infer_image("logo"), ) dash.register_page(module=MODULE_PAGE_404, layout=self._make_page_404_layout()) @@ -157,3 +159,11 @@ def _make_page_404_layout(): ], className="page_error_container", ) + + def _infer_image(self, basename: str): + valid_extensions = [".apng", ".avif", ".gif", ".jpeg", ".jpg", ".png", ".svg", ".webp"] + assets_folder = Path(dash.get_app().config.assets_folder) + if assets_folder.is_dir(): + for path in Path(assets_folder).rglob(f"{basename}.*"): + if path.suffix in valid_extensions: + return str(path.relative_to(assets_folder)) diff --git a/vizro-core/src/vizro/models/_page.py b/vizro-core/src/vizro/models/_page.py index 163061f4e..62ff0112f 100644 --- a/vizro-core/src/vizro/models/_page.py +++ b/vizro-core/src/vizro/models/_page.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import List, TypedDict +from typing import List, Optional, TypedDict from dash import Input, Output, Patch, callback, dcc, html @@ -36,6 +36,7 @@ class Page(VizroBaseModel): has to be provided. title (str): Title to be displayed. description (str): Description for meta tags. + image (str): Image filename in the assets folder for meta tags. layout (Layout): Layout to place components in. Defaults to `None`. controls (List[ControlType]): See [ControlType][vizro.models.types.ControlType]. Defaults to `[]`. path (str): Path to navigate to page. Defaults to `""`. @@ -47,6 +48,7 @@ class Page(VizroBaseModel): components: List[ComponentType] title: str = Field(..., description="Title to be displayed.") description: Optional[str] = Field(None, description="Page description for meta tags.") + image: Optional[str] = Field(None, description="Image filename in the assets folder for meta tags.") layout: Layout = None # type: ignore[assignment] controls: List[ControlType] = [] path: str = Field("", description="Path to navigate to page.") From f4e98c590849a58b60bc9de1f0d7ed82948b478f Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Sat, 16 Dec 2023 12:56:30 -0800 Subject: [PATCH 05/29] remove image field, added default app.svg --- vizro-core/src/vizro/models/_dashboard.py | 4 +++- vizro-core/src/vizro/models/_page.py | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vizro-core/src/vizro/models/_dashboard.py b/vizro-core/src/vizro/models/_dashboard.py index 483b64eba..c6c5bc9e4 100644 --- a/vizro-core/src/vizro/models/_dashboard.py +++ b/vizro-core/src/vizro/models/_dashboard.py @@ -76,7 +76,9 @@ def pre_build(self): order=order, layout=partial(self._make_page_layout, page), description=page.description, - image=page.image if page.image else self._infer_image("app") or self._infer_image("logo"), + image=self._infer_image("app") + or self._infer_image("logo") + or get_relative_path(f"/{STATIC_URL_PREFIX}/images/app.svg"), ) dash.register_page(module=MODULE_PAGE_404, layout=self._make_page_404_layout()) diff --git a/vizro-core/src/vizro/models/_page.py b/vizro-core/src/vizro/models/_page.py index 62ff0112f..ff49d5372 100644 --- a/vizro-core/src/vizro/models/_page.py +++ b/vizro-core/src/vizro/models/_page.py @@ -36,7 +36,6 @@ class Page(VizroBaseModel): has to be provided. title (str): Title to be displayed. description (str): Description for meta tags. - image (str): Image filename in the assets folder for meta tags. layout (Layout): Layout to place components in. Defaults to `None`. controls (List[ControlType]): See [ControlType][vizro.models.types.ControlType]. Defaults to `[]`. path (str): Path to navigate to page. Defaults to `""`. @@ -48,7 +47,6 @@ class Page(VizroBaseModel): components: List[ComponentType] title: str = Field(..., description="Title to be displayed.") description: Optional[str] = Field(None, description="Page description for meta tags.") - image: Optional[str] = Field(None, description="Image filename in the assets folder for meta tags.") layout: Layout = None # type: ignore[assignment] controls: List[ControlType] = [] path: str = Field("", description="Path to navigate to page.") From 8b6539717ffe8c8dda1fec581bc4756bfb9ccf4b Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Sat, 16 Dec 2023 16:39:34 -0800 Subject: [PATCH 06/29] moved meta image definition --- vizro-core/src/vizro/models/_dashboard.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vizro-core/src/vizro/models/_dashboard.py b/vizro-core/src/vizro/models/_dashboard.py index c6c5bc9e4..37d2ed917 100644 --- a/vizro-core/src/vizro/models/_dashboard.py +++ b/vizro-core/src/vizro/models/_dashboard.py @@ -64,6 +64,12 @@ def set_navigation_pages(cls, navigation, values): @_log_call def pre_build(self): + meta_image = ( + self._infer_image("app") + or self._infer_image("logo") + or get_relative_path(f"/{STATIC_URL_PREFIX}/images/app.svg") + ) + # Setting order here ensures that the pages in dash.page_registry preserves the order of the List[Page]. # For now the homepage (path /) corresponds to self.pages[0]. # Note redirect_from=["/"] doesn't work and so the / route must be defined separately. @@ -76,9 +82,7 @@ def pre_build(self): order=order, layout=partial(self._make_page_layout, page), description=page.description, - image=self._infer_image("app") - or self._infer_image("logo") - or get_relative_path(f"/{STATIC_URL_PREFIX}/images/app.svg"), + image=meta_image, ) dash.register_page(module=MODULE_PAGE_404, layout=self._make_page_404_layout()) From d5b3fe217ca9920edaf4762892c6a66b7e3e210b Mon Sep 17 00:00:00 2001 From: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> Date: Mon, 18 Dec 2023 09:42:26 -0800 Subject: [PATCH 07/29] Update vizro-core/src/vizro/models/_page.py Co-authored-by: Antony Milne <49395058+antonymilne@users.noreply.github.com> Signed-off-by: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> --- vizro-core/src/vizro/models/_page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vizro-core/src/vizro/models/_page.py b/vizro-core/src/vizro/models/_page.py index ff49d5372..34ee01fb2 100644 --- a/vizro-core/src/vizro/models/_page.py +++ b/vizro-core/src/vizro/models/_page.py @@ -46,7 +46,7 @@ class Page(VizroBaseModel): components: List[ComponentType] title: str = Field(..., description="Title to be displayed.") - description: Optional[str] = Field(None, description="Page description for meta tags.") + description: str = Field("", description="Page description for meta tags.") layout: Layout = None # type: ignore[assignment] controls: List[ControlType] = [] path: str = Field("", description="Path to navigate to page.") From f9f2f64372d7364a5b881636e3ecbb5d210c40f3 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Mon, 18 Dec 2023 10:45:19 -0800 Subject: [PATCH 08/29] updated example app image --- vizro-core/examples/assets/images/app.jpeg | Bin 16384 -> 0 bytes vizro-core/examples/assets/images/app.svg | 9 +++++++++ 2 files changed, 9 insertions(+) delete mode 100644 vizro-core/examples/assets/images/app.jpeg create mode 100644 vizro-core/examples/assets/images/app.svg diff --git a/vizro-core/examples/assets/images/app.jpeg b/vizro-core/examples/assets/images/app.jpeg deleted file mode 100644 index e871127854bdafcc9edd6b32b2b925eacbee3e11..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmdUWhdY-2AGU}h>#-`NC9`BFS)nB>BqZ4hA!LPYQK+Pnl_bd~A)Am*c1Q@x$|mbQ zujlz4$NMk5@9($|KRxdIy1&==`x)owJkKjgUG*Fd6)P192?@=G^NJcIB&6c_y=5l_ zelm&j`{Mt$JIG(q+KK+%-+q(_{n)qT6q%EmG@_ay)OUm3{Ro`jn++&}U{MvO71VT$`fL~?TcFgNaO2i9JD z;SlADukw5`UAoYfPvc9BSb%%Hp~BM9J?7@J{W06CV}%-*hl2jMw1>Fc+}%6$LZ!(9 zxV@_Gygj%d-||F_$@)ur6+^>pTmJ>FcAb4pme?953Mz5ankT#mmMY}xvu+Gbx4+T& zZ%h4fm3T+i`&Ff~El->*zu3HKyZJ_g_l-vK_8KR;Pu<+i}e)4IC4OS=#HO(KG` z56AD!G~Qt&?c)0C$ic#Y9#s9XFUTw?pv>!~iE9o#?>9d5PK)o7t}bP+9!-Q2d4awv z(jeOk>k6x*{vdkQJFxlYt0O(datFMorfykVTbJ47ncTWXLmPOQ&HD8v^Io-Nt=F$# zld^_TNXF2HgoLzM=C)Xf(o^~Wu#<4zjG>ng-bT(gmoP+$5So@Imno%7EwoT3?b-Ld z-ak2+x39#5ZFqRNyRT1Cg8l5F$6q)uY$L&Kgw>FR)hJxMwvU2>;?HQ5?a7j)|xUrKEGWpPNph^?Sx^L z&W}a6|1ZIu5J{)h8wbwM0ulOPEv6F z{y5(xjqn|DzsUf6ReL*AXJ_Y<+0^Q)Yxk7Xio4ADM2+{k2mRdX$fFblB8;6ZwfB|z z1r>ZP{!QYe#iP7bHnVKv=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<1G1*|`dr;AKHe0XA_FLJcu_UhqHhITQcehi?>C)a;a*Vz-8s3Kf0!W{e*4xwB z(-Q>UEgp~9{Ag-&mEr*U191lyM%4-fGIRp#f5vP~<=<+jNdI{owECuP98W(vNsC~? z)R^<_3!)=JKLE#oJTj%yt}?#uM5zyYDXJ4R? zksI{|NDD$YU>Gn4cwaJ<0pf`veN|cYc?N4du6lgCqbP}rG?15I&w`f8)F(P~o|6=P5)M(h1CQDWH5dC!2=g{J z-#fY}NVj3A&(}{U?gC0V3`vN}YvcofQn082IsqR=+in5Zf;mGYdhWjOMekITXX&Y! zrpeM%c$f~>mC^w^_`bj3{*;3Y + + + + + + + + From e842852aecf7f5cf4fcfda86c8ea94b01eb6f57d Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Mon, 18 Dec 2023 11:12:26 -0800 Subject: [PATCH 09/29] removed Optional import --- vizro-core/src/vizro/models/_page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vizro-core/src/vizro/models/_page.py b/vizro-core/src/vizro/models/_page.py index 34ee01fb2..c1b0c3f07 100644 --- a/vizro-core/src/vizro/models/_page.py +++ b/vizro-core/src/vizro/models/_page.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import List, Optional, TypedDict +from typing import List, TypedDict from dash import Input, Output, Patch, callback, dcc, html From 859c3af686904d91abbba1a55ffcb5ef98ed3e27 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Mon, 18 Dec 2023 15:03:34 -0800 Subject: [PATCH 10/29] update test --- vizro-core/tests/unit/vizro/models/test_dashboard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index 39f499528..56e03024b 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -49,8 +49,8 @@ def mock_page_registry(prebuilt_two_page_dashboard, page_1, page_2): "order": 0, "supplied_order": 0, "supplied_layout": partial(prebuilt_two_page_dashboard._make_page_layout, page_1), - "supplied_image": None, - "image": None, + "supplied_image": '/vizro/images/app.svg', + "image": '/vizro/images/app.svg', "image_url": None, "redirect_from": None, "layout": partial(prebuilt_two_page_dashboard._make_page_layout, page_1), @@ -69,8 +69,8 @@ def mock_page_registry(prebuilt_two_page_dashboard, page_1, page_2): "order": 1, "supplied_order": 1, "supplied_layout": partial(prebuilt_two_page_dashboard._make_page_layout, page_2), - "supplied_image": None, - "image": None, + "supplied_image": '/vizro/images/app.svg', + "image": '/vizro/images/app.svg', "image_url": None, "redirect_from": None, "layout": partial(prebuilt_two_page_dashboard._make_page_layout, page_2), From 5abedca4a61e9983d7ac8c4a3043e0a0959b255e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 18:27:24 +0000 Subject: [PATCH 11/29] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- vizro-core/src/vizro/models/_dashboard.py | 2 +- vizro-core/tests/unit/vizro/models/test_dashboard.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/vizro-core/src/vizro/models/_dashboard.py b/vizro-core/src/vizro/models/_dashboard.py index 645f5d708..6b4abbdf7 100644 --- a/vizro-core/src/vizro/models/_dashboard.py +++ b/vizro-core/src/vizro/models/_dashboard.py @@ -76,7 +76,7 @@ def pre_build(self): for order, page in enumerate(self.pages): dash.register_page( module=page.id, - name=page.title, + name=page.title, description=page.description, image=meta_image, title=f"{self.title}: {page.title}" if self.title else page.title, diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index 020e1194c..91036aa72 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -16,6 +16,7 @@ import vizro.models as vm from vizro.actions._action_loop._action_loop import ActionLoop + class TestDashboardInstantiation: """Tests model instantiation and the validators run at that time.""" From 2a96b30cff20303376632531c0d72d2b9a03a925 Mon Sep 17 00:00:00 2001 From: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> Date: Wed, 20 Dec 2023 07:06:20 -0800 Subject: [PATCH 12/29] Update vizro-core/examples/default/app.py Co-authored-by: Antony Milne <49395058+antonymilne@users.noreply.github.com> Signed-off-by: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> --- vizro-core/examples/default/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vizro-core/examples/default/app.py b/vizro-core/examples/default/app.py index 02e74e47a..ca1df8a2e 100644 --- a/vizro-core/examples/default/app.py +++ b/vizro-core/examples/default/app.py @@ -500,7 +500,7 @@ def create_home_page(): """Function returns the homepage.""" page_home = vm.Page( title="Homepage", - description="Welcome to the Vizro demo app", + description="Vizro demo app for studying gapminder data", layout=vm.Layout(grid=[[0, 1], [2, 3]], row_gap="16px", col_gap="24px"), components=[ vm.Card( From 18de28fd290d933ccacd470b43d566632ef3b989 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Wed, 20 Dec 2023 07:08:07 -0800 Subject: [PATCH 13/29] update tests --- vizro-core/src/vizro/models/_dashboard.py | 8 +------ .../tests/unit/vizro/models/test_dashboard.py | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/vizro-core/src/vizro/models/_dashboard.py b/vizro-core/src/vizro/models/_dashboard.py index 6b4abbdf7..df12eafb7 100644 --- a/vizro-core/src/vizro/models/_dashboard.py +++ b/vizro-core/src/vizro/models/_dashboard.py @@ -64,12 +64,6 @@ def set_navigation_pages(cls, navigation, values): @_log_call def pre_build(self): - meta_image = ( - self._infer_image("app") - or self._infer_image("logo") - or get_relative_path(f"/{STATIC_URL_PREFIX}/images/app.svg") - ) - # Setting order here ensures that the pages in dash.page_registry preserves the order of the List[Page]. # For now the homepage (path /) corresponds to self.pages[0]. # Note redirect_from=["/"] doesn't work and so the / route must be defined separately. @@ -78,7 +72,7 @@ def pre_build(self): module=page.id, name=page.title, description=page.description, - image=meta_image, + image=self._infer_image("app") or self._infer_image("logo"), title=f"{self.title}: {page.title}" if self.title else page.title, path=page.path if order else "/", order=order, diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index 91036aa72..aa742e185 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -76,6 +76,8 @@ def test_page_registry(self, vizro_app, page_1, page_2, mocker): mock_register_page.assert_any_call( module=page_1.id, name="Page 1", + description="", + image=None, title="Page 1", path="/", order=0, @@ -84,6 +86,8 @@ def test_page_registry(self, vizro_app, page_1, page_2, mocker): mock_register_page.assert_any_call( module=page_2.id, name="Page 2", + description="", + image=None, title="Page 2", path="/page-2", order=1, @@ -102,12 +106,32 @@ def test_page_registry_with_title(self, vizro_app, page_1, mocker): mock_register_page.assert_any_call( module=page_1.id, name="Page 1", + description="", + image=None, title="My dashboard: Page 1", path="/", order=0, layout=mocker.ANY, # partial call is tricky to mock out so we ignore it. ) + def test_page_registry_with_description(self, vizro_app, mocker): + mock_register_page = mocker.patch("dash.register_page", autospec=True) + vm.Dashboard( + pages=[vm.Page(title="Page 1", components=[vm.Button()], description="My description")] + ).pre_build() + + mock_register_page.assert_any_call( + module="Page 1", + name="Page 1", + description="My description", + image=None, + title="Page 1", + path="/", + order=0, + layout=mocker.ANY, # partial call is tricky to mock out so we ignore it. + ) + + def test_make_page_404_layout(self, vizro_app): # vizro_app fixture is needed to avoid mocking out get_relative_path. expected = html.Div( From af0fe9729dcc113266a45e7b2244349c36ddbe40 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:08:45 +0000 Subject: [PATCH 14/29] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- vizro-core/tests/unit/vizro/models/test_dashboard.py | 1 - 1 file changed, 1 deletion(-) diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index aa742e185..3a6203bf5 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -131,7 +131,6 @@ def test_page_registry_with_description(self, vizro_app, mocker): layout=mocker.ANY, # partial call is tricky to mock out so we ignore it. ) - def test_make_page_404_layout(self, vizro_app): # vizro_app fixture is needed to avoid mocking out get_relative_path. expected = html.Div( From d8257cfbb0bafeac2b4276d76502f737bd77d970 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Wed, 20 Dec 2023 08:52:22 -0800 Subject: [PATCH 15/29] added test_page_registry_with_image --- .../tests/unit/vizro/models/test_dashboard.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index 3a6203bf5..cf3a3b9ed 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -1,4 +1,5 @@ import json +from pathlib import Path import dash import dash_bootstrap_components as dbc @@ -131,6 +132,27 @@ def test_page_registry_with_description(self, vizro_app, mocker): layout=mocker.ANY, # partial call is tricky to mock out so we ignore it. ) + @pytest.mark.parametrize( + "image_filename", ["app.png", "app.svg", "folder/app.png", "folder/app.svg", "logo.png", "logo.svg"] + ) + def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_filename): + Path(tmp_path / "folder").mkdir() + Path(tmp_path / image_filename).touch() + vizro_app = vizro.Vizro(assets_folder=tmp_path) + mock_register_page = mocker.patch("dash.register_page", autospec=True) + vm.Dashboard(pages=[page_1], title="My dashboard").pre_build() + + mock_register_page.assert_any_call( + module=page_1.id, + name="Page 1", + description="", + image=image_filename, + title="My dashboard: Page 1", + path="/", + order=0, + layout=mocker.ANY, # partial call is tricky to mock out so we ignore it. + ) + def test_make_page_404_layout(self, vizro_app): # vizro_app fixture is needed to avoid mocking out get_relative_path. expected = html.Div( From fd75cbb26c05c2022972ffd521b98ea2f7592ce4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 16:54:58 +0000 Subject: [PATCH 16/29] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- vizro-core/tests/unit/vizro/models/test_dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index cf3a3b9ed..fd9eff260 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -138,7 +138,7 @@ def test_page_registry_with_description(self, vizro_app, mocker): def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_filename): Path(tmp_path / "folder").mkdir() Path(tmp_path / image_filename).touch() - vizro_app = vizro.Vizro(assets_folder=tmp_path) + vizro.Vizro(assets_folder=tmp_path) mock_register_page = mocker.patch("dash.register_page", autospec=True) vm.Dashboard(pages=[page_1], title="My dashboard").pre_build() From 9a279cb93d3b9689b33ce72f9968d4b14cceea31 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Wed, 20 Dec 2023 09:11:25 -0800 Subject: [PATCH 17/29] added test_page_registry_with_images --- .../tests/unit/vizro/models/test_dashboard.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index fd9eff260..86b19c499 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -153,6 +153,24 @@ def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_filename layout=mocker.ANY, # partial call is tricky to mock out so we ignore it. ) + def test_page_registry_with_images(self, page_1, mocker, tmp_path): + Path(tmp_path / "app.svg").touch() + Path(tmp_path / "logo.svg").touch() + vizro.Vizro(assets_folder=tmp_path) + mock_register_page = mocker.patch("dash.register_page", autospec=True) + vm.Dashboard(pages=[page_1], title="My dashboard").pre_build() + + mock_register_page.assert_any_call( + module=page_1.id, + name="Page 1", + description="", + image="app.svg", + title="My dashboard: Page 1", + path="/", + order=0, + layout=mocker.ANY, # partial call is tricky to mock out so we ignore it. + ) + def test_make_page_404_layout(self, vizro_app): # vizro_app fixture is needed to avoid mocking out get_relative_path. expected = html.Div( From f5f1c61e7f13435253dbdfbf5e940261217949b4 Mon Sep 17 00:00:00 2001 From: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> Date: Wed, 20 Dec 2023 14:18:59 -0800 Subject: [PATCH 18/29] Update vizro-core/src/vizro/models/_dashboard.py Co-authored-by: Antony Milne <49395058+antonymilne@users.noreply.github.com> Signed-off-by: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> --- vizro-core/src/vizro/models/_dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vizro-core/src/vizro/models/_dashboard.py b/vizro-core/src/vizro/models/_dashboard.py index df12eafb7..f1b2beb2f 100644 --- a/vizro-core/src/vizro/models/_dashboard.py +++ b/vizro-core/src/vizro/models/_dashboard.py @@ -160,7 +160,7 @@ def _make_page_404_layout(): className="page_error_container", ) - def _infer_image(self, basename: str): + def _infer_image(self, filename: str): valid_extensions = [".apng", ".avif", ".gif", ".jpeg", ".jpg", ".png", ".svg", ".webp"] assets_folder = Path(dash.get_app().config.assets_folder) if assets_folder.is_dir(): From ca4912df0b57c847489c3eb54960099a368c0766 Mon Sep 17 00:00:00 2001 From: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> Date: Wed, 20 Dec 2023 14:20:22 -0800 Subject: [PATCH 19/29] Update vizro-core/src/vizro/models/_page.py Co-authored-by: Antony Milne <49395058+antonymilne@users.noreply.github.com> Signed-off-by: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> --- vizro-core/src/vizro/models/_page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vizro-core/src/vizro/models/_page.py b/vizro-core/src/vizro/models/_page.py index c1b0c3f07..3b0db6d1d 100644 --- a/vizro-core/src/vizro/models/_page.py +++ b/vizro-core/src/vizro/models/_page.py @@ -46,7 +46,7 @@ class Page(VizroBaseModel): components: List[ComponentType] title: str = Field(..., description="Title to be displayed.") - description: str = Field("", description="Page description for meta tags.") + description: str = Field("", description="Description for meta tags.") layout: Layout = None # type: ignore[assignment] controls: List[ControlType] = [] path: str = Field("", description="Path to navigate to page.") From b3dcce9cf15718b5c76dd5285bb9bd5f91245d77 Mon Sep 17 00:00:00 2001 From: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> Date: Wed, 20 Dec 2023 14:20:45 -0800 Subject: [PATCH 20/29] Update vizro-core/tests/unit/vizro/models/test_dashboard.py Co-authored-by: Antony Milne <49395058+antonymilne@users.noreply.github.com> Signed-off-by: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> --- vizro-core/tests/unit/vizro/models/test_dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index 86b19c499..cc0de7500 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -133,7 +133,7 @@ def test_page_registry_with_description(self, vizro_app, mocker): ) @pytest.mark.parametrize( - "image_filename", ["app.png", "app.svg", "folder/app.png", "folder/app.svg", "logo.png", "logo.svg"] + "image_path", ["app.png", "app.svg", "images/app.png", "images/app.svg", "logo.png", "logo.svg"] ) def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_filename): Path(tmp_path / "folder").mkdir() From e035ecf5fc7a5047b7c725fc369ae567bb9b52af Mon Sep 17 00:00:00 2001 From: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> Date: Wed, 20 Dec 2023 14:22:37 -0800 Subject: [PATCH 21/29] Apply suggestions from code review Co-authored-by: Antony Milne <49395058+antonymilne@users.noreply.github.com> Signed-off-by: Ann Marie Ward <72614349+AnnMarieW@users.noreply.github.com> --- vizro-core/tests/unit/vizro/models/test_dashboard.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index cc0de7500..3aa09ce0b 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -136,18 +136,20 @@ def test_page_registry_with_description(self, vizro_app, mocker): "image_path", ["app.png", "app.svg", "images/app.png", "images/app.svg", "logo.png", "logo.svg"] ) def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_filename): - Path(tmp_path / "folder").mkdir() + if image_path.parent != Path("."): + Path(tmp_path / image_path.parent).mkdir() Path(tmp_path / image_filename).touch() - vizro.Vizro(assets_folder=tmp_path) + # at top of file: from vizro import Vizro + Vizro(assets_folder=tmp_path) mock_register_page = mocker.patch("dash.register_page", autospec=True) - vm.Dashboard(pages=[page_1], title="My dashboard").pre_build() + vm.Dashboard(pages=[page_1]).pre_build() mock_register_page.assert_any_call( module=page_1.id, name="Page 1", description="", image=image_filename, - title="My dashboard: Page 1", + title="Page 1", path="/", order=0, layout=mocker.ANY, # partial call is tricky to mock out so we ignore it. @@ -158,7 +160,7 @@ def test_page_registry_with_images(self, page_1, mocker, tmp_path): Path(tmp_path / "logo.svg").touch() vizro.Vizro(assets_folder=tmp_path) mock_register_page = mocker.patch("dash.register_page", autospec=True) - vm.Dashboard(pages=[page_1], title="My dashboard").pre_build() + vm.Dashboard(pages=[page_1]).pre_build() mock_register_page.assert_any_call( module=page_1.id, From a4befe83746c34233a81ea77243394d416c9b5c6 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Wed, 20 Dec 2023 14:57:38 -0800 Subject: [PATCH 22/29] more updates after review --- vizro-core/src/vizro/models/_dashboard.py | 6 ++++-- .../tests/unit/vizro/models/test_dashboard.py | 18 +++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/vizro-core/src/vizro/models/_dashboard.py b/vizro-core/src/vizro/models/_dashboard.py index f1b2beb2f..e358860dc 100644 --- a/vizro-core/src/vizro/models/_dashboard.py +++ b/vizro-core/src/vizro/models/_dashboard.py @@ -64,6 +64,8 @@ def set_navigation_pages(cls, navigation, values): @_log_call def pre_build(self): + meta_image = self._infer_image("app") or self._infer_image("logo") + # Setting order here ensures that the pages in dash.page_registry preserves the order of the List[Page]. # For now the homepage (path /) corresponds to self.pages[0]. # Note redirect_from=["/"] doesn't work and so the / route must be defined separately. @@ -72,7 +74,7 @@ def pre_build(self): module=page.id, name=page.title, description=page.description, - image=self._infer_image("app") or self._infer_image("logo"), + image=meta_image, title=f"{self.title}: {page.title}" if self.title else page.title, path=page.path if order else "/", order=order, @@ -164,6 +166,6 @@ def _infer_image(self, filename: str): valid_extensions = [".apng", ".avif", ".gif", ".jpeg", ".jpg", ".png", ".svg", ".webp"] assets_folder = Path(dash.get_app().config.assets_folder) if assets_folder.is_dir(): - for path in Path(assets_folder).rglob(f"{basename}.*"): + for path in Path(assets_folder).rglob(f"{filename}.*"): if path.suffix in valid_extensions: return str(path.relative_to(assets_folder)) diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index 3aa09ce0b..c8524f5dc 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -16,6 +16,7 @@ import vizro import vizro.models as vm from vizro.actions._action_loop._action_loop import ActionLoop +from vizro import Vizro class TestDashboardInstantiation: @@ -135,12 +136,11 @@ def test_page_registry_with_description(self, vizro_app, mocker): @pytest.mark.parametrize( "image_path", ["app.png", "app.svg", "images/app.png", "images/app.svg", "logo.png", "logo.svg"] ) - def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_filename): - if image_path.parent != Path("."): - Path(tmp_path / image_path.parent).mkdir() - Path(tmp_path / image_filename).touch() - # at top of file: from vizro import Vizro - Vizro(assets_folder=tmp_path) + def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_path): + if Path(image_path).parent != Path("."): + Path(tmp_path / image_path).parent.mkdir() + Path(tmp_path / image_path).touch() + Vizro(assets_folder=tmp_path) mock_register_page = mocker.patch("dash.register_page", autospec=True) vm.Dashboard(pages=[page_1]).pre_build() @@ -148,7 +148,7 @@ def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_filename module=page_1.id, name="Page 1", description="", - image=image_filename, + image=image_path, title="Page 1", path="/", order=0, @@ -158,7 +158,7 @@ def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_filename def test_page_registry_with_images(self, page_1, mocker, tmp_path): Path(tmp_path / "app.svg").touch() Path(tmp_path / "logo.svg").touch() - vizro.Vizro(assets_folder=tmp_path) + Vizro(assets_folder=tmp_path) mock_register_page = mocker.patch("dash.register_page", autospec=True) vm.Dashboard(pages=[page_1]).pre_build() @@ -167,7 +167,7 @@ def test_page_registry_with_images(self, page_1, mocker, tmp_path): name="Page 1", description="", image="app.svg", - title="My dashboard: Page 1", + title="Page 1", path="/", order=0, layout=mocker.ANY, # partial call is tricky to mock out so we ignore it. From b1d14c53e1d5a250eac4af5c2bfc38f194f9fc46 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 22:57:58 +0000 Subject: [PATCH 23/29] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- vizro-core/tests/unit/vizro/models/test_dashboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index c8524f5dc..24c48e38f 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -15,8 +15,8 @@ import vizro import vizro.models as vm -from vizro.actions._action_loop._action_loop import ActionLoop from vizro import Vizro +from vizro.actions._action_loop._action_loop import ActionLoop class TestDashboardInstantiation: From e15babcf9f1d245a80356df53d69a2a2d826a89d Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Thu, 21 Dec 2023 05:16:22 -0800 Subject: [PATCH 24/29] updated schema --- vizro-core/schemas/0.1.8.dev0.json | 2180 ++++++++++++++-------------- 1 file changed, 1118 insertions(+), 1062 deletions(-) diff --git a/vizro-core/schemas/0.1.8.dev0.json b/vizro-core/schemas/0.1.8.dev0.json index 66b0af594..6f27679f0 100644 --- a/vizro-core/schemas/0.1.8.dev0.json +++ b/vizro-core/schemas/0.1.8.dev0.json @@ -1,1100 +1,1156 @@ { - "title": "Dashboard", - "description": "Vizro Dashboard to be used within [`Vizro`][vizro._vizro.Vizro.build].\n\nArgs:\n pages (List[Page]): See [`Page`][vizro.models.Page].\n theme (Literal[\"vizro_dark\", \"vizro_light\"]): Layout theme to be applied across dashboard.\n Defaults to `vizro_dark`.\n navigation (Navigation): See [`Navigation`][vizro.models.Navigation]. Defaults to `None`.\n title (str): Dashboard title to appear on every page on top left-side. Defaults to `\"\"`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "pages": { - "title": "Pages", - "type": "array", - "items": { - "$ref": "#/definitions/Page" - } - }, - "theme": { - "title": "Theme", - "description": "Layout theme to be applied across dashboard. Defaults to `vizro_dark`", - "default": "vizro_dark", - "enum": ["vizro_dark", "vizro_light"], - "type": "string" - }, - "navigation": { - "$ref": "#/definitions/Navigation" - }, - "title": { - "title": "Title", - "description": "Dashboard title to appear on every page on top left-side.", - "default": "", - "type": "string" - } - }, - "required": ["pages"], - "additionalProperties": false, - "definitions": { - "Action": { - "title": "Action", - "description": "Action to be inserted into `actions` of relevant component.\n\nArgs:\n function (CapturedCallable): See [`CapturedCallable`][vizro.models.types.CapturedCallable].\n inputs (List[str]): Inputs in the form `.` passed to the action function.\n Defaults to `[]`.\n outputs (List[str]): Outputs in the form `.` changed by the action function.\n Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "inputs": { - "title": "Inputs", - "description": "Inputs in the form `.` passed to the action function.", - "default": [], - "pattern": "^[^.]+[.][^.]+$", - "type": "array", - "items": { - "type": "string", - "pattern": "^[^.]+[.][^.]+$" - } - }, - "outputs": { - "title": "Outputs", - "description": "Outputs in the form `.` changed by the action function.", - "default": [], - "pattern": "^[^.]+[.][^.]+$", - "type": "array", - "items": { - "type": "string", - "pattern": "^[^.]+[.][^.]+$" - } - } - }, - "additionalProperties": false - }, - "Button": { - "title": "Button", - "description": "Component provided to `Page` to trigger any defined `action` in `Page`.\n\nArgs:\n type (Literal[\"button\"]): Defaults to `\"button\"`.\n text (str): Text to be displayed on button. Defaults to `\"Click me!\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "button", - "enum": ["button"], - "type": "string" - }, - "text": { - "title": "Text", - "description": "Text to be displayed on button.", - "default": "Click me!", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } - }, - "additionalProperties": false - }, - "Card": { - "title": "Card", - "description": "Creates a card utilizing `dcc.Markdown` as title and text component.\n\nArgs:\n type (Literal[\"card\"]): Defaults to `\"card\"`.\n text (str): Markdown string to create card title/text that should adhere to the CommonMark Spec.\n href (str): URL (relative or absolute) to navigate to. If not provided the Card serves as a text card\n only. Defaults to `\"\"`.", - "type": "object", - "properties": { + "title": "Dashboard", + "description": "Vizro Dashboard to be used within [`Vizro`][vizro._vizro.Vizro.build].\n\nArgs:\n pages (List[Page]): See [`Page`][vizro.models.Page].\n theme (Literal[\"vizro_dark\", \"vizro_light\"]): Layout theme to be applied across dashboard.\n Defaults to `vizro_dark`.\n navigation (Navigation): See [`Navigation`][vizro.models.Navigation]. Defaults to `None`.\n title (str): Dashboard title to appear on every page on top left-side. Defaults to `\"\"`.", + "type": "object", + "properties": { "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "card", - "enum": ["card"], - "type": "string" - }, - "text": { - "title": "Text", - "description": "Markdown string to create card title/text that should adhere to the CommonMark Spec.", - "type": "string" - }, - "href": { - "title": "Href", - "description": "URL (relative or absolute) to navigate to. If not provided the Card serves as a text card only.", - "default": "", - "type": "string" - } - }, - "required": ["text"], - "additionalProperties": false - }, - "Graph": { - "title": "Graph", - "description": "Wrapper for `dcc.Graph` to visualize charts in dashboard.\n\nArgs:\n type (Literal[\"graph\"]): Defaults to `\"graph\"`.\n figure (CapturedCallable): See [`CapturedCallable`][vizro.models.types.CapturedCallable].\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "graph", - "enum": ["graph"], - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } - }, - "additionalProperties": false - }, - "Table": { - "title": "Table", - "description": "Wrapper for table components to visualize in dashboard.\n\nArgs:\n type (Literal[\"table\"]): Defaults to `\"table\"`.\n figure (CapturedCallable): Table like object to be displayed. Current choices include:\n [`dash_table.DataTable`](https://dash.plotly.com/datatable).\n title (str): Title of the table. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "table", - "enum": ["table"], - "type": "string" - }, - "title": { - "title": "Title", - "description": "Title of the table", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } - }, - "additionalProperties": false - }, - "Layout": { - "title": "Layout", - "description": "Grid specification to place chart/components on the [`Page`][vizro.models.Page].\n\nArgs:\n grid (List[List[int]]): Grid specification to arrange components on screen.\n row_gap (str): Gap between rows in px. Defaults to `\"12px\"`.\n col_gap (str): Gap between columns in px. Defaults to `\"12px\"`.\n row_min_height (str): Minimum row height in px. Defaults to `\"0px\"`.\n col_min_width (str): Minimum column width in px. Defaults to `\"0px\"`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" }, - "grid": { - "title": "Grid", - "description": "Grid specification to arrange components on screen.", - "type": "array", - "items": { + "pages": { + "title": "Pages", "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/Page" } - } - }, - "row_gap": { - "title": "Row Gap", - "description": "Gap between rows in px. Defaults to 12px.", - "default": "12px", - "pattern": "[0-9]+px", - "type": "string" - }, - "col_gap": { - "title": "Col Gap", - "description": "Gap between columns in px. Defaults to 12px.", - "default": "12px", - "pattern": "[0-9]+px", - "type": "string" - }, - "row_min_height": { - "title": "Row Min Height", - "description": "Minimum row height in px. Defaults to 0px.", - "default": "0px", - "pattern": "[0-9]+px", - "type": "string" }, - "col_min_width": { - "title": "Col Min Width", - "description": "Minimum column width in px. Defaults to 0px.", - "default": "0px", - "pattern": "[0-9]+px", - "type": "string" - } - }, - "required": ["grid"], - "additionalProperties": false - }, - "OptionsDictType": { - "title": "OptionsDictType", - "type": "object", - "properties": { - "label": { - "title": "Label", - "type": "string" - }, - "value": { - "title": "Value", - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - } - ] - } - }, - "required": ["label", "value"], - "additionalProperties": false - }, - "Checklist": { - "title": "Checklist", - "description": "Categorical multi-selector `Checklist` to be provided to [`Filter`][vizro.models.Filter].\n\nArgs:\n type (Literal[\"checklist\"]): Defaults to `\"checklist\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[MultiValueType]): See [`MultiValueType`][vizro.models.types.MultiValueType]. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "checklist", - "enum": ["checklist"], - "type": "string" - }, - "options": { - "title": "Options", - "default": [], - "anyOf": [ - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/OptionsDictType" - } - } - ] + "theme": { + "title": "Theme", + "description": "Layout theme to be applied across dashboard. Defaults to `vizro_dark`", + "default": "vizro_dark", + "enum": [ + "vizro_dark", + "vizro_light" + ], + "type": "string" }, - "value": { - "title": "Value", - "anyOf": [ - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "navigation": { + "$ref": "#/definitions/Navigation" }, "title": { - "title": "Title", - "description": "Title to be displayed", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } + "title": "Title", + "description": "Dashboard title to appear on every page on top left-side.", + "default": "", + "type": "string" } - }, - "additionalProperties": false }, - "Dropdown": { - "title": "Dropdown", - "description": "Categorical multi-selector `Dropdown` to be provided to [`Filter`][vizro.models.Filter].\n\nArgs:\n type (Literal[\"dropdown\"]): Defaults to `\"dropdown\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[Union[SingleValueType, MultiValueType]]): See\n [`SingleValueType`][vizro.models.types.SingleValueType] and\n [`MultiValueType`][vizro.models.types.MultiValueType]. Defaults to `None`.\n multi (bool): Whether to allow selection of multiple values. Defaults to `True`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "dropdown", - "enum": ["dropdown"], - "type": "string" - }, - "options": { - "title": "Options", - "default": [], - "anyOf": [ - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/OptionsDictType" - } - } - ] - }, - "value": { - "title": "Value", - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } + "required": [ + "pages" + ], + "additionalProperties": false, + "definitions": { + "Action": { + "title": "Action", + "description": "Action to be inserted into `actions` of relevant component.\n\nArgs:\n function (CapturedCallable): See [`CapturedCallable`][vizro.models.types.CapturedCallable].\n inputs (List[str]): Inputs in the form `.` passed to the action function.\n Defaults to `[]`.\n outputs (List[str]): Outputs in the form `.` changed by the action function.\n Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "inputs": { + "title": "Inputs", + "description": "Inputs in the form `.` passed to the action function.", + "default": [], + "pattern": "^[^.]+[.][^.]+$", + "type": "array", + "items": { + "type": "string", + "pattern": "^[^.]+[.][^.]+$" + } + }, + "outputs": { + "title": "Outputs", + "description": "Outputs in the form `.` changed by the action function.", + "default": [], + "pattern": "^[^.]+[.][^.]+$", + "type": "array", + "items": { + "type": "string", + "pattern": "^[^.]+[.][^.]+$" + } + } }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "multi": { - "title": "Multi", - "description": "Whether to allow selection of multiple values", - "default": true, - "type": "boolean" - }, - "title": { - "title": "Title", - "description": "Title to be displayed", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } - }, - "additionalProperties": false - }, - "RadioItems": { - "title": "RadioItems", - "description": "Categorical single-selector `RadioItems` to be provided to `Filter`.\n\nArgs:\n type (Literal[\"radio_items\"]): Defaults to `\"radio_items\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[SingleValueType]): See [`SingleValueType`][vizro.models.types.SingleValueType].\n Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "radio_items", - "enum": ["radio_items"], - "type": "string" - }, - "options": { - "title": "Options", - "default": [], - "anyOf": [ - { - "type": "array", - "items": { - "type": "boolean" - } + "additionalProperties": false + }, + "Button": { + "title": "Button", + "description": "Component provided to `Page` to trigger any defined `action` in `Page`.\n\nArgs:\n type (Literal[\"button\"]): Defaults to `\"button\"`.\n text (str): Text to be displayed on button. Defaults to `\"Click me!\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "button", + "enum": [ + "button" + ], + "type": "string" + }, + "text": { + "title": "Text", + "description": "Text to be displayed on button.", + "default": "Click me!", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } }, - { - "type": "array", - "items": { - "type": "number" - } + "additionalProperties": false + }, + "Card": { + "title": "Card", + "description": "Creates a card utilizing `dcc.Markdown` as title and text component.\n\nArgs:\n type (Literal[\"card\"]): Defaults to `\"card\"`.\n text (str): Markdown string to create card title/text that should adhere to the CommonMark Spec.\n href (str): URL (relative or absolute) to navigate to. If not provided the Card serves as a text card\n only. Defaults to `\"\"`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "card", + "enum": [ + "card" + ], + "type": "string" + }, + "text": { + "title": "Text", + "description": "Markdown string to create card title/text that should adhere to the CommonMark Spec.", + "type": "string" + }, + "href": { + "title": "Href", + "description": "URL (relative or absolute) to navigate to. If not provided the Card serves as a text card only.", + "default": "", + "type": "string" + } }, - { - "type": "array", - "items": { - "type": "string" - } + "required": [ + "text" + ], + "additionalProperties": false + }, + "Graph": { + "title": "Graph", + "description": "Wrapper for `dcc.Graph` to visualize charts in dashboard.\n\nArgs:\n type (Literal[\"graph\"]): Defaults to `\"graph\"`.\n figure (CapturedCallable): See [`CapturedCallable`][vizro.models.types.CapturedCallable].\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "graph", + "enum": [ + "graph" + ], + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } }, - { - "type": "array", - "items": { - "$ref": "#/definitions/OptionsDictType" - } - } - ] - }, - "value": { - "title": "Value", - "anyOf": [ - { - "type": "boolean" + "additionalProperties": false + }, + "Table": { + "title": "Table", + "description": "Wrapper for table components to visualize in dashboard.\n\nArgs:\n type (Literal[\"table\"]): Defaults to `\"table\"`.\n figure (CapturedCallable): Table like object to be displayed. Current choices include:\n [`dash_table.DataTable`](https://dash.plotly.com/datatable).\n title (str): Title of the table. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "table", + "enum": [ + "table" + ], + "type": "string" + }, + "title": { + "title": "Title", + "description": "Title of the table", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } }, - { - "type": "number" + "additionalProperties": false + }, + "Layout": { + "title": "Layout", + "description": "Grid specification to place chart/components on the [`Page`][vizro.models.Page].\n\nArgs:\n grid (List[List[int]]): Grid specification to arrange components on screen.\n row_gap (str): Gap between rows in px. Defaults to `\"12px\"`.\n col_gap (str): Gap between columns in px. Defaults to `\"12px\"`.\n row_min_height (str): Minimum row height in px. Defaults to `\"0px\"`.\n col_min_width (str): Minimum column width in px. Defaults to `\"0px\"`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "grid": { + "title": "Grid", + "description": "Grid specification to arrange components on screen.", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "row_gap": { + "title": "Row Gap", + "description": "Gap between rows in px. Defaults to 12px.", + "default": "12px", + "pattern": "[0-9]+px", + "type": "string" + }, + "col_gap": { + "title": "Col Gap", + "description": "Gap between columns in px. Defaults to 12px.", + "default": "12px", + "pattern": "[0-9]+px", + "type": "string" + }, + "row_min_height": { + "title": "Row Min Height", + "description": "Minimum row height in px. Defaults to 0px.", + "default": "0px", + "pattern": "[0-9]+px", + "type": "string" + }, + "col_min_width": { + "title": "Col Min Width", + "description": "Minimum column width in px. Defaults to 0px.", + "default": "0px", + "pattern": "[0-9]+px", + "type": "string" + } }, - { - "type": "string" - } - ] - }, - "title": { - "title": "Title", - "description": "Title to be displayed", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } - }, - "additionalProperties": false - }, - "RangeSlider": { - "title": "RangeSlider", - "description": "Numeric multi-selector `RangeSlider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.RangeSlider`](https://dash.plotly.com/dash-core-components/rangeslider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `{}`.\n value (Optional[List[float]]): Default start and end value for slider. Must be 2 items. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "range_slider", - "enum": ["range_slider"], - "type": "string" - }, - "min": { - "title": "Min", - "description": "Start value for slider.", - "type": "number" - }, - "max": { - "title": "Max", - "description": "End value for slider.", - "type": "number" - }, - "step": { - "title": "Step", - "description": "Step-size for marks on slider.", - "type": "number" - }, - "marks": { - "title": "Marks", - "description": "Marks to be displayed on slider.", - "default": {}, - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "value": { - "title": "Value", - "description": "Default start and end value for slider", - "minItems": 2, - "maxItems": 2, - "type": "array", - "items": { - "type": "number" - } - }, - "title": { - "title": "Title", - "description": "Title to be displayed.", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } - }, - "additionalProperties": false - }, - "Slider": { - "title": "Slider", - "description": "Numeric single-selector `Slider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.Slider`](https://dash.plotly.com/dash-core-components/slider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `{}`.\n value (Optional[float]): Default value for slider. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "slider", - "enum": ["slider"], - "type": "string" - }, - "min": { - "title": "Min", - "description": "Start value for slider.", - "type": "number" - }, - "max": { - "title": "Max", - "description": "End value for slider.", - "type": "number" - }, - "step": { - "title": "Step", - "description": "Step-size for marks on slider.", - "type": "number" - }, - "marks": { - "title": "Marks", - "description": "Marks to be displayed on slider.", - "default": {}, - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "value": { - "title": "Value", - "description": "Default value for slider.", - "type": "number" - }, - "title": { - "title": "Title", - "description": "Title to be displayed.", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } - }, - "additionalProperties": false - }, - "Filter": { - "title": "Filter", - "description": "Filter the data supplied to `targets` on the [`Page`][vizro.models.Page].\n\nExamples:\n >>> print(repr(Filter(column=\"species\")))\n\nArgs:\n type (Literal[\"filter\"]): Defaults to `\"filter\"`.\n column (str): Column of `DataFrame` to filter.\n targets (List[ModelID]): Target component to be affected by filter. If none are given then target all components\n on the page that use `column`.\n selector (SelectorType): See [SelectorType][vizro.models.types.SelectorType]. Defaults to `None`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "filter", - "enum": ["filter"], - "type": "string" - }, - "column": { - "title": "Column", - "description": "Column of DataFrame to filter.", - "type": "string" - }, - "targets": { - "title": "Targets", - "description": "Target component to be affected by filter. If none are given then target all components on the page that use `column`.", - "default": [], - "type": "array", - "items": { - "type": "string" - } - }, - "selector": { - "title": "Selector", - "description": "Selectors to be used inside a control.", - "discriminator": { - "propertyName": "type", - "mapping": { - "checklist": "#/definitions/Checklist", - "dropdown": "#/definitions/Dropdown", - "radio_items": "#/definitions/RadioItems", - "range_slider": "#/definitions/RangeSlider", - "slider": "#/definitions/Slider" - } - }, - "oneOf": [ - { - "$ref": "#/definitions/Checklist" + "required": [ + "grid" + ], + "additionalProperties": false + }, + "OptionsDictType": { + "title": "OptionsDictType", + "type": "object", + "properties": { + "label": { + "title": "Label", + "type": "string" + }, + "value": { + "title": "Value", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + } + ] + } }, - { - "$ref": "#/definitions/Dropdown" + "required": [ + "label", + "value" + ], + "additionalProperties": false + }, + "Checklist": { + "title": "Checklist", + "description": "Categorical multi-selector `Checklist` to be provided to [`Filter`][vizro.models.Filter].\n\nArgs:\n type (Literal[\"checklist\"]): Defaults to `\"checklist\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[MultiValueType]): See [`MultiValueType`][vizro.models.types.MultiValueType]. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "checklist", + "enum": [ + "checklist" + ], + "type": "string" + }, + "options": { + "title": "Options", + "default": [], + "anyOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/OptionsDictType" + } + } + ] + }, + "value": { + "title": "Value", + "anyOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "title": { + "title": "Title", + "description": "Title to be displayed", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } }, - { - "$ref": "#/definitions/RadioItems" + "additionalProperties": false + }, + "Dropdown": { + "title": "Dropdown", + "description": "Categorical multi-selector `Dropdown` to be provided to [`Filter`][vizro.models.Filter].\n\nArgs:\n type (Literal[\"dropdown\"]): Defaults to `\"dropdown\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[Union[SingleValueType, MultiValueType]]): See\n [`SingleValueType`][vizro.models.types.SingleValueType] and\n [`MultiValueType`][vizro.models.types.MultiValueType]. Defaults to `None`.\n multi (bool): Whether to allow selection of multiple values. Defaults to `True`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "dropdown", + "enum": [ + "dropdown" + ], + "type": "string" + }, + "options": { + "title": "Options", + "default": [], + "anyOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/OptionsDictType" + } + } + ] + }, + "value": { + "title": "Value", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "multi": { + "title": "Multi", + "description": "Whether to allow selection of multiple values", + "default": true, + "type": "boolean" + }, + "title": { + "title": "Title", + "description": "Title to be displayed", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } }, - { - "$ref": "#/definitions/RangeSlider" + "additionalProperties": false + }, + "RadioItems": { + "title": "RadioItems", + "description": "Categorical single-selector `RadioItems` to be provided to `Filter`.\n\nArgs:\n type (Literal[\"radio_items\"]): Defaults to `\"radio_items\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[SingleValueType]): See [`SingleValueType`][vizro.models.types.SingleValueType].\n Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "radio_items", + "enum": [ + "radio_items" + ], + "type": "string" + }, + "options": { + "title": "Options", + "default": [], + "anyOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/OptionsDictType" + } + } + ] + }, + "value": { + "title": "Value", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + } + ] + }, + "title": { + "title": "Title", + "description": "Title to be displayed", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } }, - { - "$ref": "#/definitions/Slider" - } - ] - } - }, - "required": ["column"], - "additionalProperties": false - }, - "Parameter": { - "title": "Parameter", - "description": "Alter the arguments supplied to any `targets` on the [`Page`][vizro.models.Page].\n\nExamples:\n >>> print(repr(Parameter(\n >>> targets=[\"scatter.x\"], selector=Slider(min=0, max=1, default=0.8, title=\"Bubble opacity\"))))\n\nArgs:\n type (Literal[\"parameter\"]): Defaults to `\"parameter\"`.\n targets (List[str]): Targets in the form of `.`.\n selector (SelectorType): See [SelectorType][vizro.models.types.SelectorType]. Converts selector value\n `\"NONE\"` into `None` to allow optional parameters.\n\nRaises:\n ValueError: If targets are invalid and not of the form `.`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "parameter", - "enum": ["parameter"], - "type": "string" - }, - "targets": { - "title": "Targets", - "description": "Targets in the form of `.`.", - "type": "array", - "items": { - "type": "string" - } - }, - "selector": { - "title": "Selector", - "description": "Selectors to be used inside a control.", - "discriminator": { - "propertyName": "type", - "mapping": { - "checklist": "#/definitions/Checklist", - "dropdown": "#/definitions/Dropdown", - "radio_items": "#/definitions/RadioItems", - "range_slider": "#/definitions/RangeSlider", - "slider": "#/definitions/Slider" - } - }, - "oneOf": [ - { - "$ref": "#/definitions/Checklist" + "additionalProperties": false + }, + "RangeSlider": { + "title": "RangeSlider", + "description": "Numeric multi-selector `RangeSlider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.RangeSlider`](https://dash.plotly.com/dash-core-components/rangeslider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `{}`.\n value (Optional[List[float]]): Default start and end value for slider. Must be 2 items. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "range_slider", + "enum": [ + "range_slider" + ], + "type": "string" + }, + "min": { + "title": "Min", + "description": "Start value for slider.", + "type": "number" + }, + "max": { + "title": "Max", + "description": "End value for slider.", + "type": "number" + }, + "step": { + "title": "Step", + "description": "Step-size for marks on slider.", + "type": "number" + }, + "marks": { + "title": "Marks", + "description": "Marks to be displayed on slider.", + "default": {}, + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "title": "Value", + "description": "Default start and end value for slider", + "minItems": 2, + "maxItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "title": { + "title": "Title", + "description": "Title to be displayed.", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } }, - { - "$ref": "#/definitions/Dropdown" + "additionalProperties": false + }, + "Slider": { + "title": "Slider", + "description": "Numeric single-selector `Slider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.Slider`](https://dash.plotly.com/dash-core-components/slider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `{}`.\n value (Optional[float]): Default value for slider. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "slider", + "enum": [ + "slider" + ], + "type": "string" + }, + "min": { + "title": "Min", + "description": "Start value for slider.", + "type": "number" + }, + "max": { + "title": "Max", + "description": "End value for slider.", + "type": "number" + }, + "step": { + "title": "Step", + "description": "Step-size for marks on slider.", + "type": "number" + }, + "marks": { + "title": "Marks", + "description": "Marks to be displayed on slider.", + "default": {}, + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "title": "Value", + "description": "Default value for slider.", + "type": "number" + }, + "title": { + "title": "Title", + "description": "Title to be displayed.", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } }, - { - "$ref": "#/definitions/RadioItems" + "additionalProperties": false + }, + "Filter": { + "title": "Filter", + "description": "Filter the data supplied to `targets` on the [`Page`][vizro.models.Page].\n\nExamples:\n >>> print(repr(Filter(column=\"species\")))\n\nArgs:\n type (Literal[\"filter\"]): Defaults to `\"filter\"`.\n column (str): Column of `DataFrame` to filter.\n targets (List[ModelID]): Target component to be affected by filter. If none are given then target all components\n on the page that use `column`.\n selector (SelectorType): See [SelectorType][vizro.models.types.SelectorType]. Defaults to `None`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "filter", + "enum": [ + "filter" + ], + "type": "string" + }, + "column": { + "title": "Column", + "description": "Column of DataFrame to filter.", + "type": "string" + }, + "targets": { + "title": "Targets", + "description": "Target component to be affected by filter. If none are given then target all components on the page that use `column`.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "selector": { + "title": "Selector", + "description": "Selectors to be used inside a control.", + "discriminator": { + "propertyName": "type", + "mapping": { + "checklist": "#/definitions/Checklist", + "dropdown": "#/definitions/Dropdown", + "radio_items": "#/definitions/RadioItems", + "range_slider": "#/definitions/RangeSlider", + "slider": "#/definitions/Slider" + } + }, + "oneOf": [ + { + "$ref": "#/definitions/Checklist" + }, + { + "$ref": "#/definitions/Dropdown" + }, + { + "$ref": "#/definitions/RadioItems" + }, + { + "$ref": "#/definitions/RangeSlider" + }, + { + "$ref": "#/definitions/Slider" + } + ] + } }, - { - "$ref": "#/definitions/RangeSlider" + "required": [ + "column" + ], + "additionalProperties": false + }, + "Parameter": { + "title": "Parameter", + "description": "Alter the arguments supplied to any `targets` on the [`Page`][vizro.models.Page].\n\nExamples:\n >>> print(repr(Parameter(\n >>> targets=[\"scatter.x\"], selector=Slider(min=0, max=1, default=0.8, title=\"Bubble opacity\"))))\n\nArgs:\n type (Literal[\"parameter\"]): Defaults to `\"parameter\"`.\n targets (List[str]): Targets in the form of `.`.\n selector (SelectorType): See [SelectorType][vizro.models.types.SelectorType]. Converts selector value\n `\"NONE\"` into `None` to allow optional parameters.\n\nRaises:\n ValueError: If targets are invalid and not of the form `.`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "parameter", + "enum": [ + "parameter" + ], + "type": "string" + }, + "targets": { + "title": "Targets", + "description": "Targets in the form of `.`.", + "type": "array", + "items": { + "type": "string" + } + }, + "selector": { + "title": "Selector", + "description": "Selectors to be used inside a control.", + "discriminator": { + "propertyName": "type", + "mapping": { + "checklist": "#/definitions/Checklist", + "dropdown": "#/definitions/Dropdown", + "radio_items": "#/definitions/RadioItems", + "range_slider": "#/definitions/RangeSlider", + "slider": "#/definitions/Slider" + } + }, + "oneOf": [ + { + "$ref": "#/definitions/Checklist" + }, + { + "$ref": "#/definitions/Dropdown" + }, + { + "$ref": "#/definitions/RadioItems" + }, + { + "$ref": "#/definitions/RangeSlider" + }, + { + "$ref": "#/definitions/Slider" + } + ] + } }, - { - "$ref": "#/definitions/Slider" - } - ] - } - }, - "required": ["targets", "selector"], - "additionalProperties": false - }, - "ActionsChain": { - "title": "ActionsChain", - "description": "All models that are registered to the model manager should inherit from this class.\n\nArgs:\n id (str): ID to identify model. Must be unique throughout the whole dashboard. Defaults to `\"\"`.\n When no ID is chosen, ID will be automatically generated.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "trigger": { - "title": "Trigger", - "type": "array", - "items": [ - { - "title": "Component Id", - "type": "string" + "required": [ + "targets", + "selector" + ], + "additionalProperties": false + }, + "ActionsChain": { + "title": "ActionsChain", + "description": "All models that are registered to the model manager should inherit from this class.\n\nArgs:\n id (str): ID to identify model. Must be unique throughout the whole dashboard. Defaults to `\"\"`.\n When no ID is chosen, ID will be automatically generated.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "trigger": { + "title": "Trigger", + "type": "array", + "items": [ + { + "title": "Component Id", + "type": "string" + }, + { + "title": "Component Property", + "type": "string" + } + ], + "minItems": 2, + "maxItems": 2 + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } }, - { - "title": "Component Property", - "type": "string" - } - ], - "minItems": 2, - "maxItems": 2 - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } - }, - "required": ["trigger"], - "additionalProperties": false - }, - "Page": { - "title": "Page", - "description": "A page in [`Dashboard`][vizro.models.Dashboard] with its own URL path and place in the `Navigation`.\n\nArgs:\n components (List[ComponentType]): See [ComponentType][vizro.models.types.ComponentType]. At least one component\n has to be provided.\n title (str): Title to be displayed.\n layout (Layout): Layout to place components in. Defaults to `None`.\n controls (List[ControlType]): See [ControlType][vizro.models.types.ControlType]. Defaults to `[]`.\n path (str): Path to navigate to page. Defaults to `\"\"`.\n\nRaises:\n ValueError: If number of page and grid components is not the same", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "components": { - "title": "Components", - "type": "array", - "items": { - "discriminator": { - "propertyName": "type", - "mapping": { - "button": "#/definitions/Button", - "card": "#/definitions/Card", - "graph": "#/definitions/Graph", - "table": "#/definitions/Table" - } + "required": [ + "trigger" + ], + "additionalProperties": false + }, + "Page": { + "title": "Page", + "description": "A page in [`Dashboard`][vizro.models.Dashboard] with its own URL path and place in the `Navigation`.\n\nArgs:\n components (List[ComponentType]): See [ComponentType][vizro.models.types.ComponentType]. At least one component\n has to be provided.\n title (str): Title to be displayed.\n description (str): Description for meta tags.\n layout (Layout): Layout to place components in. Defaults to `None`.\n controls (List[ControlType]): See [ControlType][vizro.models.types.ControlType]. Defaults to `[]`.\n path (str): Path to navigate to page. Defaults to `\"\"`.\n\nRaises:\n ValueError: If number of page and grid components is not the same", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "components": { + "title": "Components", + "type": "array", + "items": { + "discriminator": { + "propertyName": "type", + "mapping": { + "button": "#/definitions/Button", + "card": "#/definitions/Card", + "graph": "#/definitions/Graph", + "table": "#/definitions/Table" + } + }, + "oneOf": [ + { + "$ref": "#/definitions/Button" + }, + { + "$ref": "#/definitions/Card" + }, + { + "$ref": "#/definitions/Graph" + }, + { + "$ref": "#/definitions/Table" + } + ] + } + }, + "title": { + "title": "Title", + "description": "Title to be displayed.", + "type": "string" + }, + "description": { + "title": "Description", + "description": "Description for meta tags.", + "default": "", + "type": "string" + }, + "layout": { + "$ref": "#/definitions/Layout" + }, + "controls": { + "title": "Controls", + "default": [], + "type": "array", + "items": { + "discriminator": { + "propertyName": "type", + "mapping": { + "filter": "#/definitions/Filter", + "parameter": "#/definitions/Parameter" + } + }, + "oneOf": [ + { + "$ref": "#/definitions/Filter" + }, + { + "$ref": "#/definitions/Parameter" + } + ] + } + }, + "path": { + "title": "Path", + "description": "Path to navigate to page.", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/ActionsChain" + } + } }, - "oneOf": [ - { - "$ref": "#/definitions/Button" - }, - { - "$ref": "#/definitions/Card" - }, - { - "$ref": "#/definitions/Graph" - }, - { - "$ref": "#/definitions/Table" - } - ] - } - }, - "title": { - "title": "Title", - "description": "Title to be displayed.", - "type": "string" - }, - "layout": { - "$ref": "#/definitions/Layout" - }, - "controls": { - "title": "Controls", - "default": [], - "type": "array", - "items": { - "discriminator": { - "propertyName": "type", - "mapping": { - "filter": "#/definitions/Filter", - "parameter": "#/definitions/Parameter" - } + "required": [ + "components", + "title" + ], + "additionalProperties": false + }, + "Accordion": { + "title": "Accordion", + "description": "Accordion to be used as nav_selector in [`Navigation`][vizro.models.Navigation].\n\nArgs:\n type (Literal[\"accordion\"]): Defaults to `\"accordion\"`.\n pages (Dict[str, List[str]]): Mapping from name of a pages group to a list of page IDs. Defaults to `{}`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "accordion", + "enum": [ + "accordion" + ], + "type": "string" + }, + "pages": { + "title": "Pages", + "description": "Mapping from name of a pages group to a list of page IDs.", + "default": {}, + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } }, - "oneOf": [ - { - "$ref": "#/definitions/Filter" - }, - { - "$ref": "#/definitions/Parameter" - } - ] - } - }, - "path": { - "title": "Path", - "description": "Path to navigate to page.", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/ActionsChain" - } - } - }, - "required": ["components", "title"], - "additionalProperties": false - }, - "Accordion": { - "title": "Accordion", - "description": "Accordion to be used as nav_selector in [`Navigation`][vizro.models.Navigation].\n\nArgs:\n type (Literal[\"accordion\"]): Defaults to `\"accordion\"`.\n pages (Dict[str, List[str]]): Mapping from name of a pages group to a list of page IDs. Defaults to `{}`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "accordion", - "enum": ["accordion"], - "type": "string" - }, - "pages": { - "title": "Pages", - "description": "Mapping from name of a pages group to a list of page IDs.", - "default": {}, - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - "NavLink": { - "title": "NavLink", - "description": "Icon to be used in Navigation Bar of Dashboard.\n\nArgs:\n pages (NavPagesType): See [`NavPagesType`][vizro.models.types.NavPagesType]. Defaults to `[]`.\n label (str): Text description of the icon for use in tooltip.\n icon (str): Icon name from [Google Material icons library](https://fonts.google.com/icons). Defaults to `\"\"`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "pages": { - "title": "Pages", - "default": [], - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } + "additionalProperties": false + }, + "NavLink": { + "title": "NavLink", + "description": "Icon to be used in Navigation Bar of Dashboard.\n\nArgs:\n pages (NavPagesType): See [`NavPagesType`][vizro.models.types.NavPagesType]. Defaults to `[]`.\n label (str): Text description of the icon for use in tooltip.\n icon (str): Icon name from [Google Material icons library](https://fonts.google.com/icons). Defaults to `\"\"`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "pages": { + "title": "Pages", + "default": [], + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + ] + }, + "label": { + "title": "Label", + "description": "Text description of the icon for use in tooltip.", + "type": "string" + }, + "icon": { + "title": "Icon", + "description": "Icon name from Google Material icons library.", + "default": "", + "type": "string" + } }, - { - "type": "object", - "additionalProperties": { - "type": "array", + "required": [ + "label" + ], + "additionalProperties": false + }, + "NavBar": { + "title": "NavBar", + "description": "Navigation bar to be used as a nav_selector for `Navigation`.\n\nArgs:\n type (Literal[\"nav_bar\"]): Defaults to `\"nav_bar\"`.\n pages (Dict[str, List[str]]): Mapping from name of a pages group to a list of page IDs. Defaults to `{}`.\n items (List[NavLink]): See [`NavLink`][vizro.models.NavLink]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "nav_bar", + "enum": [ + "nav_bar" + ], + "type": "string" + }, + "pages": { + "title": "Pages", + "description": "Mapping from name of a pages group to a list of page IDs.", + "default": {}, + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, "items": { - "type": "string" + "title": "Items", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/NavLink" + } } - } - } - ] - }, - "label": { - "title": "Label", - "description": "Text description of the icon for use in tooltip.", - "type": "string" - }, - "icon": { - "title": "Icon", - "description": "Icon name from Google Material icons library.", - "default": "", - "type": "string" - } - }, - "required": ["label"], - "additionalProperties": false - }, - "NavBar": { - "title": "NavBar", - "description": "Navigation bar to be used as a nav_selector for `Navigation`.\n\nArgs:\n type (Literal[\"nav_bar\"]): Defaults to `\"nav_bar\"`.\n pages (Dict[str, List[str]]): Mapping from name of a pages group to a list of page IDs. Defaults to `{}`.\n items (List[NavLink]): See [`NavLink`][vizro.models.NavLink]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "nav_bar", - "enum": ["nav_bar"], - "type": "string" - }, - "pages": { - "title": "Pages", - "description": "Mapping from name of a pages group to a list of page IDs.", - "default": {}, - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "items": { - "title": "Items", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/NavLink" - } - } - }, - "additionalProperties": false - }, - "Navigation": { - "title": "Navigation", - "description": "Navigation in [`Dashboard`][vizro.models.Dashboard] to structure [`Pages`][vizro.models.Page].\n\nArgs:\n pages (NavPagesType): See [`NavPagesType`][vizro.models.types.NavPagesType]. Defaults to `[]`.\n nav_selector (NavSelectorType): See [`NavSelectorType`][vizro.models.types.NavSelectorType].\n Defaults to `None`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "pages": { - "title": "Pages", - "default": [], - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } }, - { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" + "additionalProperties": false + }, + "Navigation": { + "title": "Navigation", + "description": "Navigation in [`Dashboard`][vizro.models.Dashboard] to structure [`Pages`][vizro.models.Page].\n\nArgs:\n pages (NavPagesType): See [`NavPagesType`][vizro.models.types.NavPagesType]. Defaults to `[]`.\n nav_selector (NavSelectorType): See [`NavSelectorType`][vizro.models.types.NavSelectorType].\n Defaults to `None`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "pages": { + "title": "Pages", + "default": [], + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + ] + }, + "nav_selector": { + "title": "Nav Selector", + "anyOf": [ + { + "$ref": "#/definitions/Accordion" + }, + { + "$ref": "#/definitions/NavBar" + } + ] } - } - } - ] - }, - "nav_selector": { - "title": "Nav Selector", - "anyOf": [ - { - "$ref": "#/definitions/Accordion" }, - { - "$ref": "#/definitions/NavBar" - } - ] + "additionalProperties": false } - }, - "additionalProperties": false } - } } From 14f4722676ca0beb6522d92999000af6078cbff7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Dec 2023 13:17:15 +0000 Subject: [PATCH 25/29] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- vizro-core/schemas/0.1.8.dev0.json | 2186 ++++++++++++++-------------- 1 file changed, 1068 insertions(+), 1118 deletions(-) diff --git a/vizro-core/schemas/0.1.8.dev0.json b/vizro-core/schemas/0.1.8.dev0.json index 6f27679f0..3e1bab3d3 100644 --- a/vizro-core/schemas/0.1.8.dev0.json +++ b/vizro-core/schemas/0.1.8.dev0.json @@ -1,1156 +1,1106 @@ { - "title": "Dashboard", - "description": "Vizro Dashboard to be used within [`Vizro`][vizro._vizro.Vizro.build].\n\nArgs:\n pages (List[Page]): See [`Page`][vizro.models.Page].\n theme (Literal[\"vizro_dark\", \"vizro_light\"]): Layout theme to be applied across dashboard.\n Defaults to `vizro_dark`.\n navigation (Navigation): See [`Navigation`][vizro.models.Navigation]. Defaults to `None`.\n title (str): Dashboard title to appear on every page on top left-side. Defaults to `\"\"`.", - "type": "object", - "properties": { + "title": "Dashboard", + "description": "Vizro Dashboard to be used within [`Vizro`][vizro._vizro.Vizro.build].\n\nArgs:\n pages (List[Page]): See [`Page`][vizro.models.Page].\n theme (Literal[\"vizro_dark\", \"vizro_light\"]): Layout theme to be applied across dashboard.\n Defaults to `vizro_dark`.\n navigation (Navigation): See [`Navigation`][vizro.models.Navigation]. Defaults to `None`.\n title (str): Dashboard title to appear on every page on top left-side. Defaults to `\"\"`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "pages": { + "title": "Pages", + "type": "array", + "items": { + "$ref": "#/definitions/Page" + } + }, + "theme": { + "title": "Theme", + "description": "Layout theme to be applied across dashboard. Defaults to `vizro_dark`", + "default": "vizro_dark", + "enum": ["vizro_dark", "vizro_light"], + "type": "string" + }, + "navigation": { + "$ref": "#/definitions/Navigation" + }, + "title": { + "title": "Title", + "description": "Dashboard title to appear on every page on top left-side.", + "default": "", + "type": "string" + } + }, + "required": ["pages"], + "additionalProperties": false, + "definitions": { + "Action": { + "title": "Action", + "description": "Action to be inserted into `actions` of relevant component.\n\nArgs:\n function (CapturedCallable): See [`CapturedCallable`][vizro.models.types.CapturedCallable].\n inputs (List[str]): Inputs in the form `.` passed to the action function.\n Defaults to `[]`.\n outputs (List[str]): Outputs in the form `.` changed by the action function.\n Defaults to `[]`.", + "type": "object", + "properties": { "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" }, - "pages": { - "title": "Pages", + "inputs": { + "title": "Inputs", + "description": "Inputs in the form `.` passed to the action function.", + "default": [], + "pattern": "^[^.]+[.][^.]+$", + "type": "array", + "items": { + "type": "string", + "pattern": "^[^.]+[.][^.]+$" + } + }, + "outputs": { + "title": "Outputs", + "description": "Outputs in the form `.` changed by the action function.", + "default": [], + "pattern": "^[^.]+[.][^.]+$", + "type": "array", + "items": { + "type": "string", + "pattern": "^[^.]+[.][^.]+$" + } + } + }, + "additionalProperties": false + }, + "Button": { + "title": "Button", + "description": "Component provided to `Page` to trigger any defined `action` in `Page`.\n\nArgs:\n type (Literal[\"button\"]): Defaults to `\"button\"`.\n text (str): Text to be displayed on button. Defaults to `\"Click me!\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "button", + "enum": ["button"], + "type": "string" + }, + "text": { + "title": "Text", + "description": "Text to be displayed on button.", + "default": "Click me!", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } + }, + "additionalProperties": false + }, + "Card": { + "title": "Card", + "description": "Creates a card utilizing `dcc.Markdown` as title and text component.\n\nArgs:\n type (Literal[\"card\"]): Defaults to `\"card\"`.\n text (str): Markdown string to create card title/text that should adhere to the CommonMark Spec.\n href (str): URL (relative or absolute) to navigate to. If not provided the Card serves as a text card\n only. Defaults to `\"\"`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "card", + "enum": ["card"], + "type": "string" + }, + "text": { + "title": "Text", + "description": "Markdown string to create card title/text that should adhere to the CommonMark Spec.", + "type": "string" + }, + "href": { + "title": "Href", + "description": "URL (relative or absolute) to navigate to. If not provided the Card serves as a text card only.", + "default": "", + "type": "string" + } + }, + "required": ["text"], + "additionalProperties": false + }, + "Graph": { + "title": "Graph", + "description": "Wrapper for `dcc.Graph` to visualize charts in dashboard.\n\nArgs:\n type (Literal[\"graph\"]): Defaults to `\"graph\"`.\n figure (CapturedCallable): See [`CapturedCallable`][vizro.models.types.CapturedCallable].\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "graph", + "enum": ["graph"], + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } + }, + "additionalProperties": false + }, + "Table": { + "title": "Table", + "description": "Wrapper for table components to visualize in dashboard.\n\nArgs:\n type (Literal[\"table\"]): Defaults to `\"table\"`.\n figure (CapturedCallable): Table like object to be displayed. Current choices include:\n [`dash_table.DataTable`](https://dash.plotly.com/datatable).\n title (str): Title of the table. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "table", + "enum": ["table"], + "type": "string" + }, + "title": { + "title": "Title", + "description": "Title of the table", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } + }, + "additionalProperties": false + }, + "Layout": { + "title": "Layout", + "description": "Grid specification to place chart/components on the [`Page`][vizro.models.Page].\n\nArgs:\n grid (List[List[int]]): Grid specification to arrange components on screen.\n row_gap (str): Gap between rows in px. Defaults to `\"12px\"`.\n col_gap (str): Gap between columns in px. Defaults to `\"12px\"`.\n row_min_height (str): Minimum row height in px. Defaults to `\"0px\"`.\n col_min_width (str): Minimum column width in px. Defaults to `\"0px\"`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "grid": { + "title": "Grid", + "description": "Grid specification to arrange components on screen.", + "type": "array", + "items": { "type": "array", "items": { - "$ref": "#/definitions/Page" + "type": "integer" } + } }, - "theme": { - "title": "Theme", - "description": "Layout theme to be applied across dashboard. Defaults to `vizro_dark`", - "default": "vizro_dark", - "enum": [ - "vizro_dark", - "vizro_light" - ], - "type": "string" + "row_gap": { + "title": "Row Gap", + "description": "Gap between rows in px. Defaults to 12px.", + "default": "12px", + "pattern": "[0-9]+px", + "type": "string" + }, + "col_gap": { + "title": "Col Gap", + "description": "Gap between columns in px. Defaults to 12px.", + "default": "12px", + "pattern": "[0-9]+px", + "type": "string" + }, + "row_min_height": { + "title": "Row Min Height", + "description": "Minimum row height in px. Defaults to 0px.", + "default": "0px", + "pattern": "[0-9]+px", + "type": "string" + }, + "col_min_width": { + "title": "Col Min Width", + "description": "Minimum column width in px. Defaults to 0px.", + "default": "0px", + "pattern": "[0-9]+px", + "type": "string" + } + }, + "required": ["grid"], + "additionalProperties": false + }, + "OptionsDictType": { + "title": "OptionsDictType", + "type": "object", + "properties": { + "label": { + "title": "Label", + "type": "string" + }, + "value": { + "title": "Value", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + } + ] + } + }, + "required": ["label", "value"], + "additionalProperties": false + }, + "Checklist": { + "title": "Checklist", + "description": "Categorical multi-selector `Checklist` to be provided to [`Filter`][vizro.models.Filter].\n\nArgs:\n type (Literal[\"checklist\"]): Defaults to `\"checklist\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[MultiValueType]): See [`MultiValueType`][vizro.models.types.MultiValueType]. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "checklist", + "enum": ["checklist"], + "type": "string" + }, + "options": { + "title": "Options", + "default": [], + "anyOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/OptionsDictType" + } + } + ] }, - "navigation": { - "$ref": "#/definitions/Navigation" + "value": { + "title": "Value", + "anyOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, "title": { - "title": "Title", - "description": "Dashboard title to appear on every page on top left-side.", - "default": "", - "type": "string" + "title": "Title", + "description": "Title to be displayed", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } } + }, + "additionalProperties": false }, - "required": [ - "pages" - ], - "additionalProperties": false, - "definitions": { - "Action": { - "title": "Action", - "description": "Action to be inserted into `actions` of relevant component.\n\nArgs:\n function (CapturedCallable): See [`CapturedCallable`][vizro.models.types.CapturedCallable].\n inputs (List[str]): Inputs in the form `.` passed to the action function.\n Defaults to `[]`.\n outputs (List[str]): Outputs in the form `.` changed by the action function.\n Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "inputs": { - "title": "Inputs", - "description": "Inputs in the form `.` passed to the action function.", - "default": [], - "pattern": "^[^.]+[.][^.]+$", - "type": "array", - "items": { - "type": "string", - "pattern": "^[^.]+[.][^.]+$" - } - }, - "outputs": { - "title": "Outputs", - "description": "Outputs in the form `.` changed by the action function.", - "default": [], - "pattern": "^[^.]+[.][^.]+$", - "type": "array", - "items": { - "type": "string", - "pattern": "^[^.]+[.][^.]+$" - } - } + "Dropdown": { + "title": "Dropdown", + "description": "Categorical multi-selector `Dropdown` to be provided to [`Filter`][vizro.models.Filter].\n\nArgs:\n type (Literal[\"dropdown\"]): Defaults to `\"dropdown\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[Union[SingleValueType, MultiValueType]]): See\n [`SingleValueType`][vizro.models.types.SingleValueType] and\n [`MultiValueType`][vizro.models.types.MultiValueType]. Defaults to `None`.\n multi (bool): Whether to allow selection of multiple values. Defaults to `True`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "dropdown", + "enum": ["dropdown"], + "type": "string" + }, + "options": { + "title": "Options", + "default": [], + "anyOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } }, - "additionalProperties": false - }, - "Button": { - "title": "Button", - "description": "Component provided to `Page` to trigger any defined `action` in `Page`.\n\nArgs:\n type (Literal[\"button\"]): Defaults to `\"button\"`.\n text (str): Text to be displayed on button. Defaults to `\"Click me!\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "button", - "enum": [ - "button" - ], - "type": "string" - }, - "text": { - "title": "Text", - "description": "Text to be displayed on button.", - "default": "Click me!", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } + { + "type": "array", + "items": { + "type": "number" + } }, - "additionalProperties": false - }, - "Card": { - "title": "Card", - "description": "Creates a card utilizing `dcc.Markdown` as title and text component.\n\nArgs:\n type (Literal[\"card\"]): Defaults to `\"card\"`.\n text (str): Markdown string to create card title/text that should adhere to the CommonMark Spec.\n href (str): URL (relative or absolute) to navigate to. If not provided the Card serves as a text card\n only. Defaults to `\"\"`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "card", - "enum": [ - "card" - ], - "type": "string" - }, - "text": { - "title": "Text", - "description": "Markdown string to create card title/text that should adhere to the CommonMark Spec.", - "type": "string" - }, - "href": { - "title": "Href", - "description": "URL (relative or absolute) to navigate to. If not provided the Card serves as a text card only.", - "default": "", - "type": "string" - } + { + "type": "array", + "items": { + "type": "string" + } }, - "required": [ - "text" - ], - "additionalProperties": false - }, - "Graph": { - "title": "Graph", - "description": "Wrapper for `dcc.Graph` to visualize charts in dashboard.\n\nArgs:\n type (Literal[\"graph\"]): Defaults to `\"graph\"`.\n figure (CapturedCallable): See [`CapturedCallable`][vizro.models.types.CapturedCallable].\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "graph", - "enum": [ - "graph" - ], - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } + { + "type": "array", + "items": { + "$ref": "#/definitions/OptionsDictType" + } + } + ] + }, + "value": { + "title": "Value", + "anyOf": [ + { + "type": "boolean" }, - "additionalProperties": false - }, - "Table": { - "title": "Table", - "description": "Wrapper for table components to visualize in dashboard.\n\nArgs:\n type (Literal[\"table\"]): Defaults to `\"table\"`.\n figure (CapturedCallable): Table like object to be displayed. Current choices include:\n [`dash_table.DataTable`](https://dash.plotly.com/datatable).\n title (str): Title of the table. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "table", - "enum": [ - "table" - ], - "type": "string" - }, - "title": { - "title": "Title", - "description": "Title of the table", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } + { + "type": "number" }, - "additionalProperties": false - }, - "Layout": { - "title": "Layout", - "description": "Grid specification to place chart/components on the [`Page`][vizro.models.Page].\n\nArgs:\n grid (List[List[int]]): Grid specification to arrange components on screen.\n row_gap (str): Gap between rows in px. Defaults to `\"12px\"`.\n col_gap (str): Gap between columns in px. Defaults to `\"12px\"`.\n row_min_height (str): Minimum row height in px. Defaults to `\"0px\"`.\n col_min_width (str): Minimum column width in px. Defaults to `\"0px\"`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "grid": { - "title": "Grid", - "description": "Grid specification to arrange components on screen.", - "type": "array", - "items": { - "type": "array", - "items": { - "type": "integer" - } - } - }, - "row_gap": { - "title": "Row Gap", - "description": "Gap between rows in px. Defaults to 12px.", - "default": "12px", - "pattern": "[0-9]+px", - "type": "string" - }, - "col_gap": { - "title": "Col Gap", - "description": "Gap between columns in px. Defaults to 12px.", - "default": "12px", - "pattern": "[0-9]+px", - "type": "string" - }, - "row_min_height": { - "title": "Row Min Height", - "description": "Minimum row height in px. Defaults to 0px.", - "default": "0px", - "pattern": "[0-9]+px", - "type": "string" - }, - "col_min_width": { - "title": "Col Min Width", - "description": "Minimum column width in px. Defaults to 0px.", - "default": "0px", - "pattern": "[0-9]+px", - "type": "string" - } + { + "type": "string" }, - "required": [ - "grid" - ], - "additionalProperties": false - }, - "OptionsDictType": { - "title": "OptionsDictType", - "type": "object", - "properties": { - "label": { - "title": "Label", - "type": "string" - }, - "value": { - "title": "Value", - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - } - ] - } + { + "type": "array", + "items": { + "type": "boolean" + } }, - "required": [ - "label", - "value" - ], - "additionalProperties": false - }, - "Checklist": { - "title": "Checklist", - "description": "Categorical multi-selector `Checklist` to be provided to [`Filter`][vizro.models.Filter].\n\nArgs:\n type (Literal[\"checklist\"]): Defaults to `\"checklist\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[MultiValueType]): See [`MultiValueType`][vizro.models.types.MultiValueType]. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "checklist", - "enum": [ - "checklist" - ], - "type": "string" - }, - "options": { - "title": "Options", - "default": [], - "anyOf": [ - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/OptionsDictType" - } - } - ] - }, - "value": { - "title": "Value", - "anyOf": [ - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "title": { - "title": "Title", - "description": "Title to be displayed", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } + { + "type": "array", + "items": { + "type": "number" + } }, - "additionalProperties": false - }, - "Dropdown": { - "title": "Dropdown", - "description": "Categorical multi-selector `Dropdown` to be provided to [`Filter`][vizro.models.Filter].\n\nArgs:\n type (Literal[\"dropdown\"]): Defaults to `\"dropdown\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[Union[SingleValueType, MultiValueType]]): See\n [`SingleValueType`][vizro.models.types.SingleValueType] and\n [`MultiValueType`][vizro.models.types.MultiValueType]. Defaults to `None`.\n multi (bool): Whether to allow selection of multiple values. Defaults to `True`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "dropdown", - "enum": [ - "dropdown" - ], - "type": "string" - }, - "options": { - "title": "Options", - "default": [], - "anyOf": [ - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/OptionsDictType" - } - } - ] - }, - "value": { - "title": "Value", - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "multi": { - "title": "Multi", - "description": "Whether to allow selection of multiple values", - "default": true, - "type": "boolean" - }, - "title": { - "title": "Title", - "description": "Title to be displayed", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "multi": { + "title": "Multi", + "description": "Whether to allow selection of multiple values", + "default": true, + "type": "boolean" + }, + "title": { + "title": "Title", + "description": "Title to be displayed", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } + }, + "additionalProperties": false + }, + "RadioItems": { + "title": "RadioItems", + "description": "Categorical single-selector `RadioItems` to be provided to `Filter`.\n\nArgs:\n type (Literal[\"radio_items\"]): Defaults to `\"radio_items\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[SingleValueType]): See [`SingleValueType`][vizro.models.types.SingleValueType].\n Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "radio_items", + "enum": ["radio_items"], + "type": "string" + }, + "options": { + "title": "Options", + "default": [], + "anyOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } }, - "additionalProperties": false - }, - "RadioItems": { - "title": "RadioItems", - "description": "Categorical single-selector `RadioItems` to be provided to `Filter`.\n\nArgs:\n type (Literal[\"radio_items\"]): Defaults to `\"radio_items\"`.\n options (OptionsType): See [`OptionsType`][vizro.models.types.OptionsType]. Defaults to `[]`.\n value (Optional[SingleValueType]): See [`SingleValueType`][vizro.models.types.SingleValueType].\n Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "radio_items", - "enum": [ - "radio_items" - ], - "type": "string" - }, - "options": { - "title": "Options", - "default": [], - "anyOf": [ - { - "type": "array", - "items": { - "type": "boolean" - } - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/OptionsDictType" - } - } - ] - }, - "value": { - "title": "Value", - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - } - ] - }, - "title": { - "title": "Title", - "description": "Title to be displayed", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } + { + "type": "array", + "items": { + "type": "number" + } }, - "additionalProperties": false - }, - "RangeSlider": { - "title": "RangeSlider", - "description": "Numeric multi-selector `RangeSlider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.RangeSlider`](https://dash.plotly.com/dash-core-components/rangeslider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `{}`.\n value (Optional[List[float]]): Default start and end value for slider. Must be 2 items. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "range_slider", - "enum": [ - "range_slider" - ], - "type": "string" - }, - "min": { - "title": "Min", - "description": "Start value for slider.", - "type": "number" - }, - "max": { - "title": "Max", - "description": "End value for slider.", - "type": "number" - }, - "step": { - "title": "Step", - "description": "Step-size for marks on slider.", - "type": "number" - }, - "marks": { - "title": "Marks", - "description": "Marks to be displayed on slider.", - "default": {}, - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "value": { - "title": "Value", - "description": "Default start and end value for slider", - "minItems": 2, - "maxItems": 2, - "type": "array", - "items": { - "type": "number" - } - }, - "title": { - "title": "Title", - "description": "Title to be displayed.", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } + { + "type": "array", + "items": { + "type": "string" + } }, - "additionalProperties": false - }, - "Slider": { - "title": "Slider", - "description": "Numeric single-selector `Slider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.Slider`](https://dash.plotly.com/dash-core-components/slider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `{}`.\n value (Optional[float]): Default value for slider. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "slider", - "enum": [ - "slider" - ], - "type": "string" - }, - "min": { - "title": "Min", - "description": "Start value for slider.", - "type": "number" - }, - "max": { - "title": "Max", - "description": "End value for slider.", - "type": "number" - }, - "step": { - "title": "Step", - "description": "Step-size for marks on slider.", - "type": "number" - }, - "marks": { - "title": "Marks", - "description": "Marks to be displayed on slider.", - "default": {}, - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "value": { - "title": "Value", - "description": "Default value for slider.", - "type": "number" - }, - "title": { - "title": "Title", - "description": "Title to be displayed.", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } + { + "type": "array", + "items": { + "$ref": "#/definitions/OptionsDictType" + } + } + ] + }, + "value": { + "title": "Value", + "anyOf": [ + { + "type": "boolean" }, - "additionalProperties": false - }, - "Filter": { - "title": "Filter", - "description": "Filter the data supplied to `targets` on the [`Page`][vizro.models.Page].\n\nExamples:\n >>> print(repr(Filter(column=\"species\")))\n\nArgs:\n type (Literal[\"filter\"]): Defaults to `\"filter\"`.\n column (str): Column of `DataFrame` to filter.\n targets (List[ModelID]): Target component to be affected by filter. If none are given then target all components\n on the page that use `column`.\n selector (SelectorType): See [SelectorType][vizro.models.types.SelectorType]. Defaults to `None`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "filter", - "enum": [ - "filter" - ], - "type": "string" - }, - "column": { - "title": "Column", - "description": "Column of DataFrame to filter.", - "type": "string" - }, - "targets": { - "title": "Targets", - "description": "Target component to be affected by filter. If none are given then target all components on the page that use `column`.", - "default": [], - "type": "array", - "items": { - "type": "string" - } - }, - "selector": { - "title": "Selector", - "description": "Selectors to be used inside a control.", - "discriminator": { - "propertyName": "type", - "mapping": { - "checklist": "#/definitions/Checklist", - "dropdown": "#/definitions/Dropdown", - "radio_items": "#/definitions/RadioItems", - "range_slider": "#/definitions/RangeSlider", - "slider": "#/definitions/Slider" - } - }, - "oneOf": [ - { - "$ref": "#/definitions/Checklist" - }, - { - "$ref": "#/definitions/Dropdown" - }, - { - "$ref": "#/definitions/RadioItems" - }, - { - "$ref": "#/definitions/RangeSlider" - }, - { - "$ref": "#/definitions/Slider" - } - ] - } + { + "type": "number" }, - "required": [ - "column" - ], - "additionalProperties": false - }, - "Parameter": { - "title": "Parameter", - "description": "Alter the arguments supplied to any `targets` on the [`Page`][vizro.models.Page].\n\nExamples:\n >>> print(repr(Parameter(\n >>> targets=[\"scatter.x\"], selector=Slider(min=0, max=1, default=0.8, title=\"Bubble opacity\"))))\n\nArgs:\n type (Literal[\"parameter\"]): Defaults to `\"parameter\"`.\n targets (List[str]): Targets in the form of `.`.\n selector (SelectorType): See [SelectorType][vizro.models.types.SelectorType]. Converts selector value\n `\"NONE\"` into `None` to allow optional parameters.\n\nRaises:\n ValueError: If targets are invalid and not of the form `.`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "parameter", - "enum": [ - "parameter" - ], - "type": "string" - }, - "targets": { - "title": "Targets", - "description": "Targets in the form of `.`.", - "type": "array", - "items": { - "type": "string" - } - }, - "selector": { - "title": "Selector", - "description": "Selectors to be used inside a control.", - "discriminator": { - "propertyName": "type", - "mapping": { - "checklist": "#/definitions/Checklist", - "dropdown": "#/definitions/Dropdown", - "radio_items": "#/definitions/RadioItems", - "range_slider": "#/definitions/RangeSlider", - "slider": "#/definitions/Slider" - } - }, - "oneOf": [ - { - "$ref": "#/definitions/Checklist" - }, - { - "$ref": "#/definitions/Dropdown" - }, - { - "$ref": "#/definitions/RadioItems" - }, - { - "$ref": "#/definitions/RangeSlider" - }, - { - "$ref": "#/definitions/Slider" - } - ] - } + { + "type": "string" + } + ] + }, + "title": { + "title": "Title", + "description": "Title to be displayed", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } + }, + "additionalProperties": false + }, + "RangeSlider": { + "title": "RangeSlider", + "description": "Numeric multi-selector `RangeSlider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.RangeSlider`](https://dash.plotly.com/dash-core-components/rangeslider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `{}`.\n value (Optional[List[float]]): Default start and end value for slider. Must be 2 items. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "range_slider", + "enum": ["range_slider"], + "type": "string" + }, + "min": { + "title": "Min", + "description": "Start value for slider.", + "type": "number" + }, + "max": { + "title": "Max", + "description": "End value for slider.", + "type": "number" + }, + "step": { + "title": "Step", + "description": "Step-size for marks on slider.", + "type": "number" + }, + "marks": { + "title": "Marks", + "description": "Marks to be displayed on slider.", + "default": {}, + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "title": "Value", + "description": "Default start and end value for slider", + "minItems": 2, + "maxItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "title": { + "title": "Title", + "description": "Title to be displayed.", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } + }, + "additionalProperties": false + }, + "Slider": { + "title": "Slider", + "description": "Numeric single-selector `Slider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.Slider`](https://dash.plotly.com/dash-core-components/slider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `{}`.\n value (Optional[float]): Default value for slider. Defaults to `None`.\n title (str): Title to be displayed. Defaults to `\"\"`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "slider", + "enum": ["slider"], + "type": "string" + }, + "min": { + "title": "Min", + "description": "Start value for slider.", + "type": "number" + }, + "max": { + "title": "Max", + "description": "End value for slider.", + "type": "number" + }, + "step": { + "title": "Step", + "description": "Step-size for marks on slider.", + "type": "number" + }, + "marks": { + "title": "Marks", + "description": "Marks to be displayed on slider.", + "default": {}, + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "value": { + "title": "Value", + "description": "Default value for slider.", + "type": "number" + }, + "title": { + "title": "Title", + "description": "Title to be displayed.", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } + }, + "additionalProperties": false + }, + "Filter": { + "title": "Filter", + "description": "Filter the data supplied to `targets` on the [`Page`][vizro.models.Page].\n\nExamples:\n >>> print(repr(Filter(column=\"species\")))\n\nArgs:\n type (Literal[\"filter\"]): Defaults to `\"filter\"`.\n column (str): Column of `DataFrame` to filter.\n targets (List[ModelID]): Target component to be affected by filter. If none are given then target all components\n on the page that use `column`.\n selector (SelectorType): See [SelectorType][vizro.models.types.SelectorType]. Defaults to `None`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "filter", + "enum": ["filter"], + "type": "string" + }, + "column": { + "title": "Column", + "description": "Column of DataFrame to filter.", + "type": "string" + }, + "targets": { + "title": "Targets", + "description": "Target component to be affected by filter. If none are given then target all components on the page that use `column`.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "selector": { + "title": "Selector", + "description": "Selectors to be used inside a control.", + "discriminator": { + "propertyName": "type", + "mapping": { + "checklist": "#/definitions/Checklist", + "dropdown": "#/definitions/Dropdown", + "radio_items": "#/definitions/RadioItems", + "range_slider": "#/definitions/RangeSlider", + "slider": "#/definitions/Slider" + } + }, + "oneOf": [ + { + "$ref": "#/definitions/Checklist" }, - "required": [ - "targets", - "selector" - ], - "additionalProperties": false - }, - "ActionsChain": { - "title": "ActionsChain", - "description": "All models that are registered to the model manager should inherit from this class.\n\nArgs:\n id (str): ID to identify model. Must be unique throughout the whole dashboard. Defaults to `\"\"`.\n When no ID is chosen, ID will be automatically generated.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "trigger": { - "title": "Trigger", - "type": "array", - "items": [ - { - "title": "Component Id", - "type": "string" - }, - { - "title": "Component Property", - "type": "string" - } - ], - "minItems": 2, - "maxItems": 2 - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/Action" - } - } + { + "$ref": "#/definitions/Dropdown" }, - "required": [ - "trigger" - ], - "additionalProperties": false - }, - "Page": { - "title": "Page", - "description": "A page in [`Dashboard`][vizro.models.Dashboard] with its own URL path and place in the `Navigation`.\n\nArgs:\n components (List[ComponentType]): See [ComponentType][vizro.models.types.ComponentType]. At least one component\n has to be provided.\n title (str): Title to be displayed.\n description (str): Description for meta tags.\n layout (Layout): Layout to place components in. Defaults to `None`.\n controls (List[ControlType]): See [ControlType][vizro.models.types.ControlType]. Defaults to `[]`.\n path (str): Path to navigate to page. Defaults to `\"\"`.\n\nRaises:\n ValueError: If number of page and grid components is not the same", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "components": { - "title": "Components", - "type": "array", - "items": { - "discriminator": { - "propertyName": "type", - "mapping": { - "button": "#/definitions/Button", - "card": "#/definitions/Card", - "graph": "#/definitions/Graph", - "table": "#/definitions/Table" - } - }, - "oneOf": [ - { - "$ref": "#/definitions/Button" - }, - { - "$ref": "#/definitions/Card" - }, - { - "$ref": "#/definitions/Graph" - }, - { - "$ref": "#/definitions/Table" - } - ] - } - }, - "title": { - "title": "Title", - "description": "Title to be displayed.", - "type": "string" - }, - "description": { - "title": "Description", - "description": "Description for meta tags.", - "default": "", - "type": "string" - }, - "layout": { - "$ref": "#/definitions/Layout" - }, - "controls": { - "title": "Controls", - "default": [], - "type": "array", - "items": { - "discriminator": { - "propertyName": "type", - "mapping": { - "filter": "#/definitions/Filter", - "parameter": "#/definitions/Parameter" - } - }, - "oneOf": [ - { - "$ref": "#/definitions/Filter" - }, - { - "$ref": "#/definitions/Parameter" - } - ] - } - }, - "path": { - "title": "Path", - "description": "Path to navigate to page.", - "default": "", - "type": "string" - }, - "actions": { - "title": "Actions", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/ActionsChain" - } - } + { + "$ref": "#/definitions/RadioItems" }, - "required": [ - "components", - "title" - ], - "additionalProperties": false - }, - "Accordion": { - "title": "Accordion", - "description": "Accordion to be used as nav_selector in [`Navigation`][vizro.models.Navigation].\n\nArgs:\n type (Literal[\"accordion\"]): Defaults to `\"accordion\"`.\n pages (Dict[str, List[str]]): Mapping from name of a pages group to a list of page IDs. Defaults to `{}`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "accordion", - "enum": [ - "accordion" - ], - "type": "string" - }, - "pages": { - "title": "Pages", - "description": "Mapping from name of a pages group to a list of page IDs.", - "default": {}, - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - } + { + "$ref": "#/definitions/RangeSlider" }, - "additionalProperties": false - }, - "NavLink": { - "title": "NavLink", - "description": "Icon to be used in Navigation Bar of Dashboard.\n\nArgs:\n pages (NavPagesType): See [`NavPagesType`][vizro.models.types.NavPagesType]. Defaults to `[]`.\n label (str): Text description of the icon for use in tooltip.\n icon (str): Icon name from [Google Material icons library](https://fonts.google.com/icons). Defaults to `\"\"`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "pages": { - "title": "Pages", - "default": [], - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - } - ] - }, - "label": { - "title": "Label", - "description": "Text description of the icon for use in tooltip.", - "type": "string" - }, - "icon": { - "title": "Icon", - "description": "Icon name from Google Material icons library.", - "default": "", - "type": "string" - } + { + "$ref": "#/definitions/Slider" + } + ] + } + }, + "required": ["column"], + "additionalProperties": false + }, + "Parameter": { + "title": "Parameter", + "description": "Alter the arguments supplied to any `targets` on the [`Page`][vizro.models.Page].\n\nExamples:\n >>> print(repr(Parameter(\n >>> targets=[\"scatter.x\"], selector=Slider(min=0, max=1, default=0.8, title=\"Bubble opacity\"))))\n\nArgs:\n type (Literal[\"parameter\"]): Defaults to `\"parameter\"`.\n targets (List[str]): Targets in the form of `.`.\n selector (SelectorType): See [SelectorType][vizro.models.types.SelectorType]. Converts selector value\n `\"NONE\"` into `None` to allow optional parameters.\n\nRaises:\n ValueError: If targets are invalid and not of the form `.`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "parameter", + "enum": ["parameter"], + "type": "string" + }, + "targets": { + "title": "Targets", + "description": "Targets in the form of `.`.", + "type": "array", + "items": { + "type": "string" + } + }, + "selector": { + "title": "Selector", + "description": "Selectors to be used inside a control.", + "discriminator": { + "propertyName": "type", + "mapping": { + "checklist": "#/definitions/Checklist", + "dropdown": "#/definitions/Dropdown", + "radio_items": "#/definitions/RadioItems", + "range_slider": "#/definitions/RangeSlider", + "slider": "#/definitions/Slider" + } + }, + "oneOf": [ + { + "$ref": "#/definitions/Checklist" + }, + { + "$ref": "#/definitions/Dropdown" + }, + { + "$ref": "#/definitions/RadioItems" + }, + { + "$ref": "#/definitions/RangeSlider" + }, + { + "$ref": "#/definitions/Slider" + } + ] + } + }, + "required": ["targets", "selector"], + "additionalProperties": false + }, + "ActionsChain": { + "title": "ActionsChain", + "description": "All models that are registered to the model manager should inherit from this class.\n\nArgs:\n id (str): ID to identify model. Must be unique throughout the whole dashboard. Defaults to `\"\"`.\n When no ID is chosen, ID will be automatically generated.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "trigger": { + "title": "Trigger", + "type": "array", + "items": [ + { + "title": "Component Id", + "type": "string" + }, + { + "title": "Component Property", + "type": "string" + } + ], + "minItems": 2, + "maxItems": 2 + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } + }, + "required": ["trigger"], + "additionalProperties": false + }, + "Page": { + "title": "Page", + "description": "A page in [`Dashboard`][vizro.models.Dashboard] with its own URL path and place in the `Navigation`.\n\nArgs:\n components (List[ComponentType]): See [ComponentType][vizro.models.types.ComponentType]. At least one component\n has to be provided.\n title (str): Title to be displayed.\n description (str): Description for meta tags.\n layout (Layout): Layout to place components in. Defaults to `None`.\n controls (List[ControlType]): See [ControlType][vizro.models.types.ControlType]. Defaults to `[]`.\n path (str): Path to navigate to page. Defaults to `\"\"`.\n\nRaises:\n ValueError: If number of page and grid components is not the same", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "components": { + "title": "Components", + "type": "array", + "items": { + "discriminator": { + "propertyName": "type", + "mapping": { + "button": "#/definitions/Button", + "card": "#/definitions/Card", + "graph": "#/definitions/Graph", + "table": "#/definitions/Table" + } }, - "required": [ - "label" - ], - "additionalProperties": false - }, - "NavBar": { - "title": "NavBar", - "description": "Navigation bar to be used as a nav_selector for `Navigation`.\n\nArgs:\n type (Literal[\"nav_bar\"]): Defaults to `\"nav_bar\"`.\n pages (Dict[str, List[str]]): Mapping from name of a pages group to a list of page IDs. Defaults to `{}`.\n items (List[NavLink]): See [`NavLink`][vizro.models.NavLink]. Defaults to `[]`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "type": { - "title": "Type", - "default": "nav_bar", - "enum": [ - "nav_bar" - ], - "type": "string" - }, - "pages": { - "title": "Pages", - "description": "Mapping from name of a pages group to a list of page IDs.", - "default": {}, - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - }, + "oneOf": [ + { + "$ref": "#/definitions/Button" + }, + { + "$ref": "#/definitions/Card" + }, + { + "$ref": "#/definitions/Graph" + }, + { + "$ref": "#/definitions/Table" + } + ] + } + }, + "title": { + "title": "Title", + "description": "Title to be displayed.", + "type": "string" + }, + "description": { + "title": "Description", + "description": "Description for meta tags.", + "default": "", + "type": "string" + }, + "layout": { + "$ref": "#/definitions/Layout" + }, + "controls": { + "title": "Controls", + "default": [], + "type": "array", + "items": { + "discriminator": { + "propertyName": "type", + "mapping": { + "filter": "#/definitions/Filter", + "parameter": "#/definitions/Parameter" + } + }, + "oneOf": [ + { + "$ref": "#/definitions/Filter" + }, + { + "$ref": "#/definitions/Parameter" + } + ] + } + }, + "path": { + "title": "Path", + "description": "Path to navigate to page.", + "default": "", + "type": "string" + }, + "actions": { + "title": "Actions", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/ActionsChain" + } + } + }, + "required": ["components", "title"], + "additionalProperties": false + }, + "Accordion": { + "title": "Accordion", + "description": "Accordion to be used as nav_selector in [`Navigation`][vizro.models.Navigation].\n\nArgs:\n type (Literal[\"accordion\"]): Defaults to `\"accordion\"`.\n pages (Dict[str, List[str]]): Mapping from name of a pages group to a list of page IDs. Defaults to `{}`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "accordion", + "enum": ["accordion"], + "type": "string" + }, + "pages": { + "title": "Pages", + "description": "Mapping from name of a pages group to a list of page IDs.", + "default": {}, + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + "NavLink": { + "title": "NavLink", + "description": "Icon to be used in Navigation Bar of Dashboard.\n\nArgs:\n pages (NavPagesType): See [`NavPagesType`][vizro.models.types.NavPagesType]. Defaults to `[]`.\n label (str): Text description of the icon for use in tooltip.\n icon (str): Icon name from [Google Material icons library](https://fonts.google.com/icons). Defaults to `\"\"`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "pages": { + "title": "Pages", + "default": [], + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "object", + "additionalProperties": { + "type": "array", "items": { - "title": "Items", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/NavLink" - } + "type": "string" } + } + } + ] + }, + "label": { + "title": "Label", + "description": "Text description of the icon for use in tooltip.", + "type": "string" + }, + "icon": { + "title": "Icon", + "description": "Icon name from Google Material icons library.", + "default": "", + "type": "string" + } + }, + "required": ["label"], + "additionalProperties": false + }, + "NavBar": { + "title": "NavBar", + "description": "Navigation bar to be used as a nav_selector for `Navigation`.\n\nArgs:\n type (Literal[\"nav_bar\"]): Defaults to `\"nav_bar\"`.\n pages (Dict[str, List[str]]): Mapping from name of a pages group to a list of page IDs. Defaults to `{}`.\n items (List[NavLink]): See [`NavLink`][vizro.models.NavLink]. Defaults to `[]`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "type": { + "title": "Type", + "default": "nav_bar", + "enum": ["nav_bar"], + "type": "string" + }, + "pages": { + "title": "Pages", + "description": "Mapping from name of a pages group to a list of page IDs.", + "default": {}, + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "items": { + "title": "Items", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/NavLink" + } + } + }, + "additionalProperties": false + }, + "Navigation": { + "title": "Navigation", + "description": "Navigation in [`Dashboard`][vizro.models.Dashboard] to structure [`Pages`][vizro.models.Page].\n\nArgs:\n pages (NavPagesType): See [`NavPagesType`][vizro.models.types.NavPagesType]. Defaults to `[]`.\n nav_selector (NavSelectorType): See [`NavSelectorType`][vizro.models.types.NavSelectorType].\n Defaults to `None`.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", + "default": "", + "type": "string" + }, + "pages": { + "title": "Pages", + "default": [], + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } }, - "additionalProperties": false - }, - "Navigation": { - "title": "Navigation", - "description": "Navigation in [`Dashboard`][vizro.models.Dashboard] to structure [`Pages`][vizro.models.Page].\n\nArgs:\n pages (NavPagesType): See [`NavPagesType`][vizro.models.types.NavPagesType]. Defaults to `[]`.\n nav_selector (NavSelectorType): See [`NavSelectorType`][vizro.models.types.NavSelectorType].\n Defaults to `None`.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "ID to identify model. Must be unique throughout the whole dashboard.When no ID is chosen, ID will be automatically generated.", - "default": "", - "type": "string" - }, - "pages": { - "title": "Pages", - "default": [], - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - } - ] - }, - "nav_selector": { - "title": "Nav Selector", - "anyOf": [ - { - "$ref": "#/definitions/Accordion" - }, - { - "$ref": "#/definitions/NavBar" - } - ] + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" } + } + } + ] + }, + "nav_selector": { + "title": "Nav Selector", + "anyOf": [ + { + "$ref": "#/definitions/Accordion" }, - "additionalProperties": false + { + "$ref": "#/definitions/NavBar" + } + ] } + }, + "additionalProperties": false } + } } From 4e95ecf322735f97d724e5f73f79242d47d82ed0 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Thu, 21 Dec 2023 06:02:35 -0800 Subject: [PATCH 26/29] Added changelog --- ...20231221_052426_amward_update_meta_tags.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 vizro-core/changelog.d/20231221_052426_amward_update_meta_tags.md diff --git a/vizro-core/changelog.d/20231221_052426_amward_update_meta_tags.md b/vizro-core/changelog.d/20231221_052426_amward_update_meta_tags.md new file mode 100644 index 000000000..51925c8bb --- /dev/null +++ b/vizro-core/changelog.d/20231221_052426_amward_update_meta_tags.md @@ -0,0 +1,49 @@ + + + + + +### Added + +- Enabled adding description and image to the meta tags. ([#185](https://github.com/mckinsey/vizro/pull/185)) + +https://github.com/mckinsey/vizro/issues/176 + + + + + From a5a35e4ebd6bd8ce80157c4c25a319403d458220 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Thu, 21 Dec 2023 06:03:19 -0800 Subject: [PATCH 27/29] Fixed changelog --- .../changelog.d/20231221_052426_amward_update_meta_tags.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/vizro-core/changelog.d/20231221_052426_amward_update_meta_tags.md b/vizro-core/changelog.d/20231221_052426_amward_update_meta_tags.md index 51925c8bb..b993faa58 100644 --- a/vizro-core/changelog.d/20231221_052426_amward_update_meta_tags.md +++ b/vizro-core/changelog.d/20231221_052426_amward_update_meta_tags.md @@ -21,8 +21,6 @@ Uncomment the section that is right (remove the HTML comment wrapper). - Enabled adding description and image to the meta tags. ([#185](https://github.com/mckinsey/vizro/pull/185)) -https://github.com/mckinsey/vizro/issues/176 -