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

82 Коммитов

Автор SHA1 Сообщение Дата
Jason Davies 0b8aa07ed2 Rename "boxplot" to "box". 2011-04-13 22:31:53 +01:00
Jason Davies 2e8cd200df Add boxplot chart. 2011-04-13 19:57:57 +01:00
Jason Davies f208a5be09 Add Reingold-Tilford tree layout.
This is based on the Protovis layout; virtually no changes were needed
to the code aside from handling of previous and next siblings.
2011-04-10 16:20:51 +01:00
Mike Bostock 3e1e4f1e7c Add remove test. 2011-04-09 12:08:22 -07:00
Mike Bostock 0f8c8007a6 Add insert test. 2011-04-09 12:05:55 -07:00
Jason Davies edf75a3c36 Move bullet to new `chart` module. 2011-04-07 17:54:03 +01:00
Jason Davies 28fbabf768 First stab at bullet layout. 2011-04-06 19:47:55 +01:00
Mike Bostock 96f6374f72 Merge branch 'uglifyjs' of https://github.com/jasondavies/d3 into jasondavies-uglifyjs 2011-04-05 10:22:51 -07:00
Michael Bostock c572c7071f Add basic tests for d3.nest. 2011-03-26 18:50:32 +01:00
Jason Davies 1dfd3350dc Replace Google's closure compiler with UglifyJS.
UglifyJS requires Node.js to run, but it's a lot faster than Google's
compiler and produces smaller gzipped sizes.  Some of the non-gzipped
sizes are a bit larger than Google's but I think the gzipped size is
more important.  Faster runtime is also good when we start testing the
minified versions too.
2011-03-25 10:28:41 +00: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 723a531874 Fix a type-coercion bug with scale domains. 2011-03-13 11:38:10 -07:00
Mike Bostock 244338925f Add tests for d3.svg.arc. 2011-03-12 20:24:17 -08:00
Mike Bostock 3fff37a56d Add tests for d3.svg.symbol. 2011-03-12 20:17:31 -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
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 a6d5b6f4de Merge branch 'jasondavies-new_closure_compiler' into mbostock-master 2011-03-12 08:27:58 -08:00
Jason Davies d2ede7ce69 Add unit test for minified d3.call(). 2011-03-12 12:09:30 +00:00
Mike Bostock 996e21eb1b Fix typo in d3.scale.pow. Add tests. 2011-03-10 17:33:53 -08:00
Michael Bostock 871cefc0a4 Add a few tests for d3.scale.linear. 2011-03-08 14:24:23 -08:00
Michael Bostock 1be121ae20 Unplug env-js' timer module.
This was breaking setTimeout and setInterval in Node, since I've already
unplugged env-js' event loop. With that out of the way, we can write tests for
transitions!
2011-03-04 16:35:16 -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
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 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 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
Michael Bostock 1a6163cb1a Add d3.geom.quadtree. 2011-01-21 11:59:05 -08:00
Michael Bostock 65307730a3 Add d3.layout.stack, d3.min, d3.max. 2011-01-17 12:27:29 -08:00
Michael Bostock 487037e1af Merge branch 'jheer-master'
Adds support for contours (d3.geom.contour) and cardinal spline interpolation.
I've extended cardinal spline interpolation to d3.svg.area, and added closed
basis spline interpolation. The spline tension is now set using a named
method, and closed splines can be generated using basis-closed and
cardinal-closed, respectively.

This commit also includes Jeff's nifty clustered force-directed graph example!
2011-01-10 16:05:58 -08:00
Michael Bostock 373ddee706 Add nest, keys, values & entries operators. 2011-01-08 15:18:38 -08:00
Michael Bostock bdcb648849 Turn off the compiler's "advanced" optimizations.
The renaming of attributes is totally not worth the hassle of maintaining an
externs file (or using the awkward `foo["bar"]` syntax). The file size
reduction from the advanced optimizations was negligible, besides!
2011-01-05 11:35:39 -08:00
Michael Bostock 19d478f3e0 Add quantile scale. 2011-01-03 10:30:36 -08:00
Jeffrey Heer 5067f0a35d Move cardinal splines to svg/line.js 2010-12-15 22:06:24 -08:00
Jeffrey Heer 633a931f5b Add cardinal splines and clustered graph example 2010-12-15 09:32:29 -08:00
Jeffrey Heer 70cb5359c9 Merge branch 'master' of git://github.com/mbostock/d3 2010-12-15 08:46:23 -08:00
Mike Bostock 2bdf55ce9c Better XHR utilities.
Two new XHR utilities are included in this commit for fetching XML and HTML
data. The latter can be used to scrape data from websites that don't support a
more suitable API (such as JSON or XML), conveniently using the W3C DOM API
including selectors.

Parsing HTML is surprisingly tricky, as browser support for it is poorly
standardized. It's possible to embed the HTML in the current document or an
iframe, but that runs embedded scripts and loads external resources (images,
stylesheets), which is a security hazard!

Our approach uses the DOM Level 2 Range API, and the nonstandard
createContextualFragment method, which is supported by major browsers.
Strangely, WebKit (Chrome & Safari) can only access the body of the loaded
HTML document, whereas Firefox parses the whole document.
2010-12-09 15:04:24 -08:00
Jeffrey Heer ecf796c04a Added contour by marching squares 2010-12-06 20:27:25 -08:00
Michael Bostock 6d97ab2218 Add `classed` operator for toggling CSS classes. 2010-11-30 13:40:05 -08:00
Mike Bostock 6307364a45 Add layout module, with layout.chord class. 2010-11-28 13:15:07 -08:00
Mike Bostock 5ae51b2538 Simplify svg.chord API.
We now use the same property accessors (startAngle, endAngle and radius) for
two source and target objects. Note that you don't have to structure your data
hierarchically; you can define a source and target accessor that restructures
the data on the fly.
2010-11-27 14:13:02 -08:00
Michael Bostock c021172fe8 Add d3.{split,merge}.
These are symmetric operators for splitting and merging (blending) arrays. The
split operator is useful for line and area charts where some of the data
points may be undefined; split the data into subarrays and render each as its
own line or area. This commit also fixes a bug in d3.svg.line when the data
array is empty.
2010-11-27 10:35:11 -08:00
Mike Bostock 163a37e7cd Add svg.chord class. 2010-11-27 01:07:00 -08:00
Jeffrey Heer bbe029fa7f Added convex hull at d3.geom.hull 2010-11-22 16:21:46 -08:00