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

Circular images #1413

Closed
mbostock opened this issue Mar 31, 2023 · 4 comments · Fixed by #1425
Closed

Circular images #1413

mbostock opened this issue Mar 31, 2023 · 4 comments · Fixed by #1425
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

mbostock commented Mar 31, 2023

E.g. here, it’d be really nice to have an easy way to apply a circular clip to the image mark

untitled (45)

Maybe rx/ry would work? Or maybe better, you specify an r option and then it works well with the dodge transform.

@mbostock mbostock added the enhancement New feature or request label Mar 31, 2023
@Fil
Copy link
Contributor

Fil commented Apr 1, 2023

<style>svg image {clip-path: inset(0 0 0 0 round 50%);}

https://observablehq.com/@fil/spotify-pop-artists

Could be built-in as a "circular" option, or by supporting a clipPath option, or with a className (#1002).

@mbostock
Copy link
Member Author

mbostock commented Apr 1, 2023

Oh wow, I had no idea it was so easy! Nice! I still think an r option would be nice to match the dodge transform. We could have it generate the clipPath style accordingly.

@Fil
Copy link
Contributor

Fil commented Apr 1, 2023

r would default width to 2r, and add this clip-path (#181, #1109)? sounds good!

@Fil
Copy link
Contributor

Fil commented Apr 3, 2023

Edit: <style>svg image {clip-path: circle();}

spec / good browser support.

Fil added a commit that referenced this issue Apr 3, 2023
the **r** option of the image mark sets a default width = 2*r, and a default clip=circle()

closes #1413
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

Successfully merging a pull request may close this issue.

2 participants