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

[Dev] Return fig object by VizroAI plot function #441

Merged
merged 15 commits into from
Apr 30, 2024

Conversation

nadijagraca
Copy link
Contributor

Description

.plot() function of VizroAI now returns fig object (go.Figure type) by default. Returned fig objected can be used within Vizro dashboard.

Changes to ux:

  • when run in python script, users need assign their output to a variable and add .show() in order to display the fig

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.

Copy link
Contributor

@Anna-Xiong Anna-Xiong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's change the function name bit after changing it to return fig directly? something like _exec_code_and_retrieve_fig, but feel free to change it to other if it suits more

@nadijagraca nadijagraca changed the title [Dev] Return fig object by default by VizroAI plot function [Dev] Return fig object by VizroAI plot function Apr 29, 2024
@maxschulz-COL maxschulz-COL added Status: Ready for Review ☑️ Issue/PR is ready for review - all tests have passed Package: Vizro-AI 🤖 Issue/PR addresses Vizro-AI package labels Apr 29, 2024
Copy link
Contributor

@maxschulz-COL maxschulz-COL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to ensure that all the docs are up-to-date as well!

For instance, this https://vizro--438.org.readthedocs.build/projects/vizro-ai/en/438/pages/user-guides/run-vizro-ai/#python-script would need to change e.g.

I would probably rebase this PR on the big docs changes, and then see that these new changes are coherent.

Otherwise very exciting change!

vizro-ai/examples/example.py Outdated Show resolved Hide resolved
vizro-ai/src/vizro_ai/_vizro_ai.py Show resolved Hide resolved
Copy link
Contributor

@Anna-Xiong Anna-Xiong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for addressing comments

Copy link
Contributor

@maxschulz-COL maxschulz-COL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! There are a few things that we should change in the near future, but they are not breaking, so let's delay until after the release.

This would involve:

  • adjusting the docs regarding the application integration
  • renaming of private methods to be more intuitive
  • settling on the question of how a user should get the chart code only

Copy link
Contributor

@stichbury stichbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🌟

Just a couple of minor tweaks as suggestions.

@nadijagraca nadijagraca merged commit 894ade3 into main Apr 30, 2024
34 checks passed
@nadijagraca nadijagraca deleted the dev/vizro-ai_return_fig_object branch April 30, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: Vizro-AI 🤖 Issue/PR addresses Vizro-AI package Status: Ready for Review ☑️ Issue/PR is ready for review - all tests have passed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants