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

d3.geoFit{,Size,Extent}() #65

Closed
mbostock opened this issue Oct 25, 2016 · 3 comments
Closed

d3.geoFit{,Size,Extent}() #65

mbostock opened this issue Oct 25, 2016 · 3 comments

Comments

@mbostock
Copy link
Member

It’d be nice to have a simple projection that only does scale and translate (and possibly inverts y), so that you can use path.fitExtent or path.fitSize in conjunction with pre-projected TopoJSON.

You can resize manually with d3.geoTransform, but it’s a pain to compute the scale yourself.

@mbostock
Copy link
Member Author

Perhaps instead of:

var projection = d3.geoCartesian().fitSize([width, height], feature);

We could just say:

var projection = d3.geoFitSize([width, height], feature);

And similarly for d3.geoFitExtent.

@mbostock
Copy link
Member Author

And maybe that would just be a convenience method for d3.geoFit:

var projection = d3.geoFit().scale(k).translate([x, y]);

@mbostock mbostock changed the title d3.geoCartesian() d3.geoFit{,Size,Extent}() Oct 25, 2016
@mbostock
Copy link
Member Author

I think d3.geoIdentity is fine for now.

var projection = d3.geoIdentity().fitSize([width, height], feature);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant