Skip to content

Commit

Permalink
Update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jan 7, 2016
1 parent 2bd8146 commit a830459
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ If you use NPM, `npm install d3-scale`. Otherwise, download the [latest release]
<script src="https://d3js.org/d3-array.v0.7.min.js"></script>
<script src="https://d3js.org/d3-collection.v0.1.min.js"></script>
<script src="https://d3js.org/d3-color.v0.3.min.js"></script>
<script src="https://d3js.org/d3-format.v0.4.min.js"></script>
<script src="https://d3js.org/d3-format.v0.5.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v0.4.min.js"></script>
<script src="https://d3js.org/d3-time.v0.1.min.js"></script>
<script src="https://d3js.org/d3-time-format.v0.2.min.js"></script>
<script src="https://d3js.org/d3-scale.v0.4.min.js"></script>
<script src="https://d3js.org/d3-time.v0.2.min.js"></script>
<script src="https://d3js.org/d3-time-format.v0.3.min.js"></script>
<script src="https://d3js.org/d3-scale.v0.5.min.js"></script>
```

(If you’re not using [time scales](#time), you can omit d3-time and d3-time-format.) In a vanilla environment, a `d3_scale` global is exported. [Try d3-scale in your browser.](https://tonicdev.com/npm/d3-scale)
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d3-scale",
"version": "0.4.1",
"version": "0.5.0",
"description": "Encodings that map abstract data to visual representation.",
"keywords": [
"d3",
Expand All @@ -27,11 +27,11 @@
"dependencies": {
"d3-array": "~0.7.0",
"d3-collection": "~0.1.0",
"d3-color": "~0.3.2",
"d3-format": "~0.4.1",
"d3-color": "~0.3.3",
"d3-format": "~0.5.0",
"d3-interpolate": "~0.4.0",
"d3-time": "~0.1.1",
"d3-time-format": "~0.2.1"
"d3-time": "~0.2.0",
"d3-time-format": "~0.3.0"
},
"devDependencies": {
"faucet": "0.0",
Expand Down
6 changes: 3 additions & 3 deletions src/time.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {bisector, tickStep} from "d3-array";
import {interpolateNumber as reinterpolate} from "d3-interpolate";
import {year, month, week, day, hour, minute, second, millisecond} from "d3-time";
import {format} from "d3-time-format";
import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond} from "d3-time";
import {timeFormat} from "d3-time-format";
import nice from "./nice";
import {default as continuous, copy, deinterpolateLinear as deinterpolate} from "./continuous";

Expand Down Expand Up @@ -127,5 +127,5 @@ export function calendar(year, month, week, day, hour, minute, second, milliseco
};

export default function() {
return calendar(year, month, week, day, hour, minute, second, millisecond, format).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);
return calendar(timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);
};
24 changes: 12 additions & 12 deletions test/time-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,31 @@ tape("time.nice(count) nices using the specified tick count", function(test) {

tape("time.nice(interval) nices using the specified time interval", function(test) {
var x = scale.time().domain([date.local(2009, 0, 1, 0, 12), date.local(2009, 0, 1, 23, 48)]);
test.deepEqual(x.nice(time.day).domain(), [date.local(2009, 0, 1), date.local(2009, 0, 2)]);
test.deepEqual(x.nice(time.week).domain(), [date.local(2008, 11, 28), date.local(2009, 0, 4)]);
test.deepEqual(x.nice(time.month).domain(), [date.local(2008, 11, 1), date.local(2009, 1, 1)]);
test.deepEqual(x.nice(time.year).domain(), [date.local(2008, 0, 1), date.local(2010, 0, 1)]);
test.deepEqual(x.nice(time.timeDay).domain(), [date.local(2009, 0, 1), date.local(2009, 0, 2)]);
test.deepEqual(x.nice(time.timeWeek).domain(), [date.local(2008, 11, 28), date.local(2009, 0, 4)]);
test.deepEqual(x.nice(time.timeMonth).domain(), [date.local(2008, 11, 1), date.local(2009, 1, 1)]);
test.deepEqual(x.nice(time.timeYear).domain(), [date.local(2008, 0, 1), date.local(2010, 0, 1)]);
test.end();
});

tape("time.nice(interval) can nice empty domains", function(test) {
var x = scale.time().domain([date.local(2009, 0, 1, 0, 12), date.local(2009, 0, 1, 0, 12)]);
test.deepEqual(x.nice(time.day).domain(), [date.local(2009, 0, 1), date.local(2009, 0, 2)]);
test.deepEqual(x.nice(time.timeDay).domain(), [date.local(2009, 0, 1), date.local(2009, 0, 2)]);
test.end();
});

tape("time.nice(interval) can nice a polylinear domain, only affecting its extent", function(test) {
var x = scale.time().domain([date.local(2009, 0, 1, 0, 12), date.local(2009, 0, 1, 23, 48), date.local(2009, 0, 2, 23, 48)]).nice(time.day);
var x = scale.time().domain([date.local(2009, 0, 1, 0, 12), date.local(2009, 0, 1, 23, 48), date.local(2009, 0, 2, 23, 48)]).nice(time.timeDay);
test.deepEqual(x.domain(), [date.local(2009, 0, 1), date.local(2009, 0, 1, 23, 48), date.local(2009, 0, 3)]);
test.end();
});

tape("time.nice(interval, step) nices using the specified time interval and step", function(test) {
var x = scale.time().domain([date.local(2009, 0, 1, 0, 12), date.local(2009, 0, 1, 23, 48)]);
test.deepEqual(x.nice(time.day, 3).domain(), [date.local(2009, 0, 1), date.local(2009, 0, 4)]);
test.deepEqual(x.nice(time.week, 2).domain(), [date.local(2008, 11, 21), date.local(2009, 0, 4)]);
test.deepEqual(x.nice(time.month, 3).domain(), [date.local(2008, 9, 1), date.local(2009, 3, 1)]);
test.deepEqual(x.nice(time.year, 10).domain(), [date.local(2000, 0, 1), date.local(2010, 0, 1)]);
test.deepEqual(x.nice(time.timeDay, 3).domain(), [date.local(2009, 0, 1), date.local(2009, 0, 4)]);
test.deepEqual(x.nice(time.timeWeek, 2).domain(), [date.local(2008, 11, 21), date.local(2009, 0, 4)]);
test.deepEqual(x.nice(time.timeMonth, 3).domain(), [date.local(2008, 9, 1), date.local(2009, 3, 1)]);
test.deepEqual(x.nice(time.timeYear, 10).domain(), [date.local(2000, 0, 1), date.local(2010, 0, 1)]);
test.end();
});

Expand Down Expand Up @@ -130,7 +130,7 @@ tape("time.clamp(true).invert(value) never returns a value outside the domain",

tape("time.ticks(interval) observes the specified tick interval", function(test) {
var x = scale.time().domain([date.local(2011, 0, 1, 12, 1, 0), date.local(2011, 0, 1, 12, 4, 4)]);
test.deepEqual(x.ticks(time.minute), [
test.deepEqual(x.ticks(time.timeMinute), [
date.local(2011, 0, 1, 12, 1),
date.local(2011, 0, 1, 12, 2),
date.local(2011, 0, 1, 12, 3),
Expand All @@ -141,7 +141,7 @@ tape("time.ticks(interval) observes the specified tick interval", function(test)

tape("time.ticks(interval, step) observes the specified tick interval and step", function(test) {
var x = scale.time().domain([date.local(2011, 0, 1, 12, 0, 0), date.local(2011, 0, 1, 12, 33, 4)]);
test.deepEqual(x.ticks(time.minute, 10), [
test.deepEqual(x.ticks(time.timeMinute, 10), [
date.local(2011, 0, 1, 12, 0),
date.local(2011, 0, 1, 12, 10),
date.local(2011, 0, 1, 12, 20),
Expand Down

0 comments on commit a830459

Please sign in to comment.