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

A raster/2d function plot mark #984

Closed
Fil opened this issue Jul 13, 2022 · 3 comments
Closed

A raster/2d function plot mark #984

Fil opened this issue Jul 13, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@Fil
Copy link
Contributor

Fil commented Jul 13, 2022

@Fil Fil added the enhancement New feature or request label Jul 13, 2022
@mbostock
Copy link
Member

mbostock commented Jul 13, 2022

I like it. I think we should use foreignObject instead of toDataURL though (even if it currently breaks downloads on Observable; we could add a fix for that to downloading if we want to).

I wonder if using fillRect would be faster or slower than putImageData.

I think we’ll want a different option than resolution, but I’m not sure exactly what… For the current functionality I would rename the option to devicePixelRatio (or maybe pixelRatio) but I wonder if it should feel more like Plot.density where there’s an underlying grid of some resolution (that’s not necessarily 1:1 with pixels). But maybe starting with pixelRatio is fine and I’m overthinking.

It’s also interesting to think how a WebGL shader mark might function.

@yurivish
Copy link
Contributor

A while ago while playing around with my own density mark (with liberal help from Fil) I ran into an Safari bug where the foreignObject would not scale properly with the SVG.

You can see an example here – open it in Safari and increase the font size. Performance should be better than toDataURL, but I never figured out a workaround for the bug.

This was referenced Dec 14, 2022
@mbostock
Copy link
Member

Fixed in #1196.

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

3 participants