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

151 Коммитов

Автор SHA1 Сообщение Дата
Michael Bostock 39a32e17d1 Merge branch 'jasondavies-csv_newlines' 2011-03-17 17:52:55 -07:00
Michael Bostock 87a9b002e5 Merge branch 'csv_newlines' of https://github.com/jasondavies/d3 into jasondavies-csv_newlines 2011-03-17 17:35:04 -07:00
Michael Bostock 4fcff607ab Allow `ease` to pass additional arguments. 2011-03-17 10:24:02 -07:00
Michael Bostock 937529eff3 Merge branch 'jasondavies-ie9_xhr' 2011-03-15 09:24:45 -07:00
Jason Davies f7cee9c225 Workaround for IE's lack of xhr.overrideMimeType.
This doesn't appear to be supported even in IE9, which means the server
must set the correct content type to get the correct mime type
behaviour.  I think this is only important to trigger XML parsing but
I'm not sure.
2011-03-15 13:06:36 +00:00
Michael Bostock bb6f3c6ca0 Merge branch 'mbostock-master' 2011-03-14 23:43:45 -07:00
Michael Bostock 5f4e950002 Sticky treemap layouts!
The treemap layout can now be set to "sticky" mode, which preserves the row
arrangements from an earlier layout. This is particularly handy for animating
treemaps, as it avoids the temporary occlusion as nodes swap positions. Thanks
to @philogb and the New York Times for the inspiration!
2011-03-14 23:39:11 -07:00
Michael Bostock 723a531874 Fix a type-coercion bug with scale domains. 2011-03-13 11:38:10 -07:00
Michael Bostock e6b0924aa8 Merge branch 'mbostock-master'
Release 1.7.0. Adds partition & hierarchy layouts, step-{before,after}
interpolation for line & area, sorting for treemaps, and a few bug fixes for
time format. Oh, and a bunch of tests!
2011-03-12 21:52:00 -08:00
Mike Bostock 52bf6c978a Expose d3.layout.hierarchy.sort.
Also, add nifty transitions to the sunburst example.
2011-03-12 21:14:07 -08:00
Mike Bostock ff9da42269 Fix a couple bugs in d3.time.format.
First, we were using the wrong space-filling format for %d and equivalent.
Second, we weren't parsing numbers with optional leading spaces correctly.
Yay tests!
2011-03-12 17:00:55 -08:00
Jason Davies e6d21d4d12 Fix newline parsing for quoted values. 2011-03-12 21:25:39 +00:00
Mike Bostock aad495add3 Add step-{before,after} interpolation.
Also add tests for d3.svg.area and d3.svg.line.
2011-03-12 12:43:51 -08:00
Jason Davies 2248e04ae4 Fix CSV parsing of \r\n and \r 2011-03-12 20:43:15 +00:00
Michael Bostock abae3f9263 Add hierarchy & partition layouts.
Also, expose d3.rebind to make it a bit easier to compose classes.
2011-03-12 10:27:05 -08:00
Mike Bostock 26662dec2a Merge branch 'mbostock-master' 2011-03-12 08:29:26 -08:00
Mike Bostock a6d5b6f4de Merge branch 'jasondavies-new_closure_compiler' into mbostock-master 2011-03-12 08:27:58 -08:00
Mike Bostock 651fb56c0a Minor tweaks to d3_call and tests. 2011-03-12 08:25:49 -08:00
Jason Davies 673151160b Workaround for overzealous d3.call minification 2011-03-12 11:17:16 +00:00
Mike Bostock 996e21eb1b Fix typo in d3.scale.pow. Add tests. 2011-03-10 17:33:53 -08:00
Michael Bostock 166f8b5868 Expose d3.timer, for requestAnimationFrame.
This allows external classes to hook into D3's timer mechanism, such as the
iterative force-directed graph layout.
2011-03-08 23:29:59 -08:00
Michael Bostock e15183c32a Ack, forgot to update d3.version. 2011-03-08 14:52:42 -08:00
Michael Bostock 9857dade14 Woot, requestAnimationFrame! 2011-03-08 14:23:31 -08:00
Michael Bostock eaed6b880b Ack, Sizzle doesn't sort by default.
The Selectors API guarantees that results are returned in document order, but
Sizzle does not, by default. So now we sort the results when using Sizzle. Yay
tests!
2011-03-04 16:05:53 -08:00
Michael Bostock 50ebc155cb Test (and fixes) for d3.format. 2011-03-04 15:25:09 -08:00
Michael Bostock 36e935a8c8 Add force & treemap to d3.layout. 2011-03-03 15:43:57 -08:00
Mike Bostock 0585616df1 Add support for sortKeys on d3.nest.
The method existed previously, but it only makes sense in conjunction with the
newly-added `entries` operator; map keys are inherently unsorted. Originally I
envisioned that key-sorting could be done externally using `d3.entries`, but
that's tedious for hierarchical structures.
2011-03-01 12:01:09 -08:00
Michael Bostock 1d9ed5ae72 Add d3.interpolateHsl.
This allows scale interpolation in HSL space. For example:

    var fill = d3.scale.linear()
        .interpolate(d3.interpolateHsl)
        .domain([0, 100])
        .range([d3.hsl(180, .5, 1), d3.hsl(180, .5, 0)]);

You could approximate this in previous versions using d3.interpolateString, but
the new interpolation method is slightly faster and also provides backwards-
compatibility for browsers that only understand RGB.
2011-02-27 15:05:18 -08:00
Michael Bostock a29c802a77 Sort for layout, but don't reorder.
This fixes a bug in the pie layout sorting where we want the sort order to
affect the layout, but not the order in which arcs are rendered—and furthermore
we want the order of arcs to always match the order of data. (If you want to
sort the data, do that before it is passed to the layout.)
2011-02-24 14:36:57 -08:00
Michael Bostock ade083dd56 More convenient pies.
This adds d3.layout.pie, which can be used to compute the start and end angles
for arcs given an arbitrary array of data. In addition, d3.svg.arc now has a
`centroid` method that computes the center of the arc, useful for labeling.
Together these changes greatly simplify the donut & pie examples.

This commit also includes a `map` method for selections, which is similar to the
`filter` method. This allows you to map the data bound to the current selection.
I'm not currently using it, but it seems like a useful feature for those cases
where you want to rebind the current selection to different (but related) data.
2011-02-24 14:13:05 -08:00
Michael Bostock 77f81a01fa Merge branch 'master' of github.com:mbostock/d3
Conflicts:
	src/core/core.js
2011-02-23 12:35:41 -08:00
Michael Bostock 3ecb7534ef Non-contiguous cartogram example.
Also includes new d3.geom.polygon.centroid method. Props to Zachary Johnson for
the inspiration!
2011-02-23 12:33:18 -08:00
Mike Bostock 59c32fc669 Fix subgroup sorting in chord layout. 2011-02-23 09:09:43 -08:00
Michael Bostock 6d8a51b7de Merge branch 'array_slice' of https://github.com/jasondavies/d3 into jasondavies-array_slice
Conflicts:
	src/core/call.js
2011-02-19 12:41:21 -08:00
Michael Bostock d563b53d13 Remove slice(arguments). 2011-02-18 15:10:17 -08:00
Jason Davies e6bfd66443 Split `d3_array` into `d3_arrayNodes` and `d3_arrayArguments`. 2011-02-18 19:50:26 +00:00
Jason Davies fe5fdb31c0 Fix `d3_array` for older/more esoteric browsers.
This code is adapted from `makeArray` in Sizzle.js.
2011-02-18 18:40:35 +00:00
Michael Bostock 8da80dcc99 Support for Sizzle.
D3 now supports Sizzle, preferring Sizzle to the native Selectors API if Sizzle
is available. Sizzle internally uses the native Selectors API and thus this
should have minimal performance implications; also, it allows you to use Sizzle
proprietary extensions such as ":first".

This commit also restricts the definition of the enter selection so that only
append and insert operations are defined. The other operations were generally
unsupported anyway, and it cleans up the code to have separate implementations
for insert and append. (I might enable additional operations in the future, such
as `filter`, `sort` and `each`, but this seems like a reasonable first pass.)
2011-02-17 11:56:13 -08:00
Michael Bostock c31590e2f7 Add support for namespaced listeners.
You can now also remove listeners by specifying a null listener.
2011-02-16 09:53:48 -08:00
Jason Davies 67f122b176 Fix scroll events for Firefox 2011-02-16 13:26:54 +00:00
Michael Bostock 77a061f26d Add d3.svg.symbol.
The `symbol` class can be used to generate dot symbols for scatterplots. This
commit also fixes a couple bugs with negative-domain log and pow scales, as well
as tick generation.
2011-02-13 23:20:10 -08:00
Mike Bostock 0e1c1fad17 Add d3.geo.bounds.
This method can be used for computing the bounding box of arbitrary GeoJSON
objects. This commit also fixes a bug in d3.geo.path, such that it will accept
any GeoJSON object, rather than requiring GeoJSON feature objects.
2011-02-11 19:42:52 -08:00
Michael Bostock d215acef78 Add d3.behavior module.
Includes, as the first behavior, a pan & zoom behavior. The canvas can be panned
by dragging the mouse, and zoomed using the mousewheel (or by double-click). By
listening to redraw events, users can decide whether to implement geometric
zooming (such as by setting the "transform" attribute on an `svg:g` element) or
semantic zooming (by changing the domain of a scale object and repositioning
elements).

This commit also includes two bug fixes. The `d3.format` class now properly
groups thousands of negative numbers, and supports the sign specifier. The
unicode minus symbol \u2212 is used for negative values. The `d3.scale.pow`
class now properly handles negative numbers, as well.
2011-02-11 13:00:41 -08:00
Michael Bostock b4231227e1 Fix two bugs in transitions.
First, always coerce the tween target value (the value of the style or attribute
at the end of the transition) to a string. This guarantees that the correct
interpolator is chosen, and avoids a null dereference.

Second, default color channels to zero rather than undefined, so as to avoid NaN
channel values if there is an error parsing the color. This can occur, say, if
the background color of a div is unset and defaults to "rgba(0, 0, 0, 0)".
2011-02-08 15:59:03 -08:00
Michael Bostock 99c31e1637 Don't include empty arrays in d3.split. 2011-02-02 12:59:10 -08:00
Michael Bostock ea5ebb1304 Don't use the null context.
Instead, use the group data array as the context when evaluating the join key
function on the new data.
2011-02-02 12:10:39 -08:00
Michael Bostock f8ae20da9d Simplify data join. Add insert & empty.
The data join is now specified as a single function of data, as with all other
properties. This allows the key to be computed on the previously-bound data,
rather than requiring the key to be serialized into the DOM (say, as an
attribute). In the case that there is no previously-bound data, it is still
possible to access the associated node as the `this` context.

The `enter` operator no longer performs an append. For symmetry with the `exit`
operator, you must call `append` after obtaining the entering selection. This
requires a tiny bit more code, but should make the code more clear. Also, it
provides an opportunity to use a different instantiation operator, such as the
new `insert` operator. This takes a second argument, which is a selector for the
insert-before reference element. For example, the selector ":first-child" will
prepend nodes.

The `empty` operator allows you to query whether a selection is empty (i.e.,
contains zero matching nodes).
2011-01-31 11:00:35 -08:00
Michael Bostock 1de75bc55c Fix Firefox bug with style transitions.
You can't set the priority to be undefined; it has to be null. (Even though
null == undefined in JavaScript, but let's not be picky!)
2011-01-28 16:26:09 -08:00
Michael Bostock 811aa10f03 Scale interpolators & range rounding.
You can now override the scale interpolator by calling the `interpolate` method.
One particularly useful interpolator is the new `d3.interpolateRound`, which is
like `interpolateNumber`, except that it returns integers. This makes it easier
to produce a scale that outputs exact pixel values, and avoid antialiasing
artifacts.

For convenience, the quantitative scales have a `rangeRound` method which sets
the range and the interpolator at the same time. Similarly, a `rangeRoundBands`
has been added to the ordinal scale.
2011-01-28 13:14:43 -08:00
Michael Bostock 5748994854 Add d3.scale.quantize.
A quantize scale is much like a linear scale, but it returns a discrete value
from a set range (similar to quantile and ordinal scales).
2011-01-25 11:31:54 -08:00