You can now prefix the locale’s currency symbol. For example:
d3.format("+$,.2f")(-2.5e5) // -$250,000.00
This implementation is limited in that it does not support currencies where the
symbol should appear after the value (e.g., "250,000.00 €" as in fr_FR). And
d3.format currently only supports a single locale. But it’s a start.
Instead of relying on sed to replace a VERSION token, we generate
src/start.js, which defines the internal `d3` variable with the current
version derived from package.json.
In addition, all file generators (component, locale, start) have been
moved to bin/.
This adds d3.geo.transverseMercator and removes the custom default scales from
the mercator and equirectangular projections. Also, this commit removes the
built-in 2π scale factor from the mercator projection, simplifying the
implementation and making it consistent with transverseMercator and GDAL. This
is a partial fix for #1133; see also d3/d3-plugins#55.
Greiner–Hormann is preferable to Sutherland-Hodgman, because it doesn't
add extraneous lines along the clip edge, and can even handle
self-intersecting polygons. The line segments are generated via the
efficient Liang–Barsky line clipping algorithm, and Greiner–Hormann
rejoins them appropriately along the clip edge.
Still in progress: correct marking of whether an intersection is an
entry or exit point, and detection of points that lie exactly on the
clip edge, which should be jittered.
This is a simple stream transformation for the moment. Note that the
clip region points should be specified in counterclockwise order as
required by d3.geom.polygon, and unlike GeoJSON, the first and last
points should not be coincident.
This avoids an inconsistency (discussed in #1044) when using D3 inside Node.js,
where D3 internally creates a JSDOM document during initialization, but then
subsequently depends on the current global document, which is not exposed. D3
now always refers to the global document at the time of initialization, and
does not depend on the current global document or window.
Now that D3 supports great-arc interpolation automatically for projections,
there is no need for a great arc feature generator, as a simple LineString
geometry object is equivalent. For the same reason, d3.geo.graticule does not
need to use supersampling on meridians, since meridians are great arcs.
This commit also adds d3.geo.distance(a, b) for computing the length of the
great arc between points a and b in radians, as a replacement for the
deprecated d3.geo.greatArc method, and a faster alternative to constructing a
d3.geo.interpolate solely to measure distance.
Fixes#1021#1024.