Граф коммитов

304 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock 8349aa171c Quick and ugly hack to allow multiple locales.
Fixes #750. This isn’t the final implementation, but more of a proof of concept
demonstrating how to scope any code that requires localization within a closure
that has access to locale-specific variables. In the next pass, I can go through
this implementation and more cleanly separate locale-dependent from locale-
independent code, and only put locale-dependent code within the closure.

Also, we may want to use an options object rather than passing a zillion
arguments to d3.locale, because a many-argument method is hard to use and may
make it harder to extend the API in the future. This commit also breaks the
ability to change the default locale during the build process, but this should
be easy to restore.
2014-01-08 13:10:00 -08:00
Mike Bostock 249c01e0ba Update smash; fixes #1626. 2013-11-11 13:06:20 -08:00
Mike Bostock 68582505d9 Move benchmark. 2013-09-25 11:44:50 -07:00
Mike Bostock 41bfffe63e Add --ascii to uglifyjs. Related #1195. 2013-08-12 08:17:45 -07:00
Jason Davies d49321d2e3 Set LC_MONETARY to correct locale. 2013-07-05 23:39:56 +01:00
Mike Bostock 68809d3dd3 Add currency support to d3.format. Fixes #777.
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.
2013-07-03 10:09:54 -07:00
Mike Bostock e31c0fb290 Add make rule for component.json. 2013-06-29 09:24:41 -07:00
Mike Bostock e05b1e769b Regenerate format tables on make clean. 2013-06-29 09:03:09 -07:00
Mike Bostock 2236488f22 Am I bowering rite? Fixes #1251 #1338. 2013-06-27 11:32:08 -07:00
Mike Bostock abda353ae6 Remove spurious dependency. 2013-06-03 13:23:41 -07:00
Jason Davies 29252d53a1 Custom UglifyJS script to warn about leaking globals. 2013-05-24 20:37:58 +01:00
Jason Davies 22b744b7e6 Tweak version generation.
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/.
2013-05-07 19:47:44 +01:00
Mike Bostock 7add1117cf Add package.json prerequisites. 2013-04-30 15:52:32 -07:00
Mike Bostock d8c14b9c2a Safer clean. 2013-04-25 12:33:06 -07:00
Mike Bostock 8e5b974f87 Don't build package.json. Fixes #1213. 2013-04-25 11:48:02 -07:00
Mike Bostock c696b8c846 Add PHONY targets. 2013-03-15 17:15:07 -07:00
Mike Bostock ba7bbe61df Upgrade jsdom & uglify-js. 2013-03-15 08:27:24 -07:00
Mike Bostock 133011f608 Use npm test in the Makefile. 2013-03-14 14:32:13 -07:00
Mike Bostock ada94766f3 No longer intermediate. 2013-03-13 02:01:49 -07:00
Mike Bostock d392331412 Simplify Makefile. 2013-03-13 01:59:36 -07:00
Mike Bostock 48e449ba94 Smash dependencies! 2013-03-12 21:31:15 -07:00
Mike Bostock 86e8f88c3f Smash! 2013-03-12 21:01:49 -07:00
Jason Davies 63a95a390a Fix for running `make clean && make -j all`.
This can fail due to a missing d3.js file, which is required for
`node src/package.js` and `node src/component.js`.
2013-03-11 22:55:29 +00:00
Mike Bostock 09f6c76329 Add conic projections. Fixes #1133. 2013-03-11 13:43:05 -07:00
Mike Bostock 28c7b46b5a Add transverseMercator; remove custom scales.
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.
2013-03-11 12:58:00 -07:00
Jason Davies 600666e8c1 Reuse Greiner–Hormann for 2D polygon clipping.
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.
2013-03-06 08:57:28 +00:00
Mike Bostock d80cc86287 Merge branch 'clip-view' of git://github.com/jasondavies/d3 into 3.1.0 2013-03-05 20:50:19 -08:00
Mike Bostock 01f681213f Merge branch 'voronoi-layout' into 3.1.0 2013-03-05 20:49:22 -08:00
Mike Bostock e8d8b13498 Merge branch 'geo-length' into 3.1.0 2013-03-05 20:45:25 -08:00
Mike Bostock a7294db376 Merge branch 'd3.set' of git://github.com/jfirebaugh/d3 into 3.1.0 2013-03-05 20:42:53 -08:00
Mike Bostock f6668a804b Use the local node_modules/.bin.
This ensures that executables are consistent with the local package.json and
not affected by any globally-installed packages.
2013-03-05 20:41:35 -08:00
Mike Bostock 48f3fa8716 Merge branch 'minor-graticule' into 3.1.0
Conflicts:
	src/geo/interpolate.js
2013-03-05 19:28:39 -08:00
Jason Davies c1a02e06f7 First stab at d3.geo.clipView.
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.
2013-03-04 15:08:38 +00:00
Mike Bostock 88c4a86e71 Add d3.layout.voronoi.
A more user-friendly version of d3.geom.voronoi. Fixes #1100.
2013-03-02 14:46:45 -08:00
Mike Bostock 2c019c300c Merge branch 'geo-length' of https://github.com/jasondavies/d3 into geo-length 2013-03-01 13:59:47 -08:00
Jason Davies 889aacc43d Fix d3.geo.interpolate for coincident points.
This also improves accuracy for small distances, using the haversine
distance formula instead of the law of cosines.

Fixes #1080.
2013-02-18 13:06:29 +00:00
John Firebaugh 1e8a579810 Add d3.set
Taking inspiration from d3.map, d3.set is a simple shim for ES6 sets.
2013-02-09 14:42:04 -08:00
Jason Davies 4917fa86ca Add d3.geo.length. 2013-02-05 23:08:20 +00:00
Mike Bostock 0991f3b010 Use captured references for document and window.
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.
2013-01-31 15:11:40 -08:00
Mike Bostock 6b06c4526b Deprecate d3.geo.greatArc; add d3.geo.distance.
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.
2013-01-23 15:46:34 -08:00
Mike Bostock 75be0ab272 Rename for clarity.
d3_geo_cut is now d3_geo_clipAntimeridian.
d3_geo_circleClip is now d3_geo_clipCircle.
2012-12-15 12:42:00 -08:00
Mike Bostock ec1c7cfe04 Fix for UglifyJS 2.x. 2012-12-13 09:34:02 -08:00
Jason Davies b87bcbc22a Implement d3.geo.centroid via d3.geo.stream. 2012-12-13 12:22:41 +00:00
Jason Davies 37f64b74f2 Fix streaming polygon clipping. 2012-12-13 02:01:04 +00:00
Mike Bostock 6ca6d3ea07 Return undefined for empty buffers. 2012-12-12 16:42:07 -08:00
Mike Bostock 1a779c6f4d Implement d3.geo.path centroid via d3.geo.stream. 2012-12-12 16:17:02 -08:00
Jason Davies 33e24962be Refactor clipping to use streams.
Work in progress: everything is treated as lines at the moment.
2012-12-12 21:33:59 +00:00
Mike Bostock e06a279d62 Remove unused d3.geo.streamListener. 2012-12-12 10:17:52 -08:00
Mike Bostock 6994640f32 Add d3.geo.stream.
This will replace d3_geo_type and make projection faster.
2012-12-12 09:09:21 -08:00
Jason Davies c0f9ae7ad1 Extract d3_geo_resample. 2012-12-12 09:25:22 +00:00