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

Add support for Vega charts #63

Closed
rclement opened this issue Mar 7, 2023 · 8 comments
Closed

Add support for Vega charts #63

rclement opened this issue Mar 7, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@rclement
Copy link
Owner

rclement commented Mar 7, 2023

Only Vega-Lite charts are currently supported using the vega library. It would be useful to support both specifications.

@rclement
Copy link
Owner Author

rclement commented Mar 8, 2023

Here are some examples of Vega charts: https://vega.github.io/vega/examples/
Here are some examples of Vega-Lite charts: https://vega.github.io/vega-lite/examples/

@rclement
Copy link
Owner Author

rclement commented Mar 8, 2023

It can be safe to say the current vega library should be renamed to vega-lite to avoid confusion...

@rclement
Copy link
Owner Author

Work in progress in branch vega-charts-support: https://github.com/rclement/datasette-dashboards/tree/vega-charts-support

@lukasdei could you test the current state with custom Vega charts? There is already an example of word cloud chart in the demo

@lukasdei
Copy link

Hey. Sorry for the slow reply. That looks super cool! I did find a bug tho. I tried it in both Firefox 110.0.1 and Chrome 110.0.5481.177. In both browsers, the word cloud chart rendered, but when the window resizes, the chart container just grows continuously.

dd_grid_test.mov

However, if just the word cloud is being displayed, the chart resizes without issue.

dd_grid_test-.2.mov

Thoughts?

@rclement
Copy link
Owner Author

Thank you @lukasdei for the feedback!

I also got the "height resizing" bug on my side, no idea of the root cause for the moment

@rclement
Copy link
Owner Author

@lukasdei I managed to find a workaround in 8ce9bc0:

  • In dashboard view: responsive width only (the height need to be set either manually or by the chart itself)
  • In chart view: responsive width and height

This is aligned with the current responsive implementation for Vega-Lite charts

@rclement
Copy link
Owner Author

I am pretty happy with the current implementation so I will merge the PR #64. Further enhancements will be performed down the line when needs arrive

@lukasdei
Copy link

Works great on my end. Thanks so much for working on this! 😁😁

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

2 participants