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

517 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock 92a0ea172c Modify target aspect ratio implementation. 2011-05-27 15:48:54 -07:00
Jeffrey Heer 32b02b6902 Added configurable treemap layout 2011-05-14 12:38:20 -07:00
Mike Bostock 173a936d68 Merge branch 'release' 2011-05-12 11:56:15 -07:00
Mike Bostock 4c998ba2cc Propagate touch identifier in d3.svg.touches.
Also, add a fun little example demonstrating multi-touch.
2011-05-12 11:54:38 -07:00
Mike Bostock f1a2f62dcb Simplify touches code slightly. 2011-05-12 11:28:31 -07:00
Mike Bostock bdc7023776 Merge branch 'touch' into release 2011-05-12 11:26:09 -07:00
Mike Bostock 3018f873c1 Rewrite stack layout for flexibility.
The stack layout can now operate on arbitrary data structures, rather than
requiring a specific input format. To do this, you can now specify functions to
access values per series, along with x- and y-coordinates.

One tricky thing is that the stack layout needs to be able to write the stacked
values back into the data; this is accomplished using the customizable `out`
function. This function takes three arguments: the current datum (d), the offset
value (y0), and the y value. The y value is unchanged unless the "expand" offset
is used.

This commit also allows you to specify arbitrary functions for order and offset
computation, in addition to the built-in methods supported previously.
2011-05-12 10:56:31 -07:00
Mike Bostock 25a3a503b5 Add d3.permute. 2011-05-12 10:25:05 -07:00
Jason Davies ab28a0c833 Revert "Remove usage of d3_array for efficiency."
This reverts commit 1bb3e9b025.

The performance difference is negligible, and using d3_array results in smaller
code.
2011-05-12 17:20:07 +01:00
Jason Davies 1bb3e9b025 Remove usage of d3_array for efficiency.
This avoids unnecessarily creating a new array for every touch event.
2011-05-12 10:10:04 +01:00
Jason Davies a5f140709c Add d3.svg.touches for multitouch support. 2011-05-11 17:26:48 +01:00
Jason Davies 5f2e430f25 Add touch support to `d3.svg.mouse`.
This doesn't quite seem like the right place for it, but it seems to work when
using "touchstart", "touchmove" and "touchend" handlers without any adverse
effects on "true" mouse event handlers.

See <http://www.jasondavies.com/apollonian-gasket/> to see an example of
combined touch/mouse handlers working with this change.
2011-05-10 22:42:16 +01:00
Mike Bostock 7c518c547c Merge branch 'polylinear' 2011-05-08 19:54:40 -07:00
Mike Bostock 7ead68822b Delete d3.search.
Not needed for now, since I opted to create customized versions internally.
2011-05-08 19:52:12 -07:00
Mike Bostock c99678e6cf Rename a variable. 2011-05-07 23:24:42 -07:00
Mike Bostock e67e7d7d8b Refactor polylinear scales.
This commit adds a d3_uninterpolate method (private, for now), which is
essentially the inverse of d3.interpolate. It's used to map a value in the
domain to the unit range [0,1], which can then be passed to an interpolator.
2011-05-07 23:20:02 -07:00
Mike Bostock 5d05154ae6 Merge branch 'release' 2011-05-07 16:51:30 -07:00
Mike Bostock 978a3ceaa8 Merge branch 'stack' into release 2011-05-07 16:47:46 -07:00
Mike Bostock e1c6c74f70 Merge branch '===' into release 2011-05-07 16:42:59 -07:00
Mike Bostock ce808da5b3 Merge branch 'immediate-transitions' into release 2011-05-07 16:39:46 -07:00
Mike Bostock ef905bcf1b Merge branch 'data-listeners' into release 2011-05-07 16:35:30 -07:00
Mike Bostock b1b6b14143 Merge branch 'monotone' into release 2011-05-07 16:34:01 -07:00
Mike Bostock 7367df8050 Improved monotone interpolation.
Mainly, I fixed a bug where the coordinates could get set to NaN if two
successive points have the same x-coordinate. But I also cleaned up the
implementation slightly, and compute the initial tangents using finite
differences.
2011-05-07 16:32:48 -07:00
Mike Bostock 8aa986dff1 Merge branch 'issue-78' into release 2011-05-07 11:28:48 -07:00
Mike Bostock 1c413cda33 Add tests for classed. 2011-05-07 11:27:48 -07:00
Mike Bostock 99e2a55614 Cleverly compacted `classed` code.
We can take advantage of JavaScript's invisible hoisting of variables to set
them before they are defined. This simplifies the code for the various special
cases in the `classed` operator, such as for SVG elements and browsers that
support the tokenized class list.
2011-05-07 11:21:59 -07:00
Mike Bostock bf5374423f Merge branch 'color' into release 2011-05-07 11:09:44 -07:00
Mike Bostock 6a2c0ef053 Add tests for hsl. 2011-05-07 11:08:48 -07:00
Mike Bostock 59b5ba99be Reorganize some color functions. More tests. 2011-05-07 10:59:49 -07:00
Mike Bostock 316526a09e Revert behavior of d3.keys.
We include keys inherited from the prototype.
2011-05-07 10:32:17 -07:00
Jason Davies 09cbe4d82b Rename "group" to "node". 2011-05-05 21:46:49 +01:00
Jason Davies 4024cb6681 Add .hsl().brighter() and .hsl().darker().
Also fix .rgb() and .hsl().
2011-05-05 21:44:40 +01:00
Jason Davies fa2f325c9d Fix typo.
Thanks Mike!
2011-05-05 21:25:45 +01:00
Jason Davies 9e51c6efa3 Propagate data changes to event listeners.
Event listeners are still bound to the index at the time of binding, but data
changes are now visible from the event listener.

Fixes #88.
2011-05-05 18:53:52 +01:00
Jason Davies a591160109 Use prototypes for `d3.rgb()` and `d3.hsl()`.
This turns out to be slightly faster than using structs (`{}`) and is bit
cleaner.  You can now also do:

    d3.rgb(r, g, b).hsl()

and:

    d3.hsl(h, s, l).rgb()

to convert between RGB and HSL.
2011-05-05 17:27:43 +01:00
Jason Davies 8d2bc4b1b3 Simplify `classList` & `className.baseVal` logic. 2011-05-05 16:25:49 +01:00
Jason Davies 2280d51c9d Revert "Use a more precise check for "baseVal" property."
This reverts commit 94d0e1aa18.
2011-05-05 16:20:54 +01:00
Jason Davies 1a83029485 Polylinear scales. Fixes #61.
For example:

    d3.scale.linear()
        .domain([-100, 0, 100])
        .range(["red", "white", "green"]);
2011-05-05 15:29:17 +01:00
Jason Davies 94d0e1aa18 Use a more precise check for "baseVal" property. 2011-05-05 13:31:24 +01:00
Jason Davies 333ddeb07c Use `element.classList` for classed operator.
This is only used if available, and falls back to the regex-based implementation
e.g. for SVG nodes.  See #96.
2011-05-05 13:30:06 +01:00
Jason Davies 668cdaa767 Add `brighter` and `darker` to d3.rgb().
Fixes #138.
2011-05-05 12:38:55 +01:00
Mike Bostock 01bf83601f Add "expand" stack offset. 2011-05-03 16:23:09 -07:00
Jason Davies bf1be6f5cc Set className to `""` instead of `null`.
Retrieving it in Chrome returns `""` after setting it to `null` anyway.
2011-05-03 17:27:02 +01:00
Jason Davies 7ab5e3567f Better fix for classed operator. Fixes #78. 2011-05-03 17:17:03 +01:00
Jason Davies 05442751f9 Use "Object.keys" if available.
Also added "hasOwnProperty" check in the fallback to avoid enumerating
properties from the prototype chain.  This is the approach recommended in
<https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys>
and elsewhere.

See also: #96.
2011-05-03 13:40:27 +01:00
Jason Davies 1578595a18 Fix classed operator for SVG elements. Fixes #78.
Specifically, removal of a class wasn't working because the `className` property
for SVG elements is an SVGAnimatedString, which has no `replace` method.

It would be nice to have a unit test for this, but env-js doesn't use
SVGAnimatedString for this property.
2011-05-03 12:24:51 +01:00
Jason Davies 33486bb8f9 Minor code simplification. 2011-05-03 11:26:43 +01:00
Mike Bostock a3aebbad56 Merge remote-tracking branch 'jasondavies/monotone' into basis 2011-05-02 18:46:08 -07:00
Mike Bostock a0d4d0bd8e Add cardinal-open interpolation. 2011-05-02 18:42:39 -07:00
Mike Bostock d1c406f43c Add basis-open interpolation. 2011-05-02 17:11:44 -07:00