FastUI icon indicating copy to clipboard operation
FastUI copied to clipboard

Proposal for charts component

Open tim-x-y-z opened this issue 1 year ago • 2 comments

This PR is more a proposal at this stage, the initial chart implemented is a line chart - very happy to add more if this template seems acceptable. I can also clean a bit the implementation and add parameters if we want. Here are a few things to note:

  • this uses the package recharts https://github.com/recharts/recharts , this might be a downside if we don't want to have dependencies ? (in particular, this first pr only does the line chart examples here)
  • there is a lot of customisation possible
  • it is hard to me to knwo where to "draw the line" between what parameters to include in teh pydantic object or to let in json_schema_extras - not sure how to decide, probably for the the maintainer to decide.
  • when i put 100% in height the graph never stops - i am missing something to understand why.

For now here is how it looks: image

PS: i hope this can be useful, i would really love to see charts in fastui :)

tim-x-y-z avatar Feb 18 '24 17:02 tim-x-y-z

I also need to write the tests for it

tim-x-y-z avatar Feb 18 '24 17:02 tim-x-y-z

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (398147e) 95.68% compared to head (e1725f9) 95.19%.

Files Patch % Lines
src/python-fastui/fastui/components/charts.py 77.77% 6 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #201      +/-   ##
==========================================
- Coverage   95.68%   95.19%   -0.49%     
==========================================
  Files          14       15       +1     
  Lines         950      978      +28     
==========================================
+ Hits          909      931      +22     
- Misses         41       47       +6     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 18 '24 17:02 codecov[bot]