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

325 Коммитов

Автор SHA1 Сообщение Дата
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 cb97b4a167 Fix a bug with descending rangeBands. 2012-02-22 14:06:30 -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
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 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 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 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
Mike Bostock 7187082ccc Use d3.map for d3.scale.ordinal. 2012-02-20 22:32:46 -08:00
Mike Bostock da43cf2068 map.set returns the set value.
This makes map.set(key, value) equivalent to object[key] = value.
2012-02-20 22:28:42 -08:00
Mike Bostock f1197ed8b6 Use d3.map for d3_svg_symbols.
This fixes a crash with the symbol type "hasOwnProperty", rather than defaulting
to "circle". This commit also adds new map methods to retrieve the keys, values
and entries. The map class now uses non-enumerable properties (if supported).
2012-02-20 21:30:23 -08:00
Mike Bostock 7069da0c79 Use a map for d3_rgb_names.
This way, we don't think "hasOwnProperty" is an RGB color. This commit also
replaces the map.keys method with a generic forEach iterator.
2012-02-20 20:40:43 -08:00
Jason Davies ebab983b8a Use d3.map instead of Object.hasOwnProperty.call. 2012-02-20 19:57:19 +00:00
Mike Bostock 738b634789 Add d3.map.
This is, essentially, an ES6 shim for a Harmony Map. We will use it instead of
using a bare object, so that we don't need to worry about collision with built-
in properties names (such as "__proto__" and "hasOwnProperty").
2012-02-20 11:23:36 -08:00
Jason Davies bb61f88aaf Fix interpolation of inherited object properties. 2012-02-20 08:52:45 +00:00
Jason Davies 2314b2a0cd Simplify. 2012-02-20 04:52:53 +00:00
Jason Davies 4889a08e4c Merge remote-tracking branch 'mbostock/v2.8.0' into builtin-properties
Conflicts:
	d3.v2.min.js
2012-02-20 04:46:52 +00:00
Jason Davies 2dbe80fd34 Fix another edge case for data binding. 2012-02-20 04:43:44 +00:00
Jason Davies 19dd294c50 Fix d3.nest and d3.ns for built-in properties. 2012-02-20 04:06:20 +00:00
Jason Davies 1030db1cd6 Fix d3.interpolate for built-in prototype properties. 2012-02-20 03:31:02 +00:00
Mike Bostock b9170fb394 Add d3.time.{interval}.round. 2012-02-19 19:18:43 -08:00
Jason Davies 1e63be0cdd Handle keys that are in the default object's prototype chain.
This may seem a bit improbable at first, but I ran into this when
testing something unrelated in Firefox, which turns out to have:

  "watch" in {} === true
2012-02-20 03:18:10 +00:00
Mike Bostock 4af8633d88 Add tests for interval.offset.
Also, don't modify the passed-in date; for consistency with other methods, and
for convenience over performance, return a new date.
2012-02-19 12:24:38 -08:00
Mike Bostock 077411a236 Add interval.range, and time.scale.nice.
This commit provides a standard interface for time intervals:

  interval.floor(date)
  interval.ceil(date)
  interval.offset(date, k)
  interval.range(start, stop, step)

All local-time intervals (such as d3.time.day) have a UTC-equivalent interval,
available as interval.utc (such as d3.time.day.utc).

Fixes #463. Note that for the time.scale, an interval function is required to
nice (such as d3.time.day). In the future, we might relax that to allow a count
of ticks, similar to the ticks method, but in that case we'd also need the
ability to floor to a given tick number (e.g., every other week) and likewise
for ceil. This seems like a reasonable first implementation.
2012-02-18 22:56:54 -08:00
Mike Bostock 35dfb87d50 Add interval.ceil. Fixes #453. 2012-02-18 21:23:17 -08:00
Mike Bostock 3081dd45ef Consolidate everything into d3.v2.js.
Rather than producing separate files for each module, the default build now
produces a single file. This should encourage better page-load performance as
the files were relatively small. Also, it's easier to deal with only one file
rather than many, especially if you're not quite sure what the dependencies are.
You may still create minimized builds, if you don't want every feature.

This commit also demotes the chart components to the examples directory, rather
than keeping them as part of the core library. As always, D3 is not a charting
library, and these were ever only intended to serve as examples.
2012-02-18 14:04:01 -08:00
Mike Bostock 1643aa9b46 Merge branch 'master' of https://github.com/trevnorris/d3 into v2.8.0
I simplified the implementation, though it still seems somewhat magical. I
would be more confident if there were an easy way to extract the mantissa and
exponent from a floating point number, but since JavaScript does not expose the
bitwise representation of numbers, there's no easy way to do it.
2012-02-18 13:05:02 -08:00
Trevor Norris 8178c2961b clean up step calculations. add better method for values with no decimal part. included additional tests to demonstrate fixes. 2012-02-15 14:23:27 -08:00
Trevor Norris de8cddc6b8 forgot to follow spacing rules 2012-02-14 16:09:52 -08:00
Trevor Norris 76b13d547f use better method for calculating error correction. add test that failed the old method. 2012-02-14 16:03:38 -08:00
Mike Bostock 744aa9696e Define behavior for mismatched domain & range. 2012-02-13 23:11:05 -08:00
Trevor Norris 87f48b7aa2 fix range increment error caused by IEEE 754 2012-02-07 14:09:39 -08:00
Mike Bostock feb1da151f Merge branches 'fix-polygon', 'fix-interpolate-transform', 'fix-multiyear-time-scale' and 'dispatch-chain' into release 2012-02-01 20:06:44 -08:00
Mike Bostock 85ad3c16b0 Fix polygon.centroid for open polygons.
The implementation assumed closed polygons, but it should work on either. This
is a partial fix for #443.
2012-01-29 14:29:14 -08:00
Mike Bostock 0e5bca1e0a Inclusive upper bound for time scale ticks.
Fixes #478.
2012-01-29 13:44:48 -08:00
Mike Bostock 117942e284 Sub-second and multi-year ticks for time scales.
Fixes #428. This is built on top of existing tick support for linear scales: for
small intervals, a linear scale computes ticks based on milliseconds; for large
intervals, a linear scale computes ticks based on fractional years. This commit
also extends the time scale's formatter to display milliseconds.
2012-01-29 13:28:49 -08:00
Mike Bostock fef4f911db Merge branch 'dispatch-chain' of https://github.com/jasondavies/d3 into dispatch-chain 2012-01-29 10:43:22 -08:00
Mike Bostock cdcde01615 Merge branch 'treemap-overlap' of https://github.com/jasondavies/d3 into 2.7.x 2012-01-26 10:48:32 -08:00
Jason Davies 1708e5e7a5 Fix treemap overlap problem.
See #136.
2012-01-25 17:36:45 +00:00
Nathan Vander Wilt 61141b0be2 move accessor argument next to array param based (for #451 incorporating pull request discussion) 2012-01-24 09:04:46 -08:00
Lars Kotthoff d043d1126a setting ticks()/tickValues() sets the other one to null (mbostock) 2012-01-19 20:45:19 +00:00
Lars Kotthoff 8c2204c680 separate variable and accessor method for ticks (mbostock) 2012-01-19 20:43:57 +00:00
Lars Kotthoff 29e39cf60a test for tick positions given as list 2012-01-19 20:40:43 +00:00