Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 14, 2024
1 parent f479fd1 commit 3f7da39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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")
14 changes: 7 additions & 7 deletions vizro-core/examples/visual-vocabulary/pages/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -251,18 +251,18 @@
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.
 
#### 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.
"""
),
Expand All @@ -289,5 +289,5 @@
stepped_line_page,
heatmap_page,
gantt_page,
sparkline_page
sparkline_page,
]

0 comments on commit 3f7da39

Please sign in to comment.