From 3f7da3935db735a4044f2b85fa7c69e9d977d332 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:26:12 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../visual-vocabulary/pages/examples/sparkline.py | 8 ++++---- .../examples/visual-vocabulary/pages/time.py | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/vizro-core/examples/visual-vocabulary/pages/examples/sparkline.py b/vizro-core/examples/visual-vocabulary/pages/examples/sparkline.py index 1368f8bc4..7262b984c 100644 --- a/vizro-core/examples/visual-vocabulary/pages/examples/sparkline.py +++ b/vizro-core/examples/visual-vocabulary/pages/examples/sparkline.py @@ -1,10 +1,9 @@ -import pandas as pd import plotly.express as px -import plotly.graph_objects as go from vizro.models.types import capture stocks = px.data.stocks() -stocks_melt = stocks.melt(id_vars='date', value_vars=['GOOG', 'AMZN', "AAPL"], var_name='stock', value_name='value') +stocks_melt = stocks.melt(id_vars="date", value_vars=["GOOG", "AMZN", "AAPL"], var_name="stock", value_name="value") + @capture("graph") def sparkline(data_frame, **kwargs): @@ -14,4 +13,5 @@ def sparkline(data_frame, **kwargs): fig.update_layout(showlegend=False) return fig -fig = sparkline(stocks_melt, x="date", y='value', facet_row="stock", color="stock") + +fig = sparkline(stocks_melt, x="date", y="value", facet_row="stock", color="stock") diff --git a/vizro-core/examples/visual-vocabulary/pages/time.py b/vizro-core/examples/visual-vocabulary/pages/time.py index ef8b343f9..de6683be0 100644 --- a/vizro-core/examples/visual-vocabulary/pages/time.py +++ b/vizro-core/examples/visual-vocabulary/pages/time.py @@ -7,7 +7,7 @@ PAGE_GRID, make_code_clipboard_from_py_file, ) -from pages.examples import area, gantt, heatmap, line, stepped_line, time_column, sparkline +from pages.examples import area, gantt, heatmap, line, sparkline, stepped_line, time_column line_page = vm.Page( title="Line", @@ -251,7 +251,7 @@ text=""" #### What is a sparkline chart? - A sparkline chart is a compact line or area chart that displays multiple time series over a continuous + A sparkline chart is a compact line or area chart that displays multiple time series over a continuous period. Without visible axes or labels, they are ideal for embedding within text, tables, or dashboards, highlighting relative movement rather than precise values for a quick visual summary of trends. @@ -259,10 +259,10 @@ #### When should I use it? - Use sparkline charts to show trends for multiple time series sharing the same Y-axis quantity over the - same X-axis time range. They emphasize relative movement rather than precise values. To keep them - effective, ensure simplicity by avoiding clutter. Use consistent scales and distinct colors for - different series. Remove labels and gridlines, limit annotations, and place sparklines near relevant + Use sparkline charts to show trends for multiple time series sharing the same Y-axis quantity over the + same X-axis time range. They emphasize relative movement rather than precise values. To keep them + effective, ensure simplicity by avoiding clutter. Use consistent scales and distinct colors for + different series. Remove labels and gridlines, limit annotations, and place sparklines near relevant text or data. """ ), @@ -289,5 +289,5 @@ stepped_line_page, heatmap_page, gantt_page, - sparkline_page + sparkline_page, ]