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

1490 Коммитов

Автор SHA1 Сообщение Дата
Jon Seymour f16141517a Add a test that a degenerate domain does not cause histogram to barf.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
2012-03-24 00:22:07 +11:00
Jon Seymour bf151c2877 histogram: deal with the degenerate domain without throwing an exception.
A histogram with a domain that has an extent of exactly 0 currently causes
the generated histogram to barf with an "undefined does not have .y" exception.

In order to avoid clients having to special case this degenerate case, modified
the loop so that the empty array is returned instead, in this case.

try {
    var
        scale=d3.scale.linear().domain([0,0]);

    d3.layout.histogram().bins(scale.ticks(3))([0]);
    console.log("ok");
} catch (e) {
    console.log("failed");
    throw e;
}

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
2012-03-23 23:30:08 +11:00
Mike Bostock 1196f55b43 Optimize thin links. 2012-03-18 11:03:29 -07:00
Mike Bostock 8ea41735d9 Merge branch 'master' of github.com:mbostock/d3 2012-03-18 11:02:43 -07:00
Mike Bostock 9454e66775 Add Hive Plot example. 2012-03-17 16:18:59 -07:00
Mike Bostock 3da58981bd Merge pull request #526 from mjijackson/readme
Add note about running the tests
2012-03-15 08:28:21 -07:00
Mike Bostock d3c3324386 Merge pull request #585 from cscheid/master
fix typo on path
2012-03-06 17:41:13 -08:00
Carlos Scheidegger 2737ec3617 fix typo on path 2012-03-06 18:36:00 -05:00
Mike Bostock af2af6ac90 Merge branch 'release' 2012-03-01 16:30:25 -08:00
Mike Bostock ae1622f1e4 Merge branch 'transition-each' into release 2012-03-01 16:29:35 -08:00
Mike Bostock 4b4010363b Merge branch 'fix-time-format-leap-year' into release 2012-03-01 16:29:17 -08:00
Mike Bostock 4f552825ad Include brush mode with event.
This allows listeners to distinguish between move and resize events.
2012-03-01 16:25:30 -08:00
Mike Bostock 41371adc98 Fixes #576: leap year bug in d3.time.format.
We need to set the date fields from year down, rather than in arbitrary order.
2012-02-29 11:27:30 -08:00
Mike Bostock 93c78c625e Fix drift in brush extent.
Previously, if you set the brush extent externally, the extent could drift
slightly because it was internally stored in pixel space rather than in data
space. To avoid drift, the brush now preserves the extent exactly as-set, only
nullifying the externally-set extent when the brush is moved.
2012-02-28 18:27:40 -08:00
Mike Bostock e46b1615a1 Update histogram example. 2012-02-28 17:52:16 -08:00
Mike Bostock af4d9e4c1a Re-entrant transition.each.
In theory, you could call transition.each within the context of another
transition.each, so we should be careful how we restore the default settings.
2012-02-26 16:16:49 -08:00
Mike Bostock 3ec1d71785 Inheritance for transition.each.
If you use d3.transition(selection) within the context of a transition.each, the
created transition will automatically inherit the delay, duration and easing of
the parent transition. Likewise, if you use d3.transition(selection) within the
context of a selection.each, it simply returns the passed-in selection with no
transition at all. This makes it easier to create components, such as the axis,
that support automatic transitions.
2012-02-26 15:46:26 -08:00
Mike Bostock b42e818ce8 Merge branch 'update-jsdom' of https://github.com/stepheneb/d3 2012-02-24 23:36:51 -08:00
Stephen Bannasch eb607a5174 update to latest jsdom
The update is to get the most recent version of contextify
which is a dependency of jsdom. Previous versions of 
contextify always generate a 64 library module. v0.6.11 of
node on macos is a 32-bit ARCH. The latest version of 
contextify  builds an ARCH that matches node NOT the arch
of the system.

See: https://github.com/brianmcd/contextify/issues/19
2012-02-25 00:14:55 -05:00
Mike Bostock 0bd675ca49 Merge branch 'v2.8.0' 2012-02-24 19:19:34 -08:00
Mike Bostock b59f117341 Add tests for d3.scale.identity.
Also, we need to coerce the input values to numbers, since this is a
quantitative scale and the ticks and tickFormat methods assume numbers.
2012-02-23 10:32:42 -08:00
Mike Bostock 7663a9c291 Save two bytes. :trollface: 2012-02-22 22:50:40 -08:00
Mike Bostock ec12de6eec Rewrite brush to use transient listeners.
Fixes #566. Closures are way better than globals!
2012-02-22 22:40:44 -08:00
Mike Bostock d2f0e0bbf4 Transient listeners for drag behavior.
Fixes #516.
2012-02-22 21:59:13 -08:00
Mike Bostock 74be6c13d8 Fix a bug when clearing event listeners.
We weren't deleting the reference to the removed listener, so we were leaking
memory and returning a stale value on a subsequent get. Also, we now stash the
capture value when setting an event listener, so that we can automatically
remove or replace a listener without the caller needing to specify capture.
2012-02-22 21:39:02 -08:00
Mike Bostock 60e8fb5603 Merge branch 'master' of https://github.com/indec/d3 into v2.8.0 2012-02-22 17:58:25 -08:00
Mike Bostock e5e24305e2 Add sourceEvent to custom events.
The drag behavior, zoom behavior and brush component now set a "sourceEvent"
property on their events, defined as the triggering mouse or touch event. The
d3.mouse and d3.touches helpers likewise use the source event, letting you query
the mouse or touch location when handling a custom event.
2012-02-22 17:34:58 -08:00
Mike Bostock 7bd053014b Only dispatch "brush" events if moved. 2012-02-22 14:13:25 -08:00
Mike Bostock cb97b4a167 Fix a bug with descending rangeBands. 2012-02-22 14:06:30 -08:00
Mike Bostock 522e269663 Merge branch 'force-tick' into v2.8.0 2012-02-21 23:17:59 -08:00
Mike Bostock 0aed1e403d Merge branch 'customticks' of https://github.com/larskotthoff/d3 into v2.8.0 2012-02-21 22:42:41 -08:00
Mike Bostock 34667bf5e0 Merge branch 'master' of https://github.com/ZeeAgency/d3 into v2.8.0 2012-02-21 22:12:11 -08:00
Mike Bostock 589b12f768 Merge branch 'bisect_accessors' of https://github.com/natevw/d3 into v2.8.0 2012-02-21 21:55:18 -08:00
Mike Bostock f13d60b2ab Force transition duration of at least 1ms.
Fixes #493. Also terminates any transitions with negative or NaN durations,
rather than having them run infinitely. Also coerces NaN delays to 0 as well, to
likewise avoid infinite transitions.
2012-02-21 18:35:13 -08:00
Michael Jackson 6f509917f5 Add note about running the tests 2012-02-21 16:07:01 -08:00
Mike Bostock 0cf999b08f Query data via selection.data(). Fixes #525.
This method returns the array of data for the first group in the selection. Note
that the data method cannot be used to clear data bindings, since it computes a
data join; use datum(null) to clear bound data.
2012-02-21 13:31:20 -08:00
Mike Bostock f80b1cf244 Add selection.datum. Fixes #489. 2012-02-21 10:31:15 -08:00
Mike Bostock 31b0d3f197 Slight simplification to d3.ns.qualify.
This changes the behavior slightly, but in a good way: if the namespace is
unknown, then it is ignored rather than returning an undefined namespace.
2012-02-21 10:03:23 -08:00
Mike Bostock 72da0cd88a Adopt d3.map for d3.format. 2012-02-21 09:04:00 -08:00
Mike Bostock 2c5293675e Adopt d3.map for d3.time.format. 2012-02-21 09:03:00 -08:00
Mike Bostock d69cbbdaa7 Adopt d3.map for d3.svg.line and d3.svg.area. 2012-02-21 08:55:03 -08:00
Mike Bostock 6affe7eb94 Adopt d3.map for d3.layout.stack. 2012-02-21 08:47:57 -08:00
Mike Bostock 0daedb2344 Harden d3_geo_type against object built-ins. 2012-02-21 08:42:37 -08:00
Mike Bostock 003c45e5b3 Adopt d3.map for d3.ease.
Also, if an unknown easing method or mode is specified, fallback to linear-in.
2012-02-21 08:39:42 -08:00
Mike Bostock 1e10e2ca88 Rename map.delete to map.remove.
Unfortunately, "delete" is a reserved word, and older browsers (such as mobile
WebKit) crash if you use reserved words as method names. I'd rather have code
that runs than strictly maintain interface-compatibility with the ES6 map.
2012-02-21 08:23:23 -08:00
Mike Bostock 030a48c154 Merge branch 'drag-touch' of https://github.com/jasondavies/d3 into builtin-properties 2012-02-21 08:18:27 -08:00
Jason Davies 00eebb3ef0 Don't block click events entirely on touch devices.
This preventDefault call prevents the click event from firing at all.
2012-02-21 13:15:38 +00:00
Mike Bostock a1c5ada8f8 Adopt d3.map for d3.transition's tweens. 2012-02-20 22:57:25 -08:00
Mike Bostock c6c4f3868c Adopt d3.map for d3.dispatch. 2012-02-20 22:54:38 -08:00
Mike Bostock a52855962c Don't support interpolating non-enumerables.
We don't need to support interpolating non-enumerable properties; make it
explicit that these properties may or may not be interpolated.
2012-02-20 22:49:31 -08:00