From 06ee31d895d7ae440b48bcf8652a1293ea5a447a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:11:30 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../docs/pages/user-guides/customize-vizro-ai.md | 1 + .../pages/user-guides/vizro-ai-langchain-guide.md | 13 +++++++++---- vizro-core/docs/pages/user-guides/actions.md | 3 ++- vizro-core/docs/pages/user-guides/card-button.md | 2 ++ vizro-core/docs/pages/user-guides/figure.md | 3 +++ .../docs/pages/user-guides/kedro-data-catalog.md | 1 - 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md b/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md index e1ee74a98..4ae23abad 100644 --- a/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md +++ b/vizro-ai/docs/pages/user-guides/customize-vizro-ai.md @@ -18,6 +18,7 @@ vizro_ai = VizroAI(model="") For the string settings to work, you must supply your API key via environment variables. The relevant variable names to be set are noted in each vendor tab. === "OpenAI" + | Environment variable | Name(s) | | -------------------- | ----------------- | | API key | `OPENAI_API_KEY` | diff --git a/vizro-ai/docs/pages/user-guides/vizro-ai-langchain-guide.md b/vizro-ai/docs/pages/user-guides/vizro-ai-langchain-guide.md index ca24371a6..75a67dd07 100644 --- a/vizro-ai/docs/pages/user-guides/vizro-ai-langchain-guide.md +++ b/vizro-ai/docs/pages/user-guides/vizro-ai-langchain-guide.md @@ -117,6 +117,7 @@ Now you can use the chain to generate charts or dashboards based on natural lang !!! example "Generate chart code" === "Code" + ```python # Load sample data df = px.data.gapminder() @@ -126,16 +127,16 @@ Now you can use the chain to generate charts or dashboards based on natural lang ``` === "Vizro-AI Generated Code" + ```python import plotly.graph_objects as go from vizro.models.types import capture + @capture("graph") def custom_chart(data_frame): continent_gdp = data_frame.groupby("continent")["gdpPercap"].mean().reset_index() - fig = go.Figure( - data=[go.Bar(x=continent_gdp["continent"], y=continent_gdp["gdpPercap"])] - ) + fig = go.Figure(data=[go.Bar(x=continent_gdp["continent"], y=continent_gdp["gdpPercap"])]) fig.update_layout( title="GDP per Capita by Continent", xaxis_title="Continent", @@ -146,14 +147,18 @@ Now you can use the chain to generate charts or dashboards based on natural lang !!! example "Generate dashboard code" === "Code" + ```python dfs = [px.data.gapminder()] - dashboard_response = chain.invoke("Create a dashboard. This dashboard has a chart showing the correlation between gdpPercap and lifeExp.") + dashboard_response = chain.invoke( + "Create a dashboard. This dashboard has a chart showing the correlation between gdpPercap and lifeExp." + ) print(dashboard_response[0].content) ``` === "Vizro-AI Generated Code" + ```py ############ Imports ############## import vizro.models as vm diff --git a/vizro-core/docs/pages/user-guides/actions.md b/vizro-core/docs/pages/user-guides/actions.md index f2dae6448..84c69067e 100644 --- a/vizro-core/docs/pages/user-guides/actions.md +++ b/vizro-core/docs/pages/user-guides/actions.md @@ -22,9 +22,9 @@ The below sections are guides on how to use pre-defined action functions. To enable downloading data, you can add the [`export_data`][vizro.actions.export_data] action function to the [`Button`][vizro.models.Button] component. Hence, as a result, when a dashboard user now clicks the button, all data on the page will be downloaded. - !!! example "`export_data`" === "app.py" + ```{.python pycafe-link} import vizro.models as vm import vizro.plotly.express as px @@ -59,6 +59,7 @@ To enable downloading data, you can add the [`export_data`][vizro.actions.export ``` === "app.yaml" + ```yaml # Still requires a .py to add data to the data manager and parse YAML configuration # See yaml_version example diff --git a/vizro-core/docs/pages/user-guides/card-button.md b/vizro-core/docs/pages/user-guides/card-button.md index 947702254..0158d72d8 100755 --- a/vizro-core/docs/pages/user-guides/card-button.md +++ b/vizro-core/docs/pages/user-guides/card-button.md @@ -626,6 +626,7 @@ The example below demonstrates how to configure a button to export the filtered !!! example "Button with action" === "app.py" + ```{.python pycafe-link} import vizro.models as vm import vizro.plotly.express as px @@ -662,6 +663,7 @@ The example below demonstrates how to configure a button to export the filtered ``` === "app.yaml" + ```yaml # Still requires a .py to add data to the data manager and parse YAML configuration # See from_yaml example diff --git a/vizro-core/docs/pages/user-guides/figure.md b/vizro-core/docs/pages/user-guides/figure.md index 89761b3ab..d274bbee1 100644 --- a/vizro-core/docs/pages/user-guides/figure.md +++ b/vizro-core/docs/pages/user-guides/figure.md @@ -40,6 +40,7 @@ To add a `Figure` to your page: !!! example "Use existing figure functions" === "app.py" + ```{.python pycafe-link} import vizro.models as vm import vizro.plotly.express as px @@ -71,6 +72,7 @@ To add a `Figure` to your page: ``` === "app.yaml" + ```yaml # Still requires a .py to add data to the data manager and parse YAML configuration # See from_yaml example @@ -110,6 +112,7 @@ As described in the [API reference](../API-reference/figure-callables.md) and il !!! example "KPI card variations" === "app.py" + ```{.python pycafe-link} import pandas as pd import vizro.models as vm diff --git a/vizro-core/docs/pages/user-guides/kedro-data-catalog.md b/vizro-core/docs/pages/user-guides/kedro-data-catalog.md index 2129b7051..ce4b060fa 100644 --- a/vizro-core/docs/pages/user-guides/kedro-data-catalog.md +++ b/vizro-core/docs/pages/user-guides/kedro-data-catalog.md @@ -34,7 +34,6 @@ The `catalog` variable may have been created in a number of different ways: The full code for these different cases is given below. !!! example "Import a Kedro Data Catalog into the Vizro data manager" - === "app.py (Kedro project path)" ```python from vizro.integrations import kedro as kedro_integration