microsoft / lida

Automatic Generation of Visualizations and Infographics using Large Language Models
https://microsoft.github.io/lida/
MIT License
2.6k stars 266 forks source link

Updated the executor function to provide support for plotly that fixes #36 #44

Closed Alfred-Onuada closed 9 months ago

Alfred-Onuada commented 9 months ago

This pull request adds support for the missing Plotly visualization library.

so the following code won't throw an error anymore lida.visualize(summary=summary, goal=goals[3], textgen_config=textgen_config, library='plotly')

Alfred-Onuada commented 9 months ago

@microsoft-github-policy-service agree

trojrobert commented 9 months ago

@Alfred-Onuada Please can you check the code, I am getting the error image

trojrobert commented 9 months ago

@Alfred-Onuada I think the code works for some plot like scatter plot but not histogram

Alfred-Onuada commented 9 months ago

I will have a look now, thanks for mentioning

trojrobert commented 9 months ago

@Alfred-Onuada I was already looking into it so I was able to spot the error.

In your scaffold template, you need to add "fig.show()" before returning chart. Please add that

Alfred-Onuada commented 9 months ago

@trojrobert take a look again I pushed a new commit to make sure visualize for plotly returns the raster and chart, to prevent errors.

I also tested with histograms across 3 datasets and it worked fine, let me know if you face any errors.

trojrobert commented 9 months ago

It is still not working. I actually already have the code to solve this but I wanted you to also contribute.

image

trojrobert commented 9 months ago

Please show me a test

Alfred-Onuada commented 9 months ago

@trojrobert

Screenshot 2023-09-23 at 13 43 29



Below is the cli test using pytest
Screenshot 2023-09-23 at 13 40 51

Alfred-Onuada commented 9 months ago

what test command are you using?

trojrobert commented 9 months ago

@Alfred-Onuada You code has a new dependency, we need to add that to the requirements. What version of kaleido are you using?

image

trojrobert commented 9 months ago

@Alfred-Onuada I commented on this before. You need to add fig.show() to the template

image

trojrobert commented 9 months ago

@Alfred-Onuada Please check my comment on scaffold.py.

Please also test with multiple dataset

Alfred-Onuada commented 9 months ago

@trojrobert kaleido@0.2.1, I have also included the fig.show() in the template

trojrobert commented 9 months ago

@victordibia I think this PR should be done.

victordibia commented 9 months ago

Thanks @Alfred-Onuada and @trojrobert I'll review this PR and merge soon!

-V.