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

feat: improve export functionality #207

Merged

Conversation

flekschas
Copy link
Owner

This PR improves scatterplot.export() by allowing to customize the rendering settings during the export.

Description

What was changed in this pull request?

  • Added antiAliasing property to allow adjusting the anti-aliasing of points
  • Added pixelAligned property to allow aligning points with the pixel grid
  • Enhanced export() to allow up or down scaling the exported image as well as adjusting the anti-aliasing and pixel alignment settings during export
  • Exposed the renderer's resize() function in case one wants to resize the renderer's canvas.

Why is it necessary?

Fixes #175

All changes enable better exporting. E.g., during export it can be useful to upscale the image, render the points a tad smoother by increasing the anti-aliasing and snapping points to the pixel grid.

Huge thanks go to @danr for providing the necessary code changes in #175! 🙏

Checklist

  • Provided a concise title as a semantic commit message (e.g. "fix: correctly handle undefined properties")
  • CHANGELOG.md updated
  • Tests added or updated
  • Documentation in README.md added or updated
  • Example(s) added or updated
  • Screenshot, gif, or video attached for visual changes

Address #175 by adding `antiAliasing` and `pixelAligned` properties. This PR also exposes the renderer's `resize()` function.
@flekschas flekschas merged commit 2e6d35c into main Dec 28, 2024
2 checks passed
@flekschas flekschas deleted the flekschas/improved-rendering-and-export-functionality branch December 28, 2024 11:19
@danr
Copy link

danr commented Jan 7, 2025

Perfect! 🎉

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.

Point circles look malformed
2 participants