From 846a4fdbb3fe0e65aa68c7c5bc46f82fe220801b Mon Sep 17 00:00:00 2001 From: huong-li-nguyen Date: Mon, 15 Jul 2024 18:23:27 +0200 Subject: [PATCH] Lint --- vizro-core/examples/chart-gallery/app.py | 2 +- vizro-core/examples/chart-gallery/utils/_pages.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/vizro-core/examples/chart-gallery/app.py b/vizro-core/examples/chart-gallery/app.py index 0339173d8..114ebea5f 100644 --- a/vizro-core/examples/chart-gallery/app.py +++ b/vizro-core/examples/chart-gallery/app.py @@ -46,7 +46,7 @@ butterfly_page, distribution_butterfly, choropleth, - sankey, + sankey_page, ], navigation=vm.Navigation( nav_selector=vm.NavBar( diff --git a/vizro-core/examples/chart-gallery/utils/_pages.py b/vizro-core/examples/chart-gallery/utils/_pages.py index fcacb07e1..c4abd242d 100644 --- a/vizro-core/examples/chart-gallery/utils/_pages.py +++ b/vizro-core/examples/chart-gallery/utils/_pages.py @@ -1,6 +1,7 @@ """Contains custom components and charts used inside the dashboard.""" import json +from typing import List from urllib.request import urlopen import pandas as pd @@ -73,20 +74,20 @@ def butterfly(data_frame: pd.DataFrame, x1: str, x2: str, y: str): @capture("graph") -def sankey(data_frame: pd.DataFrame, source: str, target: str, value: str): +def sankey(data_frame: pd.DataFrame, source: str, target: str, value: str, labels: List[str]): fig = go.Figure( data=[ go.Sankey( node=dict( pad=16, thickness=16, - # label=labels, + label=labels, ), link=dict( source=data_frame[source], target=data_frame[target], value=data_frame[value], - # label=labels, + abel=labels, color="rgba(205, 209, 228, 0.4)", ), ) @@ -838,7 +839,7 @@ def butterfly(data_frame: pd.DataFrame, x1: str, x2: str, y: str): ) -sankey = vm.Page( +sankey_page = vm.Page( title="Sankey", layout=vm.Layout(grid=PAGE_GRID), components=[