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

1816 Коммитов

Автор SHA1 Сообщение Дата
Jason Davies 7c28977420 Minor optimisation for d3.layout.pack.
Uses the identity sin^2(x) + cos^2(x) = 1.
2012-07-25 13:00:40 +01:00
Jason Davies 29a674b973 Add missing semicolon. 2012-07-25 10:58:06 +01:00
Jason Davies 1893f2941b Add transition.filter. Fixes #726.
Behaves the same as selection.filter.
2012-07-25 10:02:49 +01:00
Jason Davies c3716c72cb Minor optimisations to d3.interpolateTransform. 2012-07-24 21:25:55 +01:00
Jason Davies a40c1537da Retain d3.transform's public API.
That is, d3.transform is for decomposing a matrix.
2012-07-24 21:17:11 +01:00
Jason Davies feb2cefeae Amend previous commit to use private methods. 2012-07-24 19:49:39 +01:00
Jason Davies 839fcd4d4d Interpolate "same type" transforms in isolation.
For consistency with CSS3's 2D transforms, two transforms with the same
number of transform functions and corresponding functions of the same
type are treated differently: each transform function is interpolated in
isolation.

This allows us to interpolate many transforms that contain constant
functions in a more useful way, e.g.

  "rotate(<variable>)translate(<constant>)"

The variable rotation angle would now be linearly interpolated on its
own, keeping the constant translation vector constant.
2012-07-24 18:45:52 +01:00
Jason Davies e8f5d860e2 Fix #720: d3.time.dayOfYear floating-point error. 2012-07-23 18:34:39 +01:00
Jason Davies fe803629f1 Minor optimisation and Chrome bug workaround.
There appears to be a bug in Chrome causing the whole tab to crash when
setting svgNode.className.baseVal = "" for a newly-created element
without a non-empty class name:

  https://code.google.com/p/chromium/issues/detail?id=138552

This fix is a minor optimisation: if the current class is empty then
removing a class should be a no-op.  It also conveniently works around
the Chrome bug.
2012-07-23 16:15:01 +01:00
Nathan Vander Wilt 7c3f2cce20 pass group index (and any potential other arguments in future) on to event handler 2012-07-20 18:00:10 -07:00
Mike Bostock fd308af6ca Beautify d3.v2.js.
The main advantage of beautification is that we can add abundant source comments
to the original files without increasing the size of d3.v2.js.
2012-07-19 11:07:36 -07:00
Mike Bostock fb86373a3d Add generated file. 2012-07-19 11:02:35 -07:00
Mike Bostock 7442d95798 Merge branch 'date-2d' of git://github.com/jasondavies/d3 into fix-time-full-year 2012-07-17 14:00:08 -07:00
Mike Bostock 83b5f45997 Fix #711 for years in the first century.
Alas, the JavaScript Date constructor is Y2K-centric.
2012-07-17 13:45:34 -07:00
Mike Bostock 5c1cd6bd2c Add generated file. 2012-07-17 13:45:18 -07:00
Mike Bostock 544addb462 Fix node-canvas example. 2012-07-13 09:02:12 -07:00
Jason Davies 42b9253f96 Convert 2-digit years according to POSIX.
This is also the convention used by Python 1.5.2+. Values 69-99 are
mapped to 1969-1999, and values 0–68 are mapped to 2000–2068.
2012-07-10 16:40:19 +01:00
Jason Davies 69f02eb5fc Don't interpret double-pan as double-tap.
Firstly, the last-touched-time was being set on touchend, even if a pan
gesture had occurred. This caused a pan quickly followed by a single tap
to be interpreted as a double-tap. In this fix, the time is only set on
touchstart.

Secondly, the time is cleared on touchmove, so that a pan gesture
cancels double-tap detection.
2012-07-05 08:44:28 +01:00
Mike Bostock 8c9fed492b Add linear-closed interpolation. Fixes #610. 2012-07-04 11:22:08 -07:00
Mike Bostock 9cf2595fd1 Faster linear interpolation. 2012-07-04 11:21:05 -07:00
Mike Bostock c5d230d16e Merge branch '2.9.6' 2012-07-02 18:08:52 -07:00
Mike Bostock 2643a869a4 Merge branch 'fix-axis-transition' into 2.9.6 2012-07-02 18:06:53 -07:00
Mike Bostock 3d40415209 Merge branch 'faster-geo-path' into 2.9.6 2012-07-02 18:06:23 -07:00
Mike Bostock 306a3e35cb Merge branch 'fix-interpolate-hsl' into 2.9.6 2012-07-02 18:05:51 -07:00
Mike Bostock d0b0af50b6 Fix more bugs in circle clipping.
It was returning 0 rather than null when a feature was completely clipped, and
it was crashing when a closed polygon was completely clipped.
2012-07-02 17:42:23 -07:00
Mike Bostock 54b0dcba00 Optimize greatArc and circle.
When clipping, the origin of the great arc doesn’t change, so we can cache a
number of intermediate values and accelerate the clipping computation.
2012-07-02 16:58:54 -07:00
Mike Bostock 3c082bf245 Condense code slightly. 2012-07-02 10:59:06 -07:00
Jason Davies 8710e5bbd1 Add some unit tests for d3.geo.circle. 2012-07-02 17:02:52 +01:00
Jason Davies 9865daadf8 Only close clipped polygon if it is unclosed. 2012-07-02 17:02:44 +01:00
Jason Davies 10570e915d Fix #691: remove incorrect last interpolation step.
For closed polygons, the last point should simply be connected to the
first clipped point, rather than be clipped to the clipping circle.
2012-07-02 09:27:37 +01:00
Mike Bostock 53fa8f1a4a Custom d3.svg.{area,line} interpolators.
You can now specify a function as the interpolate property of a line or area,
allowing you to define custom interpolation behavior.
2012-06-30 10:35:58 -07:00
Mike Bostock fd6c591b76 Add support for outer padding on rangeBands.
Sometimes you want additional padding between the outer bands and the range
extent. Now you can.
2012-06-28 20:41:33 -07:00
Mike Bostock ae1fed7f4f Use shortest path for hue in d3.interpolateHsl.
Fixes #688.
2012-06-28 17:43:26 -07:00
Mike Bostock 66b439d433 Add d3.tsv for tab-separated values.
This makes the previous d3.csv code a bit more generic via a d3_dsv (delimiter-
separated values) module generator. Fixes #501. (Thanks, @vlandham!)
2012-06-28 12:58:39 -07:00
Mike Bostock d12f42d8a3 Faster d3.geo.path implementation.
Rather than creating separate arrays for each geometry, a shared buffer is used
and the array is only converted to a string once.
2012-06-28 12:21:32 -07:00
Mike Bostock 47adcf5d09 Add padding to d3.layout.pack.
The previous method of subtracting slightly from the radius introduces
distortion where smaller circles are disproportionately reduced. For example,
subtracting 1px from the radius scales a circle of radius 5px by 0.64x, while a
circle of radius 50px is only reduced by 0.96x.

By incorporating padding into the layout algorithm, the leaf circles’ area is
still proportional to the associated value. Due to the scale-independent nature
of the layout, the specified padding value is only approximate.
2012-06-27 20:20:22 -07:00
Mike Bostock f7ed0304bf Don't transition label positioning attributes.
The axis component no longer uses a transition for the text elements' dy and
text-anchor attributes. This makes it easier to style the labels using post-
selection, since the transition will not override custom attribute values.
2012-06-25 13:03:55 -07:00
Mike Bostock e71de33e31 Merge branch '2.9.5' 2012-06-24 11:03:14 -07:00
Mike Bostock a3ab896295 Merge branch 'fix-interpolate-rotate' into 2.9.5 2012-06-24 10:59:40 -07:00
Mike Bostock 9f96939022 Merge branch 'fix-classed-whitespace' into 2.9.5 2012-06-24 10:59:06 -07:00
Mike Bostock 8598dc40bf More robust fix to d3.interpolateTransform. 2012-06-24 10:43:13 -07:00
Mike Bostock 4142e432c4 Remove extraneous parens. 2012-06-24 10:00:28 -07:00
Mike Bostock bd229712fb Add generated files. 2012-06-24 09:59:41 -07:00
Mike Bostock cc359a9329 Fix bug with unexpected transition inheritance.
Prior to this change, transitions used transition.each internally, which had the
unexpected side-effect of enabling transitions on d3.transition(selection) when
called from within a tween function. This would only occur on the first
invocation of the tween function when the elapsed time between the transition
creation and the transition start was greater than the transition delay;
however, this is fairly common as the default delay for transitions is zero.

This bug caused unexpected behavior if you tried to redraw an axis within a
custom tween function: in some cases, the synchronous redraw of the axis would
compete with a concurrent transition, causing unexpected behavior. By avoiding
the use of transition.each internally, the user now controls when automatic
transitions are enabled.
2012-06-24 09:27:09 -07:00
Mike Bostock e4f4a31252 Merge branch 'master' into fix-interpolate-rotate 2012-06-21 17:37:34 -07:00
Mike Bostock 4059d3b3f5 Fix #661; d3.interpolateTransform for rotate. 2012-06-21 17:35:23 -07:00
Dirk Bergstrom 7e0daf2b4e Remove spurious whitespace from class name list before splitting to eliminate null strings, which generate an error from classed(value, false). Fixes #675. 2012-06-20 15:14:10 -07:00
Mike Bostock ad43a2e843 Merge branch '2.9.4' 2012-06-19 09:15:34 -07:00
Mike Bostock 4ff1d6610d Merge branch 'master' of https://github.com/geowa4/d3 into 2.9.4 2012-06-19 09:13:08 -07:00
Mike Bostock 554f26bff3 Merge branch 'xhr' of https://github.com/jasondavies/d3 into 2.9.4 2012-06-19 09:11:53 -07:00