-
Notifications
You must be signed in to change notification settings - Fork 142
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] Refactor of vizro_ai.plot (breaking) #646
Conversation
for more information, see https://pre-commit.ci
…zro into poc/vizro_ai_charts_refactor
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very excited to seeing this PR now shaping up!
for more information, see https://pre-commit.ci
…zro into poc/vizro_ai_charts_refactor
for more information, see https://pre-commit.ci
…zro into poc/vizro_ai_charts_refactor
for more information, see https://pre-commit.ci
…zro into poc/vizro_ai_charts_refactor
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good. I love seeing so much code deleted, so much cleaner. 🧹 🙌
I did encounter a small issue with safeguard code validation when trying to run an example. In the plot description I asked for a horizontal line to be added to the chart (the error message is below).
Thanks for reporting this - strange, I could not really tell which built-in this is, surely |
Ah it's caused by
|
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Description
Full refactor of
vizro-ai.plot
. For reviewers (before docs are online):New API (no more explain, but added
validate_code
):Cases are below:
return_elements = False
- return Vizro chart, but no explanation, or code explanationreturn_elements = True
- return response pydantic model. This model has the following properties and methods:response.code
- get dash coderesponse.code_vizro
- get Vizro coderesponse.get_fig_object(self, data_frame: pd.DataFrame, chart_name: Optional[str] = None, vizro=True)
--> re-execute code to obtain fig object with DF of choice, with a different chart name, and as Vizro or plotly chart
validate_code: bool = False
- does not execute any code, but code string is not validated by actually running itScreenshot
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":