And d3.xhr now detects if the data has a type attribute; if so, this is used to
set the Content-Type header if one has not already been specified. In
conjunction with d3.urlencode, it is now easy to post encoded parameters.
This is backwards-compatible, yet adds numerous features to d3.xhr. You can now:
* Use standard node-style callbacks (fixes#473).
* Abort in-flight requests.
* Listen for progress events.
* Listen for load, error and abort events separately.
* Make POST requests (or any other method), including data.
* Set arbitrary request headers.
* Have multiple listeners on requests.
The transition-test-text callback was failing to fire when using the
latest Node.js master (82bcdbb8aaa4cf58917dc8d3fd4fcfc272512a2c). This
was most likely due to these tests being run in a different order due to
a different object enumeration order.
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.
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.
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.
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.
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).
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").
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
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.
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.