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

700 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock c0dcd06f42 Merge branch 'fix-range-band' into 3.1.8 2013-05-20 10:29:57 -07:00
Mike Bostock b7f5f30570 Define rangeBand in context of rangePoints.
Previously, the rangeBand was zero when rangePoints was used. Now it returns the
size of the step between points. Fixes #584.
2013-05-20 10:26:27 -07:00
Mike Bostock 61c67b9cb2 More accurate projection function. 2013-05-20 09:46:03 -07:00
Jason Davies 4663d05a3f Fix path tests. 2013-05-20 13:30:01 +01:00
Jason Davies af35ec07ff Fix albers tests and inversion of North pole. 2013-05-20 13:23:59 +01:00
Jason Davies 1bdc29928d Fix d3.geo.albersUsa tests. 2013-05-20 13:15:44 +01:00
Mike Bostock e8fcad0cfb Redesigned d3.geo.albersUsa.
This commit changes the albersUsa projection so that it uses a custom projection
stream rather than a custom projection function. The projection stream passes
geometry to all three constituent projections, which are then clipped to their
respective viewports. The result is that geometry that appears in multiple
projections (such as a graticule) is now rendered correctly in each, with
clipping! In addition, the inverse projection is much easier to compute because
the viewport regions of each projection are explicitly defined.
2013-05-19 11:38:22 -07:00
Mike Bostock 3fefb4a48e Merge remote-tracking branch 'origin/fix-interpolate' into 3.1.7 2013-05-15 16:11:06 -07:00
Mike Bostock c8b9164840 Merge remote-tracking branch 'origin/fix-scale-domain' into 3.1.7 2013-05-15 16:10:30 -07:00
Mike Bostock f91973283f Merge remote-tracking branch 'origin/clip-view' into 3.1.7 2013-05-15 16:09:31 -07:00
Mike Bostock 6e650062c0 Merge remote-tracking branch 'origin/geo-bounds' into 3.1.7 2013-05-15 16:09:02 -07:00
Mike Bostock 756ff5c77a Fix #1247 - more robust interpolation, again.
This removes the use of interpolateString if the start and end values passed to
d3.interpolate are different types; the interpolation behavior should be based
solely on the end value. Now if you interpolate an undefined attribute (the
empty string) to a number, it will use number interpolation as expected.

This also fixes interpolateString such that it always returns a string, even if
both the start and end value are coercible to numbers.
2013-05-15 15:48:13 -07:00
Mike Bostock 36ab0dc25a Preserve domains exactly.
Fixes #1241. With d3.scale.pow, d3.scale.sqrt and d3.scale.log, the underlying
implementation is a linear scale. Due to the transformation a linear domain and
the limits of floating-point precision, the reported domain could differ
slightly from what was set. Now, the set domain is preserved exactly.
2013-05-13 15:11:59 -07:00
Jason Davies f69040c9d2 Fix time tests by adding Date to sandbox.
Since tests are now run in their own sandbox, assert.deepEqual was not
properly testing the returned Date objects for equality, as they weren't
instances of the same Date class used by the test itself, causing type
inference to fail.  It was always returning true, even for different
dates.
2013-05-08 11:50:45 +01:00
Jason Davies 67dce478da Remove redundant VERSION from test sandbox.
This is no longer needed due to
22b744b7e6.
2013-05-08 10:44:56 +01:00
Jason Davies e1beaab051 d3.geo.bounds: antimeridian and inflection points.
The behaviour of d3.geo.bounds has been modified slightly, such that the
minimum and maximum longitudes denote minimum and maximum meridians when
going from left to right in a standard equirectangular projection.

If the maximum longitude is in fact numerically smaller than the
meridian, this simply means that the bounds cross the antimeridian.

This fixes several issues:

* The bounding box is now a true minimum-width bounding box.
* Line segments that cross the antimeridian are now correctly handled.
* Similarly, polygons that cross the antimeridian are now correctly
  handled.

Secondly, inflection points are now detected, so that the latitudinal
range is extended in the case where the great arc contains the great
circle’s inflection point.

Lastly, support for polygons has been improved, e.g. those that wind
around the poles, and those that have a counter-clockwise winding order.

Note that as part of the winding order detection, the performance of
d3.geo.area had to be reduced somewhat (by as much as 25%).  This is
because the trick to avoid atan2 calls fails for winding order detection
in the case where a counter-clockwise area strays into a positive
quadrant.  We can reinstate the trick for area-only calculations in
future; I think correct winding order detection is more important at the
moment.

See #1154.
2013-05-05 11:33:15 +01:00
Jason Davies 3eae02e3e6 Fix projection.clipExtent regression.
A bug was introduced in fa514dd08c, where
invisible line segments were incorrectly drawn.

Thanks to @jfirebaugh of iD for spotting it!
2013-05-04 12:34:23 +01:00
Mike Bostock 0c7d1864f2 Saturation is only undefined for black and white. 2013-04-30 16:09:40 -07:00
Mike Bostock 42da3ba98c Merge branch 'grayscale' into 3.1.6 2013-04-30 15:55:25 -07:00
Mike Bostock 7d81f05ff5 Merge branch 'convex-hull' into 3.1.6 2013-04-30 15:54:43 -07:00
Mike Bostock f76f564451 Fix #993; d3.geom.hull is now ccw. 2013-04-30 15:30:56 -07:00
Mike Bostock 9120507d47 Fix #1220 #1218 re. d3.select and d3.selectAll.
This commit fixes d3.select so that it no longer propagates data from the
document element to the selected node when a selector is used. This commit also
fixes d3.select and d3.selectAll such that the returned selection’s group’s
parent node is set to the document element.
2013-04-30 14:49:33 -07:00
Mike Bostock b96e4e3363 Select the document element, not the document.
Fixes #1219.
2013-04-30 14:12:02 -07:00
Mike Bostock 8e5b974f87 Don't build package.json. Fixes #1213. 2013-04-25 11:48:02 -07:00
Mike Bostock b1091b9c50 Add quadtree.extent. Fixes #1207. 2013-04-19 14:57:41 -07:00
Mike Bostock ff5364d7db Allow hue, chroma or saturation to be undefined.
In HSL space, grayscale colors can now have undefined hue rather than assuming a
hue of 0°; likewise black and white can have undefined saturation rather than
assuming 0%. In HCL space, black can now have undefined hue and chroma. (For
non-black grayscale colors, including white, hue and chroma are implied by the
D65 standard referent.)

When interpolating between colors with undefined hue, saturation or chroma, the
defined value is used when available. For example, when interpolating from black
to blue in HCL space, the intermediate colors are now dark blues (#241178)
rather than dark purples (#600054).

Fixes #833.
2013-04-19 10:26:39 -07:00
Scott Cheng c4dd577819 Add test for scale.quantize.invertExtent: out-of-range values and duplicate values in the range 2013-04-18 11:28:07 +08:00
Scott Cheng d479282ab6 Add test for scale.quantize.invertExtent: arbitrary range values 2013-04-18 00:56:37 +08:00
Scott Cheng ea2a48a248 Add test for scale.quantize.invertExtent 2013-04-17 22:47:30 +08:00
Jason Davies 9f25c5f55e Fix typo in test description. 2013-04-11 18:20:44 +01:00
Mike Bostock deae63e688 Merge branch 'fix-null-geometry' into 3.1.5 2013-04-06 19:16:38 -07:00
Mike Bostock ab7af35db9 Ignore null geometries. 2013-04-04 20:50:51 -07:00
JD Isaacks f676389b98 Make clamp implementation more similar to extent 2013-04-02 12:16:50 -04:00
JD Isaacks a829aa260c Add brush.clamp method to specify to clamp extent to range or not 2013-04-02 10:58:44 -04:00
Mike Bostock 6c0c0c2bf4 Favor strictEqual for testing. 2013-03-31 09:48:10 -07:00
Mike Bostock 359546c80c More robust type inference for d3.interpolate.
Fixes #1180 #1179 #1176. Still a work in progress; needs a few more tests.
2013-03-31 09:46:07 -07:00
Adam Sunderland fdf5f93797 cleaner formatting for step interpolation method 2013-03-26 17:11:06 -05:00
Adam Sunderland 0500aaea43 change step-middle to just step 2013-03-26 15:01:05 -05:00
Adam Sunderland 2f82165d5f adding step-middle as interpolation method 2013-03-26 14:50:54 -05:00
Jason Davies f2cce5f57d Add test for clipExtent: redundant closing points. 2013-03-25 08:51:16 +00:00
Jason Davies bcf70c96c9 Add test for quadtree with no bounds. 2013-03-22 00:01:16 +00:00
Jason Davies 34059e22c4 Minor code style fixes. 2013-03-21 22:01:51 +00:00
Jason Davies dcd784246e Add missing semicolons to test. 2013-03-21 12:56:54 +00:00
Jason Davies fd40dc2774 Refactor d3.geom.hull. 2013-03-19 17:19:21 +00:00
Jason Davies 15ec3e8d90 Optimise voronoi for default accessors. 2013-03-19 16:13:11 +00:00
Jason Davies 112ec6fac8 d3.geom.voronoi: always assign input data. 2013-03-19 16:02:09 +00:00
Jason Davies 7643e22714 d3.geom.voronoi: return the configured size. 2013-03-19 15:11:03 +00:00
Jason Davies 7c7366155f Refactor d3.geom.quadtree.
See #1145.
2013-03-19 11:35:51 +00:00
Jason Davies 788f8cd958 Refactor d3.geom.voronoi.
See #1145.
2013-03-19 11:35:49 +00:00
Jason Davies 6d62cc2060 Fix typos in test names. 2013-03-19 10:54:40 +00:00
Mike Bostock 627b55189e Don't expose transient points.
Data-in and data-out. Although I could see it being useful to access the
computed coordinates, but I think in the common case, these will be implemented
as simple accessors.
2013-03-15 17:15:20 -07:00
Jason Davies fa6ef52de9 Add d3.layout.voronoi.{links,triangles}. 2013-03-15 23:33:21 +00:00
Jason Davies 537e9e234a Add simple test for d3.interpolateTransform. 2013-03-15 16:55:53 +00:00
Jason Davies d476dffdef Fix a couple of typos. 2013-03-14 22:43:18 +00:00
Mike Bostock 0d7c6c55e7 Use _ to disambiguate local vs. global d3. 2013-03-14 15:14:12 -07:00
Mike Bostock 1ac0fa09a9 Fix the time zone for testing. 2013-03-14 14:28:25 -07:00
Mike Bostock 05e9f190e3 Fix all the tests. 2013-03-14 14:11:40 -07:00
Mike Bostock a4fed02b8c Get most transition tests working again. 2013-03-14 13:59:18 -07:00
Mike Bostock bd09d37e6c Refactor time tests for minimal load. 2013-03-14 13:29:24 -07:00
Mike Bostock 68be0ac8c8 Rename assert and XMLHttpRequest. 2013-03-14 13:00:04 -07:00
Mike Bostock ecbf93d922 Standardize test environment. 2013-03-14 12:58:16 -07:00
Mike Bostock 4c3469d336 Refactor selection tests for better isolation.
Fixes #939.
2013-03-14 12:36:21 -07:00
Mike Bostock 36c59cd233 Fix two failing assert.throws.
Since smash.load uses a separate context, any exceptions it throws use a
different Error class, and thus the assert.throws fails. So, instead, just allow
any exception type to be thrown.
2013-03-14 10:58:17 -07:00
Mike Bostock e1842fccac Refactor scale tests for minimal load. 2013-03-14 10:52:01 -07:00
Mike Bostock a6fa0c4f6b Refactor layout tests for minimal loading. 2013-03-14 10:35:04 -07:00
Jason Davies dd971666a6 Refactor selection tests for minimal loading. 2013-03-14 17:25:23 +00:00
Mike Bostock 697db5217a Refactor interpolate tests for minimal loading. 2013-03-14 10:18:11 -07:00
Mike Bostock 1ff5f504a9 Refactor geom tests for minimal loading. 2013-03-14 09:43:53 -07:00
Mike Bostock 480bfb6c51 Refactor geo tests for minimal loading. 2013-03-14 09:41:29 -07:00
Mike Bostock ae9d4a402a Refactor format tests for minimal loading. 2013-03-14 09:19:27 -07:00
Mike Bostock af25181df8 Refactor event tests for minimal loading. 2013-03-14 09:17:39 -07:00
Mike Bostock 8e9db961f9 Refactor dsv tests for minimal loading. 2013-03-14 09:16:05 -07:00
Mike Bostock 2831f6c7c4 Refactor cor tests for minimal loading. 2013-03-14 09:09:50 -07:00
Mike Bostock 97f034a44d Refactor color tests for minimal loading. 2013-03-14 09:06:31 -07:00
Mike Bostock f37405d1b8 Refactor array tests for minimal loading. 2013-03-14 09:00:13 -07:00
Mike Bostock 0f2b61ae93 Refactor svg tests using smash. 2013-03-14 08:46:45 -07:00
Mike Bostock e65d455ac6 Reuse global d3's document for xhr test. 2013-03-14 08:42:29 -07:00
Mike Bostock 5627ecdb9a Allow load expression to be overridden. 2013-03-14 08:16:52 -07:00
Mike Bostock 608902c907 Checkpoint test refactoring. 2013-03-13 23:21:23 -07:00
Mike Bostock 3442685b36 Refactor core tests using smash. 2013-03-13 19:16:59 -07:00
Mike Bostock 04fe8f8e4b Refactor color tests using smash. 2013-03-13 19:13:38 -07:00
Mike Bostock fe0d6f3ea6 Refactor array tests using smash. 2013-03-13 19:10:53 -07:00
Mike Bostock 5c4282f51a Don't import index; move ns to core. 2013-03-13 13:58:41 -07:00
Jason Davies d93f45ee82 Fix small-circle clipping of lines.
This corrects the handling of lines that are long enough to have two
visible or invisible endpoints, but still cross the small circle and
thus have an invisible or visible intermediate segment.

Fixes #1127.
2013-03-13 17:47:52 +00:00
Jason Davies 9d1925012d Support for {selection,dispatch}.on(".foo", null).
This allows all listeners with a particular name to be removed.

Fixes #880.
2013-03-13 12:15:17 +00:00
Mike Bostock 58dc604177 Move tests to match new source structure. 2013-03-13 02:08:02 -07:00
Mike Bostock d0441e6170 Automatic precision for custom tick formats.
You can now pass a format specifier to scale.tickFormat (for linear, pow and
identity scales). If the format specifier doesn't have a defined precision, the
precision will be set automatically by the scale, returning the appropriate
format. This provides a convenient, declarative way of specifying a format whose
precision will be automatically set by the scale.

This works with axes, too! For example, `axis.ticks(10, "%")` will now use a
percentage format rather than the default format, while still computing the
appropriate precision.

This commit also includes a fix to make d3.format more robust when unreasonable
precisions are specified. Rather than throwing an error, the nearest reasonable
value is used instead.

Fixes #912.
2013-03-11 18:06:05 -07:00
Mike Bostock ed81d3db2f Merge branch 'rotation-invert' of git://github.com/jasondavies/d3 into 3.1.0 2013-03-11 15:33:49 -07:00
Mike Bostock 13e2781206 More comprehensive projection tests. 2013-03-11 15:33:40 -07:00
Jason Davies 759947a2ad Add rotation.invert.
Fixes #1134.
2013-03-11 21:49:54 +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
Mike Bostock 8d3c6d43f6 JSDOM now correctly returns null.
Previous versions of JSDOM erroneously returned null rather than the empty
string, but this has now been fixed. Note: this depends on tmpvar/jsdom#582
which has not yet been merged to master.
2013-03-11 10:57:57 -07:00
Mike Bostock f1c8b090da Fix a couple bugs in d3_dsv.format. 2013-03-07 12:05:49 -08:00
Mike Bostock fe09bb0cc2 Allow objects as input to d3_dsv.format.
The previous implementation of format, which only supported arrays as input, is
retained as d3_dsv.formatRows; for backwards-compatibility, d3_dsv.format allows
both arrays and objects as input (to be removed in 4.0). This change makes
format and formatRows symmetric with parse and parseRows, respectively.

To compute the set of fields from all objects, two passes are required. Fields
are listed in discovery order, so that in the common case where all fields are
defined on all objects, the order of columns in the generated DSV will match the
property iteration order of the first object.

This supersedes #1106 and fixes #509; thank you to @smcgivern and @hammer for
suggesting this feature.
2013-03-07 07:53:08 -08:00
Mike Bostock c58471c9a9 Merge branch 'nest-map' into 3.1.0 2013-03-05 20:56:30 -08:00
Mike Bostock aad4969807 Merge branch 'insert-function' into 3.1.0 2013-03-05 20:54:58 -08:00
Mike Bostock 01f681213f Merge branch 'voronoi-layout' into 3.1.0 2013-03-05 20:49:22 -08:00
Mike Bostock 98d09c8aa7 Merge branch 'scale-log-base' into 3.1.0 2013-03-05 20:46:22 -08:00
Mike Bostock 66ca29e17a Merge branch 'dsv-parse-function' into 3.1.0 2013-03-05 20:45:54 -08:00