mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
config redirect
This commit is contained in:
13
node_modules/d3-time/LICENSE
generated
vendored
Normal file
13
node_modules/d3-time/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright 2010-2021 Mike Bostock
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||
with or without fee is hereby granted, provided that the above copyright notice
|
||||
and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
378
node_modules/d3-time/README.md
generated
vendored
Normal file
378
node_modules/d3-time/README.md
generated
vendored
Normal file
@@ -0,0 +1,378 @@
|
||||
# d3-time
|
||||
|
||||
When visualizing time series data, analyzing temporal patterns, or working with time in general, the irregularities of conventional time units quickly become apparent. In the [Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian_calendar), for example, most months have 31 days but some have 28, 29 or 30; most years have 365 days but [leap years](https://en.wikipedia.org/wiki/Leap_year) have 366; and with [daylight saving](https://en.wikipedia.org/wiki/Daylight_saving_time), most days have 24 hours but some have 23 or 25. Adding to complexity, daylight saving conventions vary around the world.
|
||||
|
||||
As a result of these temporal peculiarities, it can be difficult to perform seemingly-trivial tasks. For example, if you want to compute the number of days that have passed between two dates, you can’t simply subtract and divide by 24 hours (86,400,000 ms):
|
||||
|
||||
```js
|
||||
start = new Date(2015, 02, 01) // 2015-03-01T00:00
|
||||
end = new Date(2015, 03, 01) // 2015-04-01T00:00
|
||||
(end - start) / 864e5 // 30.958333333333332, oops! 🤯
|
||||
```
|
||||
|
||||
You can, however, use [d3.timeDay](#timeDay).[count](#interval_count):
|
||||
|
||||
```js
|
||||
d3.timeDay.count(start, end) // 31 😌
|
||||
```
|
||||
|
||||
The [day](#day) [interval](#api-reference) is one of several provided by d3-time. Each interval represents a conventional unit of time—[hours](#timeHour), [weeks](#timeWeek), [months](#timeMonth), *etc.*—and has methods to calculate boundary dates. For example, [d3.timeDay](#timeDay) computes midnight (typically 12:00 AM local time) of the corresponding day. In addition to [rounding](#interval_round) and [counting](#interval_count), intervals can also be used to generate arrays of boundary dates. For example, to compute each Sunday in the current month:
|
||||
|
||||
```js
|
||||
start = d3.timeMonth.floor() // 2015-01-01T00:00
|
||||
stop = d3.timeMonth.ceil() // 2015-02-01T00:00
|
||||
d3.timeWeek.range(start, stop) // [2015-01-07T00:00, 2015-01-14T00:00, 2015-01-21T00:00, 2015-01-28T00:00]
|
||||
```
|
||||
|
||||
The d3-time module does not implement its own calendaring system; it merely implements a convenient API for calendar math on top of ECMAScript [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date). Thus, it ignores leap seconds and can only work with the local time zone and [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) (UTC).
|
||||
|
||||
This module is used by D3’s time scales to generate sensible ticks, by D3’s time format, and can also be used directly to do things like [calendar layouts](http://bl.ocks.org/mbostock/4063318).
|
||||
|
||||
## Installing
|
||||
|
||||
If you use npm, `npm install d3-time`. You can also download the [latest release on GitHub](https://github.com/d3/d3-time/releases/latest). For vanilla HTML in modern browsers, import d3-time from Skypack:
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
|
||||
import {timeDay} from "https://cdn.skypack.dev/d3-time@3";
|
||||
|
||||
const day = timeDay();
|
||||
|
||||
</script>
|
||||
```
|
||||
|
||||
For legacy environments, you can load d3-time’s UMD bundle from an npm-based CDN such as jsDelivr; a `d3` global is exported:
|
||||
|
||||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/d3-array@3"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/d3-time@3"></script>
|
||||
<script>
|
||||
|
||||
const day = d3.timeDay();
|
||||
|
||||
</script>
|
||||
```
|
||||
|
||||
[Try d3-time in your browser.](https://observablehq.com/collection/@d3/d3-time)
|
||||
|
||||
## API Reference
|
||||
|
||||
<a name="_interval" href="#_interval">#</a> <i>interval</i>([<i>date</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/interval.js)
|
||||
|
||||
Equivalent to [*interval*.floor](#interval_floor), except if *date* is not specified, it defaults to the current time. For example, [d3.timeYear](#timeYear)(*date*) and d3.timeYear.floor(*date*) are equivalent.
|
||||
|
||||
```js
|
||||
monday = d3.timeMonday() // the latest preceeding Monday, local time
|
||||
```
|
||||
|
||||
<a name="interval_floor" href="#interval_floor">#</a> <i>interval</i>.<b>floor</b>(<i>date</i>) · [Source](https://github.com/d3/d3-time/blob/master/src/interval.js)
|
||||
|
||||
Returns a new date representing the latest interval boundary date before or equal to *date*. For example, [d3.timeDay](#timeDay).floor(*date*) typically returns 12:00 AM local time on the given *date*.
|
||||
|
||||
This method is idempotent: if the specified *date* is already floored to the current interval, a new date with an identical time is returned. Furthermore, the returned date is the minimum expressible value of the associated interval, such that *interval*.floor(*interval*.floor(*date*) - 1) returns the preceeding interval boundary date.
|
||||
|
||||
Note that the `==` and `===` operators do not compare by value with [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) objects, and thus you cannot use them to tell whether the specified *date* has already been floored. Instead, coerce to a number and then compare:
|
||||
|
||||
```js
|
||||
// Returns true if the specified date is a day boundary.
|
||||
function isDay(date) {
|
||||
return +d3.timeDay.floor(date) === +date;
|
||||
}
|
||||
```
|
||||
|
||||
This is more reliable than testing whether the time is 12:00 AM, as in some time zones midnight may not exist due to daylight saving.
|
||||
|
||||
<a name="interval_round" href="#interval_round">#</a> <i>interval</i>.<b>round</b>(<i>date</i>) · [Source](https://github.com/d3/d3-time/blob/master/src/interval.js)
|
||||
|
||||
Returns a new date representing the closest interval boundary date to *date*. For example, [d3.timeDay](#timeDay).round(*date*) typically returns 12:00 AM local time on the given *date* if it is on or before noon, and 12:00 AM of the following day if it is after noon.
|
||||
|
||||
This method is idempotent: if the specified *date* is already rounded to the current interval, a new date with an identical time is returned.
|
||||
|
||||
<a name="interval_ceil" href="#interval_ceil">#</a> <i>interval</i>.<b>ceil</b>(<i>date</i>) · [Source](https://github.com/d3/d3-time/blob/master/src/interval.js)
|
||||
|
||||
Returns a new date representing the earliest interval boundary date after or equal to *date*. For example, [d3.timeDay](#timeDay).ceil(*date*) typically returns 12:00 AM local time on the date following the given *date*.
|
||||
|
||||
This method is idempotent: if the specified *date* is already ceilinged to the current interval, a new date with an identical time is returned. Furthermore, the returned date is the maximum expressible value of the associated interval, such that *interval*.ceil(*interval*.ceil(*date*) + 1) returns the following interval boundary date.
|
||||
|
||||
<a name="interval_offset" href="#interval_offset">#</a> <i>interval</i>.<b>offset</b>(<i>date</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/interval.js)
|
||||
|
||||
Returns a new date equal to *date* plus *step* intervals. If *step* is not specified it defaults to 1. If *step* is negative, then the returned date will be before the specified *date*; if *step* is zero, then a copy of the specified *date* is returned; if *step* is not an integer, it is [floored](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor). This method does not round the specified *date* to the interval. For example, if *date* is today at 5:34 PM, then [d3.timeDay](#timeDay).offset(*date*, 1) returns 5:34 PM tomorrow (even if daylight saving changes!).
|
||||
|
||||
<a name="interval_range" href="#interval_range">#</a> <i>interval</i>.<b>range</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/interval.js)
|
||||
|
||||
Returns an array of dates representing every interval boundary after or equal to *start* (inclusive) and before *stop* (exclusive). If *step* is specified, then every *step*th boundary will be returned; for example, for the [d3.timeDay](#timeDay) interval a *step* of 2 will return every other day. If *step* is not an integer, it is [floored](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor).
|
||||
|
||||
The first date in the returned array is the earliest boundary after or equal to *start*; subsequent dates are [offset](#interval_offset) by *step* intervals and [floored](#interval_floor). Thus, two overlapping ranges may be consistent. For example, this range contains odd days:
|
||||
|
||||
```js
|
||||
d3.timeDay.range(new Date(2015, 0, 1), new Date(2015, 0, 7), 2) // [2015-01-01T00:00, 2015-01-03T00:00, 2015-01-05T00:00]
|
||||
```
|
||||
|
||||
While this contains even days:
|
||||
|
||||
```js
|
||||
d3.timeDay.range(new Date(2015, 0, 2), new Date(2015, 0, 8), 2) // [2015-01-02T00:00, 2015-01-04T00:00, 2015-01-06T00:00]
|
||||
```
|
||||
|
||||
To make ranges consistent when a *step* is specified, use [*interval*.every](#interval_every) instead.
|
||||
|
||||
<a name="interval_filter" href="#interval_filter">#</a> <i>interval</i>.<b>filter</b>(<i>test</i>) · [Source](https://github.com/d3/d3-time/blob/master/src/interval.js)
|
||||
|
||||
Returns a new interval that is a filtered subset of this interval using the specified *test* function. The *test* function is passed a date and should return true if and only if the specified date should be considered part of the interval. For example, to create an interval that returns the 1st, 11th, 21th and 31th (if it exists) of each month:
|
||||
|
||||
```js
|
||||
d3.timeDay.filter(d => (d.getDate() - 1) % 10 === 0)
|
||||
```
|
||||
|
||||
The returned filtered interval does not support [*interval*.count](#interval_count). See also [*interval*.every](#interval_every).
|
||||
|
||||
<a name="interval_every" href="#interval_every">#</a> <i>interval</i>.<b>every</b>(<i>step</i>) · [Source](https://github.com/d3/d3-time/blob/master/src/interval.js)
|
||||
|
||||
Returns a [filtered](#interval_filter) view of this interval representing every *step*th date. The meaning of *step* is dependent on this interval’s parent interval as defined by the field function. For example, [d3.timeMinute](#timeMinute).every(15) returns an interval representing every fifteen minutes, starting on the hour: :00, :15, :30, :45, <i>etc.</i> Note that for some intervals, the resulting dates may not be uniformly-spaced; [d3.timeDay](#timeDay)’s parent interval is [d3.timeMonth](#timeMonth), and thus the interval number resets at the start of each month. If *step* is not valid, returns null. If *step* is one, returns this interval.
|
||||
|
||||
This method can be used in conjunction with [*interval*.range](#interval_range) to ensure that two overlapping ranges are consistent. For example, this range contains odd days:
|
||||
|
||||
```js
|
||||
d3.timeDay.every(2).range(new Date(2015, 0, 1), new Date(2015, 0, 7)) // [2015-01-01T00:00, 2015-01-03T00:00, 2015-01-05T00:00]
|
||||
```
|
||||
|
||||
As does this one:
|
||||
|
||||
```js
|
||||
d3.timeDay.every(2).range(new Date(2015, 0, 2), new Date(2015, 0, 8)) // [2015-01-03T00:00, 2015-01-05T00:00, 2015-01-07T00:00]
|
||||
```
|
||||
|
||||
The returned filtered interval does not support [*interval*.count](#interval_count). See also [*interval*.filter](#interval_filter).
|
||||
|
||||
<a name="interval_count" href="#interval_count">#</a> <i>interval</i>.<b>count</b>(<i>start</i>, <i>end</i>) · [Source](https://github.com/d3/d3-time/blob/master/src/interval.js)
|
||||
|
||||
Returns the number of interval boundaries after *start* (exclusive) and before or equal to *end* (inclusive). Note that this behavior is slightly different than [*interval*.range](#interval_range) because its purpose is to return the zero-based number of the specified *end* date relative to the specified *start* date. For example, to compute the current zero-based day-of-year number:
|
||||
|
||||
```js
|
||||
d3.timeDay.count(d3.timeYear(now), now) // 177
|
||||
```
|
||||
|
||||
Likewise, to compute the current zero-based week-of-year number for weeks that start on Sunday:
|
||||
|
||||
```js
|
||||
d3.timeSunday.count(d3.timeYear(now), now) // 25
|
||||
```
|
||||
|
||||
<a name="timeInterval" href="#timeInterval">#</a> d3.<b>timeInterval</b>(<i>floor</i>, <i>offset</i>[, <i>count</i>[, <i>field</i>]]) · [Source](https://github.com/d3/d3-time/blob/master/src/interval.js)
|
||||
|
||||
Constructs a new custom interval given the specified *floor* and *offset* functions and an optional *count* function.
|
||||
|
||||
The *floor* function takes a single date as an argument and rounds it down to the nearest interval boundary.
|
||||
|
||||
The *offset* function takes a date and an integer step as arguments and advances the specified date by the specified number of boundaries; the step may be positive, negative or zero.
|
||||
|
||||
The optional *count* function takes a start date and an end date, already floored to the current interval, and returns the number of boundaries between the start (exclusive) and end (inclusive). If a *count* function is not specified, the returned interval does not expose [*interval*.count](#interval_count) or [*interval*.every](#interval_every) methods. Note: due to an internal optimization, the specified *count* function must not invoke *interval*.count on other time intervals.
|
||||
|
||||
The optional *field* function takes a date, already floored to the current interval, and returns the field value of the specified date, corresponding to the number of boundaries between this date (exclusive) and the latest previous parent boundary. For example, for the [d3.timeDay](#timeDay) interval, this returns the number of days since the start of the month. If a *field* function is not specified, it defaults to counting the number of interval boundaries since the UNIX epoch of January 1, 1970 UTC. The *field* function defines the behavior of [*interval*.every](#interval_every).
|
||||
|
||||
### Intervals
|
||||
|
||||
The following intervals are provided:
|
||||
|
||||
<a name="timeMillisecond" href="#timeMillisecond">#</a> d3.<b>timeMillisecond</b> · [Source](https://github.com/d3/d3-time/blob/master/src/millisecond.js "Source")
|
||||
<br><a href="#timeMillisecond">#</a> d3.<b>utcMillisecond</b>
|
||||
|
||||
Milliseconds; the shortest available time unit.
|
||||
|
||||
<a name="timeSecond" href="#timeSecond">#</a> d3.<b>timeSecond</b> · [Source](https://github.com/d3/d3-time/blob/master/src/second.js "Source")
|
||||
<br><a href="#timeSecond">#</a> d3.<b>utcSecond</b>
|
||||
|
||||
Seconds (e.g., 01:23:45.0000 AM); 1,000 milliseconds.
|
||||
|
||||
<a name="timeMinute" href="#timeMinute">#</a> d3.<b>timeMinute</b> · [Source](https://github.com/d3/d3-time/blob/master/src/minute.js "Source")
|
||||
<br><a href="#timeMinute">#</a> d3.<b>utcMinute</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcMinute.js "Source")
|
||||
|
||||
Minutes (e.g., 01:02:00 AM); 60 seconds. Note that ECMAScript [ignores leap seconds](http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.1).
|
||||
|
||||
<a name="timeHour" href="#timeHour">#</a> d3.<b>timeHour</b> · [Source](https://github.com/d3/d3-time/blob/master/src/hour.js "Source")
|
||||
<br><a href="#timeHour">#</a> d3.<b>utcHour</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcHour.js "Source")
|
||||
|
||||
Hours (e.g., 01:00 AM); 60 minutes. Note that advancing time by one hour in local time can return the same hour or skip an hour due to daylight saving.
|
||||
|
||||
<a name="timeDay" href="#timeDay">#</a> d3.<b>timeDay</b> · [Source](https://github.com/d3/d3-time/blob/master/src/day.js "Source")
|
||||
<br><a href="#timeDay">#</a> d3.<b>utcDay</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcDay.js "Source")
|
||||
|
||||
Days (e.g., February 7, 2012 at 12:00 AM); typically 24 hours. Days in local time may range from 23 to 25 hours due to daylight saving.
|
||||
|
||||
<a name="timeWeek" href="#timeWeek">#</a> d3.<b>timeWeek</b> · [Source](https://github.com/d3/d3-time/blob/master/src/week.js "Source")
|
||||
<br><a href="#timeWeek">#</a> d3.<b>utcWeek</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js "Source")
|
||||
|
||||
Alias for [d3.timeSunday](#timeSunday); 7 days and typically 168 hours. Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
||||
|
||||
<a name="timeSunday" href="#timeSunday">#</a> d3.<b>timeSunday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeSunday">#</a> d3.<b>utcSunday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Sunday-based weeks (e.g., February 5, 2012 at 12:00 AM).
|
||||
|
||||
<a name="timeMonday" href="#timeMonday">#</a> d3.<b>timeMonday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeMonday">#</a> d3.<b>utcMonday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Monday-based weeks (e.g., February 6, 2012 at 12:00 AM).
|
||||
|
||||
<a name="timeTuesday" href="#timeTuesday">#</a> d3.<b>timeTuesday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeTuesday">#</a> d3.<b>utcTuesday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Tuesday-based weeks (e.g., February 7, 2012 at 12:00 AM).
|
||||
|
||||
<a name="timeWednesday" href="#timeWednesday">#</a> d3.<b>timeWednesday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeWednesday">#</a> d3.<b>utcWednesday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Wednesday-based weeks (e.g., February 8, 2012 at 12:00 AM).
|
||||
|
||||
<a name="timeThursday" href="#timeThursday">#</a> d3.<b>timeThursday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeThursday">#</a> d3.<b>utcThursday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Thursday-based weeks (e.g., February 9, 2012 at 12:00 AM).
|
||||
|
||||
<a name="timeFriday" href="#timeFriday">#</a> d3.<b>timeFriday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeFriday">#</a> d3.<b>utcFriday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Friday-based weeks (e.g., February 10, 2012 at 12:00 AM).
|
||||
|
||||
<a name="timeSaturday" href="#timeSaturday">#</a> d3.<b>timeSaturday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeSaturday">#</a> d3.<b>utcSaturday</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Saturday-based weeks (e.g., February 11, 2012 at 12:00 AM).
|
||||
|
||||
<a name="timeMonth" href="#timeMonth">#</a> d3.<b>timeMonth</b> · [Source](https://github.com/d3/d3-time/blob/master/src/month.js "Source")
|
||||
<br><a href="#timeMonth">#</a> d3.<b>utcMonth</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcMonth.js "Source")
|
||||
|
||||
Months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days.
|
||||
|
||||
<a name="timeYear" href="#timeYear">#</a> d3.<b>timeYear</b> · [Source](https://github.com/d3/d3-time/blob/master/src/year.js "Source")
|
||||
<br><a href="#timeYear">#</a> d3.<b>utcYear</b> · [Source](https://github.com/d3/d3-time/blob/master/src/utcYear.js "Source")
|
||||
|
||||
Years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days.
|
||||
|
||||
### Ranges
|
||||
|
||||
For convenience, aliases for [*interval*.range](#interval_range) are also provided as plural forms of the corresponding interval.
|
||||
|
||||
<a name="timeMilliseconds" href="#timeMilliseconds">#</a> d3.<b>timeMilliseconds</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/millisecond.js)
|
||||
<br><a href="#timeMilliseconds">#</a> d3.<b>utcMilliseconds</b>(<i>start</i>, <i>stop</i>[, <i>step</i>])
|
||||
|
||||
Aliases for [d3.timeMillisecond](#timeMillisecond).[range](#interval_range) and [d3.utcMillisecond](#timeMillisecond).[range](#interval_range).
|
||||
|
||||
<a name="timeSeconds" href="#timeSeconds">#</a> d3.<b>timeSeconds</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/second.js)
|
||||
<br><a href="#timeSeconds">#</a> d3.<b>utcSeconds</b>(<i>start</i>, <i>stop</i>[, <i>step</i>])
|
||||
|
||||
Aliases for [d3.timeSecond](#timeSecond).[range](#interval_range) and [d3.utcSecond](#timeSecond).[range](#interval_range).
|
||||
|
||||
<a name="timeMinutes" href="#timeMinutes">#</a> d3.<b>timeMinutes</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/minute.js)
|
||||
<br><a href="#timeMinutes">#</a> d3.<b>utcMinutes</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcMinute.js)
|
||||
|
||||
Aliases for [d3.timeMinute](#timeMinute).[range](#interval_range) and [d3.utcMinute](#timeMinute).[range](#interval_range).
|
||||
|
||||
<a name="timeHours" href="#timeHours">#</a> d3.<b>timeHours</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/hour.js)
|
||||
<br><a href="#timeHours">#</a> d3.<b>utcHours</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcHour.js)
|
||||
|
||||
Aliases for [d3.timeHour](#timeHour).[range](#interval_range) and [d3.utcHour](#timeHour).[range](#interval_range).
|
||||
|
||||
<a name="timeDays" href="#timeDays">#</a> d3.<b>timeDays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/day.js)
|
||||
<br><a href="#timeDays">#</a> d3.<b>utcDays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcDay.js)
|
||||
|
||||
Aliases for [d3.timeDay](#timeDay).[range](#interval_range) and [d3.utcDay](#timeDay).[range](#interval_range).
|
||||
|
||||
<a name="timeWeeks" href="#timeWeeks">#</a> d3.<b>timeWeeks</b>(<i>start</i>, <i>stop</i>[, <i>step</i>])
|
||||
<br><a href="#timeWeeks">#</a> d3.<b>utcWeeks</b>(<i>start</i>, <i>stop</i>[, <i>step</i>])
|
||||
|
||||
Aliases for [d3.timeWeek](#timeWeek).[range](#interval_range) and [d3.utcWeek](#timeWeek).[range](#interval_range).
|
||||
|
||||
<a name="timeSundays" href="#timeSundays">#</a> d3.<b>timeSundays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeSundays">#</a> d3.<b>utcSundays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Aliases for [d3.timeSunday](#timeSunday).[range](#interval_range) and [d3.utcSunday](#timeSunday).[range](#interval_range).
|
||||
|
||||
<a name="timeMondays" href="#timeMondays">#</a> d3.<b>timeMondays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeMondays">#</a> d3.<b>utcMondays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Aliases for [d3.timeMonday](#timeMonday).[range](#interval_range) and [d3.utcMonday](#timeMonday).[range](#interval_range).
|
||||
|
||||
<a name="timeTuesdays" href="#timeTuesdays">#</a> d3.<b>timeTuesdays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeTuesdays">#</a> d3.<b>utcTuesdays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Aliases for [d3.timeTuesday](#timeTuesday).[range](#interval_range) and [d3.utcTuesday](#timeTuesday).[range](#interval_range).
|
||||
|
||||
<a name="timeWednesdays" href="#timeWednesdays">#</a> d3.<b>timeWednesdays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeWednesdays">#</a> d3.<b>utcWednesdays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Aliases for [d3.timeWednesday](#timeWednesday).[range](#interval_range) and [d3.utcWednesday](#timeWednesday).[range](#interval_range).
|
||||
|
||||
<a name="timeThursdays" href="#timeThursdays">#</a> d3.<b>timeThursdays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeThursdays">#</a> d3.<b>utcThursdays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Aliases for [d3.timeThursday](#timeThursday).[range](#interval_range) and [d3.utcThursday](#timeThursday).[range](#interval_range).
|
||||
|
||||
<a name="timeFridays" href="#timeFridays">#</a> d3.<b>timeFridays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeFridays">#</a> d3.<b>utcFridays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Aliases for [d3.timeFriday](#timeFriday).[range](#interval_range) and [d3.utcFriday](#timeFriday).[range](#interval_range).
|
||||
|
||||
<a name="timeSaturdays" href="#timeSaturdays">#</a> d3.<b>timeSaturdays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/week.js)
|
||||
<br><a href="#timeSaturdays">#</a> d3.<b>utcSaturdays</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcWeek.js)
|
||||
|
||||
Aliases for [d3.timeSaturday](#timeSaturday).[range](#interval_range) and [d3.utcSaturday](#timeSaturday).[range](#interval_range).
|
||||
|
||||
<a name="timeMonths" href="#timeMonths">#</a> d3.<b>timeMonths</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/month.js)
|
||||
<br><a href="#timeMonths">#</a> d3.<b>utcMonths</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcMonth.js)
|
||||
|
||||
Aliases for [d3.timeMonth](#timeMonth).[range](#interval_range) and [d3.utcMonth](#timeMonth).[range](#interval_range).
|
||||
|
||||
<a name="timeYears" href="#timeYears">#</a> d3.<b>timeYears</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/year.js)
|
||||
<br><a href="#timeYears">#</a> d3.<b>utcYears</b>(<i>start</i>, <i>stop</i>[, <i>step</i>]) · [Source](https://github.com/d3/d3-time/blob/master/src/utcYear.js)
|
||||
|
||||
Aliases for [d3.timeYear](#timeYear).[range](#interval_range) and [d3.utcYear](#timeYear).[range](#interval_range).
|
||||
|
||||
### Ticks
|
||||
|
||||
<a name="timeTicks" href="#timeTicks">#</a> d3.<b>timeTicks</b>(<i>start</i>, <i>stop</i>, <i>count</i>) · [Source](https://github.com/d3/d3-time/blob/master/src/ticks.js)
|
||||
|
||||
Equivalent to [d3.utcTicks](#utcTicks), but in local time.
|
||||
|
||||
<a name="timeTickInterval" href="#timeTickInterval">#</a> d3.<b>timeTickInterval</b>(<i>start</i>, <i>stop</i>, <i>count</i>) · [Source](https://github.com/d3/d3-time/blob/master/src/ticks.js)
|
||||
|
||||
Returns the time interval that would be used by [d3.timeTicks](#timeTicks) given the same arguments.
|
||||
|
||||
<a name="utcTicks" href="#utcTicks">#</a> d3.<b>utcTicks</b>(<i>start</i>, <i>stop</i>, <i>count</i>) · [Source](https://github.com/d3/d3-time/blob/master/src/ticks.js)
|
||||
|
||||
Returns an array of approximately *count* dates at regular intervals between *start* and *stop* (inclusive). If *stop* is before *start*, dates are returned in reverse chronological order; otherwise dates are returned in chronological order. The following UTC time intervals are considered:
|
||||
|
||||
* 1 second
|
||||
* 5 seconds
|
||||
* 15 seconds
|
||||
* 30 seconds
|
||||
* 1 minute
|
||||
* 5 minutes
|
||||
* 15 minutes
|
||||
* 30 minutes
|
||||
* 1 hour
|
||||
* 3 hours
|
||||
* 6 hours
|
||||
* 12 hours
|
||||
* 1 day
|
||||
* 2 days
|
||||
* 1 week
|
||||
* 1 month
|
||||
* 3 months
|
||||
* 1 year
|
||||
|
||||
Multiples of milliseconds (for small ranges) and years (for large ranges) are also considered, following the rules of [d3.ticks](https://github.com/d3/d3-array/blob/master/README.md#ticks). The interval producing the number of dates that is closest to *count* is used. For example:
|
||||
|
||||
```js
|
||||
start = new Date(Date.UTC(1970, 2, 1))
|
||||
stop = new Date(Date.UTC(1996, 2, 19))
|
||||
count = 4
|
||||
d3.utcTicks(start, stop, count) // [1975-01-01, 1980-01-01, 1985-01-01, 1990-01-01, 1995-01-01]
|
||||
```
|
||||
|
||||
If *count* is a time interval, this function behaves similarly to [*interval*.range](#interval_range) except that both *start* and *stop* are inclusive and it may return dates in reverse chronological order if *stop* is before *start*.
|
||||
|
||||
<a name="utcTickInterval" href="#utcTickInterval">#</a> d3.<b>utcTickInterval</b>(<i>start</i>, <i>stop</i>, <i>count</i>) · [Source](https://github.com/d3/d3-time/blob/master/src/ticks.js)
|
||||
|
||||
Returns the time interval that would be used by [d3.utcTicks](#utcTicks) given the same arguments. If there is no associated interval, such as when *start* or *stop* is invalid, returns null.
|
||||
422
node_modules/d3-time/dist/d3-time.js
generated
vendored
Normal file
422
node_modules/d3-time/dist/d3-time.js
generated
vendored
Normal file
@@ -0,0 +1,422 @@
|
||||
// https://d3js.org/d3-time/ v3.0.0 Copyright 2010-2021 Mike Bostock
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array')) :
|
||||
typeof define === 'function' && define.amd ? define(['exports', 'd3-array'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}, global.d3));
|
||||
}(this, (function (exports, d3Array) { 'use strict';
|
||||
|
||||
var t0 = new Date,
|
||||
t1 = new Date;
|
||||
|
||||
function newInterval(floori, offseti, count, field) {
|
||||
|
||||
function interval(date) {
|
||||
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
||||
}
|
||||
|
||||
interval.floor = function(date) {
|
||||
return floori(date = new Date(+date)), date;
|
||||
};
|
||||
|
||||
interval.ceil = function(date) {
|
||||
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
||||
};
|
||||
|
||||
interval.round = function(date) {
|
||||
var d0 = interval(date),
|
||||
d1 = interval.ceil(date);
|
||||
return date - d0 < d1 - date ? d0 : d1;
|
||||
};
|
||||
|
||||
interval.offset = function(date, step) {
|
||||
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
||||
};
|
||||
|
||||
interval.range = function(start, stop, step) {
|
||||
var range = [], previous;
|
||||
start = interval.ceil(start);
|
||||
step = step == null ? 1 : Math.floor(step);
|
||||
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
||||
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
||||
while (previous < start && start < stop);
|
||||
return range;
|
||||
};
|
||||
|
||||
interval.filter = function(test) {
|
||||
return newInterval(function(date) {
|
||||
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
||||
}, function(date, step) {
|
||||
if (date >= date) {
|
||||
if (step < 0) while (++step <= 0) {
|
||||
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
||||
} else while (--step >= 0) {
|
||||
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (count) {
|
||||
interval.count = function(start, end) {
|
||||
t0.setTime(+start), t1.setTime(+end);
|
||||
floori(t0), floori(t1);
|
||||
return Math.floor(count(t0, t1));
|
||||
};
|
||||
|
||||
interval.every = function(step) {
|
||||
step = Math.floor(step);
|
||||
return !isFinite(step) || !(step > 0) ? null
|
||||
: !(step > 1) ? interval
|
||||
: interval.filter(field
|
||||
? function(d) { return field(d) % step === 0; }
|
||||
: function(d) { return interval.count(0, d) % step === 0; });
|
||||
};
|
||||
}
|
||||
|
||||
return interval;
|
||||
}
|
||||
|
||||
var millisecond = newInterval(function() {
|
||||
// noop
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step);
|
||||
}, function(start, end) {
|
||||
return end - start;
|
||||
});
|
||||
|
||||
// An optimized implementation for this simple case.
|
||||
millisecond.every = function(k) {
|
||||
k = Math.floor(k);
|
||||
if (!isFinite(k) || !(k > 0)) return null;
|
||||
if (!(k > 1)) return millisecond;
|
||||
return newInterval(function(date) {
|
||||
date.setTime(Math.floor(date / k) * k);
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * k);
|
||||
}, function(start, end) {
|
||||
return (end - start) / k;
|
||||
});
|
||||
};
|
||||
var milliseconds = millisecond.range;
|
||||
|
||||
const durationSecond = 1000;
|
||||
const durationMinute = durationSecond * 60;
|
||||
const durationHour = durationMinute * 60;
|
||||
const durationDay = durationHour * 24;
|
||||
const durationWeek = durationDay * 7;
|
||||
const durationMonth = durationDay * 30;
|
||||
const durationYear = durationDay * 365;
|
||||
|
||||
var second = newInterval(function(date) {
|
||||
date.setTime(date - date.getMilliseconds());
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * durationSecond);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationSecond;
|
||||
}, function(date) {
|
||||
return date.getUTCSeconds();
|
||||
});
|
||||
var seconds = second.range;
|
||||
|
||||
var minute = newInterval(function(date) {
|
||||
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * durationMinute);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationMinute;
|
||||
}, function(date) {
|
||||
return date.getMinutes();
|
||||
});
|
||||
var minutes = minute.range;
|
||||
|
||||
var hour = newInterval(function(date) {
|
||||
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * durationHour);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationHour;
|
||||
}, function(date) {
|
||||
return date.getHours();
|
||||
});
|
||||
var hours = hour.range;
|
||||
|
||||
var day = newInterval(
|
||||
date => date.setHours(0, 0, 0, 0),
|
||||
(date, step) => date.setDate(date.getDate() + step),
|
||||
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
|
||||
date => date.getDate() - 1
|
||||
);
|
||||
var days = day.range;
|
||||
|
||||
function weekday(i) {
|
||||
return newInterval(function(date) {
|
||||
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setDate(date.getDate() + step * 7);
|
||||
}, function(start, end) {
|
||||
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
||||
});
|
||||
}
|
||||
|
||||
var sunday = weekday(0);
|
||||
var monday = weekday(1);
|
||||
var tuesday = weekday(2);
|
||||
var wednesday = weekday(3);
|
||||
var thursday = weekday(4);
|
||||
var friday = weekday(5);
|
||||
var saturday = weekday(6);
|
||||
|
||||
var sundays = sunday.range;
|
||||
var mondays = monday.range;
|
||||
var tuesdays = tuesday.range;
|
||||
var wednesdays = wednesday.range;
|
||||
var thursdays = thursday.range;
|
||||
var fridays = friday.range;
|
||||
var saturdays = saturday.range;
|
||||
|
||||
var month = newInterval(function(date) {
|
||||
date.setDate(1);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setMonth(date.getMonth() + step);
|
||||
}, function(start, end) {
|
||||
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
||||
}, function(date) {
|
||||
return date.getMonth();
|
||||
});
|
||||
var months = month.range;
|
||||
|
||||
var year = newInterval(function(date) {
|
||||
date.setMonth(0, 1);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setFullYear(date.getFullYear() + step);
|
||||
}, function(start, end) {
|
||||
return end.getFullYear() - start.getFullYear();
|
||||
}, function(date) {
|
||||
return date.getFullYear();
|
||||
});
|
||||
|
||||
// An optimized implementation for this simple case.
|
||||
year.every = function(k) {
|
||||
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
|
||||
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
||||
date.setMonth(0, 1);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setFullYear(date.getFullYear() + step * k);
|
||||
});
|
||||
};
|
||||
var years = year.range;
|
||||
|
||||
var utcMinute = newInterval(function(date) {
|
||||
date.setUTCSeconds(0, 0);
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * durationMinute);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationMinute;
|
||||
}, function(date) {
|
||||
return date.getUTCMinutes();
|
||||
});
|
||||
var utcMinutes = utcMinute.range;
|
||||
|
||||
var utcHour = newInterval(function(date) {
|
||||
date.setUTCMinutes(0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * durationHour);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationHour;
|
||||
}, function(date) {
|
||||
return date.getUTCHours();
|
||||
});
|
||||
var utcHours = utcHour.range;
|
||||
|
||||
var utcDay = newInterval(function(date) {
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setUTCDate(date.getUTCDate() + step);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationDay;
|
||||
}, function(date) {
|
||||
return date.getUTCDate() - 1;
|
||||
});
|
||||
var utcDays = utcDay.range;
|
||||
|
||||
function utcWeekday(i) {
|
||||
return newInterval(function(date) {
|
||||
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setUTCDate(date.getUTCDate() + step * 7);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationWeek;
|
||||
});
|
||||
}
|
||||
|
||||
var utcSunday = utcWeekday(0);
|
||||
var utcMonday = utcWeekday(1);
|
||||
var utcTuesday = utcWeekday(2);
|
||||
var utcWednesday = utcWeekday(3);
|
||||
var utcThursday = utcWeekday(4);
|
||||
var utcFriday = utcWeekday(5);
|
||||
var utcSaturday = utcWeekday(6);
|
||||
|
||||
var utcSundays = utcSunday.range;
|
||||
var utcMondays = utcMonday.range;
|
||||
var utcTuesdays = utcTuesday.range;
|
||||
var utcWednesdays = utcWednesday.range;
|
||||
var utcThursdays = utcThursday.range;
|
||||
var utcFridays = utcFriday.range;
|
||||
var utcSaturdays = utcSaturday.range;
|
||||
|
||||
var utcMonth = newInterval(function(date) {
|
||||
date.setUTCDate(1);
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setUTCMonth(date.getUTCMonth() + step);
|
||||
}, function(start, end) {
|
||||
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
||||
}, function(date) {
|
||||
return date.getUTCMonth();
|
||||
});
|
||||
var utcMonths = utcMonth.range;
|
||||
|
||||
var utcYear = newInterval(function(date) {
|
||||
date.setUTCMonth(0, 1);
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setUTCFullYear(date.getUTCFullYear() + step);
|
||||
}, function(start, end) {
|
||||
return end.getUTCFullYear() - start.getUTCFullYear();
|
||||
}, function(date) {
|
||||
return date.getUTCFullYear();
|
||||
});
|
||||
|
||||
// An optimized implementation for this simple case.
|
||||
utcYear.every = function(k) {
|
||||
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
|
||||
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
||||
date.setUTCMonth(0, 1);
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
||||
});
|
||||
};
|
||||
var utcYears = utcYear.range;
|
||||
|
||||
function ticker(year, month, week, day, hour, minute) {
|
||||
|
||||
const tickIntervals = [
|
||||
[second, 1, durationSecond],
|
||||
[second, 5, 5 * durationSecond],
|
||||
[second, 15, 15 * durationSecond],
|
||||
[second, 30, 30 * durationSecond],
|
||||
[minute, 1, durationMinute],
|
||||
[minute, 5, 5 * durationMinute],
|
||||
[minute, 15, 15 * durationMinute],
|
||||
[minute, 30, 30 * durationMinute],
|
||||
[ hour, 1, durationHour ],
|
||||
[ hour, 3, 3 * durationHour ],
|
||||
[ hour, 6, 6 * durationHour ],
|
||||
[ hour, 12, 12 * durationHour ],
|
||||
[ day, 1, durationDay ],
|
||||
[ day, 2, 2 * durationDay ],
|
||||
[ week, 1, durationWeek ],
|
||||
[ month, 1, durationMonth ],
|
||||
[ month, 3, 3 * durationMonth ],
|
||||
[ year, 1, durationYear ]
|
||||
];
|
||||
|
||||
function ticks(start, stop, count) {
|
||||
const reverse = stop < start;
|
||||
if (reverse) [start, stop] = [stop, start];
|
||||
const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count);
|
||||
const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop
|
||||
return reverse ? ticks.reverse() : ticks;
|
||||
}
|
||||
|
||||
function tickInterval(start, stop, count) {
|
||||
const target = Math.abs(stop - start) / count;
|
||||
const i = d3Array.bisector(([,, step]) => step).right(tickIntervals, target);
|
||||
if (i === tickIntervals.length) return year.every(d3Array.tickStep(start / durationYear, stop / durationYear, count));
|
||||
if (i === 0) return millisecond.every(Math.max(d3Array.tickStep(start, stop, count), 1));
|
||||
const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
|
||||
return t.every(step);
|
||||
}
|
||||
|
||||
return [ticks, tickInterval];
|
||||
}
|
||||
|
||||
const [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute);
|
||||
const [timeTicks, timeTickInterval] = ticker(year, month, sunday, day, hour, minute);
|
||||
|
||||
exports.timeDay = day;
|
||||
exports.timeDays = days;
|
||||
exports.timeFriday = friday;
|
||||
exports.timeFridays = fridays;
|
||||
exports.timeHour = hour;
|
||||
exports.timeHours = hours;
|
||||
exports.timeInterval = newInterval;
|
||||
exports.timeMillisecond = millisecond;
|
||||
exports.timeMilliseconds = milliseconds;
|
||||
exports.timeMinute = minute;
|
||||
exports.timeMinutes = minutes;
|
||||
exports.timeMonday = monday;
|
||||
exports.timeMondays = mondays;
|
||||
exports.timeMonth = month;
|
||||
exports.timeMonths = months;
|
||||
exports.timeSaturday = saturday;
|
||||
exports.timeSaturdays = saturdays;
|
||||
exports.timeSecond = second;
|
||||
exports.timeSeconds = seconds;
|
||||
exports.timeSunday = sunday;
|
||||
exports.timeSundays = sundays;
|
||||
exports.timeThursday = thursday;
|
||||
exports.timeThursdays = thursdays;
|
||||
exports.timeTickInterval = timeTickInterval;
|
||||
exports.timeTicks = timeTicks;
|
||||
exports.timeTuesday = tuesday;
|
||||
exports.timeTuesdays = tuesdays;
|
||||
exports.timeWednesday = wednesday;
|
||||
exports.timeWednesdays = wednesdays;
|
||||
exports.timeWeek = sunday;
|
||||
exports.timeWeeks = sundays;
|
||||
exports.timeYear = year;
|
||||
exports.timeYears = years;
|
||||
exports.utcDay = utcDay;
|
||||
exports.utcDays = utcDays;
|
||||
exports.utcFriday = utcFriday;
|
||||
exports.utcFridays = utcFridays;
|
||||
exports.utcHour = utcHour;
|
||||
exports.utcHours = utcHours;
|
||||
exports.utcMillisecond = millisecond;
|
||||
exports.utcMilliseconds = milliseconds;
|
||||
exports.utcMinute = utcMinute;
|
||||
exports.utcMinutes = utcMinutes;
|
||||
exports.utcMonday = utcMonday;
|
||||
exports.utcMondays = utcMondays;
|
||||
exports.utcMonth = utcMonth;
|
||||
exports.utcMonths = utcMonths;
|
||||
exports.utcSaturday = utcSaturday;
|
||||
exports.utcSaturdays = utcSaturdays;
|
||||
exports.utcSecond = second;
|
||||
exports.utcSeconds = seconds;
|
||||
exports.utcSunday = utcSunday;
|
||||
exports.utcSundays = utcSundays;
|
||||
exports.utcThursday = utcThursday;
|
||||
exports.utcThursdays = utcThursdays;
|
||||
exports.utcTickInterval = utcTickInterval;
|
||||
exports.utcTicks = utcTicks;
|
||||
exports.utcTuesday = utcTuesday;
|
||||
exports.utcTuesdays = utcTuesdays;
|
||||
exports.utcWednesday = utcWednesday;
|
||||
exports.utcWednesdays = utcWednesdays;
|
||||
exports.utcWeek = utcSunday;
|
||||
exports.utcWeeks = utcSundays;
|
||||
exports.utcYear = utcYear;
|
||||
exports.utcYears = utcYears;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
2
node_modules/d3-time/dist/d3-time.min.js
generated
vendored
Normal file
2
node_modules/d3-time/dist/d3-time.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
53
node_modules/d3-time/package.json
generated
vendored
Normal file
53
node_modules/d3-time/package.json
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "d3-time",
|
||||
"version": "3.0.0",
|
||||
"description": "A calculator for humanity’s peculiar conventions of time.",
|
||||
"homepage": "https://d3js.org/d3-time/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/d3/d3-time.git"
|
||||
},
|
||||
"keywords": [
|
||||
"d3",
|
||||
"d3-module",
|
||||
"time",
|
||||
"interval",
|
||||
"calendar"
|
||||
],
|
||||
"license": "ISC",
|
||||
"author": {
|
||||
"name": "Mike Bostock",
|
||||
"url": "http://bost.ocks.org/mike"
|
||||
},
|
||||
"type": "module",
|
||||
"files": [
|
||||
"dist/**/*.js",
|
||||
"src/**/*.js"
|
||||
],
|
||||
"module": "src/index.js",
|
||||
"main": "src/index.js",
|
||||
"jsdelivr": "dist/d3-time.min.js",
|
||||
"unpkg": "dist/d3-time.min.js",
|
||||
"exports": {
|
||||
"umd": "./dist/d3-time.min.js",
|
||||
"default": "./src/index.js"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"dependencies": {
|
||||
"d3-array": "2 - 3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "7",
|
||||
"mocha": "8",
|
||||
"rollup": "2",
|
||||
"rollup-plugin-terser": "7"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "TZ=America/Los_Angeles mocha 'test/**/*-test.js' && eslint src test",
|
||||
"prepublishOnly": "rm -rf dist && yarn test && rollup -c",
|
||||
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd -"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
}
|
||||
12
node_modules/d3-time/src/day.js
generated
vendored
Normal file
12
node_modules/d3-time/src/day.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import interval from "./interval.js";
|
||||
import {durationDay, durationMinute} from "./duration.js";
|
||||
|
||||
var day = interval(
|
||||
date => date.setHours(0, 0, 0, 0),
|
||||
(date, step) => date.setDate(date.getDate() + step),
|
||||
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
|
||||
date => date.getDate() - 1
|
||||
);
|
||||
|
||||
export default day;
|
||||
export var days = day.range;
|
||||
7
node_modules/d3-time/src/duration.js
generated
vendored
Normal file
7
node_modules/d3-time/src/duration.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export const durationSecond = 1000;
|
||||
export const durationMinute = durationSecond * 60;
|
||||
export const durationHour = durationMinute * 60;
|
||||
export const durationDay = durationHour * 24;
|
||||
export const durationWeek = durationDay * 7;
|
||||
export const durationMonth = durationDay * 30;
|
||||
export const durationYear = durationDay * 365;
|
||||
15
node_modules/d3-time/src/hour.js
generated
vendored
Normal file
15
node_modules/d3-time/src/hour.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import interval from "./interval.js";
|
||||
import {durationHour, durationMinute, durationSecond} from "./duration.js";
|
||||
|
||||
var hour = interval(function(date) {
|
||||
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * durationHour);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationHour;
|
||||
}, function(date) {
|
||||
return date.getHours();
|
||||
});
|
||||
|
||||
export default hour;
|
||||
export var hours = hour.range;
|
||||
112
node_modules/d3-time/src/index.js
generated
vendored
Normal file
112
node_modules/d3-time/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
export {
|
||||
default as timeInterval
|
||||
} from "./interval.js";
|
||||
|
||||
export {
|
||||
default as timeMillisecond,
|
||||
milliseconds as timeMilliseconds,
|
||||
default as utcMillisecond,
|
||||
milliseconds as utcMilliseconds
|
||||
} from "./millisecond.js";
|
||||
|
||||
export {
|
||||
default as timeSecond,
|
||||
seconds as timeSeconds,
|
||||
default as utcSecond,
|
||||
seconds as utcSeconds
|
||||
} from "./second.js";
|
||||
|
||||
export {
|
||||
default as timeMinute,
|
||||
minutes as timeMinutes
|
||||
} from "./minute.js";
|
||||
|
||||
export {
|
||||
default as timeHour,
|
||||
hours as timeHours
|
||||
} from "./hour.js";
|
||||
|
||||
export {
|
||||
default as timeDay,
|
||||
days as timeDays
|
||||
} from "./day.js";
|
||||
|
||||
export {
|
||||
sunday as timeWeek,
|
||||
sundays as timeWeeks,
|
||||
sunday as timeSunday,
|
||||
sundays as timeSundays,
|
||||
monday as timeMonday,
|
||||
mondays as timeMondays,
|
||||
tuesday as timeTuesday,
|
||||
tuesdays as timeTuesdays,
|
||||
wednesday as timeWednesday,
|
||||
wednesdays as timeWednesdays,
|
||||
thursday as timeThursday,
|
||||
thursdays as timeThursdays,
|
||||
friday as timeFriday,
|
||||
fridays as timeFridays,
|
||||
saturday as timeSaturday,
|
||||
saturdays as timeSaturdays
|
||||
} from "./week.js";
|
||||
|
||||
export {
|
||||
default as timeMonth,
|
||||
months as timeMonths
|
||||
} from "./month.js";
|
||||
|
||||
export {
|
||||
default as timeYear,
|
||||
years as timeYears
|
||||
} from "./year.js";
|
||||
|
||||
export {
|
||||
default as utcMinute,
|
||||
utcMinutes as utcMinutes
|
||||
} from "./utcMinute.js";
|
||||
|
||||
export {
|
||||
default as utcHour,
|
||||
utcHours as utcHours
|
||||
} from "./utcHour.js";
|
||||
|
||||
export {
|
||||
default as utcDay,
|
||||
utcDays as utcDays
|
||||
} from "./utcDay.js";
|
||||
|
||||
export {
|
||||
utcSunday as utcWeek,
|
||||
utcSundays as utcWeeks,
|
||||
utcSunday as utcSunday,
|
||||
utcSundays as utcSundays,
|
||||
utcMonday as utcMonday,
|
||||
utcMondays as utcMondays,
|
||||
utcTuesday as utcTuesday,
|
||||
utcTuesdays as utcTuesdays,
|
||||
utcWednesday as utcWednesday,
|
||||
utcWednesdays as utcWednesdays,
|
||||
utcThursday as utcThursday,
|
||||
utcThursdays as utcThursdays,
|
||||
utcFriday as utcFriday,
|
||||
utcFridays as utcFridays,
|
||||
utcSaturday as utcSaturday,
|
||||
utcSaturdays as utcSaturdays
|
||||
} from "./utcWeek.js";
|
||||
|
||||
export {
|
||||
default as utcMonth,
|
||||
utcMonths as utcMonths
|
||||
} from "./utcMonth.js";
|
||||
|
||||
export {
|
||||
default as utcYear,
|
||||
utcYears as utcYears
|
||||
} from "./utcYear.js";
|
||||
|
||||
export {
|
||||
utcTicks,
|
||||
utcTickInterval,
|
||||
timeTicks,
|
||||
timeTickInterval
|
||||
} from "./ticks.js";
|
||||
70
node_modules/d3-time/src/interval.js
generated
vendored
Normal file
70
node_modules/d3-time/src/interval.js
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
var t0 = new Date,
|
||||
t1 = new Date;
|
||||
|
||||
export default function newInterval(floori, offseti, count, field) {
|
||||
|
||||
function interval(date) {
|
||||
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
||||
}
|
||||
|
||||
interval.floor = function(date) {
|
||||
return floori(date = new Date(+date)), date;
|
||||
};
|
||||
|
||||
interval.ceil = function(date) {
|
||||
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
||||
};
|
||||
|
||||
interval.round = function(date) {
|
||||
var d0 = interval(date),
|
||||
d1 = interval.ceil(date);
|
||||
return date - d0 < d1 - date ? d0 : d1;
|
||||
};
|
||||
|
||||
interval.offset = function(date, step) {
|
||||
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
||||
};
|
||||
|
||||
interval.range = function(start, stop, step) {
|
||||
var range = [], previous;
|
||||
start = interval.ceil(start);
|
||||
step = step == null ? 1 : Math.floor(step);
|
||||
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
||||
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
||||
while (previous < start && start < stop);
|
||||
return range;
|
||||
};
|
||||
|
||||
interval.filter = function(test) {
|
||||
return newInterval(function(date) {
|
||||
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
||||
}, function(date, step) {
|
||||
if (date >= date) {
|
||||
if (step < 0) while (++step <= 0) {
|
||||
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
||||
} else while (--step >= 0) {
|
||||
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (count) {
|
||||
interval.count = function(start, end) {
|
||||
t0.setTime(+start), t1.setTime(+end);
|
||||
floori(t0), floori(t1);
|
||||
return Math.floor(count(t0, t1));
|
||||
};
|
||||
|
||||
interval.every = function(step) {
|
||||
step = Math.floor(step);
|
||||
return !isFinite(step) || !(step > 0) ? null
|
||||
: !(step > 1) ? interval
|
||||
: interval.filter(field
|
||||
? function(d) { return field(d) % step === 0; }
|
||||
: function(d) { return interval.count(0, d) % step === 0; });
|
||||
};
|
||||
}
|
||||
|
||||
return interval;
|
||||
}
|
||||
26
node_modules/d3-time/src/millisecond.js
generated
vendored
Normal file
26
node_modules/d3-time/src/millisecond.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import interval from "./interval.js";
|
||||
|
||||
var millisecond = interval(function() {
|
||||
// noop
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step);
|
||||
}, function(start, end) {
|
||||
return end - start;
|
||||
});
|
||||
|
||||
// An optimized implementation for this simple case.
|
||||
millisecond.every = function(k) {
|
||||
k = Math.floor(k);
|
||||
if (!isFinite(k) || !(k > 0)) return null;
|
||||
if (!(k > 1)) return millisecond;
|
||||
return interval(function(date) {
|
||||
date.setTime(Math.floor(date / k) * k);
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * k);
|
||||
}, function(start, end) {
|
||||
return (end - start) / k;
|
||||
});
|
||||
};
|
||||
|
||||
export default millisecond;
|
||||
export var milliseconds = millisecond.range;
|
||||
15
node_modules/d3-time/src/minute.js
generated
vendored
Normal file
15
node_modules/d3-time/src/minute.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import interval from "./interval.js";
|
||||
import {durationMinute, durationSecond} from "./duration.js";
|
||||
|
||||
var minute = interval(function(date) {
|
||||
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * durationMinute);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationMinute;
|
||||
}, function(date) {
|
||||
return date.getMinutes();
|
||||
});
|
||||
|
||||
export default minute;
|
||||
export var minutes = minute.range;
|
||||
15
node_modules/d3-time/src/month.js
generated
vendored
Normal file
15
node_modules/d3-time/src/month.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import interval from "./interval.js";
|
||||
|
||||
var month = interval(function(date) {
|
||||
date.setDate(1);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setMonth(date.getMonth() + step);
|
||||
}, function(start, end) {
|
||||
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
||||
}, function(date) {
|
||||
return date.getMonth();
|
||||
});
|
||||
|
||||
export default month;
|
||||
export var months = month.range;
|
||||
15
node_modules/d3-time/src/second.js
generated
vendored
Normal file
15
node_modules/d3-time/src/second.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import interval from "./interval.js";
|
||||
import {durationSecond} from "./duration.js";
|
||||
|
||||
var second = interval(function(date) {
|
||||
date.setTime(date - date.getMilliseconds());
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * durationSecond);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationSecond;
|
||||
}, function(date) {
|
||||
return date.getUTCSeconds();
|
||||
});
|
||||
|
||||
export default second;
|
||||
export var seconds = second.range;
|
||||
64
node_modules/d3-time/src/ticks.js
generated
vendored
Normal file
64
node_modules/d3-time/src/ticks.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
import {bisector, tickStep} from "d3-array";
|
||||
import {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from "./duration.js";
|
||||
import millisecond from "./millisecond.js";
|
||||
import second from "./second.js";
|
||||
import minute from "./minute.js";
|
||||
import hour from "./hour.js";
|
||||
import day from "./day.js";
|
||||
import {sunday as week} from "./week.js";
|
||||
import month from "./month.js";
|
||||
import year from "./year.js";
|
||||
import utcMinute from "./utcMinute.js";
|
||||
import utcHour from "./utcHour.js";
|
||||
import utcDay from "./utcDay.js";
|
||||
import {utcSunday as utcWeek} from "./utcWeek.js";
|
||||
import utcMonth from "./utcMonth.js";
|
||||
import utcYear from "./utcYear.js";
|
||||
|
||||
function ticker(year, month, week, day, hour, minute) {
|
||||
|
||||
const tickIntervals = [
|
||||
[second, 1, durationSecond],
|
||||
[second, 5, 5 * durationSecond],
|
||||
[second, 15, 15 * durationSecond],
|
||||
[second, 30, 30 * durationSecond],
|
||||
[minute, 1, durationMinute],
|
||||
[minute, 5, 5 * durationMinute],
|
||||
[minute, 15, 15 * durationMinute],
|
||||
[minute, 30, 30 * durationMinute],
|
||||
[ hour, 1, durationHour ],
|
||||
[ hour, 3, 3 * durationHour ],
|
||||
[ hour, 6, 6 * durationHour ],
|
||||
[ hour, 12, 12 * durationHour ],
|
||||
[ day, 1, durationDay ],
|
||||
[ day, 2, 2 * durationDay ],
|
||||
[ week, 1, durationWeek ],
|
||||
[ month, 1, durationMonth ],
|
||||
[ month, 3, 3 * durationMonth ],
|
||||
[ year, 1, durationYear ]
|
||||
];
|
||||
|
||||
function ticks(start, stop, count) {
|
||||
const reverse = stop < start;
|
||||
if (reverse) [start, stop] = [stop, start];
|
||||
const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count);
|
||||
const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop
|
||||
return reverse ? ticks.reverse() : ticks;
|
||||
}
|
||||
|
||||
function tickInterval(start, stop, count) {
|
||||
const target = Math.abs(stop - start) / count;
|
||||
const i = bisector(([,, step]) => step).right(tickIntervals, target);
|
||||
if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));
|
||||
if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));
|
||||
const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
|
||||
return t.every(step);
|
||||
}
|
||||
|
||||
return [ticks, tickInterval];
|
||||
}
|
||||
|
||||
const [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute);
|
||||
const [timeTicks, timeTickInterval] = ticker(year, month, week, day, hour, minute);
|
||||
|
||||
export {utcTicks, utcTickInterval, timeTicks, timeTickInterval};
|
||||
15
node_modules/d3-time/src/utcDay.js
generated
vendored
Normal file
15
node_modules/d3-time/src/utcDay.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import interval from "./interval.js";
|
||||
import {durationDay} from "./duration.js";
|
||||
|
||||
var utcDay = interval(function(date) {
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setUTCDate(date.getUTCDate() + step);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationDay;
|
||||
}, function(date) {
|
||||
return date.getUTCDate() - 1;
|
||||
});
|
||||
|
||||
export default utcDay;
|
||||
export var utcDays = utcDay.range;
|
||||
15
node_modules/d3-time/src/utcHour.js
generated
vendored
Normal file
15
node_modules/d3-time/src/utcHour.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import interval from "./interval.js";
|
||||
import {durationHour} from "./duration.js";
|
||||
|
||||
var utcHour = interval(function(date) {
|
||||
date.setUTCMinutes(0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * durationHour);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationHour;
|
||||
}, function(date) {
|
||||
return date.getUTCHours();
|
||||
});
|
||||
|
||||
export default utcHour;
|
||||
export var utcHours = utcHour.range;
|
||||
15
node_modules/d3-time/src/utcMinute.js
generated
vendored
Normal file
15
node_modules/d3-time/src/utcMinute.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import interval from "./interval.js";
|
||||
import {durationMinute} from "./duration.js";
|
||||
|
||||
var utcMinute = interval(function(date) {
|
||||
date.setUTCSeconds(0, 0);
|
||||
}, function(date, step) {
|
||||
date.setTime(+date + step * durationMinute);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationMinute;
|
||||
}, function(date) {
|
||||
return date.getUTCMinutes();
|
||||
});
|
||||
|
||||
export default utcMinute;
|
||||
export var utcMinutes = utcMinute.range;
|
||||
15
node_modules/d3-time/src/utcMonth.js
generated
vendored
Normal file
15
node_modules/d3-time/src/utcMonth.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import interval from "./interval.js";
|
||||
|
||||
var utcMonth = interval(function(date) {
|
||||
date.setUTCDate(1);
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setUTCMonth(date.getUTCMonth() + step);
|
||||
}, function(start, end) {
|
||||
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
||||
}, function(date) {
|
||||
return date.getUTCMonth();
|
||||
});
|
||||
|
||||
export default utcMonth;
|
||||
export var utcMonths = utcMonth.range;
|
||||
29
node_modules/d3-time/src/utcWeek.js
generated
vendored
Normal file
29
node_modules/d3-time/src/utcWeek.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import interval from "./interval.js";
|
||||
import {durationWeek} from "./duration.js";
|
||||
|
||||
function utcWeekday(i) {
|
||||
return interval(function(date) {
|
||||
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setUTCDate(date.getUTCDate() + step * 7);
|
||||
}, function(start, end) {
|
||||
return (end - start) / durationWeek;
|
||||
});
|
||||
}
|
||||
|
||||
export var utcSunday = utcWeekday(0);
|
||||
export var utcMonday = utcWeekday(1);
|
||||
export var utcTuesday = utcWeekday(2);
|
||||
export var utcWednesday = utcWeekday(3);
|
||||
export var utcThursday = utcWeekday(4);
|
||||
export var utcFriday = utcWeekday(5);
|
||||
export var utcSaturday = utcWeekday(6);
|
||||
|
||||
export var utcSundays = utcSunday.range;
|
||||
export var utcMondays = utcMonday.range;
|
||||
export var utcTuesdays = utcTuesday.range;
|
||||
export var utcWednesdays = utcWednesday.range;
|
||||
export var utcThursdays = utcThursday.range;
|
||||
export var utcFridays = utcFriday.range;
|
||||
export var utcSaturdays = utcSaturday.range;
|
||||
26
node_modules/d3-time/src/utcYear.js
generated
vendored
Normal file
26
node_modules/d3-time/src/utcYear.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import interval from "./interval.js";
|
||||
|
||||
var utcYear = interval(function(date) {
|
||||
date.setUTCMonth(0, 1);
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setUTCFullYear(date.getUTCFullYear() + step);
|
||||
}, function(start, end) {
|
||||
return end.getUTCFullYear() - start.getUTCFullYear();
|
||||
}, function(date) {
|
||||
return date.getUTCFullYear();
|
||||
});
|
||||
|
||||
// An optimized implementation for this simple case.
|
||||
utcYear.every = function(k) {
|
||||
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {
|
||||
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
||||
date.setUTCMonth(0, 1);
|
||||
date.setUTCHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
||||
});
|
||||
};
|
||||
|
||||
export default utcYear;
|
||||
export var utcYears = utcYear.range;
|
||||
29
node_modules/d3-time/src/week.js
generated
vendored
Normal file
29
node_modules/d3-time/src/week.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import interval from "./interval.js";
|
||||
import {durationMinute, durationWeek} from "./duration.js";
|
||||
|
||||
function weekday(i) {
|
||||
return interval(function(date) {
|
||||
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setDate(date.getDate() + step * 7);
|
||||
}, function(start, end) {
|
||||
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
||||
});
|
||||
}
|
||||
|
||||
export var sunday = weekday(0);
|
||||
export var monday = weekday(1);
|
||||
export var tuesday = weekday(2);
|
||||
export var wednesday = weekday(3);
|
||||
export var thursday = weekday(4);
|
||||
export var friday = weekday(5);
|
||||
export var saturday = weekday(6);
|
||||
|
||||
export var sundays = sunday.range;
|
||||
export var mondays = monday.range;
|
||||
export var tuesdays = tuesday.range;
|
||||
export var wednesdays = wednesday.range;
|
||||
export var thursdays = thursday.range;
|
||||
export var fridays = friday.range;
|
||||
export var saturdays = saturday.range;
|
||||
26
node_modules/d3-time/src/year.js
generated
vendored
Normal file
26
node_modules/d3-time/src/year.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import interval from "./interval.js";
|
||||
|
||||
var year = interval(function(date) {
|
||||
date.setMonth(0, 1);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setFullYear(date.getFullYear() + step);
|
||||
}, function(start, end) {
|
||||
return end.getFullYear() - start.getFullYear();
|
||||
}, function(date) {
|
||||
return date.getFullYear();
|
||||
});
|
||||
|
||||
// An optimized implementation for this simple case.
|
||||
year.every = function(k) {
|
||||
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {
|
||||
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
||||
date.setMonth(0, 1);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
}, function(date, step) {
|
||||
date.setFullYear(date.getFullYear() + step * k);
|
||||
});
|
||||
};
|
||||
|
||||
export default year;
|
||||
export var years = year.range;
|
||||
Reference in New Issue
Block a user