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 formatter for lets-plot figures. #2084

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Conversation

alshan
Copy link
Contributor

@alshan alshan commented Aug 22, 2024

📝 Summary

Register formatters for 'plot' objects produced by the Lets-Plot plotting library: https://lets-plot.org

🔍 Description of Changes

Added LetsPlotFormatter class (marimo/_output/formatters/lets_plot_formatters.py) implementing formatters associated with the 'lets_plot' package.

Demo code:

import numpy as np
from lets_plot import ggplot, geom_point, aes, gggrid, ggsize, geom_livemap

x = np.random.rand(100)
y = 2 * x + 1 + np.random.normal(0, 0.1, 100)

data = dict(x = x, y = y)

p = ggplot(data) + geom_point(aes('x', 'y'))
p
---------

gggrid([p, p]) + ggsize(1000, 300)
---------

ggplot() + geom_livemap()

📋 Checklist

  • [x ] I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • [ x] I have run the code and verified that it works as expected.

📜 Reviewers

@akshayka OR @mscolnick

Copy link

vercel bot commented Aug 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 6:30pm
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 6:30pm

Copy link

github-actions bot commented Aug 22, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@alshan
Copy link
Contributor Author

alshan commented Aug 22, 2024

I have read the CLA Document and I hereby sign the CLA

@mscolnick
Copy link
Contributor

thanks @alshan! it just made the next release

@alshan
Copy link
Contributor Author

alshan commented Aug 22, 2024

Wow! That was fast ) thanx, @mscolnick !

alshan added a commit to JetBrains/lets-plot that referenced this pull request Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants