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

projection fixed-precision option? #1143

Closed
Fil opened this issue Dec 2, 2022 · 5 comments · Fixed by #1193
Closed

projection fixed-precision option? #1143

Fil opened this issue Dec 2, 2022 · 5 comments · Fixed by #1193
Assignees
Labels
enhancement New feature or request geo Maps and projections

Comments

@Fil
Copy link
Contributor

Fil commented Dec 2, 2022

I'm not sure how we could name it, but it would be useful to add an optional quantization/line simplification step at the end of the projection stream pipeline. For instance, the test outputs could be drastically reduced in size. And any SSR map rendered with plot would download faster.

@Fil Fil added enhancement New feature or request geo Maps and projections labels Dec 2, 2022
@Fil Fil self-assigned this Dec 2, 2022
@mbostock
Copy link
Member

mbostock commented Dec 2, 2022

There’s an ancient PR in d3-path for this, I believe.

@Fil
Copy link
Contributor Author

Fil commented Dec 2, 2022

Yes, d3/d3-path#12. It's for generic paths, and probably more complicated than we'd want here (we know that we are in screen coordinates and are the last transform in the stream pipeline).

@mbostock
Copy link
Member

mbostock commented Dec 2, 2022

probably more complicated than we'd want here

How is it complicated? I feel like that’s a pretty good existing solution and it’s nice that it would also work for pre-projected and planar geometry. I guess you’re saying we could do it as a point transform and abuse the interface by passing stream.point strings instead of numbers? But I think it would be best to fix this generically in d3-path since other people have wanted this for a while.

@Fil
Copy link
Contributor Author

Fil commented Dec 2, 2022

I meant more complicated in the sense that it also has to process arcs. But I also prefer if we can land it.

@mbostock
Copy link
Member

I have updated d3/d3-path#12 and it should be ready to go now. Once that’s released as D3 7.8, we can adopt that here and switch to d3.pathFixed instead of d3.path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request geo Maps and projections
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants