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

Static sizing of Matplotlib charts #87

Open
micahtyong opened this issue May 23, 2021 · 0 comments
Open

Static sizing of Matplotlib charts #87

micahtyong opened this issue May 23, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@micahtyong
Copy link
Member

micahtyong commented May 23, 2021

Currently, we generate Matplotlib charts as SVG images on the lux-org/lux backend then pass them into the lux-org/lux-widget frontend. From there, we render them as raw images. Because of this constraint, we aren't dynamically resizing the Matplotlib charts as we do for Altair (#333). Our current fix is to obtain the plotting_scale then compute the width and height of the image (rather than letting the parent div + flexbox do the work for us).

Here are some guiding questions to get started on this issue. In either case, we would need changes in both the frontend and backend.

  1. Is there a component similar to <Vega ... /> in Matplotlib? If so, we can use that component in the frontend and use that instead of generating an SVG.
  2. Is there a way to only tweak the frontend using Flexbox styling? If so, we can use plotting_scale from the backend similar to how scaling is accomplished for Altair charts.
@micahtyong micahtyong added the enhancement New feature or request label May 23, 2021
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

1 participant