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

Chart component #75

Open
Dejiah opened this issue Dec 5, 2023 · 10 comments
Open

Chart component #75

Dejiah opened this issue Dec 5, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@Dejiah
Copy link
Contributor

Dejiah commented Dec 5, 2023

Hi,

I think it would be great if we had a chart component (e.g. think 2D bar charts or scatter plots).

Guess the mechanism of supplying data in the backend could be similar as it is implemented for the Table component.
For frontend implementation I think we could leverage something like Chart.js to do the charting work itself for us.

Not sure if this use case is common enough such that it would fit into FastUI itself or whether this should rather be considered a custom component and be separate from the package.

Any thoughts?

@bobcolner
Copy link

This would be a great feature. These libs are very feature complete:

https://plotly.com/graphing-libraries/
https://bokeh.org/

@jgunstone
Copy link

also
vega and mosaic should be simple to embed

@samuelcolvin
Copy link
Member

I think the simple solution is to return a vega JSON object perhaps from altair and render that in the frontend.

I think long term this is an idea that I'm really interested in, and I'd like to try to do something more powerful, particularly WRT interaction etc.

@AaronNHart
Copy link

Also worth considering may be echarts, which has a json format and an (auto-gen) pydantic model in ezcharts.

From my limited perspective, there are 2 possible advantages:

  • the chart types are more expansive with echarts, especially around tree based options which seem to be missing in vega-lite/altair.
  • It looks like there is an event model that could somehow map nicely onto fastui.

@samuelcolvin
Copy link
Member

ye, I agree echarts is probably the best way to go.

@jgunstone
Copy link

I've been using quarto recently which is great -
with it you can build a website from pandoc-markdown.

they recently added a feature to support observablejs code blocks.
this allows you to create interactive elements within an otherwise static website.
could be of interest as an approach...

@cjlala
Copy link

cjlala commented Mar 5, 2024

Hi guys, aftering reading the above comments, I still have no idea how to add a chart in the fastui. Can someone show me a piece of codes?

@tim-x-y-z
Copy link
Contributor

I made an initial proposal for this here: #201 using recharts

@sydney-runkle sydney-runkle added the enhancement New feature or request label May 1, 2024
@gaby
Copy link

gaby commented Jul 16, 2024

@tim-habitat Just noticed your PR is kind of stale, has there been any changes? This feature would be huge for FastUI

@tim-x-y-z
Copy link
Contributor

No nothing changed my side and would be happy to freshen up, though i suspect the team at pydantic might want to implement it in a different way based on the comments above.
This to me is why i would love to have a discussion about plugins / making it easier to extend components: #262
in that case i would be happy to implement a few graphs etc. and people could easily use that package, without it living in the core fastui leaving space for the team to do as they see fit in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants