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

3157 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock 7d638022d1 Fix typo. 2014-04-02 10:30:06 -07:00
Mike Bostock 40551b7701 Transcribe algorithm, to the best of my understanding. 2014-04-02 10:28:44 -07:00
Mike Bostock fa55eead41 Merge branch '3.4.4' 2014-03-24 20:45:44 -07:00
Mike Bostock 994235b3f9 Test for interpolate to null.
I’m not entirely sure this is the most useful behavior, but since typeof null is
"object" and +null is 0, interpolating to null is equivalent to interpolating to
the number zero.
2014-03-24 09:02:48 -07:00
Mike Bostock d3bbf394af Save a few bytes. 2014-03-23 22:57:35 -07:00
Mike Bostock abbe1c75c1 Preserve tick ordering when updating axis.
Fixes #1748.
2014-03-23 22:53:07 -07:00
Mike Bostock b86e4e4ae1 Getter support for transition.{delay,duration}.
Fixes #1773.
2014-03-23 22:53:07 -07:00
Mike Bostock 28538c40d2 Default to suitable precision.
The point of this method is to pick the right precision for you!
2014-03-23 22:53:07 -07:00
Mike Bostock fe797df41e More standard precision interpretation.
Rather than overload the meaning of precision to bias the selection of the SI
prefix, always use the standard SI prefix, and use the precision in the same
sense as with fixed digits: the number of digits after the decimal point.
2014-03-23 22:53:03 -07:00
Mike Bostock 621558c28f Consistent SI-prefix for small numbers.
For reasons that I can’t recall, the SI-prefix behavior was different for small
numbers (between -1 and 1) than it was for large numbers. This commit enforces
consistent behavior, so that the coefficient is always in the range [1, 1000),
like in engineering notation.

For example, the old d3.format("s") would display 0.01 as "0.01", whereas the
new behavior displays it as "10m".
2014-03-23 22:52:59 -07:00
Mike Bostock 91531cf7ff Consistent SI-prefix for ticks. Fixes #1746.
When a SI-prefix format (type "s") is passed to scale.tickFormat, compute a
suitable SI-prefix based on the maximum value in the range, and then use that
prefix for all ticks rather than computing the SI-prefix on a per-tick basis.
2014-03-23 22:52:54 -07:00
Mike Bostock d6ca25e87d Fix ordinal scales with singleton domains.
Fixes #1717. Turns out, -1 % 1 is 0!
2014-03-23 22:52:50 -07:00
Mike Bostock f9e00b1d35 Listen to the touch target.
This ensures that if the touch target is removed from the DOM during a zoom
gesture, the zoom behavior continues to receive events; touch events, unlike
other events, are always dispatched to the target of the touchstart event rather than the window.
2014-03-23 22:52:50 -07:00
Mike Bostock e03b645429 Better ticks for subsecond domains.
Rather than starting the ticks on the minimum domain value, round up based on
the step size. Fixes #1757.
2014-03-23 22:52:46 -07:00
Darrick Brown d9768e527d 100% to 125% faster #rgb/#rrggbb string parsing across all platforms. Tests pass. http://jsperf.com/rgb-str-vs-regex 2014-03-23 22:52:42 -07:00
Timmy Willison 086de835b2 Shorten selectAll to just `Sizzle` 2014-03-23 22:52:42 -07:00
Timmy Willison 336f3afc8c Remove redundant Sizzle.uniqueSort call 2014-03-23 22:52:31 -07:00
Mike Bostock defe5bc848 Clamp latitude for conic conformal projection.
The Lambert conic conformal projection extends to infinity along the outer edge
of the projection, and thus the latitude must be clamped either at -π/2 or +π/2
depending on the parallels. Fixes #1802.
2014-03-23 22:52:25 -07:00
Mike Bostock 2b14807055 Remove workaround for WebKit bug 44083.
This was fixed in 2010, so I think it’s safe to remove the workaround now.
2014-03-23 22:52:19 -07:00
Mike Bostock 467f1490c9 d3.touch defaults to changedTouches.
This way, it’s easier to tell whether the touch changed during the event. This
also fixes #1600 because the drag behavior now only dispatches a drag event on
elements that moved, even if multiple touches are active.
2014-03-23 22:52:13 -07:00
Mike Bostock 387249155f Add d3.touch; fix #1786.
The drag behavior no longer crashes when the element being dragged is removed
from the DOM. In addition, the new d3.touch method extracts a single identified
touch from the current touch event, making it more efficient during multitouch.
The drag behavior now assigns touchmove and touchend listeners on the target
element of the touchstart event, rather than the window.
2014-03-23 22:52:06 -07:00
Mike Bostock ee23f94141 Fix all touches ending on any touch ending.
The drag behavior registers a touchend listener for each started touch; however,
a touchend event is dispatched to ALL listeners when any touch ends, not just
for the corresponding starting touch. The drag behavior must therefore detect
whenever the ending touch is the corresponding starting touch, and ignore other
ending touches.

This fixes the drag behavior during multitouch, as discussed in #1786.
2014-03-23 22:51:47 -07:00
Mike Bostock 947c609050 Prefer interpolateNumber when coercible to number.
Objects that are coercible to numbers, such as Dates, are often more usefully
interpolated as numbers rather than as objects.
2014-03-23 22:51:26 -07:00
Mike Bostock 90b6c0b913 Instead of bisectBy, replace bisector.
For backwards-compatibility, bisector checks the arity of the specified
function, and if the function only takes a single argument, it is wrapped with a
suitable comparator.
2014-03-23 22:51:07 -07:00
Mike Bostock 3c7cc81b62 Add d3.bisectBy(comparator).
Fixes #1766. Unlike d3.bisector(accessor), this allows you to define a bisector
that works in reverse order.

An awkward aspect of implementing bisection on top of a comparator is that it is
often the case that the sorted array contains objects (e.g., rows from a TSV),
while the search value is a primitive value (e.g., a number). Thus, you want to
apply an accessor to the array elements but not to the search value.

The solution here is to invoke the comparator deterministically: the first
argument is always an element from the array, and the second argument is always
the search value. This lets a comparator apply an accessor to array elements but
not to search values.
2014-03-23 22:51:07 -07:00
Mike Bostock adeaf20195 Merge pull request #1800 from rogerbramon/ca_ES-locale
Add ca-ES for localization
2014-03-23 20:24:32 -07:00
Mike Bostock d3cf1ef94e Merge pull request #1801 from jimkang/fix-quadtree-child-tests
Fix quadtree tests that check the children of a node
2014-03-22 07:35:26 -07:00
Jim Kang a2fae346b0 Updated quadtree tests to check the `nodes` property of the node (a d3_geom_quadtreeNode) instead of treating the node as an array (which it is not) and trying to check indexes within it. e.g. `node[2]`. 2014-03-22 00:50:22 -04:00
Roger Bramon 17e1f96730 Add ca-ES for localization 2014-03-21 22:04:36 +01:00
Jason Davies 8e1ec1e74b Fix typos in optional locale definitions. 2014-03-20 14:24:57 +00:00
Jason Davies 260d144ba2 Add optional en_GB locale.
Also, expose the optional zh_CN locale as d3.locale.zh_CN.
2014-03-20 14:20:55 +00:00
Mike Bostock e4d5da3dc7 Merge pull request #1781 from fabriciotav/master
Add pt-BR for localization.
2014-03-17 08:10:35 -07:00
Fabricio Tavares de Oliveira cc64f19b94 Add pt-BR for localization.
Taken into account multiple locales support, and not custom build.
2014-03-17 10:11:34 -03:00
Mike Bostock 17b4acf410 Merge pull request #1775 from Alex--wu/master
Add zh-CN for localization
2014-03-13 08:07:42 -07:00
Alexander WU eb404805a6 Add zh-CN for localization 2014-03-13 14:30:06 +01:00
Mike Bostock a120375e56 Copyright year should be a range? 2014-03-09 11:14:50 -07:00
Mike Bostock a4bd16705e Merge branch 'safe-sin' 2014-02-27 07:50:18 -08:00
Jason Davies bef5de7510 Workaround for lack of symmetry in Math.sin.
Chrome 33 included some sin/cos optimisations, which unfortunately broke
our assumption that sin(-x) + sin(x) = 0 for all x.  More details here:

  https://code.google.com/p/v8/issues/detail?id=3006

This fix uses:

  sin(x) = sgn(x) * sin(abs(x))

and:

  cos(x) = cos(abs(x))

where it matters, which fixes area calculations for degenerate polygons
such as:

  {"type":"Polygon",
   "coordinates":[[[-0.0002,0.0001],[0.0002,0.0001],[-0.0002,0.0001]]]}

Fixes #1753.
2014-02-27 00:29:52 +00:00
Mike Bostock 04fa5dd385 Merge branch 'fix-prefix' 2014-02-18 08:39:33 -08:00
Mike Bostock 0cb6cd9283 Tweak comment. Add another test. 2014-02-18 08:38:48 -08:00
Mike Bostock 5c3d51c515 Merge branch 'master' of github.com:jbblanchet/d3 into fix-prefix 2014-02-18 08:19:56 -08:00
Mike Bostock aaa35858da Merge pull request #1721 from gdi2290/patch-1
update copyright year
2014-02-18 08:14:25 -08:00
jbblanchet d42e8c7bc5 Updated test/locale for suffix bug 2014-02-11 21:29:15 -05:00
jbblanchet fee2a08eda Update number-format.js
Corrects bug where currency suffix was overwritten by SI-prefix formatting.
2014-02-11 14:33:51 -05:00
PatrickJS 92c831befe update copyright year 2014-02-03 02:04:15 -08:00
Mike Bostock b3d9f5e63b Merge pull request #1705 from zerolinux5/patch-1
add _site
2014-01-21 08:10:09 -08:00
Jesus Magana 4e4257f076 add _site 2014-01-20 18:51:51 -08:00
Mike Bostock 13293dfde0 Merge pull request #1699 from kmindi/add-composer
adds composer.json closes #1674
2014-01-16 09:57:14 -08:00
Mike Bostock 441e8a4f4d Abbreviate per @maxogden. 2014-01-15 14:34:25 -08:00
kmindi 613824b5d2 corrects package name to include vendor 2014-01-15 08:14:28 +01:00