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

409 Коммитов

Автор SHA1 Сообщение Дата
Jason Davies 82153e60b5 Add Q-Q plot. 2011-04-25 11:44:34 +01:00
Mike Bostock 43e2ccca41 Fix fill color for iOS. 2011-04-14 16:53:33 -07:00
Mike Bostock f028aa00d9 Add bubble chart example. 2011-04-14 14:20:07 -07:00
Mike Bostock de3d1c1a6c Remove examples/index.html.
This is no longer needed, as Python's SimpleHTTPServer does directory listing.
2011-04-13 23:59:15 -07:00
Mike Bostock d4e571eb88 Replace flare.json's with symlinks. 2011-04-13 23:58:46 -07:00
Mike Bostock 47f9ced9aa Merge branch 'release' 2011-04-13 23:54:47 -07:00
Mike Bostock 2eb4573f42 Merge branch 'box' into release 2011-04-13 23:53:59 -07:00
Mike Bostock 39dea0102f Merge branch 'cluster' into release 2011-04-13 23:51:29 -07:00
Mike Bostock f7521a18d8 Merge branch 'pack' into release 2011-04-13 23:49:53 -07:00
Mike Bostock 2c80b09122 Remove blank line. 2011-04-13 23:45:54 -07:00
Mike Bostock 7f31d333ad Rename private variable `clamp`. 2011-04-13 23:44:25 -07:00
Mike Bostock 4356e4fb21 Fix some ordering issues with transitions.
By default, `append` will go to the end. This could cause the center line to be
rendered on top of the box rect if whiskers were removed then re-added. By using
the `insert` operator, we can preserve the correct order.
2011-04-13 23:28:04 -07:00
Mike Bostock 126e625d21 Add d3.svg.diagonal.
This is a utility for creating a Bézier curve between opposite corners of a
rectangle. This is commonly used to draw smooth curves connecting parent and
child nodes in a hierarchical node-link diagram. A projection may be specified
which allows the curve to be transformed from polar coordinates.

This commit also changes the semantics of the recently-added `links` method,
such that the objects have `source` and `target` properties that match the
default diagonal format.
2011-04-13 23:13:06 -07:00
Mike Bostock 8d7bd91080 Add `links` methods to cluster & tree.
This method can be used to generate an array of parent+child objects for a given
array of nodes. This is convenient for drawing paths from parent to child in
node-link diagrams.
2011-04-13 22:41:30 -07:00
Mike Bostock 60b6a3d2e5 Simplify cluster layout.
The `cluster` layout is now more similar to the `tree` layout, using a
separation function rather than a group property. In addition, the breadth and
depth properties are replaced with x and y, respectively, and scaled according
to the size of the layout.

I've updated the examples to make them more consistent, as well, including the
pretty Bézier curves. In a future commit I'd like to take some of the duplicate
code in the examples and move that into reusable methods.
2011-04-13 22:04:11 -07:00
Mike Bostock 222629a7a7 Text transitions.
You can now use the `text` operator on transitions, which has the same effect as
setting the text value at the start of the transition. This is nice if you have
a delayed transition, and avoids a common gotcha.

This commit also simplifies the implementation of the `text` operator using the
standard `textContent` property. This isn't supported on IE8-, but we could
potentially add support in the future using `innerText`.
2011-04-13 18:50:26 -07:00
Mike Bostock 55ee1b8f87 Add test for interpolate. 2011-04-13 18:19:31 -07:00
Mike Bostock c29d4dc1a7 Better box chart transitions.
Preserving object constancy across transitions is tricky! For example, what
happens if we remove the whiskers in a transition? How do we join outliers? This
commit makes a few assumptions explicit:

1. The `quartiles` function must return exactly three elements. This property
must be specified as a function.

2. The `whiskers` function must return exactly 2 elements, or null if no
whiskers are to be displayed. This property must be specified as a function.

3. The `domain` function must return exactly 2 elements, or null if the default
domain should be used. This property can be specified either as a constant or as
a function.

We could generalize this chart to support more than two whiskers, but it doesn't
seem urgent, and it would complicate the transition if the number of whiskers
changes. In a related change, the `whiskers` function does not receive a third
argument containing the quartiles; instead, this is made available by the
`quartiles` property on the values array (the first argument).

The outliers are joined using the `Number` key function. The outlier data is now
stored as indices; this allows reasonable object constancy across transitions
with outliers. Similarly, the tick labels for the quartiles are whiskers are now
separated, such that the whisker labels can be added or removed without spurious
transition.
2011-04-13 17:44:20 -07:00
Mike Bostock dd5b21a363 Fix a bug in d3.interpolateString.
The regular expression wasn't being reset, so we weren't always finding numbers!
2011-04-13 17:16:51 -07:00
Jason Davies 12663738d9 Fix quartile calculation.
The outliers were being incorrectly excluded when computing the quartiles.  I've
also added a +/-1.5 IQR whiskers computation for the Morley-Michelson example,
so it replicates the R plot exactly.
2011-04-13 23:40:00 +01:00
Jason Davies f9569c5aac Minor optimisations. 2011-04-13 23:27:52 +01:00
Jason Davies e7d359ea6c Optimise; and fix typo. 2011-04-13 23:27:25 +01:00
Jason Davies a7b3c3265c Remove unused title svg:g. 2011-04-13 23:20:16 +01:00
Jason Davies 3477764db0 Fix randomize button. 2011-04-13 23:16:10 +01:00
Jason Davies 6c8cef1eef Add Michelson-Morley data for box plot example.
Source: R statistical project
Original source: A. J. Weekes (1986) A Genstat Primer. London: Edward Arnold.
2011-04-13 23:12:18 +01:00
Jason Davies 88eabf1969 Continue renaming "boxplot" to "box". 2011-04-13 22:33:15 +01:00
Jason Davies 0b8aa07ed2 Rename "boxplot" to "box". 2011-04-13 22:31:53 +01:00
Jason Davies 54756f4d32 Fix central dashed line. 2011-04-13 22:29:44 +01:00
Jason Davies d288e69016 Remove `outlierSymbol` property.
Circles are simpler.
2011-04-13 22:27:25 +01:00
Jason Davies b693e0514e Make quartiles computation configurable.
The `quartiles` property takes the sorted data array (excluding outliers) and
returns the three quartiles.
2011-04-13 22:21:29 +01:00
Jason Davies 9721e6f045 Display outliers.
The symbol can be specified using the `outlierSymbol` property, which specifies
the `d` attribute for an SVG path.
2011-04-13 21:59:37 +01:00
Jason Davies 755529dba8 Add `whiskers` property to box plot.
This specifies a function that takes the sorted data array, and returns an array
of datum positions that should marked with whiskers.  The default implementation
is to return `[0, length-1]` i.e. the minimum and maximum.

Data outside of the whiskers are considered outliers, and are not included in
the quartile calculation.
2011-04-13 21:23:49 +01:00
Jason Davies 9518fec14a Replace `sort` property with `value`.
Much more useful, as we'll always want to sort by ascending value anyway.
2011-04-13 20:39:12 +01:00
Jason Davies 8fc521cb02 Add function support to the `domain` property.
This allows us to specify different domains across multiple box plots.  Thanks
Mike for the suggestion!
2011-04-13 20:35:33 +01:00
Jason Davies b6b39af267 Expose `d3_functor` as `d3.functor`.
This is so it can be used in other modules such as the charts module.
2011-04-13 20:34:13 +01:00
Jason Davies 5719f19223 Make boxplot sort configurable. 2011-04-13 20:14:29 +01:00
Jason Davies 2e8cd200df Add boxplot chart. 2011-04-13 19:57:57 +01:00
Nelson Minar 9889915830 put Makefile back 2011-04-12 02:11:44 +00:00
Nelson Minar 24de130f4e fix my git mistake, adding d3.min.js back 2011-04-12 02:10:27 +00:00
Nelson Minar c7c9e7fad4 rename clamped() method to clamp() 2011-04-12 02:09:19 +00:00
Nelson Minar 2548d4fa32 Merge branch 'master' of https://github.com/mbostock/d3
Conflicts:
	d3.min.js
2011-04-12 02:02:48 +00:00
Mike Bostock 776f332af6 More pretty Béziers. 2011-04-11 13:52:21 -07:00
Mike Bostock 0ca148d37e Add pretty Bézier curves. 2011-04-11 13:22:24 -07:00
Mike Bostock c7109df799 Rename for readability. 2011-04-11 12:55:27 -07:00
Mike Bostock c5c6614d9e Simplify pack layout.
The pack layout now sorts nodes by ascending value by default. The `radius`
property is removed, as the radius is always computed from the node value. The
`spacing` property is also removed; it doesn't seem particularly useful. The
`radius` property is renamed to `r` to match `x` and `y`.

I also optimized the implementation slightly, and namespaced temporary state
under the prefix `_pack_`.
2011-04-11 12:44:17 -07:00
Jason Davies 5ef525385a Add cluster-radial to examples index. 2011-04-11 11:25:19 +01:00
Jason Davies 6ebe9e5779 Add cluster (dendogram) layout.
Based on the Protovis version.  The only difference is that I've dropped
the `orient`, `innerRadius` and `outerRadius` properties so that the D3
version is more flexible.
2011-04-11 11:19:59 +01:00
Jason Davies ccfbb06729 Add circle-packing layout.
Based on the Protovis layout.  I've kept the convention of using `size`
for the width/height and `separation` for the spacing.  The Protovis
layout had a `size` property but this was used to compute the radius.
I've left this out as I've assumed it's straightforward enough to pass
in the appropriate `radius` function instead.  Likewise, I think the
existing hierarchy `sort` property can handle situations that `order`
was intended for in the Protovis version.
2011-04-11 10:01:11 +01:00
Mike Bostock 9f71e4e211 Fix a bug in cardinal-closed interpolation. 2011-04-10 23:26:35 -07:00
Mike Bostock ca3585ec97 Move tree examples into div#chart. 2011-04-10 18:59:41 -07:00