Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Apply Visual Vocabulary to vizro-ai #1059

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

lingyielia
Copy link
Contributor

@lingyielia lingyielia commented Mar 10, 2025

Description

How does vivivo become available in vizro-ai?

Assuming with current approach, whenever we make vizro-ai releases, run

# under vizro-core
hatch run gen-vivivo

# under vizro-ai
hatch run copy-vivivo

to generate and copy the latest visual_vocabulary.json to vizro-ai directory.

How is vizro-ai leveraging vivivo now?

  1. A list of example chart types is populated from vivivo and added into the field chart_type of BaseChartPlan
  2. A dictionary of {chart_type: example_code} is populated from vivivo to provide code suggestion/augment to vizro-ai

For example,
augment=False:
Screenshot 2025-03-13 at 00 46 51

augment=True:
Screenshot 2025-03-13 at 00 47 08


TODOs:

  • Decide whether rules like color preference should be enforced even when augment=False

LIMITATIONS of vizro-ai:

  • Because the code generated by .plot needs to be compatible with .dashboard, we enforced that the code should always in this format
def custom_chart(data_frame):
    fig = < do something >
    return fig

This means the vizro-ai generated code couldn't be as flexible as Visual Vocabulary. e.g.,

def waterfall(
data_frame: pd.DataFrame,
x: str,
y: str,
measure: list[str],
):

Screenshot

Notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

    • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
    • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorized to submit this contribution on behalf of the original creator(s) or their licensees.
    • I certify that the use of this contribution as authorized by the Apache 2.0 license does not violate the intellectual property rights of anyone else.
    • I have not referenced individuals, products or companies in any commits, directly or indirectly.
    • I have not added data or restricted code in any commits, directly or indirectly.

@github-actions github-actions bot added the Vizro-AI 🤖 Issue/PR that addresses Vizro-AI package label Mar 10, 2025
Copy link
Contributor

github-actions bot commented Mar 12, 2025

View the example dashboards of the current commit live on PyCafe ☕ 🚀

Updated on: 2025-03-13 05:12:26 UTC
Commit: 847c7c2

Compare the examples using the commit's wheel file vs the latest released version:

vizro-core/examples/scratch_dev

View with commit's wheel vs View with latest release

vizro-core/examples/dev/

View with commit's wheel vs View with latest release

vizro-core/examples/visual-vocabulary/

View with commit's wheel vs View with latest release

vizro-core/examples/tutorial/

View with commit's wheel vs View with latest release

vizro-ai/examples/dashboard_ui/

View with commit's wheel vs View with latest release

@lingyielia lingyielia marked this pull request as ready for review March 13, 2025 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Vizro-AI 🤖 Issue/PR that addresses Vizro-AI package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant