diff --git a/.gitignore b/.gitignore
index 8cc5a84db98c18..8abcf6a88691db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
-_site
-node_modules
+*.sublime-workspace
.DS_Store
+dist/
+node_modules
+npm-debug.log
diff --git a/.npmignore b/.npmignore
deleted file mode 100644
index 146266d9e18cb1..00000000000000
--- a/.npmignore
+++ /dev/null
@@ -1,4 +0,0 @@
-examples/
-test/
-lib/
-.DS_Store
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 20fd86b6a5bee3..00000000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - 0.10
diff --git a/API.md b/API.md
new file mode 100644
index 00000000000000..1346c78f360b56
--- /dev/null
+++ b/API.md
@@ -0,0 +1,1440 @@
+# D3 API Reference
+
+D3 is a [collection of modules](https://github.com/d3) that are designed to work together; you can use the modules independently, or you can use them together as part of the default build. The source and documentation for each module is available in its repository. Follow the links below to learn more. For changes between major versions, see [CHANGES](https://github.com/d3/d3/blob/master/CHANGES.md); see also the [release notes](https://github.com/d3/d3/releases) and the [3.x reference](https://github.com/d3/d3-3.x-api-reference/blob/master/API-Reference.md).
+
+* [Arrays](#arrays-d3-array) ([Statistics](#statistics), [Search](#search), [Iterables](#iterables), [Sets](#sets), [Transformations](#transformations), [Histograms](#histograms), [Interning](#interning))
+* [Axes](#axes-d3-axis)
+* [Brushes](#brushes-d3-brush)
+* [Chords](#chords-d3-chord)
+* [Colors](#colors-d3-color)
+* [Color Schemes](#color-schemes-d3-scale-chromatic)
+* [Contours](#contours-d3-contour)
+* [Voronoi Diagrams](#voronoi-diagrams-d3-delaunay)
+* [Dispatches](#dispatches-d3-dispatch)
+* [Dragging](#dragging-d3-drag)
+* [Delimiter-Separated Values](#delimiter-separated-values-d3-dsv)
+* [Easings](#easings-d3-ease)
+* [Fetches](#fetches-d3-fetch)
+* [Forces](#forces-d3-force)
+* [Number Formats](#number-formats-d3-format)
+* [Geographies](#geographies-d3-geo) ([Paths](#paths), [Projections](#projections), [Spherical Math](#spherical-math), [Spherical Shapes](#spherical-shapes), [Streams](#streams), [Transforms](#transforms))
+* [Hierarchies](#hierarchies-d3-hierarchy)
+* [Interpolators](#interpolators-d3-interpolate)
+* [Paths](#paths-d3-path)
+* [Polygons](#polygons-d3-polygon)
+* [Quadtrees](#quadtrees-d3-quadtree)
+* [Random Numbers](#random-numbers-d3-random)
+* [Scales](#scales-d3-scale) ([Continuous](#continuous-scales), [Sequential](#sequential-scales), [Diverging](#diverging-scales), [Quantize](#quantize-scales), [Ordinal](#ordinal-scales))
+* [Selections](#selections-d3-selection) ([Selecting](#selecting-elements), [Modifying](#modifying-elements), [Data](#joining-data), [Events](#handling-events), [Control](#control-flow), [Local Variables](#local-variables), [Namespaces](#namespaces))
+* [Shapes](#shapes-d3-shape) ([Arcs](#arcs), [Pies](#pies), [Lines](#lines), [Areas](#areas), [Curves](#curves), [Links](#links), [Symbols](#symbols), [Stacks](#stacks))
+* [Time Formats](#time-formats-d3-time-format)
+* [Time Intervals](#time-intervals-d3-time)
+* [Timers](#timers-d3-timer)
+* [Transitions](#transitions-d3-transition)
+* [Zooming](#zooming-d3-zoom)
+
+D3 uses [semantic versioning](http://semver.org/). The current version is exposed as d3.version.
+
+## [Arrays (d3-array)](https://github.com/d3/d3-array/tree/v2.12.1)
+
+Array manipulation, ordering, searching, summarizing, etc.
+
+### [Statistics](https://github.com/d3/d3-array/blob/v2.12.1/README.md#statistics)
+
+Methods for computing basic summary statistics.
+
+* [d3.min](https://github.com/d3/d3-array/blob/v2.12.1/README.md#min) - compute the minimum value in an iterable.
+* [d3.minIndex](https://github.com/d3/d3-array/blob/v2.12.1/README.md#minIndex) - compute the index of the minimum value in an iterable.
+* [d3.max](https://github.com/d3/d3-array/blob/v2.12.1/README.md#max) - compute the maximum value in an iterable.
+* [d3.maxIndex](https://github.com/d3/d3-array/blob/v2.12.1/README.md#maxIndex) - compute the index of the maximum value in an iterable.
+* [d3.extent](https://github.com/d3/d3-array/blob/v2.12.1/README.md#extent) - compute the minimum and maximum value in an iterable.
+* [d3.sum](https://github.com/d3/d3-array/blob/v2.12.1/README.md#sum) - compute the sum of an iterable of numbers.
+* [d3.mean](https://github.com/d3/d3-array/blob/v2.12.1/README.md#mean) - compute the arithmetic mean of an iterable of numbers.
+* [d3.median](https://github.com/d3/d3-array/blob/v2.12.1/README.md#median) - compute the median of an iterable of numbers (the 0.5-quantile).
+* [d3.cumsum](https://github.com/d3/d3-array/blob/v2.12.1/README.md#cumsum) - compute the cumulative sum of an iterable.
+* [d3.quantile](https://github.com/d3/d3-array/blob/v2.12.1/README.md#quantile) - compute a quantile for an iterable of numbers.
+* [d3.quantileSorted](https://github.com/d3/d3-array/blob/v2.12.1/README.md#quantileSorted) - compute a quantile for a sorted array of numbers.
+* [d3.variance](https://github.com/d3/d3-array/blob/v2.12.1/README.md#variance) - compute the variance of an iterable of numbers.
+* [d3.deviation](https://github.com/d3/d3-array/blob/v2.12.1/README.md#deviation) - compute the standard deviation of an iterable of numbers.
+* [d3.fcumsum](https://github.com/d3/d3-array/blob/v2.12.1/README.md#fcumsum) - compute a full precision cumulative summation of numbers.
+* [d3.fsum](https://github.com/d3/d3-array/blob/v2.12.1/README.md#fsum) - compute a full precision summation of an iterable of numbers.
+* [new d3.Adder](https://github.com/d3/d3-array/blob/v2.12.1/README.md#adder) - creates a full precision adder.
+* [*adder*.add](https://github.com/d3/d3-array/blob/v2.12.1/README.md#adder_add) - add a value to an adder.
+* [*adder*.valueOf](https://github.com/d3/d3-array/blob/v2.12.1/README.md#adder_valueOf) - returns a double precision representation of an adder’s value.
+
+### [Search](https://github.com/d3/d3-array/blob/v2.12.1/README.md#search)
+
+Methods for searching arrays for a specific element.
+
+* [d3.least](https://github.com/d3/d3-array/blob/v2.12.1/README.md#least) - returns the least element of an iterable.
+* [d3.leastIndex](https://github.com/d3/d3-array/blob/v2.12.1/README.md#leastIndex) - returns the index of the least element of an iterable.
+* [d3.greatest](https://github.com/d3/d3-array/blob/v2.12.1/README.md#greatest) - returns the greatest element of an iterable.
+* [d3.greatestIndex](https://github.com/d3/d3-array/blob/v2.12.1/README.md#greatestIndex) - returns the index of the greatest element of an iterable.
+* [d3.bisectCenter](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bisectCenter) - binary search for a value in a sorted array.
+* [d3.bisectLeft](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bisectLeft) - binary search for a value in a sorted array.
+* [d3.bisect](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bisect) - binary search for a value in a sorted array.
+* [d3.bisectRight](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bisectRight) - binary search for a value in a sorted array.
+* [d3.bisector](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bisector) - bisect using an accessor or comparator.
+* [*bisector*.center](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bisector_center) - binary search for a value in a sorted array.
+* [*bisector*.left](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bisector_left) - bisectLeft, with the given comparator.
+* [*bisector*.right](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bisector_right) - bisectRight, with the given comparator.
+* [d3.quickselect](https://github.com/d3/d3-array/blob/v2.12.1/README.md#quickselect) - reorder an array of numbers.
+* [d3.ascending](https://github.com/d3/d3-array/blob/v2.12.1/README.md#ascending) - compute the natural order of two values.
+* [d3.descending](https://github.com/d3/d3-array/blob/v2.12.1/README.md#descending) - compute the natural order of two values.
+
+### [Transformations](https://github.com/d3/d3-array/blob/v2.12.1/README.md#transformations)
+
+Methods for transforming arrays and for generating new arrays.
+
+* [d3.group](https://github.com/d3/d3-array/blob/v2.12.1/README.md#group) - group an iterable into a nested Map.
+* [d3.groups](https://github.com/d3/d3-array/blob/v2.12.1/README.md#groups) - group an iterable into a nested array.
+* [d3.index](https://github.com/d3/d3-array/blob/v2.12.1/README.md#index) - index an iterable into a nested Map.
+* [d3.indexes](https://github.com/d3/d3-array/blob/v2.12.1/README.md#indexes) - index an iterable into a nested array.
+* [d3.rollup](https://github.com/d3/d3-array/blob/v2.12.1/README.md#rollup) - reduce an iterable into a nested Map.
+* [d3.rollups](https://github.com/d3/d3-array/blob/v2.12.1/README.md#rollups) - reduce an iterable into a nested array.
+* [d3.groupSort](https://github.com/d3/d3-array/blob/v2.12.1/README.md#groupSort) - sort keys according to grouped values.
+* [d3.count](https://github.com/d3/d3-array/blob/v2.12.1/README.md#count) - count valid number values in an iterable.
+* [d3.cross](https://github.com/d3/d3-array/blob/v2.12.1/README.md#cross) - compute the Cartesian product of two iterables.
+* [d3.merge](https://github.com/d3/d3-array/blob/v2.12.1/README.md#merge) - merge multiple iterables into one array.
+* [d3.pairs](https://github.com/d3/d3-array/blob/v2.12.1/README.md#pairs) - create an array of adjacent pairs of elements.
+* [d3.permute](https://github.com/d3/d3-array/blob/v2.12.1/README.md#permute) - reorder an iterable of elements according to an iterable of indexes.
+* [d3.shuffle](https://github.com/d3/d3-array/blob/v2.12.1/README.md#shuffle) - randomize the order of an iterable.
+* [d3.shuffler](https://github.com/d3/d3-array/blob/v2.12.1/README.md#shuffler) - randomize the order of an iterable.
+* [d3.ticks](https://github.com/d3/d3-array/blob/v2.12.1/README.md#ticks) - generate representative values from a numeric interval.
+* [d3.tickIncrement](https://github.com/d3/d3-array/blob/v2.12.1/README.md#tickIncrement) - generate representative values from a numeric interval.
+* [d3.tickStep](https://github.com/d3/d3-array/blob/v2.12.1/README.md#tickStep) - generate representative values from a numeric interval.
+* [d3.nice](https://github.com/d3/d3-array/blob/v2.12.1/README.md#nice) - extend an interval to align with ticks.
+* [d3.range](https://github.com/d3/d3-array/blob/v2.12.1/README.md#range) - generate a range of numeric values.
+* [d3.transpose](https://github.com/d3/d3-array/blob/v2.12.1/README.md#transpose) - transpose an array of arrays.
+* [d3.zip](https://github.com/d3/d3-array/blob/v2.12.1/README.md#zip) - transpose a variable number of arrays.
+
+### [Iterables](https://github.com/d3/d3-array/blob/v2.12.1/README.md#iterables)
+
+* [d3.every](https://github.com/d3/d3-array/blob/v2.12.1/README.md#every) - test if all values satisfy a condition.
+* [d3.some](https://github.com/d3/d3-array/blob/v2.12.1/README.md#some) - test if any value satisfies a condition.
+* [d3.filter](https://github.com/d3/d3-array/blob/v2.12.1/README.md#filter) - filter values.
+* [d3.map](https://github.com/d3/d3-array/blob/v2.12.1/README.md#map) - map values.
+* [d3.reduce](https://github.com/d3/d3-array/blob/v2.12.1/README.md#reduce) - reduce values.
+* [d3.reverse](https://github.com/d3/d3-array/blob/v2.12.1/README.md#reverse) - reverse the order of values.
+* [d3.sort](https://github.com/d3/d3-array/blob/v2.12.1/README.md#sort) - sort values.
+
+### [Sets](https://github.com/d3/d3-array/blob/v2.12.1/README.md#sets)
+
+* [d3.difference](https://github.com/d3/d3-array/blob/v2.12.1/README.md#difference) - compute a set difference.
+* [d3.disjoint](https://github.com/d3/d3-array/blob/v2.12.1/README.md#disjoint) - test whether two sets are disjoint.
+* [d3.intersection](https://github.com/d3/d3-array/blob/v2.12.1/README.md#intersection) - compute a set intersection.
+* [d3.superset](https://github.com/d3/d3-array/blob/v2.12.1/README.md#superset) - test whether a set is a superset of another.
+* [d3.subset](https://github.com/d3/d3-array/blob/v2.12.1/README.md#subset) - test whether a set is a subset of another.
+* [d3.union](https://github.com/d3/d3-array/blob/v2.12.1/README.md#union) - compute a set union.
+
+### [Histograms](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bins)
+
+Bin discrete samples into continuous, non-overlapping intervals.
+
+* [d3.bin](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bin) - create a new bin generator.
+* [*bin*](https://github.com/d3/d3-array/blob/v2.12.1/README.md#_bin) - bins a given array of samples.
+* [*bin*.value](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bin_value) - specify a value accessor for each sample.
+* [*bin*.domain](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bin_domain) - specify the interval of observable values.
+* [*bin*.thresholds](https://github.com/d3/d3-array/blob/v2.12.1/README.md#bin_thresholds) - specify how values are divided into bins.
+* [d3.thresholdFreedmanDiaconis](https://github.com/d3/d3-array/blob/v2.12.1/README.md#thresholdFreedmanDiaconis) - the Freedman–Diaconis binning rule.
+* [d3.thresholdScott](https://github.com/d3/d3-array/blob/v2.12.1/README.md#thresholdScott) - Scott’s normal reference binning rule.
+* [d3.thresholdSturges](https://github.com/d3/d3-array/blob/v2.12.1/README.md#thresholdSturges) - Sturges’ binning formula.
+
+### [Interning](https://github.com/d3/d3-array/blob/v2.12.1/README.md#interning)
+
+* [d3.InternMap](https://github.com/d3/d3-array/blob/v2.12.1/README.md#InternMap) - a key-interning Map.
+* [d3.InternSet](https://github.com/d3/d3-array/blob/v2.12.1/README.md#InternSet) - a value-interning Set.
+
+## [Axes (d3-axis)](https://github.com/d3/d3-axis/tree/v2.1.0)
+
+Human-readable reference marks for scales.
+
+* [d3.axisTop](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axisTop) - create a new top-oriented axis generator.
+* [d3.axisRight](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axisRight) - create a new right-oriented axis generator.
+* [d3.axisBottom](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axisBottom) - create a new bottom-oriented axis generator.
+* [d3.axisLeft](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axisLeft) - create a new left-oriented axis generator.
+* [*axis*](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#_axis) - generate an axis for the given selection.
+* [*axis*.scale](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axis_scale) - set the scale.
+* [*axis*.ticks](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axis_ticks) - customize how ticks are generated and formatted.
+* [*axis*.tickArguments](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axis_tickArguments) - customize how ticks are generated and formatted.
+* [*axis*.tickValues](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axis_tickValues) - set the tick values explicitly.
+* [*axis*.tickFormat](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axis_tickFormat) - set the tick format explicitly.
+* [*axis*.tickSize](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axis_tickSize) - set the size of the ticks.
+* [*axis*.tickSizeInner](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axis_tickSizeInner) - set the size of inner ticks.
+* [*axis*.tickSizeOuter](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axis_tickSizeOuter) - set the size of outer (extent) ticks.
+* [*axis*.tickPadding](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axis_tickPadding) - set the padding between ticks and labels.
+* [*axis*.offset](https://github.com/d3/d3-axis/blob/v2.1.0/README.md#axis_offset) - set the pixel offset for crisp edges.
+
+## [Brushes (d3-brush)](https://github.com/d3/d3-brush/tree/v2.0.0)
+
+Select a one- or two-dimensional region using the mouse or touch.
+
+* [d3.brush](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brush) - create a new two-dimensional brush.
+* [d3.brushX](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brushX) - create a brush along the *x*-dimension.
+* [d3.brushY](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brushY) - create a brush along the *y*-dimension.
+* [*brush*](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#_brush) - apply the brush to a selection.
+* [*brush*.move](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brush_move) - move the brush selection.
+* [*brush*.clear](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brush_clear) - clear the brush selection.
+* [*brush*.extent](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brush_extent) - define the brushable region.
+* [*brush*.filter](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brush_filter) - control which input events initiate brushing.
+* [*brush*.touchable](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brush_touchable) - set the touch support detector.
+* [*brush*.keyModifiers](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brush_keyModifiers) - enable or disable key interaction.
+* [*brush*.handleSize](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brush_handleSize) - set the size of the brush handles.
+* [*brush*.on](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brush_on) - listen for brush events.
+* [d3.brushSelection](https://github.com/d3/d3-brush/blob/v2.0.0/README.md#brushSelection) - get the brush selection for a given node.
+
+## [Chords (d3-chord)](https://github.com/d3/d3-chord/tree/v2.0.0)
+
+* [d3.chord](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#chord) - create a new chord layout.
+* [*chord*](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#_chord) - compute the layout for the given matrix.
+* [*chord*.padAngle](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#chord_padAngle) - set the padding between adjacent groups.
+* [*chord*.sortGroups](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#chord_sortGroups) - define the group order.
+* [*chord*.sortSubgroups](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#chord_sortSubgroups) - define the source and target order within groups.
+* [*chord*.sortChords](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#chord_sortChords) - define the chord order across groups.
+* [d3.chordDirected](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#chordDirected) - create a directed chord generator.
+* [d3.chordTranspose](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#chordTranspose) - create a transposed chord generator.
+* [d3.ribbon](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbon) - create a ribbon shape generator.
+* [*ribbon*](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#_ribbon) - generate a ribbon shape.
+* [*ribbon*.source](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbon_source) - set the source accessor.
+* [*ribbon*.target](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbon_target) - set the target accessor.
+* [*ribbon*.radius](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbon_radius) - set the ribbon source and target radius.
+* [*ribbon*.sourceRadius](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbon_sourceRadius) - set the ribbon source radius.
+* [*ribbon*.targetRadius](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbon_targetRadius) - set the ribbon target radius.
+* [*ribbon*.startAngle](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbon_startAngle) - set the ribbon source or target start angle.
+* [*ribbon*.endAngle](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbon_endAngle) - set the ribbon source or target end angle.
+* [*ribbon*.padAngle](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbon_padAngle) - set the pad angle accessor.
+* [*ribbon*.context](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbon_context) - set the render context.
+* [d3.ribbonArrow](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbonArrow) - create an arrow ribbon generator.
+* [*ribbonArrow*.headRadius](https://github.com/d3/d3-chord/blob/v2.0.0/README.md#ribbonArrow_headRadius) - set the arrowhead radius accessor.
+
+## [Colors (d3-color)](https://github.com/d3/d3-color/tree/v2.0.0)
+
+Color manipulation and color space conversion.
+
+* [d3.color](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color) - parse the given CSS color specifier.
+* [*color*.opacity](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color_opacity) - the color’s opacity.
+* [*color*.rgb](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color_rgb) - compute the RGB equivalent of this color.
+* [*color*.copy](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color_copy) - return a copy of this color.
+* [*color*.brighter](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color_brighter) - create a brighter copy of this color.
+* [*color*.darker](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color_darker) - create a darker copy of this color.
+* [*color*.displayable](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color_displayable) - returns true if the color is displayable on standard hardware.
+* [*color*.formatHex](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color_formatHex) - returns the hexadecimal RGB string representation of this color.
+* [*color*.formatHsl](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color_formatHsl) - returns the RGB string representation of this color.
+* [*color*.formatRgb](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color_formatRgb) - returns the HSL string representation of this color.
+* [*color*.toString](https://github.com/d3/d3-color/blob/v2.0.0/README.md#color_toString) - returns the RGB string representation of this color.
+* [d3.rgb](https://github.com/d3/d3-color/blob/v2.0.0/README.md#rgb) - create a new RGB color.
+* [d3.hsl](https://github.com/d3/d3-color/blob/v2.0.0/README.md#hsl) - create a new HSL color.
+* [d3.lab](https://github.com/d3/d3-color/blob/v2.0.0/README.md#lab) - create a new Lab color.
+* [d3.gray](https://github.com/d3/d3-color/blob/v2.0.0/README.md#gray) - create a new Lab gray.
+* [d3.hcl](https://github.com/d3/d3-color/blob/v2.0.0/README.md#hcl) - create a new HCL color.
+* [d3.lch](https://github.com/d3/d3-color/blob/v2.0.0/README.md#lch) - create a new HCL color.
+* [d3.cubehelix](https://github.com/d3/d3-color/blob/v2.0.0/README.md#cubehelix) - create a new Cubehelix color.
+
+## [Color Schemes (d3-scale-chromatic)](https://github.com/d3/d3-scale-chromatic/tree/v2.0.0)
+
+Color ramps and palettes for quantitative, ordinal and categorical scales.
+
+### Categorical
+
+* [d3.schemeCategory10](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeCategory10) - an array of ten categorical colors.
+* [d3.schemeAccent](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeAccent) - an array of eight categorical colors.
+* [d3.schemeDark2](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeDark2) - an array of eight categorical colors.
+* [d3.schemePaired](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemePaired) - an array of twelve categorical colors.
+* [d3.schemePastel1](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemePastel1) - an array of nine categorical colors.
+* [d3.schemePastel2](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemePastel2) - an array of eight categorical colors.
+* [d3.schemeSet1](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeSet1) - an array of nine categorical colors.
+* [d3.schemeSet2](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeSet2) - an array of eight categorical colors.
+* [d3.schemeSet3](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeSet3) - an array of twelve categorical colors.
+* [d3.schemeTableau10](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeTableau10) - an array of ten categorical colors.
+
+### Diverging
+
+* [d3.interpolateBrBG](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateBrBG) - ColorBrewer BrBG interpolator.
+* [d3.interpolatePiYG](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolatePiYG) - ColorBrewer PiYG interpolator.
+* [d3.interpolatePRGn](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolatePRGn) - ColorBrewer PRGn interpolator.
+* [d3.interpolatePuOr](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolatePuOr) - ColorBrewer PuOr interpolator.
+* [d3.interpolateRdBu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateRdBu) - ColorBrewer RdBu interpolator.
+* [d3.interpolateRdGy](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateRdGy) - ColorBrewer RdGy interpolator.
+* [d3.interpolateRdYlBu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateRdYlBu) - ColorBrewer RdYlBu interpolator.
+* [d3.interpolateRdYlGn](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateRdYlGn) - ColorBrewer RdYlGn interpolator.
+* [d3.interpolateSpectral](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateSpectral) - ColorBrewer spectral interpolator.
+* [d3.schemeBrBG](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeBrBG) - ColorBrewer BrBG scheme.
+* [d3.schemePiYG](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemePiYG) - ColorBrewer PiYG scheme.
+* [d3.schemePRGn](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemePRGn) - ColorBrewer PRGn scheme.
+* [d3.schemePuOr](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemePuOr) - ColorBrewer PuOr scheme.
+* [d3.schemeRdBu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeRdBu) - ColorBrewer RdBu scheme.
+* [d3.schemeRdGy](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeRdGy) - ColorBrewer RdGy scheme.
+* [d3.schemeRdYlBu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeRdYlBu) - ColorBrewer RdYlBu scheme.
+* [d3.schemeRdYlGn](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeRdYlGn) - ColorBrewer RdYlGn scheme.
+* [d3.schemeSpectral](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeSpectral) - ColorBrewer spectral scheme.
+
+### Sequential (Single Hue)
+
+* [d3.interpolateBlues](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateBlues) -
+* [d3.interpolateGreens](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateGreens) -
+* [d3.interpolateGreys](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateGreys) -
+* [d3.interpolateOranges](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateOranges) -
+* [d3.interpolatePurples](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolatePurples) -
+* [d3.interpolateReds](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateReds) -
+* [d3.schemeBlues](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeBlues) -
+* [d3.schemeGreens](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeGreens) -
+* [d3.schemeGreys](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeGreys) -
+* [d3.schemeOranges](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeOranges) -
+* [d3.schemePurples](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemePurples) -
+* [d3.schemeReds](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeReds) -
+
+### Sequential (Multi-Hue)
+
+* [d3.interpolateBuGn](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateBuGn) - ColorBrewer BuGn interpolator.
+* [d3.interpolateBuPu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateBuPu) - ColorBrewer BuPu interpolator.
+* [d3.interpolateCividis](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateCividis) - cividis interpolator.
+* [d3.interpolateCool](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateCool) - cool interpolator.
+* [d3.interpolateCubehelixDefault](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateCubehelixDefault) - cubehelix interpolator.
+* [d3.interpolateGnBu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateGnBu) - ColorBrewer GnBu interpolator.
+* [d3.interpolateInferno](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateInferno) - inferno interpolator.
+* [d3.interpolateMagma](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateMagma) - magma interpolator.
+* [d3.interpolateOrRd](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateOrRd) - ColorBrewer OrRd interpolator.
+* [d3.interpolatePlasma](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolatePlasma) - plasma interpolator.
+* [d3.interpolatePuBu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolatePuBu) - ColorBrewer PuBu interpolator.
+* [d3.interpolatePuBuGn](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolatePuBuGn) - ColorBrewer PuBuGn interpolator.
+* [d3.interpolatePuRd](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolatePuRd) - ColorBrewer PuRd interpolator.
+* [d3.interpolateRdPu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateRdPu) - ColorBrewer RdPu interpolator.
+* [d3.interpolateTurbo](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateTurbo) - turbo interpolator.
+* [d3.interpolateViridis](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateViridis) - viridis interpolator.
+* [d3.interpolateWarm](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateWarm) - warm interpolator.
+* [d3.interpolateYlGn](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateYlGn) - ColorBrewer YlGn interpolator.
+* [d3.interpolateYlGnBu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateYlGnBu) - ColorBrewer YlGnBu interpolator.
+* [d3.interpolateYlOrBr](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateYlOrBr) - ColorBrewer YlOrBr interpolator.
+* [d3.interpolateYlOrRd](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateYlOrRd) - ColorBrewer YlOrRd interpolator.
+* [d3.schemeBuGn](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeBuGn) - ColorBrewer BuGn scheme.
+* [d3.schemeBuPu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeBuPu) - ColorBrewer BuPu scheme.
+* [d3.schemeGnBu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeGnBu) - ColorBrewer GnBu scheme.
+* [d3.schemeOrRd](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeOrRd) - ColorBrewer OrRd scheme.
+* [d3.schemePuBu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemePuBu) - ColorBrewer PuBu scheme.
+* [d3.schemePuBuGn](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemePuBuGn) - ColorBrewer PuBuGn scheme.
+* [d3.schemePuRd](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemePuRd) - ColorBrewer PuRd scheme.
+* [d3.schemeRdPu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeRdPu) - ColorBrewer RdPu scheme.
+* [d3.schemeYlGn](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeYlGn) - ColorBrewer YlGn scheme.
+* [d3.schemeYlGnBu](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeYlGnBu) - ColorBrewer YlGnBu scheme.
+* [d3.schemeYlOrBr](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeYlOrBr) - ColorBrewer YlOrBr scheme.
+* [d3.schemeYlOrRd](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#schemeYlOrRd) - ColorBrewer YlOrRd scheme.
+
+### Cyclical
+
+* [d3.interpolateRainbow](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateRainbow) - the “less-angry” rainbow
+* [d3.interpolateSinebow](https://github.com/d3/d3-scale-chromatic/blob/v2.0.0/README.md#interpolateSinebow) - the “sinebow” smooth rainbow
+
+## [Contours (d3-contour)](https://github.com/d3/d3-contour/tree/v2.0.0)
+
+Compute contour polygons using marching squares.
+
+* [d3.contours](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#contours) - create a new contour generator.
+* [*contours*](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#_contours) - compute the contours for a given grid of values.
+* [*contours*.contour](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#contours_contour) - compute a contour for a given value.
+* [*contours*.size](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#contours_size) - set the size of a contour generator.
+* [*contours*.smooth](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#contours_smooth) - set whether or not the generated contours are smoothed.
+* [*contours*.thresholds](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#contours_thresholds) - set the thresholds of a contour generator.
+* [d3.contourDensity](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#contourDensity) - create a new density estimator.
+* [*density*](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#_density) - estimate the density of a given array of samples.
+* [*density*.x](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#density_x) - set the *x* accessor of the density estimator.
+* [*density*.y](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#density_y) - set the *y* accessor of the density estimator.
+* [*density*.weight](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#density_weight) - set the *weight* accessor of the density estimator.
+* [*density*.size](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#density_size) - set the size of the density estimator.
+* [*density*.cellSize](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#density_cellSize) - set the cell size of the density estimator.
+* [*density*.thresholds](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#density_thresholds) - set the thresholds of the density estimator.
+* [*density*.bandwidth](https://github.com/d3/d3-contour/blob/v2.0.0/README.md#density_bandwidth) - set the bandwidth of the density estimator.
+
+## [Voronoi Diagrams (d3-delaunay)](https://github.com/d3/d3-delaunay/tree/v5.3.0)
+
+Compute the Voronoi diagram of a set of two-dimensional points.
+
+* [new Delaunay](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#new_Delaunay) - create a delaunay triangulation for an array of point coordinates.
+* [Delaunay.from](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_from) - create a delaunay triangulation for an iterable of points.
+* [*delaunay*.points](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_points) - the coordinates of the points.
+* [*delaunay*.halfedges](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_halfedges) - the delaunay halfedges.
+* [*delaunay*.hull](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_hull) - the convex hull as point indices.
+* [*delaunay*.triangles](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_triangles) - the delaunay triangles.
+* [*delaunay*.inedges](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_inedges) - the delaunay inedges
+* [*delaunay*.find](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_find) - find the closest point in the delaunay triangulation.
+* [*delaunay*.neighbors](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_neighbors) - the neighbors of a point in the delaunay triangulation.
+* [*delaunay*.render](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_render) - render the edges of the delaunay triangulation.
+* [*delaunay*.renderHull](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_renderHull) - render the convex hull.
+* [*delaunay*.renderTriangle](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_renderTriangle) - render a triangle.
+* [*delaunay*.renderPoints](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_renderPoints) - render the points.
+* [*delaunay*.hullPolygon](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_hullPolygon) - the closed convex hull as point coordinates.
+* [*delaunay*.trianglePolygons](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_trianglePolygons) - iterate over all the triangles as polygons.
+* [*delaunay*.trianglePolygon](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_trianglePolygon) - return a triangle as a polygon.
+* [*delaunay*.update](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_update) - update a delaunay triangulation in place.
+* [*delaunay*.voronoi](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#delaunay_voronoi) - compute the voronoi diagram associated with a delaunay triangulation.
+* [*voronoi*.delaunay](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_delaunay) - the voronoi diagram’s source delaunay triangulation.
+* [*voronoi*.circumcenters](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_circumcenters) - the triangles’ circumcenters.
+* [*voronoi*.vectors](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_vectors) - directions for the outer (infinite) cells of the voronoi diagram.
+* [*voronoi*.xmin](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_xmin) - set the *xmin* bound of the extent.
+* [*voronoi*.ymin](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_ymin) - set the *ymin* bound of the extent.
+* [*voronoi*.xmax](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_xmax) - set the *xmax* bound of the extent.
+* [*voronoi*.ymax](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_ymax) - set the *ymax* bound of the extent.
+* [*voronoi*.contains](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_contains) - test whether a point is inside a voronoi cell.
+* [*voronoi*.neighbors](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_neighbors) - the neighbors of a point in the voronoi diagram.
+* [*voronoi*.render](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_render) - render the mesh of voronoi cells.
+* [*voronoi*.renderBounds](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_renderBounds) - render the extent.
+* [*voronoi*.renderCell](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_renderCell) - render a voronoi cell.
+* [*voronoi*.cellPolygons](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_cellPolygons) - iterate over all the cells as polygons.
+* [*voronoi*.cellPolygon](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_cellPolygon) - return a cell as a polygon.
+* [*voronoi*.update](https://github.com/d3/d3-delaunay/blob/v5.3.0/README.md#voronoi_update) - update a voronoi diagram in place.
+
+## [Dispatches (d3-dispatch)](https://github.com/d3/d3-dispatch/tree/v2.0.0)
+
+Separate concerns using named callbacks.
+
+* [d3.dispatch](https://github.com/d3/d3-dispatch/blob/v2.0.0/README.md#dispatch) - create a custom event dispatcher.
+* [*dispatch*.on](https://github.com/d3/d3-dispatch/blob/v2.0.0/README.md#dispatch_on) - register or unregister an event listener.
+* [*dispatch*.copy](https://github.com/d3/d3-dispatch/blob/v2.0.0/README.md#dispatch_copy) - create a copy of a dispatcher.
+* [*dispatch*.call](https://github.com/d3/d3-dispatch/blob/v2.0.0/README.md#dispatch_call) - dispatch an event to registered listeners.
+* [*dispatch*.apply](https://github.com/d3/d3-dispatch/blob/v2.0.0/README.md#dispatch_apply) - dispatch an event to registered listeners.
+
+## [Dragging (d3-drag)](https://github.com/d3/d3-drag/tree/v2.0.0)
+
+Drag and drop SVG, HTML or Canvas using mouse or touch input.
+
+* [d3.drag](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#drag) - create a drag behavior.
+* [*drag*](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#_drag) - apply the drag behavior to a selection.
+* [*drag*.container](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#drag_container) - set the coordinate system.
+* [*drag*.filter](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#drag_filter) - ignore some initiating input events.
+* [*drag*.touchable](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#drag_touchable) - set the touch support detector.
+* [*drag*.subject](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#drag_subject) - set the thing being dragged.
+* [*drag*.clickDistance](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#drag_clickDistance) - set the click distance threshold.
+* [*drag*.on](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#drag_on) - listen for drag events.
+* [d3.dragDisable](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#dragDisable) - prevent native drag-and-drop and text selection.
+* [d3.dragEnable](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#dragEnable) - enable native drag-and-drop and text selection.
+* [*event*.on](https://github.com/d3/d3-drag/blob/v2.0.0/README.md#event_on) - listen for drag events on the current gesture.
+
+## [Delimiter-Separated Values (d3-dsv)](https://github.com/d3/d3-dsv/tree/v2.0.0)
+
+Parse and format delimiter-separated values, most commonly CSV and TSV.
+
+* [d3.csvParse](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#csvParse) - parse the given CSV string, returning an array of objects.
+* [d3.csvParseRows](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#csvParseRows) - parse the given CSV string, returning an array of rows.
+* [d3.csvFormat](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#csvFormat) - format the given array of objects as CSV.
+* [d3.csvFormatBody](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#csvFormatBody) - format the given array of objects as CSV.
+* [d3.csvFormatRows](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#csvFormatRows) - format the given array of rows as CSV.
+* [d3.csvFormatRow](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#csvFormatRow) - format the given row as CSV.
+* [d3.csvFormatValue](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#csvFormatValue) - format the given value as CSV.
+* [d3.tsvParse](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#tsvParse) - parse the given TSV string, returning an array of objects.
+* [d3.tsvParseRows](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#tsvParseRows) - parse the given TSV string, returning an array of rows.
+* [d3.tsvFormat](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#tsvFormat) - format the given array of objects as TSV.
+* [d3.tsvFormatBody](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#tsvFormatBody) - format the given array of objects as TSV.
+* [d3.tsvFormatRows](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#tsvFormatRows) - format the given array of rows as TSV.
+* [d3.tsvFormatRow](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#tsvFormatRow) - format the given row as TSV.
+* [d3.tsvFormatValue](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#tsvFormatValue) - format the given value as TSV.
+* [d3.dsvFormat](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#dsvFormat) - create a new parser and formatter for the given delimiter.
+* [*dsv*.parse](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#dsv_parse) - parse the given string, returning an array of objects.
+* [*dsv*.parseRows](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#dsv_parseRows) - parse the given string, returning an array of rows.
+* [*dsv*.format](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#dsv_format) - format the given array of objects.
+* [*dsv*.formatBody](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#dsv_formatBody) - format the given array of objects.
+* [*dsv*.formatRows](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#dsv_formatRows) - format the given array of rows.
+* [*dsv*.formatRow](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#dsv_formatRow) - format the given row.
+* [*dsv*.formatValue](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#dsv_formatValue) - format the given value.
+* [d3.autoType](https://github.com/d3/d3-dsv/blob/v2.0.0/README.md#autoType) - automatically infer value types for the given object.
+
+## [Easings (d3-ease)](https://github.com/d3/d3-ease/tree/v2.0.0)
+
+Easing functions for smooth animation.
+
+* [*ease*](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#_ease) - ease the given normalized time.
+* [d3.easeLinear](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeLinear) - linear easing; the identity function.
+* [d3.easePolyIn](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easePolyIn) - polynomial easing; raises time to the given power.
+* [d3.easePolyOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easePolyOut) - reverse polynomial easing.
+* [d3.easePoly](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easePoly) - an alias for easePolyInOut.
+* [d3.easePolyInOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easePolyInOut) - symmetric polynomial easing.
+* [*poly*.exponent](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#poly_exponent) - specify the polynomial exponent.
+* [d3.easeQuadIn](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeQuadIn) - quadratic easing; squares time.
+* [d3.easeQuadOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeQuadOut) - reverse quadratic easing.
+* [d3.easeQuad](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeQuad) - an alias for easeQuadInOut.
+* [d3.easeQuadInOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeQuadInOut) - symmetric quadratic easing.
+* [d3.easeCubicIn](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeCubicIn) - cubic easing; cubes time.
+* [d3.easeCubicOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeCubicOut) - reverse cubic easing.
+* [d3.easeCubic](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeCubic) - an alias for easeCubicInOut.
+* [d3.easeCubicInOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeCubicInOut) - symmetric cubic easing.
+* [d3.easeSinIn](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeSinIn) - sinusoidal easing.
+* [d3.easeSinOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeSinOut) - reverse sinusoidal easing.
+* [d3.easeSin](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeSin) - an alias for easeSinInOut.
+* [d3.easeSinInOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeSinInOut) - symmetric sinusoidal easing.
+* [d3.easeExpIn](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeExpIn) - exponential easing.
+* [d3.easeExpOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeExpOut) - reverse exponential easing.
+* [d3.easeExp](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeExp) - an alias for easeExpInOut.
+* [d3.easeExpInOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeExpInOut) - symmetric exponential easing.
+* [d3.easeCircleIn](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeCircleIn) - circular easing.
+* [d3.easeCircleOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeCircleOut) - reverse circular easing.
+* [d3.easeCircle](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeCircle) - an alias for easeCircleInOut.
+* [d3.easeCircleInOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeCircleInOut) - symmetric circular easing.
+* [d3.easeElasticIn](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeElasticIn) - elastic easing, like a rubber band.
+* [d3.easeElastic](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeElastic) - an alias for easeElasticOut.
+* [d3.easeElasticOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeElasticOut) - reverse elastic easing.
+* [d3.easeElasticInOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeElasticInOut) - symmetric elastic easing.
+* [*elastic*.amplitude](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#elastic_amplitude) - specify the elastic amplitude.
+* [*elastic*.period](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#elastic_period) - specify the elastic period.
+* [d3.easeBackIn](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeBackIn) - anticipatory easing, like a dancer bending his knees before jumping.
+* [d3.easeBackOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeBackOut) - reverse anticipatory easing.
+* [d3.easeBack](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeBack) - an alias for easeBackInOut.
+* [d3.easeBackInOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeBackInOut) - symmetric anticipatory easing.
+* [*back*.overshoot](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#back_overshoot) - specify the amount of overshoot.
+* [d3.easeBounceIn](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeBounceIn) - bounce easing, like a rubber ball.
+* [d3.easeBounce](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeBounce) - an alias for easeBounceOut.
+* [d3.easeBounceOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeBounceOut) - reverse bounce easing.
+* [d3.easeBounceInOut](https://github.com/d3/d3-ease/blob/v2.0.0/README.md#easeBounceInOut) - symmetric bounce easing.
+
+## [Fetches (d3-fetch)](https://github.com/d3/d3-fetch/tree/v2.0.0)
+
+Convenience methods on top of the Fetch API.
+
+* [d3.blob](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#blob) - get a file as a blob.
+* [d3.buffer](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#buffer) - get a file as an array buffer.
+* [d3.csv](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#csv) - get a comma-separated values (CSV) file.
+* [d3.dsv](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#dsv) - get a delimiter-separated values (CSV) file.
+* [d3.html](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#html) - get an HTML file.
+* [d3.image](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#image) - get an image.
+* [d3.json](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#json) - get a JSON file.
+* [d3.svg](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#svg) - get an SVG file.
+* [d3.text](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#text) - get a plain text file.
+* [d3.tsv](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#tsv) - get a tab-separated values (TSV) file.
+* [d3.xml](https://github.com/d3/d3-fetch/blob/v2.0.0/README.md#xml) - get an XML file.
+
+## [Forces (d3-force)](https://github.com/d3/d3-force/tree/v2.1.1)
+
+Force-directed graph layout using velocity Verlet integration.
+
+* [d3.forceSimulation](https://github.com/d3/d3-force/blob/v2.1.1/README.md#forceSimulation) - create a new force simulation.
+* [*simulation*.restart](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_restart) - reheat and restart the simulation’s timer.
+* [*simulation*.stop](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_stop) - stop the simulation’s timer.
+* [*simulation*.tick](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_tick) - advance the simulation one step.
+* [*simulation*.nodes](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_nodes) - set the simulation’s nodes.
+* [*simulation*.alpha](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_alpha) - set the current alpha.
+* [*simulation*.alphaMin](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_alphaMin) - set the minimum alpha threshold.
+* [*simulation*.alphaDecay](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_alphaDecay) - set the alpha exponential decay rate.
+* [*simulation*.alphaTarget](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_alphaTarget) - set the target alpha.
+* [*simulation*.velocityDecay](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_velocityDecay) - set the velocity decay rate.
+* [*simulation*.force](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_force) - add or remove a force.
+* [*simulation*.find](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_find) - find the closest node to the given position.
+* [*simulation*.randomSource](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_randomSource) - set the simulation’s random source.
+* [*simulation*.on](https://github.com/d3/d3-force/blob/v2.1.1/README.md#simulation_on) - add or remove an event listener.
+* [*force*](https://github.com/d3/d3-force/blob/v2.1.1/README.md#_force) - apply the force.
+* [*force*.initialize](https://github.com/d3/d3-force/blob/v2.1.1/README.md#force_initialize) - initialize the force with the given nodes.
+* [d3.forceCenter](https://github.com/d3/d3-force/blob/v2.1.1/README.md#forceCenter) - create a centering force.
+* [*center*.x](https://github.com/d3/d3-force/blob/v2.1.1/README.md#center_x) - set the center *x*-coordinate.
+* [*center*.y](https://github.com/d3/d3-force/blob/v2.1.1/README.md#center_y) - set the center *y*-coordinate.
+* [*center*.strength](https://github.com/d3/d3-force/blob/v2.1.1/README.md#center_strength) - set the strength of the centering force.
+* [d3.forceCollide](https://github.com/d3/d3-force/blob/v2.1.1/README.md#forceCollide) - create a circle collision force.
+* [*collide*.radius](https://github.com/d3/d3-force/blob/v2.1.1/README.md#collide_radius) - set the circle radius.
+* [*collide*.strength](https://github.com/d3/d3-force/blob/v2.1.1/README.md#collide_strength) - set the collision resolution strength.
+* [*collide*.iterations](https://github.com/d3/d3-force/blob/v2.1.1/README.md#collide_iterations) - set the number of iterations.
+* [d3.forceLink](https://github.com/d3/d3-force/blob/v2.1.1/README.md#forceLink) - create a link force.
+* [*link*.links](https://github.com/d3/d3-force/blob/v2.1.1/README.md#link_links) - set the array of links.
+* [*link*.id](https://github.com/d3/d3-force/blob/v2.1.1/README.md#link_id) - link nodes by numeric index or string identifier.
+* [*link*.distance](https://github.com/d3/d3-force/blob/v2.1.1/README.md#link_distance) - set the link distance.
+* [*link*.strength](https://github.com/d3/d3-force/blob/v2.1.1/README.md#link_strength) - set the link strength.
+* [*link*.iterations](https://github.com/d3/d3-force/blob/v2.1.1/README.md#link_iterations) - set the number of iterations.
+* [d3.forceManyBody](https://github.com/d3/d3-force/blob/v2.1.1/README.md#forceManyBody) - create a many-body force.
+* [*manyBody*.strength](https://github.com/d3/d3-force/blob/v2.1.1/README.md#manyBody_strength) - set the force strength.
+* [*manyBody*.theta](https://github.com/d3/d3-force/blob/v2.1.1/README.md#manyBody_theta) - set the Barnes–Hut approximation accuracy.
+* [*manyBody*.distanceMin](https://github.com/d3/d3-force/blob/v2.1.1/README.md#manyBody_distanceMin) - limit the force when nodes are close.
+* [*manyBody*.distanceMax](https://github.com/d3/d3-force/blob/v2.1.1/README.md#manyBody_distanceMax) - limit the force when nodes are far.
+* [d3.forceX](https://github.com/d3/d3-force/blob/v2.1.1/README.md#forceX) - create an *x*-positioning force.
+* [*x*.strength](https://github.com/d3/d3-force/blob/v2.1.1/README.md#x_strength) - set the force strength.
+* [*x*.x](https://github.com/d3/d3-force/blob/v2.1.1/README.md#x_x) - set the target *x*-coordinate.
+* [d3.forceY](https://github.com/d3/d3-force/blob/v2.1.1/README.md#forceY) - create an *y*-positioning force.
+* [*y*.strength](https://github.com/d3/d3-force/blob/v2.1.1/README.md#y_strength) - set the force strength.
+* [*y*.y](https://github.com/d3/d3-force/blob/v2.1.1/README.md#y_y) - set the target *y*-coordinate.
+* [d3.forceRadial](https://github.com/d3/d3-force/blob/v2.1.1/README.md#forceRadial) - create a radial positioning force.
+* [*radial*.strength](https://github.com/d3/d3-force/blob/v2.1.1/README.md#radial_strength) - set the force strength.
+* [*radial*.radius](https://github.com/d3/d3-force/blob/v2.1.1/README.md#radial_radius) - set the target radius.
+* [*radial*.x](https://github.com/d3/d3-force/blob/v2.1.1/README.md#radial_x) - set the target center *x*-coordinate.
+* [*radial*.y](https://github.com/d3/d3-force/blob/v2.1.1/README.md#radial_y) - set the target center *y*-coordinate.
+
+## [Number Formats (d3-format)](https://github.com/d3/d3-format/tree/v2.0.0)
+
+Format numbers for human consumption.
+
+* [d3.format](https://github.com/d3/d3-format/blob/v2.0.0/README.md#format) - alias for *locale*.format on the default locale.
+* [d3.formatPrefix](https://github.com/d3/d3-format/blob/v2.0.0/README.md#formatPrefix) - alias for *locale*.formatPrefix on the default locale.
+* [*locale*.format](https://github.com/d3/d3-format/blob/v2.0.0/README.md#locale_format) - create a number format.
+* [*locale*.formatPrefix](https://github.com/d3/d3-format/blob/v2.0.0/README.md#locale_formatPrefix) - create a SI-prefix number format.
+* [d3.formatSpecifier](https://github.com/d3/d3-format/blob/v2.0.0/README.md#formatSpecifier) - parse a number format specifier.
+* [new d3.FormatSpecifier](https://github.com/d3/d3-format/blob/v2.0.0/README.md#FormatSpecifier) - augments a number format specifier object.
+* [d3.precisionFixed](https://github.com/d3/d3-format/blob/v2.0.0/README.md#precisionFixed) - compute decimal precision for fixed-point notation.
+* [d3.precisionPrefix](https://github.com/d3/d3-format/blob/v2.0.0/README.md#precisionPrefix) - compute decimal precision for SI-prefix notation.
+* [d3.precisionRound](https://github.com/d3/d3-format/blob/v2.0.0/README.md#precisionRound) - compute significant digits for rounded notation.
+* [d3.formatLocale](https://github.com/d3/d3-format/blob/v2.0.0/README.md#formatLocale) - define a custom locale.
+* [d3.formatDefaultLocale](https://github.com/d3/d3-format/blob/v2.0.0/README.md#formatDefaultLocale) - define the default locale.
+
+## [Geographies (d3-geo)](https://github.com/d3/d3-geo/tree/v2.0.0)
+
+Geographic projections, shapes and math.
+
+### [Paths](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#paths)
+
+* [d3.geoPath](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoPath) - create a new geographic path generator.
+* [*path*](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#_path) - project and render the specified feature.
+* [*path*.area](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#path_area) - compute the projected planar area of a given feature.
+* [*path*.bounds](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#path_bounds) - compute the projected planar bounding box of a given feature.
+* [*path*.centroid](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#path_centroid) - compute the projected planar centroid of a given feature.
+* [*path*.measure](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#path_measure) - compute the projected planar length of a given feature.
+* [*path*.projection](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#path_projection) - set the geographic projection.
+* [*path*.context](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#path_context) - set the render context.
+* [*path*.pointRadius](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#path_pointRadius) - set the radius to display point features.
+
+### [Projections](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projections)
+
+* [*projection*](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#_projection) - project the specified point from the sphere to the plane.
+* [*projection*.invert](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_invert) - unproject the specified point from the plane to the sphere.
+* [*projection*.stream](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_stream) - wrap the specified stream to project geometry.
+* [*projection*.preclip](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_preclip) - set the projection’s spherical clipping function.
+* [*projection*.postclip](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_postclip) - set the projection’s cartesian clipping function.
+* [*projection*.clipAngle](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_clipAngle) - set the radius of the clip circle.
+* [*projection*.clipExtent](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_clipExtent) - set the viewport clip extent, in pixels.
+* [*projection*.scale](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_scale) - set the scale factor.
+* [*projection*.translate](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_translate) - set the translation offset.
+* [*projection*.center](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_center) - set the center point.
+* [*projection*.angle](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_angle) - set the post-projection rotation.
+* [*projection*.reflectX](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_reflectX) - reflect the *x*-dimension.
+* [*projection*.reflectY](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_reflectY) - reflect the *y*-dimension.
+* [*projection*.rotate](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_rotate) - set the three-axis spherical rotation angles.
+* [*projection*.precision](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_precision) - set the precision threshold for adaptive sampling.
+* [*projection*.fitExtent](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_fitExtent) - set the scale and translate to fit a GeoJSON object.
+* [*projection*.fitSize](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_fitSize) - set the scale and translate to fit a GeoJSON object.
+* [*projection*.fitWidth](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_fitWidth) - set the scale and translate to fit a GeoJSON object.
+* [*projection*.fitHeight](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#projection_fitHeight) - set the scale and translate to fit a GeoJSON object.
+* [d3.geoAzimuthalEqualArea](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoAzimuthalEqualArea) - the azimuthal equal-area projection.
+* [d3.geoAzimuthalEqualAreaRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoAzimuthalEqualAreaRaw) - the raw azimuthal equal-area projection.
+* [d3.geoAzimuthalEquidistant](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoAzimuthalEquidistant) - the azimuthal equidistant projection.
+* [d3.geoAzimuthalEquidistantRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoAzimuthalEquidistantRaw) - the raw azimuthal equidistant projection.
+* [d3.geoGnomonic](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoGnomonic) - the gnomonic projection.
+* [d3.geoGnomonicRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoGnomonicRaw) - the raw gnomonic projection.
+* [d3.geoOrthographic](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoOrthographic) - the azimuthal orthographic projection.
+* [d3.geoOrthographicRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoOrthographicRaw) - the raw azimuthal orthographic projection.
+* [d3.geoStereographic](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoStereographic) - the azimuthal stereographic projection.
+* [d3.geoStereographicRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoStereographicRaw) - the raw azimuthal stereographic projection.
+* [d3.geoEqualEarth](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoEqualEarth) - the Equal Earth projection.
+* [d3.geoEqualEarthRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoEqualEarthRaw) - the raw Equal Earth projection.
+* [d3.geoAlbersUsa](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoAlbersUsa) - a composite Albers projection for the United States.
+* [*conic*.parallels](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#conic_parallels) - set the two standard parallels.
+* [d3.geoAlbers](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoAlbers) - the Albers equal-area conic projection.
+* [d3.geoConicConformal](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoConicConformal) - the conic conformal projection.
+* [d3.geoConicConformalRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoConicConformalRaw) - the raw conic conformal projection.
+* [d3.geoConicEqualArea](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoConicEqualArea) - the conic equal-area (Albers) projection.
+* [d3.geoConicEqualAreaRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoConicEqualAreaRaw) - the raw conic equal-area (Albers) projection.
+* [d3.geoConicEquidistant](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoConicEquidistant) - the conic equidistant projection.
+* [d3.geoConicEquidistantRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoConicEquidistantRaw) - the raw conic equidistant projection.
+* [d3.geoEquirectangular](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoEquirectangular) - the equirectangular (plate carreé) projection.
+* [d3.geoEquirectangularRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoEquirectangularRaw) - the raw equirectangular (plate carreé) projection.
+* [d3.geoMercator](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoMercator) - the spherical Mercator projection.
+* [d3.geoMercatorRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoMercatorRaw) - the raw Mercator projection.
+* [d3.geoTransverseMercator](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoTransverseMercator) - the transverse spherical Mercator projection.
+* [d3.geoTransverseMercatorRaw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoTransverseMercatorRaw) - the raw transverse spherical Mercator projection.
+* [d3.geoNaturalEarth1](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoNaturalEarth1) - the Equal Earth projection, version 1.
+* [d3.geoNaturalEarth1Raw](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoNaturalEarth1Raw) - the raw Equal Earth projection, version 1
+
+### [Raw projections](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#raw-projections)
+
+* [*project*](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#_project) - project the specified point from the sphere to the plane.
+* [*project*.invert](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#project_invert) - unproject the specified point from the plane to the sphere.
+* [d3.geoProjection](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoProjection) - create a custom projection.
+* [d3.geoProjectionMutator](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoProjectionMutator) - create a custom configurable projection.
+
+### [Spherical Math](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#spherical-math)
+
+* [d3.geoArea](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoArea) - compute the spherical area of a given feature.
+* [d3.geoBounds](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoBounds) - compute the latitude-longitude bounding box for a given feature.
+* [d3.geoCentroid](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoCentroid) - compute the spherical centroid of a given feature.
+* [d3.geoDistance](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoDistance) - compute the great-arc distance between two points.
+* [d3.geoLength](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoLength) - compute the length of a line string or the perimeter of a polygon.
+* [d3.geoInterpolate](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoInterpolate) - interpolate between two points along a great arc.
+* [d3.geoContains](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoContains) - test whether a point is inside a given feature.
+* [d3.geoRotation](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoRotation) - create a rotation function for the specified angles.
+* [*rotation*](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#_rotation) - rotate the given point around the sphere.
+* [*rotation*.invert](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#rotation_invert) - unrotate the given point around the sphere.
+
+### [Spherical Shapes](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#spherical-shapes)
+
+* [d3.geoCircle](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoCircle) - create a circle generator.
+* [*circle*](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#_circle) - generate a piecewise circle as a Polygon.
+* [*circle*.center](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#circle_center) - specify the circle center in latitude and longitude.
+* [*circle*.radius](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#circle_radius) - specify the angular radius in degrees.
+* [*circle*.precision](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#circle_precision) - specify the precision of the piecewise circle.
+* [d3.geoGraticule](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoGraticule) - create a graticule generator.
+* [*graticule*](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#_graticule) - generate a MultiLineString of meridians and parallels.
+* [*graticule*.lines](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#graticule_lines) - generate an array of LineStrings of meridians and parallels.
+* [*graticule*.outline](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#graticule_outline) - generate a Polygon of the graticule’s extent.
+* [*graticule*.extent](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#graticule_extent) - get or set the major & minor extents.
+* [*graticule*.extentMajor](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#graticule_extentMajor) - get or set the major extent.
+* [*graticule*.extentMinor](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#graticule_extentMinor) - get or set the minor extent.
+* [*graticule*.step](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#graticule_step) - get or set the major & minor step intervals.
+* [*graticule*.stepMajor](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#graticule_stepMajor) - get or set the major step intervals.
+* [*graticule*.stepMinor](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#graticule_stepMinor) - get or set the minor step intervals.
+* [*graticule*.precision](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#graticule_precision) - get or set the latitudinal precision.
+* [d3.geoGraticule10](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoGraticule10) - generate the default 10° global graticule.
+
+### [Streams](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#streams)
+
+* [d3.geoStream](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoStream) - convert a GeoJSON object to a geometry stream.
+* [*stream*.point](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#stream_point) - indicates a point with the specified coordinates.
+* [*stream*.lineStart](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#stream_lineStart) - indicates the start of a line or ring.
+* [*stream*.lineEnd](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#stream_lineEnd) - indicates the end of a line or ring.
+* [*stream*.polygonStart](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#stream_polygonStart) - indicates the start of a polygon.
+* [*stream*.polygonEnd](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#stream_polygonEnd) - indicates the end of a polygon.
+* [*stream*.sphere](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#stream_sphere) - indicates the sphere.
+
+### [Transforms](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#transforms)
+
+* [d3.geoTransform](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoTransform) - define a custom geometry transform.
+* [d3.geoIdentity](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoIdentity) - scale, translate or clip planar geometry.
+
+### [Clipping](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#clipping)
+
+* [*preclip*](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#preclip) - pre-clipping in geographic coordinates.
+* [*postclip*](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#postclip) - post-clipping in planar coordinates.
+* [d3.geoClipAntimeridian](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoClipAntimeridian) - cuts spherical geometries that cross the antimeridian.
+* [d3.geoClipCircle](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoClipCircle) - clips spherical geometries to a small circle.
+* [d3.geoClipRectangle](https://github.com/d3/d3-geo/blob/v2.0.0/README.md#geoClipRectangle) - clips planar geometries to a rectangular viewport.
+
+## [Hierarchies (d3-hierarchy)](https://github.com/d3/d3-hierarchy/tree/v2.0.0)
+
+Layout algorithms for visualizing hierarchical data.
+
+* [d3.hierarchy](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#hierarchy) - constructs a root node from hierarchical data.
+* [*node*.ancestors](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_ancestors) - generate an array of ancestors.
+* [*node*.descendants](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_descendants) - generate an array of descendants.
+* [*node*.leaves](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_leaves) - generate an array of leaves.
+* [*node*.find](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_find) - find a node in the hierarchy.
+* [*node*.path](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_path) - generate the shortest path to another node.
+* [*node*.links](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_links) - generate an array of links.
+* [*node*.sum](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_sum) - evaluate and aggregate quantitative values.
+* [*node*.count](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_count) - count the number of leaves.
+* [*node*.sort](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_sort) - sort all descendant siblings.
+* [*node*[Symbol.iterator]](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_iterator) - iterate on a hierarchy.
+* [*node*.each](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_each) - breadth-first traversal.
+* [*node*.eachAfter](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_eachAfter) - post-order traversal.
+* [*node*.eachBefore](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_eachBefore) - pre-order traversal.
+* [*node*.copy](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#node_copy) - copy a hierarchy.
+* [d3.stratify](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#stratify) - create a new stratify operator.
+* [*stratify*](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#_stratify) - construct a root node from tabular data.
+* [*stratify*.id](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#stratify_id) - set the node id accessor.
+* [*stratify*.parentId](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#stratify_parentId) - set the parent node id accessor.
+* [d3.cluster](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#cluster) - create a new cluster (dendrogram) layout.
+* [*cluster*](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#_cluster) - layout the specified hierarchy in a dendrogram.
+* [*cluster*.size](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#cluster_size) - set the layout size.
+* [*cluster*.nodeSize](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#cluster_nodeSize) - set the node size.
+* [*cluster*.separation](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#cluster_separation) - set the separation between leaves.
+* [d3.tree](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#tree) - create a new tidy tree layout.
+* [*tree*](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#_tree) - layout the specified hierarchy in a tidy tree.
+* [*tree*.size](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#tree_size) - set the layout size.
+* [*tree*.nodeSize](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#tree_nodeSize) - set the node size.
+* [*tree*.separation](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#tree_separation) - set the separation between nodes.
+* [d3.treemap](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap) - create a new treemap layout.
+* [*treemap*](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#_treemap) - layout the specified hierarchy as a treemap.
+* [*treemap*.tile](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap_tile) - set the tiling method.
+* [*treemap*.size](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap_size) - set the layout size.
+* [*treemap*.round](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap_round) - set whether the output coordinates are rounded.
+* [*treemap*.padding](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap_padding) - set the padding.
+* [*treemap*.paddingInner](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap_paddingInner) - set the padding between siblings.
+* [*treemap*.paddingOuter](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap_paddingOuter) - set the padding between parent and children.
+* [*treemap*.paddingTop](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap_paddingTop) - set the padding between the parent’s top edge and children.
+* [*treemap*.paddingRight](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap_paddingRight) - set the padding between the parent’s right edge and children.
+* [*treemap*.paddingBottom](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap_paddingBottom) - set the padding between the parent’s bottom edge and children.
+* [*treemap*.paddingLeft](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemap_paddingLeft) - set the padding between the parent’s left edge and children.
+* [d3.treemapBinary](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemapBinary) - tile using a balanced binary tree.
+* [d3.treemapDice](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemapDice) - tile into a horizontal row.
+* [d3.treemapSlice](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemapSlice) - tile into a vertical column.
+* [d3.treemapSliceDice](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemapSliceDice) - alternate between slicing and dicing.
+* [d3.treemapSquarify](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemapSquarify) - tile using squarified rows per Bruls *et. al.*
+* [d3.treemapResquarify](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#treemapResquarify) - like d3.treemapSquarify, but performs stable updates.
+* [*squarify*.ratio](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#squarify_ratio) - set the desired rectangle aspect ratio.
+* [d3.partition](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#partition) - create a new partition (icicle or sunburst) layout.
+* [*partition*](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#_partition) - layout the specified hierarchy as a partition diagram.
+* [*partition*.size](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#partition_size) - set the layout size.
+* [*partition*.round](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#partition_round) - set whether the output coordinates are rounded.
+* [*partition*.padding](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#partition_padding) - set the padding.
+* [d3.pack](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#pack) - create a new circle-packing layout.
+* [*pack*](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#_pack) - layout the specified hierarchy using circle-packing.
+* [*pack*.radius](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#pack_radius) - set the radius accessor.
+* [*pack*.size](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#pack_size) - set the layout size.
+* [*pack*.padding](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#pack_padding) - set the padding.
+* [d3.packSiblings](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#packSiblings) - pack the specified array of circles.
+* [d3.packEnclose](https://github.com/d3/d3-hierarchy/blob/v2.0.0/README.md#packEnclose) - enclose the specified array of circles.
+
+## [Interpolators (d3-interpolate)](https://github.com/d3/d3-interpolate/tree/v2.0.1)
+
+Interpolate numbers, colors, strings, arrays, objects, whatever!
+
+* [d3.interpolate](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolate) - interpolate arbitrary values.
+* [d3.interpolateNumber](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateNumber) - interpolate numbers.
+* [d3.interpolateRound](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateRound) - interpolate integers.
+* [d3.interpolateString](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateString) - interpolate strings with embedded numbers.
+* [d3.interpolateDate](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateDate) - interpolate dates.
+* [d3.interpolateArray](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateArray) - interpolate arrays of arbitrary values.
+* [d3.interpolateNumberArray](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateNumberArray) - interpolate arrays of numbers.
+* [d3.interpolateObject](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateObject) - interpolate arbitrary objects.
+* [d3.interpolateTransformCss](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateTransformCss) - interpolate 2D CSS transforms.
+* [d3.interpolateTransformSvg](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateTransformSvg) - interpolate 2D SVG transforms.
+* [d3.interpolateZoom](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateZoom) - zoom and pan between two views.
+* [*interpolateZoom*.rho](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolate_rho) - set the curvature *rho* of the zoom interpolator.
+* [d3.interpolateDiscrete](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateDiscrete) - generate a discrete interpolator from a set of values.
+* [d3.quantize](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#quantize) - generate uniformly-spaced samples from an interpolator.
+* [d3.interpolateRgb](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateRgb) - interpolate RGB colors.
+* [d3.interpolateRgbBasis](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateRgbBasis) - generate a B-spline through a set of colors.
+* [d3.interpolateRgbBasisClosed](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateRgbBasisClosed) - generate a closed B-spline through a set of colors.
+* [d3.interpolateHsl](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateHsl) - interpolate HSL colors.
+* [d3.interpolateHslLong](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateHslLong) - interpolate HSL colors, the long way.
+* [d3.interpolateLab](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateLab) - interpolate Lab colors.
+* [d3.interpolateHcl](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateHcl) - interpolate HCL colors.
+* [d3.interpolateHclLong](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateHclLong) - interpolate HCL colors, the long way.
+* [d3.interpolateCubehelix](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateCubehelix) - interpolate Cubehelix colors.
+* [d3.interpolateCubehelixLong](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateCubehelixLong) - interpolate Cubehelix colors, the long way.
+* [*interpolate*.gamma](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolate_gamma) - apply gamma correction during interpolation.
+* [d3.interpolateHue](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateHue) - interpolate a hue angle.
+* [d3.interpolateBasis](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateBasis) - generate a B-spline through a set of values.
+* [d3.interpolateBasisClosed](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#interpolateBasisClosed) - generate a closed B-spline through a set of values.
+* [d3.piecewise](https://github.com/d3/d3-interpolate/blob/v2.0.1/README.md#piecewise) - generate a piecewise linear interpolator from a set of values.
+
+## [Paths (d3-path)](https://github.com/d3/d3-path/tree/v2.0.0)
+
+Serialize Canvas path commands to SVG.
+
+* [d3.path](https://github.com/d3/d3-path/blob/v2.0.0/README.md#path) - create a new path serializer.
+* [*path*.moveTo](https://github.com/d3/d3-path/blob/v2.0.0/README.md#path_moveTo) - move to the given point.
+* [*path*.closePath](https://github.com/d3/d3-path/blob/v2.0.0/README.md#path_closePath) - close the current subpath.
+* [*path*.lineTo](https://github.com/d3/d3-path/blob/v2.0.0/README.md#path_lineTo) - draw a straight line segment.
+* [*path*.quadraticCurveTo](https://github.com/d3/d3-path/blob/v2.0.0/README.md#path_quadraticCurveTo) - draw a quadratic Bézier segment.
+* [*path*.bezierCurveTo](https://github.com/d3/d3-path/blob/v2.0.0/README.md#path_bezierCurveTo) - draw a cubic Bézier segment.
+* [*path*.arcTo](https://github.com/d3/d3-path/blob/v2.0.0/README.md#path_arcTo) - draw a circular arc segment.
+* [*path*.arc](https://github.com/d3/d3-path/blob/v2.0.0/README.md#path_arc) - draw a circular arc segment.
+* [*path*.rect](https://github.com/d3/d3-path/blob/v2.0.0/README.md#path_rect) - draw a rectangle.
+* [*path*.toString](https://github.com/d3/d3-path/blob/v2.0.0/README.md#path_toString) - serialize to an SVG path data string.
+
+## [Polygons (d3-polygon)](https://github.com/d3/d3-polygon/tree/v2.0.0)
+
+Geometric operations for two-dimensional polygons.
+
+* [d3.polygonArea](https://github.com/d3/d3-polygon/blob/v2.0.0/README.md#polygonArea) - compute the area of the given polygon.
+* [d3.polygonCentroid](https://github.com/d3/d3-polygon/blob/v2.0.0/README.md#polygonCentroid) - compute the centroid of the given polygon.
+* [d3.polygonHull](https://github.com/d3/d3-polygon/blob/v2.0.0/README.md#polygonHull) - compute the convex hull of the given points.
+* [d3.polygonContains](https://github.com/d3/d3-polygon/blob/v2.0.0/README.md#polygonContains) - test whether a point is inside a polygon.
+* [d3.polygonLength](https://github.com/d3/d3-polygon/blob/v2.0.0/README.md#polygonLength) - compute the length of the given polygon’s perimeter.
+
+## [Quadtrees (d3-quadtree)](https://github.com/d3/d3-quadtree/tree/v2.0.0)
+
+Two-dimensional recursive spatial subdivision.
+
+* [d3.quadtree](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree) - create a new, empty quadtree.
+* [*quadtree*.x](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_x) - set the *x* accessor.
+* [*quadtree*.y](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_y) - set the *y* accessor.
+* [*quadtree*.extent](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_extent) - extend the quadtree to cover an extent.
+* [*quadtree*.cover](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_cover) - extend the quadtree to cover a point.
+* [*quadtree*.add](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_add) - add a datum to a quadtree.
+* [*quadtree*.addAll](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_addAll) - add an array of data to a quadtree.
+* [*quadtree*.remove](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_remove) - remove a datum from a quadtree.
+* [*quadtree*.removeAll](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_removeAll) - remove an array of data from a quadtree.
+* [*quadtree*.copy](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_copy) - create a copy of a quadtree.
+* [*quadtree*.root](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_root) - get the quadtree’s root node.
+* [*quadtree*.data](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_data) - retrieve all data from the quadtree.
+* [*quadtree*.size](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_size) - count the number of data in the quadtree.
+* [*quadtree*.find](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_find) - quickly find the closest datum in a quadtree.
+* [*quadtree*.visit](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_visit) - selectively visit nodes in a quadtree.
+* [*quadtree*.visitAfter](https://github.com/d3/d3-quadtree/blob/v2.0.0/README.md#quadtree_visitAfter) - visit all nodes in a quadtree.
+
+## [Random Numbers (d3-random)](https://github.com/d3/d3-random/tree/v2.2.2)
+
+Generate random numbers from various distributions.
+
+* [d3.randomUniform](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomUniform) - from a uniform distribution.
+* [d3.randomInt](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomInt) - from a uniform integer distribution.
+* [d3.randomNormal](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomNormal) - from a normal distribution.
+* [d3.randomLogNormal](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomLogNormal) - from a log-normal distribution.
+* [d3.randomBates](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomBates) - from a Bates distribution.
+* [d3.randomIrwinHall](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomIrwinHall) - from an Irwin–Hall distribution.
+* [d3.randomExponential](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomExponential) - from an exponential distribution.
+* [d3.randomPareto](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomPareto) - from a Pareto distribution.
+* [d3.randomBernoulli](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomBernoulli) - from a Bernoulli distribution.
+* [d3.randomGeometric](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomGeometric) - from a geometric distribution.
+* [d3.randomBinomial](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomBinomial) - from a binomial distribution.
+* [d3.randomGamma](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomGamma) - from a gamma distribution.
+* [d3.randomBeta](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomBeta) - from a beta distribution.
+* [d3.randomWeibull](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomWeibull) - from a Weibull, Gumbel or Fréchet distribution.
+* [d3.randomCauchy](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomCauchy) - from a Cauchy distribution.
+* [d3.randomLogistic](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomLogistic) - from a logistic distribution.
+* [d3.randomPoisson](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomPoisson) - from a Poisson distribution.
+* [*random*.source](https://github.com/d3/d3-random/blob/v2.2.2/README.md#random_source) - set the source of randomness.
+* [d3.randomLcg](https://github.com/d3/d3-random/blob/v2.2.2/README.md#randomLcg) - a seeded pseudorandom number generator.
+
+## [Scales (d3-scale)](https://github.com/d3/d3-scale/tree/v3.3.0)
+
+Encodings that map abstract data to visual representation.
+
+### [Continuous Scales](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous-scales)
+
+Map a continuous, quantitative domain to a continuous range.
+
+* [*continuous*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_continuous) - compute the range value corresponding to a given domain value.
+* [*continuous*.invert](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_invert) - compute the domain value corresponding to a given range value.
+* [*continuous*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_domain) - set the input domain.
+* [*continuous*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_range) - set the output range.
+* [*continuous*.rangeRound](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_rangeRound) - set the output range and enable rounding.
+* [*continuous*.clamp](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_clamp) - enable clamping to the domain or range.
+* [*continuous*.unknown](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_unknown) - set the output value for unknown inputs.
+* [*continuous*.interpolate](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_interpolate) - set the output interpolator.
+* [*continuous*.ticks](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_ticks) - compute representative values from the domain.
+* [*continuous*.tickFormat](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_tickFormat) - format ticks for human consumption.
+* [*continuous*.nice](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_nice) - extend the domain to nice round numbers.
+* [*continuous*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#continuous_copy) - create a copy of this scale.
+* [d3.tickFormat](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#tickFormat) - format ticks for human consumption.
+* [d3.scaleLinear](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleLinear) - create a quantitative linear scale.
+* [d3.scalePow](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scalePow) - create a quantitative power scale.
+* [*pow*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_pow) - compute the range value corresponding to a given domain value.
+* [*pow*.invert](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_invert) - compute the domain value corresponding to a given range value.
+* [*pow*.exponent](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_exponent) - set the power exponent.
+* [*pow*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_domain) - set the input domain.
+* [*pow*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_range) - set the output range.
+* [*pow*.rangeRound](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_rangeRound) - set the output range and enable rounding.
+* [*pow*.clamp](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_clamp) - enable clamping to the domain or range.
+* [*pow*.interpolate](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_interpolate) - set the output interpolator.
+* [*pow*.ticks](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_ticks) - compute representative values from the domain.
+* [*pow*.tickFormat](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_tickFormat) - format ticks for human consumption.
+* [*pow*.nice](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_nice) - extend the domain to nice round numbers.
+* [*pow*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#pow_copy) - create a copy of this scale.
+* [d3.scaleSqrt](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleSqrt) - create a quantitative power scale with exponent 0.5.
+* [d3.scaleLog](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleLog) - create a quantitative logarithmic scale.
+* [*log*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_log) - compute the range value corresponding to a given domain value.
+* [*log*.invert](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_invert) - compute the domain value corresponding to a given range value.
+* [*log*.base](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_base) - set the logarithm base.
+* [*log*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_domain) - set the input domain.
+* [*log*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_range) - set the output range.
+* [*log*.rangeRound](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_rangeRound) - set the output range and enable rounding.
+* [*log*.clamp](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_clamp) - enable clamping to the domain or range.
+* [*log*.interpolate](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_interpolate) - set the output interpolator.
+* [*log*.ticks](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_ticks) - compute representative values from the domain.
+* [*log*.tickFormat](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_tickFormat) - format ticks for human consumption.
+* [*log*.nice](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_nice) - extend the domain to nice round numbers.
+* [*log*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#log_copy) - create a copy of this scale.
+* [d3.scaleSymlog](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleSymlog) - create a symmetric logarithmic scale.
+* [*symlog*.constant](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#symlog_constant) - set the constant of a symlog scale.
+* [d3.scaleIdentity](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleIdentity) - creates an identity scale.
+* [d3.scaleRadial](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleRadial) - creates a radial scale.
+* [d3.scaleTime](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleTime) - create a linear scale for time.
+* [*time*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_time) - compute the range value corresponding to a given domain value.
+* [*time*.invert](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#time_invert) - compute the domain value corresponding to a given range value.
+* [*time*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#time_domain) - set the input domain.
+* [*time*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#time_range) - set the output range.
+* [*time*.rangeRound](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#time_rangeRound) - set the output range and enable rounding.
+* [*time*.clamp](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#time_clamp) - enable clamping to the domain or range.
+* [*time*.interpolate](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#time_interpolate) - set the output interpolator.
+* [*time*.ticks](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#time_ticks) - compute representative values from the domain.
+* [*time*.tickFormat](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#time_tickFormat) - format ticks for human consumption.
+* [*time*.nice](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#time_nice) - extend the domain to nice round times.
+* [*time*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#time_copy) - create a copy of this scale.
+* [d3.scaleUtc](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleUtc) - create a linear scale for UTC.
+
+### [Sequential Scales](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#sequential-scales)
+
+Map a continuous, quantitative domain to a continuous, fixed interpolator.
+
+* [d3.scaleSequential](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleSequential) - create a sequential scale.
+* [*sequential*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_sequential) - compute the range value corresponding to an input value.
+* [*sequential*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#sequential_domain) - set the input domain.
+* [*sequential*.clamp](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#sequential_clamp) - enable clamping to the domain.
+* [*sequential*.interpolator](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#sequential_interpolator) - set the scale’s output interpolator.
+* [*sequential*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#sequential_range) - set the output range.
+* [*sequential*.rangeRound](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#sequential_rangeRound) - set the output range and enable rounding.
+* [*sequential*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#sequential_copy) - create a copy of this scale.
+* [d3.scaleSequentialLog](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleSequentialLog) - create a logarithmic sequential scale.
+* [d3.scaleSequentialPow](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleSequentialPow) - create a power sequential scale.
+* [d3.scaleSequentialSqrt](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleSequentialSqrt) - create a power sequential scale with exponent 0.5.
+* [d3.scaleSequentialSymlog](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleSequentialSymlog) - create a symmetric logarithmic sequential scale.
+* [d3.scaleSequentialQuantile](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleSequentialQuantile) - create a sequential scale using a *p*-quantile transform.
+* [*sequentialQuantile*.quantiles](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#sequentialQuantile_quantiles) - return the scale’s quantiles.
+
+### [Diverging Scales](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#diverging-scales)
+
+Map a continuous, quantitative domain to a continuous, fixed interpolator.
+
+* [d3.scaleDiverging](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleDiverging) - create a diverging scale.
+* [*diverging*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_diverging) - compute the range value corresponding to an input value.
+* [*diverging*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#diverging_domain) - set the input domain.
+* [*diverging*.clamp](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#diverging_clamp) - enable clamping to the domain or range.
+* [*diverging*.interpolator](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#diverging_interpolator) - set the scale’s output interpolator.
+* [*diverging*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#diverging_range) - set the output range.
+* [*diverging*.rangeRound](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#diverging_rangeRound) - set the output range and enable rounding.
+* [*diverging*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#diverging_copy) - create a copy of this scale.
+* [*diverging*.unknown](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#diverging_unknown) - set the output value for unknown inputs.
+* [d3.scaleDivergingLog](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleDivergingLog) - create a diverging logarithmic scale.
+* [d3.scaleDivergingPow](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleDivergingPow) - create a diverging power scale.
+* [d3.scaleDivergingSqrt](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleDivergingSqrt) - create a diverging power scale with exponent 0.5.
+* [d3.scaleDivergingSymlog](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleDivergingSymlog) - create a diverging symmetric logarithmic scale.
+
+### [Quantize Scales](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantize-scales)
+
+Map a continuous, quantitative domain to a discrete range.
+
+* [d3.scaleQuantize](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleQuantize) - create a uniform quantizing linear scale.
+* [*quantize*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_quantize) - compute the range value corresponding to a given domain value.
+* [*quantize*.invertExtent](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantize_invertExtent) - compute the domain values corresponding to a given range value.
+* [*quantize*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantize_domain) - set the input domain.
+* [*quantize*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantize_range) - set the output range.
+* [*quantize*.ticks](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantize_ticks) - compute representative values from the domain.
+* [*quantize*.tickFormat](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantize_tickFormat) - format ticks for human consumption.
+* [*quantize*.nice](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantize_nice) - extend the domain to nice round numbers.
+* [*quantize*.thresholds](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantize_thresholds) - return the array of computed thresholds within the domain.
+* [*quantize*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantize_copy) - create a copy of this scale.
+* [d3.scaleQuantile](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleQuantile) - create a quantile quantizing linear scale.
+* [*quantile*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_quantile) - compute the range value corresponding to a given domain value.
+* [*quantile*.invertExtent](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantile_invertExtent) - compute the domain values corresponding to a given range value.
+* [*quantile*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantile_domain) - set the input domain.
+* [*quantile*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantile_range) - set the output range.
+* [*quantile*.quantiles](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantile_quantiles) - get the quantile thresholds.
+* [*quantile*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#quantile_copy) - create a copy of this scale.
+* [d3.scaleThreshold](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleThreshold) - create an arbitrary quantizing linear scale.
+* [*threshold*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_threshold) - compute the range value corresponding to a given domain value.
+* [*threshold*.invertExtent](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#threshold_invertExtent) - compute the domain values corresponding to a given range value.
+* [*threshold*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#threshold_domain) - set the input domain.
+* [*threshold*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#threshold_range) - set the output range.
+* [*threshold*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#threshold_copy) - create a copy of this scale.
+
+### [Ordinal Scales](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#ordinal-scales)
+
+Map a discrete domain to a discrete range.
+
+* [d3.scaleOrdinal](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleOrdinal) - create an ordinal scale.
+* [*ordinal*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_ordinal) - compute the range value corresponding to a given domain value.
+* [*ordinal*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#ordinal_domain) - set the input domain.
+* [*ordinal*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#ordinal_range) - set the output range.
+* [*ordinal*.unknown](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#ordinal_unknown) - set the output value for unknown inputs.
+* [*ordinal*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#ordinal_copy) - create a copy of this scale.
+* [d3.scaleImplicit](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleImplicit) - a special unknown value for implicit domains.
+* [d3.scaleBand](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scaleBand) - create an ordinal band scale.
+* [*band*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_band) - compute the band start corresponding to a given domain value.
+* [*band*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_domain) - set the input domain.
+* [*band*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_range) - set the output range.
+* [*band*.rangeRound](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_rangeRound) - set the output range and enable rounding.
+* [*band*.round](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_round) - enable rounding.
+* [*band*.paddingInner](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_paddingInner) - set padding between bands.
+* [*band*.paddingOuter](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_paddingOuter) - set padding outside the first and last bands.
+* [*band*.padding](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_padding) - set padding outside and between bands.
+* [*band*.align](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_align) - set band alignment, if there is extra space.
+* [*band*.bandwidth](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_bandwidth) - get the width of each band.
+* [*band*.step](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_step) - get the distance between the starts of adjacent bands.
+* [*band*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#band_copy) - create a copy of this scale.
+* [d3.scalePoint](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#scalePoint) - create an ordinal point scale.
+* [*point*](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#_point) - compute the point corresponding to a given domain value.
+* [*point*.domain](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#point_domain) - set the input domain.
+* [*point*.range](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#point_range) - set the output range.
+* [*point*.rangeRound](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#point_rangeRound) - set the output range and enable rounding.
+* [*point*.round](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#point_round) - enable rounding.
+* [*point*.padding](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#point_padding) - set padding outside the first and last point.
+* [*point*.align](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#point_align) - set point alignment, if there is extra space.
+* [*point*.bandwidth](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#point_bandwidth) - returns zero.
+* [*point*.step](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#point_step) - get the distance between the starts of adjacent points.
+* [*point*.copy](https://github.com/d3/d3-scale/blob/v3.3.0/README.md#point_copy) - create a copy of this scale.
+
+## [Selections (d3-selection)](https://github.com/d3/d3-selection/tree/v2.0.0)
+
+Transform the DOM by selecting elements and joining to data.
+
+### [Selecting Elements](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selecting-elements)
+
+* [d3.selection](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection) - select the root document element.
+* [d3.select](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#select) - select an element from the document.
+* [d3.selectAll](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selectAll) - select multiple elements from the document.
+* [*selection*.select](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_select) - select a descendant element for each selected element.
+* [*selection*.selectAll](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_selectAll) - select multiple descendants for each selected element.
+* [*selection*.filter](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_filter) - filter elements based on data.
+* [*selection*.merge](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_merge) - merge this selection with another.
+* [*selection*.selectChild](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_selectChild) - select a child element for each selected element.
+* [*selection*.selectChildren](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_selectChildren) - select the children elements for each selected element.
+* [*selection*.selection](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_selection) - return the selection.
+* [d3.matcher](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#matcher) - test whether an element matches a selector.
+* [d3.selector](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selector) - select an element.
+* [d3.selectorAll](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selectorAll) - select elements.
+* [d3.window](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#window) - get a node’s owner window.
+* [d3.style](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#style) - get a node’s current style value.
+
+### [Modifying Elements](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#modifying-elements)
+
+* [*selection*.attr](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_attr) - get or set an attribute.
+* [*selection*.classed](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_classed) - get, add or remove CSS classes.
+* [*selection*.style](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_style) - get or set a style property.
+* [*selection*.property](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_property) - get or set a (raw) property.
+* [*selection*.text](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_text) - get or set the text content.
+* [*selection*.html](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_html) - get or set the inner HTML.
+* [*selection*.append](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_append) - create, append and select new elements.
+* [*selection*.insert](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_insert) - create, insert and select new elements.
+* [*selection*.remove](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_remove) - remove elements from the document.
+* [*selection*.clone](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_clone) - insert clones of selected elements.
+* [*selection*.sort](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_sort) - sort elements in the document based on data.
+* [*selection*.order](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_order) - reorders elements in the document to match the selection.
+* [*selection*.raise](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_raise) - reorders each element as the last child of its parent.
+* [*selection*.lower](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_lower) - reorders each element as the first child of its parent.
+* [d3.create](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#create) - create and select a detached element.
+* [d3.creator](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#creator) - create an element by name.
+
+### [Joining Data](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#joining-data)
+
+* [*selection*.data](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_data) - bind elements to data.
+* [*selection*.join](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_join) - enter, update or exit elements based on data.
+* [*selection*.enter](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_enter) - get the enter selection (data missing elements).
+* [*selection*.exit](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_exit) - get the exit selection (elements missing data).
+* [*selection*.datum](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_datum) - get or set element data (without joining).
+
+### [Handling Events](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#handling-events)
+
+* [*selection*.on](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_on) - add or remove event listeners.
+* [*selection*.dispatch](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_dispatch) - dispatch a custom event.
+* [d3.pointer](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#pointer) - get the pointer’s position of an event.
+* [d3.pointers](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#pointers) - get the pointers’ positions of an event.
+
+### [Control Flow](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#control-flow)
+
+* [*selection*.each](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_each) - call a function for each element.
+* [*selection*.call](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_call) - call a function with this selection.
+* [*selection*.empty](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_empty) - returns true if this selection is empty.
+* [*selection*.nodes](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_nodes) - returns an array of all selected elements.
+* [*selection*.node](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_node) - returns the first (non-null) element.
+* [*selection*.size](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_size) - returns the count of elements.
+* [*selection*[Symbol.iterator]](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#selection_iterator) - iterate over the selection’s nodes.
+
+### [Local Variables](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#local-variables)
+
+* [d3.local](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#local) - declares a new local variable.
+* [*local*.set](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#local_set) - set a local variable’s value.
+* [*local*.get](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#local_get) - get a local variable’s value.
+* [*local*.remove](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#local_remove) - delete a local variable.
+* [*local*.toString](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#local_toString) - get the property identifier of a local variable.
+
+### [Namespaces](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#namespaces)
+
+* [d3.namespace](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#namespace) - qualify a prefixed XML name, such as “xlink:href”.
+* [d3.namespaces](https://github.com/d3/d3-selection/blob/v2.0.0/README.md#namespaces) - the built-in XML namespaces.
+
+## [Shapes (d3-shape)](https://github.com/d3/d3-shape/tree/v2.1.0)
+
+Graphical primitives for visualization.
+
+### [Arcs](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arcs)
+
+Circular or annular sectors, as in a pie or donut chart.
+
+* [d3.arc](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arc) - create a new arc generator.
+* [*arc*](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#_arc) - generate an arc for the given datum.
+* [*arc*.centroid](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arc_centroid) - compute an arc’s midpoint.
+* [*arc*.innerRadius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arc_innerRadius) - set the inner radius.
+* [*arc*.outerRadius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arc_outerRadius) - set the outer radius.
+* [*arc*.cornerRadius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arc_cornerRadius) - set the corner radius, for rounded corners.
+* [*arc*.startAngle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arc_startAngle) - set the start angle.
+* [*arc*.endAngle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arc_endAngle) - set the end angle.
+* [*arc*.padAngle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arc_padAngle) - set the angle between adjacent arcs, for padded arcs.
+* [*arc*.padRadius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arc_padRadius) - set the radius at which to linearize padding.
+* [*arc*.context](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#arc_context) - set the rendering context.
+
+### [Pies](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#pies)
+
+Compute the necessary angles to represent a tabular dataset as a pie or donut chart.
+
+* [d3.pie](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#pie) - create a new pie generator.
+* [*pie*](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#_pie) - compute the arc angles for the given dataset.
+* [*pie*.value](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#pie_value) - set the value accessor.
+* [*pie*.sort](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#pie_sort) - set the sort order comparator.
+* [*pie*.sortValues](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#pie_sortValues) - set the sort order comparator.
+* [*pie*.startAngle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#pie_startAngle) - set the overall start angle.
+* [*pie*.endAngle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#pie_endAngle) - set the overall end angle.
+* [*pie*.padAngle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#pie_padAngle) - set the pad angle between adjacent arcs.
+
+### [Lines](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#lines)
+
+A spline or polyline, as in a line chart.
+
+* [d3.line](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#line) - create a new line generator.
+* [*line*](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#_line) - generate a line for the given dataset.
+* [*line*.x](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#line_x) - set the *x* accessor.
+* [*line*.y](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#line_y) - set the *y* accessor.
+* [*line*.defined](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#line_defined) - set the defined accessor.
+* [*line*.curve](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#line_curve) - set the curve interpolator.
+* [*line*.context](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#line_context) - set the rendering context.
+* [d3.lineRadial](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#lineRadial) - create a new radial line generator.
+* [*lineRadial*](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#_lineRadial) - generate a line for the given dataset.
+* [*lineRadial*.angle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#lineRadial_angle) - set the angle accessor.
+* [*lineRadial*.radius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#lineRadial_radius) - set the radius accessor.
+* [*lineRadial*.defined](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#lineRadial_defined) - set the defined accessor.
+* [*lineRadial*.curve](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#lineRadial_curve) - set the curve interpolator.
+* [*lineRadial*.context](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#lineRadial_context) - set the rendering context.
+
+### [Areas](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areas)
+
+An area, defined by a bounding topline and baseline, as in an area chart.
+
+* [d3.area](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area) - create a new area generator.
+* [*area*](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#_area) - generate an area for the given dataset.
+* [*area*.x](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_x) - set the *x0* and *x1* accessors.
+* [*area*.x0](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_x0) - set the baseline *x* accessor.
+* [*area*.x1](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_x1) - set the topline *x* accessor.
+* [*area*.y](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_y) - set the *y0* and *y1* accessors.
+* [*area*.y0](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_y0) - set the baseline *y* accessor.
+* [*area*.y1](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_y1) - set the topline *y* accessor.
+* [*area*.defined](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_defined) - set the defined accessor.
+* [*area*.curve](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_curve) - set the curve interpolator.
+* [*area*.context](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_context) - set the rendering context.
+* [*area*.lineX0](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_lineX0) - derive a line for the left edge of an area.
+* [*area*.lineY0](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_lineY0) - derive a line for the top edge of an area.
+* [*area*.lineX1](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_lineX1) - derive a line for the right edge of an area.
+* [*area*.lineY1](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#area_lineY1) - derive a line for the bottom edge of an area.
+* [d3.areaRadial](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial) - create a new radial area generator.
+* [*areaRadial*](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#_areaRadial) - generate an area for the given dataset.
+* [*areaRadial*.angle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_angle) - set the start and end angle accessors.
+* [*areaRadial*.startAngle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_startAngle) - set the start angle accessor.
+* [*areaRadial*.endAngle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_endAngle) - set the end angle accessor.
+* [*areaRadial*.radius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_radius) - set the inner and outer radius accessors.
+* [*areaRadial*.innerRadius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_innerRadius) - set the inner radius accessor.
+* [*areaRadial*.outerRadius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_outerRadius) - set the outer radius accessor.
+* [*areaRadial*.defined](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_defined) - set the defined accessor.
+* [*areaRadial*.curve](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_curve) - set the curve interpolator.
+* [*areaRadial*.context](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_context) - set the rendering context.
+* [*areaRadial*.lineStartAngle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_lineStartAngle) - derive a line for the start edge of an area.
+* [*areaRadial*.lineInnerRadius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_lineInnerRadius) - derive a line for the inner edge of an area.
+* [*areaRadial*.lineEndAngle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_lineEndAngle) - derive a line for the end edge of an area.
+* [*areaRadial*.lineOuterRadius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#areaRadial_lineOuterRadius) - derive a line for the outer edge of an area.
+
+### [Curves](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curves)
+
+Interpolate between points to produce a continuous shape.
+
+* [d3.curveBasis](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveBasis) - a cubic basis spline, repeating the end points.
+* [d3.curveBasisClosed](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveBasisClosed) - a closed cubic basis spline.
+* [d3.curveBasisOpen](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveBasisOpen) - a cubic basis spline.
+* [d3.curveBundle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveBundle) - a straightened cubic basis spline.
+* [*bundle*.beta](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveBundle_beta) - set the bundle tension *beta*.
+* [d3.curveBumpX](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveBumpX) - a cubic Bézier spline with horizontal tangents.
+* [d3.curveBumpY](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveBumpY) - a cubic Bézier spline with vertical tangents.
+* [d3.curveCardinal](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveCardinal) - a cubic cardinal spline, with one-sided difference at each end.
+* [d3.curveCardinalClosed](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveCardinalClosed) - a closed cubic cardinal spline.
+* [d3.curveCardinalOpen](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveCardinalOpen) - a cubic cardinal spline.
+* [*cardinal*.tension](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveCardinal_tension) - set the cardinal spline tension.
+* [d3.curveCatmullRom](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveCatmullRom) - a cubic Catmull–Rom spline, with one-sided difference at each end.
+* [d3.curveCatmullRomClosed](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveCatmullRomClosed) - a closed cubic Catmull–Rom spline.
+* [d3.curveCatmullRomOpen](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveCatmullRomOpen) - a cubic Catmull–Rom spline.
+* [*catmullRom*.alpha](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveCatmullRom_alpha) - set the Catmull–Rom parameter *alpha*.
+* [d3.curveLinear](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveLinear) - a polyline.
+* [d3.curveLinearClosed](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveLinearClosed) - a closed polyline.
+* [d3.curveMonotoneX](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveMonotoneX) - a cubic spline that, given monotonicity in *x*, preserves it in *y*.
+* [d3.curveMonotoneY](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveMonotoneY) - a cubic spline that, given monotonicity in *y*, preserves it in *x*.
+* [d3.curveNatural](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveNatural) - a natural cubic spline.
+* [d3.curveStep](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveStep) - a piecewise constant function.
+* [d3.curveStepAfter](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveStepAfter) - a piecewise constant function.
+* [d3.curveStepBefore](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curveStepBefore) - a piecewise constant function.
+* [*curve*.areaStart](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curve_areaStart) - start a new area segment.
+* [*curve*.areaEnd](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curve_areaEnd) - end the current area segment.
+* [*curve*.lineStart](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curve_lineStart) - start a new line segment.
+* [*curve*.lineEnd](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curve_lineEnd) - end the current line segment.
+* [*curve*.point](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#curve_point) - add a point to the current line segment.
+
+### [Links](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#links)
+
+A smooth cubic Bézier curve from a source to a target.
+
+* [d3.linkVertical](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#linkVertical) - create a new vertical link generator.
+* [d3.linkHorizontal](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#linkHorizontal) - create a new horizontal link generator.
+* [*link*](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#_link) - generate a link.
+* [*link*.source](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#link_source) - set the source accessor.
+* [*link*.target](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#link_target) - set the target accessor.
+* [*link*.x](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#link_x) - set the point *x*-accessor.
+* [*link*.y](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#link_y) - set the point *y*-accessor.
+* [*link*.context](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#link_context) - set the rendering context.
+* [d3.linkRadial](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#linkRadial) - create a new radial link generator.
+* [*linkRadial*.angle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#linkRadial_angle) - set the point *angle* accessor.
+* [*linkRadial*.radius](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#linkRadial_radius) - set the point *radius* accessor.
+
+### [Symbols](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbols)
+
+A categorical shape encoding, as in a scatterplot.
+
+* [d3.symbol](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbol) - create a new symbol generator.
+* [*symbol*](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#_symbol) - generate a symbol for the given datum.
+* [*symbol*.type](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbol_type) - set the symbol type.
+* [*symbol*.size](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbol_size) - set the size of the symbol in square pixels.
+* [*symbol*.context](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbol_context) - set the rendering context.
+* [d3.symbols](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbols) - the array of built-in symbol types.
+* [d3.symbolCircle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbolCircle) - a circle.
+* [d3.symbolCross](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbolCross) - a Greek cross with arms of equal length.
+* [d3.symbolDiamond](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbolDiamond) - a rhombus.
+* [d3.symbolSquare](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbolSquare) - a square.
+* [d3.symbolStar](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbolStar) - a pentagonal star (pentagram).
+* [d3.symbolTriangle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbolTriangle) - an up-pointing triangle.
+* [d3.symbolWye](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbolWye) - a Y shape.
+* [d3.pointRadial](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#pointRadial) - relative coordinates of a point given an angle and radius.
+* [*symbolType*.draw](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#symbolType_draw) - draw this symbol to the given context.
+
+### [Stacks](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stacks)
+
+Stack shapes, placing one adjacent to another, as in a stacked bar chart.
+
+* [d3.stack](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stack) - create a new stack generator.
+* [*stack*](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#_stack) - generate a stack for the given dataset.
+* [*stack*.keys](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stack_keys) - set the keys accessor.
+* [*stack*.value](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stack_value) - set the value accessor.
+* [*stack*.order](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stack_order) - set the order accessor.
+* [*stack*.offset](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stack_offset) - set the offset accessor.
+* [d3.stackOrderAppearance](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOrderAppearance) - put the earliest series on bottom.
+* [d3.stackOrderAscending](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOrderAscending) - put the smallest series on bottom.
+* [d3.stackOrderDescending](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOrderDescending) - put the largest series on bottom.
+* [d3.stackOrderInsideOut](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOrderInsideOut) - put earlier series in the middle.
+* [d3.stackOrderNone](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOrderNone) - use the given series order.
+* [d3.stackOrderReverse](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOrderReverse) - use the reverse of the given series order.
+* [d3.stackOffsetExpand](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOffsetExpand) - normalize the baseline to zero and topline to one.
+* [d3.stackOffsetDiverging](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOffsetDiverging) - positive above zero; negative below zero.
+* [d3.stackOffsetNone](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOffsetNone) - apply a zero baseline.
+* [d3.stackOffsetSilhouette](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOffsetSilhouette) - center the streamgraph around zero.
+* [d3.stackOffsetWiggle](https://github.com/d3/d3-shape/blob/v2.1.0/README.md#stackOffsetWiggle) - minimize streamgraph wiggling.
+
+## [Time Formats (d3-time-format)](https://github.com/d3/d3-time-format/tree/v3.0.0)
+
+Parse and format times, inspired by strptime and strftime.
+
+* [d3.timeFormat](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#timeFormat) - alias for *locale*.format on the default locale.
+* [d3.timeParse](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#timeParse) - alias for *locale*.parse on the default locale.
+* [d3.utcFormat](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#utcFormat) - alias for *locale*.utcFormat on the default locale.
+* [d3.utcParse](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#utcParse) - alias for *locale*.utcParse on the default locale.
+* [d3.isoFormat](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#isoFormat) - an ISO 8601 UTC formatter.
+* [d3.isoParse](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#isoParse) - an ISO 8601 UTC parser.
+* [*locale*.format](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#locale_format) - create a time formatter.
+* [*locale*.parse](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#locale_parse) - create a time parser.
+* [*locale*.utcFormat](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#locale_utcFormat) - create a UTC formatter.
+* [*locale*.utcParse](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#locale_utcParse) - create a UTC parser.
+* [d3.timeFormatLocale](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#timeFormatLocale) - define a custom locale.
+* [d3.timeFormatDefaultLocale](https://github.com/d3/d3-time-format/blob/v3.0.0/README.md#timeFormatDefaultLocale) - define the default locale.
+
+## [Time Intervals (d3-time)](https://github.com/d3/d3-time/tree/v2.1.0)
+
+A calculator for humanity’s peculiar conventions of time.
+
+* [d3.timeInterval](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeInterval) - implement a new custom time interval.
+* [*interval*](https://github.com/d3/d3-time/blob/v2.1.0/README.md#_interval) - alias for *interval*.floor.
+* [*interval*.floor](https://github.com/d3/d3-time/blob/v2.1.0/README.md#interval_floor) - round down to the nearest boundary.
+* [*interval*.round](https://github.com/d3/d3-time/blob/v2.1.0/README.md#interval_round) - round to the nearest boundary.
+* [*interval*.ceil](https://github.com/d3/d3-time/blob/v2.1.0/README.md#interval_ceil) - round up to the nearest boundary.
+* [*interval*.offset](https://github.com/d3/d3-time/blob/v2.1.0/README.md#interval_offset) - offset a date by some number of intervals.
+* [*interval*.range](https://github.com/d3/d3-time/blob/v2.1.0/README.md#interval_range) - generate a range of dates at interval boundaries.
+* [*interval*.filter](https://github.com/d3/d3-time/blob/v2.1.0/README.md#interval_filter) - create a filtered subset of this interval.
+* [*interval*.every](https://github.com/d3/d3-time/blob/v2.1.0/README.md#interval_every) - create a filtered subset of this interval.
+* [*interval*.count](https://github.com/d3/d3-time/blob/v2.1.0/README.md#interval_count) - count interval boundaries between two dates.
+* [d3.timeMillisecond](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMillisecond), [d3.utcMillisecond](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMillisecond) - the millisecond interval.
+* [d3.timeMilliseconds](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMillisecond), [d3.utcMilliseconds](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMillisecond) - aliases for millisecond.range.
+* [d3.timeSecond](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSecond), [d3.utcSecond](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSecond) - the second interval.
+* [d3.timeSeconds](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSecond), [d3.utcSeconds](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSecond) - aliases for second.range.
+* [d3.timeMinute](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMinute), [d3.utcMinute](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMinute) - the minute interval.
+* [d3.timeMinutes](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMinute), [d3.utcMinutes](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMinute) - aliases for minute.range.
+* [d3.timeHour](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeHour), [d3.utcHour](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeHour) - the hour interval.
+* [d3.timeHours](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeHour), [d3.utcHours](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeHour) - aliases for hour.range.
+* [d3.timeDay](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeDay), [d3.utcDay](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeDay) - the day interval.
+* [d3.timeDays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeDay), [d3.utcDays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeDay) - aliases for day.range.
+* [d3.timeWeek](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeWeek), [d3.utcWeek](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeWeek) - aliases for sunday.
+* [d3.timeWeeks](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeWeek), [d3.utcWeeks](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeWeek) - aliases for week.range.
+* [d3.timeSunday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSunday), [d3.utcSunday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSunday) - the week interval, starting on Sunday.
+* [d3.timeSundays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSunday), [d3.utcSundays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSunday) - aliases for sunday.range.
+* [d3.timeMonday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMonday), [d3.utcMonday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMonday) - the week interval, starting on Monday.
+* [d3.timeMondays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMonday), [d3.utcMondays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMonday) - aliases for monday.range.
+* [d3.timeTuesday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeTuesday), [d3.utcTuesday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeTuesday) - the week interval, starting on Tuesday.
+* [d3.timeTuesdays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeTuesday), [d3.utcTuesdays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeTuesday) - aliases for tuesday.range.
+* [d3.timeWednesday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeWednesday), [d3.utcWednesday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeWednesday) - the week interval, starting on Wednesday.
+* [d3.timeWednesdays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeWednesday), [d3.utcWednesdays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeWednesday) - aliases for wednesday.range.
+* [d3.timeThursday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeThursday), [d3.utcThursday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeThursday) - the week interval, starting on Thursday.
+* [d3.timeThursdays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeThursday), [d3.utcThursdays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeThursday) - aliases for thursday.range.
+* [d3.timeFriday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeFriday), [d3.utcFriday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeFriday) - the week interval, starting on Friday.
+* [d3.timeFridays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeFriday), [d3.utcFridays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeFriday) - aliases for friday.range.
+* [d3.timeSaturday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSaturday), [d3.utcSaturday](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSaturday) - the week interval, starting on Saturday.
+* [d3.timeSaturdays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSaturday), [d3.utcSaturdays](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeSaturday) - aliases for saturday.range.
+* [d3.timeMonth](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMonth), [d3.utcMonth](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMonth) - the month interval.
+* [d3.timeMonths](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMonth), [d3.utcMonths](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeMonth) - aliases for month.range.
+* [d3.timeYear](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeYear), [d3.utcYear](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeYear) - the year interval.
+* [d3.timeYears](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeYear), [d3.utcYears](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeYear) - aliases for year.range.
+* [d3.timeTicks](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeTicks), [d3.utcTicks](https://github.com/d3/d3-time/blob/v2.1.0/README.md#utcTicks) -
+* [d3.timeTickInterval](https://github.com/d3/d3-time/blob/v2.1.0/README.md#timeTickInterval), [d3.utcTickInterval](https://github.com/d3/d3-time/blob/v2.1.0/README.md#utcTickInterval) -
+
+## [Timers (d3-timer)](https://github.com/d3/d3-timer/tree/v2.0.0)
+
+An efficient queue for managing thousands of concurrent animations.
+
+* [d3.now](https://github.com/d3/d3-timer/blob/v2.0.0/README.md#now) - get the current high-resolution time.
+* [d3.timer](https://github.com/d3/d3-timer/blob/v2.0.0/README.md#timer) - schedule a new timer.
+* [*timer*.restart](https://github.com/d3/d3-timer/blob/v2.0.0/README.md#timer_restart) - reset the timer’s start time and callback.
+* [*timer*.stop](https://github.com/d3/d3-timer/blob/v2.0.0/README.md#timer_stop) - stop the timer.
+* [d3.timerFlush](https://github.com/d3/d3-timer/blob/v2.0.0/README.md#timerFlush) - immediately execute any eligible timers.
+* [d3.timeout](https://github.com/d3/d3-timer/blob/v2.0.0/README.md#timeout) - schedule a timer that stops on its first callback.
+* [d3.interval](https://github.com/d3/d3-timer/blob/v2.0.0/README.md#interval) - schedule a timer that is called with a configurable period.
+
+## [Transitions (d3-transition)](https://github.com/d3/d3-transition/tree/v2.0.0)
+
+Animated transitions for [selections](#selections).
+
+* [*selection*.transition](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#selection_transition) - schedule a transition for the selected elements.
+* [*selection*.interrupt](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#selection_interrupt) - interrupt and cancel transitions on the selected elements.
+* [d3.interrupt](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#interrupt) - interrupt the active transition for a given node.
+* [d3.transition](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition) - schedule a transition on the root document element.
+* [*transition*.select](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_select) - schedule a transition on the selected elements.
+* [*transition*.selectAll](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_selectAll) - schedule a transition on the selected elements.
+* [*transition*.filter](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_filter) - filter elements based on data.
+* [*transition*.merge](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_merge) - merge this transition with another.
+* [*transition*.transition](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_transition) - schedule a new transition following this one.
+* [*transition*.selection](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_selection) - returns a selection for this transition.
+* [d3.active](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#active) - select the active transition for a given node.
+* [*transition*.attr](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_attr) - tween the given attribute using the default interpolator.
+* [*transition*.attrTween](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_attrTween) - tween the given attribute using a custom interpolator.
+* [*transition*.style](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_style) - tween the given style property using the default interpolator.
+* [*transition*.styleTween](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_styleTween) - tween the given style property using a custom interpolator.
+* [*transition*.text](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_text) - set the text content when the transition starts.
+* [*transition*.textTween](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_textTween) - tween the text using a custom interpolator.
+* [*transition*.remove](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_remove) - remove the selected elements when the transition ends.
+* [*transition*.tween](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_tween) - run custom code during the transition.
+* [*transition*.delay](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_delay) - specify per-element delay in milliseconds.
+* [*transition*.duration](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_duration) - specify per-element duration in milliseconds.
+* [*transition*.ease](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_ease) - specify the easing function.
+* [*transition*.easeVarying](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_easeVarying) - specify an easing function factory.
+* [*transition*.end](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_end) - a promise that resolves when a transition ends.
+* [*transition*.on](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_on) - await the end of a transition.
+* [*transition*.each](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_each) - call a function for each element.
+* [*transition*.call](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_call) - call a function with this transition.
+* [*transition*.empty](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_empty) - returns true if this transition is empty.
+* [*transition*.nodes](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_nodes) - returns an array of all selected elements.
+* [*transition*.node](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_node) - returns the first (non-null) element.
+* [*transition*.size](https://github.com/d3/d3-transition/blob/v2.0.0/README.md#transition_size) - returns the count of elements.
+
+## [Zooming (d3-zoom)](https://github.com/d3/d3-zoom/tree/v2.0.0)
+
+Pan and zoom SVG, HTML or Canvas using mouse or touch input.
+
+* [d3.zoom](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom) - create a zoom behavior.
+* [*zoom*](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#_zoom) - apply the zoom behavior to the selected elements.
+* [*zoom*.transform](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_transform) - change the transform for the selected elements.
+* [*zoom*.translateBy](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_translateBy) - translate the transform for the selected elements.
+* [*zoom*.translateTo](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_translateTo) - translate the transform for the selected elements.
+* [*zoom*.scaleBy](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_scaleBy) - scale the transform for the selected elements.
+* [*zoom*.scaleTo](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_scaleTo) - scale the transform for the selected elements.
+* [*zoom*.constrain](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_constrain) - override the transform constraint logic.
+* [*zoom*.filter](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_filter) - control which input events initiate zooming.
+* [*zoom*.touchable](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_touchable) - set the touch support detector.
+* [*zoom*.wheelDelta](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_wheelDelta) - override scaling for wheel events.
+* [*zoom*.extent](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_extent) - set the extent of the viewport.
+* [*zoom*.scaleExtent](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_scaleExtent) - set the allowed scale range.
+* [*zoom*.translateExtent](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_translateExtent) - set the extent of the zoomable world.
+* [*zoom*.clickDistance](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_clickDistance) - set the click distance threshold.
+* [*zoom*.tapDistance](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_tapDistance) - set the tap distance threshold.
+* [*zoom*.duration](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_duration) - set the duration of zoom transitions.
+* [*zoom*.interpolate](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_interpolate) - control the interpolation of zoom transitions.
+* [*zoom*.on](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoom_on) - listen for zoom events.
+* [d3.zoomTransform](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoomTransform) - get the zoom transform for a given element.
+* [*transform*.scale](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_scale) - scale a transform by the specified amount.
+* [*transform*.translate](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_translate) - translate a transform by the specified amount.
+* [*transform*.apply](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_apply) - apply the transform to the given point.
+* [*transform*.applyX](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_applyX) - apply the transform to the given *x*-coordinate.
+* [*transform*.applyY](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_applyY) - apply the transform to the given *y*-coordinate.
+* [*transform*.invert](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_invert) - unapply the transform to the given point.
+* [*transform*.invertX](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_invertX) - unapply the transform to the given *x*-coordinate.
+* [*transform*.invertY](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_invertY) - unapply the transform to the given *y*-coordinate.
+* [*transform*.rescaleX](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_rescaleX) - apply the transform to an *x*-scale’s domain.
+* [*transform*.rescaleY](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_rescaleY) - apply the transform to a *y*-scale’s domain.
+* [*transform*.toString](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#transform_toString) - format the transform as an SVG transform string.
+* [d3.zoomIdentity](https://github.com/d3/d3-zoom/blob/v2.0.0/README.md#zoomIdentity) - the identity transform.
diff --git a/CHANGES.md b/CHANGES.md
new file mode 100644
index 00000000000000..b55924450a5e65
--- /dev/null
+++ b/CHANGES.md
@@ -0,0 +1,1643 @@
+# Changes in D3 6.0
+
+[Released August 26, 2020.](https://github.com/d3/d3/releases/tag/v6.0.0)
+
+*This document covers only major changes. For minor and patch changes, please see the [release notes](https://github.com/d3/d3/releases).*
+
+D3 now **uses native collections** (Map and Set) and **accepts iterables**. [d3.group and d3.rollup](https://observablehq.com/@d3/d3-group) are powerful new aggregation functions that replace d3.nest and work great [with d3-hierarchy](https://observablehq.com/d/9a453665f405eebf) and d3-selection. There are lots of new helpers in d3-array, too, such as [d3.greatest](https://observablehq.com/@d3/d3-least), [d3.quickselect](https://observablehq.com/@d3/d3-quickselect), and [d3.fsum](https://observablehq.com/@d3/d3-fsum).
+
+D3 now **passes events directly to listeners**, replacing the d3.event global and bringing D3 inline with vanilla JavaScript and most other frameworks.
+
+**d3-delaunay** (based on Vladimir Agafonkin’s excellent [Delaunator](https://github.com/mapbox/delaunator)) replaces d3-voronoi, offering dramatic improvements to performance, robustness, and [search](https://observablehq.com/@d3/delaunay-find). And there’s a new [d3-geo-voronoi](https://github.com/Fil/d3-geo-voronoi) for spherical (geographical) data! **d3-random** is [greatly expanded](https://github.com/d3/d3-random/blob/master/README.md) and includes a fast [linear congruential generator](https://observablehq.com/@d3/d3-randomlcg) for seeded randomness. **d3-chord** has new layouts for [directed](https://observablehq.com/@d3/directed-chord-diagram) and transposed chord diagrams. **d3-scale** adds a new [radial scale](https://observablehq.com/@d3/radial-stacked-bar-chart-ii) type.
+
+… and a variety of other small enhancements. [More than 450 examples](https://observablehq.com/@d3/gallery) have been updated to D3 6.0!
+
+### d3-array
+
+* Accept iterables.
+* Add [d3.group](https://github.com/d3/d3-array/blob/master/README.md#group).
+* Add [d3.groups](https://github.com/d3/d3-array/blob/master/README.md#groups).
+* Add [d3.index](https://github.com/d3/d3-array/blob/master/README.md#index).
+* Add [d3.indexes](https://github.com/d3/d3-array/blob/master/README.md#indexes).
+* Add [d3.rollup](https://github.com/d3/d3-array/blob/master/README.md#rollup).
+* Add [d3.rollups](https://github.com/d3/d3-array/blob/master/README.md#rollups).
+* Add [d3.maxIndex](https://github.com/d3/d3-array/blob/master/README.md#maxIndex).
+* Add [d3.minIndex](https://github.com/d3/d3-array/blob/master/README.md#minIndex).
+* Add [d3.greatest](https://github.com/d3/d3-array/blob/master/README.md#greatest).
+* Add [d3.greatestIndex](https://github.com/d3/d3-array/blob/master/README.md#greatestIndex).
+* Add [d3.least](https://github.com/d3/d3-array/blob/master/README.md#least).
+* Add [d3.leastIndex](https://github.com/d3/d3-array/blob/master/README.md#leastIndex).
+* Add [d3.bin](https://github.com/d3/d3-array/blob/master/README.md#bin).
+* Add [d3.count](https://github.com/d3/d3-array/blob/master/README.md#count).
+* Add [d3.cumsum](https://github.com/d3/d3-array/blob/master/README.md#cumsum).
+* Add [d3.fsum](https://github.com/d3/d3-array/blob/master/README.md#fsum).
+* Add [d3.Adder](https://github.com/d3/d3-array/blob/master/README.md#Adder).
+* Add [d3.quantileSorted](https://github.com/d3/d3-array/blob/master/README.md#quantileSorted).
+* Add [d3.quickselect](https://github.com/d3/d3-array/blob/master/README.md#quickselect).
+* Add [*bisector*.center](https://github.com/d3/d3-array/blob/master/README.md#bisector_center).
+* Allow more than two iterables for [d3.cross](https://github.com/d3/d3-array/blob/master/README.md#cross).
+* Accept non-sorted input with [d3.quantile](https://github.com/d3/d3-array/blob/master/README.md#quantile).
+* Fix a *array*.sort bug in Safari.
+* Fix bin thresholds to ignore NaN input.
+* Fix [d3.ticks](https://github.com/d3/d3-array/blob/master/README.md#ticks) to not return ticks outside the domain.
+* Improve the performance of [d3.median](https://github.com/d3/d3-array/blob/master/README.md#median).
+
+See https://observablehq.com/@d3/d3-array-2-0 for details.
+
+### d3-brush
+
+* Add [*event*.mode](https://github.com/d3/d3-brush/blob/master/README.md#brush-events).
+* Change [*brush*.on](https://github.com/d3/d3-brush/blob/master/README.md#brush_on) to pass the *event* directly to listeners.
+* Improve multitouch (two-touch) interaction.
+
+### d3-chord
+
+* Add [d3.chordDirected](https://github.com/d3/d3-chord/blob/master/README.md#chordDirected).
+* Add [d3.chordTranspose](https://github.com/d3/d3-chord/blob/master/README.md#chordTranspose).
+* Add [d3.ribbonArrow](https://github.com/d3/d3-chord/blob/master/README.md#ribbonArrow).
+* Add [*ribbon*.padAngle](https://github.com/d3/d3-chord/blob/master/README.md#ribbon_padAngle).
+* Add [*ribbon*.sourceRadius](https://github.com/d3/d3-chord/blob/master/README.md#ribbon_sourceRadius).
+* Add [*ribbon*.targetRadius](https://github.com/d3/d3-chord/blob/master/README.md#ribbon_targetRadius).
+
+### d3-delaunay
+
+* Add [d3.Delaunay](https://github.com/d3/d3-delaunay/blob/master/README.md).
+
+### d3-drag
+
+* Change [*drag*.on](https://github.com/d3/d3-drag/blob/master/README.md#drag_on) to pass the *event* directly to listeners.
+
+### d3-force
+
+* Add *iterations* argument to [*simulation*.tick](https://github.com/d3/d3-force/blob/master/README.md#simulation_tick).
+* Add [*forceCenter*.strength](https://github.com/d3/d3-force/blob/master/README.md#center_strength).
+* Add [*forceSimulation*.randomSource](https://github.com/d3/d3-force/blob/master/README.md#simulation_randomSource).
+* All built-in forces are now fully deterministic (including “jiggling” coincident nodes).
+* Improve the default phyllotaxis layout slightly by offsetting by one half-radius.
+* Improve the error message when a link references an unknown node.
+* [*force*.initialize](https://github.com/d3/d3-force/blob/master/README.md#force_initialize) is now passed a random source.
+* Fix bug when initializing nodes with fixed positions.
+
+### d3-format
+
+* Change the default minus sign to the minus sign (−) instead of hyphen-minus (-).
+* Fix decimal `d` formatting of numbers greater than or equal to 1e21.
+
+### d3-geo
+
+* Fix clipping of some degenerate polygons.
+
+### d3-hierarchy
+
+* Accept iterables.
+* Add [*node*[Symbol.iterator]](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_iterator); hierarchies are now iterable.
+* Add [*node*.find](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_find).
+* Change [*node*.each](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_each) to pass the traversal index.
+* Change [*node*.eachAfter](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_eachAfter) to pass the traversal index.
+* Change [*node*.eachBefore](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_eachBefore) to pass the traversal index.
+* Fix [d3.packSiblings](https://github.com/d3/d3-hierarchy/blob/master/README.md#packSiblings) for huge circles.
+* Fix divide-by-zero bug in [d3.treemapBinary](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemapBinary).
+* Fix divide-by-zero bug in [d3.treemapResquarify](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemapResquarify).
+
+### d3-interpolate
+
+* Add [*interpolateZoom*.rho](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateZoom_rho). (#25)
+* Allow [d3.piecewise](https://github.com/d3/d3-interpolate/blob/master/README.md#piecewise) to default to using d3.interpolate. #90
+* Change [d3.interpolateTransformCss](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateTransformCss) to use DOMMatrix and require absolute units. #83
+
+### d3-quadtree
+
+* Fix an infinite loop when coordinates diverge to huge values.
+
+### d3-random
+
+* Add [d3.randomLcg](https://github.com/d3/d3-random/blob/master/README.md#randomLcg).
+* Add [d3.randomGamma](https://github.com/d3/d3-random/blob/master/README.md#randomGamma).
+* Add [d3.randomBeta](https://github.com/d3/d3-random/blob/master/README.md#randomBeta).
+* Add [d3.randomWeibull](https://github.com/d3/d3-random/blob/master/README.md#randomWeibull).
+* Add [d3.randomCauchy](https://github.com/d3/d3-random/blob/master/README.md#randomCauchy).
+* Add [d3.randomLogistic](https://github.com/d3/d3-random/blob/master/README.md#randomLogistic).
+* Add [d3.randomPoisson](https://github.com/d3/d3-random/blob/master/README.md#randomPoisson).
+* Add [d3.randomInt](https://github.com/d3/d3-random/blob/master/README.md#randomInt).
+* Add [d3.randomBinomial](https://github.com/d3/d3-random/blob/master/README.md#randomBinomial).
+* Add [d3.randomGeometric](https://github.com/d3/d3-random/blob/master/README.md#randomGeometric).
+* Add [d3.randomPareto](https://github.com/d3/d3-random/blob/master/README.md#randomPareto).
+* Add [d3.randomBernoulli](https://github.com/d3/d3-random/blob/master/README.md#randomBernoulli).
+* Allow [d3.randomBates](https://github.com/d3/d3-random/blob/master/README.md#randomBates) to take fractional *n*.
+* Allow [d3.randomIrwinHall](https://github.com/d3/d3-random/blob/master/README.md#randomIrwinHall) to take fractional *n*.
+* Don’t wrap Math.random in the default source.
+
+Thanks to @Lange, @p-v-d-Veeken, @svanschooten, @Parcly-Taxel and @jrus for your contributions!
+
+### d3-scale
+
+* Accept iterables.
+* Add [*diverging*.rangeRound](https://github.com/d3/d3-scale/blob/master/README.md#diverging_rangeRound).
+* Add [*sequential*.range](https://github.com/d3/d3-scale/blob/master/README.md#sequential_range) (for compatibility with d3-axis).
+* Add [*sequential*.rangeRound](https://github.com/d3/d3-scale/blob/master/README.md#sequential_rangeRound).
+* Add [*sequentialQuantile*.quantiles](https://github.com/d3/d3-scale/blob/master/README.md#sequentialQuantile_quantiles).
+* Add [d3.scaleRadial](https://github.com/d3/d3-scale/blob/master/README.md#radial-scales).
+* [*diverging*.range](https://github.com/d3/d3-scale/blob/master/README.md#diverging_range) can now be used to set the interpolator.
+* [*sequential*.range](https://github.com/d3/d3-scale/blob/master/README.md#sequential_range) can now be used to set the interpolator.
+* [d3.scaleDiverging](https://github.com/d3/d3-scale/blob/master/README.md#diverging-scales) can now accept a range array in place of an interpolator.
+* [d3.scaleSequential](https://github.com/d3/d3-scale/blob/master/README.md#sequential-scales) can now accept a range array in place of an interpolator.
+* Fix [*continuous*.nice](https://github.com/d3/d3-scale/blob/master/README.md#continuous_nice) to ensure that niced domains always span ticks.
+* Fix [*log*.ticks](https://github.com/d3/d3-scale/blob/master/README.md#log_ticks) for small domains.
+* Fix [*log*.ticks](https://github.com/d3/d3-scale/blob/master/README.md#log_ticks) for small domains. #44
+* Fix [*scale*.clamp](https://github.com/d3/d3-scale/blob/master/README.md#continuous_clamp) for [sequential quantile scales](https://github.com/d3/d3-scale/blob/master/README.md#scaleSequentialQuantile). Thanks, @Fil!
+* Fix [*scale*.clamp](https://github.com/d3/d3-scale/blob/master/README.md#continuous_clamp) for continuous scales with more domain values than range values.
+* Fix [diverging scales](https://github.com/d3/d3-scale/blob/master/README.md#diverging-scales) with descending domains.
+* Remove deprecated *step* argument from [*time*.ticks](https://github.com/d3/d3-scale/blob/master/README.md#time_ticks) and [*time*.nice](https://github.com/d3/d3-scale/blob/master/README.md#time_nice).
+
+### d3-selection
+
+* Add [*selection*.selectChild](https://github.com/d3/d3-selection/blob/master/README.md#selection_selectChild).
+* Add [*selection*.selectChildren](https://github.com/d3/d3-selection/blob/master/README.md#selection_selectChildren).
+* Add [d3.pointer](https://github.com/d3/d3-selection/blob/master/README.md#pointer).
+* Add [d3.pointers](https://github.com/d3/d3-selection/blob/master/README.md#pointers).
+* Add *selection*[Symbol.iterator]; selections are now iterable!
+* Accept iterables with [*selection*.data](https://github.com/d3/d3-selection/blob/master/README.md#selection_data).
+* Accept iterables with [d3.selectAll](https://github.com/d3/d3-selection/blob/master/README.md#selectAll).
+* Change [*selection*.on](https://github.com/d3/d3-selection/blob/master/README.md#selection_on) to pass the *event* directly to listeners.
+* Remove index and group from *selection*.on listeners!
+* Remove d3.event!
+* Remove d3.mouse.
+* Remove d3.touch.
+* Remove d3.touches.
+* Remove d3.customEvent.
+* Remove d3.clientPoint.
+* Remove d3.sourceEvent.
+* Fix *selection*.merge(*transition*) to error.
+
+For an overview of changes, see https://observablehq.com/@d3/d3-selection-2-0.
+
+### d3-shape
+
+* Accept iterables.
+* Add [d3.line](https://github.com/d3/d3-shape/blob/master/README.md#line)(*x*, *y*) shorthand.
+* Add [d3.area](https://github.com/d3/d3-shape/blob/master/README.md#area)(*x*, *y0*, *y1*) shorthand.
+* Add [d3.symbol](https://github.com/d3/d3-shape/blob/master/README.md#symbol)(*type*, *size*) shorthand.
+
+### d3-time-format
+
+* Add ISO 8601 “week year” (`%G` and `%g`).
+
+### d3-timer
+
+* Fix [*interval*.restart](https://github.com/d3/d3-timer/blob/master/README.md#timer_restart) to restart as an interval.
+
+### d3-transition
+
+* Add [*transition*.easeVarying](https://github.com/d3/d3-transition/blob/master/README.md#transition_easeVarying).
+* Add *transition*[Symbol.iterator]; transitions are now iterable.
+* Fix [*selection*.transition](https://github.com/d3/d3-transition/blob/master/README.md#selection_transition) to error if the named transition to inherit is not found.k
+* Fix [*transition*.end](https://github.com/d3/d3-transition/blob/master/README.md#transition_end) to resolve immediately if the selection is empty.
+
+### d3-zoom
+
+* Add [*zoom*.tapDistance](https://github.com/d3/d3-zoom/blob/master/README.md#zoom_tapDistance).
+* Change [*zoom*.on](https://github.com/d3/d3-zoom/blob/master/README.md#zoom_on) to pass the *event* directly to listeners.
+* Change the default [*zoom*.filter](https://github.com/d3/d3-zoom/blob/master/README.md#zoom_filter) to observe *wheel* events if the control key is pressed.
+* Change the default [*zoom*.wheelDelta](ttps://github.com/d3/d3-zoom/blob/master/README.md#zoom_wheelDelta) to go faster if the control key is pressed.
+* Don‘t set touch-action: none.
+* Upgrade to [d3-selection 2](https://observablehq.com/@d3/d3-selection-2-0).
+
+### Breaking Changes
+
+D3 6.0 introduces several non-backwards-compatible changes.
+
+* Remove [d3.event](https://observablehq.com/d/f91cccf0cad5e9cb#events).
+* Change [*selection*.on](https://observablehq.com/d/f91cccf0cad5e9cb#events) to pass the *event* directly to listeners.
+* Change [*transition*.on](https://observablehq.com/d/f91cccf0cad5e9cb#events) to pass the *event* directly to listeners.
+* Change [*brush*.on](https://observablehq.com/d/f91cccf0cad5e9cb#event_brush) to pass the *event* directly to listeners.
+* Change [*drag*.on](https://observablehq.com/d/f91cccf0cad5e9cb#event_drag) to pass the *event* directly to listeners.
+* Change [*zoom*.on](https://observablehq.com/d/f91cccf0cad5e9cb#event_zoom) to pass the *event* directly to listeners.
+* Remove d3.mouse; use [d3.pointer](https://observablehq.com/d/f91cccf0cad5e9cb#pointer).
+* Remove d3.touch; use [d3.pointer](https://observablehq.com/d/f91cccf0cad5e9cb#pointer).
+* Remove d3.touches; use [d3.pointers](https://observablehq.com/d/f91cccf0cad5e9cb#pointer).
+* Remove d3.clientPoint; use [d3.pointer](https://observablehq.com/d/f91cccf0cad5e9cb#pointer).
+* Remove d3.voronoi; use [d3.Delaunay](https://observablehq.com/d/f91cccf0cad5e9cb#delaunay).
+* Remove d3.nest; use [d3.group](https://observablehq.com/d/f91cccf0cad5e9cb#group) and [d3.rollup](https://observablehq.com/d/f91cccf0cad5e9cb#group).
+* Remove d3.map; use [Map](https://observablehq.com/d/f91cccf0cad5e9cb#collection).
+* Remove d3.set; use [Set](https://observablehq.com/d/f91cccf0cad5e9cb#collection).
+* Remove d3.keys; use [Object.keys](https://observablehq.com/d/f91cccf0cad5e9cb#collection).
+* Remove d3.values; use [Object.values](https://observablehq.com/d/f91cccf0cad5e9cb#collection).
+* Remove d3.entries; use [Object.entries](https://observablehq.com/d/f91cccf0cad5e9cb#collection).
+* Rename d3.histogram to [d3.bin](https://observablehq.com/d/f91cccf0cad5e9cb#bin).
+* Rename d3.scan to [d3.leastIndex](https://observablehq.com/d/f91cccf0cad5e9cb#leastIndex).
+* Change [d3.interpolateTransformCss](https://observablehq.com/d/f91cccf0cad5e9cb#interpolateTransformCss) to require absolute units.
+* Change [d3.format](https://observablehq.com/d/f91cccf0cad5e9cb#minus) to default to the minus sign instead of hyphen-minus for negative values.
+
+D3 now requires a browser that supports [ES2015](http://www.ecma-international.org/ecma-262/6.0/). For older browsers, you must bring your own transpiler.
+
+Lastly, support for [Bower](https://bower.io) has been dropped; D3 is now exclusively published to npm and GitHub.
+
+See our [migration guide](https://observablehq.com/d/f91cccf0cad5e9cb) for help upgrading.
+
+# Changes in D3 5.0
+
+[Released March 22, 2018.](https://github.com/d3/d3/releases/tag/v5.0.0)
+
+D3 5.0 introduces only a few non-backwards-compatible changes.
+
+D3 now uses [Promises](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises) instead of asynchronous callbacks to load data. Promises simplify the structure of asynchronous code, especially in modern browsers that support [async and await](https://javascript.info/async-await). (See this [introduction to promises](https://observablehq.com/@observablehq/introduction-to-promises) on [Observable](https://observablehq.com).) For example, to load a CSV file in v4, you might say:
+
+```js
+d3.csv("file.csv", function(error, data) {
+ if (error) throw error;
+ console.log(data);
+});
+```
+
+In v5, using promises:
+
+```js
+d3.csv("file.csv").then(function(data) {
+ console.log(data);
+});
+```
+
+Note that you don’t need to rethrow the error—the promise will reject automatically, and you can *promise*.catch if desired. Using await, the code is even simpler:
+
+```js
+const data = await d3.csv("file.csv");
+console.log(data);
+```
+
+With the adoption of promises, D3 now uses the [Fetch API](https://fetch.spec.whatwg.org/) instead of [XMLHttpRequest](https://developer.mozilla.org/docs/Web/API/XMLHttpRequest): the [d3-request](https://github.com/d3/d3-request) module has been replaced by [d3-fetch](https://github.com/d3/d3-fetch). Fetch supports many powerful new features, such as [streaming responses](https://observablehq.com/@mbostock/streaming-shapefiles). D3 5.0 also deprecates and removes the [d3-queue](https://github.com/d3/d3-queue) module. Use [Promise.all](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) to run a batch of asynchronous tasks in parallel, or a helper library such as [p-queue](https://github.com/sindresorhus/p-queue) to [control concurrency](https://observablehq.com/@mbostock/hello-p-queue).
+
+D3 no longer provides the d3.schemeCategory20* categorical color schemes. These twenty-color schemes were flawed because their grouped design could falsely imply relationships in the data: a shared hue can imply that the encoded data are part of a group (a super-category), while relative lightness can imply order. Instead, D3 now includes [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic), which implements excellent schemes from ColorBrewer, including [categorical](https://github.com/d3/d3-scale-chromatic/blob/master/README.md#categorical), [diverging](https://github.com/d3/d3-scale-chromatic/blob/master/README.md#diverging), [sequential single-hue](https://github.com/d3/d3-scale-chromatic/blob/master/README.md#sequential-single-hue) and [sequential multi-hue](https://github.com/d3/d3-scale-chromatic/blob/master/README.md#sequential-multi-hue) schemes. These schemes are available in both discrete and continuous variants.
+
+D3 now provides implementations of [marching squares](https://observablehq.com/@d3/contours) and [density estimation](https://observablehq.com/@d3/density-contours) via [d3-contour](https://github.com/d3/d3-contour)! There are two new [d3-selection](https://github.com/d3/d3-selection) methods: [*selection*.clone](https://github.com/d3/d3-selection/blob/master/README.md#selection_clone) for inserting clones of the selected nodes, and [d3.create](https://github.com/d3/d3-selection/blob/master/README.md#create) for creating detached elements. [Geographic projections](https://github.com/d3/d3-geo) now support [*projection*.angle](https://github.com/d3/d3-geo/blob/master/README.md#projection_angle), which has enabled several fantastic new [polyhedral projections](https://github.com/d3/d3-geo-polygon) by Philippe Rivière.
+
+Lastly, D3’s [package.json](https://github.com/d3/d3/blob/master/package.json) no longer pins exact versions of the dependent D3 modules. This fixes an issue with [duplicate installs](https://github.com/d3/d3/issues/3256) of D3 modules.
+
+# Changes in D3 4.0
+
+[Released June 28, 2016.](https://github.com/d3/d3/releases/tag/v4.0.0)
+
+D3 4.0 is modular. Instead of one library, D3 is now [many small libraries](#table-of-contents) that are designed to work together. You can pick and choose which parts to use as you see fit. Each library is maintained in its own repository, allowing decentralized ownership and independent release cycles. The default bundle combines about thirty of these microlibraries.
+
+```html
+
+```
+
+As before, you can load optional plugins on top of the default bundle, such as [ColorBrewer scales](https://github.com/d3/d3-scale-chromatic):
+
+```html
+
+
+```
+
+You are not required to use the default bundle! If you’re just using [d3-selection](https://github.com/d3/d3-selection), use it as a standalone library. Like the default bundle, you can load D3 microlibraries using vanilla script tags or RequireJS (great for HTTP/2!):
+
+```html
+
+```
+
+You can also `cat` D3 microlibraries into a custom bundle, or use tools such as [Webpack](https://webpack.github.io/) and [Rollup](http://rollupjs.org/) to create [optimized bundles](https://bl.ocks.org/mbostock/bb09af4c39c79cffcde4). Custom bundles are great for applications that use a subset of D3’s features; for example, a React chart library might use D3 for scales and shapes, and React to manipulate the DOM. The D3 microlibraries are written as [ES6 modules](http://www.2ality.com/2014/09/es6-modules-final.html), and Rollup lets you pick at the symbol level to produce smaller bundles.
+
+Small files are nice, but modularity is also about making D3 more *fun*. Microlibraries are easier to understand, develop and test. They make it easier for new people to get involved and contribute. They reduce the distinction between a “core module” and a “plugin”, and increase the pace of development in D3 features.
+
+If you don’t care about modularity, you can mostly ignore this change and keep using the default bundle. However, there is one unavoidable consequence of adopting ES6 modules: every symbol in D3 4.0 now shares a flat namespace rather than the nested one of D3 3.x. For example, d3.scale.linear is now d3.scaleLinear, and d3.layout.treemap is now d3.treemap. The adoption of ES6 modules also means that D3 is now written exclusively in [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) and has better readability. And there have been many other significant improvements to D3’s features! (Nearly all of the code from D3 3.x has been rewritten.) These changes are covered below.
+
+### Other Global Changes
+
+The default [UMD bundle](https://github.com/umdjs/umd) is now [anonymous](https://github.com/requirejs/requirejs/wiki/Updating-existing-libraries#register-as-an-anonymous-module-). No `d3` global is exported if AMD or CommonJS is detected. In a vanilla environment, the D3 microlibraries share the `d3` global, even if you load them independently; thus, code you write is the same whether or not you use the default bundle. (See [Let’s Make a (D3) Plugin](https://bost.ocks.org/mike/d3-plugin/) for more.) The generated bundle is no longer stored in the Git repository; Bower has been repointed to [d3-bower](https://github.com/mbostock-bower/d3-bower), and you can find the generated files on [npm](https://unpkg.com/d3) or attached to the [latest release](https://github.com/d3/d3/releases/latest). The non-minified default bundle is no longer mangled, making it more readable and preserving inline comments.
+
+To the consternation of some users, 3.x employed Unicode variable names such as λ, φ, τ and π for a concise representation of mathematical operations. A downside of this approach was that a SyntaxError would occur if you loaded the non-minified D3 using ISO-8859-1 instead of UTF-8. 3.x also used Unicode string literals, such as the SI-prefix µ for 1e-6. 4.0 uses only ASCII variable names and ASCII string literals (see [rollup-plugin-ascii](https://github.com/mbostock/rollup-plugin-ascii)), avoiding encoding problems.
+
+### Table of Contents
+
+* [Arrays](#arrays-d3-array)
+* [Axes](#axes-d3-axis)
+* [Brushes](#brushes-d3-brush)
+* [Chords](#chords-d3-chord)
+* [Collections](#collections-d3-collection)
+* [Colors](#colors-d3-color)
+* [Dispatches](#dispatches-d3-dispatch)
+* [Dragging](#dragging-d3-drag)
+* [Delimiter-Separated Values](#delimiter-separated-values-d3-dsv)
+* [Easings](#easings-d3-ease)
+* [Forces](#forces-d3-force)
+* [Number Formats](#number-formats-d3-format)
+* [Geographies](#geographies-d3-geo)
+* [Hierarchies](#hierarchies-d3-hierarchy)
+* [Internals](#internals)
+* [Interpolators](#interpolators-d3-interpolate)
+* [Paths](#paths-d3-path)
+* [Polygons](#polygons-d3-polygon)
+* [Quadtrees](#quadtrees-d3-quadtree)
+* [Queues](#queues-d3-queue)
+* [Random Numbers](#random-numbers-d3-random)
+* [Requests](#requests-d3-request)
+* [Scales](#scales-d3-scale)
+* [Selections](#selections-d3-selection)
+* [Shapes](#shapes-d3-shape)
+* [Time Formats](#time-formats-d3-time-format)
+* [Time Intervals](#time-intervals-d3-time)
+* [Timers](#timers-d3-timer)
+* [Transitions](#transitions-d3-transition)
+* [Voronoi Diagrams](#voronoi-diagrams-d3-voronoi)
+* [Zooming](#zooming-d3-zoom)
+
+## [Arrays (d3-array)](https://github.com/d3/d3-array/blob/master/README.md)
+
+The new [d3.scan](https://github.com/d3/d3-array/blob/master/README.md#scan) method performs a linear scan of an array, returning the index of the least element according to the specified comparator. This is similar to [d3.min](https://github.com/d3/d3-array/blob/master/README.md#min) and [d3.max](https://github.com/d3/d3-array/blob/master/README.md#max), except you can use it to find the position of an extreme element, rather than just calculate an extreme value.
+
+```js
+var data = [
+ {name: "Alice", value: 2},
+ {name: "Bob", value: 3},
+ {name: "Carol", value: 1},
+ {name: "Dwayne", value: 5}
+];
+
+var i = d3.scan(data, function(a, b) { return a.value - b.value; }); // 2
+data[i]; // {name: "Carol", value: 1}
+```
+
+The new [d3.ticks](https://github.com/d3/d3-array/blob/master/README.md#ticks) and [d3.tickStep](https://github.com/d3/d3-array/blob/master/README.md#tickStep) methods are useful for generating human-readable numeric ticks. These methods are a low-level alternative to [*continuous*.ticks](https://github.com/d3/d3-scale/blob/master/README.md#continuous_ticks) from [d3-scale](https://github.com/d3/d3-scale). The new implementation is also more accurate, returning the optimal number of ticks as measured by relative error.
+
+```js
+var ticks = d3.ticks(0, 10, 5); // [0, 2, 4, 6, 8, 10]
+```
+
+The [d3.range](https://github.com/d3/d3-array/blob/master/README.md#range) method no longer makes an elaborate attempt to avoid floating-point error when *step* is not an integer. The returned values are strictly defined as *start* + *i* \* *step*, where *i* is an integer. (Learn more about [floating point math](http://0.30000000000000004.com/).) d3.range returns the empty array for infinite ranges, rather than throwing an error.
+
+The method signature for optional accessors has been changed to be more consistent with array methods such as [*array*.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach): the accessor is passed the current element (*d*), the index (*i*), and the array (*data*), with *this* as undefined. This affects [d3.min](https://github.com/d3/d3-array/blob/master/README.md#min), [d3.max](https://github.com/d3/d3-array/blob/master/README.md#max), [d3.extent](https://github.com/d3/d3-array/blob/master/README.md#extent), [d3.sum](https://github.com/d3/d3-array/blob/master/README.md#sum), [d3.mean](https://github.com/d3/d3-array/blob/master/README.md#mean), [d3.median](https://github.com/d3/d3-array/blob/master/README.md#median), [d3.quantile](https://github.com/d3/d3-array/blob/master/README.md#quantile), [d3.variance](https://github.com/d3/d3-array/blob/master/README.md#variance) and [d3.deviation](https://github.com/d3/d3-array/blob/master/README.md#deviation). The [d3.quantile](https://github.com/d3/d3-array/blob/master/README.md#quantile) method previously did not take an accessor. Some methods with optional arguments now treat those arguments as missing if they are null or undefined, rather than strictly checking arguments.length.
+
+The new [d3.histogram](https://github.com/d3/d3-array/blob/master/README.md#histograms) API replaces d3.layout.histogram. Rather than exposing *bin*.x and *bin*.dx on each returned bin, the histogram exposes *bin*.x0 and *bin*.x1, guaranteeing that *bin*.x0 is exactly equal to *bin*.x1 on the preceding bin. The “frequency” and “probability” modes are no longer supported; each bin is simply an array of elements from the input data, so *bin*.length is equal to D3 3.x’s *bin*.y in frequency mode. To compute a probability distribution, divide the number of elements in each bin by the total number of elements.
+
+The *histogram*.range method has been renamed [*histogram*.domain](https://github.com/d3/d3-array/blob/master/README.md#histogram_domain) for consistency with scales. The *histogram*.bins method has been renamed [*histogram*.thresholds](https://github.com/d3/d3-array/blob/master/README.md#histogram_thresholds), and no longer accepts an upper value: *n* thresholds will produce *n* + 1 bins. If you specify a desired number of bins rather than thresholds, d3.histogram now uses [d3.ticks](https://github.com/d3/d3-array/blob/master/README.md#ticks) to compute nice bin thresholds. In addition to the default Sturges’ formula, D3 now implements the [Freedman-Diaconis rule](https://github.com/d3/d3-array/blob/master/README.md#thresholdFreedmanDiaconis) and [Scott’s normal reference rule](https://github.com/d3/d3-array/blob/master/README.md#thresholdScott).
+
+## [Axes (d3-axis)](https://github.com/d3/d3-axis/blob/master/README.md)
+
+To render axes properly in D3 3.x, you needed to style them:
+
+```html
+
+
+```
+
+If you didn’t, you saw this:
+
+
+
+D3 4.0 provides default styles and shorter syntax. In place of d3.svg.axis and *axis*.orient, D3 4.0 now provides four constructors for each orientation: [d3.axisTop](https://github.com/d3/d3-axis/blob/master/README.md#axisTop), [d3.axisRight](https://github.com/d3/d3-axis/blob/master/README.md#axisRight), [d3.axisBottom](https://github.com/d3/d3-axis/blob/master/README.md#axisBottom), [d3.axisLeft](https://github.com/d3/d3-axis/blob/master/README.md#axisLeft). These constructors accept a scale, so you can reduce all of the above to:
+
+```html
+
+```
+
+And get this:
+
+
+
+As before, you can customize the axis appearance either by applying stylesheets or by modifying the axis elements. The default appearance has been changed slightly to offset the axis by a half-pixel; this fixes a crisp-edges rendering issue on Safari where the axis would be drawn two-pixels thick.
+
+There’s now an [*axis*.tickArguments](https://github.com/d3/d3-axis/blob/master/README.md#axis_tickArguments) method, as an alternative to [*axis*.ticks](https://github.com/d3/d3-axis/blob/master/README.md#axis_ticks) that also allows the axis tick arguments to be inspected. The [*axis*.tickSize](https://github.com/d3/d3-axis/blob/master/README.md#axis_tickSize) method has been changed to only allow a single argument when setting the tick size. The *axis*.innerTickSize and *axis*.outerTickSize methods have been renamed [*axis*.tickSizeInner](https://github.com/d3/d3-axis/blob/master/README.md#axis_tickSizeInner) and [*axis*.tickSizeOuter](https://github.com/d3/d3-axis/blob/master/README.md#axis_tickSizeOuter), respectively.
+
+## [Brushes (d3-brush)](https://github.com/d3/d3-brush/blob/master/README.md)
+
+Replacing d3.svg.brush, there are now three classes of brush for brushing along the *x*-dimension, the *y*-dimension, or both: [d3.brushX](https://github.com/d3/d3-brush/blob/master/README.md#brushX), [d3.brushY](https://github.com/d3/d3-brush/blob/master/README.md#brushY), [d3.brush](https://github.com/d3/d3-brush/blob/master/README.md#brush). Brushes are no longer dependent on [scales](#scales-d3-scale); instead, each brush defines a selection in screen coordinates. This selection can be [inverted](https://github.com/d3/d3-scale/blob/master/README.md#continuous_invert) if you want to compute the corresponding data domain. And rather than rely on the scales’ ranges to determine the brushable area, there is now a [*brush*.extent](https://github.com/d3/d3-brush/blob/master/README.md#brush_extent) method for setting it. If you do not set the brush extent, it defaults to the full extent of the owner SVG element. The *brush*.clamp method has also been eliminated; brushing is always restricted to the brushable area defined by the brush extent.
+
+Brushes no longer store the active brush selection (*i.e.*, the highlighted region; the brush’s position) internally. The brush’s position is now stored on any elements to which the brush has been applied. The brush’s position is available as *event*.selection within a brush event or by calling [d3.brushSelection](https://github.com/d3/d3-brush/blob/master/README.md#brushSelection) on a given *element*. To move the brush programmatically, use [*brush*.move](https://github.com/d3/d3-brush/blob/master/README.md#brush_move) with a given [selection](#selections-d3-selection) or [transition](#transitions-d3-transition); see the [brush snapping example](https://bl.ocks.org/mbostock/6232537). The *brush*.event method has been removed.
+
+Brush interaction has been improved. By default, brushes now ignore right-clicks intended for the context menu; you can change this behavior using [*brush*.filter](https://github.com/d3/d3-brush/blob/master/README.md#brush_filter). Brushes also ignore emulated mouse events on iOS. Holding down SHIFT (⇧) while brushing locks the *x*- or *y*-position of the brush. Holding down META (⌘) while clicking and dragging starts a new selection, rather than translating the existing selection.
+
+The default appearance of the brush has also been improved and slightly simplified. Previously it was necessary to apply styles to the brush to give it a reasonable appearance, such as:
+
+```css
+.brush .extent {
+ stroke: #fff;
+ fill-opacity: .125;
+ shape-rendering: crispEdges;
+}
+```
+
+These styles are now applied by default as attributes; if you want to customize the brush appearance, you can still apply external styles or modify the brush elements. (D3 4.0 features a similar improvement to [axes](#axes-d3-axis).) A new [*brush*.handleSize](https://github.com/d3/d3-brush/blob/master/README.md#brush_handleSize) method lets you override the brush handle size; it defaults to six pixels.
+
+The brush now consumes handled events, making it easier to combine with other interactive behaviors such as [dragging](#dragging-d3-drag) and [zooming](#zooming-d3-zoom). The *brushstart* and *brushend* events have been renamed to *start* and *end*, respectively. The brush event no longer reports a *event*.mode to distinguish between resizing and dragging the brush.
+
+## [Chords (d3-chord)](https://github.com/d3/d3-chord/blob/master/README.md)
+
+Pursuant to the great namespace flattening:
+
+* d3.layout.chord ↦ [d3.chord](https://github.com/d3/d3-chord/blob/master/README.md#chord)
+* d3.svg.chord ↦ [d3.ribbon](https://github.com/d3/d3-chord/blob/master/README.md#ribbon)
+
+For consistency with [*arc*.padAngle](https://github.com/d3/d3-shape/blob/master/README.md#arc_padAngle), *chord*.padding has also been renamed to [*ribbon*.padAngle](https://github.com/d3/d3-chord/blob/master/README.md#ribbon_padAngle). A new [*ribbon*.context](https://github.com/d3/d3-chord/blob/master/README.md#ribbon_context) method lets you render chord diagrams to Canvas! See also [d3-path](#paths-d3-path).
+
+## [Collections (d3-collection)](https://github.com/d3/d3-collection/blob/master/README.md)
+
+The [d3.set](https://github.com/d3/d3-collection/blob/master/README.md#set) constructor now accepts an existing set for making a copy. If you pass an array to d3.set, you can also pass a value accessor. This accessor takes the standard arguments: the current element (*d*), the index (*i*), and the array (*data*), with *this* undefined. For example:
+
+```js
+var yields = [
+ {yield: 22.13333, variety: "Manchuria", year: 1932, site: "Grand Rapids"},
+ {yield: 26.76667, variety: "Peatland", year: 1932, site: "Grand Rapids"},
+ {yield: 28.10000, variety: "No. 462", year: 1931, site: "Duluth"},
+ {yield: 38.50000, variety: "Svansota", year: 1932, site: "Waseca"},
+ {yield: 40.46667, variety: "Svansota", year: 1931, site: "Crookston"},
+ {yield: 36.03333, variety: "Peatland", year: 1932, site: "Waseca"},
+ {yield: 34.46667, variety: "Wisconsin No. 38", year: 1931, site: "Grand Rapids"}
+];
+
+var sites = d3.set(yields, function(d) { return d.site; }); // Grand Rapids, Duluth, Waseca, Crookston
+```
+
+The [d3.map](https://github.com/d3/d3-collection/blob/master/README.md#map) constructor also follows the standard array accessor argument pattern.
+
+The *map*.forEach and *set*.forEach methods have been renamed to [*map*.each](https://github.com/d3/d3-collection/blob/master/README.md#map_each) and [*set*.each](https://github.com/d3/d3-collection/blob/master/README.md#set_each) respectively. The order of arguments for *map*.each has also been changed to *value*, *key* and *map*, while the order of arguments for *set*.each is now *value*, *value* and *set*. This is closer to ES6 [*map*.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach) and [*set*.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach). Also like ES6 Map and Set, *map*.set and *set*.add now return the current collection (rather than the added value) to facilitate method chaining. New [*map*.clear](https://github.com/d3/d3-collection/blob/master/README.md#map_clear) and [*set*.clear](https://github.com/d3/d3-collection/blob/master/README.md#set_clear) methods can be used to empty collections.
+
+The [*nest*.map](https://github.com/d3/d3-collection/blob/master/README.md#nest_map) method now always returns a d3.map instance. For a plain object, use [*nest*.object](https://github.com/d3/d3-collection/blob/master/README.md#nest_object) instead. When used in conjunction with [*nest*.rollup](https://github.com/d3/d3-collection/blob/master/README.md#nest_rollup), [*nest*.entries](https://github.com/d3/d3-collection/blob/master/README.md#nest_entries) now returns {key, value} objects for the leaf entries, instead of {key, values}. This makes *nest*.rollup easier to use in conjunction with [hierarchies](#hierarchies-d3-hierarchy), as in this [Nest Treemap example](https://bl.ocks.org/mbostock/2838bf53e0e65f369f476afd653663a2).
+
+## [Colors (d3-color)](https://github.com/d3/d3-color/blob/master/README.md)
+
+All colors now have opacity exposed as *color*.opacity, which is a number in [0, 1]. You can pass an optional opacity argument to the color space constructors [d3.rgb](https://github.com/d3/d3-color/blob/master/README.md#rgb), [d3.hsl](https://github.com/d3/d3-color/blob/master/README.md#hsl), [d3.lab](https://github.com/d3/d3-color/blob/master/README.md#lab), [d3.hcl](https://github.com/d3/d3-color/blob/master/README.md#hcl) or [d3.cubehelix](https://github.com/d3/d3-color/blob/master/README.md#cubehelix).
+
+You can now parse rgba(…) and hsla(…) CSS color specifiers or the string “transparent” using [d3.color](https://github.com/d3/d3-color/blob/master/README.md#color). The “transparent” color is defined as an RGB color with zero opacity and undefined red, green and blue channels; this differs slightly from CSS which defines it as transparent black, but is useful for simplifying color interpolation logic where either the starting or ending color has undefined channels. The [*color*.toString](https://github.com/d3/d3-color/blob/master/README.md#color_toString) method now likewise returns an rgb(…) or rgba(…) string with integer channel values, not the hexadecimal RGB format, consistent with CSS computed values. This improves performance by short-circuiting transitions when the element’s starting style matches its ending style.
+
+The new [d3.color](https://github.com/d3/d3-color/blob/master/README.md#color) method is the primary method for parsing colors: it returns a d3.color instance in the appropriate color space, or null if the CSS color specifier is invalid. For example:
+
+```js
+var red = d3.color("hsl(0, 80%, 50%)"); // {h: 0, l: 0.5, s: 0.8, opacity: 1}
+```
+
+The parsing implementation is now more robust. For example, you can no longer mix integers and percentages in rgb(…), and it correctly handles whitespace, decimal points, number signs, and other edge cases. The color space constructors d3.rgb, d3.hsl, d3.lab, d3.hcl and d3.cubehelix now always return a copy of the input color, converted to the corresponding color space. While [*color*.rgb](https://github.com/d3/d3-color/blob/master/README.md#color_rgb) remains, *rgb*.hsl has been removed; use d3.hsl to convert a color to the RGB color space.
+
+The RGB color space no longer greedily quantizes and clamps channel values when creating colors, improving accuracy in color space conversion. Quantization and clamping now occurs in *color*.toString when formatting a color for display. You can use the new [*color*.displayable](https://github.com/d3/d3-color/blob/master/README.md#color_displayable) to test whether a color is [out-of-gamut](https://en.wikipedia.org/wiki/Gamut).
+
+The [*rgb*.brighter](https://github.com/d3/d3-color/blob/master/README.md#rgb_brighter) method no longer special-cases black. This is a multiplicative operator, defining a new color *r*′, *g*′, *b*′ where *r*′ = *r* × *pow*(0.7, *k*), *g*′ = *g* × *pow*(0.7, *k*) and *b*′ = *b* × *pow*(0.7, *k*); a brighter black is still black.
+
+There’s a new [d3.cubehelix](https://github.com/d3/d3-color/blob/master/README.md#cubehelix) color space, generalizing Dave Green’s color scheme! (See also [d3.interpolateCubehelixDefault](https://github.com/d3/d3-scale/blob/master/README.md#interpolateCubehelixDefault) from [d3-scale](#scales-d3-scale).) You can continue to define your own custom color spaces, too; see [d3-hsv](https://github.com/d3/d3-hsv) for an example.
+
+## [Dispatches (d3-dispatch)](https://github.com/d3/d3-dispatch/blob/master/README.md)
+
+Rather than decorating the *dispatch* object with each event type, the dispatch object now exposes generic [*dispatch*.call](https://github.com/d3/d3-dispatch/blob/master/README.md#dispatch_call) and [*dispatch*.apply](https://github.com/d3/d3-dispatch/blob/master/README.md#dispatch_apply) methods which take the *type* string as the first argument. For example, in D3 3.x, you might say:
+
+```js
+dispatcher.foo.call(that, "Hello, Foo!");
+```
+
+To dispatch a *foo* event in D3 4.0, you’d say:
+
+```js
+dispatcher.call("foo", that, "Hello, Foo!");
+```
+
+The [*dispatch*.on](https://github.com/d3/d3-dispatch/blob/master/README.md#dispatch_on) method now accepts multiple typenames, allowing you to add or remove listeners for multiple events simultaneously. For example, to send both *foo* and *bar* events to the same listener:
+
+```js
+dispatcher.on("foo bar", function(message) {
+ console.log(message);
+});
+```
+
+This matches the new behavior of [*selection*.on](https://github.com/d3/d3-selection/blob/master/README.md#selection_on) in [d3-selection](#selections-d3-selection). The *dispatch*.on method now validates that the specifier *listener* is a function, rather than throwing an error in the future.
+
+The new implementation d3.dispatch is faster, using fewer closures to improve performance. There’s also a new [*dispatch*.copy](https://github.com/d3/d3-dispatch/blob/master/README.md#dispatch_copy) method for making a copy of a dispatcher; this is used by [d3-transition](#transitions-d3-transition) to improve the performance of transitions in the common case where all elements in a transition have the same transition event listeners.
+
+## [Dragging (d3-drag)](https://github.com/d3/d3-drag/blob/master/README.md)
+
+The drag behavior d3.behavior.drag has been renamed to d3.drag. The *drag*.origin method has been replaced by [*drag*.subject](https://github.com/d3/d3-drag/blob/master/README.md#drag_subject), which allows you to define the thing being dragged at the start of a drag gesture. This is particularly useful with Canvas, where draggable objects typically share a Canvas element (as opposed to SVG, where draggable objects typically have distinct DOM elements); see the [circle dragging example](https://bl.ocks.org/mbostock/444757cc9f0fde320a5f469cd36860f4).
+
+A new [*drag*.container](https://github.com/d3/d3-drag/blob/master/README.md#drag_container) method lets you override the parent element that defines the drag gesture coordinate system. This defaults to the parent node of the element to which the drag behavior was applied. For dragging on Canvas elements, you probably want to use the Canvas element as the container.
+
+[Drag events](https://github.com/d3/d3-drag/blob/master/README.md#drag-events) now expose an [*event*.on](https://github.com/d3/d3-drag/blob/master/README.md#event_on) method for registering temporary listeners for duration of the current drag gesture; these listeners can capture state for the current gesture, such as the thing being dragged. A new *event*.active property lets you detect whether multiple (multitouch) drag gestures are active concurrently. The *dragstart* and *dragend* events have been renamed to *start* and *end*. By default, drag behaviors now ignore right-clicks intended for the context menu; use [*drag*.filter](https://github.com/d3/d3-drag/blob/master/README.md#drag_filter) to control which events are ignored. The drag behavior also ignores emulated mouse events on iOS. The drag behavior now consumes handled events, making it easier to combine with other interactive behaviors such as [zooming](#zooming-d3-zoom).
+
+The new [d3.dragEnable](https://github.com/d3/d3-drag/blob/master/README.md#dragEnable) and [d3.dragDisable](https://github.com/d3/d3-drag/blob/master/README.md#dragDisable) methods provide a low-level API for implementing drag gestures across browsers and devices. These methods are also used by other D3 components, such as the [brush](#brushes-d3-brush).
+
+## [Delimiter-Separated Values (d3-dsv)](https://github.com/d3/d3-dsv/blob/master/README.md)
+
+Pursuant to the great namespace flattening, various CSV and TSV methods have new names:
+
+* d3.csv.parse ↦ [d3.csvParse](https://github.com/d3/d3-dsv/blob/master/README.md#csvParse)
+* d3.csv.parseRows ↦ [d3.csvParseRows](https://github.com/d3/d3-dsv/blob/master/README.md#csvParseRows)
+* d3.csv.format ↦ [d3.csvFormat](https://github.com/d3/d3-dsv/blob/master/README.md#csvFormat)
+* d3.csv.formatRows ↦ [d3.csvFormatRows](https://github.com/d3/d3-dsv/blob/master/README.md#csvFormatRows)
+* d3.tsv.parse ↦ [d3.tsvParse](https://github.com/d3/d3-dsv/blob/master/README.md#tsvParse)
+* d3.tsv.parseRows ↦ [d3.tsvParseRows](https://github.com/d3/d3-dsv/blob/master/README.md#tsvParseRows)
+* d3.tsv.format ↦ [d3.tsvFormat](https://github.com/d3/d3-dsv/blob/master/README.md#tsvFormat)
+* d3.tsv.formatRows ↦ [d3.tsvFormatRows](https://github.com/d3/d3-dsv/blob/master/README.md#tsvFormatRows)
+
+The [d3.csv](https://github.com/d3/d3-request/blob/master/README.md#csv) and [d3.tsv](https://github.com/d3/d3-request/blob/master/README.md#tsv) methods for loading files of the corresponding formats have not been renamed, however! Those are defined in [d3-request](#requests-d3-request).There’s no longer a d3.dsv method, which served the triple purpose of defining a DSV formatter, a DSV parser and a DSV requestor; instead, there’s just [d3.dsvFormat](https://github.com/d3/d3-dsv/blob/master/README.md#dsvFormat) which you can use to define a DSV formatter and parser. You can use [*request*.response](https://github.com/d3/d3-request/blob/master/README.md#request_response) to make a request and then parse the response body, or just use [d3.text](https://github.com/d3/d3-request/blob/master/README.md#text).
+
+The [*dsv*.parse](https://github.com/d3/d3-dsv/blob/master/README.md#dsv_parse) method now exposes the column names and their input order as *data*.columns. For example:
+
+```js
+d3.csv("cars.csv", function(error, data) {
+ if (error) throw error;
+ console.log(data.columns); // ["Year", "Make", "Model", "Length"]
+});
+```
+
+You can likewise pass an optional array of column names to [*dsv*.format](https://github.com/d3/d3-dsv/blob/master/README.md#dsv_format) to format only a subset of columns, or to specify the column order explicitly:
+
+```js
+var string = d3.csvFormat(data, ["Year", "Model", "Length"]);
+```
+
+The parser is a bit faster and the formatter is a bit more robust: inputs are coerced to strings before formatting, fixing an obscure crash, and deprecated support for falling back to [*dsv*.formatRows](https://github.com/d3/d3-dsv/blob/master/README.md#dsv_formatRows) when the input *data* is an array of arrays has been removed.
+
+## [Easings (d3-ease)](https://github.com/d3/d3-ease/blob/master/README.md)
+
+D3 3.x used strings, such as “cubic-in-out”, to identify easing methods; these strings could be passed to d3.ease or *transition*.ease. D3 4.0 uses symbols instead, such as [d3.easeCubicInOut](https://github.com/d3/d3-ease/blob/master/README.md#easeCubicInOut). Symbols are simpler and cleaner. They work well with Rollup to produce smaller custom bundles. You can still define your own custom easing function, too, if desired. Here’s the full list of equivalents:
+
+* linear ↦ [d3.easeLinear](https://github.com/d3/d3-ease/blob/master/README.md#easeLinear)¹
+* linear-in ↦ [d3.easeLinear](https://github.com/d3/d3-ease/blob/master/README.md#easeLinear)¹
+* linear-out ↦ [d3.easeLinear](https://github.com/d3/d3-ease/blob/master/README.md#easeLinear)¹
+* linear-in-out ↦ [d3.easeLinear](https://github.com/d3/d3-ease/blob/master/README.md#easeLinear)¹
+* linear-out-in ↦ [d3.easeLinear](https://github.com/d3/d3-ease/blob/master/README.md#easeLinear)¹
+* poly-in ↦ [d3.easePolyIn](https://github.com/d3/d3-ease/blob/master/README.md#easePolyIn)
+* poly-out ↦ [d3.easePolyOut](https://github.com/d3/d3-ease/blob/master/README.md#easePolyOut)
+* poly-in-out ↦ [d3.easePolyInOut](https://github.com/d3/d3-ease/blob/master/README.md#easePolyInOut)
+* poly-out-in ↦ REMOVED²
+* quad-in ↦ [d3.easeQuadIn](https://github.com/d3/d3-ease/blob/master/README.md#easeQuadIn)
+* quad-out ↦ [d3.easeQuadOut](https://github.com/d3/d3-ease/blob/master/README.md#easeQuadOut)
+* quad-in-out ↦ [d3.easeQuadInOut](https://github.com/d3/d3-ease/blob/master/README.md#easeQuadInOut)
+* quad-out-in ↦ REMOVED²
+* cubic-in ↦ [d3.easeCubicIn](https://github.com/d3/d3-ease/blob/master/README.md#easeCubicIn)
+* cubic-out ↦ [d3.easeCubicOut](https://github.com/d3/d3-ease/blob/master/README.md#easeCubicOut)
+* cubic-in-out ↦ [d3.easeCubicInOut](https://github.com/d3/d3-ease/blob/master/README.md#easeCubicInOut)
+* cubic-out-in ↦ REMOVED²
+* sin-in ↦ [d3.easeSinIn](https://github.com/d3/d3-ease/blob/master/README.md#easeSinIn)
+* sin-out ↦ [d3.easeSinOut](https://github.com/d3/d3-ease/blob/master/README.md#easeSinOut)
+* sin-in-out ↦ [d3.easeSinInOut](https://github.com/d3/d3-ease/blob/master/README.md#easeSinInOut)
+* sin-out-in ↦ REMOVED²
+* exp-in ↦ [d3.easeExpIn](https://github.com/d3/d3-ease/blob/master/README.md#easeExpIn)
+* exp-out ↦ [d3.easeExpOut](https://github.com/d3/d3-ease/blob/master/README.md#easeExpOut)
+* exp-in-out ↦ [d3.easeExpInOut](https://github.com/d3/d3-ease/blob/master/README.md#easeExpInOut)
+* exp-out-in ↦ REMOVED²
+* circle-in ↦ [d3.easeCircleIn](https://github.com/d3/d3-ease/blob/master/README.md#easeCircleIn)
+* circle-out ↦ [d3.easeCircleOut](https://github.com/d3/d3-ease/blob/master/README.md#easeCircleOut)
+* circle-in-out ↦ [d3.easeCircleInOut](https://github.com/d3/d3-ease/blob/master/README.md#easeCircleInOut)
+* circle-out-in ↦ REMOVED²
+* elastic-in ↦ [d3.easeElasticOut](https://github.com/d3/d3-ease/blob/master/README.md#easeElasticOut)²
+* elastic-out ↦ [d3.easeElasticIn](https://github.com/d3/d3-ease/blob/master/README.md#easeElasticIn)²
+* elastic-in-out ↦ REMOVED²
+* elastic-out-in ↦ [d3.easeElasticInOut](https://github.com/d3/d3-ease/blob/master/README.md#easeElasticInOut)²
+* back-in ↦ [d3.easeBackIn](https://github.com/d3/d3-ease/blob/master/README.md#easeBackIn)
+* back-out ↦ [d3.easeBackOut](https://github.com/d3/d3-ease/blob/master/README.md#easeBackOut)
+* back-in-out ↦ [d3.easeBackInOut](https://github.com/d3/d3-ease/blob/master/README.md#easeBackInOut)
+* back-out-in ↦ REMOVED²
+* bounce-in ↦ [d3.easeBounceOut](https://github.com/d3/d3-ease/blob/master/README.md#easeBounceOut)²
+* bounce-out ↦ [d3.easeBounceIn](https://github.com/d3/d3-ease/blob/master/README.md#easeBounceIn)²
+* bounce-in-out ↦ REMOVED²
+* bounce-out-in ↦ [d3.easeBounceInOut](https://github.com/d3/d3-ease/blob/master/README.md#easeBounceInOut)²
+
+¹ The -in, -out and -in-out variants of linear easing are identical, so there’s just d3.easeLinear.
+
² Elastic and bounce easing were inadvertently reversed in 3.x, so 4.0 eliminates -out-in easing!
+
+For convenience, there are also default aliases for each easing method. For example, [d3.easeCubic](https://github.com/d3/d3-ease/blob/master/README.md#easeCubic) is an alias for [d3.easeCubicInOut](https://github.com/d3/d3-ease/blob/master/README.md#easeCubicInOut). Most default to -in-out; the exceptions are [d3.easeBounce](https://github.com/d3/d3-ease/blob/master/README.md#easeBounce) and [d3.easeElastic](https://github.com/d3/d3-ease/blob/master/README.md#easeElastic), which default to -out.
+
+Rather than pass optional arguments to d3.ease or *transition*.ease, parameterizable easing functions now have named parameters: [*poly*.exponent](https://github.com/d3/d3-ease/blob/master/README.md#poly_exponent), [*elastic*.amplitude](https://github.com/d3/d3-ease/blob/master/README.md#elastic_amplitude), [*elastic*.period](https://github.com/d3/d3-ease/blob/master/README.md#elastic_period) and [*back*.overshoot](https://github.com/d3/d3-ease/blob/master/README.md#back_overshoot). For example, in D3 3.x you might say:
+
+```js
+var e = d3.ease("elastic-out-in", 1.2);
+```
+
+The equivalent in D3 4.0 is:
+
+```js
+var e = d3.easeElastic.amplitude(1.2);
+```
+
+Many of the easing functions have been optimized for performance and accuracy. Several bugs have been fixed, as well, such as the interpretation of the overshoot parameter for back easing, and the period parameter for elastic easing. Also, [d3-transition](#transitions-d3-transition) now explicitly guarantees that the last tick of the transition happens at exactly *t* = 1, avoiding floating point errors in some easing functions.
+
+There’s now a nice [visual reference](https://github.com/d3/d3-ease/blob/master/README.md) and an [animated reference](https://bl.ocks.org/mbostock/248bac3b8e354a9103c4) to the new easing functions, too!
+
+## [Forces (d3-force)](https://github.com/d3/d3-force/blob/master/README.md)
+
+The force layout d3.layout.force has been renamed to d3.forceSimulation. The force simulation now uses [velocity Verlet integration](https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet) rather than position Verlet, tracking the nodes’ positions (*node*.x, *node*.y) and velocities (*node*.vx, *node*.vy) rather than their previous positions (*node*.px, *node*.py).
+
+Rather than hard-coding a set of built-in forces, the force simulation is now extensible: you specify which forces you want! The approach affords greater flexibility through composition. The new forces are more flexible, too: force parameters can typically be configured per-node or per-link. There are separate positioning forces for [*x*](https://github.com/d3/d3-force/blob/master/README.md#forceX) and [*y*](https://github.com/d3/d3-force/blob/master/README.md#forceY) that replace *force*.gravity; [*x*.x](https://github.com/d3/d3-force/blob/master/README.md#x_x) and [*y*.y](https://github.com/d3/d3-force/blob/master/README.md#y_y) replace *force*.size. The new [link force](https://github.com/d3/d3-force/blob/master/README.md#forceLink) replaces *force*.linkStrength and employs better default heuristics to improve stability. The new [many-body force](https://github.com/d3/d3-force/blob/master/README.md#forceManyBody) replaces *force*.charge and supports a new [minimum-distance parameter](https://github.com/d3/d3-force/blob/master/README.md#manyBody_distanceMin) and performance improvements thanks to 4.0’s [new quadtrees](#quadtrees-d3-quadtree). There are also brand-new forces for [centering nodes](https://github.com/d3/d3-force/blob/master/README.md#forceCenter) and [collision resolution](https://github.com/d3/d3-force/blob/master/README.md#forceCollision).
+
+The new forces and simulation have been carefully crafted to avoid nondeterminism. Rather than initializing nodes randomly, if the nodes do not have preset positions, they are placed in a phyllotaxis pattern:
+
+
+
+Random jitter is still needed to resolve link, collision and many-body forces if there are coincident nodes, but at least in the common case, the force simulation (and the resulting force-directed graph layout) is now consistent across browsers and reloads. D3 no longer plays dice!
+
+The force simulation has several new methods for greater control over heating, such as [*simulation*.alphaMin](https://github.com/d3/d3-force/blob/master/README.md#simulation_alphaMin) and [*simulation*.alphaDecay](https://github.com/d3/d3-force/blob/master/README.md#simulation_alphaDecay), and the internal timer. Calling [*simulation*.alpha](https://github.com/d3/d3-force/blob/master/README.md#simulation_alpha) now has no effect on the internal timer, which is controlled independently via [*simulation*.stop](https://github.com/d3/d3-force/blob/master/README.md#simulation_stop) and [*simulation*.restart](https://github.com/d3/d3-force/blob/master/README.md#simulation_restart). The force layout’s internal timer now starts automatically on creation, removing *force*.start. As in 3.x, you can advance the simulation manually using [*simulation*.tick](https://github.com/d3/d3-force/blob/master/README.md#simulation_tick). The *force*.friction parameter is replaced by *simulation*.velocityDecay. A new [*simulation*.alphaTarget](https://github.com/d3/d3-force/blob/master/README.md#simulation_alphaTarget) method allows you to set the desired alpha (temperature) of the simulation, such that the simulation can be smoothly reheated during interaction, and then smoothly cooled again. This improves the stability of the graph during interaction.
+
+The force layout no longer depends on the [drag behavior](#dragging-d3-drag), though you can certainly create [draggable force-directed graphs](https://bl.ocks.org/mbostock/ad70335eeef6d167bc36fd3c04378048)! Set *node*.fx and *node*.fy to fix a node’s position. As an alternative to a [Voronoi](#voronoi-d3-voronoi) SVG overlay, you can now use [*simulation*.find](https://github.com/d3/d3-force/blob/master/README.md#simulation_find) to find the closest node to a pointer.
+
+## [Number Formats (d3-format)](https://github.com/d3/d3-format/blob/master/README.md)
+
+If a precision is not specified, the formatting behavior has changed: there is now a default precision of 6 for all directives except *none*, which defaults to 12. In 3.x, if you did not specify a precision, the number was formatted using its shortest unique representation (per [*number*.toString](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)); this could lead to unexpected digits due to [floating point math](http://0.30000000000000004.com/). The new default precision in 4.0 produces more consistent results:
+
+```js
+var f = d3.format("e");
+f(42); // "4.200000e+1"
+f(0.1 + 0.2); // "3.000000e-1"
+```
+
+To trim insignificant trailing zeroes, use the *none* directive, which is similar `g`. For example:
+
+```js
+var f = d3.format(".3");
+f(0.12345); // "0.123"
+f(0.10000); // "0.1"
+f(0.1 + 0.2); // "0.3"
+```
+
+Under the hood, number formatting has improved accuracy with very large and very small numbers by using [*number*.toExponential](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) rather than [Math.log](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log) to extract the mantissa and exponent. Negative zero (-0, an IEEE 754 construct) and very small numbers that round to zero are now formatted as unsigned zero. The inherently unsafe d3.round method has been removed, along with d3.requote.
+
+The [d3.formatPrefix](https://github.com/d3/d3-format/blob/master/README.md#formatPrefix) method has been changed. Rather than returning an SI-prefix string, it returns an SI-prefix format function for a given *specifier* and reference *value*. For example, to format thousands:
+
+```js
+var f = d3.formatPrefix(",.0", 1e3);
+f(1e3); // "1k"
+f(1e4); // "10k"
+f(1e5); // "100k"
+f(1e6); // "1,000k"
+```
+
+Unlike the `s` format directive, d3.formatPrefix always employs the same SI-prefix, producing consistent results:
+
+```js
+var f = d3.format(".0s");
+f(1e3); // "1k"
+f(1e4); // "10k"
+f(1e5); // "100k"
+f(1e6); // "1M"
+```
+
+The new `(` sign option uses parentheses for negative values. This is particularly useful in conjunction with `$`. For example:
+
+```js
+d3.format("+.0f")(-42); // "-42"
+d3.format("(.0f")(-42); // "(42)"
+d3.format("+$.0f")(-42); // "-$42"
+d3.format("($.0f")(-42); // "($42)"
+```
+
+The new `=` align option places any sign and symbol to the left of any padding:
+
+```js
+d3.format(">6d")(-42); // " -42"
+d3.format("=6d")(-42); // "- 42"
+d3.format(">(6d")(-42); // " (42)"
+d3.format("=(6d")(-42); // "( 42)"
+```
+
+The `b`, `o`, `d` and `x` directives now round to the nearest integer, rather than returning the empty string for non-integers:
+
+```js
+d3.format("b")(41.9); // "101010"
+d3.format("o")(41.9); // "52"
+d3.format("d")(41.9); // "42"
+d3.format("x")(41.9); // "2a"
+```
+
+The `c` directive is now for character data (*i.e.*, literal strings), not for character codes. The is useful if you just want to apply padding and alignment and don’t care about formatting numbers. For example, the infamous [left-pad](http://blog.npmjs.org/post/141577284765/kik-left-pad-and-npm) (as well as center- and right-pad!) can be conveniently implemented as:
+
+```js
+d3.format(">10c")("foo"); // " foo"
+d3.format("^10c")("foo"); // " foo "
+d3.format("<10c")("foo"); // "foo "
+```
+
+There are several new methods for computing suggested decimal precisions; these are used by [d3-scale](#scales-d3-scale) for tick formatting, and are helpful for implementing custom number formats: [d3.precisionFixed](https://github.com/d3/d3-format/blob/master/README.md#precisionFixed), [d3.precisionPrefix](https://github.com/d3/d3-format/blob/master/README.md#precisionPrefix) and [d3.precisionRound](https://github.com/d3/d3-format/blob/master/README.md#precisionRound). There’s also a new [d3.formatSpecifier](https://github.com/d3/d3-format/blob/master/README.md#formatSpecifier) method for parsing, validating and debugging format specifiers; it’s also good for deriving related format specifiers, such as when you want to substitute the precision automatically.
+
+You can now set the default locale using [d3.formatDefaultLocale](https://github.com/d3/d3-format/blob/master/README.md#formatDefaultLocale)! The locales are published as [JSON](https://github.com/d3/d3-request/blob/master/README.md#json) to [npm](https://unpkg.com/d3-format/locale/).
+
+## [Geographies (d3-geo)](https://github.com/d3/d3-geo/blob/master/README.md)
+
+Pursuant to the great namespace flattening, various methods have new names:
+
+* d3.geo.graticule ↦ [d3.geoGraticule](https://github.com/d3/d3-geo/blob/master/README.md#geoGraticule)
+* d3.geo.circle ↦ [d3.geoCircle](https://github.com/d3/d3-geo/blob/master/README.md#geoCircle)
+* d3.geo.area ↦ [d3.geoArea](https://github.com/d3/d3-geo/blob/master/README.md#geoArea)
+* d3.geo.bounds ↦ [d3.geoBounds](https://github.com/d3/d3-geo/blob/master/README.md#geoBounds)
+* d3.geo.centroid ↦ [d3.geoCentroid](https://github.com/d3/d3-geo/blob/master/README.md#geoCentroid)
+* d3.geo.distance ↦ [d3.geoDistance](https://github.com/d3/d3-geo/blob/master/README.md#geoDistance)
+* d3.geo.interpolate ↦ [d3.geoInterpolate](https://github.com/d3/d3-geo/blob/master/README.md#geoInterpolate)
+* d3.geo.length ↦ [d3.geoLength](https://github.com/d3/d3-geo/blob/master/README.md#geoLength)
+* d3.geo.rotation ↦ [d3.geoRotation](https://github.com/d3/d3-geo/blob/master/README.md#geoRotation)
+* d3.geo.stream ↦ [d3.geoStream](https://github.com/d3/d3-geo/blob/master/README.md#geoStream)
+* d3.geo.path ↦ [d3.geoPath](https://github.com/d3/d3-geo/blob/master/README.md#geoPath)
+* d3.geo.projection ↦ [d3.geoProjection](https://github.com/d3/d3-geo/blob/master/README.md#geoProjection)
+* d3.geo.projectionMutator ↦ [d3.geoProjectionMutator](https://github.com/d3/d3-geo/blob/master/README.md#geoProjectionMutator)
+* d3.geo.albers ↦ [d3.geoAlbers](https://github.com/d3/d3-geo/blob/master/README.md#geoAlbers)
+* d3.geo.albersUsa ↦ [d3.geoAlbersUsa](https://github.com/d3/d3-geo/blob/master/README.md#geoAlbersUsa)
+* d3.geo.azimuthalEqualArea ↦ [d3.geoAzimuthalEqualArea](https://github.com/d3/d3-geo/blob/master/README.md#geoAzimuthalEqualArea)
+* d3.geo.azimuthalEquidistant ↦ [d3.geoAzimuthalEquidistant](https://github.com/d3/d3-geo/blob/master/README.md#geoAzimuthalEquidistant)
+* d3.geo.conicConformal ↦ [d3.geoConicConformal](https://github.com/d3/d3-geo/blob/master/README.md#geoConicConformal)
+* d3.geo.conicEqualArea ↦ [d3.geoConicEqualArea](https://github.com/d3/d3-geo/blob/master/README.md#geoConicEqualArea)
+* d3.geo.conicEquidistant ↦ [d3.geoConicEquidistant](https://github.com/d3/d3-geo/blob/master/README.md#geoConicEquidistant)
+* d3.geo.equirectangular ↦ [d3.geoEquirectangular](https://github.com/d3/d3-geo/blob/master/README.md#geoEquirectangular)
+* d3.geo.gnomonic ↦ [d3.geoGnomonic](https://github.com/d3/d3-geo/blob/master/README.md#geoGnomonic)
+* d3.geo.mercator ↦ [d3.geoMercator](https://github.com/d3/d3-geo/blob/master/README.md#geoMercator)
+* d3.geo.orthographic ↦ [d3.geoOrthographic](https://github.com/d3/d3-geo/blob/master/README.md#geoOrthographic)
+* d3.geo.stereographic ↦ [d3.geoStereographic](https://github.com/d3/d3-geo/blob/master/README.md#geoStereographic)
+* d3.geo.transverseMercator ↦ [d3.geoTransverseMercator](https://github.com/d3/d3-geo/blob/master/README.md#geoTransverseMercator)
+
+Also renamed for consistency:
+
+* *circle*.origin ↦ [*circle*.center](https://github.com/d3/d3-geo/blob/master/README.md#circle_center)
+* *circle*.angle ↦ [*circle*.radius](https://github.com/d3/d3-geo/blob/master/README.md#circle_radius)
+* *graticule*.majorExtent ↦ [*graticule*.extentMajor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_extentMajor)
+* *graticule*.minorExtent ↦ [*graticule*.extentMinor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_extentMinor)
+* *graticule*.majorStep ↦ [*graticule*.stepMajor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_stepMajor)
+* *graticule*.minorStep ↦ [*graticule*.stepMinor](https://github.com/d3/d3-geo/blob/master/README.md#graticule_stepMinor)
+
+Projections now have more appropriate defaults. For example, [d3.geoOrthographic](https://github.com/d3/d3-geo/blob/master/README.md#geoOrthographic) has a 90° clip angle by default, showing only the front hemisphere, and [d3.geoGnomonic](https://github.com/d3/d3-geo/blob/master/README.md#geoGnomonic) has a default 60° clip angle. The default [projection](https://github.com/d3/d3-geo/blob/master/README.md#path_projection) for [d3.geoPath](https://github.com/d3/d3-geo/blob/master/README.md#geoPath) is now null rather than [d3.geoAlbersUsa](https://github.com/d3/d3-geo/blob/master/README.md#geoAlbersUsa); a null projection is used with [pre-projected geometry](https://bl.ocks.org/mbostock/5557726) and is typically faster to render.
+
+“Fallback projections”—when you pass a function rather than a projection to [*path*.projection](https://github.com/d3/d3-geo/blob/master/README.md#path_projection)—are no longer supported. For geographic projections, use [d3.geoProjection](https://github.com/d3/d3-geo/blob/master/README.md#geoProjection) or [d3.geoProjectionMutator](https://github.com/d3/d3-geo/blob/master/README.md#geoProjectionMutator) to define a custom projection. For arbitrary geometry transformations, implement the [stream interface](https://github.com/d3/d3-geo/blob/master/README.md#streams); see also [d3.geoTransform](https://github.com/d3/d3-geo/blob/master/README.md#geoTransform). The “raw” projections (e.g., d3.geo.equirectangular.raw) are no longer exported.
+
+## [Hierarchies (d3-hierarchy)](https://github.com/d3/d3-hierarchy/blob/master/README.md)
+
+Pursuant to the great namespace flattening:
+
+* d3.layout.cluster ↦ [d3.cluster](https://github.com/d3/d3-hierarchy/blob/master/README.md#cluster)
+* d3.layout.hierarchy ↦ [d3.hierarchy](https://github.com/d3/d3-hierarchy/blob/master/README.md#hierarchy)
+* d3.layout.pack ↦ [d3.pack](https://github.com/d3/d3-hierarchy/blob/master/README.md#pack)
+* d3.layout.partition ↦ [d3.partition](https://github.com/d3/d3-hierarchy/blob/master/README.md#partition)
+* d3.layout.tree ↦ [d3.tree](https://github.com/d3/d3-hierarchy/blob/master/README.md#tree)
+* d3.layout.treemap ↦ [d3.treemap](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemap)
+
+As an alternative to using JSON to represent hierarchical data (such as the “flare.json format” used by many D3 examples), the new [d3.stratify](https://github.com/d3/d3-hierarchy/blob/master/README.md#stratify) operator simplifies the conversion of tabular data to hierarchical data! This is convenient if you already have data in a tabular format, such as the result of a SQL query or a CSV file:
+
+```
+name,parent
+Eve,
+Cain,Eve
+Seth,Eve
+Enos,Seth
+Noam,Seth
+Abel,Eve
+Awan,Eve
+Enoch,Awan
+Azura,Eve
+```
+
+To convert this to a root [*node*](https://github.com/d3/d3-hierarchy/blob/master/README.md#hierarchy):
+
+```js
+var root = d3.stratify()
+ .id(function(d) { return d.name; })
+ .parentId(function(d) { return d.parent; })
+ (nodes);
+```
+
+The resulting *root* can be passed to [d3.tree](https://github.com/d3/d3-hierarchy/blob/master/README.md#tree) to produce a tree diagram like this:
+
+
+
+Root nodes can also be created from JSON data using [d3.hierarchy](https://github.com/d3/d3-hierarchy/blob/master/README.md#hierarchy). The hierarchy layouts now take these root nodes as input rather than operating directly on JSON data, which helps to provide a cleaner separation between the input data and the computed layout. (For example, use [*node*.copy](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_copy) to isolate layout changes.) It also simplifies the API: rather than each hierarchy layout needing to implement value and sorting accessors, there are now generic [*node*.sum](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_sum) and [*node*.sort](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_sort) methods that work with any hierarchy layout.
+
+The new d3.hierarchy API also provides a richer set of methods for manipulating hierarchical data. For example, to generate an array of all nodes in topological order, use [*node*.descendants](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_descendants); for just leaf nodes, use [*node*.leaves](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_leaves). To highlight the ancestors of a given *node* on mouseover, use [*node*.ancestors](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_ancestors). To generate an array of {source, target} links for a given hierarchy, use [*node*.links](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_links); this replaces *treemap*.links and similar methods on the other layouts. The new [*node*.path](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_path) method replaces d3.layout.bundle; see also [d3.curveBundle](https://github.com/d3/d3-shape/blob/master/README.md#curveBundle) for hierarchical edge bundling.
+
+The hierarchy layouts have been rewritten using new, non-recursive traversal methods ([*node*.each](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_each), [*node*.eachAfter](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_eachAfter) and [*node*.eachBefore](https://github.com/d3/d3-hierarchy/blob/master/README.md#node_eachBefore)), improving performance on large datasets. The d3.tree layout no longer uses a *node*.\_ field to store temporary state during layout.
+
+Treemap tiling is now [extensible](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemap-tiling) via [*treemap*.tile](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemap_tile)! The default squarified tiling algorithm, [d3.treemapSquarify](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemapSquarify), has been completely rewritten, improving performance and fixing bugs in padding and rounding. The *treemap*.sticky method has been replaced with the [d3.treemapResquarify](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemapResquarify), which is identical to d3.treemapSquarify except it performs stable neighbor-preserving updates. The *treemap*.ratio method has been replaced with [*squarify*.ratio](https://github.com/d3/d3-hierarchy/blob/master/README.md#squarify_ratio). And there’s a new [d3.treemapBinary](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemapBinary) for binary treemaps!
+
+Treemap padding has also been improved. The treemap now distinguishes between [outer padding](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemap_paddingOuter) that separates a parent from its children, and [inner padding](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemap_paddingInner) that separates adjacent siblings. You can set the [top-](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemap_paddingTop), [right-](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemap_paddingRight), [bottom-](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemap_paddingBottom) and [left-](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemap_paddingLeft)outer padding separately. There are new examples for the traditional [nested treemap](https://bl.ocks.org/mbostock/911ad09bdead40ec0061) and for Lü and Fogarty’s [cascaded treemap](https://bl.ocks.org/mbostock/f85ffb3a5ac518598043). And there’s a new example demonstrating [d3.nest with d3.treemap](https://bl.ocks.org/mbostock/2838bf53e0e65f369f476afd653663a2).
+
+The space-filling layouts [d3.treemap](https://github.com/d3/d3-hierarchy/blob/master/README.md#treemap) and [d3.partition](https://github.com/d3/d3-hierarchy/blob/master/README.md#partition) now output *x0*, *x1*, *y0*, *y1* on each node instead of *x0*, *dx*, *y0*, *dy*. This improves accuracy by ensuring that the edges of adjacent cells are exactly equal, rather than sometimes being slightly off due to floating point math. The partition layout now supports [rounding](https://github.com/d3/d3-hierarchy/blob/master/README.md#partition_round) and [padding](https://github.com/d3/d3-hierarchy/blob/master/README.md#partition_padding).
+
+The circle-packing layout, [d3.pack](https://github.com/d3/d3-hierarchy/blob/master/README.md#pack), has been completely rewritten to better implement Wang et al.’s algorithm, fixing major bugs and improving results! Welzl’s algorithm is now used to compute the exact [smallest enclosing circle](https://bl.ocks.org/mbostock/29c534ff0b270054a01c) for each parent, rather than the approximate answer used by Wang et al. The 3.x output is shown on the left; 4.0 is shown on the right:
+
+
+
+A non-hierarchical implementation is also available as [d3.packSiblings](https://github.com/d3/d3-hierarchy/blob/master/README.md#packSiblings), and the smallest enclosing circle implementation is available as [d3.packEnclose](https://github.com/d3/d3-hierarchy/blob/master/README.md#packEnclose). [Pack padding](https://github.com/d3/d3-hierarchy/blob/master/README.md#pack_padding) now applies between a parent and its children, as well as between adjacent siblings. In addition, you can now specify padding as a function that is computed dynamically for each parent.
+
+## Internals
+
+The d3.rebind method has been removed. (See the [3.x source](https://github.com/d3/d3/blob/v3.5.17/src/core/rebind.js).) If you want to wrap a getter-setter method, the recommend pattern is to implement a wrapper method and check the return value. For example, given a *component* that uses an internal [*dispatch*](#dispatches-d3-dispatch), *component*.on can rebind *dispatch*.on as follows:
+
+```js
+component.on = function() {
+ var value = dispatch.on.apply(dispatch, arguments);
+ return value === dispatch ? component : value;
+};
+```
+
+The d3.functor method has been removed. (See the [3.x source](https://github.com/d3/d3/blob/v3.5.17/src/core/functor.js).) If you want to promote a constant value to a function, the recommended pattern is to implement a closure that returns the constant value. If desired, you can use a helper method as follows:
+
+```js
+function constant(x) {
+ return function() {
+ return x;
+ };
+}
+```
+
+Given a value *x*, to promote *x* to a function if it is not already:
+
+```js
+var fx = typeof x === "function" ? x : constant(x);
+```
+
+## [Interpolators (d3-interpolate)](https://github.com/d3/d3-interpolate/blob/master/README.md)
+
+The [d3.interpolate](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) method no longer delegates to d3.interpolators, which has been removed; its behavior is now defined by the library. It is now slightly faster in the common case that *b* is a number. It only uses [d3.interpolateRgb](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateRgb) if *b* is a valid CSS color specifier (and not approximately one). And if the end value *b* is null, undefined, true or false, d3.interpolate now returns a constant function which always returns *b*.
+
+The behavior of [d3.interpolateObject](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateObject) and [d3.interpolateArray](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateArray) has changed slightly with respect to properties or elements in the start value *a* that do not exist in the end value *b*: these properties and elements are now ignored, such that the ending value of the interpolator at *t* = 1 is now precisely equal to *b*. So, in 3.x:
+
+```js
+d3.interpolateObject({foo: 2, bar: 1}, {foo: 3})(0.5); // {bar: 1, foo: 2.5} in 3.x
+```
+
+Whereas in 4.0, *a*.bar is ignored:
+
+```js
+d3.interpolateObject({foo: 2, bar: 1}, {foo: 3})(0.5); // {foo: 2.5} in 4.0
+```
+
+If *a* or *b* are undefined or not an object, they are now implicitly converted to the empty object or empty array as appropriate, rather than throwing a TypeError.
+
+The d3.interpolateTransform interpolator has been renamed to [d3.interpolateTransformSvg](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateTransformSvg), and there is a new [d3.interpolateTransformCss](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateTransformCss) to interpolate CSS transforms! This allows [d3-transition](#transitions-d3-transition) to automatically interpolate both the SVG [transform attribute](https://www.w3.org/TR/SVG/coords.html#TransformAttribute) and the CSS [transform style property](https://www.w3.org/TR/css-transforms-1/#transform-property). (Note, however, that only 2D CSS transforms are supported.) The d3.transform method has been removed.
+
+Color space interpolators now interpolate opacity (see [d3-color](#colors-d3-color)) and return rgb(…) or rgba(…) CSS color specifier strings rather than using the RGB hexadecimal format. This is necessary to support opacity interpolation, but is also beneficial because it matches CSS computed values. When a channel in the start color *a* is undefined, color interpolators now use the corresponding channel value from the end color *b*, or *vice versa*. This logic previously applied to some channels (such as saturation in HSL), but now applies to all channels in all color spaces, and is especially useful when interpolating to or from transparent.
+
+There are now “long” versions of cylindrical color space interpolators: [d3.interpolateHslLong](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateHslLong), [d3.interpolateHclLong](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateHclLong) and [d3.interpolateCubehelixLong](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateCubehelixLong). These interpolators use linear interpolation of hue, rather than using the shortest path around the 360° hue circle. See [d3.interpolateRainbow](https://github.com/d3/d3-scale/blob/master/README.md#interpolateRainbow) for an example. The Cubehelix color space is now supported by [d3-color](#colors-d3-color), and so there are now [d3.interpolateCubehelix](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateCubehelix) and [d3.interpolateCubehelixLong](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateCubehelixLong) interpolators.
+
+[Gamma-corrected color interpolation](https://web.archive.org/web/20160112115812/http://www.4p8.com/eric.brasseur/gamma.html) is now supported for both RGB and Cubehelix color spaces as [*interpolate*.gamma](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate_gamma). For example, to interpolate from purple to orange with a gamma of 2.2 in RGB space:
+
+```js
+var interpolate = d3.interpolateRgb.gamma(2.2)("purple", "orange");
+```
+
+There are new interpolators for uniform non-rational [B-splines](https://en.wikipedia.org/wiki/B-spline)! These are useful for smoothly interpolating between an arbitrary sequence of values from *t* = 0 to *t* = 1, such as to generate a smooth color gradient from a discrete set of colors. The [d3.interpolateBasis](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateBasis) and [d3.interpolateBasisClosed](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateBasisClosed) interpolators generate one-dimensional B-splines, while [d3.interpolateRgbBasis](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateRgbBasis) and [d3.interpolateRgbBasisClosed](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateRgbBasisClosed) generate three-dimensional B-splines through RGB color space. These are used by [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) to generate continuous color scales from ColorBrewer’s discrete color schemes, such as [PiYG](https://bl.ocks.org/mbostock/048d21cf747371b11884f75ad896e5a5).
+
+There’s also now a [d3.quantize](https://github.com/d3/d3-interpolate/blob/master/README.md#quantize) method for generating uniformly-spaced discrete samples from a continuous interpolator. This is useful for taking one of the built-in color scales (such as [d3.interpolateViridis](https://github.com/d3/d3-scale/blob/master/README.md#interpolateViridis)) and quantizing it for use with [d3.scaleQuantize](https://github.com/d3/d3-scale/blob/master/README.md#scaleQuantize), [d3.scaleQuantile](https://github.com/d3/d3-scale/blob/master/README.md#scaleQuantile) or [d3.scaleThreshold](https://github.com/d3/d3-scale/blob/master/README.md#scaleThreshold).
+
+## [Paths (d3-path)](https://github.com/d3/d3-path/blob/master/README.md)
+
+The [d3.path](https://github.com/d3/d3-path/blob/master/README.md#path) serializer implements the [CanvasPathMethods API](https://www.w3.org/TR/2dcontext/#canvaspathmethods), allowing you to write code that can render to either Canvas or SVG. For example, given some code that draws to a canvas:
+
+```js
+function drawCircle(context, radius) {
+ context.moveTo(radius, 0);
+ context.arc(0, 0, radius, 0, 2 * Math.PI);
+}
+```
+
+You can render to SVG as follows:
+
+```js
+var context = d3.path();
+drawCircle(context, 40);
+pathElement.setAttribute("d", context.toString());
+```
+
+The path serializer enables [d3-shape](#shapes-d3-shape) to support both Canvas and SVG; see [*line*.context](https://github.com/d3/d3-shape/blob/master/README.md#line_context) and [*area*.context](https://github.com/d3/d3-shape/blob/master/README.md#area_context), for example.
+
+## [Polygons (d3-polygon)](https://github.com/d3/d3-polygon/blob/master/README.md)
+
+There’s no longer a d3.geom.polygon constructor; instead you just pass an array of vertices to the polygon methods. So instead of *polygon*.area and *polygon*.centroid, there’s [d3.polygonArea](https://github.com/d3/d3-polygon/blob/master/README.md#polygonArea) and [d3.polygonCentroid](https://github.com/d3/d3-polygon/blob/master/README.md#polygonCentroid). There are also new [d3.polygonContains](https://github.com/d3/d3-polygon/blob/master/README.md#polygonContains) and [d3.polygonLength](https://github.com/d3/d3-polygon/blob/master/README.md#polygonLength) methods. There’s no longer an equivalent to *polygon*.clip, but if [Sutherland–Hodgman clipping](https://en.wikipedia.org/wiki/Sutherland–Hodgman_algorithm) is needed, please [file a feature request](https://github.com/d3/d3-polygon/issues).
+
+The d3.geom.hull operator has been simplified: instead of an operator with *hull*.x and *hull*.y accessors, there’s just the [d3.polygonHull](https://github.com/d3/d3-polygon/blob/master/README.md#polygonHull) method which takes an array of points and returns the convex hull.
+
+## [Quadtrees (d3-quadtree)](https://github.com/d3/d3-quadtree/blob/master/README.md)
+
+The d3.geom.quadtree method has been replaced by [d3.quadtree](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree). 4.0 removes the concept of quadtree “generators” (configurable functions that build a quadtree from an array of data); there are now just quadtrees, which you can create via d3.quadtree and add data to via [*quadtree*.add](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_add) and [*quadtree*.addAll](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_addAll). This code in 3.x:
+
+```js
+var quadtree = d3.geom.quadtree()
+ .extent([[0, 0], [width, height]])
+ (data);
+```
+
+Can be rewritten in 4.0 as:
+
+```js
+var quadtree = d3.quadtree()
+ .extent([[0, 0], [width, height]])
+ .addAll(data);
+```
+
+The new quadtree implementation is vastly improved! It is no longer recursive, avoiding stack overflows when there are large numbers of coincident points. The internal storage is now more efficient, and the implementation is also faster; constructing a quadtree of 1M normally-distributed points takes about one second in 4.0, as compared to three seconds in 3.x.
+
+The change in [internal *node* structure](https://github.com/d3/d3-quadtree/blob/master/README.md#nodes) affects [*quadtree*.visit](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_visit): use *node*.length to distinguish leaf nodes from internal nodes. For example, to iterate over all data in a quadtree:
+
+```js
+quadtree.visit(function(node) {
+ if (!node.length) {
+ do {
+ console.log(node.data);
+ } while (node = node.next)
+ }
+});
+```
+
+There’s a new [*quadtree*.visitAfter](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_visitAfter) method for visiting nodes in post-order traversal. This feature is used in [d3-force](#forces-d3-force) to implement the [Barnes–Hut approximation](https://en.wikipedia.org/wiki/Barnes–Hut_simulation).
+
+You can now remove data from a quadtree using [*quadtree*.remove](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_remove) and [*quadtree*.removeAll](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_removeAll). When adding data to a quadtree, the quadtree will now expand its extent by repeated doubling if the new point is outside the existing extent of the quadtree. There are also [*quadtree*.extent](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_extent) and [*quadtree*.cover](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_cover) methods for explicitly expanding the extent of the quadtree after creation.
+
+Quadtrees support several new utility methods: [*quadtree*.copy](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_copy) returns a copy of the quadtree sharing the same data; [*quadtree*.data](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_data) generates an array of all data in the quadtree; [*quadtree*.size](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_size) returns the number of data points in the quadtree; and [*quadtree*.root](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_root) returns the root node, which is useful for manual traversal of the quadtree. The [*quadtree*.find](https://github.com/d3/d3-quadtree/blob/master/README.md#quadtree_find) method now takes an optional search radius, which is useful for pointer-based selection in [force-directed graphs](https://bl.ocks.org/mbostock/ad70335eeef6d167bc36fd3c04378048).
+
+## [Queues (d3-queue)](https://github.com/d3/d3-queue/blob/master/README.md)
+
+Formerly known as Queue.js and queue-async, [d3.queue](https://github.com/d3/d3-queue) is now included in the default bundle, making it easy to load data files in parallel. It has been rewritten with fewer closures to improve performance, and there are now stricter checks in place to guarantee well-defined behavior. You can now use instanceof d3.queue and inspect the queue’s internal private state.
+
+## [Random Numbers (d3-random)](https://github.com/d3/d3-random/blob/master/README.md)
+
+Pursuant to the great namespace flattening, the random number generators have new names:
+
+* d3.random.normal ↦ [d3.randomNormal](https://github.com/d3/d3-random/blob/master/README.md#randomNormal)
+* d3.random.logNormal ↦ [d3.randomLogNormal](https://github.com/d3/d3-random/blob/master/README.md#randomLogNormal)
+* d3.random.bates ↦ [d3.randomBates](https://github.com/d3/d3-random/blob/master/README.md#randomBates)
+* d3.random.irwinHall ↦ [d3.randomIrwinHall](https://github.com/d3/d3-random/blob/master/README.md#randomIrwinHall)
+
+There are also new random number generators for [exponential](https://github.com/d3/d3-random/blob/master/README.md#randomExponential) and [uniform](https://github.com/d3/d3-random/blob/master/README.md#randomUniform) distributions. The [normal](https://github.com/d3/d3-random/blob/master/README.md#randomNormal) and [log-normal](https://github.com/d3/d3-random/blob/master/README.md#randomLogNormal) random generators have been optimized.
+
+## [Requests (d3-request)](https://github.com/d3/d3-request/blob/master/README.md)
+
+The d3.xhr method has been renamed to [d3.request](https://github.com/d3/d3-request/blob/master/README.md#request). Basic authentication is now supported using [*request*.user](https://github.com/d3/d3-request/blob/master/README.md#request_user) and [*request*.password](https://github.com/d3/d3-request/blob/master/README.md#request_password). You can now configure a timeout using [*request*.timeout](https://github.com/d3/d3-request/blob/master/README.md#request_timeout).
+
+If an error occurs, the corresponding [ProgressEvent](https://xhr.spec.whatwg.org/#interface-progressevent) of type “error” is now passed to the error listener, rather than the [XMLHttpRequest](https://xhr.spec.whatwg.org/#interface-xmlhttprequest). Likewise, the ProgressEvent is passed to progress event listeners, rather than using [d3.event](https://github.com/d3/d3-selection/blob/master/README.md#event). If [d3.xml](https://github.com/d3/d3-request/blob/master/README.md#xml) encounters an error parsing XML, this error is now reported to error listeners rather than returning a null response.
+
+The [d3.request](https://github.com/d3/d3-request/blob/master/README.md#request), [d3.text](https://github.com/d3/d3-request/blob/master/README.md#text) and [d3.xml](https://github.com/d3/d3-request/blob/master/README.md#xml) methods no longer take an optional mime type as the second argument; use [*request*.mimeType](https://github.com/d3/d3-request/blob/master/README.md#request_mimeType) instead. For example:
+
+```js
+d3.xml("file.svg").mimeType("image/svg+xml").get(function(error, svg) {
+ …
+});
+```
+
+With the exception of [d3.html](https://github.com/d3/d3-request/blob/master/README.md#html) and [d3.xml](https://github.com/d3/d3-request/blob/master/README.md#xml), Node is now supported via [node-XMLHttpRequest](https://github.com/driverdan/node-XMLHttpRequest).
+
+## [Scales (d3-scale)](https://github.com/d3/d3-scale/blob/master/README.md)
+
+Pursuant to the great namespace flattening:
+
+* d3.scale.linear ↦ [d3.scaleLinear](https://github.com/d3/d3-scale/blob/master/README.md#scaleLinear)
+* d3.scale.sqrt ↦ [d3.scaleSqrt](https://github.com/d3/d3-scale/blob/master/README.md#scaleSqrt)
+* d3.scale.pow ↦ [d3.scalePow](https://github.com/d3/d3-scale/blob/master/README.md#scalePow)
+* d3.scale.log ↦ [d3.scaleLog](https://github.com/d3/d3-scale/blob/master/README.md#scaleLog)
+* d3.scale.quantize ↦ [d3.scaleQuantize](https://github.com/d3/d3-scale/blob/master/README.md#scaleQuantize)
+* d3.scale.threshold ↦ [d3.scaleThreshold](https://github.com/d3/d3-scale/blob/master/README.md#scaleThreshold)
+* d3.scale.quantile ↦ [d3.scaleQuantile](https://github.com/d3/d3-scale/blob/master/README.md#scaleQuantile)
+* d3.scale.identity ↦ [d3.scaleIdentity](https://github.com/d3/d3-scale/blob/master/README.md#scaleIdentity)
+* d3.scale.ordinal ↦ [d3.scaleOrdinal](https://github.com/d3/d3-scale/blob/master/README.md#scaleOrdinal)
+* d3.time.scale ↦ [d3.scaleTime](https://github.com/d3/d3-scale/blob/master/README.md#scaleTime)
+* d3.time.scale.utc ↦ [d3.scaleUtc](https://github.com/d3/d3-scale/blob/master/README.md#scaleUtc)
+
+Scales now generate ticks in the same order as the domain: if you have a descending domain, you now get descending ticks. This change affects the order of tick elements generated by [axes](#axes-d3-axis). For example:
+
+```js
+d3.scaleLinear().domain([10, 0]).ticks(5); // [10, 8, 6, 4, 2, 0]
+```
+
+[Log tick formatting](https://github.com/d3/d3-scale/blob/master/README.md#log_tickFormat) now assumes a default *count* of ten, not Infinity, if not specified. Log scales with domains that span many powers (such as from 1e+3 to 1e+29) now return only one [tick](https://github.com/d3/d3-scale/blob/master/README.md#log_ticks) per power rather than returning *base* ticks per power. Non-linear quantitative scales are slightly more accurate.
+
+You can now control whether an ordinal scale’s domain is implicitly extended when the scale is passed a value that is not already in its domain. By default, [*ordinal*.unknown](https://github.com/d3/d3-scale/blob/master/README.md#ordinal_unknown) is [d3.scaleImplicit](https://github.com/d3/d3-scale/blob/master/README.md#scaleImplicit), causing unknown values to be added to the domain:
+
+```js
+var x = d3.scaleOrdinal()
+ .domain([0, 1])
+ .range(["red", "green", "blue"]);
+
+x.domain(); // [0, 1]
+x(2); // "blue"
+x.domain(); // [0, 1, 2]
+```
+
+By setting *ordinal*.unknown, you instead define the output value for unknown inputs. This is particularly useful for choropleth maps where you want to assign a color to missing data.
+
+```js
+var x = d3.scaleOrdinal()
+ .domain([0, 1])
+ .range(["red", "green", "blue"])
+ .unknown(undefined);
+
+x.domain(); // [0, 1]
+x(2); // undefined
+x.domain(); // [0, 1]
+```
+
+The *ordinal*.rangeBands and *ordinal*.rangeRoundBands methods have been replaced with a new subclass of ordinal scale: [band scales](https://github.com/d3/d3-scale/blob/master/README.md#band-scales). The following code in 3.x:
+
+```js
+var x = d3.scale.ordinal()
+ .domain(["a", "b", "c"])
+ .rangeBands([0, width]);
+```
+
+Is equivalent to this in 4.0:
+
+```js
+var x = d3.scaleBand()
+ .domain(["a", "b", "c"])
+ .range([0, width]);
+```
+
+The new [*band*.padding](https://github.com/d3/d3-scale/blob/master/README.md#band_padding), [*band*.paddingInner](https://github.com/d3/d3-scale/blob/master/README.md#band_paddingInner) and [*band*.paddingOuter](https://github.com/d3/d3-scale/blob/master/README.md#band_paddingOuter) methods replace the optional arguments to *ordinal*.rangeBands. The new [*band*.bandwidth](https://github.com/d3/d3-scale/blob/master/README.md#band_bandwidth) and [*band*.step](https://github.com/d3/d3-scale/blob/master/README.md#band_step) methods replace *ordinal*.rangeBand. There’s also a new [*band*.align](https://github.com/d3/d3-scale/blob/master/README.md#band_align) method which you can use to control how the extra space outside the bands is distributed, say to shift columns closer to the *y*-axis.
+
+Similarly, the *ordinal*.rangePoints and *ordinal*.rangeRoundPoints methods have been replaced with a new subclass of ordinal scale: [point scales](https://github.com/d3/d3-scale/blob/master/README.md#point-scales). The following code in 3.x:
+
+```js
+var x = d3.scale.ordinal()
+ .domain(["a", "b", "c"])
+ .rangePoints([0, width]);
+```
+
+Is equivalent to this in 4.0:
+
+```js
+var x = d3.scalePoint()
+ .domain(["a", "b", "c"])
+ .range([0, width]);
+```
+
+The new [*point*.padding](https://github.com/d3/d3-scale/blob/master/README.md#point_padding) method replaces the optional *padding* argument to *ordinal*.rangePoints. Like *ordinal*.rangeBand with *ordinal*.rangePoints, the [*point*.bandwidth](https://github.com/d3/d3-scale/blob/master/README.md#point_bandwidth) method always returns zero; a new [*point*.step](https://github.com/d3/d3-scale/blob/master/README.md#point_step) method returns the interval between adjacent points.
+
+The [ordinal scale constructor](https://github.com/d3/d3-scale/blob/master/README.md#ordinal-scales) now takes an optional *range* for a shorter alternative to [*ordinal*.range](https://github.com/d3/d3-scale/blob/master/README.md#ordinal_range). This is especially useful now that the categorical color scales have been changed to simple arrays of colors rather than specialized ordinal scale constructors:
+
+* d3.scale.category10 ↦ [d3.schemeCategory10](https://github.com/d3/d3-scale/blob/master/README.md#schemeCategory10)
+* d3.scale.category20 ↦ [d3.schemeCategory20](https://github.com/d3/d3-scale/blob/master/README.md#schemeCategory20)
+* d3.scale.category20b ↦ [d3.schemeCategory20b](https://github.com/d3/d3-scale/blob/master/README.md#schemeCategory20b)
+* d3.scale.category20c ↦ [d3.schemeCategory20c](https://github.com/d3/d3-scale/blob/master/README.md#schemeCategory20c)
+
+The following code in 3.x:
+
+```js
+var color = d3.scale.category10();
+```
+
+Is equivalent to this in 4.0:
+
+```js
+var color = d3.scaleOrdinal(d3.schemeCategory10);
+```
+
+[Sequential scales](https://github.com/d3/d3-scale/blob/master/README.md#scaleSequential), are a new class of scales with a fixed output [interpolator](https://github.com/d3/d3-scale/blob/master/README.md#sequential_interpolator) instead of a [range](https://github.com/d3/d3-scale/blob/master/README.md#continuous_range). Typically these scales are used to implement continuous sequential or diverging color schemes. Inspired by Matplotlib’s new [perceptually-motived colormaps](https://bids.github.io/colormap/), 4.0 now features [viridis](https://github.com/d3/d3-scale/blob/master/README.md#interpolateViridis), [inferno](https://github.com/d3/d3-scale/blob/master/README.md#interpolateInferno), [magma](https://github.com/d3/d3-scale/blob/master/README.md#interpolateMagma), [plasma](https://github.com/d3/d3-scale/blob/master/README.md#interpolatePlasma) interpolators for use with sequential scales. Using [d3.quantize](https://github.com/d3/d3-interpolate/blob/master/README.md#quantize), these interpolators can also be applied to [quantile](https://github.com/d3/d3-scale/blob/master/README.md#quantile-scales), [quantize](https://github.com/d3/d3-scale/blob/master/README.md#quantize-scales) and [threshold](https://github.com/d3/d3-scale/blob/master/README.md#threshold-scales) scales.
+
+[
](https://github.com/d3/d3-scale/blob/master/README.md#interpolateViridis)
+[
](https://github.com/d3/d3-scale/blob/master/README.md#interpolateInferno)
+[
](https://github.com/d3/d3-scale/blob/master/README.md#interpolateMagma)
+[
](https://github.com/d3/d3-scale/blob/master/README.md#interpolatePlasma)
+
+4.0 also ships new Cubehelix schemes, including [Dave Green’s default](https://github.com/d3/d3-scale/blob/master/README.md#interpolateCubehelixDefault) and a [cyclical rainbow](https://github.com/d3/d3-scale/blob/master/README.md#interpolateRainbow) inspired by [Matteo Niccoli](https://mycarta.wordpress.com/2013/02/21/perceptual-rainbow-palette-the-method/):
+
+[
](https://github.com/d3/d3-scale/blob/master/README.md#interpolateCubehelixDefault)
+[
](https://github.com/d3/d3-scale/blob/master/README.md#interpolateRainbow)
+[
](https://github.com/d3/d3-scale/blob/master/README.md#interpolateWarm)
+[
](https://github.com/d3/d3-scale/blob/master/README.md#interpolateCool)
+
+For even more sequential and categorical color schemes, see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic).
+
+For an introduction to scales, see [Introducing d3-scale](https://medium.com/@mbostock/introducing-d3-scale-61980c51545f).
+
+## [Selections (d3-selection)](https://github.com/d3/d3-selection/blob/master/README.md)
+
+Selections no longer subclass Array using [prototype chain injection](http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/#wrappers_prototype_chain_injection); they are now plain objects, improving performance. The internal fields (*selection*.\_groups, *selection*.\_parents) are private; please use the documented public API to manipulate selections. The new [*selection*.nodes](https://github.com/d3/d3-selection/blob/master/README.md#selection_nodes) method generates an array of all nodes in a selection.
+
+Selections are now immutable: the elements and parents in a selection never change. (The elements’ attributes and content will of course still be modified!) The [*selection*.sort](https://github.com/d3/d3-selection/blob/master/README.md#selection_sort) and [*selection*.data](https://github.com/d3/d3-selection/blob/master/README.md#selection_data) methods now return new selections rather than modifying the selection in-place. In addition, [*selection*.append](https://github.com/d3/d3-selection/blob/master/README.md#selection_append) no longer merges entering nodes into the update selection; use [*selection*.merge](https://github.com/d3/d3-selection/blob/master/README.md#selection_merge) to combine enter and update after a data join. For example, the following [general update pattern](https://bl.ocks.org/mbostock/a8a5baa4c4a470cda598) in 3.x:
+
+```js
+var circle = svg.selectAll("circle").data(data) // UPDATE
+ .style("fill", "blue");
+
+circle.exit().remove(); // EXIT
+
+circle.enter().append("circle") // ENTER; modifies UPDATE! 🌶
+ .style("fill", "green");
+
+circle // ENTER + UPDATE
+ .style("stroke", "black");
+```
+
+Would be rewritten in 4.0 as:
+
+```js
+var circle = svg.selectAll("circle").data(data) // UPDATE
+ .style("fill", "blue");
+
+circle.exit().remove(); // EXIT
+
+circle.enter().append("circle") // ENTER
+ .style("fill", "green")
+ .merge(circle) // ENTER + UPDATE
+ .style("stroke", "black");
+```
+
+This change is discussed further in [What Makes Software Good](https://medium.com/@mbostock/what-makes-software-good-943557f8a488).
+
+In 3.x, the [*selection*.enter](https://github.com/d3/d3-selection/blob/master/README.md#selection_enter) and [*selection*.exit](https://github.com/d3/d3-selection/blob/master/README.md#selection_exit) methods were undefined until you called *selection*.data, resulting in a TypeError if you attempted to access them. In 4.0, now they simply return the empty selection if the selection has not been joined to data.
+
+In 3.x, [*selection*.append](https://github.com/d3/d3-selection/blob/master/README.md#selection_append) would always append the new element as the last child of its parent. A little-known trick was to use [*selection*.insert](https://github.com/d3/d3-selection/blob/master/README.md#selection_insert) without specifying a *before* selector when entering nodes, causing the entering nodes to be inserted before the following element in the update selection. In 4.0, this is now the default behavior of *selection*.append; if you do not specify a *before* selector to *selection*.insert, the inserted element is appended as the last child. This change makes the general update pattern preserve the relative order of elements and data. For example, given the following DOM:
+
+```html
+
+
+
+
+Each curve type can define its own named parameters, replacing *line*.tension and *area*.tension. For example, Catmull–Rom splines are parameterized using [*catmullRom*.alpha](https://github.com/d3/d3-shape/blob/master/README.md#curveCatmullRom_alpha) and defaults to 0.5, which corresponds to a centripetal spline that avoids self-intersections and overshoot. For a uniform Catmull–Rom spline instead:
+
+```js
+var line = d3.line()
+ .curve(d3.curveCatmullRom.alpha(0));
+```
+
+4.0 fixes the interpretation of the cardinal spline *tension* parameter, which is now specified as [*cardinal*.tension](https://github.com/d3/d3-shape/blob/master/README.md#curveCardinal_tension) and defaults to zero for a uniform Catmull–Rom spline; a tension of one produces a linear curve. The first and last segments of basis and cardinal curves have also been fixed! The undocumented *interpolate*.reverse field has been removed. Curves can define different behavior for toplines and baselines by counting the sequence of [*curve*.lineStart](https://github.com/d3/d3-shape/blob/master/README.md#curve_lineStart) within [*curve*.areaStart](https://github.com/d3/d3-shape/blob/master/README.md#curve_areaStart). See the [d3.curveStep implementation](https://github.com/d3/d3-shape/blob/master/src/curve/step.js) for an example.
+
+4.0 fixes numerous bugs in the monotone curve implementation, and introduces [d3.curveMonotoneY](https://github.com/d3/d3-shape/blob/master/README.md#curveMonotoneY); this is like d3.curveMonotoneX, except it requires that the input points are monotone in *y* rather than *x*, such as for a vertically-oriented line chart. The new [d3.curveNatural](https://github.com/d3/d3-shape/blob/master/README.md#curveNatural) produces a [natural cubic spline](http://mathworld.wolfram.com/CubicSpline.html). The default [β](https://github.com/d3/d3-shape/blob/master/README.md#bundle_beta) for [d3.curveBundle](https://github.com/d3/d3-shape/blob/master/README.md#curveBundle) is now 0.85, rather than 0.7, matching the values used by [Holten](https://www.win.tue.nl/vis1/home/dholten/papers/bundles_infovis.pdf). 4.0 also has a more robust implementation of arc padding; see [*arc*.padAngle](https://github.com/d3/d3-shape/blob/master/README.md#arc_padAngle) and [*arc*.padRadius](https://github.com/d3/d3-shape/blob/master/README.md#arc_padRadius).
+
+4.0 introduces a new symbol type API. Symbol types are passed to [*symbol*.type](https://github.com/d3/d3-shape/blob/master/README.md#symbol_type) in place of strings. The equivalents are:
+
+* circle ↦ [d3.symbolCircle](https://github.com/d3/d3-shape/blob/master/README.md#symbolCircle)
+* cross ↦ [d3.symbolCross](https://github.com/d3/d3-shape/blob/master/README.md#symbolCross)
+* diamond ↦ [d3.symbolDiamond](https://github.com/d3/d3-shape/blob/master/README.md#symbolDiamond)
+* square ↦ [d3.symbolSquare](https://github.com/d3/d3-shape/blob/master/README.md#symbolSquare)
+* triangle-down ↦ REMOVED
+* triangle-up ↦ [d3.symbolTriangle](https://github.com/d3/d3-shape/blob/master/README.md#symbolTriangle)
+* ADDED ↦ [d3.symbolStar](https://github.com/d3/d3-shape/blob/master/README.md#symbolStar)
+* ADDED ↦ [d3.symbolWye](https://github.com/d3/d3-shape/blob/master/README.md#symbolWye)
+
+The full set of symbol types is now:
+
+





+
+Lastly, 4.0 overhauls the stack layout API, replacing d3.layout.stack with [d3.stack](https://github.com/d3/d3-shape/blob/master/README.md#stacks). The stack generator no longer needs an *x*-accessor. In addition, the API has been simplified: the *stack* generator now accepts tabular input, such as this array of objects:
+
+```js
+var data = [
+ {month: new Date(2015, 0, 1), apples: 3840, bananas: 1920, cherries: 960, dates: 400},
+ {month: new Date(2015, 1, 1), apples: 1600, bananas: 1440, cherries: 960, dates: 400},
+ {month: new Date(2015, 2, 1), apples: 640, bananas: 960, cherries: 640, dates: 400},
+ {month: new Date(2015, 3, 1), apples: 320, bananas: 480, cherries: 640, dates: 400}
+];
+```
+
+To generate the stack layout, first define a stack generator, and then apply it to the data:
+
+```js
+var stack = d3.stack()
+ .keys(["apples", "bananas", "cherries", "dates"])
+ .order(d3.stackOrderNone)
+ .offset(d3.stackOffsetNone);
+
+var series = stack(data);
+```
+
+The resulting array has one element per *series*. Each series has one point per month, and each point has a lower and upper value defining the baseline and topline:
+
+```js
+[
+ [[ 0, 3840], [ 0, 1600], [ 0, 640], [ 0, 320]], // apples
+ [[3840, 5760], [1600, 3040], [ 640, 1600], [ 320, 800]], // bananas
+ [[5760, 6720], [3040, 4000], [1600, 2240], [ 800, 1440]], // cherries
+ [[6720, 7120], [4000, 4400], [2240, 2640], [1440, 1840]], // dates
+]
+```
+
+Each series in then typically passed to an [area generator](https://github.com/d3/d3-shape/blob/master/README.md#areas) to render an area chart, or used to construct rectangles for a bar chart. Stack generators no longer modify the input data, so *stack*.out has been removed.
+
+For an introduction to shapes, see [Introducing d3-shape](https://medium.com/@mbostock/introducing-d3-shape-73f8367e6d12).
+
+## [Time Formats (d3-time-format)](https://github.com/d3/d3-time-format/blob/master/README.md)
+
+Pursuant to the great namespace flattening, the format constructors have new names:
+
+* d3.time.format ↦ [d3.timeFormat](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormat)
+* d3.time.format.utc ↦ [d3.utcFormat](https://github.com/d3/d3-time-format/blob/master/README.md#utcFormat)
+* d3.time.format.iso ↦ [d3.isoFormat](https://github.com/d3/d3-time-format/blob/master/README.md#isoFormat)
+
+The *format*.parse method has also been removed in favor of separate [d3.timeParse](https://github.com/d3/d3-time-format/blob/master/README.md#timeParse), [d3.utcParse](https://github.com/d3/d3-time-format/blob/master/README.md#utcParse) and [d3.isoParse](https://github.com/d3/d3-time-format/blob/master/README.md#isoParse) parser constructors. Thus, this code in 3.x:
+
+```js
+var parseTime = d3.time.format("%c").parse;
+```
+
+Can be rewritten in 4.0 as:
+
+```js
+var parseTime = d3.timeParse("%c");
+```
+
+The multi-scale time format d3.time.format.multi has been replaced by [d3.scaleTime](https://github.com/d3/d3-scale/blob/master/README.md#scaleTime)’s [tick format](https://github.com/d3/d3-scale/blob/master/README.md#time_tickFormat). Time formats now coerce inputs to dates, and time parsers coerce inputs to strings. The `%Z` directive now allows more flexible parsing of time zone offsets, such as `-0700`, `-07:00`, `-07`, and `Z`. The `%p` directive is now parsed correctly when the locale’s period name is longer than two characters (*e.g.*, “a.m.”).
+
+The default U.S. English locale now uses 12-hour time and a more concise representation of the date. This aligns with local convention and is consistent with [*date*.toLocaleString](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString) in Chrome, Firefox and Node:
+
+```js
+var now = new Date;
+d3.timeFormat("%c")(new Date); // "6/23/2016, 2:01:33 PM"
+d3.timeFormat("%x")(new Date); // "6/23/2016"
+d3.timeFormat("%X")(new Date); // "2:01:38 PM"
+```
+
+You can now set the default locale using [d3.timeFormatDefaultLocale](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatDefaultLocale)! The locales are published as [JSON](https://github.com/d3/d3-request/blob/master/README.md#json) to [npm](https://unpkg.com/d3-time-format/locale/).
+
+The performance of time formatting and parsing has been improved, and the UTC formatter and parser have a cleaner implementation (that avoids temporarily overriding the Date global).
+
+## [Time Intervals (d3-time)](https://github.com/d3/d3-time/blob/master/README.md)
+
+Pursuant to the great namespace flattening, the local time intervals have been renamed:
+
+* ADDED ↦ [d3.timeMillisecond](https://github.com/d3/d3-time/blob/master/README.md#timeMillisecond)
+* d3.time.second ↦ [d3.timeSecond](https://github.com/d3/d3-time/blob/master/README.md#timeSecond)
+* d3.time.minute ↦ [d3.timeMinute](https://github.com/d3/d3-time/blob/master/README.md#timeMinute)
+* d3.time.hour ↦ [d3.timeHour](https://github.com/d3/d3-time/blob/master/README.md#timeHour)
+* d3.time.day ↦ [d3.timeDay](https://github.com/d3/d3-time/blob/master/README.md#timeDay)
+* d3.time.sunday ↦ [d3.timeSunday](https://github.com/d3/d3-time/blob/master/README.md#timeSunday)
+* d3.time.monday ↦ [d3.timeMonday](https://github.com/d3/d3-time/blob/master/README.md#timeMonday)
+* d3.time.tuesday ↦ [d3.timeTuesday](https://github.com/d3/d3-time/blob/master/README.md#timeTuesday)
+* d3.time.wednesday ↦ [d3.timeWednesday](https://github.com/d3/d3-time/blob/master/README.md#timeWednesday)
+* d3.time.thursday ↦ [d3.timeThursday](https://github.com/d3/d3-time/blob/master/README.md#timeThursday)
+* d3.time.friday ↦ [d3.timeFriday](https://github.com/d3/d3-time/blob/master/README.md#timeFriday)
+* d3.time.saturday ↦ [d3.timeSaturday](https://github.com/d3/d3-time/blob/master/README.md#timeSaturday)
+* d3.time.week ↦ [d3.timeWeek](https://github.com/d3/d3-time/blob/master/README.md#timeWeek)
+* d3.time.month ↦ [d3.timeMonth](https://github.com/d3/d3-time/blob/master/README.md#timeMonth)
+* d3.time.year ↦ [d3.timeYear](https://github.com/d3/d3-time/blob/master/README.md#timeYear)
+
+The UTC time intervals have likewise been renamed:
+
+* ADDED ↦ [d3.utcMillisecond](https://github.com/d3/d3-time/blob/master/README.md#utcMillisecond)
+* d3.time.second.utc ↦ [d3.utcSecond](https://github.com/d3/d3-time/blob/master/README.md#utcSecond)
+* d3.time.minute.utc ↦ [d3.utcMinute](https://github.com/d3/d3-time/blob/master/README.md#utcMinute)
+* d3.time.hour.utc ↦ [d3.utcHour](https://github.com/d3/d3-time/blob/master/README.md#utcHour)
+* d3.time.day.utc ↦ [d3.utcDay](https://github.com/d3/d3-time/blob/master/README.md#utcDay)
+* d3.time.sunday.utc ↦ [d3.utcSunday](https://github.com/d3/d3-time/blob/master/README.md#utcSunday)
+* d3.time.monday.utc ↦ [d3.utcMonday](https://github.com/d3/d3-time/blob/master/README.md#utcMonday)
+* d3.time.tuesday.utc ↦ [d3.utcTuesday](https://github.com/d3/d3-time/blob/master/README.md#utcTuesday)
+* d3.time.wednesday.utc ↦ [d3.utcWednesday](https://github.com/d3/d3-time/blob/master/README.md#utcWednesday)
+* d3.time.thursday.utc ↦ [d3.utcThursday](https://github.com/d3/d3-time/blob/master/README.md#utcThursday)
+* d3.time.friday.utc ↦ [d3.utcFriday](https://github.com/d3/d3-time/blob/master/README.md#utcFriday)
+* d3.time.saturday.utc ↦ [d3.utcSaturday](https://github.com/d3/d3-time/blob/master/README.md#utcSaturday)
+* d3.time.week.utc ↦ [d3.utcWeek](https://github.com/d3/d3-time/blob/master/README.md#utcWeek)
+* d3.time.month.utc ↦ [d3.utcMonth](https://github.com/d3/d3-time/blob/master/README.md#utcMonth)
+* d3.time.year.utc ↦ [d3.utcYear](https://github.com/d3/d3-time/blob/master/README.md#utcYear)
+
+The local time range aliases have been renamed:
+
+* d3.time.seconds ↦ [d3.timeSeconds](https://github.com/d3/d3-time/blob/master/README.md#timeSeconds)
+* d3.time.minutes ↦ [d3.timeMinutes](https://github.com/d3/d3-time/blob/master/README.md#timeMinutes)
+* d3.time.hours ↦ [d3.timeHours](https://github.com/d3/d3-time/blob/master/README.md#timeHours)
+* d3.time.days ↦ [d3.timeDays](https://github.com/d3/d3-time/blob/master/README.md#timeDays)
+* d3.time.sundays ↦ [d3.timeSundays](https://github.com/d3/d3-time/blob/master/README.md#timeSundays)
+* d3.time.mondays ↦ [d3.timeMondays](https://github.com/d3/d3-time/blob/master/README.md#timeMondays)
+* d3.time.tuesdays ↦ [d3.timeTuesdays](https://github.com/d3/d3-time/blob/master/README.md#timeTuesdays)
+* d3.time.wednesdays ↦ [d3.timeWednesdays](https://github.com/d3/d3-time/blob/master/README.md#timeWednesdays)
+* d3.time.thursdays ↦ [d3.timeThursdays](https://github.com/d3/d3-time/blob/master/README.md#timeThursdays)
+* d3.time.fridays ↦ [d3.timeFridays](https://github.com/d3/d3-time/blob/master/README.md#timeFridays)
+* d3.time.saturdays ↦ [d3.timeSaturdays](https://github.com/d3/d3-time/blob/master/README.md#timeSaturdays)
+* d3.time.weeks ↦ [d3.timeWeeks](https://github.com/d3/d3-time/blob/master/README.md#timeWeeks)
+* d3.time.months ↦ [d3.timeMonths](https://github.com/d3/d3-time/blob/master/README.md#timeMonths)
+* d3.time.years ↦ [d3.timeYears](https://github.com/d3/d3-time/blob/master/README.md#timeYears)
+
+The UTC time range aliases have been renamed:
+
+* d3.time.seconds.utc ↦ [d3.utcSeconds](https://github.com/d3/d3-time/blob/master/README.md#utcSeconds)
+* d3.time.minutes.utc ↦ [d3.utcMinutes](https://github.com/d3/d3-time/blob/master/README.md#utcMinutes)
+* d3.time.hours.utc ↦ [d3.utcHours](https://github.com/d3/d3-time/blob/master/README.md#utcHours)
+* d3.time.days.utc ↦ [d3.utcDays](https://github.com/d3/d3-time/blob/master/README.md#utcDays)
+* d3.time.sundays.utc ↦ [d3.utcSundays](https://github.com/d3/d3-time/blob/master/README.md#utcSundays)
+* d3.time.mondays.utc ↦ [d3.utcMondays](https://github.com/d3/d3-time/blob/master/README.md#utcMondays)
+* d3.time.tuesdays.utc ↦ [d3.utcTuesdays](https://github.com/d3/d3-time/blob/master/README.md#utcTuesdays)
+* d3.time.wednesdays.utc ↦ [d3.utcWednesdays](https://github.com/d3/d3-time/blob/master/README.md#utcWednesdays)
+* d3.time.thursdays.utc ↦ [d3.utcThursdays](https://github.com/d3/d3-time/blob/master/README.md#utcThursdays)
+* d3.time.fridays.utc ↦ [d3.utcFridays](https://github.com/d3/d3-time/blob/master/README.md#utcFridays)
+* d3.time.saturdays.utc ↦ [d3.utcSaturdays](https://github.com/d3/d3-time/blob/master/README.md#utcSaturdays)
+* d3.time.weeks.utc ↦ [d3.utcWeeks](https://github.com/d3/d3-time/blob/master/README.md#utcWeeks)
+* d3.time.months.utc ↦ [d3.utcMonths](https://github.com/d3/d3-time/blob/master/README.md#utcMonths)
+* d3.time.years.utc ↦ [d3.utcYears](https://github.com/d3/d3-time/blob/master/README.md#utcYears)
+
+The behavior of [*interval*.range](https://github.com/d3/d3-time/blob/master/README.md#interval_range) (and the convenience aliases such as [d3.timeDays](https://github.com/d3/d3-time/blob/master/README.md#timeDays)) has been changed when *step* is greater than one. Rather than filtering the returned dates using the field number, *interval*.range now behaves like [d3.range](https://github.com/d3/d3-array/blob/master/README.md#range): it simply skips, returning every *step*th date. For example, the following code in 3.x returns only odd days of the month:
+
+```js
+d3.time.days(new Date(2016, 4, 28), new Date(2016, 5, 5), 2);
+// [Sun May 29 2016 00:00:00 GMT-0700 (PDT),
+// Tue May 31 2016 00:00:00 GMT-0700 (PDT),
+// Wed Jun 01 2016 00:00:00 GMT-0700 (PDT),
+// Fri Jun 03 2016 00:00:00 GMT-0700 (PDT)]
+```
+
+Note the returned array of dates does not start on the *start* date because May 28 is even. Also note that May 31 and June 1 are one day apart, not two! The behavior of d3.timeDays in 4.0 is probably closer to what you expect:
+
+```js
+d3.timeDays(new Date(2016, 4, 28), new Date(2016, 5, 5), 2);
+// [Sat May 28 2016 00:00:00 GMT-0700 (PDT),
+// Mon May 30 2016 00:00:00 GMT-0700 (PDT),
+// Wed Jun 01 2016 00:00:00 GMT-0700 (PDT),
+// Fri Jun 03 2016 00:00:00 GMT-0700 (PDT)]
+```
+
+If you want a filtered view of a time interval (say to guarantee that two overlapping ranges are consistent, such as when generating [time scale ticks](https://github.com/d3/d3-scale/blob/master/README.md#time_ticks)), you can use the new [*interval*.every](https://github.com/d3/d3-time/blob/master/README.md#interval_every) method or its more general cousin [*interval*.filter](https://github.com/d3/d3-time/blob/master/README.md#interval_filter):
+
+```js
+d3.timeDay.every(2).range(new Date(2016, 4, 28), new Date(2016, 5, 5));
+// [Sun May 29 2016 00:00:00 GMT-0700 (PDT),
+// Tue May 31 2016 00:00:00 GMT-0700 (PDT),
+// Wed Jun 01 2016 00:00:00 GMT-0700 (PDT),
+// Fri Jun 03 2016 00:00:00 GMT-0700 (PDT)]
+```
+
+Time intervals now expose an [*interval*.count](https://github.com/d3/d3-time/blob/master/README.md#interval_count) method for counting the number of interval boundaries after a *start* date and before or equal to an *end* date. This replaces d3.time.dayOfYear and related methods in 3.x. For example, this code in 3.x:
+
+```js
+var now = new Date;
+d3.time.dayOfYear(now); // 165
+```
+
+Can be rewritten in 4.0 as:
+
+```js
+var now = new Date;
+d3.timeDay.count(d3.timeYear(now), now); // 165
+```
+
+Likewise, in place of 3.x’s d3.time.weekOfYear, in 4.0 you would say:
+
+```js
+d3.timeWeek.count(d3.timeYear(now), now); // 24
+```
+
+The new *interval*.count is of course more general. For example, you can use it to compute hour-of-week for a heatmap:
+
+```js
+d3.timeHour.count(d3.timeWeek(now), now); // 64
+```
+
+Here are all the equivalences from 3.x to 4.0:
+
+* d3.time.dayOfYear ↦ [d3.timeDay](https://github.com/d3/d3-time/blob/master/README.md#timeDay).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.sundayOfYear ↦ [d3.timeSunday](https://github.com/d3/d3-time/blob/master/README.md#timeSunday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.mondayOfYear ↦ [d3.timeMonday](https://github.com/d3/d3-time/blob/master/README.md#timeMonday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.tuesdayOfYear ↦ [d3.timeTuesday](https://github.com/d3/d3-time/blob/master/README.md#timeTuesday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.wednesdayOfYear ↦ [d3.timeWednesday](https://github.com/d3/d3-time/blob/master/README.md#timeWednesday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.thursdayOfYear ↦ [d3.timeThursday](https://github.com/d3/d3-time/blob/master/README.md#timeThursday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.fridayOfYear ↦ [d3.timeFriday](https://github.com/d3/d3-time/blob/master/README.md#timeFriday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.saturdayOfYear ↦ [d3.timeSaturday](https://github.com/d3/d3-time/blob/master/README.md#timeSaturday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.weekOfYear ↦ [d3.timeWeek](https://github.com/d3/d3-time/blob/master/README.md#timeWeek).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.dayOfYear.utc ↦ [d3.utcDay](https://github.com/d3/d3-time/blob/master/README.md#utcDay).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.sundayOfYear.utc ↦ [d3.utcSunday](https://github.com/d3/d3-time/blob/master/README.md#utcSunday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.mondayOfYear.utc ↦ [d3.utcMonday](https://github.com/d3/d3-time/blob/master/README.md#utcMonday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.tuesdayOfYear.utc ↦ [d3.utcTuesday](https://github.com/d3/d3-time/blob/master/README.md#utcTuesday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.wednesdayOfYear.utc ↦ [d3.utcWednesday](https://github.com/d3/d3-time/blob/master/README.md#utcWednesday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.thursdayOfYear.utc ↦ [d3.utcThursday](https://github.com/d3/d3-time/blob/master/README.md#utcThursday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.fridayOfYear.utc ↦ [d3.utcFriday](https://github.com/d3/d3-time/blob/master/README.md#utcFriday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.saturdayOfYear.utc ↦ [d3.utcSaturday](https://github.com/d3/d3-time/blob/master/README.md#utcSaturday).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+* d3.time.weekOfYear.utc ↦ [d3.utcWeek](https://github.com/d3/d3-time/blob/master/README.md#utcWeek).[count](https://github.com/d3/d3-time/blob/master/README.md#interval_count)
+
+D3 4.0 now also lets you define custom time intervals using [d3.timeInterval](https://github.com/d3/d3-time/blob/master/README.md#timeInterval). The [d3.timeYear](https://github.com/d3/d3-time/blob/master/README.md#timeYear), [d3.utcYear](https://github.com/d3/d3-time/blob/master/README.md#utcYear), [d3.timeMillisecond](https://github.com/d3/d3-time/blob/master/README.md#timeMillisecond) and [d3.utcMillisecond](https://github.com/d3/d3-time/blob/master/README.md#utcMillisecond) intervals have optimized implementations of [*interval*.every](https://github.com/d3/d3-time/blob/master/README.md#interval_every), which is necessary to generate time ticks for very large or very small domains efficiently. More generally, the performance of time intervals has been improved, and time intervals now do a better job with respect to daylight savings in various locales.
+
+## [Timers (d3-timer)](https://github.com/d3/d3-timer/blob/master/README.md)
+
+In D3 3.x, the only way to stop a timer was for its callback to return true. For example, this timer stops after one second:
+
+```js
+d3.timer(function(elapsed) {
+ console.log(elapsed);
+ return elapsed >= 1000;
+});
+```
+
+In 4.0, use [*timer*.stop](https://github.com/d3/d3-timer/blob/master/README.md#timer_stop) instead:
+
+```js
+var t = d3.timer(function(elapsed) {
+ console.log(elapsed);
+ if (elapsed >= 1000) {
+ t.stop();
+ }
+});
+```
+
+The primary benefit of *timer*.stop is that timers are not required to self-terminate: they can be stopped externally, allowing for the immediate and synchronous disposal of associated resources, and the separation of concerns. The above is equivalent to:
+
+```js
+var t = d3.timer(function(elapsed) {
+ console.log(elapsed);
+});
+
+d3.timeout(function() {
+ t.stop();
+}, 1000);
+```
+
+This improvement extends to [d3-transition](#transitions-d3-transition): now when a transition is interrupted, its resources are immediately freed rather than having to wait for transition to start.
+
+4.0 also introduces a new [*timer*.restart](https://github.com/d3/d3-timer/blob/master/README.md#timer_restart) method for restarting timers, for replacing the callback of a running timer, or for changing its delay or reference time. Unlike *timer*.stop followed by [d3.timer](https://github.com/d3/d3-timer/blob/master/README.md#timer), *timer*.restart maintains the invocation priority of an existing timer: it guarantees that the order of invocation of active timers remains the same. The d3.timer.flush method has been renamed to [d3.timerFlush](https://github.com/d3/d3-timer/blob/master/README.md#timerFlush).
+
+Some usage patterns in D3 3.x could cause the browser to hang when a background page returned to the foreground. For example, the following code schedules a transition every second:
+
+```js
+setInterval(function() {
+ d3.selectAll("div").transition().call(someAnimation); // BAD
+}, 1000);
+```
+
+If such code runs in the background for hours, thousands of queued transitions will try to run simultaneously when the page is foregrounded. D3 4.0 avoids this hang by freezing time in the background: when a page is in the background, time does not advance, and so no queue of timers accumulates to run when the page returns to the foreground. Use d3.timer instead of transitions to schedule a long-running animation, or use [d3.timeout](https://github.com/d3/d3-timer/blob/master/README.md#timeout) and [d3.interval](https://github.com/d3/d3-timer/blob/master/README.md#interval) in place of setTimeout and setInterval to prevent transitions from being queued in the background:
+
+```js
+d3.interval(function() {
+ d3.selectAll("div").transition().call(someAnimation); // GOOD
+}, 1000);
+```
+
+By freezing time in the background, timers are effectively “unaware” of being backgrounded. It’s like nothing happened! 4.0 also now uses high-precision time ([performance.now](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now)) where available; the current time is available as [d3.now](https://github.com/d3/d3-timer/blob/master/README.md#now).
+
+## [Transitions (d3-transition)](https://github.com/d3/d3-transition/blob/master/README.md)
+
+The [*selection*.transition](https://github.com/d3/d3-transition/blob/master/README.md#selection_transition) method now takes an optional *transition* instance which can be used to synchronize a new transition with an existing transition. (This change is discussed further in [What Makes Software Good?](https://medium.com/@mbostock/what-makes-software-good-943557f8a488)) For example:
+
+```js
+var t = d3.transition()
+ .duration(750)
+ .ease(d3.easeLinear);
+
+d3.selectAll(".apple").transition(t)
+ .style("fill", "red");
+
+d3.selectAll(".orange").transition(t)
+ .style("fill", "orange");
+```
+
+Transitions created this way inherit timing from the closest ancestor element, and thus are synchronized even when the referenced *transition* has variable timing such as a staggered delay. This method replaces the deeply magical behavior of *transition*.each in 3.x; in 4.0, [*transition*.each](https://github.com/d3/d3-transition/blob/master/README.md#transition_each) is identical to [*selection*.each](https://github.com/d3/d3-selection/blob/master/README.md#selection_each). Use the new [*transition*.on](https://github.com/d3/d3-transition/blob/master/README.md#transition_on) method to listen to transition events.
+
+The meaning of [*transition*.delay](https://github.com/d3/d3-transition/blob/master/README.md#transition_delay) has changed for chained transitions created by [*transition*.transition](https://github.com/d3/d3-transition/blob/master/README.md#transition_transition). The specified delay is now relative to the *previous* transition in the chain, rather than the *first* transition in the chain; this makes it easier to insert interstitial pauses. For example:
+
+```js
+d3.selectAll(".apple")
+ .transition() // First fade to green.
+ .style("fill", "green")
+ .transition() // Then red.
+ .style("fill", "red")
+ .transition() // Wait one second. Then brown, and remove.
+ .delay(1000)
+ .style("fill", "brown")
+ .remove();
+```
+
+Time is now frozen in the background; see [d3-timer](#timers-d3-timer) for more information. While it was previously the case that transitions did not run in the background, now they pick up where they left off when the page returns to the foreground. This avoids page hangs by not scheduling an unbounded number of transitions in the background. If you want to schedule an infinitely-repeating transition, use transition events, or use [d3.timeout](https://github.com/d3/d3-timer/blob/master/README.md#timeout) and [d3.interval](https://github.com/d3/d3-timer/blob/master/README.md#interval) in place of [setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout) and [setInterval](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval).
+
+The [*selection*.interrupt](https://github.com/d3/d3-transition/blob/master/README.md#selection_interrupt) method now cancels all scheduled transitions on the selected elements, in addition to interrupting any active transition. When transitions are interrupted, any resources associated with the transition are now released immediately, rather than waiting until the transition starts, improving performance. (See also [*timer*.stop](https://github.com/d3/d3-timer/blob/master/README.md#timer_stop).) The new [d3.interrupt](https://github.com/d3/d3-transition/blob/master/README.md#interrupt) method is an alternative to [*selection*.interrupt](https://github.com/d3/d3-transition/blob/master/README.md#selection_interrupt) for quickly interrupting a single node.
+
+The new [d3.active](https://github.com/d3/d3-transition/blob/master/README.md#active) method allows you to select the currently-active transition on a given *node*, if any. This is useful for modifying in-progress transitions and for scheduling infinitely-repeating transitions. For example, this transition continuously oscillates between red and blue:
+
+```js
+d3.select("circle")
+ .transition()
+ .on("start", function repeat() {
+ d3.active(this)
+ .style("fill", "red")
+ .transition()
+ .style("fill", "blue")
+ .transition()
+ .on("start", repeat);
+ });
+```
+
+The [life cycle of a transition](https://github.com/d3/d3-transition/blob/master/README.md#the-life-of-a-transition) is now more formally defined and enforced. For example, attempting to change the duration of a running transition now throws an error rather than silently failing. The [*transition*.remove](https://github.com/d3/d3-transition/blob/master/README.md#transition_remove) method has been fixed if multiple transition names are in use: the element is only removed if it has no scheduled transitions, regardless of name. The [*transition*.ease](https://github.com/d3/d3-transition/blob/master/README.md#transition_ease) method now always takes an [easing function](#easings-d3-ease), not a string. When a transition ends, the tweens are invoked one last time with *t* equal to exactly 1, regardless of the associated easing function.
+
+As with [selections](#selections-d3-selection) in 4.0, all transition callback functions now receive the standard arguments: the element’s datum (*d*), the element’s index (*i*), and the element’s group (*nodes*), with *this* as the element. This notably affects [*transition*.attrTween](https://github.com/d3/d3-transition/blob/master/README.md#transition_attrTween) and [*transition*.styleTween](https://github.com/d3/d3-transition/blob/master/README.md#transition_styleTween), which no longer pass the *tween* function the current attribute or style value as the third argument. The *transition*.attrTween and *transition*.styleTween methods can now be called in getter modes for debugging or to share tween definitions between transitions.
+
+Homogenous transitions are now optimized! If all elements in a transition share the same tween, interpolator, or event listeners, this state is now shared across the transition rather than separately allocated for each element. 4.0 also uses an optimized default interpolator in place of [d3.interpolate](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolate) for [*transition*.attr](https://github.com/d3/d3-transition/blob/master/README.md#transition_attr) and [*transition*.style](https://github.com/d3/d3-transition/blob/master/README.md#transition_style). And transitions can now interpolate both [CSS](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateTransformCss) and [SVG](https://github.com/d3/d3-interpolate/blob/master/README.md#interpolateTransformSvg) transforms.
+
+For reusable components that support transitions, such as [axes](#axes-d3-axis), a new [*transition*.selection](https://github.com/d3/d3-transition/blob/master/README.md#transition_selection) method returns the [selection](#selections-d3-selection) that corresponds to a given transition. There is also a new [*transition*.merge](https://github.com/d3/d3-transition/blob/master/README.md#transition_merge) method that is equivalent to [*selection*.merge](https://github.com/d3/d3-selection/blob/master/README.md#selection_merge).
+
+For the sake of parsimony, the multi-value map methods have been extracted to [d3-selection-multi](https://github.com/d3/d3-selection-multi) and are no longer part of the default bundle. The multi-value map methods have also been renamed to plural form to reduce overload: [*transition*.attrs](https://github.com/d3/d3-selection-multi/blob/master/README.md#transition_attrs) and [*transition*.styles](https://github.com/d3/d3-selection-multi/blob/master/README.md#transition_styles).
+
+## [Voronoi Diagrams (d3-voronoi)](https://github.com/d3/d3-voronoi/blob/master/README.md)
+
+The d3.geom.voronoi method has been renamed to [d3.voronoi](https://github.com/d3/d3-voronoi/blob/master/README.md#voronoi), and the *voronoi*.clipExtent method has been renamed to [*voronoi*.extent](https://github.com/d3/d3-voronoi/blob/master/README.md#voronoi_extent). The undocumented *polygon*.point property in 3.x, which is the element in the input *data* corresponding to the polygon, has been renamed to *polygon*.data.
+
+Calling [*voronoi*](https://github.com/d3/d3-voronoi/blob/master/README.md#_voronoi) now returns the full [Voronoi diagram](https://github.com/d3/d3-voronoi/blob/master/README.md#voronoi-diagrams), which includes topological information: each Voronoi edge exposes *edge*.left and *edge*.right specifying the sites on either side of the edge, and each Voronoi cell is defined as an array of these edges and a corresponding site. The Voronoi diagram can be used to efficiently compute both the Voronoi and Delaunay tessellations for a set of points: [*diagram*.polygons](https://github.com/d3/d3-voronoi/blob/master/README.md#diagram_polygons), [*diagram*.links](https://github.com/d3/d3-voronoi/blob/master/README.md#diagram_links), and [*diagram*.triangles](https://github.com/d3/d3-voronoi/blob/master/README.md#diagram_triangles). The new topology is also useful in conjunction with TopoJSON; see the [Voronoi topology example](https://bl.ocks.org/mbostock/cd52a201d7694eb9d890).
+
+The [*voronoi*.polygons](https://github.com/d3/d3-voronoi/blob/master/README.md#voronoi_polygons) and [*diagram*.polygons](https://github.com/d3/d3-voronoi/blob/master/README.md#diagram_polygons) now require an [extent](https://github.com/d3/d3-voronoi/blob/master/README.md#voronoi_extent); there is no longer an implicit extent of ±1e6. The [*voronoi*.links](https://github.com/d3/d3-voronoi/blob/master/README.md#voronoi_links), [*voronoi*.triangles](https://github.com/d3/d3-voronoi/blob/master/README.md#voronoi_triangles), [*diagram*.links](https://github.com/d3/d3-voronoi/blob/master/README.md#diagram_links) and [*diagram*.triangles](https://github.com/d3/d3-voronoi/blob/master/README.md#diagram_triangles) are now affected by the clip extent: as the Delaunay is computed as the dual of the Voronoi, two sites are only linked if the clipped cells are touching. To compute the Delaunay triangulation without respect to clipping, set the extent to null.
+
+The Voronoi generator finally has well-defined behavior for coincident vertices: the first of a set of coincident points has a defined cell, while the subsequent duplicate points have null cells. The returned array of polygons is sparse, so by using *array*.forEach or *array*.map, you can easily skip undefined cells. The Voronoi generator also now correctly handles the case where no cell edges intersect the extent.
+
+## [Zooming (d3-zoom)](https://github.com/d3/d3-zoom/blob/master/README.md)
+
+The zoom behavior d3.behavior.zoom has been renamed to d3.zoom. Zoom behaviors no longer store the active zoom transform (*i.e.*, the visible region; the scale and translate) internally. The zoom transform is now stored on any elements to which the zoom behavior has been applied. The zoom transform is available as *event*.transform within a zoom event or by calling [d3.zoomTransform](https://github.com/d3/d3-zoom/blob/master/README.md#zoomTransform) on a given *element*. To zoom programmatically, use [*zoom*.transform](https://github.com/d3/d3-zoom/blob/master/README.md#zoom_transform) with a given [selection](#selections-d3-selection) or [transition](#transitions-d3-transition); see the [zoom transitions example](https://bl.ocks.org/mbostock/b783fbb2e673561d214e09c7fb5cedee). The *zoom*.event method has been removed.
+
+To make programmatic zooming easier, there are several new convenience methods on top of *zoom*.transform: [*zoom*.translateBy](https://github.com/d3/d3-zoom/blob/master/README.md#zoom_translateBy), [*zoom*.scaleBy](https://github.com/d3/d3-zoom/blob/master/README.md#zoom_scaleBy) and [*zoom*.scaleTo](https://github.com/d3/d3-zoom/blob/master/README.md#zoom_scaleTo). There is also a new API for describing [zoom transforms](https://github.com/d3/d3-zoom/blob/master/README.md#zoom-transforms). Zoom behaviors are no longer dependent on [scales](#scales-d3-scale), but you can use [*transform*.rescaleX](https://github.com/d3/d3-zoom/blob/master/README.md#transform_rescaleX), [*transform*.rescaleY](https://github.com/d3/d3-zoom/blob/master/README.md#transform_rescaleY), [*transform*.invertX](https://github.com/d3/d3-zoom/blob/master/README.md#transform_invertX) or [*transform*.invertY](https://github.com/d3/d3-zoom/blob/master/README.md#transform_invertY) to transform a scale’s domain. 3.x’s *event*.scale is replaced with *event*.transform.k, and *event*.translate is replaced with *event*.transform.x and *event*.transform.y. The *zoom*.center method has been removed in favor of programmatic zooming.
+
+The zoom behavior finally supports simple constraints on panning! The new [*zoom*.translateExtent](https://github.com/d3/d3-zoom/blob/master/README.md#zoom_translateExtent) lets you define the viewable extent of the world: the currently-visible extent (the extent of the viewport, as defined by [*zoom*.extent](https://github.com/d3/d3-zoom/blob/master/README.md#zoom_extent)) is always contained within the translate extent. The *zoom*.size method has been replaced by *zoom*.extent, and the default behavior is now smarter: it defaults to the extent of the zoom behavior’s owner element, rather than being hardcoded to 960×500. (This also improves the default path chosen during smooth zoom transitions!)
+
+The zoom behavior’s interaction has also improved. It now correctly handles concurrent wheeling and dragging, as well as concurrent touching and mousing. The zoom behavior now ignores wheel events at the limits of its scale extent, allowing you to scroll past a zoomable area. The *zoomstart* and *zoomend* events have been renamed *start* and *end*. By default, zoom behaviors now ignore right-clicks intended for the context menu; use [*zoom*.filter](https://github.com/d3/d3-zoom/blob/master/README.md#zoom_filter) to control which events are ignored. The zoom behavior also ignores emulated mouse events on iOS. The zoom behavior now consumes handled events, making it easier to combine with other interactive behaviors such as [dragging](#dragging-d3-drag).
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
new file mode 100644
index 00000000000000..0b791d099a6322
--- /dev/null
+++ b/ISSUE_TEMPLATE.md
@@ -0,0 +1,12 @@
+STOP. DO NOT ASK FOR HELP HERE!
+
+If you ignore this message and ask for help anyway, your issue will be closed without a response.
+
+If you want help, please try one of the following forums instead:
+
+Stack Overflow: https://stackoverflow.com/questions/tagged/d3.js
+Slack: https://d3-slackin.herokuapp.com/
+Google Groups: https://groups.google.com/d/forum/d3-js
+Observable: https://observablehq.com/@d3
+
+ARE YOU REPORTING A BUG, OR MAKING A FEATURE REQUEST? Please file an issue on the relevant D3 module, not here; see https://github.com/d3. Please isolate the specific methods that exhibit unexpected behavior and precisely describe how your expectations were not met.
diff --git a/LICENSE b/LICENSE
index 0bc47f33ef3284..894ddc6549f17d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,8 +1,8 @@
-Copyright (c) 2013, Michael Bostock
+Copyright 2010-2020 Mike Bostock
All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
@@ -11,16 +11,17 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-* The name Michael Bostock may not be used to endorse or promote products
- derived from this software without specific prior written permission.
+* Neither the name of the author nor the names of contributors may be used to
+ endorse or promote products derived from this software without specific prior
+ written permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index d5511ea197d924..00000000000000
--- a/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-LOCALE ?= en_US
-
-GENERATED_FILES = \
- d3.js \
- d3.min.js \
- src/format/format-localized.js \
- src/time/format-localized.js \
- bower.json \
- component.json
-
-all: $(GENERATED_FILES)
-
-.PHONY: clean all test
-
-test:
- @npm test
-
-benchmark: all
- @node test/geo/benchmark.js
-
-src/format/format-localized.js: bin/locale src/format/format-locale.js
- LC_NUMERIC=$(LOCALE) LC_MONETARY=$(LOCALE) locale -ck LC_NUMERIC LC_MONETARY | bin/locale src/format/format-locale.js > $@
-
-src/time/format-localized.js: bin/locale src/time/format-locale.js
- LC_TIME=$(LOCALE) locale -ck LC_TIME | bin/locale src/time/format-locale.js > $@
-
-src/start.js: package.json bin/start
- bin/start > $@
-
-d3.js: $(shell node_modules/.bin/smash --list src/d3.js) package.json
- @rm -f $@
- node_modules/.bin/smash src/d3.js | node_modules/.bin/uglifyjs - -b indent-level=2 -o $@
- @chmod a-w $@
-
-d3.min.js: d3.js bin/uglify
- @rm -f $@
- bin/uglify $< > $@
-
-%.json: bin/% package.json
- @rm -f $@
- bin/$* > $@
- @chmod a-w $@
-
-clean:
- rm -f -- $(GENERATED_FILES)
diff --git a/README.md b/README.md
index 885069c70bfc53..74058319051108 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,57 @@
-# Data-Driven Documents
+# D3: Data-Driven Documents
-**D3.js** is a JavaScript library for manipulating documents based on data. **D3** helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.
+=o.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,i={},o=[],a=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(mo.map,e,0),0)},i.key=function(n){return o.push(n),i},i.sortKeys=function(n){return a[o.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},mo.set=function(n){var t=new i;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},r(i,{has:function(n){return zo+n in this},add:function(n){return this[zo+n]=!0,n},remove:function(n){return n=zo+n,n in this&&delete this[n]},values:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},forEach:function(n){for(var t in this)t.charCodeAt(0)===Co&&n.call(this,t.substring(1))}}),mo.behavior={},mo.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r=0&&(r=n.substring(e+1),n=n.substring(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},mo.event=null,mo.requote=function(n){return n.replace(jo,"\\$&")};var jo=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Lo={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},Ho=function(n,t){return t.querySelector(n)},Fo=function(n,t){return t.querySelectorAll(n)},Po=bo[a(bo,"matchesSelector")],Oo=function(n,t){return Po.call(n,t)};"function"==typeof Sizzle&&(Ho=function(n,t){return Sizzle(n,t)[0]||null},Fo=function(n,t){return Sizzle.uniqueSort(Sizzle(n,t))},Oo=Sizzle.matchesSelector),mo.selection=function(){return Uo};var Ro=mo.selection.prototype=[];Ro.select=function(n){var t,e,r,u,i=[];n=d(n);for(var o=-1,a=this.length;++o=0&&(e=n.substring(0,t),n=n.substring(t+1)),Yo.hasOwnProperty(e)?{space:Yo[e],local:n}:n}},Ro.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=mo.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(m(t,n[t]));return this}return this.each(m(n,t))},Ro.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=n.trim().split(/^|\s+/g)).length,u=-1;if(t=e.classList){for(;++u =0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return e=xc.get(e)||Mc,r=bc.get(r)||dt,Ar(r(e.apply(null,Array.prototype.slice.call(arguments,1))))},mo.interpolateHcl=Rr,mo.interpolateHsl=Yr,mo.interpolateLab=Ir,mo.interpolateRound=Ur,mo.transform=function(n){var t=xo.createElementNS(mo.ns.prefix.svg,"g");return(mo.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Zr(e?e.matrix:_c)})(n)},Zr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var _c={a:1,b:0,c:0,d:1,e:0,f:0};mo.interpolateTransform=Br,mo.layout={},mo.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++eHello & world!
-
diff --git a/test/data/sample.json b/test/data/sample.json
deleted file mode 100644
index 92c35fd7d66a63..00000000000000
--- a/test/data/sample.json
+++ /dev/null
@@ -1 +0,0 @@
-[{"Hello": 42, "World": "\"fish\""}]
diff --git a/test/data/sample.tsv b/test/data/sample.tsv
deleted file mode 100644
index 9998779de8a927..00000000000000
--- a/test/data/sample.tsv
+++ /dev/null
@@ -1,2 +0,0 @@
-Hello World
-42 """fish"""
diff --git a/test/data/sample.txt b/test/data/sample.txt
deleted file mode 100644
index af5626b4a114ab..00000000000000
--- a/test/data/sample.txt
+++ /dev/null
@@ -1 +0,0 @@
-Hello, world!
diff --git a/test/data/sample.xml b/test/data/sample.xml
deleted file mode 100644
index a2447a54cd0add..00000000000000
--- a/test/data/sample.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
-
-
diff --git a/test/math/transform-test.html b/test/math/transform-test.html
deleted file mode 100644
index 7e313d7876af67..00000000000000
--- a/test/math/transform-test.html
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-start
- end
- actual intermediate values
- exp.
- act.
-
-
-
-Hello, world!
");
- assert.equal(body.node().firstChild.tagName, "H1");
- assert.equal(body.node().firstChild.textContent, "Hello, world!");
- },
- "sets the inner HTML as a number": function(body) {
- body.html(42);
- assert.equal(body.node().innerHTML, "42");
- assert.equal(body.node().firstChild.nodeType, 3);
- },
- "sets the inner HTML as a function": function(body) {
- body.data(["Subject"]).html(function(d, i) { return "" + d + "" + i + ""; });
- assert.equal(body.node().firstChild.tagName, "B");
- assert.equal(body.node().firstChild.textContent, "Subject");
- assert.equal(body.node().lastChild.tagName, "I");
- assert.equal(body.node().lastChild.textContent, "0");
- },
- "clears the inner HTML as null": function(body) {
- body.html(null);
- assert.equal(body.node().innerHTML, "");
- assert.isNull(body.node().firstChild);
- },
- "clears the inner HTML as undefined": function(body) {
- body.html(undefined);
- assert.equal(body.node().innerHTML, "");
- assert.isNull(body.node().firstChild);
- },
- "clears the inner HTML as the empty string": function(body) {
- body.html("");
- assert.equal(body.node().innerHTML, "");
- assert.isNull(body.node().firstChild);
- },
- "clears the inner HTML as a function returning the empty string": function(body) {
- body.text(function() { return ""; });
- assert.equal(body.node().innerHTML, "");
- assert.isNull(body.node().firstChild);
- },
- "clears the inner HTML as a function returning null": function(body) {
- body.text(function() { return null; });
- assert.equal(body.node().innerHTML, "");
- assert.isNull(body.node().firstChild);
- },
- "clears the inner HTML as a function returning undefined": function(body) {
- body.text(function() { return undefined; });
- assert.equal(body.node().innerHTML, "");
- assert.isNull(body.node().firstChild);
- },
- "returns the current selection": function(body) {
- assert.isTrue(body.html("foo") === body);
- },
- "ignores null nodes": function(body) {
- var node = body.node();
- body[0][0] = null;
- node.innerHTML = "foo
";
- body.html("bar");
- assert.equal(node.textContent, "foo");
- }
- }
- }
-});
-
-suite.addBatch({
- "selectAll(div)": {
- topic: load("selection/selection").document(),
- "on a simple page": {
- topic: function(d3) {
- return d3.select("body").selectAll("div").data([0, 1]).enter().append("div");
- },
- "sets the inner HTML as a string": function(div) {
- div.html("Hello, world!
");
- assert.equal(div[0][0].firstChild.tagName, "H1");
- assert.equal(div[0][0].firstChild.textContent, "Hello, world!");
- assert.equal(div[0][1].firstChild.tagName, "H1");
- assert.equal(div[0][1].firstChild.textContent, "Hello, world!");
- },
- "sets the inner HTML as a number": function(div) {
- div.html(42);
- assert.equal(div[0][0].innerHTML, "42");
- assert.equal(div[0][0].firstChild.nodeType, 3);
- },
- "sets the inner HTML as a function": function(div) {
- div.data(["foo", "bar"]).html(function(d, i) { return "" + d + "" + i + ""; });
- assert.equal(div[0][0].firstChild.tagName, "B");
- assert.equal(div[0][0].firstChild.textContent, "foo");
- assert.equal(div[0][0].lastChild.tagName, "I");
- assert.equal(div[0][0].lastChild.textContent, "0");
- assert.equal(div[0][1].firstChild.tagName, "B");
- assert.equal(div[0][1].firstChild.textContent, "bar");
- assert.equal(div[0][1].lastChild.tagName, "I");
- assert.equal(div[0][1].lastChild.textContent, "1");
- },
- "clears the inner HTML as null": function(div) {
- div.html(null);
- assert.equal(div[0][0].innerHTML, "");
- assert.isNull(div[0][0].firstChild);
- assert.equal(div[0][1].innerHTML, "");
- assert.isNull(div[0][1].firstChild);
- },
- "clears the inner HTML as a function": function(div) {
- div.html(function() { return ""; });
- assert.equal(div[0][0].innerHTML, "");
- assert.isNull(div[0][0].firstChild);
- assert.equal(div[0][1].innerHTML, "");
- assert.isNull(div[0][1].firstChild);
- },
- "returns the current selection": function(div) {
- assert.isTrue(div.html("foo") === div);
- },
- "ignores null nodes": function(div) {
- var node = div[0][0];
- div[0][0] = null;
- node.innerHTML = "foo
";
- div.html("bar");
- assert.equal(node.textContent, "foo");
- assert.equal(div[0][1].textContent, "bar");
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/insert-test.js b/test/selection/insert-test.js
deleted file mode 100644
index 2294d3f35c6a04..00000000000000
--- a/test/selection/insert-test.js
+++ /dev/null
@@ -1,169 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.insert");
-
-suite.addBatch({
- "select(body)": {
- topic: load("selection/insert").document(),
- "on a simple page": {
- topic: function(d3) {
- return d3.select("body");
- },
- "inserts before the specified selector": function(body) {
- var span = body.html("").append("span");
- var div = body.insert("div", "span");
- assert.equal(div[0][0].tagName, "DIV");
- assert.isNull(div[0][0].namespaceURI);
- assert.domEqual(div[0][0], body.node().firstChild);
- assert.domEqual(div[0][0].nextSibling, span[0][0]);
- },
- "inserts before the specified node": function(body) {
- var span = body.html("").append("span");
- var div = body.insert("div", function() { return span.node(); });
- assert.equal(div[0][0].tagName, "DIV");
- assert.isNull(div[0][0].namespaceURI);
- assert.domEqual(div[0][0], body.node().firstChild);
- assert.domEqual(div[0][0].nextSibling, span[0][0]);
- },
- "appends an HTML element": function(body) {
- var div = body.insert("div");
- assert.equal(div[0][0].tagName, "DIV");
- assert.isNull(div[0][0].namespaceURI);
- assert.domEqual(div[0][0], body.node().lastChild);
- },
- "appends an SVG element": function(body) {
- var svg = body.insert("svg:svg");
- assert.equal(svg[0][0].tagName, "SVG");
- assert.equal(svg[0][0].namespaceURI, "http://www.w3.org/2000/svg");
- assert.domEqual(svg[0][0].parentNode, body.node());
- assert.domEqual(svg[0][0], body.node().lastChild);
- },
- "propagates data to new element": function(body) {
- var data = new Object(), div = body.data([data]).insert("div");
- assert.strictEqual(div[0][0].__data__, data);
- },
- "returns a new selection": function(body) {
- assert.isFalse(body.insert("div") === body);
- },
- "inherits namespace from parent node": function(body) {
- var g = body.insert("svg:svg").insert("g");
- assert.equal(g[0][0].namespaceURI, "http://www.w3.org/2000/svg");
- }
- }
- }
-});
-
-suite.addBatch({
- "selectAll(div)": {
- topic: load("selection/selection").document(),
- "on a simple page": {
- topic: function(d3) {
- return d3.select("body").selectAll("div").data([0, 1]).enter().insert("div");
- },
- "appends an HTML element": function(div) {
- var span = div.insert("span");
- assert.equal(span[0].length, 2);
- assert.equal(span[0][0].tagName, "SPAN");
- assert.equal(span[0][1].tagName, "SPAN");
- assert.isNull(span[0][0].namespaceURI);
- assert.isNull(span[0][1].namespaceURI);
- assert.domEqual(span[0][0].parentNode, div[0][0]);
- assert.domEqual(span[0][1].parentNode, div[0][1]);
- assert.domEqual(div[0][0].lastChild, span[0][0]);
- assert.domEqual(div[0][1].lastChild, span[0][1]);
- },
- "appends an SVG element": function(div) {
- var svg = div.insert("svg:svg");
- assert.equal(svg[0].length, 2);
- assert.equal(svg[0][0].tagName, "SVG");
- assert.equal(svg[0][1].tagName, "SVG");
- assert.equal(svg[0][0].namespaceURI, "http://www.w3.org/2000/svg");
- assert.equal(svg[0][1].namespaceURI, "http://www.w3.org/2000/svg");
- assert.domEqual(svg[0][0].parentNode, div[0][0]);
- assert.domEqual(svg[0][1].parentNode, div[0][1]);
- assert.domEqual(div[0][0].lastChild, svg[0][0]);
- assert.domEqual(div[0][1].lastChild, svg[0][1]);
- },
- "propagates data to new elements": function(div) {
- var a = new Object(), b = new Object(), span = div.data([a, b]).insert("span");
- assert.strictEqual(span[0][0].__data__, a);
- assert.strictEqual(span[0][1].__data__, b);
- },
- "returns a new selection": function(div) {
- assert.isFalse(div.insert("div") === div);
- },
- "ignores null nodes": function(div) {
- div.html("");
- var node = div[0][1];
- div[0][1] = null;
- var span = div.insert("span");
- assert.equal(span[0].length, 2);
- assert.equal(span[0][0].tagName, "SPAN");
- assert.domNull(span[0][1]);
- assert.domEqual(span[0][0].parentNode, div[0][0]);
- assert.domEqual(div[0][0].lastChild, span[0][0]);
- assert.domNull(node.lastChild);
- }
- }
- }
-});
-
-suite.addBatch({
- "enter-insert": {
- topic: load("selection/selection").document(),
- "on a page with existing elements": {
- topic: function(d3) {
- var body = d3.select("body");
- body.selectAll("div").data(["apple", "orange"]).enter().append("div");
- return body;
- },
- "inserts before the following updating sibling": function(body) {
- var data = ["peach", "apple", "apple2", "apple3", "banana", "orange", "apricot"];
- body.selectAll("div").data(data, String).enter().insert("div");
- assert.deepEqual(body.selectAll("div").data(), data);
- }
- }
- }
-});
-
-suite.addBatch({
- "selectAll(div).data(…).enter()": {
- topic: load("selection/selection").document(),
- "on a simple page": {
- topic: function(d3) {
- return d3.select("body");
- },
- "inserts before the specified selector": function(body) {
- var span = body.append("span");
- var div = body.selectAll("div").data([0, 1]).enter().insert("div", "span");
- assert.equal(div.length, 1);
- assert.equal(div[0].length, 2);
- assert.domEqual(div[0][0], body.node().firstChild);
- assert.domEqual(div[0][1].previousSibling, div[0][0]);
- assert.domEqual(div[0][1].nextSibling, span[0][0]);
- },
- "propagates data to new elements": function(body) {
- var a = new Object(), b = new Object(), div = body.html("").selectAll("div").data([a, b]).enter().insert("div");
- assert.strictEqual(div[0][0].__data__, a);
- assert.strictEqual(div[0][1].__data__, b);
- },
- "ignores null nodes": function(body) {
- body.html("").insert("div");
- var div = body.selectAll("div").data([0, 1, 2]).enter().insert("div");
- assert.equal(div.length, 1);
- assert.equal(div[0].length, 3);
- assert.domNull(div[0][0]);
- assert.domEqual(div[0][1].parentNode, body.node());
- assert.domEqual(div[0][2].parentNode, body.node());
- },
- "returns a new selection": function(body) {
- var enter = body.html("").selectAll("div").data([0, 1]).enter();
- assert.isFalse(enter.insert("div") === enter);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/interrupt-test.js b/test/selection/interrupt-test.js
deleted file mode 100644
index bb341144201bf9..00000000000000
--- a/test/selection/interrupt-test.js
+++ /dev/null
@@ -1,32 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.interrupt");
-
-suite.addBatch({
- "interrupt": {
- topic: load("transition/transition").document(),
- "returns the current selection": function(d3) {
- var selection = d3.select("body").append("div");
- assert.strictEqual(selection.interrupt(), selection);
- },
- "increments the active transition": function(d3) {
- var selection = d3.select("body").append("div"),
- transition = selection.transition();
- assert.equal(selection.node().__transition__.active, 0); // transition hasn’t yet started
- d3.timer.flush();
- assert.equal(selection.node().__transition__.active, transition.id); // transition has started
- selection.interrupt();
- assert.equal(selection.node().__transition__.active, transition.id + 1); // transition was interrupted
- },
- "does nothing if there is no active transition": function(d3) {
- var selection = d3.select("body").append("div");
- assert.isUndefined(selection.node().__transition__); // no transition scheduled
- selection.interrupt();
- assert.isUndefined(selection.node().__transition__); // still no transition scheduled
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/node-test.js b/test/selection/node-test.js
deleted file mode 100644
index ae6005d0e1a84f..00000000000000
--- a/test/selection/node-test.js
+++ /dev/null
@@ -1,55 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.node");
-
-suite.addBatch({
- "select(body)": {
- topic: load("selection/node").document(),
- "on a simple page": {
- topic: function(d3) {
- return d3.select("body");
- },
- "returns null for empty selections": function(body) {
- assert.isNull(body.select("foo").node());
- },
- "returns the first element for non-empty selections": function(body) {
- assert.isTrue(body.node() === body[0][0]);
- assert.equal(body.node().tagName, "BODY");
- },
- "ignores null nodes": function(body) {
- body[0][0] = null;
- assert.isNull(body.node());
- }
- }
- }
-});
-
-suite.addBatch({
- "selectAll(div)": {
- topic: load("selection/node").document(),
- "on a simple page": {
- topic: function(d3) {
- var body = d3.select("body");
- body.append("div").append("span");
- body.append("div");
- return body.selectAll("div");
- },
- "returns null for empty selections": function(div) {
- assert.isNull(div.select("foo").node());
- },
- "returns the first element for non-empty selections": function(div) {
- assert.isTrue(div.node() === div[0][0]);
- assert.equal(div.node().tagName, "DIV");
- },
- "ignores null nodes": function(div) {
- div[0][0] = null;
- assert.isTrue(div.node() === div[0][1]);
- assert.equal(div.node().tagName, "DIV");
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/on-test.js b/test/selection/on-test.js
deleted file mode 100644
index a4d4f8fe90eeec..00000000000000
--- a/test/selection/on-test.js
+++ /dev/null
@@ -1,135 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.on");
-
-suite.addBatch({
- "select(body)": {
- topic: load("selection/on").document(),
- "on a simple page": {
- topic: function(d3) {
- return d3.select("body");
- },
- "registers an event listener for the specified type": function(body) {
- var form = body.append("form"), count = 0;
- form.on("submit", function() { ++count; }); // jsdom has spotty event support
- form.append("input").attr("type", "submit").node().click();
- assert.equal(count, 1);
- },
- "replaces an existing event listener for the same type": function(body) {
- var form = body.append("form"), count = 0, fail = 0;
- form.on("submit", function() { ++fail; });
- form.on("submit", function() { ++count; });
- form.append("input").attr("type", "submit").node().click();
- assert.equal(count, 1);
- assert.equal(fail, 0);
- },
- "removes an existing event listener": function(body) {
- var form = body.append("form"), fail = 0;
- form.on("submit", function() { ++fail; });
- form.on("submit", null);
- form.append("input").attr("type", "submit").node().click();
- assert.equal(fail, 0);
- assert.isUndefined(form.on("submit"));
- },
- /* Regrettably, JSDOM ignores the capture flag, so we can't test this yet…
- "removing a listener doesn't require the capture flag": function(body) {
- var form = body.append("form"), fail = 0;
- form.on("submit", function() { ++fail; }, true);
- form.on("submit", null);
- form.append("input").attr("type", "submit").node().click();
- assert.equal(fail, 0);
- assert.isUndefined(form.on("submit"));
- },
- */
- "ignores removal of non-matching event listener": function(body) {
- body.append("form").on("submit", null);
- },
- "observes the specified namespace": function(body) {
- var form = body.append("form"), foo = 0, bar = 0;
- form.on("submit.foo", function() { ++foo; });
- form.on({"submit.bar": function() { ++bar; }});
- form.append("input").attr("type", "submit").node().click();
- assert.equal(foo, 1);
- assert.equal(bar, 1);
- },
- "can register listeners as a map": function(body) {
- var form = body.append("form"), count = 0, fail = 0;
- form.on({submit: function() { ++fail; }});
- form.on({submit: function() { ++count; }});
- form.append("input").attr("type", "submit").node().click();
- assert.equal(count, 1);
- assert.equal(fail, 0);
- form.on({submit: null});
- assert.isUndefined(form.on("submit"));
- },
- /* Not really sure how to test this one…
- "observes the specified capture flag": function(body) {
- },
- */
- "passes the current data and index to the event listener": function(body) {
- var forms = body.html("").selectAll("form").data(["a", "b"]).enter().append("form"), dd, ii, data = new Object();
- forms.on("submit", function(d, i) { dd = d; ii = i; });
- forms.append("input").attr("type", "submit")[0][1].click();
- assert.equal(dd, "b");
- assert.equal(ii, 1);
- forms[0][1].__data__ = data;
- forms.append("input").attr("type", "submit")[0][1].click();
- assert.equal(dd, data);
- assert.equal(ii, 1);
- },
- "uses the current element as the context": function(body) {
- var forms = body.html("").selectAll("form").data(["a", "b"]).enter().append("form"), context;
- forms.on("submit", function() { context = this; });
- forms.append("input").attr("type", "submit")[0][1].click();
- assert.domEqual(context, forms[0][1]);
- },
- "returns the current selection": function(body) {
- assert.isTrue(body.on("submit", function() {}) === body);
- },
- "returns the assigned listener if called with one argument": function(body) {
- body.on("mouseover", f).on("click.foo", f);
- function f() {}
- assert.equal(body.on("mouseover"), f);
- assert.equal(body.on("click.foo"), f);
- assert.isUndefined(body.on("click"));
- assert.isUndefined(body.on("mouseover.foo"));
- },
- "omitting the event type": {
- "returns undefined when retrieving a listener": function(body) {
- assert.isUndefined(body.on(".foo"));
- },
- "null removes all named event listeners": function(body) {
- body.on("mouseover.foo", f)
- .on("click.foo", f)
- .on("click.foobar", f)
- .on(".foo", null);
- function f() {}
- assert.isUndefined(body.on("mouseover.foo"));
- assert.isUndefined(body.on("click.foo"));
- assert.equal(body.on("click.foobar"), f);
- },
- "no-op when setting a listener": function(body) {
- assert.isTrue(body.on(".foo", function() {}) === body);
- assert.isUndefined(body.on(".foo"));
- }
- }
- },
- "sets the current event as d3.event": function(d3) {
- var form = d3.select("body").append("form"), event;
- form.on("submit", function() { event = d3.event; });
- form.append("input").attr("type", "submit").node().click();
- assert.equal(event.type, "submit");
- assert.domEqual(event.target, form[0][0]);
- },
- "restores the original event after notifying listeners": function(d3) {
- var form = d3.select("body").append("form"), event = d3.event = new Object();
- form.on("submit", function() {});
- form.append("input").attr("type", "submit").node().click();
- assert.equal(d3.event, event);
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/order-test.js b/test/selection/order-test.js
deleted file mode 100644
index 1576d683af13c7..00000000000000
--- a/test/selection/order-test.js
+++ /dev/null
@@ -1,32 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.order");
-
-suite.addBatch({
- "selectAll(div)": {
- topic: load("selection/call").document(),
- "on a simple page": {
- topic: function(d3) {
- return d3.select("body").selectAll("div")
- .data([1, 2, 10, 20])
- .enter().append("div")
- .attr("id", String);
- },
- "orders elements by data": function(div) {
- div = div.data([1, 10, 20, 2], String).order();
- assert.domNull(div[0][0].previousSibling);
- assert.domEqual(div[0][1].previousSibling, div[0][0]);
- assert.domEqual(div[0][2].previousSibling, div[0][1]);
- assert.domEqual(div[0][3].previousSibling, div[0][2]);
- assert.domNull(div[0][3].nextSibling);
- },
- "returns the current selection": function(span) {
- assert.isTrue(span.order() === span);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/property-test.js b/test/selection/property-test.js
deleted file mode 100644
index 075f3bd2e37c75..00000000000000
--- a/test/selection/property-test.js
+++ /dev/null
@@ -1,117 +0,0 @@
-var vows = require("vows"),
- _ = require("../../"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.property");
-
-suite.addBatch({
- "select(body)": {
- topic: load("selection/property").document(),
- "on a simple page": {
- topic: function(d3) {
- return d3.select("body");
- },
- "sets a property as a string": function(body) {
- body.property("bgcolor", "red");
- assert.equal(body.node().bgcolor, "red");
- },
- "sets a property as a number": function(body) {
- body.property("opacity", 1);
- assert.equal(body.node().opacity, "1");
- },
- "sets a property as a function": function(body) {
- body.property("bgcolor", function() { return "orange"; });
- assert.equal(body.node().bgcolor, "orange");
- },
- "sets properties as a map of constants": function(body) {
- body.property({bgcolor: "purple", opacity: .41});
- assert.equal(body.node().bgcolor, "purple");
- assert.equal(body.node().opacity, .41);
- },
- "sets properties as a map of functions": function(body) {
- body.data(["cyan"]).property({bgcolor: String, opacity: function(d, i) { return i; }});
- assert.equal(body.node().bgcolor, "cyan");
- assert.equal(body.node().opacity, 0);
- },
- "gets a property value": function(body) {
- body.node().bgcolor = "yellow";
- assert.equal(body.property("bgcolor"), "yellow");
- },
- "removes a property as null": function(body) {
- body.property("bgcolor", "yellow").property("bgcolor", null);
- assert.isFalse("bgcolor" in body.node());
- },
- "removes a property as a function": function(body) {
- body.property("bgcolor", "yellow").property("bgcolor", function() { return null });
- assert.isFalse("bgcolor" in body.node());
- },
- "removes properties as a map of nulls": function(body) {
- body.node().bgcolor = "red";
- body.property({bgcolor: null});
- assert.isFalse("bgcolor" in body.node());
- },
- "removes properties as a map of functions that return null": function(body) {
- body.node().bgcolor = "red";
- body.property({bgcolor: function() {}});
- assert.isFalse("bgcolor" in body.node());
- },
- "returns the current selection": function(body) {
- assert.isTrue(body.property("bgcolor", "yellow") === body);
- }
- }
- }
-});
-
-suite.addBatch({
- "selectAll(div)": {
- topic: load("selection/property").document(),
- "on a simple page": {
- topic: function(d3) {
- return d3.select("body").html("").selectAll("div").data([0, 1]).enter().append("div");
- },
- "sets a property as a string": function(div) {
- div.property("bgcolor", "red");
- assert.equal(div[0][0].bgcolor, "red");
- assert.equal(div[0][1].bgcolor, "red");
- },
- "sets a property as a number": function(div) {
- div.property("opacity", 0.4);
- assert.equal(div[0][0].opacity, "0.4");
- assert.equal(div[0][1].opacity, "0.4");
- },
- "sets a property as a function": function(div) {
- div.property("bgcolor", _.interpolateRgb("brown", "steelblue"));
- assert.equal(div[0][0].bgcolor, "#a52a2a");
- assert.equal(div[0][1].bgcolor, "#4682b4");
- },
- "gets a property value": function(div) {
- div[0][0].bgcolor = "purple";
- assert.equal(div.property("bgcolor"), "purple");
- },
- "removes a property as null": function(div) {
- div.property("bgcolor", "yellow").property("bgcolor", null);
- assert.isFalse("bgcolor" in div[0][0]);
- assert.isFalse("bgcolor" in div[0][1]);
- },
- "removes a property as a function": function(div) {
- div.property("bgcolor", "yellow").property("bgcolor", function() { return null });
- assert.isFalse("bgcolor" in div[0][0]);
- assert.isFalse("bgcolor" in div[0][1]);
- },
- "returns the current selection": function(div) {
- assert.isTrue(div.property("bgcolor", "yellow") === div);
- },
- "ignores null nodes": function(div) {
- var node = div[0][1];
- div.property("bgcolor", null);
- div[0][1] = null;
- div.property("bgcolor", "red");
- assert.equal(div[0][0].bgcolor, "red");
- assert.isFalse("bgcolor" in node);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/remove-test.js b/test/selection/remove-test.js
deleted file mode 100644
index 907bcb40501273..00000000000000
--- a/test/selection/remove-test.js
+++ /dev/null
@@ -1,38 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.remove");
-
-suite.addBatch({
- "select(body)": {
- topic: load("selection/remove").document(),
- "removes the matching elements": function(d3) {
- var div = d3.select("body").append("div");
- div.remove();
- assert.domNull(div[0][0].parentNode);
- },
- "does not remove non-matching elements": function(d3) {
- var body = d3.select("body"),
- div1 = body.append("div"),
- div2 = body.append("div");
- div1.remove();
- assert.domEqual(div2[0][0].parentNode, body.node());
- },
- "ignores null nodes": function(d3) {
- var div1 = d3.select("body").append("div"),
- div2 = div1.selectAll("div").data([0, 1]).enter().append("div"),
- node = div2[0][0];
- div2[0][0] = null;
- div2.remove();
- assert.domEqual(node.parentNode, div1.node());
- assert.domNull(div2[0][1].parentNode);
- },
- "returns the current selection": function(d3) {
- var div = d3.select("body").append("div");
- assert.isTrue(div.remove() === div);
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/select-test.js b/test/selection/select-test.js
deleted file mode 100644
index 33d68bd9b75baa..00000000000000
--- a/test/selection/select-test.js
+++ /dev/null
@@ -1,69 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.select");
-
-suite.addBatch({
- "select": {
- topic: load("selection/select").document(),
- "on a simple page": {
- topic: function(d3) {
- var body = d3.select("body");
- body.append("span").attr("class", "f00").attr("id", "b4r").attr("name", "b4z");
- body.append("div").attr("class", "foo").attr("id", "bar").attr("name", "baz");
- return d3;
- },
- "selects by element name": function(d3) {
- var div = d3.select("div");
- assert.equal(div[0][0].tagName, "DIV");
- },
- "selects by class name": function(d3) {
- var div = d3.select(".foo");
- assert.equal(div[0][0].className, "foo");
- },
- "selects by id": function(d3) {
- var div = d3.select("div#bar");
- assert.equal(div[0][0].id, "bar");
- },
- "selects by attribute value": function(d3) {
- var div = d3.select("[name=baz]");
- assert.equal(div[0][0].getAttribute("name"), "baz");
- },
- "selects by node": function(d3) {
- var body = d3.select("body").node(),
- div = d3.select(body.lastChild);
- assert.isTrue(div[0][0] === body.lastChild);
- assert.lengthOf(div, 1);
- assert.lengthOf(div[0], 1);
- },
- "sets the parentNode to the document element": function(d3) {
- var selection = d3.select("body"),
- document = d3.selection().node().ownerDocument;
- assert.strictEqual(selection[0].parentNode, document.documentElement);
- },
- "does not propagate data from the document": function(d3) {
- var document = d3.selection().node().ownerDocument;
- document.__data__ = 42;
- delete document.body.__data__;
- try {
- assert.isUndefined(d3.select("body").datum());
- } finally {
- delete document.__data__;
- }
- },
- "does not propagate data from the document element": function(d3) {
- var document = d3.selection().node().ownerDocument;
- document.documentElement.__data__ = 42;
- delete document.body.__data__;
- try {
- assert.isUndefined(d3.select("body").datum());
- } finally {
- delete document.documentElement.__data__;
- }
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/selectAll-test.js b/test/selection/selectAll-test.js
deleted file mode 100644
index decbc665fa22d2..00000000000000
--- a/test/selection/selectAll-test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.selectAll");
-
-suite.addBatch({
- "selectAll": {
- topic: load("selection/selectAll").document(),
- "on a simple page": {
- topic: function(d3) {
- var body = d3.select("body");
- body.append("span").attr("class", "f00").attr("id", "b4r").attr("name", "b4z");
- body.append("div").attr("class", "foo").attr("id", "bar").attr("name", "baz");
- return d3;
- },
- "selects by element name": function(d3) {
- var div = d3.selectAll("div");
- assert.equal(div[0][0].tagName, "DIV");
- },
- "selects by class name": function(d3) {
- var div = d3.selectAll(".foo");
- assert.equal(div[0][0].className, "foo");
- },
- "selects by id": function(d3) {
- var div = d3.selectAll("div#bar");
- assert.equal(div[0][0].id, "bar");
- },
- "selects by attribute value": function(d3) {
- var div = d3.selectAll("[name=baz]");
- assert.equal(div[0][0].getAttribute("name"), "baz");
- },
- "selects by array": function(d3) {
- var body = d3.select("body").node(), div = d3.selectAll([body.lastChild]);
- assert.isTrue(div[0][0] === body.lastChild);
- assert.lengthOf(div, 1);
- assert.lengthOf(div[0], 1);
- },
- "groups are arrays, not NodeLists": function(d3) {
- var div = d3.select("body").selectAll(function() { return this.getElementsByClassName("div"); });
- assert.isTrue(Array.isArray(div[0]));
- },
- "sets the parentNode to the document element": function(d3) {
- var selection = d3.selectAll("body"),
- document = d3.selection().node().ownerDocument;
- assert.strictEqual(selection[0].parentNode, document.documentElement);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/selection-select-test.js b/test/selection/selection-select-test.js
deleted file mode 100644
index 082fb7218eb4b8..00000000000000
--- a/test/selection/selection-select-test.js
+++ /dev/null
@@ -1,128 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.select");
-
-suite.addBatch({
- "select(body)": {
- topic: load("selection/selection").document(),
- "on a simple page": {
- topic: function(d3) {
- var body = d3.select("body");
- body.append("div").attr("class", "first");
- body.append("div").attr("class", "second");
- return body;
- },
- "selects the first matching element": function(body) {
- var div = body.select("div");
- assert.isTrue(div[0][0] === body.node().firstChild);
- assert.equal(div.length, 1);
- assert.equal(div[0].length, 1);
- assert.equal(div.attr("class"), "first");
- },
- "propagates parent node to the selected elements": function(body) {
- var div = body.select("div");
- assert.isNotNull(div[0].parentNode);
- assert.isTrue(div[0].parentNode === body.node().parentNode);
- assert.isTrue(div[0].parentNode === body[0].parentNode);
- },
- "propagates data to the selected elements": function(body) {
- var data = new Object(), div = body.data([data]).select("div");
- assert.strictEqual(div[0][0].__data__, data);
- },
- "does not propagate data if no data was specified": function(body) {
- delete body.node().__data__;
- var data = new Object(), div = body.select("div").data([data]);
- div = body.select("div");
- assert.strictEqual(div[0][0].__data__, data);
- assert.isUndefined(body.node().__data__);
- },
- "returns null if no match is found": function(body) {
- var span = body.select("span");
- assert.equal(span[0][0], null);
- assert.equal(span.length, 1);
- assert.equal(span[0].length, 1);
- },
- "can select via function": function(body) {
- body.append("foo");
- var d = {}, dd = [], ii = [], tt = [],
- s = body.data([d]).select(function(d, i) { dd.push(d); ii.push(i); tt.push(this); return this.firstChild; });
- assert.deepEqual(dd, [d], "expected data, got {actual}");
- assert.deepEqual(ii, [0], "expected index, got {actual}");
- assert.domEqual(tt[0], body.node(), "expected this, got {actual}");
- assert.domEqual(s[0][0], body.node().firstChild);
- delete body.node().__data__;
- }
- }
- }
-});
-
-suite.addBatch({
- "selectAll(div)": {
- topic: load("selection/selection").document(),
- "on a simple page": {
- topic: function(d3) {
- var div = d3.select("body").selectAll("div").data([0, 1]).enter().append("div");
- div.append("span").attr("class", "first");
- div.append("span").attr("class", "second");
- return div;
- },
- "selects the first matching element": function(div) {
- var span = div.select("span");
- assert.isTrue(span[0][0].parentNode === div[0][0]);
- assert.isTrue(span[0][1].parentNode === div[0][1]);
- assert.equal(span.length, 1);
- assert.equal(span[0].length, 2);
- assert.equal(span.attr("class"), "first");
- },
- "propagates parent node to the selected elements": function(div) {
- var span = div.select("span");
- assert.isNotNull(span[0].parentNode);
- assert.isTrue(span[0].parentNode === div.node().parentNode);
- assert.isTrue(span[0].parentNode === div[0].parentNode);
- },
- "propagates data to the selected elements": function(div) {
- var data = new Object(), span = div.data([data]).select("span");
- assert.strictEqual(span[0][0].__data__, data);
- },
- "does not propagate data if no data was specified": function(div) {
- delete div[0][0].__data__;
- delete div[0][1].__data__;
- var a = new Object(), b = new Object(), span = div.select("span").data([a, b]);
- span = div.select("span");
- assert.strictEqual(span[0][0].__data__, a);
- assert.strictEqual(span[0][1].__data__, b);
- assert.isUndefined(div[0][0].__data__);
- assert.isUndefined(div[0][1].__data__);
- },
- "returns null if no match is found": function(div) {
- var div = div.select("div");
- assert.equal(div[0][0], null);
- assert.equal(div[0][1], null);
- assert.equal(div.length, 1);
- assert.equal(div[0].length, 2);
- },
- "can select via function": function(div) {
- var dd = [], ii = [], tt = [],
- s = div.data(["a", "b"]).select(function(d, i) { dd.push(d); ii.push(i); tt.push(this); return this.firstChild; });
- assert.deepEqual(dd, ["a", "b"], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.domEqual(tt[0], div[0][0], "expected this, got {actual}");
- assert.domEqual(tt[1], div[0][1], "expected this, got {actual}");
- assert.domEqual(s[0][0], div[0][0].firstChild);
- assert.domEqual(s[0][1], div[0][1].firstChild);
- },
- "ignores null nodes": function(div) {
- div[0][1] = null;
- var span = div.select("span");
- assert.equal(span.length, 1);
- assert.equal(span[0].length, 2);
- assert.isTrue(span[0][0].parentNode === div[0][0]);
- assert.isNull(span[0][1]);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/selection-selectAll-test.js b/test/selection/selection-selectAll-test.js
deleted file mode 100644
index 1506b5cc9e620f..00000000000000
--- a/test/selection/selection-selectAll-test.js
+++ /dev/null
@@ -1,131 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.selectAll");
-
-suite.addBatch({
- "select(body)": {
- topic: load("selection/selection").document(),
- "on a simple page": {
- topic: function(d3) {
- var body = d3.select("body");
- body.append("div").attr("class", "first");
- body.append("div").attr("class", "second");
- return body;
- },
- "selects all matching elements": function(body) {
- var div = body.selectAll("div");
- assert.isTrue(div[0][0] === body.node().firstChild);
- assert.isTrue(div[0][1] === body.node().lastChild);
- assert.equal(div.length, 1);
- assert.equal(div[0].length, 2);
- },
- "propagates parent node to the selected elements": function(body) {
- var div = body.selectAll("div");
- assert.isNotNull(div[0].parentNode);
- assert.isTrue(div[0].parentNode === body.node());
- },
- "does not propagate data if data was specified": function(body) {
- var div = body.data([new Object()]).selectAll("div");
- assert.isUndefined(div[0][0].__data__);
- assert.isUndefined(div[0][1].__data__);
- },
- "does not propagate data if data was not specified": function(body) {
- var div = body.selectAll("div").data([1, 2]);
- div = body.data([new Object()]).selectAll("div");
- assert.equal(div[0][0].__data__, 1);
- assert.equal(div[0][1].__data__, 2);
- },
- "returns empty array if no match is found": function(body) {
- var span = body.selectAll("span");
- assert.equal(span.length, 1);
- assert.equal(span[0].length, 0);
- },
- "can select via function": function(body) {
- var d = {}, dd = [], ii = [], tt = [],
- s = body.data([d]).selectAll(function(d, i) { dd.push(d); ii.push(i); tt.push(this); return this.childNodes; });
- assert.deepEqual(dd, [d], "expected data, got {actual}");
- assert.deepEqual(ii, [0], "expected index, got {actual}");
- assert.domEqual(tt[0], body.node(), "expected this, got {actual}");
- assert.domEqual(s[0][0], body.node().firstChild);
- assert.domEqual(s[0][1], body.node().lastChild);
- delete body.node().__data__;
- }
- }
- }
-});
-
-suite.addBatch({
- "selectAll(div)": {
- topic: load("selection/selection").document(),
- "on a simple page": {
- topic: function(d3) {
- var div = d3.select("body").append("div").selectAll("div").data([0, 1]).enter().append("div");
- div.append("span").attr("class", "first");
- div.append("span").attr("class", "second");
- return div;
- },
- "selects all matching elements": function(div) {
- var span = div.selectAll("span");
- assert.equal(span.length, 2);
- assert.equal(span[0].length, 2);
- assert.isTrue(span[0][0].parentNode === div[0][0]);
- assert.isTrue(span[0][1].parentNode === div[0][0]);
- assert.isTrue(span[1][0].parentNode === div[0][1]);
- assert.isTrue(span[1][1].parentNode === div[0][1]);
- },
- "propagates parent node to the selected elements": function(div) {
- var span = div.selectAll("span");
- assert.isNotNull(span[0].parentNode);
- assert.isTrue(span[0].parentNode === div[0][0]);
- assert.isTrue(span[1].parentNode === div[0][1]);
- },
- "does not propagate data if data was specified": function(div) {
- var span = div.selectAll("span");
- delete span[0][0].__data__;
- delete span[0][1].__data__;
- span = div.data([new Object(), new Object()]).selectAll("span");
- assert.isUndefined(span[0][0].__data__);
- assert.isUndefined(span[0][1].__data__);
- },
- "does not propagate data if data was not specified": function(div) {
- var a = new Object(), b = new Object(), span = div.selectAll("span").data([a, b]);
- delete div[0][0].__data__;
- delete div[0][1].__data__;
- span = div.selectAll("span");
- assert.equal(span[0][0].__data__, a);
- assert.equal(span[0][1].__data__, b);
- },
- "returns empty array if no match is found": function(div) {
- var div = div.selectAll("div");
- assert.equal(div.length, 2);
- assert.equal(div[0].length, 0);
- assert.equal(div[1].length, 0);
- },
- "can select via function": function(div) {
- var dd = [], ii = [], tt = [],
- s = div.data(["a", "b"]).selectAll(function(d, i) { dd.push(d); ii.push(i); tt.push(this); return this.childNodes; });
- assert.deepEqual(dd, ["a", "b"], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.domEqual(tt[0], div[0][0], "expected this, got {actual}");
- assert.domEqual(tt[1], div[0][1], "expected this, got {actual}");
- assert.domEqual(s[0][0], div[0][0].firstChild);
- assert.domEqual(s[0][1], div[0][0].lastChild);
- assert.domEqual(s[1][0], div[0][1].firstChild);
- assert.domEqual(s[1][1], div[0][1].lastChild);
- },
- "ignores null nodes": function(div) {
- var node = div[0][1];
- div[0][1] = null;
- var span = div.selectAll("span");
- assert.equal(span.length, 1);
- assert.equal(span[0].length, 2);
- assert.isTrue(span[0][0].parentNode === div[0][0]);
- assert.isTrue(span[0][1].parentNode === div[0][0]);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/selection-test.js b/test/selection/selection-test.js
deleted file mode 100644
index 313ad4aa75c2a2..00000000000000
--- a/test/selection/selection-test.js
+++ /dev/null
@@ -1,38 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.selection");
-
-suite.addBatch({
- "selection": {
- topic: load("selection/selection").document(),
- "selects the document element": function(d3) {
- var selection = d3.selection();
- assert.equal(selection.length, 1);
- assert.equal(selection[0].length, 1);
- assert.equal(selection[0][0].nodeType, 1);
- assert.equal(selection[0][0].tagName, "HTML");
- },
- "the parentNode is also the document element": function(d3) {
- var parentNode = d3.selection()[0].parentNode;
- assert.equal(parentNode.nodeType, 1);
- assert.equal(parentNode.tagName, "HTML");
- },
- "is an instanceof d3.selection": function(d3) {
- assert.instanceOf(d3.selection(), d3.selection);
- },
- "subselections are also instanceof d3.selection": function(d3) {
- assert.instanceOf(d3.selection().select("body"), d3.selection);
- assert.instanceOf(d3.selection().selectAll("body"), d3.selection);
- },
- "selection prototype can be extended": function(d3) {
- d3.selection.prototype.foo = function(v) { return this.attr("foo", v); };
- var body = d3.selection().select("body").foo(42);
- assert.equal(body.attr("foo"), "42");
- delete d3.selection.prototype.foo;
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/size-test.js b/test/selection/size-test.js
deleted file mode 100644
index f9c86cb7a44f87..00000000000000
--- a/test/selection/size-test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.size");
-
-suite.addBatch({
- "select(body)": {
- topic: load("selection/size").document(),
- "on a simple page": {
- topic: function(d3) {
- return d3.select("body");
- },
- "returns zero for empty selections": function(body) {
- assert.equal(body.select("foo").size(), 0);
- },
- "returns one for a singleton selection": function(body) {
- assert.equal(body.size(), 1);
- },
- "does not count null nodes": function(body) {
- body[0][0] = null;
- assert.equal(body.size(), 0);
- }
- }
- }
-});
-
-suite.addBatch({
- "selectAll(div)": {
- topic: load("selection/size").document(),
- "on a simple page": {
- topic: function(d3) {
- var body = d3.select("body");
- body.append("div").append("span");
- body.append("div");
- return body.selectAll("div");
- },
- "returns null for empty selections": function(div) {
- assert.equal(div.select("foo").size(), 0);
- },
- "returns the number of non-null nodes": function(div) {
- assert.equal(div.size(), 2);
- },
- "does not count null nodes": function(div) {
- div[0][0] = null;
- assert.equal(div.size(), 1);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/sort-test.js b/test/selection/sort-test.js
deleted file mode 100644
index 73c7d9ba2c2abd..00000000000000
--- a/test/selection/sort-test.js
+++ /dev/null
@@ -1,81 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.sort");
-
-suite.addBatch({
- "selectAll(div).selectAll(span)": {
- topic: load("selection/sort").document(),
- "on a page with some spans": {
- topic: function(d3) {
- return d3.select("body").append("div").selectAll("div")
- .data([1, 2, 10, 20])
- .enter().append("div")
- .selectAll("span")
- .data(function(d) { return [20 + d, 2 + d, 10, 1]; })
- .enter().append("span");
- },
- "sorts elements by natural order": function(span) {
- span.sort();
- assert.domNull(span[0][0].previousSibling);
- assert.domEqual(span[0][1].previousSibling, span[0][0]);
- assert.domEqual(span[0][2].previousSibling, span[0][1]);
- assert.domEqual(span[0][3].previousSibling, span[0][2]);
- assert.domNull(span[0][3].nextSibling);
- },
- "sorts each group independently": function(span) {
- span.sort(function(a, b) { return b - a; });
- assert.deepEqual(span[0].map(data), [21, 10, 3, 1]);
- assert.deepEqual(span[1].map(data), [22, 10, 4, 1]);
- assert.deepEqual(span[2].map(data), [30, 12, 10, 1]);
- assert.deepEqual(span[3].map(data), [40, 22, 10, 1]);
- },
- "sorts using the specified comparator": function(span) {
- span.sort(function(a, b) { return (a + "").localeCompare(b + ""); });
- assert.deepEqual(span[0].map(data), [1, 10, 21, 3]);
- assert.deepEqual(span[1].map(data), [1, 10, 22, 4]);
- assert.deepEqual(span[2].map(data), [1, 10, 12, 30]);
- assert.deepEqual(span[3].map(data), [1, 10, 22, 40]);
- },
- "returns the current selection": function(span) {
- assert.isTrue(span.sort() === span);
- },
- "sorts null nodes at the end of the selection": function(span) {
- var nulls = 0;
- span[0][0].parentNode.removeChild(span[0][0]);
- span[0][2].parentNode.removeChild(span[0][2]);
- span[0][0] = span[0][2] = null;
- span.sort(function(a, b) { if ((a === null) || (b === null)) ++nulls; return a - b; });
- assert.equal(nulls, 0);
-
- assert.domNull(span[0][2]);
- assert.domNull(span[0][3]);
- assert.domNull(span[0][0].previousSibling);
- assert.domEqual(span[0][1], span[0][0].nextSibling);
- assert.domEqual(span[0][0], span[0][1].previousSibling);
- assert.domNull(span[0][1].nextSibling);
- assert.deepEqual(span[0].slice(0, -2).map(data), [3, 21]);
-
- for (var i = 1; i < 4; ++i) {
- var d = span[i].parentNode.__data__;
- assert.domNull(span[i][0].previousSibling);
- assert.domEqual(span[i][1], span[i][0].nextSibling);
- assert.domEqual(span[i][0], span[i][1].previousSibling);
- assert.domEqual(span[i][2], span[i][1].nextSibling);
- assert.domEqual(span[i][1], span[i][2].previousSibling);
- assert.domEqual(span[i][3], span[i][2].nextSibling);
- assert.domEqual(span[i][2], span[i][3].previousSibling);
- assert.domNull(span[i][3].nextSibling);
- assert.deepEqual(span[i].map(data), [1, 2 + d, 10, 20 + d].sort(function(a, b) { return a - b; }));
- }
- }
- }
- }
-});
-
-function data(d) {
- return d.__data__;
-}
-
-suite.export(module);
diff --git a/test/selection/style-test.js b/test/selection/style-test.js
deleted file mode 100644
index bdadc78b737e44..00000000000000
--- a/test/selection/style-test.js
+++ /dev/null
@@ -1,129 +0,0 @@
-var vows = require("vows"),
- _ = require("../../"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.style");
-
-suite.addBatch({
- "on select(body)": {
- topic: load("selection/style").document(),
- "on an initially-empty page": {
- topic: function(d3) {
- return d3.select("body");
- },
- "sets a property as a string": function(body) {
- body.style("background-color", "red");
- assert.equal(body.node().style.getPropertyValue("background-color"), "red");
- },
- "sets a property as a number": function(body) {
- body.style("opacity", .3);
- assert.equal(body.node().style.getPropertyValue("opacity"), "0.3");
- },
- "sets a property as a function": function(body) {
- body.style("background-color", function() { return "orange"; });
- assert.equal(body.node().style.getPropertyValue("background-color"), "orange");
- },
- "sets properties as a map of constants": function(body) {
- body.style({"background-color": "white", opacity: .42});
- assert.equal(body.node().style.getPropertyValue("background-color"), "white");
- assert.equal(body.node().style.getPropertyValue("opacity"), "0.42");
- },
- "sets properties as a map of functions": function(body) {
- body.data(["orange"]).style({"background-color": String, opacity: function(d, i) { return i; }});
- assert.equal(body.node().style.getPropertyValue("background-color"), "orange");
- assert.equal(body.node().style.getPropertyValue("opacity"), "0");
- },
- "gets a property value": function(body) {
- body.node().style.setProperty("background-color", "yellow", "");
- assert.equal(body.style("background-color"), "yellow");
- },
- "observes the specified priority": function(body) {
- body.style("background-color", "green", "important");
- assert.equal(body.node().style.getPropertyPriority("background-color"), "important");
- body.style({opacity: .52}, "important");
- assert.equal(body.node().style.getPropertyPriority("opacity"), "important");
- body.style({visibility: function() { return "visible"; }}, "important");
- assert.equal(body.node().style.getPropertyPriority("visibility"), "important");
- },
- "removes a property as null": function(body) {
- body.style("background-color", "green").style("background-color", null);
- assert.equal(body.style("background-color"), "");
- },
- "removes a property as a function": function(body) {
- body.style("background-color", "green").style("background-color", function() { return null; });
- assert.equal(body.style("background-color"), "");
- },
- "removes properties as a map of nulls": function(body) {
- body.node().style.setProperty("background-color", "purple");
- body.style({"background-color": null});
- assert.equal(body.style("background-color"), "");
- },
- "removes properties as a map of functions that return null": function(body) {
- body.node().style.setProperty("background-color", "purple");
- body.style({"background-color": function() {}});
- assert.equal(body.style("background-color"), "");
- },
- "returns the current selection": function(body) {
- assert.isTrue(body.style("background-color", "green") === body);
- }
- }
- }
-});
-
-suite.addBatch({
- "on selectAll(div)": {
- topic: load("selection/style").document(),
- "on a page with a few divs": {
- topic: function(d3) {
- return d3.select("body").selectAll("div").data([0, 1]).enter().append("div");
- },
- "sets a property as a string": function(div) {
- div.style("background-color", "red");
- assert.equal(div[0][0].style.getPropertyValue("background-color"), "red");
- assert.equal(div[0][1].style.getPropertyValue("background-color"), "red");
- },
- "sets a property as a number": function(div) {
- div.style("opacity", .5);
- assert.equal(div[0][0].style.getPropertyValue("opacity"), "0.5");
- assert.equal(div[0][1].style.getPropertyValue("opacity"), "0.5");
- },
- "sets a property as a function": function(div) {
- div.style("background-color", _.interpolateRgb("orange", "yellow"));
- assert.equal(div[0][0].style.getPropertyValue("background-color"), "#ffa500");
- assert.equal(div[0][1].style.getPropertyValue("background-color"), "#ffff00");
- },
- "gets a property value": function(div) {
- div[0][0].style.setProperty("background-color", "green", "");
- assert.equal(div.style("background-color"), "green");
- },
- "observes the specified priority": function(div) {
- div.style("background-color", "blue", "important");
- assert.equal(div[0][0].style.getPropertyPriority("background-color"), "important");
- assert.equal(div[0][1].style.getPropertyPriority("background-color"), "important");
- },
- "removes a property as null": function(div) {
- div.style("background-color", "red").style("background-color", null);
- assert.equal(div[0][0].style.getPropertyValue("background-color"), "");
- assert.equal(div[0][1].style.getPropertyValue("background-color"), "");
- },
- "removes a property as a function": function(div) {
- div.style("background-color", "red").style("background-color", function() { return null; });
- assert.equal(div[0][0].style.getPropertyValue("background-color"), "");
- assert.equal(div[0][1].style.getPropertyValue("background-color"), "");
- },
- "returns the current selection": function(div) {
- assert.isTrue(div.style("background-color", "green") === div);
- },
- "ignores null nodes": function(div) {
- var node = div[0][1];
- div[0][1] = null;
- div.style("background-color", null).style("background-color", "red");
- assert.equal(div[0][0].style.getPropertyValue("background-color"), "red");
- assert.equal(node.style.getPropertyValue("background-color"), "green");
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/selection/text-test.js b/test/selection/text-test.js
deleted file mode 100644
index 13f994a86d45f9..00000000000000
--- a/test/selection/text-test.js
+++ /dev/null
@@ -1,115 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("selection.text");
-
-suite.addBatch({
- "on select(body)": {
- topic: load("selection/text").document(),
- "on an initially-empty page": {
- topic: function(d3) {
- return d3.select("body");
- },
- "sets the text content as a string": function(body) {
- body.text("Hello, world!");
- assert.equal(body.node().textContent, "Hello, world!");
- },
- "sets the text content as a number": function(body) {
- body.text(42);
- assert.equal(body.node().textContent, "42");
- },
- "sets the text content as a function": function(body) {
- body.data(["Subject"]).text(function(d, i) { return "Hello, " + d + " " + i + "!"; });
- assert.equal(body.node().textContent, "Hello, Subject 0!");
- },
- "escapes html content to text": function(body) {
- body.text("Hello, world!
");
- assert.equal(body.node().textContent, "Hello, world!
");
- assert.equal(body.node().firstChild.nodeType, 3);
- },
- "clears the text content as null": function(body) {
- body.text(null);
- assert.equal(body.node().textContent, "");
- },
- "clears the text content as undefined": function(body) {
- body.text(undefined);
- assert.equal(body.node().textContent, "");
- },
- "clears the text content as a function returning null": function(body) {
- body.text(function() { return null; });
- assert.equal(body.node().textContent, "");
- },
- "clears the text content as a function returning undefined": function(body) {
- body.text(function() { return undefined; });
- assert.equal(body.node().textContent, "");
- },
- "returns the current selection": function(body) {
- assert.isTrue(body.text("hello") === body);
- },
- "ignores null nodes": function(body) {
- var node = body.node();
- node.textContent = "foo";
- body[0][0] = null;
- body.text("bar");
- assert.equal(node.textContent, "foo");
- }
- }
- }
-});
-
-suite.addBatch({
- "on selectAll(div)": {
- topic: load("selection/text").document(),
- "on a page with a few divs": {
- topic: function(d3) {
- return d3.select("body").selectAll("div").data([0, 1]).enter().append("div");
- },
- "sets the text content as a string": function(div) {
- div.text("Hello, world!");
- assert.equal(div[0][0].textContent, "Hello, world!");
- assert.equal(div[0][1].textContent, "Hello, world!");
- },
- "sets the text content as a number": function(div) {
- div.text(42);
- assert.equal(div[0][0].textContent, "42");
- assert.equal(div[0][1].textContent, "42");
- },
- "sets the text content as a function": function(div) {
- div.data(["foo", "bar"]).text(function(d, i) { return "Hello, " + d + " " + i + "!"; });
- assert.equal(div[0][0].textContent, "Hello, foo 0!");
- assert.equal(div[0][1].textContent, "Hello, bar 1!");
- },
- "escapes html content to text": function(div) {
- div.text("Hello, world!
");
- assert.equal(div[0][0].textContent, "Hello, world!
");
- assert.equal(div[0][1].textContent, "Hello, world!
");
- assert.equal(div[0][0].firstChild.nodeType, 3);
- assert.equal(div[0][1].firstChild.nodeType, 3);
- },
- "clears the text content as null": function(div) {
- div.text(null);
- assert.equal(div[0][0].textContent, "");
- assert.equal(div[0][1].textContent, "");
- },
- "clears the text content as a function": function(div) {
- div.text(function() { return null; });
- assert.equal(div[0][0].textContent, "");
- assert.equal(div[0][1].textContent, "");
- },
- "returns the current selection": function(div) {
- assert.isTrue(div.text("hello") === div);
- },
- "ignores null nodes": function(div) {
- var node = div[0][0];
- node.textContent = "foo";
- div[0][0] = null;
- div.text("bar");
- assert.equal(node.textContent, "foo");
- assert.equal(div[0][1].textContent, "bar");
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/svg/arc-test.js b/test/svg/arc-test.js
deleted file mode 100644
index 393856e1414e13..00000000000000
--- a/test/svg/arc-test.js
+++ /dev/null
@@ -1,143 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.svg.arc");
-
-suite.addBatch({
- "arc": {
- topic: load("svg/arc").expression("d3.svg.arc"),
-
- "innerRadius defaults to a function accessor": function(arc) {
- var a = arc().outerRadius(100).startAngle(0).endAngle(Math.PI);
- assert.pathEqual(a({innerRadius: 0}), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- assert.pathEqual(a({innerRadius: 50}), "M0,-100A100,100 0 1,1 0,100L0,50A50,50 0 1,0 0,-50Z");
- },
- "innerRadius can be defined as a constant": function(arc) {
- var a = arc().outerRadius(100).startAngle(0).endAngle(Math.PI);
- assert.pathEqual(a.innerRadius(0)(), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- assert.pathEqual(a.innerRadius(50)(), "M0,-100A100,100 0 1,1 0,100L0,50A50,50 0 1,0 0,-50Z");
- },
- "innerRadius can be defined as a function of data or index": function(arc) {
- var a = arc().innerRadius(f).outerRadius(100).startAngle(0).endAngle(Math.PI), o = {}, t = {}, dd, ii, tt;
- function f(d, i) { dd = d; ii = i; tt = this; return 42; }
- assert.pathEqual(a.call(t, o, 2), "M0,-100A100,100 0 1,1 0,100L0,42A42,42 0 1,0 0,-42Z");
- assert.equal(dd, o, "expected data, got {actual}");
- assert.equal(ii, 2, "expected index, got {actual}");
- assert.equal(tt, t, "expected this, got {actual}");
- },
-
- "outerRadius defaults to a function accessor": function(arc) {
- var a = arc().innerRadius(0).startAngle(0).endAngle(Math.PI);
- assert.pathEqual(a({outerRadius: 50}), "M0,-50A50,50 0 1,1 0,50L0,0Z");
- assert.pathEqual(a({outerRadius: 100}), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- },
- "outerRadius can be defined as a constant": function(arc) {
- var a = arc().innerRadius(0).startAngle(0).endAngle(Math.PI);
- assert.pathEqual(a.outerRadius(50)(), "M0,-50A50,50 0 1,1 0,50L0,0Z");
- assert.pathEqual(a.outerRadius(100)(), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- },
- "outerRadius can be defined as a function of data or index": function(arc) {
- var a = arc().innerRadius(0).outerRadius(f).startAngle(0).endAngle(Math.PI), o = {}, t = {}, dd, ii, tt;
- function f(d, i) { dd = d; ii = i; tt = this; return 42; }
- assert.pathEqual(a.call(t, o, 2), "M0,-42A42,42 0 1,1 0,42L0,0Z");
- assert.equal(dd, o, "expected data, got {actual}");
- assert.equal(ii, 2, "expected index, got {actual}");
- assert.equal(tt, t, "expected this, got {actual}");
- },
-
- "startAngle defaults to a function accessor": function(arc) {
- var a = arc().innerRadius(0).outerRadius(100).endAngle(Math.PI);
- assert.pathEqual(a({startAngle: 0}), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- assert.pathEqual(a({startAngle: Math.PI / 2}), "M100,0A100,100 0 0,1 0,100L0,0Z");
- },
- "startAngle can be defined as a constant": function(arc) {
- var a = arc().innerRadius(0).outerRadius(100).endAngle(Math.PI);
- assert.pathEqual(a.startAngle(0)(), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- assert.pathEqual(a.startAngle(Math.PI / 2)(), "M100,0A100,100 0 0,1 0,100L0,0Z");
- },
- "startAngle can be defined as a function of data or index": function(arc) {
- var a = arc().innerRadius(0).outerRadius(100).startAngle(f).endAngle(Math.PI), o = {}, t = {}, dd, ii, tt;
- function f(d, i) { dd = d; ii = i; tt = this; return Math.PI; }
- assert.pathEqual(a.call(t, o, 2), "M0,100A100,100 0 0,1 0,100L0,0Z");
- assert.equal(dd, o, "expected data, got {actual}");
- assert.equal(ii, 2, "expected index, got {actual}");
- assert.equal(tt, t, "expected this, got {actual}");
- },
-
- "endAngle defaults to a function accessor": function(arc) {
- var a = arc().innerRadius(0).outerRadius(100).startAngle(0);
- assert.pathEqual(a({endAngle: Math.PI / 2}), "M0,-100A100,100 0 0,1 100,0L0,0Z");
- assert.pathEqual(a({endAngle: Math.PI}), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- },
- "endAngle can be defined as a constant": function(arc) {
- var a = arc().innerRadius(0).outerRadius(100).startAngle(0);
- assert.pathEqual(a.endAngle(Math.PI / 2)(), "M0,-100A100,100 0 0,1 100,0L0,0Z");
- assert.pathEqual(a.endAngle(Math.PI)(), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- },
- "endAngle can be defined as a function of data or index": function(arc) {
- var a = arc().innerRadius(0).outerRadius(100).startAngle(0).endAngle(f), o = {}, t = {}, dd, ii, tt;
- function f(d, i) { dd = d; ii = i; tt = this; return Math.PI; }
- assert.pathEqual(a.call(t, o, 2), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- assert.equal(dd, o, "expected data, got {actual}");
- assert.equal(ii, 2, "expected index, got {actual}");
- assert.equal(tt, t, "expected this, got {actual}");
- },
-
- "startAngle and endAngle are swapped if endAngle is less than startAngle": function(arc) {
- var a = arc().innerRadius(50).outerRadius(100);
- assert.pathEqual(a.startAngle(2 * Math.PI).endAngle(Math.PI)(), a.startAngle(Math.PI).endAngle(2 * Math.PI)());
- assert.pathEqual(a.startAngle(-Math.PI).endAngle(Math.PI)(), a.startAngle(Math.PI).endAngle(-Math.PI)());
- },
-
- "angles are defined in radians, with zero at 12 o'clock": function(arc) {
- var a = arc().innerRadius(0).outerRadius(100);
- assert.pathEqual(a.startAngle(0).endAngle(Math.PI)(), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- assert.pathEqual(a.startAngle(Math.PI).endAngle(2 * Math.PI)(), "M0,100A100,100 0 1,1 0,-100L0,0Z");
- },
- "radii are defined in local coordinates (typically pixels)": function(arc) {
- var a = arc().startAngle(0).endAngle(Math.PI);
- assert.pathEqual(a.innerRadius(0).outerRadius(100)(), "M0,-100A100,100 0 1,1 0,100L0,0Z");
- assert.pathEqual(a.innerRadius(100).outerRadius(200)(), "M0,-200A200,200 0 1,1 0,200L0,100A100,100 0 1,0 0,-100Z");
- },
- "draws a circle when inner radius is zero and angle is approximately 2π": function(arc) {
- var a = arc().innerRadius(0).outerRadius(100);
- assert.pathEqual(a.startAngle(0).endAngle(2 * Math.PI - 1e-9)(), "M0,100A100,100 0 1,1 0,-100A100,100 0 1,1 0,100Z");
- assert.pathEqual(a.startAngle(Math.PI + 1e-9).endAngle(3 * Math.PI - 1e-9)(), "M0,100A100,100 0 1,1 0,-100A100,100 0 1,1 0,100Z");
- },
- "draws a circle when inner radius is zero and angle is greater than 2π": function(arc) {
- var a = arc().innerRadius(0).outerRadius(100);
- assert.pathEqual(a.startAngle(0).endAngle(7)(), "M0,100A100,100 0 1,1 0,-100A100,100 0 1,1 0,100Z");
- assert.pathEqual(a.startAngle(1).endAngle(8)(), "M0,100A100,100 0 1,1 0,-100A100,100 0 1,1 0,100Z");
- },
- "draws a circular sector when inner radius is zero and angle is less than 2π": function(arc) {
- var a = arc().innerRadius(0).outerRadius(100);
- assert.pathEqual(a.startAngle(0).endAngle(Math.PI / 2)(), "M0,-100A100,100 0 0,1 100,0L0,0Z");
- },
- "draws an annulus when inner radius is non-zero and angle is approximately 2π": function(arc) {
- var a = arc().innerRadius(100).outerRadius(200);
- assert.pathEqual(a.startAngle(0).endAngle(2 * Math.PI - 1e-9)(), "M0,200A200,200 0 1,1 0,-200A200,200 0 1,1 0,200M0,100A100,100 0 1,0 0,-100A100,100 0 1,0 0,100Z");
- assert.pathEqual(a.startAngle(Math.PI + 1e-9).endAngle(3 * Math.PI - 1e-9)(), "M0,200A200,200 0 1,1 0,-200A200,200 0 1,1 0,200M0,100A100,100 0 1,0 0,-100A100,100 0 1,0 0,100Z");
- },
- "draws an annulus when inner radius is non-zero and angle is greater than 2π": function(arc) {
- var a = arc().innerRadius(100).outerRadius(200);
- assert.pathEqual(a.startAngle(0).endAngle(7)(), "M0,200A200,200 0 1,1 0,-200A200,200 0 1,1 0,200M0,100A100,100 0 1,0 0,-100A100,100 0 1,0 0,100Z");
- assert.pathEqual(a.startAngle(-1).endAngle(6)(), "M0,200A200,200 0 1,1 0,-200A200,200 0 1,1 0,200M0,100A100,100 0 1,0 0,-100A100,100 0 1,0 0,100Z");
- },
- "draws an annular sector when both radii are non-zero and angle is less than 2π": function(arc) {
- var a = arc().innerRadius(100).outerRadius(200);
- assert.pathEqual(a.startAngle(0).endAngle(Math.PI / 2)(), "M0,-200A200,200 0 0,1 200,0L100,0A100,100 0 0,0 0,-100Z");
- },
-
- "computes the centroid as mid-radius and mid-angle": function(arc) {
- var c = arc().innerRadius(0).outerRadius(100).startAngle(0).endAngle(2 * Math.PI).centroid();
- assert.inDelta(c[0], 0, 1e-6);
- assert.inDelta(c[1], 50, 1e-6);
- var c = arc().innerRadius(100).outerRadius(200).startAngle(Math.PI).endAngle(2 * Math.PI).centroid();
- assert.inDelta(c[0], -150, 1e-6);
- assert.inDelta(c[1], 0, 1e-6);
- }
- }
-});
-
-suite.export(module);
diff --git a/test/svg/area-radial-test.js b/test/svg/area-radial-test.js
deleted file mode 100644
index d837217b1fcf3a..00000000000000
--- a/test/svg/area-radial-test.js
+++ /dev/null
@@ -1,199 +0,0 @@
-var vows = require("vows"),
- _ = require("../../"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.svg.area.radial");
-
-suite.addBatch({
- "area.radial": {
- topic: load("svg/area-radial").expression("d3.svg.area.radial"),
-
- "radius is an alias for setting innerRadius and outerRadius": function(area) {
- var a = area().radius(f);
- function f() {}
- assert.equal(a.radius(), f);
- assert.equal(a.innerRadius(), f);
- assert.equal(a.outerRadius(), f);
- },
- "radius is an alias for getting outerRadius": function(area) {
- var a = area().outerRadius(f);
- function f() {}
- assert.equal(a.radius(), f);
- },
-
- "angle is an alias for setting startAngle and endAngle": function(area) {
- var a = area().angle(f);
- function f() {}
- assert.equal(a.angle(), f);
- assert.equal(a.startAngle(), f);
- assert.equal(a.endAngle(), f);
- },
- "angle is an alias for getting endAngle": function(area) {
- var a = area().endAngle(f);
- function f() {}
- assert.equal(a.angle(), f);
- },
-
- "innerRadius defaults to a function accessor": function(area) {
- var a = area();
- assert.pathEqual(a([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10L16.829420,-10.806046L18.185949,8.322937L1.411200,9.899925L0,-10L0,-20L0,-20L0,-10Z");
- assert.typeOf(a.innerRadius(), "function");
- },
- "innerRadius can be defined as a constant": function(area) {
- var a = area().innerRadius(30);
- assert.pathEqual(a([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10L16.829420,-10.806046L18.185949,8.322937L1.411200,9.899925L0,-30L0,-30L0,-30L0,-30Z");
- assert.equal(a.innerRadius(), 30);
- },
- "innerRadius can be defined as a function": function(area) {
- var a = area().innerRadius(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 30; }
- assert.pathEqual(a.call(t, [[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10L16.829420,-10.806046L18.185949,8.322937L1.411200,9.899925L0,-30L0,-30L0,-30L0,-30Z");
- assert.deepEqual(dd, [[10, 0], [20, 1], [20, 2], [10, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1, 2, 3], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t, t, t], "expected this, got {actual}");
- },
-
- "outerRadius defaults to a function accessor": function(area) {
- var a = area();
- assert.pathEqual(a([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10L16.829420,-10.806046L18.185949,8.322937L1.411200,9.899925L0,-10L0,-20L0,-20L0,-10Z");
- assert.typeOf(a.outerRadius(), "function");
- },
- "outerRadius can be defined as a constant": function(area) {
- var a = area().outerRadius(30);
- assert.pathEqual(a([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-30L25.244130,-16.209069L27.278923,12.484405L4.233600,29.699775L0,-10L0,-20L0,-20L0,-10Z");
- assert.equal(a.outerRadius(), 30);
- },
- "outerRadius can be defined as a function": function(area) {
- var a = area().outerRadius(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 30; }
- assert.pathEqual(a.call(t, [[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-30L25.244130,-16.209069L27.278923,12.484405L4.233600,29.699775L0,-10L0,-20L0,-20L0,-10Z");
- assert.deepEqual(dd, [[10, 0], [20, 1], [20, 2], [10, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1, 2, 3], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t, t, t], "expected this, got {actual}");
- },
-
- "startAngle defaults to zero": function(area) {
- var a = area();
- assert.pathEqual(a([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10L16.829420,-10.806046L18.185949,8.322937L1.411200,9.899925L0,-10L0,-20L0,-20L0,-10Z");
- assert.equal(a.startAngle(), 0);
- },
- "startAngle can be defined as a constant": function(area) {
- var a = area().startAngle(Math.PI / 2);
- assert.pathEqual(a([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10L16.829420,-10.806046L18.185949,8.322937L1.411200,9.899925L10,0L20,0L20,0L10,0Z");
- assert.equal(a.startAngle(), Math.PI / 2);
- },
- "startAngle can be defined as a function": function(area) {
- var a = area().startAngle(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return Math.PI / 2; }
- assert.pathEqual(a.call(t, [[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10L16.829420,-10.806046L18.185949,8.322937L1.411200,9.899925L10,0L20,0L20,0L10,0Z");
- assert.deepEqual(dd, [[10, 0], [20, 1], [20, 2], [10, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1, 2, 3], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t, t, t], "expected this, got {actual}");
- },
-
- "endAngle defaults to a function accessor": function(area) {
- var a = area();
- assert.pathEqual(a([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10L16.829420,-10.806046L18.185949,8.322937L1.411200,9.899925L0,-10L0,-20L0,-20L0,-10Z");
- assert.typeOf(a.endAngle(), "function");
- },
- "endAngle can be defined as a constant": function(area) {
- var a = area().endAngle(Math.PI / 2);
- assert.pathEqual(a([[10, 0], [20, 1], [20, 2], [10, 3]]), "M10,0L20,0L20,0L10,0L0,-10L0,-20L0,-20L0,-10Z");
- assert.equal(a.endAngle(), Math.PI / 2);
- },
- "endAngle can be defined as a function": function(area) {
- var a = area().endAngle(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return Math.PI / 2; }
- assert.pathEqual(a.call(t, [[10, 0], [20, 1], [20, 2], [10, 3]]), "M10,0L20,0L20,0L10,0L0,-10L0,-20L0,-20L0,-10Z");
- assert.deepEqual(dd, [[10, 0], [20, 1], [20, 2], [10, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1, 2, 3], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t, t, t], "expected this, got {actual}");
- },
-
- "if innerRadius === outerRadius, radius is only evaluated once per point": function(area) {
- var a = area().radius(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 30; }
- assert.pathEqual(a.call(t, [[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-30L25.244130,-16.209069L27.278923,12.484405L4.233600,29.699775L0,-30L0,-30L0,-30L0,-30Z");
- assert.deepEqual(dd, [[10, 0], [20, 1], [20, 2], [10, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1, 2, 3], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t, t, t], "expected this, got {actual}");
- },
- "if startAngle === endAngle, angle is only evaluated once per point": function(area) {
- var a = area().angle(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return Math.PI / 2; }
- assert.pathEqual(a.call(t, [[10, 0], [20, 1], [20, 2], [10, 3]]), "M10,0L20,0L20,0L10,0L10,0L20,0L20,0L10,0Z");
- assert.deepEqual(dd, [[10, 0], [20, 1], [20, 2], [10, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1, 2, 3], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t, t, t], "expected this, got {actual}");
- },
-
- "interpolate defaults to linear": function(area) {
- assert.equal(area().interpolate(), "linear");
- },
- "interpolate can be defined as a constant": function(area) {
- var a = area().interpolate("step-before");
- assert.pathEqual(a([[0, 0], [1, 1]]), "M0,0V-0.540302H0.841471L0,-1H0V0Z");
- assert.equal(a.interpolate(), "step-before");
- },
-
- "tension defaults to .7": function(area) {
- assert.equal(area().tension(), .7);
- },
- "tension can be specified as a constant": function(area) {
- var a = area().tension(.5);
- assert.equal(a.tension(), .5);
- },
-
- "returns null if input points array is empty": function(area) {
- assert.isNull(area()([]));
- },
-
- "interpolate(linear)": {
- "supports linear interpolation": testInterpolation("linear")
- },
-
- "interpolate(step)": {
- "supports step-before interpolation": testInterpolation("step-before"),
- "supports step-after interpolation": testInterpolation("step-after")
- },
-
- "interpolate(basis)": {
- "supports basis interpolation": testInterpolation("basis"),
- "supports basis-open interpolation": testInterpolation("basis-open"),
- "supports basis-closed interpolation": testInterpolation("basis-closed")
- },
-
- "interpolate(cardinal)": {
- "supports cardinal interpolation": testInterpolation("cardinal"),
- "supports cardinal-open interpolation": testInterpolation("cardinal-open"),
- "supports cardinal-closed interpolation": testInterpolation("cardinal-closed")
- },
-
- "interpolate(monotone)": {
- "supports monotone interpolation": testInterpolation("monotone")
- }
- }
-});
-
-// A radial area is just a transformation of a Cartesian line.
-function testInterpolation(interpolate) {
- var data = [[10, 0], [20, 1], [20, 2], [10, 3]];
-
- var cartesian = _.svg.area()
- .x0(function(d) { return d[0] * Math.cos(d[1] - Math.PI / 2); })
- .x1(function(d) { return 2 * d[0] * Math.cos(d[1] - Math.PI / 2); })
- .y0(function(d) { return d[0] * Math.sin(d[1] - Math.PI / 2); })
- .y1(function(d) { return 2 * d[0] * Math.sin(d[1] - Math.PI / 2); });
-
- return function(area) {
- var radial = area()
- .innerRadius(function(d) { return d[0]; })
- .outerRadius(function(d) { return d[0] * 2; })
- .angle(function(d) { return d[1]; });
-
- assert.pathEqual(radial.interpolate(interpolate)(data), cartesian.interpolate(interpolate)(data));
- };
-}
-
-suite.export(module);
diff --git a/test/svg/area-test.js b/test/svg/area-test.js
deleted file mode 100644
index 289815c3a73ea1..00000000000000
--- a/test/svg/area-test.js
+++ /dev/null
@@ -1,192 +0,0 @@
-var vows = require("vows"),
- _ = require("../../"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.svg.area");
-
-suite.addBatch({
- "area": {
- topic: load("svg/area").expression("d3.svg.area"),
-
- "x is an alias for setting x0 and x1": function(area) {
- var a = area().x(f);
- function f() {}
- assert.equal(a.x(), f);
- assert.equal(a.x0(), f);
- assert.equal(a.x1(), f);
- },
- "x is an alias for getting x1": function(area) {
- var a = area().x1(f);
- function f() {}
- assert.equal(a.x(), f);
- },
-
- "y is an alias for setting y0 and y1": function(area) {
- var a = area().y(f);
- function f() {}
- assert.equal(a.y(), f);
- assert.equal(a.y0(), f);
- assert.equal(a.y1(), f);
- },
- "y is an alias for getting x1": function(area) {
- var a = area().y1(f);
- function f() {}
- assert.equal(a.y(), f);
- },
-
- "x0 defaults to a function accessor": function(area) {
- var a = area();
- assert.pathEqual(a([[1, 2], [4, 3]]), "M1,2L4,3L4,0L1,0Z");
- assert.typeOf(a.x0(), "function");
- },
- "x0 can be defined as a constant": function(area) {
- var a = area().x0(0);
- assert.pathEqual(a([[1, 2], [4, 3]]), "M1,2L4,3L0,0L0,0Z");
- assert.equal(a.x0(), 0);
- },
- "x0 can be defined as a function": function(area) {
- var a = area().x0(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 0; }
- assert.pathEqual(a.call(t, [[1, 2], [4, 3]]), "M1,2L4,3L0,0L0,0Z");
- assert.deepEqual(dd, [[1, 2], [4, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t], "expected this, got {actual}");
- },
-
- "x1 defaults to a function accessor": function(area) {
- var a = area();
- assert.pathEqual(a([[1, 2], [4, 3]]), "M1,2L4,3L4,0L1,0Z");
- assert.typeOf(a.x1(), "function");
- },
- "x1 can be defined as a constant": function(area) {
- var a = area().x1(0);
- assert.pathEqual(a([[1, 2], [4, 3]]), "M0,2L0,3L4,0L1,0Z");
- assert.equal(a.x1(), 0);
- },
- "x1 can be defined as a function": function(area) {
- var a = area().x1(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 0; }
- assert.pathEqual(a.call(t, [[1, 2], [4, 3]]), "M0,2L0,3L4,0L1,0Z");
- assert.deepEqual(dd, [[1, 2], [4, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t], "expected this, got {actual}");
- },
-
- "y0 defaults to zero": function(area) {
- var a = area();
- assert.pathEqual(a([[1, 2], [4, 3]]), "M1,2L4,3L4,0L1,0Z");
- assert.equal(a.y0(), 0);
- },
- "y0 can be defined as a constant": function(area) {
- var a = area().y0(1);
- assert.pathEqual(a([[1, 2], [4, 3]]), "M1,2L4,3L4,1L1,1Z");
- assert.equal(a.y0(), 1);
- },
- "y0 can be defined as a function": function(area) {
- var a = area().y0(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 1; }
- assert.pathEqual(a.call(t, [[1, 2], [4, 3]]), "M1,2L4,3L4,1L1,1Z");
- assert.deepEqual(dd, [[1, 2], [4, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t], "expected this, got {actual}");
- },
-
- "y1 defaults to a function accessor": function(area) {
- var a = area();
- assert.pathEqual(a([[1, 2], [4, 3]]), "M1,2L4,3L4,0L1,0Z");
- assert.typeOf(a.y1(), "function");
- },
- "y1 can be defined as a constant": function(area) {
- var a = area().y1(1);
- assert.pathEqual(a([[1, 2], [4, 3]]), "M1,1L4,1L4,0L1,0Z");
- assert.equal(a.y1(), 1);
- },
- "y1 can be defined as a function": function(area) {
- var a = area().y1(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 1; }
- assert.pathEqual(a.call(t, [[1, 2], [4, 3]]), "M1,1L4,1L4,0L1,0Z");
- assert.deepEqual(dd, [[1, 2], [4, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t], "expected this, got {actual}");
- },
-
- "if x0 === x1, x is only evaluated once per point": function(area) {
- var a = area().x(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 0; }
- assert.pathEqual(a.call(t, [[1, 2], [4, 3]]), "M0,2L0,3L0,0L0,0Z");
- assert.deepEqual(dd, [[1, 2], [4, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t], "expected this, got {actual}");
- },
- "if y0 === y1, y is only evaluated once per point": function(area) {
- var a = area().y(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 1; }
- assert.pathEqual(a.call(t, [[1, 2], [4, 3]]), "M1,1L4,1L4,1L1,1Z");
- assert.deepEqual(dd, [[1, 2], [4, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t], "expected this, got {actual}");
- },
-
- "interpolate defaults to linear": function(area) {
- assert.equal(area().interpolate(), "linear");
- },
- "interpolate can be defined as a constant": function(area) {
- var a = area().interpolate("step-before");
- assert.pathEqual(a([[0, 0], [1, 1]]), "M0,0V1H1L1,0H0V0Z");
- assert.equal(a.interpolate(), "step-before");
- },
- "invalid interpolates fallback to linear": function(area) {
- assert.equal(area().interpolate("__proto__").interpolate(), "linear");
- },
-
- "tension defaults to .7": function(area) {
- assert.equal(area().tension(), .7);
- },
- "tension can be specified as a constant": function(area) {
- var a = area().tension(.5);
- assert.equal(a.tension(), .5);
- },
-
- "returns null if input points array is empty": function(area) {
- assert.isNull(area()([]));
- },
-
- "interpolate(linear)": {
- "supports linear interpolation": testInterpolation("linear")
- },
-
- "interpolate(step)": {
- "supports step-before interpolation": testInterpolation("step-before", "step-after"),
- "supports step-after interpolation": testInterpolation("step-after", "step-before")
- },
-
- "interpolate(basis)": {
- "supports basis interpolation": testInterpolation("basis"),
- "supports basis-open interpolation": testInterpolation("basis-open")
- },
-
- "interpolate(cardinal)": {
- "supports cardinal interpolation": testInterpolation("cardinal"),
- "supports cardinal-open interpolation": testInterpolation("cardinal-open")
- },
-
- "interpolate(monotone)": {
- "supports monotone interpolation": testInterpolation("monotone")
- }
- }
-});
-
-// An area is just two lines, with one reversed.
-function testInterpolation(i0, i1) {
- if (arguments.length < 2) i1 = i0;
- return function(area) {
- var a = area().interpolate(i0),
- d = [[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]],
- l0 = _.svg.line().interpolate(i1).x(a.x0()).y(a.y0()),
- l1 = _.svg.line().interpolate(i0).x(a.x1()).y(a.y1());
- assert.pathEqual(a(d), l1(d) + "L" + l0(d.reverse()).substring(1) + "Z");
- };
-}
-
-suite.export(module);
diff --git a/test/svg/axis-test.js b/test/svg/axis-test.js
deleted file mode 100644
index ab0e2fec18a71c..00000000000000
--- a/test/svg/axis-test.js
+++ /dev/null
@@ -1,497 +0,0 @@
-var vows = require("vows"),
- _ = require("../../"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.svg.axis");
-
-suite.addBatch({
- "axis": {
- topic: load("svg/axis").document(),
-
- "scale": {
- "defaults to a linear scale": function(d3) {
- var a = d3.svg.axis(),
- x = a.scale();
- assert.deepEqual(x.domain(), [0, 1]);
- assert.deepEqual(x.range(), [0, 1]);
- assert.equal(x(0.5), 0.5);
- },
- "can be defined as a scale object": function(d3) {
- var x = _.scale.linear(),
- a = d3.svg.axis().scale(x);
- assert.equal(a.scale(), x);
- },
- "can be a polylinear scale": function(d3) {
- var x = _.scale.linear().domain([0, 1, 10]).range([2, 20, 200]),
- a = d3.svg.axis().scale(x),
- g = d3.select("body").html("").append("g").call(a),
- path = g.selectAll("path");
- assert.inDelta(g.selectAll(".tick").data(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1e-4);
- assert.inDelta(g.selectAll(".tick").data().map(x), [2, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200], 1e-4);
- assert.equal(path.attr("d"), "M2,6V0H200V6");
- },
- "can be an ordinal scale": function(d3) {
- var x = _.scale.ordinal().domain(["A", "B", "C"]).rangeBands([10, 90]),
- a = d3.svg.axis().scale(x),
- g = d3.select("body").html("").append("g").call(a),
- path = g.selectAll("path");
- assert.deepEqual(g.selectAll(".tick").data(), ["A", "B", "C"]);
- assert.inDelta(g.selectAll(".tick").data().map(x), [10, 36.6667, 63.3333], 1e-4);
- assert.equal(path.attr("d"), "M10,6V0H90V6");
- },
- "can be an ordinal scale with explicit range": function(d3) {
- var x = _.scale.ordinal().domain(["A", "B", "C"]).range([10, 50, 90]),
- a = d3.svg.axis().scale(x),
- g = d3.select("body").html("").append("g").call(a),
- path = g.selectAll("path");
- assert.deepEqual(g.selectAll(".tick").data(), ["A", "B", "C"]);
- assert.deepEqual(g.selectAll(".tick").data().map(x), [10, 50, 90]);
- assert.equal(path.attr("d"), "M10,6V0H90V6");
- },
- "can be a quantize scale": function(d3) {
- var x = _.scale.quantize().domain([0, 10]).range([10, 50, 90]),
- a = d3.svg.axis().scale(x),
- g = d3.select("body").html("").append("g").call(a);
- assert.inDelta(g.selectAll(".tick").data(), [0, 10], 1e-4);
- assert.deepEqual(g.selectAll(".tick").data().map(x), [10, 90]);
- assert.equal(g.select("path").attr("d"), "M10,6V0H90V6");
- },
- "can be a quantile scale": function(d3) {
- var x = _.scale.quantile().domain([6, 3, 5, 2, 7, 8, 4, 0, 1, 9]).range([10, 50, 90]),
- a = d3.svg.axis().scale(x),
- g = d3.select("body").html("").append("g").call(a);
- assert.inDelta(g.selectAll(".tick").data(), [0, 3, 6], 1e-4);
- assert.inDelta(g.selectAll(".tick").data().map(x), [10, 50, 90], 1e-4);
- assert.equal(g.select("path").attr("d"), "M10,6V0H90V6");
- },
- "can be a threshold scale": function(d3) {
- var x = _.scale.threshold().domain([4, 5, 6]).range([0, 30, 60, 90]),
- a = d3.svg.axis().scale(x),
- g = d3.select("body").html("").append("g").call(a);
- assert.inDelta(g.selectAll(".tick").data(), [4, 5, 6], 1e-4);
- assert.inDelta(g.selectAll(".tick").data().map(x), [30, 60, 90], 1e-4);
- assert.equal(g.select("path").attr("d"), "M0,6V0H90V6");
- }
- },
-
- "orient": {
- "defaults to bottom": function(d3) {
- var a = d3.svg.axis();
- assert.equal(a.orient(), "bottom");
- },
- "defaults to bottom when an invalid orientation is specified": function(d3) {
- var a = d3.svg.axis().orient("invalid");
- assert.equal(a.orient(), "bottom");
- },
- "coerces to a string": function(d3) {
- var a = d3.svg.axis().orient({toString: function() { return "left"; }});
- assert.equal(a.orient(), "left");
- },
- "supports top orientation": function(d3) {
- var a = d3.svg.axis().orient("top"),
- g = d3.select("body").html("").append("g").call(a),
- tick = g.select("g:nth-child(3)"),
- text = tick.select("text"),
- line = tick.select("line"),
- path = g.select("path.domain");
- assert.equal(tick.attr("transform"), "translate(0.2,0)");
- assert.equal(text.attr("y"), -9);
- assert.equal(text.attr("dy"), "0em");
- assert.equal(text.style("text-anchor"), "middle");
- assert.equal(text.text(), "0.2");
- assert.equal(line.attr("y2"), -6);
- assert.equal(path.attr("d"), "M0,-6V0H1V-6");
- },
- "supports right orientation": function(d3) {
- var a = d3.svg.axis().orient("right"),
- g = d3.select("body").html("").append("g").call(a),
- tick = g.select("g:nth-child(3)"),
- text = tick.select("text"),
- line = tick.select("line"),
- path = g.select("path.domain");
- assert.equal(tick.attr("transform"), "translate(0,0.2)");
- assert.equal(text.attr("x"), 9);
- assert.equal(text.attr("dy"), ".32em");
- assert.equal(text.style("text-anchor"), "start");
- assert.equal(text.text(), "0.2");
- assert.equal(line.attr("x2"), 6);
- assert.equal(path.attr("d"), "M6,0H0V1H6");
- },
- "supports bottom orientation": function(d3) {
- var a = d3.svg.axis().orient("bottom"),
- g = d3.select("body").html("").append("g").call(a),
- tick = g.select("g:nth-child(3)"),
- text = tick.select("text"),
- line = tick.select("line"),
- path = g.select("path.domain");
- assert.equal(tick.attr("transform"), "translate(0.2,0)");
- assert.equal(text.attr("y"), 9);
- assert.equal(text.attr("dy"), ".71em");
- assert.equal(text.style("text-anchor"), "middle");
- assert.equal(text.text(), "0.2");
- assert.equal(line.attr("y2"), 6);
- assert.equal(path.attr("d"), "M0,6V0H1V6");
- },
- "supports left orientation": function(d3) {
- var a = d3.svg.axis().orient("left"),
- g = d3.select("body").html("").append("g").call(a),
- tick = g.select("g:nth-child(3)"),
- text = tick.select("text"),
- line = tick.select("line"),
- path = g.select("path.domain");
- assert.equal(tick.attr("transform"), "translate(0,0.2)");
- assert.equal(text.attr("x"), -9);
- assert.equal(text.attr("dy"), ".32em");
- assert.equal(text.style("text-anchor"), "end");
- assert.equal(text.text(), "0.2");
- assert.equal(line.attr("x2"), -6);
- assert.equal(path.attr("d"), "M-6,0H0V1H-6");
- }
- },
-
- "tickSize": {
- "defaults to six pixels": function(d3) {
- var a = d3.svg.axis();
- assert.strictEqual(a.tickSize(), 6);
- },
- "can be defined as a number": function(d3) {
- var a = d3.svg.axis().tickSize(3);
- assert.strictEqual(a.tickSize(), 3);
- },
- "coerces input values to numbers": function(d3) {
- var a = d3.svg.axis().tickSize("3");
- assert.strictEqual(a.tickSize(), 3);
- assert.strictEqual(a.innerTickSize(), 3);
- assert.strictEqual(a.outerTickSize(), 3);
- a.tickSize("4", "5");
- assert.strictEqual(a.tickSize(), 4);
- assert.strictEqual(a.innerTickSize(), 4);
- assert.strictEqual(a.outerTickSize(), 5);
- },
- "with no arguments, returns the inner tick size": function(d3) {
- var a = d3.svg.axis().innerTickSize(10);
- assert.strictEqual(a.tickSize(), 10);
- },
- "with one argument, specifies both the inner and outer tick size": function(d3) {
- var a = d3.svg.axis().tickSize(10);
- assert.strictEqual(a.innerTickSize(), 10);
- assert.strictEqual(a.outerTickSize(), 10);
- },
- "with two arguments, specifies inner and outer tick sizes": function(d3) {
- var a = d3.svg.axis().tickSize(2, 4);
- assert.strictEqual(a.innerTickSize(), 2);
- assert.strictEqual(a.outerTickSize(), 4);
- },
- "with three arguments (for backwards compatibility), specifies the inner and outer tick sizes": function(d3) {
- var a = d3.svg.axis().tickSize(1, 2, 3);
- assert.strictEqual(a.innerTickSize(), 1);
- assert.strictEqual(a.outerTickSize(), 3);
- }
- },
-
- "innerTickSize": {
- "defaults to six pixels": function(d3) {
- var a = d3.svg.axis();
- assert.strictEqual(a.innerTickSize(), 6);
- },
- "can be defined as a number": function(d3) {
- var a = d3.svg.axis().innerTickSize(3);
- assert.strictEqual(a.innerTickSize(), 3);
- },
- "when changed, does not affect the outer tick size": function(d3) {
- var a = d3.svg.axis().innerTickSize(3);
- assert.strictEqual(a.outerTickSize(), 6);
- },
- "coerces the specified value to a number": function(d3) {
- var a = d3.svg.axis().innerTickSize("3");
- assert.strictEqual(a.innerTickSize(), 3);
- },
- "with no arguments, returns the outer tick size": function(d3) {
- var a = d3.svg.axis().outerTickSize(10);
- assert.strictEqual(a.outerTickSize(), 10);
- },
- "affects the generated tick lines": function(d3) {
- var a = d3.svg.axis().innerTickSize(3),
- g = d3.select("body").html("").append("g").call(a),
- line = g.selectAll("g line");
- line.each(function() {
- assert.equal(d3.select(this).attr("y2"), 3);
- });
- },
- "if negative, labels are placed on the opposite end": function(d3) {
- var a = d3.svg.axis().innerTickSize(-80),
- g = d3.select("body").html("").append("g").call(a),
- line = g.selectAll("g line"),
- text = g.selectAll("g text");
- line.each(function() {
- assert.equal(d3.select(this).attr("y2"), -80);
- });
- text.each(function() {
- assert.equal(d3.select(this).attr("y"), 3);
- });
- }
- },
-
- "outerTickSize": {
- "defaults to six pixels": function(d3) {
- var a = d3.svg.axis();
- assert.strictEqual(a.outerTickSize(), 6);
- },
- "can be defined as a number": function(d3) {
- var a = d3.svg.axis().outerTickSize(3);
- assert.strictEqual(a.outerTickSize(), 3);
- },
- "when changed, does not affect the inner tick size": function(d3) {
- var a = d3.svg.axis().outerTickSize(3);
- assert.strictEqual(a.innerTickSize(), 6);
- },
- "coerces the specified value to a number": function(d3) {
- var a = d3.svg.axis().outerTickSize("3");
- assert.strictEqual(a.outerTickSize(), 3);
- },
- "with no arguments, returns the inner tick size": function(d3) {
- var a = d3.svg.axis().innerTickSize(10);
- assert.strictEqual(a.innerTickSize(), 10);
- },
- "affects the generated domain path": function(d3) {
- var a = d3.svg.axis().tickSize(3),
- g = d3.select("body").html("").append("g").call(a),
- path = g.select("path.domain");
- assert.equal(path.attr("d"), "M0,3V0H1V3");
- },
- "with three arguments, specifies end tick size and ignores minor tick size": function(d3) {
- var a = d3.svg.axis().tickSize(6, 3, 9),
- g = d3.select("body").html("").append("g").call(a),
- path = g.selectAll("path");
- assert.equal(path.attr("d"), "M0,9V0H1V9");
- }
- },
-
- "tickPadding": {
- "defaults to three pixels": function(d3) {
- var a = d3.svg.axis();
- assert.equal(a.tickPadding(), 3);
- },
- "can be defined as a number": function(d3) {
- var a = d3.svg.axis().tickPadding(6);
- assert.equal(a.tickPadding(), 6);
- },
- "coerces input value to a number": function(d3) {
- var a = d3.svg.axis().tickPadding("6");
- assert.strictEqual(a.tickPadding(), 6);
- },
- "affects the generated tick labels": function(d3) {
- var a = d3.svg.axis().tickSize(2).tickPadding(7),
- g = d3.select("body").html("").append("g").call(a),
- text = g.selectAll("g text");
- text.each(function() {
- assert.equal(d3.select(this).attr("y"), 9);
- });
- }
- },
-
- "ticks": {
- "defaults to [10]": function(d3) {
- var a = d3.svg.axis();
- assert.deepEqual(a.ticks(), [10]);
- },
- "can be defined as any arguments": function(d3) {
- var b = {}, a = d3.svg.axis().ticks(b, 42), t = a.ticks();
- assert.equal(t[0], b);
- assert.equal(t[1], 42);
- assert.equal(t.length, 2);
- },
- "passes any arguments to the scale's ticks function": function(d3) {
- var x = _.scale.linear(), b = {}, a = d3.svg.axis().ticks(b, "%").scale(x), aa = [],
- g = d3.select("body").html("").append("g");
- x.ticks = function() { aa.push(arguments); return [42]; };
- g.call(a);
- assert.equal(aa.length, 1);
- assert.equal(aa[0].length, 2);
- assert.equal(aa[0][0], b);
- assert.equal(aa[0][1], "%");
- },
- "passes any arguments to the scale's tickFormat function": function(d3) {
- var b = {},
- x = _.scale.linear(),
- a = d3.svg.axis().scale(x).ticks(b, "%"),
- g = d3.select("body").html("").append("g"),
- aa = [];
-
- x.tickFormat = function() {
- aa.push(arguments);
- return String;
- };
-
- g.call(a);
- assert.equal(aa.length, 1);
- assert.equal(aa[0].length, 2);
- assert.equal(aa[0][0], b);
- assert.equal(aa[0][1], "%");
- },
- "affects the generated ticks": function(d3) {
- var a = d3.svg.axis().ticks(20, "%"),
- g = d3.select("body").html("").append("g").call(a),
- t = g.selectAll("g");
- assert.equal(t[0].length, 21);
- assert.equal(t[0][0].textContent, "0%");
- },
- "only substitutes precision if not specified": function(d3) {
- var a = d3.svg.axis().ticks(20, ".5%"),
- g = d3.select("body").html("").append("g").call(a),
- t = g.selectAll("g");
- assert.equal(t[0].length, 21);
- assert.equal(t[0][0].textContent, "0.00000%");
- }
- },
-
- "tickValues": {
- "defaults to null": function(d3) {
- var a = d3.svg.axis().tickValues();
- assert.isNull(a);
- },
- "can be given as array of positions": function(d3) {
- var l = [1, 2.5, 3], a = d3.svg.axis().tickValues(l), t = a.tickValues();
- assert.equal(t, l);
- assert.equal(t.length, 3);
- },
- "does not change the tick arguments": function(d3) {
- var b = {}, a = d3.svg.axis().ticks(b, 42).tickValues([10]), t = a.ticks();
- assert.equal(t[0], b);
- assert.equal(t[1], 42);
- assert.equal(t.length, 2);
- },
- "does not change the arguments passed to the scale's tickFormat function": function(d3) {
- var x = _.scale.linear(),
- a = d3.svg.axis().scale(x).ticks(10).tickValues([1, 2, 3]),
- g = d3.select("body").html("").append("g"),
- aa = [];
-
- x.tickFormat = function() {
- aa.push(arguments);
- return String;
- };
-
- g.call(a);
- assert.equal(aa.length, 1);
- assert.equal(aa[0].length, 1);
- assert.equal(aa[0][0], 10);
- },
- "affects the generated ticks": function(d3) {
- var a = d3.svg.axis().ticks(20),
- g = d3.select("body").html("").append("g").call(a),
- t = g.selectAll("g");
- assert.equal(t[0].length, 21);
- }
- },
-
- "tickSubdivide": {
- "is deprecated and does nothing": function(d3) {
- var a = d3.svg.axis();
- assert.equal(a.tickSubdivide(), 0);
- assert.strictEqual(a.tickSubdivide(1), a);
- assert.equal(a.tickSubdivide(), 0);
- }
- },
-
- "tickFormat": {
- "defaults to null": function(d3) {
- var a = d3.svg.axis();
- assert.isTrue(a.tickFormat() == null);
- },
- "when null, uses the scale's tick format": function(d3) {
- var x = _.scale.linear(), a = d3.svg.axis().scale(x),
- g = d3.select("body").html("").append("g");
-
- x.tickFormat = function() {
- return function(d) {
- return "foo-" + d;
- };
- };
-
- g.call(a);
- var t = g.selectAll("g text");
- assert.equal(t.text(), "foo-0");
- },
- "affects the generated tick labels": function(d3) {
- var a = d3.svg.axis().tickFormat(d3.format("+.2%")),
- g = d3.select("body").html("").append("g").call(a),
- t = g.selectAll("g text");
- assert.equal(t.text(), "+0.00%");
- },
- "can be set to a constant": function(d3) {
- var a = d3.svg.axis().tickFormat("I'm a tick!"),
- g = d3.select("body").html("").append("g").call(a),
- t = g.selectAll("g text");
- assert.equal(t.text(), "I'm a tick!");
- },
- "can be set to a falsey constant": function(d3) {
- var a = d3.svg.axis().tickFormat(""),
- g = d3.select("body").html("").append("g").call(a),
- t = g.selectAll("g text");
- assert.equal(t.text(), "");
- }
- },
-
- "enter": {
- "generates a new domain path": function(d3) {
- var a = d3.svg.axis(),
- g = d3.select("body").html("").append("g").call(a),
- path = g.selectAll("path.domain");
- assert.equal(path[0].length, 1);
- assert.equal(path.attr("d"), "M0,6V0H1V6");
- assert.isNull(path.node().nextSibling);
- },
- "generates new tick marks with labels": function(d3) {
- var a = d3.svg.axis(),
- g = d3.select("body").html("").append("g").call(a),
- x = _.scale.linear(),
- tick = g.selectAll("g"),
- ticks = x.ticks(10),
- tickFormat = x.tickFormat(10);
- assert.equal(tick[0].length, ticks.length);
- tick.each(function(d, i) {
- var t = d3.select(this);
- assert.isFalse(t.select("line").empty());
- assert.isFalse(t.select("text").empty());
- assert.equal(t.select("text").text(), tickFormat(ticks[i]));
- });
- }
- },
-
- "update": {
- "updates the domain path": function(d3) {
- var a = d3.svg.axis(),
- g = d3.select("body").html("").append("g").call(a);
- a.scale().domain([0, 2]).range([1, 2]);
- a.tickSize(3);
- g.call(a);
- var path = g.selectAll("path.domain");
- assert.equal(path[0].length, 1);
- assert.equal(path.attr("d"), "M1,3V0H2V3");
- assert.domEqual(path.node().nextSibling, null);
- },
- "enters, exits and updates tick marks": function(d3) {
- var a = d3.svg.axis(),
- g = d3.select("body").html("").append("g").call(a),
- x = d3.scale.linear().domain([1, 1.5]);
- a.scale().domain(x.domain());
- a.tickSize(3).tickPadding(9);
- g.call(a);
- var tick = g.selectAll("g"),
- ticks = x.ticks(10),
- tickFormat = x.tickFormat(10);
- assert.equal(tick[0].length, ticks.length);
- tick.each(function(d, i) {
- var t = d3.select(this);
- assert.isFalse(t.select("line").empty());
- assert.isFalse(t.select("text").empty());
- assert.equal(t.select("text").text(), tickFormat(ticks[i]));
- });
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/svg/brush-test.js b/test/svg/brush-test.js
deleted file mode 100644
index c64abfefbeddde..00000000000000
--- a/test/svg/brush-test.js
+++ /dev/null
@@ -1,114 +0,0 @@
-var vows = require("vows"),
- _ = require("../../"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.svg.brush");
-
-suite.addBatch({
- "brush": {
- topic: load("svg/brush").expression("d3.svg.brush").document(),
-
- "x": {
- "defaults to null": function(brush) {
- assert.isNull(brush().x());
- }
- },
-
- "y": {
- "defaults to null": function(brush) {
- assert.isNull(brush().y());
- }
- },
-
- "clamp": {
- "returns null when no scales are attached": function(brush) {
- assert.isNull(brush().clamp());
- },
- "returns a single boolean if only x is defined": function(brush) {
- var b = brush().x(_.scale.linear());
- assert.isTrue(b.clamp());
- },
- "returns a single boolean if only y is defined": function(brush) {
- var b = brush().y(_.scale.linear());
- assert.isTrue(b.clamp());
- },
- "returns one-dimensional array if both x and y are defined": function(brush) {
- var b = brush().x(_.scale.linear()).y(_.scale.linear());
- assert.deepEqual(b.clamp(), [true, true]);
- },
- "takes a single boolean if only x is defined": function(brush) {
- var b = brush().x(_.scale.linear()).clamp(false);
- assert.isFalse(b.clamp());
- },
- "takes a single boolean if only y is defined": function(brush) {
- var b = brush().y(_.scale.linear()).clamp(false);
- assert.isFalse(b.clamp());
- },
- "takes a one-dimensional array if both x and y are defined": function(brush) {
- var b = brush().x(_.scale.linear()).y(_.scale.linear()).clamp([false, true]);
- assert.deepEqual(b.clamp(), [false, true]);
- b.clamp([true, false]);
- assert.deepEqual(b.clamp(), [true, false]);
- }
- },
-
- "extent": {
- "returns null when no scales are attached": function(brush) {
- assert.isNull(brush().extent());
- },
- "returns a one-dimensional array if only x is defined": function(brush) {
- var b = brush().x(_.scale.linear());
- assert.deepEqual(b.extent(), [0, 0]);
- },
- "takes a one-dimensional array if only x is defined": function(brush) {
- var b = brush().x(_.scale.linear()).extent([0.1, 0.4]);
- assert.deepEqual(b.extent(), [0.1, 0.4]);
- },
- "returns a one-dimensional array if only y is defined": function(brush) {
- var b = brush().y(_.scale.linear());
- assert.deepEqual(b.extent(), [0, 0]);
- },
- "takes a one-dimensional array if only y is defined": function(brush) {
- var b = brush().y(_.scale.linear()).extent([0.1, 0.4]);
- assert.deepEqual(b.extent(), [0.1, 0.4]);
- },
- "returns a two-dimensional array if x and y are defined": function(brush) {
- var b = brush().x(_.scale.linear()).y(_.scale.linear());
- assert.deepEqual(b.extent(), [[0, 0], [0, 0]]);
- },
- "takes a two-dimensional array if x and y are defined": function(brush) {
- var b = brush().x(_.scale.linear()).y(_.scale.linear()).extent([[0.1, 0.2], [0.3, 0.4]]);
- assert.deepEqual(b.extent(), [[0.1, 0.2], [0.3, 0.4]]);
- },
- "preserves the set extent exactly": function(brush) {
- var lo = new Number(0.1),
- hi = new Number(0.3),
- b = brush().x(_.scale.linear()).extent([lo, hi]),
- extent = b.extent();
- assert.strictEqual(extent[0], lo);
- assert.strictEqual(extent[1], hi);
- }
- },
-
- "empty": {
- "returns true if and only if any defined extent is empty": function(brush) {
- var b = brush();
- assert.strictEqual(b.empty(), false); // x and y are undefined
- var b = brush().x(_.scale.linear());
- assert.strictEqual(b.empty(), true); // x is empty, y is undefined
- assert.strictEqual(b.extent([0, 1]).empty(), false); // x is non-empty, y is undefined
- var b = brush().y(_.scale.linear());
- assert.strictEqual(b.empty(), true); // x is undefined, y is empty
- assert.strictEqual(b.extent([0, 1]).empty(), false); // x is undefined, y is non-empty
- var b = brush().x(_.scale.linear()).y(_.scale.linear());
- assert.strictEqual(b.empty(), true); // x is empty, y is empty
- assert.strictEqual(b.extent([[0, 0], [1, 0]]).empty(), true); // x is non-empty, y is empty
- assert.strictEqual(b.extent([[0, 0], [0, 1]]).empty(), true); // x is empty, y is non-empty
- assert.strictEqual(b.extent([[0, 0], [1, 1]]).empty(), false); // x is non-empty, y is non-empty
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/svg/diagonal-test.js b/test/svg/diagonal-test.js
deleted file mode 100644
index 4a7ae51aba2633..00000000000000
--- a/test/svg/diagonal-test.js
+++ /dev/null
@@ -1,62 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.svg.diagonal");
-
-suite.addBatch({
- "diagonal": {
- topic: load("svg/diagonal").expression("d3.svg.diagonal"),
-
- "source defaults to a function accessor": function(diagonal) {
- var d = diagonal().target({x:5, y:5});
- assert.pathEqual(d({source: {x:1, y:1}}), "M1,1C1,3 5,3 5,5");
- assert.pathEqual(d({source: {x:5, y:1}}), "M5,1C5,3 5,3 5,5");
- },
- "source can be defined as a constant": function(diagonal) {
- var d = diagonal().target({x:5, y:5});
- assert.pathEqual(d.source({x:1, y:1})(), "M1,1C1,3 5,3 5,5");
- assert.pathEqual(d.source({x:5, y:1})(), "M5,1C5,3 5,3 5,5");
- },
- "source can be defined as a function of data or index": function(diagonal) {
- var d = diagonal().source(f).target({x:5, y:5}), o = {}, t = {}, dd, ii, tt;
- function f(d,i) { dd = d; ii = i; tt = this; return {x:42, y:42}; }
- assert.pathEqual(d.call(t, o, 2), "M42,42C42,23.500000 5,23.500000 5,5");
-
- assert.equal(dd, o, "expected data, got {actual}");
- assert.equal(ii, 2, "expected data, got {actual}");
- assert.equal(tt, t, "expected data, got {actual}");
- },
- "target defaults to a function accessor": function(diagonal) {
- var d = diagonal().source({x:1, y:1});
- assert.pathEqual(d({target: {x:5, y:5}}), "M1,1C1,3 5,3 5,5");
- assert.pathEqual(d({target: {x:5, y:1}}), "M1,1C1,1 5,1 5,1");
- },
- "target can be defined as a constant": function(diagonal) {
- var d = diagonal().source({x:1, y:1});
- assert.pathEqual(d.target({x:5, y:5})(), "M1,1C1,3 5,3 5,5");
- assert.pathEqual(d.target({x:5, y:1})(), "M1,1C1,1 5,1 5,1");
- },
- "target can be defined as a function of data or index": function(diagonal) {
- var d = diagonal().source({x:1, y:1}).target(f), o = {}, t = {}, dd, ii, tt;
- function f(d,i) { dd = d; ii = i; tt = this; return {x:42, y:42}; }
- assert.pathEqual(d.call(t, o, 2), "M1,1C1,21.500000 42,21.500000 42,42");
-
- assert.equal(dd, o, "expected data, got {actual}");
- assert.equal(ii, 2, "expected data, got {actual}");
- assert.equal(tt, t, "expected data, got {actual}");
- },
- "projection defaults to identity": function(diagonal) {
- var d = diagonal();
- assert.deepEqual(d.projection()({x:1, y:1}),[1, 1]);
- },
- "custom projection function can be set": function(diagonal) {
- var d = diagonal().source({x:1, y:1}).target({x:5, y:5});
- assert.pathEqual(d.projection(function(d) {
- return [d.x * 2, d.y * 2];
- })(),"M2,2C2,6 10,6 10,10");
- }
- }
-});
-
-suite.export(module);
diff --git a/test/svg/line-radial-test.js b/test/svg/line-radial-test.js
deleted file mode 100644
index 6d7e358f105aa4..00000000000000
--- a/test/svg/line-radial-test.js
+++ /dev/null
@@ -1,120 +0,0 @@
-var vows = require("vows"),
- _ = require("../../"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.svg.line.radial");
-
-suite.addBatch({
- "line.radial": {
- topic: load("svg/line-radial").expression("d3.svg.line.radial"),
-
- "radius defaults to a function accessor": function(line) {
- var l = line();
- assert.pathEqual(l([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10L16.82941969615793,-10.806046117362794L18.185948536513635,8.32293673094285L1.4112000805986715,9.899924966004454");
- assert.typeOf(l.radius(), "function");
- },
- "radius can be defined as a constant": function(line) {
- var l = line().radius(30);
- assert.pathEqual(l([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-30L25.244129544236895,-16.20906917604419L27.278922804770453,12.484405096414275L4.233600241796014,29.699774898013363");
- assert.equal(l.radius(), 30);
- },
- "radius can be defined as a function": function(line) {
- var l = line().radius(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 30; }
- assert.pathEqual(l.call(t, [[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-30L25.244129544236895,-16.20906917604419L27.278922804770453,12.484405096414275L4.233600241796014,29.699774898013363");
- assert.deepEqual(dd, [[10, 0], [20, 1], [20, 2], [10, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1, 2, 3], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t, t, t], "expected this, got {actual}");
- },
-
- "angle defaults to a function accessor": function(line) {
- var l = line();
- assert.pathEqual(l([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10L16.82941969615793,-10.806046117362794L18.185948536513635,8.32293673094285L1.4112000805986715,9.899924966004454");
- assert.typeOf(l.angle(), "function");
- },
- "angle can be defined as a constant": function(line) {
- var l = line().angle(Math.PI / 2);
- assert.pathEqual(l([[10, 0], [20, 1], [20, 2], [10, 3]]), "M10,0L20,0L20,0L10,0");
- assert.equal(l.angle(), Math.PI / 2);
- },
- "angle can be defined as a function": function(line) {
- var l = line().angle(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return Math.PI / 2; }
- assert.pathEqual(l.call(t, [[10, 0], [20, 1], [20, 2], [10, 3]]), "M10,0L20,0L20,0L10,0");
- assert.deepEqual(dd, [[10, 0], [20, 1], [20, 2], [10, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1, 2, 3], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t, t, t], "expected this, got {actual}");
- },
- "angle is defined in radians, with zero at 12 o'clock": function(line) {
- var l = line().angle(0);
- assert.pathEqual(l([[10, Math.PI], [20, Math.PI / 3]]), "M0,-10L0,-20");
- assert.equal(l.angle(), 0);
- },
-
- "interpolate defaults to linear": function(line) {
- assert.equal(line().interpolate(), "linear");
- },
- "interpolate can be defined as a constant": function(line) {
- var l = line().interpolate("cardinal");
- assert.pathEqual(l([[10, 0], [20, 1], [20, 2], [10, 3]]), "M0,-10Q15.010824842506567,-12.638339790457078,16.82941969615793,-10.806046117362794C19.557311976634978,-8.057605607721365,20.498681478847523,5.217041068437762,18.185948536513635,8.32293673094285Q16.64412657495771,10.393533839279574,1.4112000805986715,9.899924966004454");
- assert.equal(l.interpolate(), "cardinal");
- },
-
- "tension defaults to .7": function(line) {
- assert.equal(line().tension(), .7);
- },
- "tension can be specified as a constant": function(line) {
- var l = line().tension(.5);
- assert.equal(l.tension(), .5);
- },
-
- "returns null if input points array is empty": function(line) {
- assert.isNull(line()([]));
- },
-
- "interpolate(linear)": {
- "supports linear interpolation": testInterpolation("linear")
- },
-
- "interpolate(step)": {
- "supports step-before interpolation": testInterpolation("step-before"),
- "supports step-after interpolation": testInterpolation("step-after")
- },
-
- "interpolate(basis)": {
- "supports basis interpolation": testInterpolation("basis"),
- "supports basis-open interpolation": testInterpolation("basis-open"),
- "supports basis-closed interpolation": testInterpolation("basis-closed")
- },
-
- "interpolate(bundle)": {
- "supports bundle interpolation": testInterpolation("bundle")
- },
-
- "interpolate(cardinal)": {
- "supports cardinal interpolation": testInterpolation("cardinal"),
- "supports cardinal-open interpolation": testInterpolation("cardinal-open"),
- "supports cardinal-closed interpolation": testInterpolation("cardinal-closed")
- },
-
- "interpolate(monotone)": {
- "supports monotone interpolation": testInterpolation("monotone")
- }
- }
-});
-
-// A radial line is just a transformation of a Cartesian line.
-function testInterpolation(interpolate) {
- var data = [[10, 0], [20, 1], [20, 2], [10, 3]];
-
- var cartesian = _.svg.line()
- .x(function(d) { return d[0] * Math.cos(d[1] - Math.PI / 2); })
- .y(function(d) { return d[0] * Math.sin(d[1] - Math.PI / 2); });
-
- return function(radial) {
- assert.pathEqual(radial().interpolate(interpolate)(data), cartesian.interpolate(interpolate)(data));
- };
-}
-
-suite.export(module);
diff --git a/test/svg/line-test.js b/test/svg/line-test.js
deleted file mode 100644
index 010189eb1d1e4f..00000000000000
--- a/test/svg/line-test.js
+++ /dev/null
@@ -1,207 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.svg.line");
-
-suite.addBatch({
- "line": {
- topic: load("svg/line").expression("d3.svg.line"),
-
- "x defaults to a function accessor": function(line) {
- var l = line();
- assert.pathEqual(l([[1, 2], [4, 3]]), "M1,2L4,3");
- assert.typeOf(l.x(), "function");
- },
- "x can be defined as a constant": function(line) {
- var l = line().x(0);
- assert.pathEqual(l([[1, 2], [4, 3]]), "M0,2L0,3");
- assert.equal(l.x(), 0);
- },
- "x can be defined as a function": function(line) {
- var l = line().x(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 0; }
- assert.pathEqual(l.call(t, [[1, 2], [4, 3]]), "M0,2L0,3");
- assert.deepEqual(dd, [[1, 2], [4, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t], "expected this, got {actual}");
- },
-
- "y defaults to a function accessor": function(line) {
- var l = line();
- assert.pathEqual(l([[1, 2], [4, 3]]), "M1,2L4,3");
- assert.typeOf(l.y(), "function");
- },
- "y can be defined as a constant": function(line) {
- var l = line().y(0);
- assert.pathEqual(l([[1, 2], [4, 3]]), "M1,0L4,0");
- assert.equal(l.y(), 0);
- },
- "y can be defined as a function": function(line) {
- var l = line().y(f), t = {}, dd = [], ii = [], tt = [];
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return 0; }
- assert.pathEqual(l.call(t, [[1, 2], [4, 3]]), "M1,0L4,0");
- assert.deepEqual(dd, [[1, 2], [4, 3]], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.deepEqual(tt, [t, t], "expected this, got {actual}");
- },
-
- "interpolate defaults to linear": function(line) {
- assert.equal(line().interpolate(), "linear");
- },
- "interpolate can be defined as a constant": function(line) {
- var l = line().interpolate("step-before");
- assert.pathEqual(l([[0, 0], [1, 1]]), "M0,0V1H1");
- assert.equal(l.interpolate(), "step-before");
- },
- "interpolate can be defined as a function": function(line) {
- var l = line().interpolate(interpolate);
- assert.pathEqual(l([[0, 0], [1, 1]]), "M0,0T1,1");
- assert.equal(l.interpolate(), interpolate);
-
- function interpolate(points) {
- return points.join("T");
- }
- },
- "invalid interpolates fallback to linear": function(line) {
- assert.equal(line().interpolate("__proto__").interpolate(), "linear");
- },
-
- "tension defaults to .7": function(line) {
- assert.equal(line().tension(), .7);
- },
- "tension can be specified as a constant": function(line) {
- var l = line().tension(.5);
- assert.equal(l.tension(), .5);
- },
-
- "returns null if input points array is empty": function(line) {
- assert.isNull(line()([]));
- },
-
- "interpolate(linear)": {
- "supports linear interpolation": function(line) {
- var l = line().interpolate("linear");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M0,0L1,1L2,0L3,1L4,0");
- }
- },
-
- "interpolate(step)": {
- "supports step-before interpolation": function(line) {
- var l = line().interpolate("step-before");
- assert.pathEqual(l([[0, 0]]), "M0,0");
- assert.pathEqual(l([[0, 0], [1, 1]]), "M0,0V1H1");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0]]), "M0,0V1H1V0H2");
- },
- "supports step interpolation": function(line) {
- var l = line().interpolate("step");
- assert.pathEqual(l([[0, 0]]), "M0,0");
- assert.pathEqual(l([[0, 0], [1, 1]]), "M0,0H0.5V1H1");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0]]), "M0,0H0.5V1H1.5V0H2");
- },
- "supports step-after interpolation": function(line) {
- var l = line().interpolate("step-after");
- assert.pathEqual(l([[0, 0]]), "M0,0");
- assert.pathEqual(l([[0, 0], [1, 1]]), "M0,0H1V1");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0]]), "M0,0H1V1H2V0");
- }
- },
-
- "interpolate(basis)": {
- "supports basis interpolation": function(line) {
- var l = line().interpolate("basis");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M0,0L0.16666666666666666,0.16666666666666666C0.3333333333333333,0.3333333333333333,0.6666666666666666,0.6666666666666666,1,0.6666666666666666C1.3333333333333333,0.6666666666666666,1.6666666666666665,0.3333333333333333,2,0.3333333333333333C2.333333333333333,0.3333333333333333,2.6666666666666665,0.6666666666666666,3,0.6666666666666666C3.333333333333333,0.6666666666666666,3.6666666666666665,0.3333333333333333,3.833333333333333,0.16666666666666666L4,0");
- },
- "supports basis-open interpolation": function(line) {
- var l = line().interpolate("basis-open");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M1,0.6666666666666666C1.3333333333333333,0.6666666666666666,1.6666666666666665,0.3333333333333333,2,0.3333333333333333C2.333333333333333,0.3333333333333333,2.6666666666666665,0.6666666666666666,3,0.6666666666666666");
- },
- "supports basis-closed interpolation": function(line) {
- var l = line().interpolate("basis-closed");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M2,0.3333333333333333C2.333333333333333,0.3333333333333333,2.6666666666666665,0.6666666666666666,3,0.6666666666666666C3.333333333333333,0.6666666666666666,3.6666666666666665,0.3333333333333333,3.1666666666666665,0.16666666666666666C2.6666666666666665,0,1.3333333333333333,0,0.8333333333333333,0.16666666666666666C0.3333333333333333,0.3333333333333333,0.6666666666666666,0.6666666666666666,1,0.6666666666666666C1.3333333333333333,0.6666666666666666,1.6666666666666665,0.3333333333333333,2,0.3333333333333333");
- },
- "basis interpolation reverts to linear with fewer than three points": function(line) {
- var l = line().interpolate("basis"), d = line();
- assert.pathEqual(l([[0, 0]]), d([[0, 0]]));
- assert.pathEqual(l([[0, 0], [1, 1]]), d([[0, 0], [1, 1]]));
- },
- "basis-open interpolation reverts to linear with fewer than four points": function(line) {
- var l = line().interpolate("basis-open"), d = line();
- assert.pathEqual(l([[0, 0]]), d([[0, 0]]));
- assert.pathEqual(l([[0, 0], [1, 1]]), d([[0, 0], [1, 1]]));
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0]]), d([[0, 0], [1, 1], [2, 0]]));
- },
- "basis-closed interpolation reverts to linear with fewer than three points": function(line) {
- var l = line().interpolate("basis-open"), d = line();
- assert.pathEqual(l([[0, 0]]), d([[0, 0]]));
- assert.pathEqual(l([[0, 0], [1, 1]]), d([[0, 0], [1, 1]]));
- }
- },
-
- "interpolate(bundle)": {
- "supports bundle interpolation": function(line) {
- var l = line().interpolate("bundle");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M0,0L0.16666666666666666,0.11666666666666665C0.3333333333333333,0.2333333333333333,0.6666666666666666,0.4666666666666666,1,0.4666666666666666C1.3333333333333333,0.4666666666666666,1.6666666666666665,0.2333333333333333,2,0.2333333333333333C2.333333333333333,0.2333333333333333,2.6666666666666665,0.4666666666666666,3,0.4666666666666666C3.333333333333333,0.4666666666666666,3.6666666666666665,0.2333333333333333,3.833333333333333,0.11666666666666665L4,0");
- },
- "observes the specified tension": function(line) {
- var l = line().interpolate("bundle").tension(1);
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), line().interpolate("basis")([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]));
- },
- "supports a single-element array": function(line) {
- var l = line().interpolate("bundle").tension(1);
- assert.pathEqual(l([[0, 0]]), "M0,0");
- }
- },
-
- "interpolate(cardinal)": {
- "supports cardinal interpolation": function(line) {
- var l = line().interpolate("cardinal");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M0,0Q0.8,1,1,1C1.3,1,1.7,0,2,0S2.7,1,3,1Q3.2,1,4,0");
- },
- "supports cardinal-open interpolation": function(line) {
- var l = line().interpolate("cardinal-open");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M1,1C1.3,1,1.7,0,2,0S2.7,1,3,1");
- },
- "supports cardinal-closed interpolation": function(line) {
- var l = line().interpolate("cardinal-closed");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M0,0C-0.45,0.15,0.7,1,1,1S1.7,0,2,0S2.7,1,3,1S4.45,0.15,4,0S0.45,-0.15,0,0");
- },
- "cardinal interpolation reverts to linear with fewer than three points": function(line) {
- var l = line().interpolate("cardinal"), d = line();
- assert.pathEqual(l([[0, 0]]), d([[0, 0]]));
- assert.pathEqual(l([[0, 0], [1, 1]]), d([[0, 0], [1, 1]]));
- },
- "cardinal-open interpolation reverts to linear with fewer than four points": function(line) {
- var l = line().interpolate("cardinal-open"), d = line();
- assert.pathEqual(l([[0, 0]]), d([[0, 0]]));
- assert.pathEqual(l([[0, 0], [1, 1]]), d([[0, 0], [1, 1]]));
- assert.pathEqual(l([[0, 0], [1, 1], [2, 0]]), d([[0, 0], [1, 1], [2, 0]]));
- },
- "cardinal-closed interpolation reverts to linear with fewer than three points": function(line) {
- var l = line().interpolate("cardinal-open"), d = line();
- assert.pathEqual(l([[0, 0]]), d([[0, 0]]));
- assert.pathEqual(l([[0, 0], [1, 1]]), d([[0, 0], [1, 1]]));
- },
- "observes the specified tension": function(line) {
- var l = line().tension(.5);
- assert.pathEqual(l.interpolate("cardinal")([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M0,0Q0.6666666666666667,1,1,1C1.5,1,1.5,0,2,0S2.5,1,3,1Q3.3333333333333335,1,4,0");
- assert.pathEqual(l.interpolate("cardinal-open")([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M1,1C1.5,1,1.5,0,2,0S2.5,1,3,1");
- assert.pathEqual(l.interpolate("cardinal-closed")([[0, 0], [1, 1], [2, 0], [3, 1], [4, 0]]), "M0,0C-0.75,0.25,0.5,1,1,1S1.5,0,2,0S2.5,1,3,1S4.75,0.25,4,0S0.75,-0.25,0,0");
- }
- },
-
- "interpolate(monotone)": {
- "supports monotone interpolation": function(line) {
- var l = line().interpolate("monotone");
- assert.pathEqual(l([[0, 0], [1, 1], [2, 1], [3, 0], [4, 0]]), "M0,0C0.08333333333333333,0.08333333333333333,0.6666666666666667,1,1,1S1.6666666666666667,1,2,1S2.6666666666666665,0,3,0S3.8333333333333335,0,4,0");
- },
- "monotone interpolation reverts to linear with fewer than three points": function(line) {
- var l = line().interpolate("monotone"), d = line();
- assert.pathEqual(l([[0, 0]]), d([[0, 0]]));
- assert.pathEqual(l([[0, 0], [1, 1]]), d([[0, 0], [1, 1]]));
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/svg/symbol-test.js b/test/svg/symbol-test.js
deleted file mode 100644
index 9477a9aedf5c90..00000000000000
--- a/test/svg/symbol-test.js
+++ /dev/null
@@ -1,91 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.svg.symbol");
-
-suite.addBatch({
- "symbol": {
- topic: load("svg/symbol").expression("d3.svg.symbol"),
- "default symbol is a fixed-size circle": function(symbol) {
- var a = symbol();
- assert.pathEqual(a(), "M0,4.51351666838205A4.51351666838205,4.51351666838205 0 1,1 0,-4.51351666838205A4.51351666838205,4.51351666838205 0 1,1 0,4.51351666838205Z");
- },
- "size accessor specifies shape area in square pixels": function(symbol) {
- var a = symbol().size(Number);
- assert.pathEqual(a(0), "M0,0A0,0 0 1,1 0,0A0,0 0 1,1 0,0Z");
- assert.pathEqual(a(Math.PI), "M0,1A1,1 0 1,1 0,-1A1,1 0 1,1 0,1Z");
- assert.pathEqual(a(4 * Math.PI), "M0,2A2,2 0 1,1 0,-2A2,2 0 1,1 0,2Z");
- },
- "size accessor is passed data and index": function(symbol) {
- var a = symbol().size(function(d, i) { return d.z * 2 + i; });
- assert.pathEqual(a({z: 0}, 0), "M0,0A0,0 0 1,1 0,0A0,0 0 1,1 0,0Z");
- assert.pathEqual(a({z: Math.PI}, 1), "M0,1.5225997130512636A1.5225997130512636,1.5225997130512636 0 1,1 0,-1.5225997130512636A1.5225997130512636,1.5225997130512636 0 1,1 0,1.5225997130512636Z");
- assert.pathEqual(a({z: 4 * Math.PI}, 2), "M0,2.938812646693828A2.938812646693828,2.938812646693828 0 1,1 0,-2.938812646693828A2.938812646693828,2.938812646693828 0 1,1 0,2.938812646693828Z");
- },
- "supports cross symbol type": function(symbol) {
- var a = symbol().type("cross").size(Number);
- assert.pathEqual(a(0), "M0,0H0V0H0V0H0V0H0V0H0V0H0Z");
- assert.pathEqual(a(20), "M-3,-1H-1V-3H1V-1H3V1H1V3H-1V1H-3Z");
- },
- "supports diamond symbol type": function(symbol) {
- var a = symbol().type("diamond").size(Number);
- assert.pathEqual(a(0), "M0,0L0,0 0,0 0,0Z");
- assert.pathEqual(a(10), "M0,-2.9428309563827124L1.6990442448471224,0 0,2.9428309563827124 -1.6990442448471224,0Z");
- },
- "supports square symbol type": function(symbol) {
- var a = symbol().type("square").size(Number);
- assert.pathEqual(a(0), "M0,0L0,0 0,0 0,0Z");
- assert.pathEqual(a(4), "M-1,-1L1,-1 1,1 -1,1Z");
- assert.pathEqual(a(16), "M-2,-2L2,-2 2,2 -2,2Z");
- },
- "supports triangle-down symbol type": function(symbol) {
- var a = symbol().type("triangle-down").size(Number);
- assert.pathEqual(a(0), "M0,0L0,0 0,0Z");
- assert.pathEqual(a(10), "M0,2.0808957251439084L2.4028114141347543,-2.0808957251439084 -2.4028114141347543,-2.0808957251439084Z");
- },
- "supports triangle-up symbol type": function(symbol) {
- var a = symbol().type("triangle-up").size(Number);
- assert.pathEqual(a(0), "M0,0L0,0 0,0Z");
- assert.pathEqual(a(10), "M0,-2.0808957251439084L2.4028114141347543,2.0808957251439084 -2.4028114141347543,2.0808957251439084Z");
- },
- "unknown symbol type defaults to circle": function(symbol) {
- var a = symbol().type(String);
- assert.pathEqual(a(), "M0,4.51351666838205A4.51351666838205,4.51351666838205 0 1,1 0,-4.51351666838205A4.51351666838205,4.51351666838205 0 1,1 0,4.51351666838205Z");
- assert.pathEqual(a("invalid"), "M0,4.51351666838205A4.51351666838205,4.51351666838205 0 1,1 0,-4.51351666838205A4.51351666838205,4.51351666838205 0 1,1 0,4.51351666838205Z");
- assert.pathEqual(a("hasOwnProperty"), "M0,4.51351666838205A4.51351666838205,4.51351666838205 0 1,1 0,-4.51351666838205A4.51351666838205,4.51351666838205 0 1,1 0,4.51351666838205Z");
- },
- "can specify type accessor as a function": function(symbol) {
- var a = symbol().type(String);
- assert.pathEqual(a("circle"), "M0,4.51351666838205A4.51351666838205,4.51351666838205 0 1,1 0,-4.51351666838205A4.51351666838205,4.51351666838205 0 1,1 0,4.51351666838205Z");
- assert.pathEqual(a("cross"), "M-5.366563145999495,-1.7888543819998317H-1.7888543819998317V-5.366563145999495H1.7888543819998317V-1.7888543819998317H5.366563145999495V1.7888543819998317H1.7888543819998317V5.366563145999495H-1.7888543819998317V1.7888543819998317H-5.366563145999495Z");
- assert.pathEqual(a("diamond"), "M0,-7.444838872816797L4.298279727294167,0 0,7.444838872816797 -4.298279727294167,0Z");
- assert.pathEqual(a("square"), "M-4,-4L4,-4 4,4 -4,4Z");
- assert.pathEqual(a("triangle-down"), "M0,5.26429605180997L6.078685485212741,-5.26429605180997 -6.078685485212741,-5.26429605180997Z");
- assert.pathEqual(a("triangle-up"), "M0,-5.26429605180997L6.078685485212741,5.26429605180997 -6.078685485212741,5.26429605180997Z");
- }
- },
- "symbolTypes": {
- topic: load("svg/symbol").expression("d3.svg.symbolTypes"),
- "contains circle": function(types) {
- assert.isTrue(types.indexOf("circle") != -1);
- },
- "contains cross": function(types) {
- assert.isTrue(types.indexOf("cross") != -1);
- },
- "contains diamond": function(types) {
- assert.isTrue(types.indexOf("diamond") != -1);
- },
- "contains square": function(types) {
- assert.isTrue(types.indexOf("square") != -1);
- },
- "contains triangle-down": function(types) {
- assert.isTrue(types.indexOf("triangle-down") != -1);
- },
- "contains triangle-up": function(types) {
- assert.isTrue(types.indexOf("triangle-up") != -1);
- }
- }
-});
-
-suite.export(module);
diff --git a/test/test-exports.js b/test/test-exports.js
new file mode 100644
index 00000000000000..f7d3e33e0cfc02
--- /dev/null
+++ b/test/test-exports.js
@@ -0,0 +1,13 @@
+var tape = require("tape-await"),
+ d3 = require("../");
+
+module.exports = function(moduleName) {
+ var module = require(moduleName);
+ tape("d3 exports everything from " + moduleName, function(test) {
+ for (var symbol in module) {
+ if (symbol !== "version") {
+ test.equal(symbol in d3, true, moduleName + " export " + symbol);
+ }
+ }
+ });
+};
diff --git a/test/time/day-test.js b/test/time/day-test.js
deleted file mode 100644
index c408b5ae9447cc..00000000000000
--- a/test/time/day-test.js
+++ /dev/null
@@ -1,178 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.day");
-
-suite.addBatch({
- "day": {
- topic: load("time/day").expression("d3.time.day"),
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns midnights": function(floor) {
- assert.deepEqual(floor(local(2010, 11, 31, 23)), local(2010, 11, 31));
- assert.deepEqual(floor(local(2011, 00, 01, 00)), local(2011, 00, 01));
- assert.deepEqual(floor(local(2011, 00, 01, 01)), local(2011, 00, 01));
- },
- "observes start of daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 02, 13, 07)), local(2011, 02, 12));
- assert.deepEqual(floor(utc(2011, 02, 13, 08)), local(2011, 02, 13));
- assert.deepEqual(floor(utc(2011, 02, 13, 09)), local(2011, 02, 13));
- assert.deepEqual(floor(utc(2011, 02, 13, 10)), local(2011, 02, 13));
- },
- "observes end of daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 10, 06, 07)), local(2011, 10, 06));
- assert.deepEqual(floor(utc(2011, 10, 06, 08)), local(2011, 10, 06));
- assert.deepEqual(floor(utc(2011, 10, 06, 09)), local(2011, 10, 06));
- assert.deepEqual(floor(utc(2011, 10, 06, 10)), local(2011, 10, 06));
- },
- "correctly handles years in the first century": function(floor) {
- assert.deepEqual(floor(local(0011, 10, 06, 07)), local(0011, 10, 06));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns midnights": function(ceil) {
- assert.deepEqual(ceil(local(2010, 11, 30, 23)), local(2010, 11, 31));
- assert.deepEqual(ceil(local(2010, 11, 31, 00)), local(2010, 11, 31));
- assert.deepEqual(ceil(local(2010, 11, 31, 01)), local(2011, 00, 01));
- },
- "observes start of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 02, 13, 07)), local(2011, 02, 13));
- assert.deepEqual(ceil(utc(2011, 02, 13, 08)), local(2011, 02, 13));
- assert.deepEqual(ceil(utc(2011, 02, 13, 09)), local(2011, 02, 14));
- assert.deepEqual(ceil(utc(2011, 02, 13, 10)), local(2011, 02, 14));
- },
- "observes end of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 10, 06, 07)), local(2011, 10, 06));
- assert.deepEqual(ceil(utc(2011, 10, 06, 08)), local(2011, 10, 07));
- assert.deepEqual(ceil(utc(2011, 10, 06, 09)), local(2011, 10, 07));
- assert.deepEqual(ceil(utc(2011, 10, 06, 10)), local(2011, 10, 07));
- },
- "handles midnight for leap years": function(ceil) {
- assert.deepEqual(ceil(utc(2012, 02, 01, 00)), local(2012, 02, 01));
- assert.deepEqual(ceil(utc(2012, 02, 01, 00)), local(2012, 02, 01));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = local(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, local(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), +1), local(2011, 00, 01, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 456), -2), local(2010, 11, 29, 23, 59, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31), -1), local(2010, 11, 30));
- assert.deepEqual(offset(local(2011, 00, 01), -2), local(2010, 11, 30));
- assert.deepEqual(offset(local(2011, 00, 01), -1), local(2010, 11, 31));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31), +1), local(2011, 00, 01));
- assert.deepEqual(offset(local(2010, 11, 30), +2), local(2011, 00, 01));
- assert.deepEqual(offset(local(2010, 11, 30), +1), local(2010, 11, 31));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), 0), local(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 58, 000), 0), local(2010, 11, 31, 23, 59, 58, 000));
- }
- },
- "UTC": {
- topic: function(interval) {
- return interval.utc;
- },
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns midnights": function(floor) {
- assert.deepEqual(floor(utc(2010, 11, 31, 23)), utc(2010, 11, 31));
- assert.deepEqual(floor(utc(2011, 00, 01, 00)), utc(2011, 00, 01));
- assert.deepEqual(floor(utc(2011, 00, 01, 01)), utc(2011, 00, 01));
- },
- "does not observe the start of daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 02, 13, 07)), utc(2011, 02, 13));
- assert.deepEqual(floor(utc(2011, 02, 13, 08)), utc(2011, 02, 13));
- assert.deepEqual(floor(utc(2011, 02, 13, 09)), utc(2011, 02, 13));
- assert.deepEqual(floor(utc(2011, 02, 13, 10)), utc(2011, 02, 13));
- },
- "does not observe the end of daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 10, 06, 05)), utc(2011, 10, 06));
- assert.deepEqual(floor(utc(2011, 10, 06, 06)), utc(2011, 10, 06));
- assert.deepEqual(floor(utc(2011, 10, 06, 07)), utc(2011, 10, 06));
- assert.deepEqual(floor(utc(2011, 10, 06, 08)), utc(2011, 10, 06));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns midnights": function(ceil) {
- assert.deepEqual(ceil(utc(2010, 11, 30, 23)), utc(2010, 11, 31));
- assert.deepEqual(ceil(utc(2010, 11, 31, 00)), utc(2010, 11, 31));
- assert.deepEqual(ceil(utc(2010, 11, 31, 01)), utc(2011, 00, 01));
- },
- "does not observe the start of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 02, 13, 07)), utc(2011, 02, 14));
- assert.deepEqual(ceil(utc(2011, 02, 13, 08)), utc(2011, 02, 14));
- assert.deepEqual(ceil(utc(2011, 02, 13, 09)), utc(2011, 02, 14));
- assert.deepEqual(ceil(utc(2011, 02, 13, 10)), utc(2011, 02, 14));
- },
- "does not observe the end of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 10, 06, 05)), utc(2011, 10, 07));
- assert.deepEqual(ceil(utc(2011, 10, 06, 06)), utc(2011, 10, 07));
- assert.deepEqual(ceil(utc(2011, 10, 06, 07)), utc(2011, 10, 07));
- assert.deepEqual(ceil(utc(2011, 10, 06, 08)), utc(2011, 10, 07));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = utc(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, utc(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), +1), utc(2011, 00, 01, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 456), -2), utc(2010, 11, 29, 23, 59, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31), -1), utc(2010, 11, 30));
- assert.deepEqual(offset(utc(2011, 00, 01), -2), utc(2010, 11, 30));
- assert.deepEqual(offset(utc(2011, 00, 01), -1), utc(2010, 11, 31));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31), +1), utc(2011, 00, 01));
- assert.deepEqual(offset(utc(2010, 11, 30), +2), utc(2011, 00, 01));
- assert.deepEqual(offset(utc(2010, 11, 30), +1), utc(2010, 11, 31));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), 0), utc(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 58, 000), 0), utc(2010, 11, 31, 23, 59, 58, 000));
- }
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/dayOfYear-test.js b/test/time/dayOfYear-test.js
deleted file mode 100644
index 91866cd78e3886..00000000000000
--- a/test/time/dayOfYear-test.js
+++ /dev/null
@@ -1,16 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.time.dayOfYear");
-
-suite.addBatch({
- "dayOfYear": {
- topic: load("time/day").expression("d3.time.dayOfYear"),
- "no floating-point rounding error": function(dayOfYear) {
- assert.equal(dayOfYear(new Date(2011, 4, 9)), 128);
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/days-test.js b/test/time/days-test.js
deleted file mode 100644
index e20dc36c8209e8..00000000000000
--- a/test/time/days-test.js
+++ /dev/null
@@ -1,95 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.days");
-
-suite.addBatch({
- "days": {
- topic: load("time/day").expression("d3.time.days"),
- "returns midnights": function(range) {
- assert.deepEqual(range(local(2010, 11, 31, 12), local(2011, 0, 3, 12)), [
- local(2011, 0, 1),
- local(2011, 0, 2),
- local(2011, 0, 3)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(local(2010, 11, 31), local(2011, 0, 3))[0], local(2010, 11, 31));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(local(2010, 11, 31), local(2011, 0, 3))[2], local(2011, 0, 2));
- },
- "can skip days": function(range) {
- assert.deepEqual(range(local(2010, 11, 29), local(2011, 0, 14), 5), [
- local(2010, 11, 31),
- local(2011, 0, 1),
- local(2011, 0, 6),
- local(2011, 0, 11)
- ]);
- },
- "observes start of daylight savings time": function(range) {
- assert.deepEqual(range(local(2011, 2, 12), local(2011, 2, 16)), [
- local(2011, 2, 12),
- local(2011, 2, 13),
- local(2011, 2, 14),
- local(2011, 2, 15)
- ]);
- },
- "observes end of daylight savings time": function(range) {
- assert.deepEqual(range(local(2011, 10, 5), local(2011, 10, 9)), [
- local(2011, 10, 5),
- local(2011, 10, 6),
- local(2011, 10, 7),
- local(2011, 10, 8)
- ]);
- },
- "UTC": {
- topic: function(range) {
- return range.utc;
- },
- "returns midnights": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31, 12), utc(2011, 0, 3, 12)), [
- utc(2011, 0, 1),
- utc(2011, 0, 2),
- utc(2011, 0, 3)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31), utc(2011, 0, 3))[0], utc(2010, 11, 31));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31), utc(2011, 0, 3))[2], utc(2011, 0, 2));
- },
- "can skip days": function(range) {
- assert.deepEqual(range(utc(2010, 11, 29), utc(2011, 0, 14), 5), [
- utc(2010, 11, 31),
- utc(2011, 0, 1),
- utc(2011, 0, 6),
- utc(2011, 0, 11)
- ]);
- },
- "does not observe the start of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 2, 12), utc(2011, 2, 16)), [
- utc(2011, 2, 12),
- utc(2011, 2, 13),
- utc(2011, 2, 14),
- utc(2011, 2, 15)
- ]);
- },
- "does not observe the end of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 10, 5), utc(2011, 10, 9)), [
- utc(2011, 10, 5),
- utc(2011, 10, 6),
- utc(2011, 10, 7),
- utc(2011, 10, 8)
- ]);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/format-iso-test.js b/test/time/format-iso-test.js
deleted file mode 100644
index fbc0f91e42874a..00000000000000
--- a/test/time/format-iso-test.js
+++ /dev/null
@@ -1,33 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- utc = time.utc;
-
-var suite = vows.describe("d3.time.format");
-
-suite.addBatch({
- "format.iso": {
- topic: load("time/format-iso").expression("d3.time.format.iso"),
-
- "toString is %Y-%m-%dT%H:%M:%S.%LZ": function(format) {
- assert.equal(format + "", "%Y-%m-%dT%H:%M:%S.%LZ");
- },
-
- "formats as ISO 8601": function(format) {
- assert.equal(format(utc(1990, 0, 1, 0, 0, 0)), "1990-01-01T00:00:00.000Z");
- assert.equal(format(utc(2011, 11, 31, 23, 59, 59)), "2011-12-31T23:59:59.000Z");
- },
-
- "parse": {
- "parses as ISO 8601": function(format) {
- var p = format.parse;
- assert.deepEqual(p("1990-01-01T00:00:00.000Z"), utc(1990, 0, 1, 0, 0, 0));
- assert.deepEqual(p("2011-12-31T23:59:59.000Z"), utc(2011, 11, 31, 23, 59, 59));
- assert.isNull(p("1990-01-01T00:00:00.000X"));
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/format-test.js b/test/time/format-test.js
deleted file mode 100644
index 6697d220c47c92..00000000000000
--- a/test/time/format-test.js
+++ /dev/null
@@ -1,310 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local;
-
-var suite = vows.describe("d3.time.format");
-
-suite.addBatch({
- "format": {
- topic: load("time/format").expression("d3.time.format"),
- "formats abbreviated weekday": function(format) {
- var f = format("%a");
- assert.equal(f(local(1990, 0, 1)), "Mon");
- assert.equal(f(local(1990, 0, 2)), "Tue");
- assert.equal(f(local(1990, 0, 3)), "Wed");
- assert.equal(f(local(1990, 0, 4)), "Thu");
- assert.equal(f(local(1990, 0, 5)), "Fri");
- assert.equal(f(local(1990, 0, 6)), "Sat");
- assert.equal(f(local(1990, 0, 7)), "Sun");
- },
- "formats weekday": function(format) {
- var f = format("%A");
- assert.equal(f(local(1990, 0, 1)), "Monday");
- assert.equal(f(local(1990, 0, 2)), "Tuesday");
- assert.equal(f(local(1990, 0, 3)), "Wednesday");
- assert.equal(f(local(1990, 0, 4)), "Thursday");
- assert.equal(f(local(1990, 0, 5)), "Friday");
- assert.equal(f(local(1990, 0, 6)), "Saturday");
- assert.equal(f(local(1990, 0, 7)), "Sunday");
- },
- "formats abbreviated month": function(format) {
- var f = format("%b");
- assert.equal(f(local(1990, 0, 1)), "Jan");
- assert.equal(f(local(1990, 1, 1)), "Feb");
- assert.equal(f(local(1990, 2, 1)), "Mar");
- assert.equal(f(local(1990, 3, 1)), "Apr");
- assert.equal(f(local(1990, 4, 1)), "May");
- assert.equal(f(local(1990, 5, 1)), "Jun");
- assert.equal(f(local(1990, 6, 1)), "Jul");
- assert.equal(f(local(1990, 7, 1)), "Aug");
- assert.equal(f(local(1990, 8, 1)), "Sep");
- assert.equal(f(local(1990, 9, 1)), "Oct");
- assert.equal(f(local(1990, 10, 1)), "Nov");
- assert.equal(f(local(1990, 11, 1)), "Dec");
- },
- "formats locale date and time": function(format) {
- var f = format("%c");
- assert.equal(f(local(1990, 0, 1)), "Mon Jan 1 00:00:00 1990");
- },
- "formats zero-padded date": function(format) {
- var f = format("%d");
- assert.equal(f(local(1990, 0, 1)), "01");
- },
- "formats space-padded date": function(format) {
- var f = format("%e");
- assert.equal(f(local(1990, 0, 1)), " 1");
- },
- "formats zero-padded hour (24)": function(format) {
- var f = format("%H");
- assert.equal(f(local(1990, 0, 1, 0)), "00");
- assert.equal(f(local(1990, 0, 1, 13)), "13");
- },
- "formats zero-padded hour (12)": function(format) {
- var f = format("%I");
- assert.equal(f(local(1990, 0, 1, 0)), "12");
- assert.equal(f(local(1990, 0, 1, 13)), "01");
- },
- "formats zero-padded day of year": function(format) {
- var f = format("%j");
- assert.equal(f(local(1990, 0, 1)), "001");
- assert.equal(f(local(1990, 5, 1)), "152");
- assert.equal(f(local(2010, 2, 13)), "072");
- assert.equal(f(local(2010, 2, 14)), "073"); // DST begins
- assert.equal(f(local(2010, 2, 15)), "074");
- assert.equal(f(local(2010, 10, 6)), "310");
- assert.equal(f(local(2010, 10, 7)), "311"); // DST ends
- assert.equal(f(local(2010, 10, 8)), "312");
- },
- "formats zero-padded month": function(format) {
- var f = format("%m");
- assert.equal(f(local(1990, 0, 1)), "01");
- assert.equal(f(local(1990, 9, 1)), "10");
- },
- "formats zero-padded minute": function(format) {
- var f = format("%M");
- assert.equal(f(local(1990, 0, 1, 0, 0)), "00");
- assert.equal(f(local(1990, 0, 1, 0, 32)), "32");
- },
- "formats AM or PM": function(format) {
- var f = format("%p");
- assert.equal(f(local(1990, 0, 1, 0)), "AM");
- assert.equal(f(local(1990, 0, 1, 13)), "PM");
- },
- "formats zero-padded second": function(format) {
- var f = format("%S");
- assert.equal(f(local(1990, 0, 1, 0, 0, 0)), "00");
- assert.equal(f(local(1990, 0, 1, 0, 0, 32)), "32");
- var f = format("%0S");
- assert.equal(f(local(1990, 0, 1, 0, 0, 0)), "00");
- assert.equal(f(local(1990, 0, 1, 0, 0, 32)), "32");
- },
- "formats space-padded second": function(format) {
- var f = format("%_S");
- assert.equal(f(local(1990, 0, 1, 0, 0, 0)), " 0");
- assert.equal(f(local(1990, 0, 1, 0, 0, 3)), " 3");
- assert.equal(f(local(1990, 0, 1, 0, 0, 32)), "32");
- },
- "formats no-padded second": function(format) {
- var f = format("%-S");
- assert.equal(f(local(1990, 0, 1, 0, 0, 0)), "0");
- assert.equal(f(local(1990, 0, 1, 0, 0, 3)), "3");
- assert.equal(f(local(1990, 0, 1, 0, 0, 32)), "32");
- },
- "formats zero-padded millisecond": function(format) {
- var f = format("%L");
- assert.equal(f(local(1990, 0, 1, 0, 0, 0, 0)), "000");
- assert.equal(f(local(1990, 0, 1, 0, 0, 0, 432)), "432");
- },
- "formats zero-padded week number": function(format) {
- var f = format("%U");
- assert.equal(f(local(1990, 0, 1)), "00");
- assert.equal(f(local(1990, 5, 1)), "21");
- assert.equal(f(local(2010, 2, 13, 23)), "10");
- assert.equal(f(local(2010, 2, 14, 00)), "11"); // DST begins
- assert.equal(f(local(2010, 2, 15, 00)), "11");
- assert.equal(f(local(2010, 10, 6, 23)), "44");
- assert.equal(f(local(2010, 10, 7, 00)), "45"); // DST ends
- assert.equal(f(local(2010, 10, 8, 00)), "45");
- },
- "formats locale date": function(format) {
- var f = format("%x");
- assert.equal(f(local(1990, 0, 1)), "01/01/1990");
- assert.equal(f(local(2010, 5, 1)), "06/01/2010");
- },
- "formats locale time": function(format) {
- var f = format("%X");
- assert.equal(f(local(1990, 0, 1)), "00:00:00");
- assert.equal(f(local(1990, 0, 1, 13, 34, 59)), "13:34:59");
- },
- "formats zero-padded two-digit year": function(format) {
- var f = format("%y");
- assert.equal(f(local(1990, 0, 1)), "90");
- assert.equal(f(local(2002, 0, 1)), "02");
- assert.equal(f(local(-2, 0, 1)), "-02");
- },
- "formats zero-padded four-digit year": function(format) {
- var f = format("%Y");
- assert.equal(f(local(123, 0, 1)), "0123");
- assert.equal(f(local(1990, 0, 1)), "1990");
- assert.equal(f(local(2002, 0, 1)), "2002");
- assert.equal(f(local(10002, 0, 1)), "0002");
- assert.equal(f(local(-2, 0, 1)), "-0002");
- },
- "formats time zone": function(format) {
- var f = format("%Z");
- assert.equal(f(local(1990, 0, 1)), "-0800");
- },
- "formats literal percent sign": function(format) {
- var f = format("%%");
- assert.equal(f(local(1990, 0, 1)), "%");
- },
-
- "parse": {
- "parses abbreviated weekday and numeric date": function(format) {
- var p = format("%a %m/%d/%Y").parse;
- assert.deepEqual(p("Sun 01/01/1990"), local(1990, 0, 1));
- assert.deepEqual(p("Wed 02/03/1991"), local(1991, 1, 3));
- assert.isNull(p("XXX 03/10/2010"));
- },
- "parses weekday and numeric date": function(format) {
- var p = format("%A %m/%d/%Y").parse;
- assert.deepEqual(p("Sunday 01/01/1990"), local(1990, 0, 1));
- assert.deepEqual(p("Wednesday 02/03/1991"), local(1991, 1, 3));
- assert.isNull(p("Caturday 03/10/2010"));
- },
- "parses abbreviated weekday, week number (Sunday) and year": function(format) {
- var p = format("%a %U %Y").parse;
- assert.deepEqual(p("Mon 00 1990"), local(1990, 0, 1));
- assert.deepEqual(p("Sun 05 1991"), local(1991, 1, 3));
- assert.deepEqual(p("Sun 01 1995"), local(1995, 0, 1));
- assert.isNull(p("XXX 03 2010"));
- },
- "parses weekday, week number (Sunday) and year": function(format) {
- var p = format("%A %U %Y").parse;
- assert.deepEqual(p("Monday 00 1990"), local(1990, 0, 1));
- assert.deepEqual(p("Sunday 05 1991"), local(1991, 1, 3));
- assert.deepEqual(p("Sunday 01 1995"), local(1995, 0, 1));
- assert.isNull(p("Caturday 03 2010"));
- },
- "parses numeric weekday, week number (Sunday) and year": function(format) {
- var p = format("%w %U %Y").parse;
- assert.deepEqual(p("1 00 1990"), local(1990, 0, 1));
- assert.deepEqual(p("0 05 1991"), local(1991, 1, 3));
- assert.deepEqual(p("0 01 1995"), local(1995, 0, 1));
- assert.isNull(p("X 03 2010"));
- },
- "parses abbreviated weekday, week number (Monday) and year": function(format) {
- var p = format("%a %W %Y").parse;
- assert.deepEqual(p("Mon 01 1990"), local(1990, 0, 1));
- assert.deepEqual(p("Sun 04 1991"), local(1991, 1, 3));
- assert.deepEqual(p("Sun 00 1995"), local(1995, 0, 1));
- assert.isNull(p("XXX 03 2010"));
- },
- "parses weekday, week number (Monday) and year": function(format) {
- var p = format("%A %W %Y").parse;
- assert.deepEqual(p("Monday 01 1990"), local(1990, 0, 1));
- assert.deepEqual(p("Sunday 04 1991"), local(1991, 1, 3));
- assert.deepEqual(p("Sunday 00 1995"), local(1995, 0, 1));
- assert.isNull(p("Caturday 03 2010"));
- },
- "parses numeric weekday, week number (Monday) and year": function(format) {
- var p = format("%w %W %Y").parse;
- assert.deepEqual(p("1 01 1990"), local(1990, 0, 1));
- assert.deepEqual(p("0 04 1991"), local(1991, 1, 3));
- assert.deepEqual(p("0 00 1995"), local(1995, 0, 1));
- assert.isNull(p("X 03 2010"));
- },
- "parses numeric date": function(format) {
- var p = format("%m/%d/%y").parse;
- assert.deepEqual(p("01/01/90"), local(1990, 0, 1));
- assert.deepEqual(p("02/03/91"), local(1991, 1, 3));
- assert.isNull(p("03/10/2010"));
- },
- "parses locale date": function(format) {
- var p = format("%x").parse;
- assert.deepEqual(p("01/01/1990"), local(1990, 0, 1));
- assert.deepEqual(p("02/03/1991"), local(1991, 1, 3));
- assert.deepEqual(p("03/10/2010"), local(2010, 2, 10));
- },
- "parses abbreviated month, date and year": function(format) {
- var p = format("%b %d, %Y").parse;
- assert.deepEqual(p("jan 01, 1990"), local(1990, 0, 1));
- assert.deepEqual(p("feb 2, 2010"), local(2010, 1, 2));
- assert.isNull(p("jan. 1, 1990"));
- },
- "parses month, date and year": function(format) {
- var p = format("%B %d, %Y").parse;
- assert.deepEqual(p("january 01, 1990"), local(1990, 0, 1));
- assert.deepEqual(p("February 2, 2010"), local(2010, 1, 2));
- assert.isNull(p("jan 1, 1990"));
- },
- "parses day of year and numeric date": function(format) {
- var p = format("%j %m/%d/%Y").parse;
- assert.deepEqual(p("001 01/01/1990"), local(1990, 0, 1));
- assert.deepEqual(p("034 02/03/1991"), local(1991, 1, 3));
- assert.isNull(p("2012 03/10/2010"));
- },
- "parses locale date and time": function(format) {
- var p = format("%c").parse;
- assert.deepEqual(p("Mon Jan 1 00:00:00 1990"), local(1990, 0, 1));
- assert.deepEqual(p("Sun Jan 1 00:00:00 1990"), local(1990, 0, 1));
- assert.deepEqual(p("Mon Jan 01 00:00:00 1990"), local(1990, 0, 1));
- assert.deepEqual(p("Mon Jan 1 00:00:00 1990"), local(1990, 0, 1));
- assert.deepEqual(p("Mon Jan 1 0:0:0 1990"), local(1990, 0, 1));
- },
- "parses twenty-four hour, minute and second": function(format) {
- var p = format("%H:%M:%S").parse;
- assert.deepEqual(p("00:00:00"), local(1900, 0, 1, 0, 0, 0));
- assert.deepEqual(p("11:59:59"), local(1900, 0, 1, 11, 59, 59));
- assert.deepEqual(p("12:00:00"), local(1900, 0, 1, 12, 0, 0));
- assert.deepEqual(p("12:00:01"), local(1900, 0, 1, 12, 0, 1));
- assert.deepEqual(p("23:59:59"), local(1900, 0, 1, 23, 59, 59));
- },
- "parses locale time": function(format) {
- var p = format("%X").parse;
- assert.deepEqual(p("00:00:00"), local(1900, 0, 1, 0, 0, 0));
- assert.deepEqual(p("11:59:59"), local(1900, 0, 1, 11, 59, 59));
- assert.deepEqual(p("12:00:00"), local(1900, 0, 1, 12, 0, 0));
- assert.deepEqual(p("12:00:01"), local(1900, 0, 1, 12, 0, 1));
- assert.deepEqual(p("23:59:59"), local(1900, 0, 1, 23, 59, 59));
- },
- "parses twelve hour, minute and second": function(format) {
- var p = format("%I:%M:%S %p").parse;
- assert.deepEqual(p("12:00:00 am"), local(1900, 0, 1, 0, 0, 0));
- assert.deepEqual(p("11:59:59 AM"), local(1900, 0, 1, 11, 59, 59));
- assert.deepEqual(p("12:00:00 pm"), local(1900, 0, 1, 12, 0, 0));
- assert.deepEqual(p("12:00:01 pm"), local(1900, 0, 1, 12, 0, 1));
- assert.deepEqual(p("11:59:59 PM"), local(1900, 0, 1, 23, 59, 59));
- },
- "parses literal %": function(format) {
- var p = format("%% %m/%d/%Y").parse;
- assert.deepEqual(p("% 01/01/1990"), local(1990, 0, 1));
- assert.deepEqual(p("% 02/03/1991"), local(1991, 1, 3));
- assert.isNull(p("%% 03/10/2010"));
- },
- "parses timezone offset": function(format) {
- var p = format("%m/%d/%Y %Z").parse;
- assert.deepEqual(p("01/02/1990 +0000"), local(1990, 0, 1, 16));
- assert.deepEqual(p("01/02/1990 +0100"), local(1990, 0, 1, 17));
- assert.deepEqual(p("01/02/1990 -0100"), local(1990, 0, 1, 15));
- },
- "ignores optional padding modifier, skipping zeroes and spaces": function(format) {
- var p = format("%-m/%0d/%_Y").parse;
- assert.deepEqual(p("01/ 1/1990"), local(1990, 0, 1));
- },
- "doesn't crash when given weird strings": function(format) {
- try {
- Object.prototype.foo = 10;
- var p = format("%b %d, %Y").parse;
- assert.isNull(p("foo 1, 1990"));
- } finally {
- delete Object.prototype.foo;
- }
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/format-utc-test.js b/test/time/format-utc-test.js
deleted file mode 100644
index a42a895c25aa6a..00000000000000
--- a/test/time/format-utc-test.js
+++ /dev/null
@@ -1,225 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- utc = time.utc;
-
-var suite = vows.describe("d3.time.format");
-
-suite.addBatch({
- "format.utc": {
- topic: load("time/format-utc").expression("d3.time.format.utc"),
- "formats abbreviated weekday": function(format) {
- var f = format("%a");
- assert.equal(f(utc(1990, 0, 1)), "Mon");
- assert.equal(f(utc(1990, 0, 2)), "Tue");
- assert.equal(f(utc(1990, 0, 3)), "Wed");
- assert.equal(f(utc(1990, 0, 4)), "Thu");
- assert.equal(f(utc(1990, 0, 5)), "Fri");
- assert.equal(f(utc(1990, 0, 6)), "Sat");
- assert.equal(f(utc(1990, 0, 7)), "Sun");
- },
- "formats weekday": function(format) {
- var f = format("%A");
- assert.equal(f(utc(1990, 0, 1)), "Monday");
- assert.equal(f(utc(1990, 0, 2)), "Tuesday");
- assert.equal(f(utc(1990, 0, 3)), "Wednesday");
- assert.equal(f(utc(1990, 0, 4)), "Thursday");
- assert.equal(f(utc(1990, 0, 5)), "Friday");
- assert.equal(f(utc(1990, 0, 6)), "Saturday");
- assert.equal(f(utc(1990, 0, 7)), "Sunday");
- },
- "formats abbreviated month": function(format) {
- var f = format("%b");
- assert.equal(f(utc(1990, 0, 1)), "Jan");
- assert.equal(f(utc(1990, 1, 1)), "Feb");
- assert.equal(f(utc(1990, 2, 1)), "Mar");
- assert.equal(f(utc(1990, 3, 1)), "Apr");
- assert.equal(f(utc(1990, 4, 1)), "May");
- assert.equal(f(utc(1990, 5, 1)), "Jun");
- assert.equal(f(utc(1990, 6, 1)), "Jul");
- assert.equal(f(utc(1990, 7, 1)), "Aug");
- assert.equal(f(utc(1990, 8, 1)), "Sep");
- assert.equal(f(utc(1990, 9, 1)), "Oct");
- assert.equal(f(utc(1990, 10, 1)), "Nov");
- assert.equal(f(utc(1990, 11, 1)), "Dec");
- },
- "formats locale date and time": function(format) {
- var f = format("%c");
- assert.equal(f(utc(1990, 0, 1)), "Mon Jan 1 00:00:00 1990");
- },
- "formats zero-padded date": function(format) {
- var f = format("%d");
- assert.equal(f(utc(1990, 0, 1)), "01");
- },
- "formats space-padded date": function(format) {
- var f = format("%e");
- assert.equal(f(utc(1990, 0, 1)), " 1");
- },
- "formats zero-padded hour (24)": function(format) {
- var f = format("%H");
- assert.equal(f(utc(1990, 0, 1, 0)), "00");
- assert.equal(f(utc(1990, 0, 1, 13)), "13");
- },
- "formats zero-padded hour (12)": function(format) {
- var f = format("%I");
- assert.equal(f(utc(1990, 0, 1, 0)), "12");
- assert.equal(f(utc(1990, 0, 1, 13)), "01");
- },
- "formats zero-padded day of year": function(format) {
- var f = format("%j");
- assert.equal(f(utc(1990, 0, 1)), "001");
- assert.equal(f(utc(1990, 5, 1)), "152");
- assert.equal(f(utc(2010, 2, 13, 23)), "072");
- assert.equal(f(utc(2010, 2, 14, 00)), "073"); // DST begins
- assert.equal(f(utc(2010, 2, 15, 00)), "074");
- assert.equal(f(utc(2010, 10, 6, 23)), "310");
- assert.equal(f(utc(2010, 10, 7, 00)), "311"); // DST ends
- assert.equal(f(utc(2010, 10, 8, 00)), "312");
- },
- "formats zero-padded month": function(format) {
- var f = format("%m");
- assert.equal(f(utc(1990, 0, 1)), "01");
- assert.equal(f(utc(1990, 9, 1)), "10");
- },
- "formats zero-padded minute": function(format) {
- var f = format("%M");
- assert.equal(f(utc(1990, 0, 1, 0, 0)), "00");
- assert.equal(f(utc(1990, 0, 1, 0, 32)), "32");
- },
- "formats AM or PM": function(format) {
- var f = format("%p");
- assert.equal(f(utc(1990, 0, 1, 0)), "AM");
- assert.equal(f(utc(1990, 0, 1, 13)), "PM");
- },
- "formats zero-padded second": function(format) {
- var f = format("%S");
- assert.equal(f(utc(1990, 0, 1, 0, 0, 0)), "00");
- assert.equal(f(utc(1990, 0, 1, 0, 0, 32)), "32");
- },
- "formats zero-padded millisecond": function(format) {
- var f = format("%L");
- assert.equal(f(utc(1990, 0, 1, 0, 0, 0, 0)), "000");
- assert.equal(f(utc(1990, 0, 1, 0, 0, 0, 432)), "432");
- },
- "formats zero-padded week number": function(format) {
- var f = format("%U");
- assert.equal(f(utc(1990, 0, 1)), "00");
- assert.equal(f(utc(1990, 5, 1)), "21");
- assert.equal(f(utc(2010, 2, 13, 23)), "10");
- assert.equal(f(utc(2010, 2, 14, 00)), "11"); // DST begins
- assert.equal(f(utc(2010, 2, 15, 00)), "11");
- assert.equal(f(utc(2010, 10, 6, 23)), "44");
- assert.equal(f(utc(2010, 10, 7, 00)), "45"); // DST ends
- assert.equal(f(utc(2010, 10, 8, 00)), "45");
- },
- "formats locale date": function(format) {
- var f = format("%x");
- assert.equal(f(utc(1990, 0, 1)), "01/01/1990");
- assert.equal(f(utc(2010, 5, 1)), "06/01/2010");
- },
- "formats locale time": function(format) {
- var f = format("%X");
- assert.equal(f(utc(1990, 0, 1)), "00:00:00");
- assert.equal(f(utc(1990, 0, 1, 13, 34, 59)), "13:34:59");
- },
- "formats zero-padded two-digit year": function(format) {
- var f = format("%y");
- assert.equal(f(utc(1990, 0, 1)), "90");
- assert.equal(f(utc(2002, 0, 1)), "02");
- },
- "formats zero-padded four-digit year": function(format) {
- var f = format("%Y");
- assert.equal(f(utc(123, 0, 1)), "0123");
- assert.equal(f(utc(1990, 0, 1)), "1990");
- assert.equal(f(utc(2002, 0, 1)), "2002");
- assert.equal(f(utc(10002, 0, 1)), "0002");
- },
- "formats time zone": function(format) {
- var f = format("%Z");
- assert.equal(f(utc(1990, 0, 1)), "+0000");
- },
- "formats literal percent sign": function(format) {
- var f = format("%%");
- assert.equal(f(utc(1990, 0, 1)), "%");
- },
- "parse": {
- "parses abbreviated weekday and numeric date": function(format) {
- var p = format("%a %m/%d/%Y").parse;
- assert.deepEqual(p("Sun 01/01/1990"), utc(1990, 0, 1));
- assert.deepEqual(p("Wed 02/03/1991"), utc(1991, 1, 3));
- assert.isNull(p("XXX 03/10/2010"));
- },
- "parses weekday and numeric date": function(format) {
- var p = format("%A %m/%d/%Y").parse;
- assert.deepEqual(p("Sunday 01/01/1990"), utc(1990, 0, 1));
- assert.deepEqual(p("Wednesday 02/03/1991"), utc(1991, 1, 3));
- assert.isNull(p("Caturday 03/10/2010"));
- },
- "parses numeric date": function(format) {
- var p = format("%m/%d/%y").parse;
- assert.deepEqual(p("01/01/90"), utc(1990, 0, 1));
- assert.deepEqual(p("02/03/91"), utc(1991, 1, 3));
- assert.isNull(p("03/10/2010"));
- },
- "parses locale date": function(format) {
- var p = format("%x").parse;
- assert.deepEqual(p("01/01/1990"), utc(1990, 0, 1));
- assert.deepEqual(p("02/03/1991"), utc(1991, 1, 3));
- assert.deepEqual(p("03/10/2010"), utc(2010, 2, 10));
- },
- "parses abbreviated month, date and year": function(format) {
- var p = format("%b %d, %Y").parse;
- assert.deepEqual(p("jan 01, 1990"), utc(1990, 0, 1));
- assert.deepEqual(p("feb 2, 2010"), utc(2010, 1, 2));
- assert.isNull(p("jan. 1, 1990"));
- },
- "parses month, date and year": function(format) {
- var p = format("%B %d, %Y").parse;
- assert.deepEqual(p("january 01, 1990"), utc(1990, 0, 1));
- assert.deepEqual(p("February 2, 2010"), utc(2010, 1, 2));
- assert.isNull(p("jan 1, 1990"));
- },
- "parses locale date and time": function(format) {
- var p = format("%c").parse;
- assert.deepEqual(p("Mon Jan 1 00:00:00 1990"), utc(1990, 0, 1));
- assert.deepEqual(p("Sun Jan 1 00:00:00 1990"), utc(1990, 0, 1));
- assert.deepEqual(p("Mon Jan 01 00:00:00 1990"), utc(1990, 0, 1));
- assert.deepEqual(p("Mon Jan 1 00:00:00 1990"), utc(1990, 0, 1));
- assert.deepEqual(p("Mon Jan 1 0:0:0 1990"), utc(1990, 0, 1));
- },
- "parses twenty-four hour, minute and second": function(format) {
- var p = format("%H:%M:%S").parse;
- assert.deepEqual(p("00:00:00"), utc(1900, 0, 1, 0, 0, 0));
- assert.deepEqual(p("11:59:59"), utc(1900, 0, 1, 11, 59, 59));
- assert.deepEqual(p("12:00:00"), utc(1900, 0, 1, 12, 0, 0));
- assert.deepEqual(p("12:00:01"), utc(1900, 0, 1, 12, 0, 1));
- assert.deepEqual(p("23:59:59"), utc(1900, 0, 1, 23, 59, 59));
- },
- "parses locale time": function(format) {
- var p = format("%X").parse;
- assert.deepEqual(p("00:00:00"), utc(1900, 0, 1, 0, 0, 0));
- assert.deepEqual(p("11:59:59"), utc(1900, 0, 1, 11, 59, 59));
- assert.deepEqual(p("12:00:00"), utc(1900, 0, 1, 12, 0, 0));
- assert.deepEqual(p("12:00:01"), utc(1900, 0, 1, 12, 0, 1));
- assert.deepEqual(p("23:59:59"), utc(1900, 0, 1, 23, 59, 59));
- },
- "parses twelve hour, minute and second": function(format) {
- var p = format("%I:%M:%S %p").parse;
- assert.deepEqual(p("12:00:00 am"), utc(1900, 0, 1, 0, 0, 0));
- assert.deepEqual(p("11:59:59 AM"), utc(1900, 0, 1, 11, 59, 59));
- assert.deepEqual(p("12:00:00 pm"), utc(1900, 0, 1, 12, 0, 0));
- assert.deepEqual(p("12:00:01 pm"), utc(1900, 0, 1, 12, 0, 1));
- assert.deepEqual(p("11:59:59 PM"), utc(1900, 0, 1, 23, 59, 59));
- },
- "parses timezone offset": function(format) {
- var p = format("%m/%d/%Y %Z").parse;
- assert.deepEqual(p("01/02/1990 +0000"), utc(1990, 0, 2));
- assert.deepEqual(p("01/02/1990 +0100"), utc(1990, 0, 2, 1));
- assert.deepEqual(p("01/02/1990 -0100"), utc(1990, 0, 1, 23));
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/hour-test.js b/test/time/hour-test.js
deleted file mode 100644
index 757ae2267f9536..00000000000000
--- a/test/time/hour-test.js
+++ /dev/null
@@ -1,215 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.hour");
-
-suite.addBatch({
- "hour": {
- topic: load("time/hour").expression("d3.time.hour"),
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns hours": function(floor) {
- assert.deepEqual(floor(local(2010, 11, 31, 23, 59)), local(2010, 11, 31, 23));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00)), local(2011, 00, 01, 00));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 01)), local(2011, 00, 01, 00));
- },
- "observes start of daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 02, 13, 08, 59)), utc(2011, 02, 13, 08));
- assert.deepEqual(floor(utc(2011, 02, 13, 09, 00)), utc(2011, 02, 13, 09));
- assert.deepEqual(floor(utc(2011, 02, 13, 09, 01)), utc(2011, 02, 13, 09));
- assert.deepEqual(floor(utc(2011, 02, 13, 09, 59)), utc(2011, 02, 13, 09));
- assert.deepEqual(floor(utc(2011, 02, 13, 10, 00)), utc(2011, 02, 13, 10));
- assert.deepEqual(floor(utc(2011, 02, 13, 10, 01)), utc(2011, 02, 13, 10));
- },
- "observes end of daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 10, 06, 07, 59)), utc(2011, 10, 06, 07));
- assert.deepEqual(floor(utc(2011, 10, 06, 08, 00)), utc(2011, 10, 06, 08));
- assert.deepEqual(floor(utc(2011, 10, 06, 08, 01)), utc(2011, 10, 06, 08));
- assert.deepEqual(floor(utc(2011, 10, 06, 08, 59)), utc(2011, 10, 06, 08));
- assert.deepEqual(floor(utc(2011, 10, 06, 09, 00)), utc(2011, 10, 06, 09));
- assert.deepEqual(floor(utc(2011, 10, 06, 09, 01)), utc(2011, 10, 06, 09));
- },
- "NPT": {
- "observes 15-minute offset": time.zone(345, function(floor) {
- assert.deepEqual(floor(local(2010, 11, 31, 23, 59, 59)), utc(2010, 11, 31, 17, 15));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 00)), utc(2010, 11, 31, 18, 15));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 01)), utc(2010, 11, 31, 18, 15));
- })
- },
- "IST": {
- "observes 30-minute offset": time.zone(330, function(floor) {
- assert.deepEqual(floor(local(2010, 11, 31, 23, 59, 59)), utc(2010, 11, 31, 17, 30));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 00)), utc(2010, 11, 31, 18, 30));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 01)), utc(2010, 11, 31, 18, 30));
- })
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns hours": function(ceil) {
- assert.deepEqual(ceil(local(2010, 11, 31, 23, 59)), local(2011, 00, 01, 00));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00)), local(2011, 00, 01, 00));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 01)), local(2011, 00, 01, 01));
- },
- "observes start of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 02, 13, 08, 59)), utc(2011, 02, 13, 09));
- assert.deepEqual(ceil(utc(2011, 02, 13, 09, 00)), utc(2011, 02, 13, 09));
- assert.deepEqual(ceil(utc(2011, 02, 13, 09, 01)), utc(2011, 02, 13, 10));
- assert.deepEqual(ceil(utc(2011, 02, 13, 09, 59)), utc(2011, 02, 13, 10));
- assert.deepEqual(ceil(utc(2011, 02, 13, 10, 00)), utc(2011, 02, 13, 10));
- assert.deepEqual(ceil(utc(2011, 02, 13, 10, 01)), utc(2011, 02, 13, 11));
- },
- "observes end of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 10, 06, 07, 59)), utc(2011, 10, 06, 08));
- assert.deepEqual(ceil(utc(2011, 10, 06, 08, 00)), utc(2011, 10, 06, 08));
- assert.deepEqual(ceil(utc(2011, 10, 06, 08, 01)), utc(2011, 10, 06, 09));
- assert.deepEqual(ceil(utc(2011, 10, 06, 08, 59)), utc(2011, 10, 06, 09));
- assert.deepEqual(ceil(utc(2011, 10, 06, 09, 00)), utc(2011, 10, 06, 09));
- assert.deepEqual(ceil(utc(2011, 10, 06, 09, 01)), utc(2011, 10, 06, 10));
- },
- "NPT": {
- "observes 15-minute offset": time.zone(345, function(ceil) {
- assert.deepEqual(ceil(local(2010, 11, 31, 23, 59, 59)), utc(2010, 11, 31, 18, 15));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 00)), utc(2010, 11, 31, 18, 15));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 01)), utc(2010, 11, 31, 19, 15));
- })
- },
- "IST": {
- "observes 30-minute offset": time.zone(330, function(ceil) {
- assert.deepEqual(ceil(local(2010, 11, 31, 23, 59, 59)), utc(2010, 11, 31, 18, 30));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 00)), utc(2010, 11, 31, 18, 30));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 01)), utc(2010, 11, 31, 19, 30));
- })
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = local(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, local(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), +1), local(2011, 00, 01, 00, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 456), -2), local(2010, 11, 31, 21, 59, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 12), -1), local(2010, 11, 31, 11));
- assert.deepEqual(offset(local(2011, 00, 01, 01), -2), local(2010, 11, 31, 23));
- assert.deepEqual(offset(local(2011, 00, 01, 00), -1), local(2010, 11, 31, 23));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 11), +1), local(2010, 11, 31, 12));
- assert.deepEqual(offset(local(2010, 11, 31, 23), +2), local(2011, 00, 01, 01));
- assert.deepEqual(offset(local(2010, 11, 31, 23), +1), local(2011, 00, 01, 00));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), 0), local(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 58, 000), 0), local(2010, 11, 31, 23, 59, 58, 000));
- }
- },
- "UTC": {
- topic: function(interval) {
- return interval.utc;
- },
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns hours": function(floor) {
- assert.deepEqual(floor(utc(2010, 11, 31, 23, 59)), utc(2010, 11, 31, 23));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00)), utc(2011, 00, 01, 00));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 01)), utc(2011, 00, 01, 00));
- },
- "does not observe the start of daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 02, 13, 08, 59)), utc(2011, 02, 13, 08));
- assert.deepEqual(floor(utc(2011, 02, 13, 09, 00)), utc(2011, 02, 13, 09));
- assert.deepEqual(floor(utc(2011, 02, 13, 09, 01)), utc(2011, 02, 13, 09));
- assert.deepEqual(floor(utc(2011, 02, 13, 09, 59)), utc(2011, 02, 13, 09));
- assert.deepEqual(floor(utc(2011, 02, 13, 10, 00)), utc(2011, 02, 13, 10));
- assert.deepEqual(floor(utc(2011, 02, 13, 10, 01)), utc(2011, 02, 13, 10));
- },
- "does not observe the end of daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 10, 06, 07, 59)), utc(2011, 10, 06, 07));
- assert.deepEqual(floor(utc(2011, 10, 06, 08, 00)), utc(2011, 10, 06, 08));
- assert.deepEqual(floor(utc(2011, 10, 06, 08, 01)), utc(2011, 10, 06, 08));
- assert.deepEqual(floor(utc(2011, 10, 06, 08, 59)), utc(2011, 10, 06, 08));
- assert.deepEqual(floor(utc(2011, 10, 06, 09, 00)), utc(2011, 10, 06, 09));
- assert.deepEqual(floor(utc(2011, 10, 06, 09, 01)), utc(2011, 10, 06, 09));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns hours": function(ceil) {
- assert.deepEqual(ceil(utc(2010, 11, 31, 23, 59)), utc(2011, 00, 01, 00));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00)), utc(2011, 00, 01, 00));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 01)), utc(2011, 00, 01, 01));
- },
- "does not observe the start of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 02, 13, 08, 59)), utc(2011, 02, 13, 09));
- assert.deepEqual(ceil(utc(2011, 02, 13, 09, 00)), utc(2011, 02, 13, 09));
- assert.deepEqual(ceil(utc(2011, 02, 13, 09, 01)), utc(2011, 02, 13, 10));
- assert.deepEqual(ceil(utc(2011, 02, 13, 09, 59)), utc(2011, 02, 13, 10));
- assert.deepEqual(ceil(utc(2011, 02, 13, 10, 00)), utc(2011, 02, 13, 10));
- assert.deepEqual(ceil(utc(2011, 02, 13, 10, 01)), utc(2011, 02, 13, 11));
- },
- "does not observe the end of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 10, 06, 07, 59)), utc(2011, 10, 06, 08));
- assert.deepEqual(ceil(utc(2011, 10, 06, 08, 00)), utc(2011, 10, 06, 08));
- assert.deepEqual(ceil(utc(2011, 10, 06, 08, 01)), utc(2011, 10, 06, 09));
- assert.deepEqual(ceil(utc(2011, 10, 06, 08, 59)), utc(2011, 10, 06, 09));
- assert.deepEqual(ceil(utc(2011, 10, 06, 09, 00)), utc(2011, 10, 06, 09));
- assert.deepEqual(ceil(utc(2011, 10, 06, 09, 01)), utc(2011, 10, 06, 10));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = utc(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, utc(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), +1), utc(2011, 00, 01, 00, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 456), -2), utc(2010, 11, 31, 21, 59, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 12), -1), utc(2010, 11, 31, 11));
- assert.deepEqual(offset(utc(2011, 00, 01, 01), -2), utc(2010, 11, 31, 23));
- assert.deepEqual(offset(utc(2011, 00, 01, 00), -1), utc(2010, 11, 31, 23));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 11), +1), utc(2010, 11, 31, 12));
- assert.deepEqual(offset(utc(2010, 11, 31, 23), +2), utc(2011, 00, 01, 01));
- assert.deepEqual(offset(utc(2010, 11, 31, 23), +1), utc(2011, 00, 01, 00));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), 0), utc(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 58, 000), 0), utc(2010, 11, 31, 23, 59, 58, 000));
- }
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/hours-test.js b/test/time/hours-test.js
deleted file mode 100644
index c0a6a767cde3b5..00000000000000
--- a/test/time/hours-test.js
+++ /dev/null
@@ -1,109 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.hours");
-
-suite.addBatch({
- "hours": {
- topic: load("time/hour").expression("d3.time.hours"),
- "returns hours": function(range) {
- assert.deepEqual(range(local(2010, 11, 31, 12, 30), local(2010, 11, 31, 15, 30)), [
- local(2010, 11, 31, 13),
- local(2010, 11, 31, 14),
- local(2010, 11, 31, 15)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(local(2010, 11, 31, 23), local(2011, 0, 1, 2))[0], local(2010, 11, 31, 23));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(local(2010, 11, 31, 23), local(2011, 0, 1, 2))[2], local(2011, 0, 1, 1));
- },
- "can skip hours": function(range) {
- assert.deepEqual(range(local(2011, 1, 1, 1), local(2011, 1, 1, 13), 3), [
- local(2011, 1, 1, 3),
- local(2011, 1, 1, 6),
- local(2011, 1, 1, 9),
- local(2011, 1, 1, 12)
- ]);
- },
- "observes start of daylight savings time": function(range) {
- assert.deepEqual(range(local(2011, 2, 13, 1), local(2011, 2, 13, 5)), [
- utc(2011, 2, 13, 9),
- utc(2011, 2, 13, 10),
- utc(2011, 2, 13, 11)
- ]);
- },
- "observes end of daylight savings time": function(range) {
- assert.deepEqual(range(local(2011, 10, 6, 0), local(2011, 10, 6, 2)), [
- utc(2011, 10, 6, 7),
- utc(2011, 10, 6, 8),
- utc(2011, 10, 6, 9)
- ]);
- },
- "NPT": {
- "observes 15-minute offset": time.zone(345, function(range) {
- assert.deepEqual(range(local(2011, 10, 7, 0), local(2011, 10, 7, 3)), [
- utc(2011, 10, 6, 18, 15),
- utc(2011, 10, 6, 19, 15),
- utc(2011, 10, 6, 20, 15)
- ]);
- })
- },
- "IST": {
- "observes 30-minute offset": time.zone(330, function(range) {
- assert.deepEqual(range(local(2011, 10, 7, 0), local(2011, 10, 7, 3)), [
- utc(2011, 10, 6, 18, 30),
- utc(2011, 10, 6, 19, 30),
- utc(2011, 10, 6, 20, 30)
- ]);
- })
- },
- "UTC": {
- topic: function(range) {
- return range.utc;
- },
- "returns hours": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31, 12, 30), utc(2010, 11, 31, 15, 30)), [
- utc(2010, 11, 31, 13),
- utc(2010, 11, 31, 14),
- utc(2010, 11, 31, 15)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31, 23), utc(2011, 0, 1, 2))[0], utc(2010, 11, 31, 23));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31, 23), utc(2011, 0, 1, 2))[2], utc(2011, 0, 1, 1));
- },
- "can skip hours": function(range) {
- assert.deepEqual(range(utc(2011, 1, 1, 1), utc(2011, 1, 1, 13), 3), [
- utc(2011, 1, 1, 3),
- utc(2011, 1, 1, 6),
- utc(2011, 1, 1, 9),
- utc(2011, 1, 1, 12)
- ]);
- },
- "observes start of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 2, 13, 9), utc(2011, 2, 13, 12)), [
- utc(2011, 2, 13, 9),
- utc(2011, 2, 13, 10),
- utc(2011, 2, 13, 11)
- ]);
- },
- "observes end of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 10, 6, 7), utc(2011, 10, 6, 10)), [
- utc(2011, 10, 6, 7),
- utc(2011, 10, 6, 8),
- utc(2011, 10, 6, 9)
- ]);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/minute-test.js b/test/time/minute-test.js
deleted file mode 100644
index e3a3c3c2c0608f..00000000000000
--- a/test/time/minute-test.js
+++ /dev/null
@@ -1,127 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.minute");
-
-suite.addBatch({
- "minute": {
- topic: load("time/minute").expression("d3.time.minute"),
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns minutes": function(floor) {
- assert.deepEqual(floor(local(2010, 11, 31, 23, 59, 59)), local(2010, 11, 31, 23, 59));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 00)), local(2011, 00, 01, 00, 00));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 59)), local(2011, 00, 01, 00, 00));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 01, 00)), local(2011, 00, 01, 00, 01));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns minutes": function(ceil) {
- assert.deepEqual(ceil(local(2010, 11, 31, 23, 59, 59)), local(2011, 00, 01, 00, 00));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 00)), local(2011, 00, 01, 00, 00));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 59)), local(2011, 00, 01, 00, 01));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 01, 00)), local(2011, 00, 01, 00, 01));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = local(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, local(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), +1), local(2011, 00, 01, 00, 00, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 456), -2), local(2010, 11, 31, 23, 57, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 12), -1), local(2010, 11, 31, 23, 11));
- assert.deepEqual(offset(local(2011, 00, 01, 00, 01), -2), local(2010, 11, 31, 23, 59));
- assert.deepEqual(offset(local(2011, 00, 01, 00, 00), -1), local(2010, 11, 31, 23, 59));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 11), +1), local(2010, 11, 31, 23, 12));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59), +2), local(2011, 00, 01, 00, 01));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59), +1), local(2011, 00, 01, 00, 00));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), 0), local(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 58, 000), 0), local(2010, 11, 31, 23, 59, 58, 000));
- }
- },
- "UTC": {
- topic: function(interval) {
- return interval.utc;
- },
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns minutes": function(floor) {
- assert.deepEqual(floor(utc(2010, 11, 31, 23, 59, 59)), utc(2010, 11, 31, 23, 59));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00, 00)), utc(2011, 00, 01, 00, 00));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00, 59)), utc(2011, 00, 01, 00, 00));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 01, 00)), utc(2011, 00, 01, 00, 01));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns minutes": function(ceil) {
- assert.deepEqual(ceil(utc(2010, 11, 31, 23, 59, 59)), utc(2011, 00, 01, 00, 00));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00, 00)), utc(2011, 00, 01, 00, 00));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00, 59)), utc(2011, 00, 01, 00, 01));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 01, 00)), utc(2011, 00, 01, 00, 01));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = utc(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, utc(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), +1), utc(2011, 00, 01, 00, 00, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 456), -2), utc(2010, 11, 31, 23, 57, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 12), -1), utc(2010, 11, 31, 23, 11));
- assert.deepEqual(offset(utc(2011, 00, 01, 00, 01), -2), utc(2010, 11, 31, 23, 59));
- assert.deepEqual(offset(utc(2011, 00, 01, 00, 00), -1), utc(2010, 11, 31, 23, 59));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 11), +1), utc(2010, 11, 31, 23, 12));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59), +2), utc(2011, 00, 01, 00, 01));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59), +1), utc(2011, 00, 01, 00, 00));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), 0), utc(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 58, 000), 0), utc(2010, 11, 31, 23, 59, 58, 000));
- }
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/minutes-test.js b/test/time/minutes-test.js
deleted file mode 100644
index 1d176bfcd37952..00000000000000
--- a/test/time/minutes-test.js
+++ /dev/null
@@ -1,91 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.minutes");
-
-suite.addBatch({
- "minutes": {
- topic: load("time/minute").expression("d3.time.minutes"),
- "returns minutes": function(range) {
- assert.deepEqual(range(local(2010, 11, 31, 23, 59), local(2011, 0, 1, 0, 2)), [
- local(2010, 11, 31, 23, 59),
- local(2011, 0, 1, 0, 0),
- local(2011, 0, 1, 0, 1)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(local(2010, 11, 31, 23, 59), local(2011, 0, 1, 0, 2))[0], local(2010, 11, 31, 23, 59));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(local(2010, 11, 31, 23, 59), local(2011, 0, 1, 0, 2))[2], local(2011, 0, 1, 0, 1));
- },
- "can skip minutes": function(range) {
- assert.deepEqual(range(local(2011, 1, 1, 12, 7), local(2011, 1, 1, 13, 7), 15), [
- local(2011, 1, 1, 12, 15),
- local(2011, 1, 1, 12, 30),
- local(2011, 1, 1, 12, 45),
- local(2011, 1, 1, 13, 0)
- ]);
- },
- "observes start of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 2, 13, 9, 59), utc(2011, 2, 13, 10, 2)), [
- utc(2011, 2, 13, 9, 59),
- utc(2011, 2, 13, 10, 0),
- utc(2011, 2, 13, 10, 1)
- ]);
- },
- "observes end of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 10, 6, 8, 59), utc(2011, 10, 6, 9, 2)), [
- utc(2011, 10, 6, 8, 59),
- utc(2011, 10, 6, 9, 0),
- utc(2011, 10, 6, 9, 1)
- ]);
- },
- "UTC": {
- topic: function(range) {
- return range.utc;
- },
- "returns minutes": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31, 23, 59), utc(2011, 0, 1, 0, 2)), [
- utc(2010, 11, 31, 23, 59),
- utc(2011, 0, 1, 0, 0),
- utc(2011, 0, 1, 0, 1)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31, 23, 59), utc(2011, 0, 1, 0, 2))[0], utc(2010, 11, 31, 23, 59));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31, 23, 59), utc(2011, 0, 1, 0, 2))[2], utc(2011, 0, 1, 0, 1));
- },
- "can skip minutes": function(range) {
- assert.deepEqual(range(utc(2011, 1, 1, 12, 7), utc(2011, 1, 1, 13, 7), 15), [
- utc(2011, 1, 1, 12, 15),
- utc(2011, 1, 1, 12, 30),
- utc(2011, 1, 1, 12, 45),
- utc(2011, 1, 1, 13, 0)
- ]);
- },
- "does not observe the start of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 2, 13, 9, 59), utc(2011, 2, 13, 10, 2)), [
- utc(2011, 2, 13, 9, 59),
- utc(2011, 2, 13, 10, 0),
- utc(2011, 2, 13, 10, 1)
- ]);
- },
- "does not observe the end of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 10, 6, 8, 59), utc(2011, 10, 6, 9, 2)), [
- utc(2011, 10, 6, 8, 59),
- utc(2011, 10, 6, 9, 0),
- utc(2011, 10, 6, 9, 1)
- ]);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/month-test.js b/test/time/month-test.js
deleted file mode 100644
index 10f349df70731e..00000000000000
--- a/test/time/month-test.js
+++ /dev/null
@@ -1,150 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.month");
-
-suite.addBatch({
- "month": {
- topic: load("time/month").expression("d3.time.month"),
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns months": function(floor) {
- assert.deepEqual(floor(local(2010, 11, 31, 23, 59, 59)), local(2010, 11, 01));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 00)), local(2011, 00, 01));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 01)), local(2011, 00, 01));
- },
- "observes the start of daylight savings time": function(floor) {
- assert.deepEqual(floor(local(2011, 02, 13, 01)), local(2011, 02, 01));
- },
- "observes the end of the daylight savings time": function(floor) {
- assert.deepEqual(floor(local(2011, 10, 06, 01)), local(2011, 10, 01));
- },
- "correctly handles years in the first century": function(floor) {
- assert.deepEqual(floor(local(0011, 10, 06, 07)), local(0011, 10, 01));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns months": function(ceil) {
- assert.deepEqual(ceil(local(2010, 11, 31, 23, 59, 59)), local(2011, 00, 01));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 00)), local(2011, 00, 01));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 01)), local(2011, 01, 01));
- },
- "observes the start of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(local(2011, 02, 13, 01)), local(2011, 03, 01));
- },
- "observes the end of the daylight savings time": function(ceil) {
- assert.deepEqual(ceil(local(2011, 10, 06, 01)), local(2011, 11, 01));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = local(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, local(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), +1), local(2011, 00, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 456), -2), local(2010, 09, 31, 23, 59, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 01), -1), local(2010, 10, 01));
- assert.deepEqual(offset(local(2011, 00, 01), -2), local(2010, 10, 01));
- assert.deepEqual(offset(local(2011, 00, 01), -1), local(2010, 11, 01));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 10, 01), +1), local(2010, 11, 01));
- assert.deepEqual(offset(local(2010, 10, 01), +2), local(2011, 00, 01));
- assert.deepEqual(offset(local(2010, 11, 01), +1), local(2011, 00, 01));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), 0), local(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 58, 000), 0), local(2010, 11, 31, 23, 59, 58, 000));
- }
- },
- "UTC": {
- topic: function(interval) {
- return interval.utc;
- },
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns months": function(floor) {
- assert.deepEqual(floor(utc(2010, 11, 31, 23, 59, 59)), utc(2010, 11, 01));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00, 00)), utc(2011, 00, 01));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00, 01)), utc(2011, 00, 01));
- },
- "does not observe the start of daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 02, 13, 01)), utc(2011, 02, 01));
- },
- "does not observe the end of the daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 10, 06, 01)), utc(2011, 10, 01));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns months": function(ceil) {
- assert.deepEqual(ceil(utc(2010, 11, 31, 23, 59, 59)), utc(2011, 00, 01));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00, 00)), utc(2011, 00, 01));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00, 01)), utc(2011, 01, 01));
- },
- "does not observe the start of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 02, 13, 01)), utc(2011, 03, 01));
- },
- "does not observe the end of the daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 10, 06, 01)), utc(2011, 11, 01));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = utc(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, utc(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), +1), utc(2011, 00, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 456), -2), utc(2010, 09, 31, 23, 59, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 01), -1), utc(2010, 10, 01));
- assert.deepEqual(offset(utc(2011, 00, 01), -2), utc(2010, 10, 01));
- assert.deepEqual(offset(utc(2011, 00, 01), -1), utc(2010, 11, 01));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 10, 01), +1), utc(2010, 11, 01));
- assert.deepEqual(offset(utc(2010, 10, 01), +2), utc(2011, 00, 01));
- assert.deepEqual(offset(utc(2010, 11, 01), +1), utc(2011, 00, 01));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), 0), utc(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 58, 000), 0), utc(2010, 11, 31, 23, 59, 58, 000));
- }
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/months-test.js b/test/time/months-test.js
deleted file mode 100644
index 82bca86baf8191..00000000000000
--- a/test/time/months-test.js
+++ /dev/null
@@ -1,95 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.months");
-
-suite.addBatch({
- "months": {
- topic: load("time/month").expression("d3.time.months"),
- "returns months": function(range) {
- assert.deepEqual(range(local(2010, 10, 31), local(2011, 2, 1)), [
- local(2010, 11, 1),
- local(2011, 0, 1),
- local(2011, 1, 1)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(local(2010, 10, 31), local(2011, 2, 1))[0], local(2010, 11, 1));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(local(2010, 10, 31), local(2011, 2, 1))[2], local(2011, 1, 1));
- },
- "can skip months": function(range) {
- assert.deepEqual(range(local(2011, 1, 1), local(2012, 1, 1), 3), [
- local(2011, 3, 1),
- local(2011, 6, 1),
- local(2011, 9, 1),
- local(2012, 0, 1)
- ]);
- },
- "observes start of daylight savings time": function(range) {
- assert.deepEqual(range(local(2011, 0, 1), local(2011, 4, 1)), [
- local(2011, 0, 1),
- local(2011, 1, 1),
- local(2011, 2, 1),
- local(2011, 3, 1)
- ]);
- },
- "observes end of daylight savings time": function(range) {
- assert.deepEqual(range(local(2011, 9, 1), local(2012, 1, 1)), [
- local(2011, 9, 1),
- local(2011, 10, 1),
- local(2011, 11, 1),
- local(2012, 0, 1)
- ]);
- },
- "UTC": {
- topic: function(range) {
- return range.utc;
- },
- "returns months": function(range) {
- assert.deepEqual(range(utc(2010, 10, 31), utc(2011, 2, 1)), [
- utc(2010, 11, 1),
- utc(2011, 0, 1),
- utc(2011, 1, 1)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(utc(2010, 10, 31), utc(2011, 2, 1))[0], utc(2010, 11, 1));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(utc(2010, 10, 31), utc(2011, 2, 1))[2], utc(2011, 1, 1));
- },
- "can skip months": function(range) {
- assert.deepEqual(range(utc(2011, 1, 1), utc(2012, 1, 1), 3), [
- utc(2011, 3, 1),
- utc(2011, 6, 1),
- utc(2011, 9, 1),
- utc(2012, 0, 1)
- ]);
- },
- "does not observe the start of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 0, 1), utc(2011, 4, 1)), [
- utc(2011, 0, 1),
- utc(2011, 1, 1),
- utc(2011, 2, 1),
- utc(2011, 3, 1)
- ]);
- },
- "does not observe the end of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 9, 1), utc(2012, 1, 1)), [
- utc(2011, 9, 1),
- utc(2011, 10, 1),
- utc(2011, 11, 1),
- utc(2012, 0, 1)
- ]);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/scale-test.js b/test/time/scale-test.js
deleted file mode 100644
index a213a934489c7b..00000000000000
--- a/test/time/scale-test.js
+++ /dev/null
@@ -1,679 +0,0 @@
-var vows = require("vows"),
- _ = require("../../"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.scale");
-
-suite.addBatch({
- "scale": {
- topic: load("time/scale").expression("d3.time.scale").document(),
-
- "nice": {
- "rounds using the specified time interval": function(scale) {
- var x = scale().domain([local(2009, 0, 1, 0, 12), local(2009, 0, 1, 23, 48)]);
- assert.deepEqual(x.nice(_.time.day).domain(), [local(2009, 0, 1), local(2009, 0, 2)]);
- assert.deepEqual(x.nice(_.time.week).domain(), [local(2008, 11, 28), local(2009, 0, 4)]);
- assert.deepEqual(x.nice(_.time.month).domain(), [local(2008, 11, 1), local(2009, 1, 1)]);
- assert.deepEqual(x.nice(_.time.year).domain(), [local(2008, 0, 1), local(2010, 0, 1)]);
- },
- "rounds using the specified time interval and skip": function(scale) {
- var x = scale().domain([local(2009, 0, 1, 0, 12), local(2009, 0, 1, 23, 48)]);
- assert.deepEqual(x.nice(_.time.day, 3).domain(), [local(2009, 0, 1), local(2009, 0, 4)]);
- assert.deepEqual(x.nice(_.time.week, 2).domain(), [local(2008, 11, 21), local(2009, 0, 4)]);
- assert.deepEqual(x.nice(_.time.month, 3).domain(), [local(2008, 9, 1), local(2009, 3, 1)]);
- assert.deepEqual(x.nice(_.time.year, 10).domain(), [local(2000, 0, 1), local(2010, 0, 1)]);
- },
- "rounds using the specified count": function(scale) {
- var x = scale().domain([local(2009, 0, 1, 0, 17), local(2009, 0, 1, 23, 42)]);
- assert.deepEqual(x.nice(100).domain(), [local(2009, 0, 1, 0, 15), local(2009, 0, 1, 23, 45)]);
- assert.deepEqual(x.nice(10).domain(), [local(2009, 0, 1), local(2009, 0, 2)]);
- },
- "rounds with a default count of ten if no arguments": function(scale) {
- var x = scale().domain([local(2009, 0, 1, 0, 17), local(2009, 0, 1, 23, 42)]);
- assert.deepEqual(x.nice().domain(), [local(2009, 0, 1), local(2009, 0, 2)]);
- },
- "works on degenerate domains": function(scale) {
- var x = scale().domain([local(2009, 0, 1, 0, 12), local(2009, 0, 1, 0, 12)]);
- assert.deepEqual(x.nice(_.time.day).domain(), [local(2009, 0, 1), local(2009, 0, 2)]);
- },
- "nicing a polylinear domain only affects the extent": function(linear) {
- var x = linear().domain([local(2009, 0, 1, 0, 12), local(2009, 0, 1, 23, 48), local(2009, 0, 2, 23, 48)]).nice(_.time.day);
- assert.deepEqual(x.domain(), [local(2009, 0, 1), local(2009, 0, 1, 23, 48), local(2009, 0, 3)]);
- }
- },
-
- "copy": {
- "changes to the domain are isolated": function(scale) {
- var x = scale().domain([local(2009, 0, 1), local(2010, 0, 1)]), y = x.copy();
- x.domain([local(2010, 0, 1), local(2011, 0, 1)]);
- assert.deepEqual(y.domain(), [local(2009, 0, 1), local(2010, 0, 1)]);
- assert.equal(x(local(2010, 0, 1)), 0);
- assert.equal(y(local(2010, 0, 1)), 1);
- y.domain([local(2011, 0, 1), local(2012, 0, 1)]);
- assert.equal(x(local(2011, 0, 1)), 1);
- assert.equal(y(local(2011, 0, 1)), 0);
- assert.deepEqual(x.domain(), [local(2010, 0, 1), local(2011, 0, 1)]);
- assert.deepEqual(y.domain(), [local(2011, 0, 1), local(2012, 0, 1)]);
- },
- "changes to the range are isolated": function(scale) {
- var x = scale().domain([local(2009, 0, 1), local(2010, 0, 1)]), y = x.copy();
- x.range([1, 2]);
- assert.deepEqual(x.invert(1), local(2009, 0, 1));
- assert.deepEqual(y.invert(1), local(2010, 0, 1));
- assert.deepEqual(y.range(), [0, 1]);
- y.range([2, 3]);
- assert.deepEqual(x.invert(2), local(2010, 0, 1));
- assert.deepEqual(y.invert(2), local(2009, 0, 1));
- assert.deepEqual(x.range(), [1, 2]);
- assert.deepEqual(y.range(), [2, 3]);
- },
- "changes to the interpolator are isolated": function(scale) {
- var x = scale().domain([local(2009, 0, 1), local(2010, 0, 1)]).range(["red", "blue"]),
- i = x.interpolate(),
- y = x.copy();
- x.interpolate(_.interpolateHsl);
- assert.equal(x(local(2009, 6, 1)), "#ff00fd");
- assert.equal(y(local(2009, 6, 1)), "#81007e");
- assert.equal(y.interpolate(), i);
- },
- "changes to clamping are isolated": function(scale) {
- var x = scale().domain([local(2009, 0, 1), local(2010, 0, 1)]).clamp(true), y = x.copy();
- x.clamp(false);
- assert.equal(x(local(2011, 0, 1)), 2);
- assert.equal(y(local(2011, 0, 1)), 1);
- assert.isTrue(y.clamp());
- y.clamp(false);
- assert.equal(x(local(2011, 0, 1)), 2);
- assert.equal(y(local(2011, 0, 1)), 2);
- assert.isFalse(x.clamp());
- }
- },
-
- "ticks": {
- "observes explicit tick interval": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 1, 0), local(2011, 0, 1, 12, 4, 4)]);
- assert.deepEqual(x.ticks(_.time.minute), [
- local(2011, 0, 1, 12, 1),
- local(2011, 0, 1, 12, 2),
- local(2011, 0, 1, 12, 3),
- local(2011, 0, 1, 12, 4)
- ]);
- },
- "observes explicit tick interval and step": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 0, 0), local(2011, 0, 1, 12, 33, 4)]);
- assert.deepEqual(x.ticks(_.time.minute, 10), [
- local(2011, 0, 1, 12, 0),
- local(2011, 0, 1, 12, 10),
- local(2011, 0, 1, 12, 20),
- local(2011, 0, 1, 12, 30)
- ]);
- },
- "(deprecated) observes explicit tick range": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 1, 0), local(2011, 0, 1, 12, 4, 4)]);
- assert.deepEqual(x.ticks(_.time.minutes), [
- local(2011, 0, 1, 12, 1),
- local(2011, 0, 1, 12, 2),
- local(2011, 0, 1, 12, 3),
- local(2011, 0, 1, 12, 4)
- ]);
- },
- "(deprecated) observes explicit tick range and step": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 0, 0), local(2011, 0, 1, 12, 33, 4)]);
- assert.deepEqual(x.ticks(_.time.minutes, 10), [
- local(2011, 0, 1, 12, 0),
- local(2011, 0, 1, 12, 10),
- local(2011, 0, 1, 12, 20),
- local(2011, 0, 1, 12, 30)
- ]);
- },
- "generates sub-second ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 0, 0), local(2011, 0, 1, 12, 0, 1)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 12, 0, 0, 0),
- local(2011, 0, 1, 12, 0, 0, 200),
- local(2011, 0, 1, 12, 0, 0, 400),
- local(2011, 0, 1, 12, 0, 0, 600),
- local(2011, 0, 1, 12, 0, 0, 800),
- local(2011, 0, 1, 12, 0, 1, 0)
- ]);
- },
- "generates 1-second ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 0, 0), local(2011, 0, 1, 12, 0, 4)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 12, 0, 0),
- local(2011, 0, 1, 12, 0, 1),
- local(2011, 0, 1, 12, 0, 2),
- local(2011, 0, 1, 12, 0, 3),
- local(2011, 0, 1, 12, 0, 4)
- ]);
- },
- "generates 5-second ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 0, 0), local(2011, 0, 1, 12, 0, 20)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 12, 0, 0),
- local(2011, 0, 1, 12, 0, 5),
- local(2011, 0, 1, 12, 0, 10),
- local(2011, 0, 1, 12, 0, 15),
- local(2011, 0, 1, 12, 0, 20)
- ]);
- },
- "generates 15-second ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 0, 0), local(2011, 0, 1, 12, 0, 50)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 12, 0, 0),
- local(2011, 0, 1, 12, 0, 15),
- local(2011, 0, 1, 12, 0, 30),
- local(2011, 0, 1, 12, 0, 45)
- ]);
- },
- "generates 30-second ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 0, 0), local(2011, 0, 1, 12, 1, 50)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 12, 0, 0),
- local(2011, 0, 1, 12, 0, 30),
- local(2011, 0, 1, 12, 1, 0),
- local(2011, 0, 1, 12, 1, 30)
- ]);
- },
- "generates 1-minute ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 0, 27), local(2011, 0, 1, 12, 4, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 12, 1),
- local(2011, 0, 1, 12, 2),
- local(2011, 0, 1, 12, 3),
- local(2011, 0, 1, 12, 4)
- ]);
- },
- "generates 5-minute ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 3, 27), local(2011, 0, 1, 12, 21, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 12, 5),
- local(2011, 0, 1, 12, 10),
- local(2011, 0, 1, 12, 15),
- local(2011, 0, 1, 12, 20)
- ]);
- },
- "generates 15-minute ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 8, 27), local(2011, 0, 1, 13, 4, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 12, 15),
- local(2011, 0, 1, 12, 30),
- local(2011, 0, 1, 12, 45),
- local(2011, 0, 1, 13, 0)
- ]);
- },
- "generates 30-minute ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 28, 27), local(2011, 0, 1, 14, 4, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 12, 30),
- local(2011, 0, 1, 13, 0),
- local(2011, 0, 1, 13, 30),
- local(2011, 0, 1, 14, 0)
- ]);
- },
- "generates 1-hour ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 12, 28, 27), local(2011, 0, 1, 16, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 13, 0),
- local(2011, 0, 1, 14, 0),
- local(2011, 0, 1, 15, 0),
- local(2011, 0, 1, 16, 0)
- ]);
- },
- "generates 3-hour ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 14, 28, 27), local(2011, 0, 2, 1, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 15, 0),
- local(2011, 0, 1, 18, 0),
- local(2011, 0, 1, 21, 0),
- local(2011, 0, 2, 0, 0)
- ]);
- },
- "generates 6-hour ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 16, 28, 27), local(2011, 0, 2, 14, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 18, 0),
- local(2011, 0, 2, 0, 0),
- local(2011, 0, 2, 6, 0),
- local(2011, 0, 2, 12, 0)
- ]);
- },
- "generates 12-hour ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 16, 28, 27), local(2011, 0, 3, 21, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 2, 0, 0),
- local(2011, 0, 2, 12, 0),
- local(2011, 0, 3, 0, 0),
- local(2011, 0, 3, 12, 0)
- ]);
- },
- "generates 1-day ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 16, 28, 27), local(2011, 0, 5, 21, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 2, 0, 0),
- local(2011, 0, 3, 0, 0),
- local(2011, 0, 4, 0, 0),
- local(2011, 0, 5, 0, 0)
- ]);
- },
- "generates 2-day ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 2, 16, 28, 27), local(2011, 0, 9, 21, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 3, 0, 0),
- local(2011, 0, 5, 0, 0),
- local(2011, 0, 7, 0, 0),
- local(2011, 0, 9, 0, 0)
- ]);
- },
- "generates 1-week ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 1, 16, 28, 27), local(2011, 0, 23, 21, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 2, 0, 0),
- local(2011, 0, 9, 0, 0),
- local(2011, 0, 16, 0, 0),
- local(2011, 0, 23, 0, 0)
- ]);
- },
- "generates 1-month ticks": function(scale) {
- var x = scale().domain([local(2011, 0, 18), local(2011, 4, 2)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 1, 1, 0, 0),
- local(2011, 2, 1, 0, 0),
- local(2011, 3, 1, 0, 0),
- local(2011, 4, 1, 0, 0)
- ]);
- },
- "generates 3-month ticks": function(scale) {
- var x = scale().domain([local(2010, 11, 18), local(2011, 10, 2)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 0, 0),
- local(2011, 3, 1, 0, 0),
- local(2011, 6, 1, 0, 0),
- local(2011, 9, 1, 0, 0)
- ]);
- },
- "generates 1-year ticks": function(scale) {
- var x = scale().domain([local(2010, 11, 18), local(2014, 2, 2)]);
- assert.deepEqual(x.ticks(4), [
- local(2011, 0, 1, 0, 0),
- local(2012, 0, 1, 0, 0),
- local(2013, 0, 1, 0, 0),
- local(2014, 0, 1, 0, 0)
- ]);
- },
- "generates multi-year ticks": function(scale) {
- var x = scale().domain([local(0, 11, 18), local(2014, 2, 2)]);
- assert.deepEqual(x.ticks(6), [
- local( 500, 0, 1, 0, 0),
- local(1000, 0, 1, 0, 0),
- local(1500, 0, 1, 0, 0),
- local(2000, 0, 1, 0, 0)
- ]);
- },
- "returns one tick for degenerate empty domain": function(scale) {
- var x = scale().domain([local(2014, 2, 2), local(2014, 2, 2)]);
- assert.deepEqual(x.ticks(6), [local(2014, 2, 2)]);
- }
- },
-
- "tickFormat": {
- topic: function(scale) {
- return scale().tickFormat();
- },
- "formats year on New Year's": function(format) {
- assert.equal(format(local(2011, 0, 1)), "2011");
- assert.equal(format(local(2012, 0, 1)), "2012");
- assert.equal(format(local(2013, 0, 1)), "2013");
- },
- "formats month on the 1st of each month": function(format) {
- assert.equal(format(local(2011, 1, 1)), "February");
- assert.equal(format(local(2011, 2, 1)), "March");
- assert.equal(format(local(2011, 3, 1)), "April");
- },
- "formats week on Sunday midnight": function(format) {
- assert.equal(format(local(2011, 1, 6)), "Feb 06");
- assert.equal(format(local(2011, 1, 13)), "Feb 13");
- assert.equal(format(local(2011, 1, 20)), "Feb 20");
- },
- "formats date on midnight": function(format) {
- assert.equal(format(local(2011, 1, 2)), "Wed 02");
- assert.equal(format(local(2011, 1, 3)), "Thu 03");
- assert.equal(format(local(2011, 1, 4)), "Fri 04");
- },
- "formats hour on minute zero": function(format) {
- assert.equal(format(local(2011, 1, 2, 11)), "11 AM");
- assert.equal(format(local(2011, 1, 2, 12)), "12 PM");
- assert.equal(format(local(2011, 1, 2, 13)), "01 PM");
- },
- "formats minute on second zero": function(format) {
- assert.equal(format(local(2011, 1, 2, 11, 59)), "11:59");
- assert.equal(format(local(2011, 1, 2, 12, 1)), "12:01");
- assert.equal(format(local(2011, 1, 2, 12, 2)), "12:02");
- },
- "otherwise, formats second": function(format) {
- assert.equal(format(local(2011, 1, 2, 12, 1, 9)), ":09");
- assert.equal(format(local(2011, 1, 2, 12, 1, 10)), ":10");
- assert.equal(format(local(2011, 1, 2, 12, 1, 11)), ":11");
- }
- }
- }
-});
-
-suite.addBatch({
- "scale.utc": {
- topic: load("time/scale-utc").expression("d3.time.scale.utc").document(),
-
- "nice": {
- "rounds using the specified time interval": function(scale) {
- var x = scale().domain([utc(2009, 0, 1, 0, 12), utc(2009, 0, 1, 23, 48)]);
- assert.deepEqual(x.nice(_.time.day.utc).domain(), [utc(2009, 0, 1), utc(2009, 0, 2)]);
- assert.deepEqual(x.nice(_.time.week.utc).domain(), [utc(2008, 11, 28), utc(2009, 0, 4)]);
- assert.deepEqual(x.nice(_.time.month.utc).domain(), [utc(2008, 11, 1), utc(2009, 1, 1)]);
- assert.deepEqual(x.nice(_.time.year.utc).domain(), [utc(2008, 0, 1), utc(2010, 0, 1)]);
- },
- "rounds using the specified time interval and skip": function(scale) {
- var x = scale().domain([utc(2009, 0, 1, 0, 12), utc(2009, 0, 1, 23, 48)]);
- assert.deepEqual(x.nice(_.time.day.utc, 3).domain(), [utc(2009, 0, 1), utc(2009, 0, 4)]);
- assert.deepEqual(x.nice(_.time.week.utc, 2).domain(), [utc(2008, 11, 21), utc(2009, 0, 4)]);
- assert.deepEqual(x.nice(_.time.month.utc, 3).domain(), [utc(2008, 9, 1), utc(2009, 3, 1)]);
- assert.deepEqual(x.nice(_.time.year.utc, 10).domain(), [utc(2000, 0, 1), utc(2010, 0, 1)]);
- },
- "rounds using the specified count": function(scale) {
- var x = scale().domain([utc(2009, 0, 1, 0, 17), utc(2009, 0, 1, 23, 42)]);
- assert.deepEqual(x.nice(100).domain(), [utc(2009, 0, 1, 0, 15), utc(2009, 0, 1, 23, 45)]);
- assert.deepEqual(x.nice(10).domain(), [utc(2009, 0, 1), utc(2009, 0, 2)]);
- },
- "rounds with a default count of ten if no arguments": function(scale) {
- var x = scale().domain([utc(2009, 0, 1, 0, 17), utc(2009, 0, 1, 23, 42)]);
- assert.deepEqual(x.nice().domain(), [utc(2009, 0, 1), utc(2009, 0, 2)]);
- },
- "works on degenerate domains": function(scale) {
- var x = scale().domain([utc(2009, 0, 1, 0, 12), utc(2009, 0, 1, 0, 12)]);
- assert.deepEqual(x.nice(_.time.day.utc).domain(), [utc(2009, 0, 1), utc(2009, 0, 2)]);
- },
- "nicing a polylinear domain only affects the extent": function(linear) {
- var x = linear().domain([utc(2009, 0, 1, 0, 12), utc(2009, 0, 1, 23, 48), utc(2009, 0, 2, 23, 48)]).nice(_.time.day.utc);
- assert.deepEqual(x.domain(), [utc(2009, 0, 1), utc(2009, 0, 1, 23, 48), utc(2009, 0, 3)]);
- }
- },
-
- "ticks": {
- "observes explicit tick interval": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 1, 0), utc(2011, 0, 1, 12, 4, 4)]);
- assert.deepEqual(x.ticks(_.time.minute.utc), [
- utc(2011, 0, 1, 12, 1),
- utc(2011, 0, 1, 12, 2),
- utc(2011, 0, 1, 12, 3),
- utc(2011, 0, 1, 12, 4)
- ]);
- },
- "observes explicit tick interval and step": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 0, 0), utc(2011, 0, 1, 12, 33, 4)]);
- assert.deepEqual(x.ticks(_.time.minute.utc, 10), [
- utc(2011, 0, 1, 12, 0),
- utc(2011, 0, 1, 12, 10),
- utc(2011, 0, 1, 12, 20),
- utc(2011, 0, 1, 12, 30)
- ]);
- },
- "(deprecated) observes explicit tick range": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 1, 0), utc(2011, 0, 1, 12, 4, 4)]);
- assert.deepEqual(x.ticks(_.time.minutes.utc), [
- utc(2011, 0, 1, 12, 1),
- utc(2011, 0, 1, 12, 2),
- utc(2011, 0, 1, 12, 3),
- utc(2011, 0, 1, 12, 4)
- ]);
- },
- "(deprecated) observes explicit tick range and step": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 0, 0), utc(2011, 0, 1, 12, 33, 4)]);
- assert.deepEqual(x.ticks(_.time.minutes.utc, 10), [
- utc(2011, 0, 1, 12, 0),
- utc(2011, 0, 1, 12, 10),
- utc(2011, 0, 1, 12, 20),
- utc(2011, 0, 1, 12, 30)
- ]);
- },
- "generates sub-second ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 0, 0), utc(2011, 0, 1, 12, 0, 1)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 12, 0, 0, 0),
- utc(2011, 0, 1, 12, 0, 0, 200),
- utc(2011, 0, 1, 12, 0, 0, 400),
- utc(2011, 0, 1, 12, 0, 0, 600),
- utc(2011, 0, 1, 12, 0, 0, 800),
- utc(2011, 0, 1, 12, 0, 1, 0)
- ]);
- },
- "generates 1-second ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 0, 0), utc(2011, 0, 1, 12, 0, 4)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 12, 0, 0),
- utc(2011, 0, 1, 12, 0, 1),
- utc(2011, 0, 1, 12, 0, 2),
- utc(2011, 0, 1, 12, 0, 3),
- utc(2011, 0, 1, 12, 0, 4)
- ]);
- },
- "generates 5-second ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 0, 0), utc(2011, 0, 1, 12, 0, 20)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 12, 0, 0),
- utc(2011, 0, 1, 12, 0, 5),
- utc(2011, 0, 1, 12, 0, 10),
- utc(2011, 0, 1, 12, 0, 15),
- utc(2011, 0, 1, 12, 0, 20)
- ]);
- },
- "generates 15-second ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 0, 0), utc(2011, 0, 1, 12, 0, 50)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 12, 0, 0),
- utc(2011, 0, 1, 12, 0, 15),
- utc(2011, 0, 1, 12, 0, 30),
- utc(2011, 0, 1, 12, 0, 45)
- ]);
- },
- "generates 30-second ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 0, 0), utc(2011, 0, 1, 12, 1, 50)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 12, 0, 0),
- utc(2011, 0, 1, 12, 0, 30),
- utc(2011, 0, 1, 12, 1, 0),
- utc(2011, 0, 1, 12, 1, 30)
- ]);
- },
- "generates 1-minute ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 0, 27), utc(2011, 0, 1, 12, 4, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 12, 1),
- utc(2011, 0, 1, 12, 2),
- utc(2011, 0, 1, 12, 3),
- utc(2011, 0, 1, 12, 4)
- ]);
- },
- "generates 5-minute ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 3, 27), utc(2011, 0, 1, 12, 21, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 12, 5),
- utc(2011, 0, 1, 12, 10),
- utc(2011, 0, 1, 12, 15),
- utc(2011, 0, 1, 12, 20)
- ]);
- },
- "generates 15-minute ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 8, 27), utc(2011, 0, 1, 13, 4, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 12, 15),
- utc(2011, 0, 1, 12, 30),
- utc(2011, 0, 1, 12, 45),
- utc(2011, 0, 1, 13, 0)
- ]);
- },
- "generates 30-minute ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 28, 27), utc(2011, 0, 1, 14, 4, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 12, 30),
- utc(2011, 0, 1, 13, 0),
- utc(2011, 0, 1, 13, 30),
- utc(2011, 0, 1, 14, 0)
- ]);
- },
- "generates 1-hour ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 12, 28, 27), utc(2011, 0, 1, 16, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 13, 0),
- utc(2011, 0, 1, 14, 0),
- utc(2011, 0, 1, 15, 0),
- utc(2011, 0, 1, 16, 0)
- ]);
- },
- "generates 3-hour ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 14, 28, 27), utc(2011, 0, 2, 1, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 15, 0),
- utc(2011, 0, 1, 18, 0),
- utc(2011, 0, 1, 21, 0),
- utc(2011, 0, 2, 0, 0)
- ]);
- },
- "generates 6-hour ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 16, 28, 27), utc(2011, 0, 2, 14, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 18, 0),
- utc(2011, 0, 2, 0, 0),
- utc(2011, 0, 2, 6, 0),
- utc(2011, 0, 2, 12, 0)
- ]);
- },
- "generates 12-hour ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 16, 28, 27), utc(2011, 0, 3, 21, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 2, 0, 0),
- utc(2011, 0, 2, 12, 0),
- utc(2011, 0, 3, 0, 0),
- utc(2011, 0, 3, 12, 0)
- ]);
- },
- "generates 1-day ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 16, 28, 27), utc(2011, 0, 5, 21, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 2, 0, 0),
- utc(2011, 0, 3, 0, 0),
- utc(2011, 0, 4, 0, 0),
- utc(2011, 0, 5, 0, 0)
- ]);
- },
- "generates 2-day ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 2, 16, 28, 27), utc(2011, 0, 9, 21, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 3, 0, 0),
- utc(2011, 0, 5, 0, 0),
- utc(2011, 0, 7, 0, 0),
- utc(2011, 0, 9, 0, 0)
- ]);
- },
- "generates 1-week ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 1, 16, 28, 27), utc(2011, 0, 23, 21, 34, 12)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 2, 0, 0),
- utc(2011, 0, 9, 0, 0),
- utc(2011, 0, 16, 0, 0),
- utc(2011, 0, 23, 0, 0)
- ]);
- },
- "generates 1-month ticks": function(scale) {
- var x = scale().domain([utc(2011, 0, 18), utc(2011, 4, 2)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 1, 1, 0, 0),
- utc(2011, 2, 1, 0, 0),
- utc(2011, 3, 1, 0, 0),
- utc(2011, 4, 1, 0, 0)
- ]);
- },
- "generates 3-month ticks": function(scale) {
- var x = scale().domain([utc(2010, 11, 18), utc(2011, 10, 2)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 0, 0),
- utc(2011, 3, 1, 0, 0),
- utc(2011, 6, 1, 0, 0),
- utc(2011, 9, 1, 0, 0)
- ]);
- },
- "generates 1-year ticks": function(scale) {
- var x = scale().domain([utc(2010, 11, 18), utc(2014, 2, 2)]);
- assert.deepEqual(x.ticks(4), [
- utc(2011, 0, 1, 0, 0),
- utc(2012, 0, 1, 0, 0),
- utc(2013, 0, 1, 0, 0),
- utc(2014, 0, 1, 0, 0)
- ]);
- },
- "generates multi-year ticks": function(scale) {
- var x = scale().domain([utc(0, 11, 18), utc(2014, 2, 2)]);
- assert.deepEqual(x.ticks(6), [
- utc( 500, 0, 1, 0, 0),
- utc(1000, 0, 1, 0, 0),
- utc(1500, 0, 1, 0, 0),
- utc(2000, 0, 1, 0, 0)
- ]);
- },
- "returns one tick for degenerate empty domain": function(scale) {
- var x = scale().domain([utc(2014, 2, 2), utc(2014, 2, 2)]);
- assert.deepEqual(x.ticks(6), [utc(2014, 2, 2)]);
- }
- },
-
- "tickFormat": {
- topic: function(scale) {
- return scale().tickFormat();
- },
- "formats year on New Year's": function(format) {
- assert.equal(format(utc(2011, 0, 1)), "2011");
- assert.equal(format(utc(2012, 0, 1)), "2012");
- assert.equal(format(utc(2013, 0, 1)), "2013");
- },
- "formats month on the 1st of each month": function(format) {
- assert.equal(format(utc(2011, 1, 1)), "February");
- assert.equal(format(utc(2011, 2, 1)), "March");
- assert.equal(format(utc(2011, 3, 1)), "April");
- },
- "formats week on Sunday midnight": function(format) {
- assert.equal(format(utc(2011, 1, 6)), "Feb 06");
- assert.equal(format(utc(2011, 1, 13)), "Feb 13");
- assert.equal(format(utc(2011, 1, 20)), "Feb 20");
- },
- "formats date on midnight": function(format) {
- assert.equal(format(utc(2011, 1, 2)), "Wed 02");
- assert.equal(format(utc(2011, 1, 3)), "Thu 03");
- assert.equal(format(utc(2011, 1, 4)), "Fri 04");
- },
- "formats hour on minute zero": function(format) {
- assert.equal(format(utc(2011, 1, 2, 11)), "11 AM");
- assert.equal(format(utc(2011, 1, 2, 12)), "12 PM");
- assert.equal(format(utc(2011, 1, 2, 13)), "01 PM");
- },
- "formats minute on second zero": function(format) {
- assert.equal(format(utc(2011, 1, 2, 11, 59)), "11:59");
- assert.equal(format(utc(2011, 1, 2, 12, 1)), "12:01");
- assert.equal(format(utc(2011, 1, 2, 12, 2)), "12:02");
- },
- "formats second on millisecond zero": function(format) {
- assert.equal(format(utc(2011, 1, 2, 12, 1, 9)), ":09");
- assert.equal(format(utc(2011, 1, 2, 12, 1, 10)), ":10");
- assert.equal(format(utc(2011, 1, 2, 12, 1, 11)), ":11");
- },
- "otherwise, formats milliseconds": function(format) {
- assert.equal(format(utc(2011, 1, 2, 12, 1, 0, 9)), ".009");
- assert.equal(format(utc(2011, 1, 2, 12, 1, 0, 10)), ".010");
- assert.equal(format(utc(2011, 1, 2, 12, 1, 0, 11)), ".011");
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/second-test.js b/test/time/second-test.js
deleted file mode 100644
index e740d3a29eaf67..00000000000000
--- a/test/time/second-test.js
+++ /dev/null
@@ -1,143 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.second");
-
-suite.addBatch({
- "second": {
- topic: load("time/second").expression("d3.time.second"),
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns seconds": function(floor) {
- assert.deepEqual(floor(local(2010, 11, 31, 23, 59, 59, 999)), local(2010, 11, 31, 23, 59, 59));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 00, 000)), local(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 00, 001)), local(2011, 00, 01, 00, 00, 00));
- }
- },
- "round": {
- topic: function(interval) {
- return interval.round;
- },
- "returns seconds": function(round) {
- assert.deepEqual(round(local(2010, 11, 31, 23, 59, 59, 999)), local(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(round(local(2011, 00, 01, 00, 00, 00, 499)), local(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(round(local(2011, 00, 01, 00, 00, 00, 500)), local(2011, 00, 01, 00, 00, 01));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns seconds": function(ceil) {
- assert.deepEqual(ceil(local(2010, 11, 31, 23, 59, 59, 999)), local(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 00, 000)), local(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 00, 001)), local(2011, 00, 01, 00, 00, 01));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = local(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, local(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), +1), local(2011, 00, 01, 00, 00, 00, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 456), -2), local(2010, 11, 31, 23, 59, 57, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59), -1), local(2010, 11, 31, 23, 59, 58));
- assert.deepEqual(offset(local(2011, 00, 01, 00, 00, 00), -2), local(2010, 11, 31, 23, 59, 58));
- assert.deepEqual(offset(local(2011, 00, 01, 00, 00, 00), -1), local(2010, 11, 31, 23, 59, 59));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 58), +1), local(2010, 11, 31, 23, 59, 59));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 58), +2), local(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59), +1), local(2011, 00, 01, 00, 00, 00));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), 0), local(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 58, 000), 0), local(2010, 11, 31, 23, 59, 58, 000));
- }
- },
- "UTC": {
- topic: function(interval) {
- return interval.utc;
- },
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns seconds": function(floor) {
- assert.deepEqual(floor(utc(2010, 11, 31, 23, 59, 59, 999)), utc(2010, 11, 31, 23, 59, 59));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00, 00, 000)), utc(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00, 00, 001)), utc(2011, 00, 01, 00, 00, 00));
- }
- },
- "round": {
- topic: function(interval) {
- return interval.round;
- },
- "returns seconds": function(round) {
- assert.deepEqual(round(utc(2010, 11, 31, 23, 59, 59, 999)), utc(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(round(utc(2011, 00, 01, 00, 00, 00, 499)), utc(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(round(utc(2011, 00, 01, 00, 00, 00, 500)), utc(2011, 00, 01, 00, 00, 01));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns seconds": function(ceil) {
- assert.deepEqual(ceil(utc(2010, 11, 31, 23, 59, 59, 999)), utc(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00, 00, 000)), utc(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00, 00, 001)), utc(2011, 00, 01, 00, 00, 01));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = utc(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, utc(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), +1), utc(2011, 00, 01, 00, 00, 00, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 456), -2), utc(2010, 11, 31, 23, 59, 57, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59), -1), utc(2010, 11, 31, 23, 59, 58));
- assert.deepEqual(offset(utc(2011, 00, 01, 00, 00, 00), -2), utc(2010, 11, 31, 23, 59, 58));
- assert.deepEqual(offset(utc(2011, 00, 01, 00, 00, 00), -1), utc(2010, 11, 31, 23, 59, 59));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 58), +1), utc(2010, 11, 31, 23, 59, 59));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 58), +2), utc(2011, 00, 01, 00, 00, 00));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59), +1), utc(2011, 00, 01, 00, 00, 00));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), 0), utc(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 58, 000), 0), utc(2010, 11, 31, 23, 59, 58, 000));
- }
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/seconds-test.js b/test/time/seconds-test.js
deleted file mode 100644
index e8c6ab44867de7..00000000000000
--- a/test/time/seconds-test.js
+++ /dev/null
@@ -1,91 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.seconds");
-
-suite.addBatch({
- "seconds": {
- topic: load("time/second").expression("d3.time.seconds"),
- "returns seconds": function(range) {
- assert.deepEqual(range(local(2010, 11, 31, 23, 59, 59), local(2011, 0, 1, 0, 0, 2)), [
- local(2010, 11, 31, 23, 59, 59),
- local(2011, 0, 1, 0, 0, 0),
- local(2011, 0, 1, 0, 0, 1)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(local(2010, 11, 31, 23, 59, 59), local(2011, 0, 1, 0, 0, 2))[0], local(2010, 11, 31, 23, 59, 59));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(local(2010, 11, 31, 23, 59, 59), local(2011, 0, 1, 0, 0, 2))[2], local(2011, 0, 1, 0, 0, 1));
- },
- "can skip seconds": function(range) {
- assert.deepEqual(range(local(2011, 1, 1, 12, 0, 7), local(2011, 1, 1, 12, 1, 7), 15), [
- local(2011, 1, 1, 12, 0, 15),
- local(2011, 1, 1, 12, 0, 30),
- local(2011, 1, 1, 12, 0, 45),
- local(2011, 1, 1, 12, 1, 0)
- ]);
- },
- "observes start of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 2, 13, 9, 59, 59), utc(2011, 2, 13, 10, 0, 2)), [
- utc(2011, 2, 13, 9, 59, 59),
- utc(2011, 2, 13, 10, 0, 0),
- utc(2011, 2, 13, 10, 0, 1)
- ]);
- },
- "observes end of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 10, 6, 8, 59, 59), utc(2011, 10, 6, 9, 0, 2)), [
- utc(2011, 10, 6, 8, 59, 59),
- utc(2011, 10, 6, 9, 0, 0),
- utc(2011, 10, 6, 9, 0, 1)
- ]);
- },
- "UTC": {
- topic: function(range) {
- return range.utc;
- },
- "returns seconds": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31, 23, 59, 59), utc(2011, 0, 1, 0, 0, 2)), [
- utc(2010, 11, 31, 23, 59, 59),
- utc(2011, 0, 1, 0, 0, 0),
- utc(2011, 0, 1, 0, 0, 1)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31, 23, 59, 59), utc(2011, 0, 1, 0, 0, 2))[0], utc(2010, 11, 31, 23, 59, 59));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(utc(2010, 11, 31, 23, 59, 59), utc(2011, 0, 1, 0, 0, 2))[2], utc(2011, 0, 1, 0, 0, 1));
- },
- "can skip seconds": function(range) {
- assert.deepEqual(range(utc(2011, 1, 1, 12, 0, 7), utc(2011, 1, 1, 12, 1, 7), 15), [
- utc(2011, 1, 1, 12, 0, 15),
- utc(2011, 1, 1, 12, 0, 30),
- utc(2011, 1, 1, 12, 0, 45),
- utc(2011, 1, 1, 12, 1, 0)
- ]);
- },
- "does not observe the start of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 2, 13, 9, 59, 59), utc(2011, 2, 13, 10, 0, 2)), [
- utc(2011, 2, 13, 9, 59, 59),
- utc(2011, 2, 13, 10, 0, 0),
- utc(2011, 2, 13, 10, 0, 1)
- ]);
- },
- "does not observe the end of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 10, 6, 8, 59, 59), utc(2011, 10, 6, 9, 0, 2)), [
- utc(2011, 10, 6, 8, 59, 59),
- utc(2011, 10, 6, 9, 0, 0),
- utc(2011, 10, 6, 9, 0, 1)
- ]);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/time.js b/test/time/time.js
deleted file mode 100644
index df18dd55ec01b2..00000000000000
--- a/test/time/time.js
+++ /dev/null
@@ -1,30 +0,0 @@
-var offset = 0;
-
-exports.local = function(year, month, day, hours, minutes, seconds, milliseconds) {
- var date = new Date();
- date.setFullYear(year, month, day);
- date.setHours(hours || 0, offset + (minutes || 0), seconds || 0, milliseconds || 0);
- return date;
-};
-
-exports.utc = function(year, month, day, hours, minutes, seconds, milliseconds) {
- var date = new Date();
- date.setUTCFullYear(year, month, day);
- date.setUTCHours(hours || 0, minutes || 0, seconds || 0, milliseconds || 0);
- return date;
-};
-
-exports.zone = function(tzOffset, scope) {
- return function() {
- var o = Date.prototype.getTimezoneOffset;
- try {
- // Note: assumes the dates are not in DST.
- offset = -tzOffset - new Date(0).getTimezoneOffset();
- Date.prototype.getTimezoneOffset = function() { return offset; };
- scope.apply(this, arguments);
- } finally {
- offset = 0;
- Date.prototype.getTimezoneOffset = o;
- }
- };
-};
diff --git a/test/time/week-test.js b/test/time/week-test.js
deleted file mode 100644
index f0db1f7f18d50c..00000000000000
--- a/test/time/week-test.js
+++ /dev/null
@@ -1,162 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.week");
-
-suite.addBatch({
- "week": {
- topic: load("time/week").expression("d3.time.week"),
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns sundays": function(floor) {
- assert.deepEqual(floor(local(2010, 11, 31, 23, 59, 59)), local(2010, 11, 26));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 00)), local(2010, 11, 26));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 01)), local(2010, 11, 26));
- assert.deepEqual(floor(local(2011, 00, 01, 23, 59, 59)), local(2010, 11, 26));
- assert.deepEqual(floor(local(2011, 00, 02, 00, 00, 00)), local(2011, 00, 02));
- assert.deepEqual(floor(local(2011, 00, 02, 00, 00, 01)), local(2011, 00, 02));
- },
- "observes the start of daylight savings time": function(floor) {
- assert.deepEqual(floor(local(2011, 02, 13, 01)), local(2011, 02, 13));
- },
- "observes the end of the daylight savings time": function(floor) {
- assert.deepEqual(floor(local(2011, 10, 06, 01)), local(2011, 10, 06));
- },
- "correctly handles years in the first century": function(floor) {
- assert.deepEqual(floor(local(0011, 10, 06, 07)), local(0011, 10, 01));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns sundays": function(ceil) {
- assert.deepEqual(ceil(local(2010, 11, 31, 23, 59, 59)), local(2011, 00, 02));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 00)), local(2011, 00, 02));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 01)), local(2011, 00, 02));
- assert.deepEqual(ceil(local(2011, 00, 01, 23, 59, 59)), local(2011, 00, 02));
- assert.deepEqual(ceil(local(2011, 00, 02, 00, 00, 00)), local(2011, 00, 02));
- assert.deepEqual(ceil(local(2011, 00, 02, 00, 00, 01)), local(2011, 00, 09));
- },
- "observes the start of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(local(2011, 02, 13, 01)), local(2011, 02, 20));
- },
- "observes the end of the daylight savings time": function(ceil) {
- assert.deepEqual(ceil(local(2011, 10, 06, 01)), local(2011, 10, 13));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = local(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, local(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), +1), local(2011, 00, 07, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 456), -2), local(2010, 11, 17, 23, 59, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 01), -1), local(2010, 10, 24));
- assert.deepEqual(offset(local(2011, 00, 01), -2), local(2010, 11, 18));
- assert.deepEqual(offset(local(2011, 00, 01), -1), local(2010, 11, 25));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 10, 24), +1), local(2010, 11, 01));
- assert.deepEqual(offset(local(2010, 11, 18), +2), local(2011, 00, 01));
- assert.deepEqual(offset(local(2010, 11, 25), +1), local(2011, 00, 01));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), 0), local(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 58, 000), 0), local(2010, 11, 31, 23, 59, 58, 000));
- }
- },
- "UTC": {
- topic: function(interval) {
- return interval.utc;
- },
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns sundays": function(floor) {
- assert.deepEqual(floor(utc(2010, 11, 31, 23, 59, 59)), utc(2010, 11, 26));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00, 00)), utc(2010, 11, 26));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00, 01)), utc(2010, 11, 26));
- assert.deepEqual(floor(utc(2011, 00, 01, 23, 59, 59)), utc(2010, 11, 26));
- assert.deepEqual(floor(utc(2011, 00, 02, 00, 00, 00)), utc(2011, 00, 02));
- assert.deepEqual(floor(utc(2011, 00, 02, 00, 00, 01)), utc(2011, 00, 02));
- },
- "does not observe the start of daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 02, 13, 01)), utc(2011, 02, 13));
- },
- "does not observe the end of the daylight savings time": function(floor) {
- assert.deepEqual(floor(utc(2011, 10, 06, 01)), utc(2011, 10, 06));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns sundays": function(ceil) {
- assert.deepEqual(ceil(utc(2010, 11, 31, 23, 59, 59)), utc(2011, 00, 02));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00, 00)), utc(2011, 00, 02));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00, 01)), utc(2011, 00, 02));
- assert.deepEqual(ceil(utc(2011, 00, 01, 23, 59, 59)), utc(2011, 00, 02));
- assert.deepEqual(ceil(utc(2011, 00, 02, 00, 00, 00)), utc(2011, 00, 02));
- assert.deepEqual(ceil(utc(2011, 00, 02, 00, 00, 01)), utc(2011, 00, 09));
- },
- "does not observe the start of daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 02, 13, 01)), utc(2011, 02, 20));
- },
- "does not observe the end of the daylight savings time": function(ceil) {
- assert.deepEqual(ceil(utc(2011, 10, 06, 01)), utc(2011, 10, 13));
- }
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = utc(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, utc(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), +1), utc(2011, 00, 07, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 456), -2), utc(2010, 11, 17, 23, 59, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 01), -1), utc(2010, 10, 24));
- assert.deepEqual(offset(utc(2011, 00, 01), -2), utc(2010, 11, 18));
- assert.deepEqual(offset(utc(2011, 00, 01), -1), utc(2010, 11, 25));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 10, 24), +1), utc(2010, 11, 01));
- assert.deepEqual(offset(utc(2010, 11, 18), +2), utc(2011, 00, 01));
- assert.deepEqual(offset(utc(2010, 11, 25), +1), utc(2011, 00, 01));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), 0), utc(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 58, 000), 0), utc(2010, 11, 31, 23, 59, 58, 000));
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/weeks-test.js b/test/time/weeks-test.js
deleted file mode 100644
index 7a110a8db87741..00000000000000
--- a/test/time/weeks-test.js
+++ /dev/null
@@ -1,95 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert"),
- time = require("./time"),
- local = time.local,
- utc = time.utc;
-
-var suite = vows.describe("d3.time.weeks");
-
-suite.addBatch({
- "weeks": {
- topic: load("time/week").expression("d3.time.weeks"),
- "returns sundays": function(range) {
- assert.deepEqual(range(local(2010, 11, 21), local(2011, 0, 12)), [
- local(2010, 11, 26),
- local(2011, 0, 2),
- local(2011, 0, 9)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(local(2010, 11, 21), local(2011, 0, 12))[0], local(2010, 11, 26));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(local(2010, 11, 21), local(2011, 0, 12))[2], local(2011, 0, 9));
- },
- "can skip weeks": function(range) {
- assert.deepEqual(range(local(2011, 0, 1), local(2011, 3, 1), 4), [
- local(2011, 0, 2),
- local(2011, 0, 30),
- local(2011, 1, 27),
- local(2011, 2, 27)
- ]);
- },
- "observes start of daylight savings time": function(range) {
- assert.deepEqual(range(local(2011, 2, 1), local(2011, 2, 28)), [
- local(2011, 2, 6),
- local(2011, 2, 13),
- local(2011, 2, 20),
- local(2011, 2, 27)
- ]);
- },
- "observes end of daylight savings time": function(range) {
- assert.deepEqual(range(local(2011, 10, 1), local(2011, 10, 30)), [
- local(2011, 10, 6),
- local(2011, 10, 13),
- local(2011, 10, 20),
- local(2011, 10, 27)
- ]);
- },
- "UTC": {
- topic: function(range) {
- return range.utc;
- },
- "returns sundays": function(range) {
- assert.deepEqual(range(utc(2010, 11, 21), utc(2011, 0, 12)), [
- utc(2010, 11, 26),
- utc(2011, 0, 2),
- utc(2011, 0, 9)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(utc(2010, 11, 21), utc(2011, 0, 12))[0], utc(2010, 11, 26));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(utc(2010, 11, 21), utc(2011, 0, 12))[2], utc(2011, 0, 9));
- },
- "can skip weeks": function(range) {
- assert.deepEqual(range(utc(2011, 0, 1), utc(2011, 3, 1), 4), [
- utc(2011, 0, 2),
- utc(2011, 0, 30),
- utc(2011, 1, 27),
- utc(2011, 2, 27)
- ]);
- },
- "does not observe the start of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 2, 1), utc(2011, 2, 28)), [
- utc(2011, 2, 6),
- utc(2011, 2, 13),
- utc(2011, 2, 20),
- utc(2011, 2, 27)
- ]);
- },
- "does not observe the end of daylight savings time": function(range) {
- assert.deepEqual(range(utc(2011, 10, 1), utc(2011, 10, 30)), [
- utc(2011, 10, 6),
- utc(2011, 10, 13),
- utc(2011, 10, 20),
- utc(2011, 10, 27)
- ]);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/time/year-test.js b/test/time/year-test.js
deleted file mode 100644
index 66230f60cba263..00000000000000
--- a/test/time/year-test.js
+++ /dev/null
@@ -1,137 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.time.year");
-
-suite.addBatch({
- "year": {
- topic: load("time/year").expression("d3.time.year"),
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns years": function(floor) {
- assert.deepEqual(floor(local(2010, 11, 31, 23, 59, 59)), local(2010, 00, 01));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 00)), local(2011, 00, 01));
- assert.deepEqual(floor(local(2011, 00, 01, 00, 00, 01)), local(2011, 00, 01));
- },
- "correctly handles years in the first century": function(floor) {
- assert.deepEqual(floor(local(0011, 10, 06, 07)), local(0011, 00, 01));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns years": function(ceil) {
- assert.deepEqual(ceil(local(2010, 11, 31, 23, 59, 59)), local(2011, 00, 01));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 00)), local(2011, 00, 01));
- assert.deepEqual(ceil(local(2011, 00, 01, 00, 00, 01)), local(2012, 00, 01));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = local(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, local(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), +1), local(2011, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 456), -2), local(2008, 11, 31, 23, 59, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 01), -1), local(2009, 11, 01));
- assert.deepEqual(offset(local(2011, 00, 01), -2), local(2009, 00, 01));
- assert.deepEqual(offset(local(2011, 00, 01), -1), local(2010, 00, 01));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(local(2009, 11, 01), +1), local(2010, 11, 01));
- assert.deepEqual(offset(local(2009, 00, 01), +2), local(2011, 00, 01));
- assert.deepEqual(offset(local(2010, 00, 01), +1), local(2011, 00, 01));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 59, 999), 0), local(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(local(2010, 11, 31, 23, 59, 58, 000), 0), local(2010, 11, 31, 23, 59, 58, 000));
- }
- },
- "UTC": {
- topic: function(interval) {
- return interval.utc;
- },
- "defaults to floor": function(interval) {
- assert.strictEqual(interval, interval.floor);
- },
- "floor": {
- topic: function(interval) {
- return interval.floor;
- },
- "returns years": function(floor) {
- assert.deepEqual(floor(utc(2010, 11, 31, 23, 59, 59)), utc(2010, 00, 01));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00, 00)), utc(2011, 00, 01));
- assert.deepEqual(floor(utc(2011, 00, 01, 00, 00, 01)), utc(2011, 00, 01));
- }
- },
- "ceil": {
- topic: function(interval) {
- return interval.ceil;
- },
- "returns years": function(ceil) {
- assert.deepEqual(ceil(utc(2010, 11, 31, 23, 59, 59)), utc(2011, 00, 01));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00, 00)), utc(2011, 00, 01));
- assert.deepEqual(ceil(utc(2011, 00, 01, 00, 00, 01)), utc(2012, 00, 01));
- }
- },
- "offset": {
- topic: function(interval) {
- return interval.offset;
- },
- "does not modify the passed-in date": function(offset) {
- var date = utc(2010, 11, 31, 23, 59, 59, 999);
- offset(date, +1);
- assert.deepEqual(date, utc(2010, 11, 31, 23, 59, 59, 999));
- },
- "does not round the passed-in-date": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), +1), utc(2011, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 456), -2), utc(2008, 11, 31, 23, 59, 59, 456));
- },
- "allows negative offsets": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 01), -1), utc(2009, 11, 01));
- assert.deepEqual(offset(utc(2011, 00, 01), -2), utc(2009, 00, 01));
- assert.deepEqual(offset(utc(2011, 00, 01), -1), utc(2010, 00, 01));
- },
- "allows positive offsets": function(offset) {
- assert.deepEqual(offset(utc(2009, 11, 01), +1), utc(2010, 11, 01));
- assert.deepEqual(offset(utc(2009, 00, 01), +2), utc(2011, 00, 01));
- assert.deepEqual(offset(utc(2010, 00, 01), +1), utc(2011, 00, 01));
- },
- "allows zero offset": function(offset) {
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 59, 999), 0), utc(2010, 11, 31, 23, 59, 59, 999));
- assert.deepEqual(offset(utc(2010, 11, 31, 23, 59, 58, 000), 0), utc(2010, 11, 31, 23, 59, 58, 000));
- }
- }
- }
- }
-});
-
-function local(year, month, day, hours, minutes, seconds, milliseconds) {
- var date = new Date();
- date.setFullYear(year, month, day);
- date.setHours(hours || 0, minutes || 0, seconds || 0, milliseconds || 0);
- return date;
-}
-
-function utc(year, month, day, hours, minutes, seconds, milliseconds) {
- var date = new Date();
- date.setUTCFullYear(year, month, day);
- date.setUTCHours(hours || 0, minutes || 0, seconds || 0, milliseconds || 0);
- return date;
-}
-
-suite.export(module);
diff --git a/test/time/years-test.js b/test/time/years-test.js
deleted file mode 100644
index 16f61410788bd5..00000000000000
--- a/test/time/years-test.js
+++ /dev/null
@@ -1,74 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.time.years");
-
-suite.addBatch({
- "years": {
- topic: load("time/year").expression("d3.time.years"),
- "returns years": function(range) {
- assert.deepEqual(range(local(2010, 0, 1), local(2013, 0, 1)), [
- local(2010, 0, 1),
- local(2011, 0, 1),
- local(2012, 0, 1)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(local(2010, 0, 1), local(2013, 0, 1))[0], local(2010, 0, 1));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(local(2010, 0, 1), local(2013, 0, 1))[2], local(2012, 0, 1));
- },
- "can skip years": function(range) {
- assert.deepEqual(range(local(2009, 0, 1), local(2029, 0, 1), 5), [
- local(2010, 0, 1),
- local(2015, 0, 1),
- local(2020, 0, 1),
- local(2025, 0, 1)
- ]);
- },
- "UTC": {
- topic: function(range) {
- return range.utc;
- },
- "returns years": function(range) {
- assert.deepEqual(range(utc(2010, 0, 1), utc(2013, 0, 1)), [
- utc(2010, 0, 1),
- utc(2011, 0, 1),
- utc(2012, 0, 1)
- ]);
- },
- "has an inclusive lower bound": function(range) {
- assert.deepEqual(range(utc(2010, 0, 1), utc(2013, 0, 1))[0], utc(2010, 0, 1));
- },
- "has an exclusive upper bound": function(range) {
- assert.deepEqual(range(utc(2010, 0, 1), utc(2013, 0, 1))[2], utc(2012, 0, 1));
- },
- "can skip years": function(range) {
- assert.deepEqual(range(utc(2009, 0, 1), utc(2029, 0, 1), 5), [
- utc(2010, 0, 1),
- utc(2015, 0, 1),
- utc(2020, 0, 1),
- utc(2025, 0, 1)
- ]);
- }
- }
- }
-});
-
-function local(year, month, day, hours, minutes, seconds, milliseconds) {
- var date = new Date();
- date.setFullYear(year, month, day);
- date.setHours(hours || 0, minutes || 0, seconds || 0, milliseconds || 0);
- return date;
-}
-
-function utc(year, month, day, hours, minutes, seconds, milliseconds) {
- var date = new Date();
- date.setUTCFullYear(year, month, day);
- date.setUTCHours(hours || 0, minutes || 0, seconds || 0, milliseconds || 0);
- return date;
-}
-
-suite.export(module);
diff --git a/test/transition/transition-test-attr.js b/test/transition/transition-test-attr.js
deleted file mode 100644
index 627f91792f14d1..00000000000000
--- a/test/transition/transition-test-attr.js
+++ /dev/null
@@ -1,56 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- var s = d3.select("body").append("div")
- .attr("display", "none")
- .attr("font-size", "20px")
- .attr("width", 20)
- .attr("color", "red")
- .attr("xlink:type", "simple")
- .attr("xlink:href", "http://mbostock.github.com/d3/");
-
- var t = s.transition()
- .attr("display", null)
- .attr("font-size", function() { return null; })
- .attr("display", null)
- .attr("width", 100)
- .attr("width", 200)
- .attr("color", function() { return "green"; })
- .attr("xlink:href", null)
- .attr("xlink:type", function() { return null; });
-
- return {selection: s, transition: t};
- },
- "defines the corresponding attr tween": function(result) {
- assert.typeOf(result.transition.tween("attr.width"), "function");
- assert.typeOf(result.transition.tween("attr.color"), "function");
- },
- "on end": {
- topic: function(result) {
- var cb = this.callback;
- result.transition.each("end", function() { cb(null, result); });
- },
- "the last attr operator takes precedence": function(result) {
- assert.equal(result.selection.attr("width"), "200");
- },
- "sets an attribute as a number": function(result) {
- assert.equal(result.selection.attr("width"), "200");
- },
- "sets an attribute as a function": function(result) {
- assert.equal(result.selection.attr("color"), "#008000");
- },
- "removes an attribute using a constant null": function(result) {
- assert.isNull(result.selection.attr("display"));
- },
- "removes an attribute using a function null": function(result) {
- assert.isNull(result.selection.attr("font-size"));
- },
- "removes a namespaced attribute using a constant null": function(result) {
- assert.isNull(result.selection.attr("xlink:href"));
- },
- "removes a namespaced attribute using a function null": function(result) {
- assert.isNull(result.selection.attr("xlink:type"));
- }
- }
-};
diff --git a/test/transition/transition-test-attrTween.js b/test/transition/transition-test-attrTween.js
deleted file mode 100644
index 5bd4b33e1b052e..00000000000000
--- a/test/transition/transition-test-attrTween.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var assert = require("../assert"),
- _ = require("../../");
-
-module.exports = {
- topic: function(d3) {
- var callback = this.callback,
- dd = [],
- ii = [],
- tt = [],
- vv = [];
-
- var s = d3.select("body").html("").append("div").selectAll("div")
- .data(["red", "green"])
- .enter().append("div")
- .attr("color", function(d, i) { return i ? "#008000" : "#ff0000"; });
-
- var t = s.transition()
- .attrTween("color", tween);
-
- function tween(d, i, v) {
- dd.push(d);
- ii.push(i);
- vv.push(v);
- if (tt.push(this) >= 2) callback(null, {
- selection: s,
- transition: t,
- data: dd,
- index: ii,
- value: vv,
- context: tt
- });
- return i && _.interpolateHsl(v, "blue");
- }
- },
-
- "defines the corresponding attr tween": function(result) {
- assert.typeOf(result.transition.tween("attr.color"), "function");
- },
- "invokes the tween function": function(result) {
- assert.deepEqual(result.data, ["red", "green"], "expected data, got {actual}");
- assert.deepEqual(result.index, [0, 1], "expected data, got {actual}");
- assert.deepEqual(result.value, ["#ff0000", "#008000"], "expected value, got {actual}");
- assert.domEqual(result.context[0], result.selection[0][0], "expected this, got {actual}");
- assert.domEqual(result.context[1], result.selection[0][1], "expected this, got {actual}");
- },
-
- "end": {
- topic: function(result) {
- var callback = this.callback;
- result.transition.each("end", function(d, i) { if (i >= 1) callback(null, result); });
- },
- "uses the returned interpolator": function(result) {
- assert.equal(result.selection[0][1].getAttribute("color"), "#0000ff");
- },
- "does nothing if the interpolator is falsey": function(result) {
- assert.equal(result.selection[0][0].getAttribute("color"), "#ff0000");
- }
- }
-};
diff --git a/test/transition/transition-test-call.js b/test/transition/transition-test-call.js
deleted file mode 100644
index 816d26e1604bc4..00000000000000
--- a/test/transition/transition-test-call.js
+++ /dev/null
@@ -1,30 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- return d3.select("body").append("div").transition();
- },
- "calls the function once": function(transition) {
- var count = 0;
- transition.call(function() { ++count; });
- assert.equal(count, 1);
- },
- "passes any optional arguments": function(transition) {
- var abc;
- transition.call(function(selection, a, b, c) { abc = [a, b, c]; }, "a", "b", "c");
- assert.deepEqual(abc, ["a", "b", "c"]);
- },
- "passes the transition as the first argument": function(transition) {
- var t;
- transition.call(function(x) { t = x; });
- assert.isTrue(t === transition);
- },
- "uses the transition as the context": function(transition) {
- var t;
- transition.call(function() { t = this; });
- assert.isTrue(t === transition);
- },
- "returns the current transition": function(transition) {
- assert.isTrue(transition.call(function() {}) === transition);
- }
-};
diff --git a/test/transition/transition-test-delay.js b/test/transition/transition-test-delay.js
deleted file mode 100644
index e721c3619e13e6..00000000000000
--- a/test/transition/transition-test-delay.js
+++ /dev/null
@@ -1,56 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- return d3.select("body").html("").selectAll()
- .data(["foo", "bar"])
- .enter().append("div")
- .attr("class", String);
- },
- "defaults to zero": function(selection) {
- var t = selection.transition();
- assert.strictEqual(t[0][0].__transition__[t.id].delay, 0);
- assert.strictEqual(t[0][1].__transition__[t.id].delay, 0);
- },
- "can specify delay as a number": function(selection) {
- var t = selection.transition().delay(150);
- assert.strictEqual(t[0][0].__transition__[t.id].delay, 150);
- assert.strictEqual(t[0][1].__transition__[t.id].delay, 150);
- t.delay(250);
- assert.strictEqual(t[0][0].__transition__[t.id].delay, 250);
- assert.strictEqual(t[0][1].__transition__[t.id].delay, 250);
- },
- "can specify delay as a negative number": function(selection) {
- var t = selection.transition().delay(-250);
- assert.strictEqual(t[0][0].__transition__[t.id].delay, -250);
- assert.strictEqual(t[0][1].__transition__[t.id].delay, -250);
- },
- "delay is coerced to a number": function(selection) {
- var t = selection.transition().delay("520");
- assert.strictEqual(t[0][0].__transition__[t.id].delay, 520);
- assert.strictEqual(t[0][1].__transition__[t.id].delay, 520);
- },
- "floating-point durations are not floored to integers": function(selection) {
- var t = selection.transition().delay(14.6);
- assert.strictEqual(t[0][0].__transition__[t.id].delay, 14.6);
- assert.strictEqual(t[0][1].__transition__[t.id].delay, 14.6);
- var t = selection.transition().delay("16.99");
- assert.strictEqual(t[0][0].__transition__[t.id].delay, 16.99);
- assert.strictEqual(t[0][1].__transition__[t.id].delay, 16.99);
- },
- "can specify delay as a function": function(selection) {
- var dd = [], ii = [], tt = [], t = selection.transition().delay(f);
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return i * 20; }
- assert.strictEqual(t[0][0].__transition__[t.id].delay, 0);
- assert.strictEqual(t[0][1].__transition__[t.id].delay, 20);
- assert.deepEqual(dd, ["foo", "bar"], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.domEqual(tt[0], t[0][0], "expected this, got {actual}");
- assert.domEqual(tt[1], t[0][1], "expected this, got {actual}");
- },
- "coerces delay to a number": function(selection) {
- var t = selection.transition().delay("150");
- assert.strictEqual(t[0][0].__transition__[t.id].delay, 150);
- assert.strictEqual(t[0][1].__transition__[t.id].delay, 150);
- }
-};
diff --git a/test/transition/transition-test-duration.js b/test/transition/transition-test-duration.js
deleted file mode 100644
index 34fc2dc6de85c1..00000000000000
--- a/test/transition/transition-test-duration.js
+++ /dev/null
@@ -1,62 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- return d3.select("body").html("").selectAll()
- .data(["foo", "bar"])
- .enter().append("div")
- .attr("class", String);
- },
- "defaults to 250 milliseconds": function(selection) {
- var t = selection.transition();
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 250);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 250);
- },
- "can specify duration as a number": function(selection) {
- var t = selection.transition().duration(150);
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 150);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 150);
- t.duration(50);
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 50);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 50);
- },
- "zero or negative durations are treated as 1ms": function(selection) {
- var t = selection.transition().duration(0);
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 1);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 1);
- t.duration(-10);
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 1);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 1);
- t.duration(-Infinity);
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 1);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 1);
- },
- "duration is coerced to a number": function(selection) {
- var t = selection.transition().duration("520");
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 520);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 520);
- },
- "floating-point durations are not floored to integers": function(selection) {
- var t = selection.transition().duration(14.6);
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 14.6);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 14.6);
- var t = selection.transition().duration("16.99");
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 16.99);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 16.99);
- },
- "can specify duration as a function": function(selection) {
- var dd = [], ii = [], tt = [], t = selection.transition().duration(f);
- function f(d, i) { dd.push(d); ii.push(i); tt.push(this); return i * 20 + 10; }
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 10);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 30);
- assert.deepEqual(dd, ["foo", "bar"], "expected data, got {actual}");
- assert.deepEqual(ii, [0, 1], "expected index, got {actual}");
- assert.domEqual(tt[0], t[0][0], "expected this, got {actual}");
- assert.domEqual(tt[1], t[0][1], "expected this, got {actual}");
- },
- "coerces duration to a number": function(selection) {
- var t = selection.transition().duration("150");
- assert.strictEqual(t[0][0].__transition__[t.id].duration, 150);
- assert.strictEqual(t[0][1].__transition__[t.id].duration, 150);
- }
-};
diff --git a/test/transition/transition-test-each.js b/test/transition/transition-test-each.js
deleted file mode 100644
index 0b652064b1a562..00000000000000
--- a/test/transition/transition-test-each.js
+++ /dev/null
@@ -1,171 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- "start": {
- topic: function(d3) {
- var callback = this.callback,
- div = d3.select("body").html("").selectAll().data(["foo", "bar"]).enter().append("div").attr("class", String),
- transition = div.transition().delay(350),
- then = Date.now(),
- n = 0,
- calls = [],
- context = [],
- data = [],
- index = [],
- count = [],
- delay = [];
-
- // A callback to verify that multiple callbacks are allowed.
- transition.each("start.other", function() {
- ++n;
- });
-
- // A callback which captures arguments and context.
- transition.each("start", function(d, i) {
- context.push(this);
- data.push(d);
- index.push(i);
- count.push(++n);
- delay.push(Date.now() - then);
- if (n >= 4) callback(null, {
- selection: div,
- delay: delay,
- context: context,
- data: data,
- index: index,
- count: count,
- id: transition.id
- });
- });
- },
-
- "invokes the listener after the specified delay": function(result) {
- assert.inDelta(result.delay, [350, 350], 20);
- },
- "invokes each listener exactly once, in order": function(result) {
- assert.deepEqual(result.count, [2, 4]);
- },
-
- // For the same node, listeners will be called back in order, according to
- // the implementation of d3.dispatch. However, the order of callbacks across
- // nodes is not guaranteed; currently, callbacks are in reverse order if
- // they share the same delay, because of the timer queue. I suppose it'd be
- // slightly better if the callbacks were invoked in node order (consistent
- // with selections), but since these callbacks happen asynchronously I don't
- // think the API needs to guarantee the order of callbacks.
-
- "uses the node as the context": function(result) {
- assert.domEqual(result.context[0], result.selection[0][0]);
- assert.domEqual(result.context[1], result.selection[0][1]);
- },
- "passes the data and index to the function": function(result) {
- assert.deepEqual(result.data, ["foo", "bar"], "expected data, got {actual}");
- assert.deepEqual(result.index, [0, 1], "expected index, got {actual}");
- },
-
- "sets an exclusive lock on transitioning nodes": function(result) {
- var id = result.id;
- assert.isTrue(id > 0);
- assert.equal(result.selection[0][0].__transition__.count, 1);
- assert.equal(result.selection[0][1].__transition__.count, 1);
- assert.equal(result.selection[0][0].__transition__.active, id);
- assert.equal(result.selection[0][1].__transition__.active, id);
- }
- },
-
- "end": {
- topic: function(d3) {
- var callback = this.callback,
- div = d3.select("body").html("").selectAll().data(["foo", "bar"]).enter().append("div").attr("class", String),
- transition = div.transition().duration(350),
- then = Date.now(),
- n = 0,
- calls = [],
- context = [],
- data = [],
- index = [],
- count = [],
- delay = [];
-
- // A callback to verify that multiple callbacks are allowed.
- transition.each("end.other", function() {
- ++n;
- });
-
- // A callback which captures arguments and context.
- transition.each("end", function(d, i) {
- context.push(this);
- data.push(d);
- index.push(i);
- count.push(++n);
- delay.push(Date.now() - then);
- if (n >= 4) callback(null, {
- selection: div,
- delay: delay,
- context: context,
- data: data,
- index: index,
- count: count,
- id: transition.id
- });
- });
- },
-
- "invokes the listener after the specified delay": function(result) {
- assert.inDelta(result.delay, [350, 350], 20);
- },
- "invokes each listener exactly once, in order": function(result) {
- assert.deepEqual(result.count, [2, 4]);
- },
-
- // For the same node, listeners will be called back in order, according to
- // the implementation of d3.dispatch. However, the order of callbacks across
- // nodes is not guaranteed; currently, callbacks are in reverse order if
- // they share the same delay, because of the timer queue. I suppose it'd be
- // slightly better if the callbacks were invoked in node order (consistent
- // with selections), but since these callbacks happen asynchronously I don't
- // think the API needs to guarantee the order of callbacks.
-
- "uses the node as the context": function(result) {
- assert.domEqual(result.context[0], result.selection[0][0]);
- assert.domEqual(result.context[1], result.selection[0][1]);
- },
- "passes the data and index to the function": function(result) {
- assert.deepEqual(result.data, ["foo", "bar"], "expected data, got {actual}");
- assert.deepEqual(result.index, [0, 1], "expected index, got {actual}");
- },
-
- "after the transition ends": {
- topic: function(result) {
- var callback = this.callback;
- process.nextTick(function() {
- callback(null, result);
- });
- },
- "deletes the transition lock": function(result) {
- assert.isFalse("__transition__" in result.selection[0][0]);
- assert.isFalse("__transition__" in result.selection[0][1]);
- }
- },
-
- // I'd like to test d3.timer.flush here, but unfortunately there's a bug in
- // Vows where it really doesn't like to receive multiple callbacks from
- // different tests at the same time!
-
- "sequenced": {
- topic: function(result, d3) {
- var callback = this.callback,
- node = d3.select("body").append("div").node(),
- id = result.id;
- d3.select(node).transition().delay(150).each("start", function() {
- callback(null, {id: id, node: this});
- });
- },
- "does not inherit the transition id": function(result) {
- assert.isTrue(result.id > 0);
- assert.equal(result.node.__transition__.count, 1);
- assert.isTrue(result.node.__transition__.active > result.id);
- }
- }
- }
-};
diff --git a/test/transition/transition-test-filter.js b/test/transition/transition-test-filter.js
deleted file mode 100644
index 9667d5c22a1b10..00000000000000
--- a/test/transition/transition-test-filter.js
+++ /dev/null
@@ -1,80 +0,0 @@
-var assert = require("../assert"),
- _ = require("../../");
-
-var datum = {};
-
-module.exports = {
- topic: function(d3) {
- return d3.select("body").html("").selectAll("div")
- .data([0, 1])
- .enter().append("div")
- .selectAll("span")
- .data(function(d) { d <<= 1; return [d, d + 1]; })
- .enter().append("span")
- .classed("foo", function(d, i) { return d & 1; })
- .transition()
- .delay(100)
- .duration(150)
- .ease("bounce");
- },
-
- "preserves matching elements": function(span) {
- var some = span.filter(function(d, i) { return i === 0; });
- assert.isTrue(some[0][0] === span[0][0]);
- assert.isTrue(some[1][0] === span[1][0]);
- },
- "removes non-matching elements": function(span) {
- var some = _.merge(span.filter(function(d, i) { return d & 1; }));
- assert.equal(some.indexOf(span[0][0]), -1);
- assert.equal(some.indexOf(span[1][0]), -1);
- },
- "preserves data": function(span) {
- var some = span.filter(function(d, i) { return d & 1; });
- assert.equal(some[0][0].__data__, 1);
- assert.equal(some[1][0].__data__, 3);
- },
- "preserves grouping": function(span) {
- var some = span.filter(function(d, i) { return d & 1; });
- assert.equal(some.length, 2);
- assert.equal(some[0].length, 1);
- assert.equal(some[1].length, 1);
- },
- "preserves parent node": function(span) {
- var some = span.filter(function(d, i) { return d & 1; });
- assert.isTrue(some[0].parentNode === span[0].parentNode);
- assert.isTrue(some[1].parentNode === span[1].parentNode);
- },
- "does not preserve index": function(span) {
- var indexes = [];
- span.filter(function(d, i) { return d & 1; }).each(function(d, i) { indexes.push(i); });
- assert.deepEqual(indexes, [0, 0]);
- },
- "ignores null nodes": function(span) {
- var node = span[0][1];
- span[0][1] = null;
- var some = span.filter(function(d, i) { return d & 1; });
- assert.isTrue(some[0][0] === span[0][3]);
- assert.equal(some.length, 2);
- span[0][1] = node;
- },
- "can be specified as a selector": function(span) {
- var some = span.filter(".foo");
- assert.equal(some.length, 2);
- assert.equal(some[0].length, 1);
- assert.equal(some[1].length, 1);
- },
- "returns a new selection": function(span) {
- assert.isFalse(span.filter(function() { return 1; }) === span);
- },
- "works on empty selections": function(span) {
- var none = function() { return false; },
- empty = span.filter(none);
- assert.isTrue(empty.empty());
- assert.isTrue(empty.filter(none).empty());
- },
- "inherits the transition id and, by extension, all transition parameters": function(t1) {
- var t2 = t1.filter(function() { return 1; });
- assert.equal(t2.id, t1.id);
- assert.strictEqual(t2[0][0].__transition__[t2.id], t1[0][0].__transition__[t1.id]);
- }
-};
diff --git a/test/transition/transition-test-id.js b/test/transition/transition-test-id.js
deleted file mode 100644
index 858a230f31ee84..00000000000000
--- a/test/transition/transition-test-id.js
+++ /dev/null
@@ -1,22 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- return d3; // bug in vows where topic is not propagated automatically
- },
- "on a new transition": {
- topic: function(d3) {
- return d3.select("body").append("div").transition();
- },
- "has a positive integer id": function(transition) {
- var id = transition.id;
- assert.isTrue(id > 0);
- assert.equal(~~id, id);
- }
- },
- "increases monotonically across transitions": function(d3) {
- var t0 = d3.select("body").append("div").transition(),
- t1 = d3.select("body").append("div").transition();
- assert.isTrue(t1.id > t0.id);
- }
-};
diff --git a/test/transition/transition-test-node.js b/test/transition/transition-test-node.js
deleted file mode 100644
index 54d13d940af003..00000000000000
--- a/test/transition/transition-test-node.js
+++ /dev/null
@@ -1,39 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- "with a single element selected": {
- topic: function(d3) {
- return d3.select("body").transition();
- },
- "returns null for empty subselections": function(body) {
- assert.isNull(body.select("foo").node());
- },
- "returns the selected element": function(body) {
- assert.equal(body.node().tagName, "BODY");
- },
- "returns null if no elements are slected": function(body) {
- body[0][0] = null;
- assert.isNull(body.node());
- }
- },
- "with multiple elements selected": {
- topic: function(d3) {
- var body = d3.select("body").html(null);
- body.append("div").attr("class", "first").append("span");
- body.append("div").attr("class", "second");
- return body.selectAll("div").transition();
- },
- "returns null for empty subselections": function(div) {
- assert.isNull(div.select("foo").node());
- },
- "returns the first selected element": function(div) {
- assert.equal(div.node().className, "first");
- assert.equal(div.node().tagName, "DIV");
- },
- "does not count null nodes": function(div) {
- div[0][0] = null;
- assert.equal(div.node().className, "second");
- assert.equal(div.node().tagName, "DIV");
- }
- }
-};
diff --git a/test/transition/transition-test-remove.js b/test/transition/transition-test-remove.js
deleted file mode 100644
index fcf98c53b7fb4e..00000000000000
--- a/test/transition/transition-test-remove.js
+++ /dev/null
@@ -1,57 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- "on a new transition": {
- topic: function(d3) {
- var callback = this.callback,
- t = d3.select("body").append("div").transition().remove();
- t.each("end", function() {
- process.nextTick(function() {
- callback(null, t);
- });
- });
- },
- "removes the selected elements": function(transition) {
- assert.domEqual(transition[0][0].parentNode, null);
- }
- },
-
- "when the element is already removed": {
- topic: function(d3) {
- var callback = this.callback,
- t = d3.select("body").append("div").remove().transition().remove();
- t.each("end", function() {
- process.nextTick(function() {
- callback(null, t);
- });
- });
- },
- "does nothing": function(transition) {
- assert.domEqual(transition[0][0].parentNode, null);
- }
- },
-
- // Since these tests are triggered inside the end event of the above topic,
- // transitions will inherit ids from the original transition. But we want to
- // test concurrent transitions, so we use timeouts to avoid inheritance. This
- // test also verifies that if multiple transitions are created at the same
- // time, the last transition becomes the owner.
-
- "when another transition is scheduled": {
- topic: function(d3) {
- var callback = this.callback,
- s = d3.select("body").append("div");
- setTimeout(function() {
- s.transition().duration(150).remove().each("end", function() {
- process.nextTick(function() {
- callback(null, s);
- });
- });
- s.transition().delay(250);
- }, 10);
- },
- "does nothing": function(selection) {
- assert.equal(selection[0][0].parentNode.tagName, "BODY");
- }
- }
-};
diff --git a/test/transition/transition-test-select.js b/test/transition/transition-test-select.js
deleted file mode 100644
index cf8b148ca5a310..00000000000000
--- a/test/transition/transition-test-select.js
+++ /dev/null
@@ -1,60 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- var s = d3.select("body").append("div").selectAll("div")
- .data(["one", "two", "three", "four"])
- .enter().append("div")
- .attr("class", String);
-
- s.filter(function(d, i) { return i > 0; }).append("span");
- s[0][3] = null;
-
- return s.transition()
- .delay(function(d, i) { return i * 13; })
- .duration(function(d, i) { return i * 21; });
- },
-
- "selects the first matching element": function(transition) {
- var t = transition.select("span");
- assert.domEqual(t[0][1].parentNode, transition[0][1]);
- assert.domEqual(t[0][2].parentNode, transition[0][2]);
- },
- "ignores null elements": function(transition) {
- var t = transition.select("span");
- assert.isNull(t[0][3]);
- },
- "propagates data to the selected elements": function(transition) {
- var t = transition.select("span");
- assert.equal(t[0][1].__data__, "two");
- assert.equal(t[0][2].__data__, "three");
- },
- "propagates delay to the selected elements": function(transition) {
- var t = transition.select("span");
- assert.equal(t[0][1].__transition__[t.id].delay, 13);
- assert.equal(t[0][2].__transition__[t.id].delay, 26);
- },
- "propagates duration to the selected elements": function(transition) {
- var t = transition.select("span");
- assert.equal(t[0][1].__transition__[t.id].duration, 21);
- assert.equal(t[0][2].__transition__[t.id].duration, 42);
- },
- "does not propagate data if no data was specified": function(transition) {
- delete transition[0][1].__data__;
- delete transition[0][1].firstChild.__data__;
- var t = transition.select("span");
- assert.isUndefined(t[0][1].__data__);
- assert.equal(t[0][2].__data__, "three");
- },
- "returns null if no match is found": function(transition) {
- var t = transition.select("span");
- assert.isNull(t[0][0]);
- },
- "inherits transition id": function(transition) {
- var id = transition.id,
- t0 = transition.select("span"),
- t1 = transition.select("span");
- assert.equal(t0.id, id);
- assert.equal(t1.id, id);
- }
-};
diff --git a/test/transition/transition-test-selectAll.js b/test/transition/transition-test-selectAll.js
deleted file mode 100644
index 2450c565a09017..00000000000000
--- a/test/transition/transition-test-selectAll.js
+++ /dev/null
@@ -1,56 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- var s = d3.select("body").append("div").selectAll("div")
- .data(["one", "two", "three", "four"])
- .enter().append("div")
- .attr("class", String);
-
- s.filter(function(d, i) { return i > 0; }).append("span");
- s.filter(function(d, i) { return i > 1; }).append("span");
- s[0][3] = null;
-
- return s.transition()
- .delay(function(d, i) { return i * 13; })
- .duration(function(d, i) { return i * 21; });
- },
-
- "selects all matching elements": function(transition) {
- var t = transition.selectAll("span");
- assert.domEqual(t[1][0].parentNode, transition[0][1]);
- assert.domEqual(t[2][0].parentNode, transition[0][2]);
- assert.domEqual(t[2][1].parentNode, transition[0][2]);
- },
- "ignores null elements": function(transition) {
- var t = transition.selectAll("span");
- assert.equal(t.length, 3);
- },
- "propagates delay to the selected elements": function(transition) {
- var t = transition.selectAll("span");
- assert.domEqual(t[1][0].__transition__[t.id].delay, 13);
- assert.domEqual(t[2][0].__transition__[t.id].delay, 26);
- assert.domEqual(t[2][1].__transition__[t.id].delay, 26);
- },
- "propagates duration to the selected elements": function(transition) {
- var t = transition.selectAll("span");
- assert.domEqual(t[1][0].__transition__[t.id].duration, 21);
- assert.domEqual(t[2][0].__transition__[t.id].duration, 42);
- assert.domEqual(t[2][1].__transition__[t.id].duration, 42);
- },
- "returns empty if no match is found": function(transition) {
- var t = transition.selectAll("span");
- assert.isEmpty(t[0]);
- },
- "inherits transition id": function(transition) {
- var id = transition.id,
- t0 = transition.selectAll("span"),
- t1 = transition.selectAll("span");
- assert.equal(t0.id, id);
- assert.equal(t1.id, id);
- },
- "groups are arrays, not instances of NodeList": function(transition) {
- var t = transition.selectAll(function() { return this.getElementsByClassName("span"); });
- assert.isTrue(Array.isArray(t[0]));
- }
-};
diff --git a/test/transition/transition-test-size.js b/test/transition/transition-test-size.js
deleted file mode 100644
index 60f6615f7ffff0..00000000000000
--- a/test/transition/transition-test-size.js
+++ /dev/null
@@ -1,37 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- "with a single element selected": {
- topic: function(d3) {
- return d3.select("body").transition();
- },
- "returns zero for empty subselections": function(body) {
- assert.equal(body.select("foo").size(), 0);
- },
- "returns one for a singleton selection": function(body) {
- assert.equal(body.size(), 1);
- },
- "does not count null nodes": function(body) {
- body[0][0] = null;
- assert.equal(body.size(), 0);
- }
- },
- "with multiple elements selected": {
- topic: function(d3) {
- var body = d3.select("body").html(null);
- body.append("div").append("span");
- body.append("div");
- return body.selectAll("div").transition();
- },
- "returns null for empty selections": function(div) {
- assert.equal(div.select("foo").size(), 0);
- },
- "returns the number of non-null nodes": function(div) {
- assert.equal(div.size(), 2);
- },
- "does not count null nodes": function(div) {
- div[0][0] = null;
- assert.equal(div.size(), 1);
- }
- }
-};
diff --git a/test/transition/transition-test-style.js b/test/transition/transition-test-style.js
deleted file mode 100644
index 9380764dd55280..00000000000000
--- a/test/transition/transition-test-style.js
+++ /dev/null
@@ -1,51 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- var s = d3.select("body").append("div")
- .style("background-color", "white")
- .style("color", "red")
- .style("display", "none")
- .style("font-size", "20px");
-
- var t = s.transition()
- .style("display", null)
- .style("font-size", function() { return null; })
- .style("display", null)
- .style("background-color", "green")
- .style("background-color", "red")
- .style("color", function() { return "green"; }, "important");
-
- return {selection: s, transition: t};
- },
- "defines the corresponding style tween": function(result) {
- assert.typeOf(result.transition.tween("style.background-color"), "function");
- assert.typeOf(result.transition.tween("style.color"), "function");
- },
- "on end": {
- topic: function(result) {
- var cb = this.callback;
- result.transition.each("end", function() { cb(null, result); });
- },
- "the last style operator takes precedence": function(result) {
- assert.equal(result.selection.style("background-color"), "#ff0000");
- },
- "sets a property as a string": function(result) {
- assert.equal(result.selection.style("background-color"), "#ff0000");
- },
- "sets a property as a function": function(result) {
- assert.equal(result.selection.style("color"), "#008000");
- },
- "observes the specified priority": function(result) {
- var style = result.selection.node().style;
- assert.equal(style.getPropertyPriority("background-color"), "");
- assert.equal(style.getPropertyPriority("color"), "important");
- },
- "removes a property using a constant null": function(result) {
- assert.equal(result.selection.style("display"), "");
- },
- "removes a property using a function null": function(result) {
- assert.equal(result.selection.style("font-size"), "");
- }
- }
-};
diff --git a/test/transition/transition-test-styleTween.js b/test/transition/transition-test-styleTween.js
deleted file mode 100644
index 361857803dad8e..00000000000000
--- a/test/transition/transition-test-styleTween.js
+++ /dev/null
@@ -1,65 +0,0 @@
-var assert = require("../assert"),
- _ = require("../../");
-
-module.exports = {
- topic: function(d3) {
- var cb = this.callback,
- dd = [],
- ii = [],
- tt = [],
- vv = [],
- fails = 0;
-
- var s = d3.select("body").html("").append("div").selectAll("div")
- .data(["red", "green"])
- .enter().append("div")
- .style("background-color", function(d) { return d3.rgb(d)+""; });
-
- var t = s.transition()
- .styleTween("background-color", function() { ++fails; })
- .styleTween("background-color", tween);
-
- function tween(d, i, v) {
- dd.push(d);
- ii.push(i);
- vv.push(v);
- if (tt.push(this) >= 2) cb(null, {
- selection: s,
- transition: t,
- data: dd,
- index: ii,
- value: vv,
- context: tt,
- fails: fails
- });
- return i && _.interpolateHsl(v, "blue");
- }
- },
-
- "defines the corresponding style tween": function(result) {
- assert.typeOf(result.transition.tween("style.background-color"), "function");
- },
- "the last style tween takes precedence": function(result) {
- assert.equal(result.fails, 0);
- },
- "invokes the tween function": function(result) {
- assert.deepEqual(result.data, ["red", "green"], "expected data, got {actual}");
- assert.deepEqual(result.index, [0, 1], "expected index, got {actual}");
- assert.deepEqual(result.value, ["#ff0000", "#008000"], "expected value, got {actual}");
- assert.domEqual(result.context[0], result.selection[0][0], "expected this, got {actual}");
- assert.domEqual(result.context[1], result.selection[0][1], "expected this, got {actual}");
- },
-
- "end": {
- topic: function(result) {
- var cb = this.callback;
- result.transition.each("end", function(d, i) { if (i >= 1) cb(null, result); });
- },
- "uses the returned interpolator": function(result) {
- assert.equal(result.selection[0][1].style.getPropertyValue("background-color"), "#0000ff");
- },
- "does nothing if the interpolator is falsey": function(result) {
- assert.equal(result.selection[0][0].style.getPropertyValue("background-color"), "#ff0000");
- }
- }
-};
diff --git a/test/transition/transition-test-text.js b/test/transition/transition-test-text.js
deleted file mode 100644
index b755bf64a7e98d..00000000000000
--- a/test/transition/transition-test-text.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- return d3.select("body").append("div").text("foo").transition().text("bar");
- },
- "sets the text tween": function(div) {
- assert.typeOf(div.tween("text"), "function");
- },
- "start": {
- topic: function(div) {
- var cb = this.callback,
- tween = div.tween("text");
- div.tween("text", function() {
- var result = tween.apply(this, arguments);
- cb(null, {transition: div, tween: result});
- return result;
- });
- },
- "sets the text content as a string": function(result) {
- assert.equal(result.transition[0][0].textContent, "bar");
- },
- "does not interpolate text": function(result) {
- assert.isTrue(!result.tween);
- }
- }
-};
diff --git a/test/transition/transition-test-time.js b/test/transition/transition-test-time.js
deleted file mode 100644
index f982a807ab50a7..00000000000000
--- a/test/transition/transition-test-time.js
+++ /dev/null
@@ -1,38 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- return d3; // bug in vows where topic is not propagated automatically
- },
- "on a new transition": {
- topic: function(d3) {
- return d3.select("body").append("div").transition();
- },
- "is approximately equal to now": function(transition) {
- var time = transition[0][0].__transition__[transition.id].time;
- assert.inDelta(time, Date.now(), 20);
- }
- },
- "increases monotonically across transitions": function(d3) {
- var now = Date.now, then = Date.now();
- try {
- Date.now = function() { return ++then; };
- var t0 = d3.select("body").append("div").transition(),
- t1 = d3.select("body").append("div").transition();
- assert.isTrue(t1[0][0].__transition__[t1.id].time > t0[0][0].__transition__[t0.id].time);
- } finally {
- Date.now = now;
- }
- },
- "is inherited by subtransitions": function(d3) {
- var now = Date.now, then = Date.now();
- try {
- Date.now = function() { return ++then; };
- var t0 = d3.select("body").append("div").transition(),
- t1 = t0.transition();
- assert.equal(t1[0][0].__transition__[t1.id].time, t0[0][0].__transition__[t0.id].time);
- } finally {
- Date.now = now;
- }
- }
-};
diff --git a/test/transition/transition-test-transition.js b/test/transition/transition-test-transition.js
deleted file mode 100644
index c2109e7656c751..00000000000000
--- a/test/transition/transition-test-transition.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- return d3.select("body").append("div").transition()
- .delay(101)
- .duration(152)
- .ease("bounce");
- },
-
- "starts immediately after the previous transition ends": function(t1) {
- var t2 = t1.transition();
- assert.equal(t2[0][0].__transition__[t2.id].delay, 253);
- },
- "inherits the previous transition's duration": function(t1) {
- var t2 = t1.transition();
- assert.equal(t2[0][0].__transition__[t2.id].duration, 152);
- },
- "inherits easing": function(t1) {
- // TODO how to test this?
- },
- "gets a new transition id": function(t1) {
- var t2 = t1.transition();
- assert.isTrue(t2.id > t1.id);
- },
-
- "while transitioning": {
- topic: function(t1) {
- var callback = this.callback;
- var t2 = t1.transition().tween("custom", function() {
- return function(t) {
- if (callback) {
- callback(null, t2);
- callback = null;
- }
- };
- });
- },
- "increments the lock's reference count": function(t2) {
- assert.isTrue(t2[0][0].__transition__.count > 1);
- }
- },
-
- "after transitioning": {
- topic: function(t1) {
- var cb = this.callback;
- var t2 = t1.transition();
- t2.each("end", function() {
- setTimeout(function() {
- cb(null, t2);
- return true;
- }, 50);
- });
- },
- "decrements the lock's reference count": function(t2) {
- assert.isFalse("__transition__" in t2[0][0]);
- }
- }
-};
diff --git a/test/transition/transition-test-tween.js b/test/transition/transition-test-tween.js
deleted file mode 100644
index f21a8a73f00b1d..00000000000000
--- a/test/transition/transition-test-tween.js
+++ /dev/null
@@ -1,62 +0,0 @@
-var assert = require("../assert");
-
-module.exports = {
- topic: function(d3) {
- var cb = this.callback,
- dd = [],
- ii = [],
- tt = [],
- fails = 0;
-
- var s = d3.select("body").append("div").selectAll("div")
- .data(["red", "green"])
- .enter().append("div")
- .text(function(d) { return d3.rgb(d)+""; });
-
- var t = s.transition()
- .tween("text", function() { ++fails; })
- .tween("text", tween);
-
- function tween(d, i) {
- dd.push(d);
- ii.push(i);
- if (tt.push(this) >= 2) cb(null, {
- selection: s,
- transition: t,
- data: dd,
- index: ii,
- context: tt,
- fails: fails
- });
- return i && function(t) {
- this.textContent = d3.hsl(230, 0.5, t) + "";
- };
- }
- },
-
- "defines the corresponding tween": function(result) {
- assert.typeOf(result.transition.tween("text"), "function");
- },
- "the last tween takes precedence": function(result) {
- assert.equal(result.fails, 0);
- },
- "invokes the tween function": function(result) {
- assert.deepEqual(result.data, ["red", "green"], "expected data, got {actual}");
- assert.deepEqual(result.index, [0, 1], "expected data, got {actual}");
- assert.domEqual(result.context[0], result.selection[0][0], "expected this, got {actual}");
- assert.domEqual(result.context[1], result.selection[0][1], "expected this, got {actual}");
- },
-
- "end": {
- topic: function(result) {
- var cb = this.callback;
- result.transition.each("end", function(d, i) { if (i >= 1) cb(null, result); });
- },
- "uses the returned tweener": function(result) {
- assert.equal(result.selection[0][1].textContent, "#ffffff");
- },
- "does nothing if the tweener is falsey": function(result) {
- assert.equal(result.selection[0][0].textContent, "#ff0000");
- }
- }
-};
diff --git a/test/transition/transition-test.js b/test/transition/transition-test.js
deleted file mode 100644
index e4c41d2fd3cad8..00000000000000
--- a/test/transition/transition-test.js
+++ /dev/null
@@ -1,89 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.transition");
-
-suite.addBatch({
- "transition": {
- topic: load("transition/transition").document(),
- "selects the document element": function(d3) {
- var transition = d3.transition();
- assert.equal(transition.length, 1);
- assert.equal(transition[0].length, 1);
- assert.equal(transition[0][0].nodeType, 1);
- assert.equal(transition[0][0].tagName, "HTML");
- },
- "is an instanceof d3.transition": function(d3) {
- assert.isTrue(d3.transition() instanceof d3.transition);
- },
- "subselections are also instanceof d3.transition": function(d3) {
- var transition = d3.transition();
- assert.isTrue(transition.select("body") instanceof d3.transition);
- assert.isTrue(transition.selectAll("body") instanceof d3.transition);
- },
- "transition prototype can be extended": function(d3) {
- var transition = d3.transition(), vv = [];
- d3.transition.prototype.foo = function(v) { vv.push(v); return this; };
- transition.select("body").foo(42);
- assert.deepEqual(vv, [42]);
- delete d3.transition.prototype.foo;
- }
- }
-});
-
-// Subtransitions
-suite.addBatch({
- "transition": {
- topic: load("transition/transition").document(),
- "select": require("./transition-test-select"),
- "selectAll": require("./transition-test-selectAll"),
- "transition": require("./transition-test-transition"),
- "filter": require("./transition-test-filter")
- }
-});
-
-// Content
-suite.addBatch({
- "transition": {
- topic: load("transition/transition").document(),
- "attr": require("./transition-test-attr"),
- "attrTween": require("./transition-test-attrTween"),
- "style": require("./transition-test-style"),
- "styleTween": require("./transition-test-styleTween"),
- "text": require("./transition-test-text"),
- "remove": require("./transition-test-remove")
- }
-});
-
-// Animation
-suite.addBatch({
- "transition": {
- topic: load("transition/transition").document(),
- "delay": require("./transition-test-delay"),
- "duration": require("./transition-test-duration")
- }
-});
-
-// Control
-suite.addBatch({
- "transition": {
- topic: load("transition/transition").document(),
- "each": require("./transition-test-each"),
- "call": require("./transition-test-call"),
- "tween": require("./transition-test-tween"),
- "id": require("./transition-test-id"),
- "time": require("./transition-test-time")
- }
-});
-
-// Inspection
-suite.addBatch({
- "transition": {
- topic: load("transition/transition").document(),
- "size": require("./transition-test-size"),
- "node": require("./transition-test-node")
- }
-})
-
-suite.export(module);
diff --git a/test/xhr/html-test.js b/test/xhr/html-test.js
deleted file mode 100644
index aaf2f3a6dfcfd6..00000000000000
--- a/test/xhr/html-test.js
+++ /dev/null
@@ -1,37 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.html");
-
-suite.addBatch({
- "html": {
- topic: load("xhr/html").expression("d3.html").document(),
-
- "on a sample file": {
- topic: function(html) {
- html("test/data/sample.html", this.callback);
- },
- "invokes the callback with the loaded html": function(document) {
- assert.equal(document.getElementsByTagName("H1")[0].textContent, "Hello & world!");
- },
- "override the mime type to text/html": function(document) {
- assert.equal(XMLHttpRequest._last._info.mimeType, "text/html");
- }
- },
-
- "on a file that does not exist": {
- topic: function(html) {
- var callback = this.callback;
- html("//does/not/exist.html", function(error, document) {
- callback(null, document);
- });
- },
- "invokes the callback with undefined when an error occurs": function(document) {
- assert.isUndefined(document);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/xhr/json-test.js b/test/xhr/json-test.js
deleted file mode 100644
index d6ba7797eb3616..00000000000000
--- a/test/xhr/json-test.js
+++ /dev/null
@@ -1,51 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.json");
-
-suite.addBatch({
- "json": {
- topic: load("xhr/json").expression("d3.json").document(),
-
- "on a sample file": {
- topic: function(json) {
- json("test/data/sample.json", this.callback);
- },
- "invokes the callback with the loaded JSON": function(json) {
- assert.deepEqual(json, [{"Hello":42,"World":"\"fish\""}]);
- },
- "overrides the mime type to application/json": function(json) {
- assert.equal(XMLHttpRequest._last._info.mimeType, "application/json");
- }
- },
-
- "on a file that does not exist": {
- topic: function(json) {
- var callback = this.callback;
- json("//does/not/exist.json", function(error, json) {
- callback(null, {error: error, value: json});
- });
- },
- "invokes the callback with undefined when an error occurs": function(result) {
- assert.equal(result.error.status, 404);
- assert.isUndefined(result.value);
- }
- },
-
- "on a file with invalid JSON": {
- topic: function(json) {
- var callback = this.callback;
- json("test/data/sample.tsv", function(error, json) {
- callback(null, {error: error, value: json});
- });
- },
- "invokes the callback with undefined when an error occurs": function(result) {
- assert.equal(result.error.constructor.name, "SyntaxError");
- assert.isUndefined(result.value);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/xhr/text-test.js b/test/xhr/text-test.js
deleted file mode 100644
index dbe123d5fdfa39..00000000000000
--- a/test/xhr/text-test.js
+++ /dev/null
@@ -1,46 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.text");
-
-suite.addBatch({
- "text": {
- topic: load("xhr/text").expression("d3.text").document(),
-
- "on a sample file": {
- topic: function(text) {
- text("test/data/sample.txt", this.callback);
- },
- "invokes the callback with the loaded text": function(text) {
- assert.equal(text, "Hello, world!\n");
- },
- "does not override the mime type by default": function(text) {
- assert.isUndefined(XMLHttpRequest._last._info.mimeType);
- }
- },
-
- "with a custom mime type": {
- topic: function(text) {
- text("test/data/sample.txt", "text/plain+sample", this.callback);
- },
- "observes the optional mime type": function(text) {
- assert.equal(XMLHttpRequest._last._info.mimeType, "text/plain+sample");
- }
- },
-
- "on a file that does not exist": {
- topic: function(text) {
- var callback = this.callback;
- text("//does/not/exist.txt", function(error, text) {
- callback(null, text);
- });
- },
- "invokes the callback with undefined when an error occurs": function(text) {
- assert.isUndefined(text);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/xhr/xhr-test.js b/test/xhr/xhr-test.js
deleted file mode 100644
index b24722e1e534f6..00000000000000
--- a/test/xhr/xhr-test.js
+++ /dev/null
@@ -1,79 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.xhr");
-
-suite.addBatch({
- "xhr": {
- topic: load("xhr/xhr").document(),
-
- "on a sample text file": {
- topic: function(d3) {
- d3.xhr("test/data/sample.txt", this.callback);
- },
- "makes an asynchronous HTTP request": function(req) {
- assert.equal(req._info.url, "test/data/sample.txt");
- assert.isTrue(req._info.async);
- },
- "invokes the callback with the request object": function(req) {
- assert.equal(req.responseText, "Hello, world!\n");
- },
- "does not override the mime type by default": function(req) {
- assert.isUndefined(req._info.mimeType);
- },
- "waits until the request is done": function(req) {
- assert.equal(req.readyState, 4);
- assert.equal(req.status, 200);
- }
- },
-
- "when a custom mime type is specified": {
- topic: function(d3) {
- d3.xhr("test/data/sample.txt", "text/plain", this.callback);
- },
- "observes the optional mime type": function(req) {
- assert.equal(req._info.mimeType, "text/plain");
- }
- },
-
- "when a beforesend listener is specified": {
- topic: function(d3) {
- var callback = this.callback;
- var xhr = d3.xhr("test/data/sample.txt", "text/plain").on("beforesend", function(request) {
- callback(null, {
- that: this,
- xhr: xhr,
- readyState: request.readyState,
- request: request
- });
- });
- xhr.get();
- },
- "invokes the beforesend listener with the xhr object as the context": function(result) {
- assert.equal(result.that, result.xhr);
- assert.ok(result.xhr.get);
- },
- "invokes the beforesend listener with the underlying XMLHttpRequest as an argument": function(result) {
- assert.instanceOf(result.request, XMLHttpRequest);
- },
- "invokes the beforesend listener after open and before send": function(result) {
- assert.equal(result.readyState, 1);
- }
- },
-
- "on a file that does not exist": {
- topic: function(d3) {
- var callback = this.callback;
- d3.xhr("//does/not/exist.txt", function(error, req) {
- callback(null, req);
- });
- },
- "invokes the callback with undefined when an error occurs": function(req) {
- assert.isUndefined(req);
- }
- }
- }
-});
-
-suite.export(module);
diff --git a/test/xhr/xml-test.js b/test/xhr/xml-test.js
deleted file mode 100644
index 2b118f190448a8..00000000000000
--- a/test/xhr/xml-test.js
+++ /dev/null
@@ -1,46 +0,0 @@
-var vows = require("vows"),
- load = require("../load"),
- assert = require("../assert");
-
-var suite = vows.describe("d3.xml");
-
-suite.addBatch({
- "xml": {
- topic: load("xhr/xml").expression("d3.xml").document(),
-
- "on a sample file": {
- topic: function(xml) {
- xml("test/data/sample.xml", this.callback);
- },
- "invokes the callback with the loaded xml": function(xml) {
- assert.deepEqual(xml, {_xml: "\n