@redsift/dashboard 7.6.0 → 7.7.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -1
- package/index.js +683 -3137
- package/index.js.map +1 -1
- package/package.json +7 -4
package/index.js
CHANGED
|
@@ -7,9 +7,9 @@ import { useGridApiRef, gridFilteredSortedRowEntriesSelector, gridVisibleColumnD
|
|
|
7
7
|
import { DataGrid as DataGrid$1 } from '@redsift/table';
|
|
8
8
|
import { config, rowChart, redrawAll, filterAll, pieChart, barChart, filters } from 'dc';
|
|
9
9
|
import { saveAs } from 'file-saver';
|
|
10
|
-
import { Font, StyleSheet, Document, Page, View, Image, Text, pdf } from '@react-pdf/renderer';
|
|
10
|
+
import { Font, StyleSheet, Document, Page, View, Image, Text as Text$1, pdf } from '@react-pdf/renderer';
|
|
11
11
|
import domToImage from 'dom-to-image';
|
|
12
|
-
import 'd3
|
|
12
|
+
import { sum, utcParse, timeFormat, isoParse, timeMonth, scaleTime, timeMonths, timeYear, timeYears, timeWeek, timeWeeks, timeDay, timeDays, timeHour, timeHours } from 'd3';
|
|
13
13
|
|
|
14
14
|
const groupReduceCount = d => d.group().reduceCount();
|
|
15
15
|
const COUNT = groupReduceCount;
|
|
@@ -20,6 +20,15 @@ const SUM = groupReduceSum;
|
|
|
20
20
|
// Material Design Icons v7.1.96
|
|
21
21
|
var mdiRefresh = "M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z";
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Font.
|
|
25
|
+
*/
|
|
26
|
+
const FontFamily = {
|
|
27
|
+
raleway: 'raleway',
|
|
28
|
+
'source-code-pro': 'source-code-pro',
|
|
29
|
+
electrolize: 'electrolize'
|
|
30
|
+
};
|
|
31
|
+
|
|
23
32
|
/**
|
|
24
33
|
* Color palette.
|
|
25
34
|
*/
|
|
@@ -40,6 +49,14 @@ const ProductColorPalette = {
|
|
|
40
49
|
hardenize: 'hardenize',
|
|
41
50
|
tools: 'tools'
|
|
42
51
|
};
|
|
52
|
+
const NeutralColorPalette = {
|
|
53
|
+
black: 'black',
|
|
54
|
+
darkgrey: 'darkgrey',
|
|
55
|
+
midgrey: 'midgrey',
|
|
56
|
+
lightgrey: 'lightgrey',
|
|
57
|
+
xlightgrey: 'xlightgrey',
|
|
58
|
+
white: 'white'
|
|
59
|
+
};
|
|
43
60
|
|
|
44
61
|
/**
|
|
45
62
|
* Do not edit directly
|
|
@@ -225,6 +242,168 @@ function _defineProperty$1(obj, key, value) {
|
|
|
225
242
|
return obj;
|
|
226
243
|
}
|
|
227
244
|
|
|
245
|
+
/*
|
|
246
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
247
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
248
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
249
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
250
|
+
*
|
|
251
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
252
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
253
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
254
|
+
* governing permissions and limitations under the License.
|
|
255
|
+
*/ /*
|
|
256
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
257
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
258
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
259
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
260
|
+
*
|
|
261
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
262
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
263
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
264
|
+
* governing permissions and limitations under the License.
|
|
265
|
+
*/ let $488c6ddbf4ef74c2$var$formatterCache = new Map();
|
|
266
|
+
let $488c6ddbf4ef74c2$var$supportsSignDisplay = false;
|
|
267
|
+
try {
|
|
268
|
+
// @ts-ignore
|
|
269
|
+
$488c6ddbf4ef74c2$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", {
|
|
270
|
+
signDisplay: "exceptZero"
|
|
271
|
+
}).resolvedOptions().signDisplay === "exceptZero";
|
|
272
|
+
// eslint-disable-next-line no-empty
|
|
273
|
+
} catch (e) {}
|
|
274
|
+
let $488c6ddbf4ef74c2$var$supportsUnit = false;
|
|
275
|
+
try {
|
|
276
|
+
// @ts-ignore
|
|
277
|
+
$488c6ddbf4ef74c2$var$supportsUnit = new Intl.NumberFormat("de-DE", {
|
|
278
|
+
style: "unit",
|
|
279
|
+
unit: "degree"
|
|
280
|
+
}).resolvedOptions().style === "unit";
|
|
281
|
+
// eslint-disable-next-line no-empty
|
|
282
|
+
} catch (e1) {}
|
|
283
|
+
// Polyfill for units since Safari doesn't support them yet. See https://bugs.webkit.org/show_bug.cgi?id=215438.
|
|
284
|
+
// Currently only polyfilling the unit degree in narrow format for ColorSlider in our supported locales.
|
|
285
|
+
// Values were determined by switching to each locale manually in Chrome.
|
|
286
|
+
const $488c6ddbf4ef74c2$var$UNITS = {
|
|
287
|
+
degree: {
|
|
288
|
+
narrow: {
|
|
289
|
+
default: "\xb0",
|
|
290
|
+
"ja-JP": " 度",
|
|
291
|
+
"zh-TW": "度",
|
|
292
|
+
"sl-SI": " \xb0"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
class $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 {
|
|
297
|
+
/** Formats a number value as a string, according to the locale and options provided to the constructor. */ format(value) {
|
|
298
|
+
let res = "";
|
|
299
|
+
if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null) res = $488c6ddbf4ef74c2$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
|
|
300
|
+
else res = this.numberFormatter.format(value);
|
|
301
|
+
if (this.options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
|
|
302
|
+
var _UNITS_unit;
|
|
303
|
+
let { unit: unit , unitDisplay: unitDisplay = "short" , locale: locale } = this.resolvedOptions();
|
|
304
|
+
let values = (_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay];
|
|
305
|
+
res += values[locale] || values.default;
|
|
306
|
+
}
|
|
307
|
+
return res;
|
|
308
|
+
}
|
|
309
|
+
/** Formats a number to an array of parts such as separators, digits, punctuation, and more. */ formatToParts(value) {
|
|
310
|
+
// TODO: implement signDisplay for formatToParts
|
|
311
|
+
// @ts-ignore
|
|
312
|
+
return this.numberFormatter.formatToParts(value);
|
|
313
|
+
}
|
|
314
|
+
/** Formats a number range as a string. */ formatRange(start, end) {
|
|
315
|
+
// @ts-ignore
|
|
316
|
+
if (typeof this.numberFormatter.formatRange === "function") // @ts-ignore
|
|
317
|
+
return this.numberFormatter.formatRange(start, end);
|
|
318
|
+
if (end < start) throw new RangeError("End date must be >= start date");
|
|
319
|
+
// Very basic fallback for old browsers.
|
|
320
|
+
return `${this.format(start)} – ${this.format(end)}`;
|
|
321
|
+
}
|
|
322
|
+
/** Formats a number range as an array of parts. */ formatRangeToParts(start, end) {
|
|
323
|
+
// @ts-ignore
|
|
324
|
+
if (typeof this.numberFormatter.formatRangeToParts === "function") // @ts-ignore
|
|
325
|
+
return this.numberFormatter.formatRangeToParts(start, end);
|
|
326
|
+
if (end < start) throw new RangeError("End date must be >= start date");
|
|
327
|
+
let startParts = this.numberFormatter.formatToParts(start);
|
|
328
|
+
let endParts = this.numberFormatter.formatToParts(end);
|
|
329
|
+
return [
|
|
330
|
+
...startParts.map((p)=>({
|
|
331
|
+
...p,
|
|
332
|
+
source: "startRange"
|
|
333
|
+
})),
|
|
334
|
+
{
|
|
335
|
+
type: "literal",
|
|
336
|
+
value: " – ",
|
|
337
|
+
source: "shared"
|
|
338
|
+
},
|
|
339
|
+
...endParts.map((p)=>({
|
|
340
|
+
...p,
|
|
341
|
+
source: "endRange"
|
|
342
|
+
}))
|
|
343
|
+
];
|
|
344
|
+
}
|
|
345
|
+
/** Returns the resolved formatting options based on the values passed to the constructor. */ resolvedOptions() {
|
|
346
|
+
let options = this.numberFormatter.resolvedOptions();
|
|
347
|
+
if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null) options = {
|
|
348
|
+
...options,
|
|
349
|
+
signDisplay: this.options.signDisplay
|
|
350
|
+
};
|
|
351
|
+
if (!$488c6ddbf4ef74c2$var$supportsUnit && this.options.style === "unit") options = {
|
|
352
|
+
...options,
|
|
353
|
+
style: "unit",
|
|
354
|
+
unit: this.options.unit,
|
|
355
|
+
unitDisplay: this.options.unitDisplay
|
|
356
|
+
};
|
|
357
|
+
return options;
|
|
358
|
+
}
|
|
359
|
+
constructor(locale, options = {}){
|
|
360
|
+
this.numberFormatter = $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options);
|
|
361
|
+
this.options = options;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options = {}) {
|
|
365
|
+
let { numberingSystem: numberingSystem } = options;
|
|
366
|
+
if (numberingSystem && locale.indexOf("-u-nu-") === -1) locale = `${locale}-u-nu-${numberingSystem}`;
|
|
367
|
+
if (options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
|
|
368
|
+
var _UNITS_unit;
|
|
369
|
+
let { unit: unit , unitDisplay: unitDisplay = "short" } = options;
|
|
370
|
+
if (!unit) throw new Error('unit option must be provided with style: "unit"');
|
|
371
|
+
if (!((_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay])) throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);
|
|
372
|
+
options = {
|
|
373
|
+
...options,
|
|
374
|
+
style: "decimal"
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : "");
|
|
378
|
+
if ($488c6ddbf4ef74c2$var$formatterCache.has(cacheKey)) return $488c6ddbf4ef74c2$var$formatterCache.get(cacheKey);
|
|
379
|
+
let numberFormatter = new Intl.NumberFormat(locale, options);
|
|
380
|
+
$488c6ddbf4ef74c2$var$formatterCache.set(cacheKey, numberFormatter);
|
|
381
|
+
return numberFormatter;
|
|
382
|
+
}
|
|
383
|
+
function $488c6ddbf4ef74c2$export$711b50b3c525e0f2(numberFormat, signDisplay, num) {
|
|
384
|
+
if (signDisplay === "auto") return numberFormat.format(num);
|
|
385
|
+
else if (signDisplay === "never") return numberFormat.format(Math.abs(num));
|
|
386
|
+
else {
|
|
387
|
+
let needsPositiveSign = false;
|
|
388
|
+
if (signDisplay === "always") needsPositiveSign = num > 0 || Object.is(num, 0);
|
|
389
|
+
else if (signDisplay === "exceptZero") {
|
|
390
|
+
if (Object.is(num, -0) || Object.is(num, 0)) num = Math.abs(num);
|
|
391
|
+
else needsPositiveSign = num > 0;
|
|
392
|
+
}
|
|
393
|
+
if (needsPositiveSign) {
|
|
394
|
+
let negative = numberFormat.format(-num);
|
|
395
|
+
let noSign = numberFormat.format(num);
|
|
396
|
+
// ignore RTL/LTR marker character
|
|
397
|
+
let minus = negative.replace(noSign, "").replace(/\u200e|\u061C/, "");
|
|
398
|
+
if ([
|
|
399
|
+
...minus
|
|
400
|
+
].length !== 1) console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
|
|
401
|
+
let positive = negative.replace(noSign, "!!!").replace(minus, "+").replace("!!!", noSign);
|
|
402
|
+
return positive;
|
|
403
|
+
} else return numberFormat.format(num);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
228
407
|
/*
|
|
229
408
|
* Copyright 2020 Adobe. All rights reserved.
|
|
230
409
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -402,6 +581,28 @@ function $fca6afa0e843324b$export$f12b703ca79dfbb1(strings) {
|
|
|
402
581
|
]);
|
|
403
582
|
}
|
|
404
583
|
|
|
584
|
+
|
|
585
|
+
/*
|
|
586
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
587
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
588
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
589
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
590
|
+
*
|
|
591
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
592
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
593
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
594
|
+
* governing permissions and limitations under the License.
|
|
595
|
+
*/
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
function $a916eb452884faea$export$b7a616150fdb9f44(options = {}) {
|
|
599
|
+
let { locale: locale } = ($18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
|
|
600
|
+
return (useMemo)(()=>new ($488c6ddbf4ef74c2$export$cc77c4ff7e8673c5)(locale, options), [
|
|
601
|
+
locale,
|
|
602
|
+
options
|
|
603
|
+
]);
|
|
604
|
+
}
|
|
605
|
+
|
|
405
606
|
function ownKeys(object, enumerableOnly) {
|
|
406
607
|
var keys = Object.keys(object);
|
|
407
608
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -2440,10 +2641,10 @@ const StyledIcon = styled.span`
|
|
|
2440
2641
|
}}
|
|
2441
2642
|
`;
|
|
2442
2643
|
|
|
2443
|
-
const _excluded$
|
|
2444
|
-
const COMPONENT_NAME$
|
|
2445
|
-
const CLASSNAME$
|
|
2446
|
-
const DEFAULT_PROPS$
|
|
2644
|
+
const _excluded$b = ["aria-hidden", "aria-label", "badge", "className", "color", "icon", "size", "svgProps"];
|
|
2645
|
+
const COMPONENT_NAME$b = 'Icon';
|
|
2646
|
+
const CLASSNAME$b = 'redsift-icon';
|
|
2647
|
+
const DEFAULT_PROPS$a = {
|
|
2447
2648
|
size: IconSize.medium
|
|
2448
2649
|
};
|
|
2449
2650
|
|
|
@@ -2461,7 +2662,7 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2461
2662
|
size,
|
|
2462
2663
|
svgProps
|
|
2463
2664
|
} = props,
|
|
2464
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
2665
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$b);
|
|
2465
2666
|
return /*#__PURE__*/React.createElement(StyledIcon, _extends({}, forwardedProps, {
|
|
2466
2667
|
$color: color,
|
|
2467
2668
|
$size: size,
|
|
@@ -2483,9 +2684,9 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2483
2684
|
fill: "currentColor"
|
|
2484
2685
|
})), badge ? badge : null);
|
|
2485
2686
|
});
|
|
2486
|
-
Icon.className = CLASSNAME$
|
|
2487
|
-
Icon.defaultProps = DEFAULT_PROPS$
|
|
2488
|
-
Icon.displayName = COMPONENT_NAME$
|
|
2687
|
+
Icon.className = CLASSNAME$b;
|
|
2688
|
+
Icon.defaultProps = DEFAULT_PROPS$a;
|
|
2689
|
+
Icon.displayName = COMPONENT_NAME$b;
|
|
2489
2690
|
|
|
2490
2691
|
/**
|
|
2491
2692
|
* Component variant.
|
|
@@ -2668,7 +2869,7 @@ var spinnerTools = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My
|
|
|
2668
2869
|
|
|
2669
2870
|
var spinnerWebsite = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNDAwIDQwMCIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iIHRleHQtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogIDxzdHlsZT4KICAgIC5zcGlubmluZyB7CiAgICAgIGFuaW1hdGlvbjogc3Bpbm5pbmcta2V5ZnJhbWVzIDMwMDBtcyBsaW5lYXIgaW5maW5pdGUgbm9ybWFsIGZvcndhcmRzOwogICAgICB0cmFuc2Zvcm0tb3JpZ2luOiBjZW50ZXI7CiAgICAgIGFuaW1hdGlvbi10aW1pbmctZnVuY3Rpb246IGN1YmljLWJlemllcigwLjQyLCAwLCAwLjU4LCAxKTsKICAgIH0KICAgIEBrZXlmcmFtZXMgc3Bpbm5pbmcta2V5ZnJhbWVzIHsKICAgICAgMCUgewogICAgICAgIHRyYW5zZm9ybTogIHJvdGF0ZSgwZGVnKTsKICAgICAgfQoKICAgICAgMzMlIHsKICAgICAgICB0cmFuc2Zvcm06ICByb3RhdGUoMTgwZGVnKTsKICAgICAgfQoKICAgICAgNTAlIHsKICAgICAgICB0cmFuc2Zvcm06IHJvdGF0ZSgxODBkZWcpOwogICAgICB9CgogICAgICA4MyUgewogICAgICAgIHRyYW5zZm9ybTogIHJvdGF0ZSgzNjBkZWcpOwogICAgICB9CgogICAgICAxMDAlIHsKICAgICAgICB0cmFuc2Zvcm06ICByb3RhdGUoMzYwZGVnKQogICAgICB9CiAgICB9CiAgPC9zdHlsZT4KICA8cGF0aAogICAgbWFzaz0idXJsKCNzcGlubmVyLXUtbWFza3MpIgogICAgZmlsbD0iIzAwNzllMSIKICAgIGQ9Ik0zMTggMTg2LjlWMTA4LjhMMjAwIDU3IDgyIDEwOC44djc4LjFDODIgMjU5IDEzMi4zIDMyNi40IDIwMCAzNDNjNjcuNy0xNi42IDExOC04NCAxMTgtMTU2LjF6TTQwMCAyMDBjMCAxMTAuNS04OS41IDIwMC0yMDAgMjAwUzAgMzEwLjUgMCAyMDAgODkuNSAwIDIwMCAwczIwMCA4OS41IDIwMCAyMDB6IgogIC8+CiAgPG1hc2sgaWQ9InNwaW5uZXItdS1tYXNrcyI+CiAgICA8cGF0aAogICAgICBjbGFzcz0ic3Bpbm5pbmciCiAgICAgIGQ9Ik0wLDIwMEMwLDg5LjU0MzA1LDg5LjU0MzA1LDAsMjAwLDB2NDAwQzg5LjU0MzA1LDQwMCwwLDMxMC40NTY5NSwwLDIwMFoiCiAgICAgIGZpbGw9IiNmZmYiCiAgICAvPgogIDwvbWFzaz4KICA8cGF0aAogICAgbWFzaz0idXJsKCNzcGlubmVyLXUtbWFza3MyKSIKICAgIGZpbGw9IiMwMDc5ZTEiCiAgICBkPSJNODIsMTg2LjkzOXYtNzguMDg5TDIwMCw1N2wxMTgsNTEuODV2NzguMDg5QzMxOCwyNTkuMDAyLDI2Ny42ODYsMzI2LjQwMiwyMDAsMzQzQzEzMi4zMTQsMzI2LjQwMiw4MiwyNTkuMDAyLDgyLDE4Ni45MzlaIgogIC8+CiAgPG1hc2sgaWQ9InNwaW5uZXItdS1tYXNrczIiPgogICAgPHBhdGgKICAgICAgY2xhc3M9InNwaW5uaW5nIgogICAgICBkPSJNNDAwIDIwMEM0MDAgMzEwLjUgMzEwLjUgNDAwIDIwMCA0MDBWMGMxMTAuNSAwIDIwMCA4OS41IDIwMCAyMDB6IgogICAgICBmaWxsPSIjZmZmIgogICAgLz4KICA8L21hc2s+Cjwvc3ZnPg==';
|
|
2670
2871
|
|
|
2671
|
-
const _excluded$
|
|
2872
|
+
const _excluded$a = ["aria-hidden", "aria-label", "className", "color", "size"];
|
|
2672
2873
|
const colorToFile = {
|
|
2673
2874
|
default: spinnerDefault,
|
|
2674
2875
|
hardenize: spinnerHardenize,
|
|
@@ -2680,9 +2881,9 @@ const colorToFile = {
|
|
|
2680
2881
|
tools: spinnerTools,
|
|
2681
2882
|
website: spinnerWebsite
|
|
2682
2883
|
};
|
|
2683
|
-
const COMPONENT_NAME$
|
|
2684
|
-
const CLASSNAME$
|
|
2685
|
-
const DEFAULT_PROPS$
|
|
2884
|
+
const COMPONENT_NAME$a = 'Spinner';
|
|
2885
|
+
const CLASSNAME$a = 'redsift-shield';
|
|
2886
|
+
const DEFAULT_PROPS$9 = {
|
|
2686
2887
|
color: ColorPalette.default,
|
|
2687
2888
|
size: SpinnerSize.medium
|
|
2688
2889
|
};
|
|
@@ -2723,7 +2924,7 @@ const Spinner = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2723
2924
|
color: propsColor,
|
|
2724
2925
|
size
|
|
2725
2926
|
} = props,
|
|
2726
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
2927
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$a);
|
|
2727
2928
|
const {
|
|
2728
2929
|
width,
|
|
2729
2930
|
height
|
|
@@ -2745,14 +2946,14 @@ const Spinner = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2745
2946
|
$size: size
|
|
2746
2947
|
}));
|
|
2747
2948
|
});
|
|
2748
|
-
Spinner.className = CLASSNAME$
|
|
2749
|
-
Spinner.defaultProps = DEFAULT_PROPS$
|
|
2750
|
-
Spinner.displayName = COMPONENT_NAME$
|
|
2751
|
-
|
|
2752
|
-
const _excluded$
|
|
2753
|
-
const COMPONENT_NAME$
|
|
2754
|
-
const CLASSNAME$
|
|
2755
|
-
const DEFAULT_PROPS$
|
|
2949
|
+
Spinner.className = CLASSNAME$a;
|
|
2950
|
+
Spinner.defaultProps = DEFAULT_PROPS$9;
|
|
2951
|
+
Spinner.displayName = COMPONENT_NAME$a;
|
|
2952
|
+
|
|
2953
|
+
const _excluded$9 = ["children", "className", "color", "disabled", "fullWidth", "isActive", "isDisabled", "isLoading", "leftIcon", "onPress", "rightIcon", "variant"];
|
|
2954
|
+
const COMPONENT_NAME$9 = 'Button';
|
|
2955
|
+
const CLASSNAME$9 = 'redsift-button';
|
|
2956
|
+
const DEFAULT_PROPS$8 = {
|
|
2756
2957
|
color: ColorPalette.default,
|
|
2757
2958
|
height: 'fit-content',
|
|
2758
2959
|
variant: ButtonVariant.primary
|
|
@@ -2789,7 +2990,7 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2789
2990
|
rightIcon,
|
|
2790
2991
|
variant
|
|
2791
2992
|
} = props,
|
|
2792
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
2993
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$9);
|
|
2793
2994
|
return /*#__PURE__*/React.createElement(StyledButton, _extends({}, forwardedProps, buttonProps, {
|
|
2794
2995
|
$color: color,
|
|
2795
2996
|
$fullWidth: fullWidth,
|
|
@@ -2813,9 +3014,318 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2813
3014
|
className: "right"
|
|
2814
3015
|
}) : null);
|
|
2815
3016
|
});
|
|
2816
|
-
Button.className = CLASSNAME$
|
|
2817
|
-
Button.defaultProps = DEFAULT_PROPS$
|
|
2818
|
-
Button.displayName = COMPONENT_NAME$
|
|
3017
|
+
Button.className = CLASSNAME$9;
|
|
3018
|
+
Button.defaultProps = DEFAULT_PROPS$8;
|
|
3019
|
+
Button.displayName = COMPONENT_NAME$9;
|
|
3020
|
+
|
|
3021
|
+
/**
|
|
3022
|
+
* Component style.
|
|
3023
|
+
*/
|
|
3024
|
+
const StyledFlexbox = styled.div`
|
|
3025
|
+
display: ${_ref => {
|
|
3026
|
+
let {
|
|
3027
|
+
inline
|
|
3028
|
+
} = _ref;
|
|
3029
|
+
return inline ? 'inline-flex' : 'flex';
|
|
3030
|
+
}};
|
|
3031
|
+
|
|
3032
|
+
${baseStyling}
|
|
3033
|
+
${baseInternalSpacing}
|
|
3034
|
+
${baseFlexbox}
|
|
3035
|
+
`;
|
|
3036
|
+
|
|
3037
|
+
const _excluded$8 = ["children", "className"];
|
|
3038
|
+
const COMPONENT_NAME$8 = 'Flexbox';
|
|
3039
|
+
const CLASSNAME$8 = 'redsift-flex-box';
|
|
3040
|
+
const DEFAULT_PROPS$7 = {
|
|
3041
|
+
gap: '16px'
|
|
3042
|
+
};
|
|
3043
|
+
|
|
3044
|
+
/**
|
|
3045
|
+
* The Flexbox component.
|
|
3046
|
+
*/
|
|
3047
|
+
const Flexbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
3048
|
+
const {
|
|
3049
|
+
children,
|
|
3050
|
+
className
|
|
3051
|
+
} = props,
|
|
3052
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$8);
|
|
3053
|
+
return /*#__PURE__*/React.createElement(StyledFlexbox, _extends({}, forwardedProps, {
|
|
3054
|
+
className: classNames(Flexbox.className, className),
|
|
3055
|
+
ref: ref
|
|
3056
|
+
}), children);
|
|
3057
|
+
});
|
|
3058
|
+
Flexbox.className = CLASSNAME$8;
|
|
3059
|
+
Flexbox.defaultProps = DEFAULT_PROPS$7;
|
|
3060
|
+
Flexbox.displayName = COMPONENT_NAME$8;
|
|
3061
|
+
|
|
3062
|
+
/**
|
|
3063
|
+
* Component variant.
|
|
3064
|
+
*/
|
|
3065
|
+
const TextVariant = {
|
|
3066
|
+
subtitle: 'subtitle',
|
|
3067
|
+
body: 'body',
|
|
3068
|
+
body2: 'body2',
|
|
3069
|
+
button: 'button',
|
|
3070
|
+
caption: 'caption',
|
|
3071
|
+
inherit: 'inherit'
|
|
3072
|
+
};
|
|
3073
|
+
const TextComponent = {
|
|
3074
|
+
p: 'p',
|
|
3075
|
+
b: 'b',
|
|
3076
|
+
i: 'i',
|
|
3077
|
+
u: 'u',
|
|
3078
|
+
abbr: 'abbr',
|
|
3079
|
+
cite: 'cite',
|
|
3080
|
+
del: 'del',
|
|
3081
|
+
em: 'em',
|
|
3082
|
+
ins: 'ins',
|
|
3083
|
+
kbd: 'kbd',
|
|
3084
|
+
mark: 'mark',
|
|
3085
|
+
s: 's',
|
|
3086
|
+
samp: 'samp',
|
|
3087
|
+
sub: 'sub',
|
|
3088
|
+
sup: 'sup'
|
|
3089
|
+
};
|
|
3090
|
+
|
|
3091
|
+
/**
|
|
3092
|
+
* Component style.
|
|
3093
|
+
*/
|
|
3094
|
+
const StyledText = styled.span`
|
|
3095
|
+
${baseStyling}
|
|
3096
|
+
|
|
3097
|
+
${_ref => {
|
|
3098
|
+
let {
|
|
3099
|
+
$color
|
|
3100
|
+
} = _ref;
|
|
3101
|
+
return $color && [...Object.keys(ColorPalette), ...Object.keys(ProductColorPalette)].indexOf($color) !== -1 ? css`
|
|
3102
|
+
color: var(--redsift-color-${$color}-primary);
|
|
3103
|
+
` : Object.keys(NeutralColorPalette).indexOf($color) !== -1 ? css`
|
|
3104
|
+
color: var(--redsift-color-neutral-${$color});
|
|
3105
|
+
` : css`
|
|
3106
|
+
color: ${$color || css`inherit`};
|
|
3107
|
+
`;
|
|
3108
|
+
}}
|
|
3109
|
+
|
|
3110
|
+
${_ref2 => {
|
|
3111
|
+
let {
|
|
3112
|
+
$as
|
|
3113
|
+
} = _ref2;
|
|
3114
|
+
return css`
|
|
3115
|
+
${$as === TextComponent.i || $as === TextComponent.cite || $as === TextComponent.em ? css`
|
|
3116
|
+
font-style: italic;
|
|
3117
|
+
` : $as === TextComponent.sub ? css`
|
|
3118
|
+
vertical-align: sub;
|
|
3119
|
+
` : $as === TextComponent.sup ? css`
|
|
3120
|
+
vertical-align: super;
|
|
3121
|
+
` : ''}
|
|
3122
|
+
`;
|
|
3123
|
+
}}
|
|
3124
|
+
|
|
3125
|
+
${_ref3 => {
|
|
3126
|
+
let {
|
|
3127
|
+
$as,
|
|
3128
|
+
$fontFamily,
|
|
3129
|
+
$fontSize,
|
|
3130
|
+
$lineHeight,
|
|
3131
|
+
$variant
|
|
3132
|
+
} = _ref3;
|
|
3133
|
+
return !$variant ? css`
|
|
3134
|
+
${$fontFamily ? css`
|
|
3135
|
+
font-family: var(
|
|
3136
|
+
--redsift-typography-font-family-${$fontFamily}
|
|
3137
|
+
);
|
|
3138
|
+
` : ''}
|
|
3139
|
+
${$fontSize ? css`
|
|
3140
|
+
font-size: ${$fontSize};
|
|
3141
|
+
` : ''}
|
|
3142
|
+
${$lineHeight ? css`
|
|
3143
|
+
line-height: ${$lineHeight};
|
|
3144
|
+
` : ''}
|
|
3145
|
+
${$as === TextComponent.b ? css`
|
|
3146
|
+
font-weight: var(--redsift-typography-font-weight-bold);
|
|
3147
|
+
` : $as === TextComponent.sup || $as === TextComponent.sub ? css`
|
|
3148
|
+
font-size: ${$fontSize ? $fontSize : '12px'};
|
|
3149
|
+
` : ''}
|
|
3150
|
+
` : $variant === TextVariant.inherit ? css`
|
|
3151
|
+
font-family: ${$fontFamily ? css`var(--redsift-typography-font-family-${$fontFamily})` : css`inherit`};
|
|
3152
|
+
font-size: ${$fontSize ? $fontSize : $as === TextComponent.sup || $as === TextComponent.sub ? '12px' : css`inherit`};
|
|
3153
|
+
font-weight: ${$as === TextComponent.b ? 'var(--redsift-typography-font-weight-bold)' : 'inherit'};
|
|
3154
|
+
line-height: ${$lineHeight ? $lineHeight : css`inherit`};
|
|
3155
|
+
text-transform: inherit;
|
|
3156
|
+
` : css`
|
|
3157
|
+
font-family: ${$fontFamily ? css`var(--redsift-typography-font-family-${$fontFamily})` : css`var(--redsift-typography-${$variant}-font-family)`};
|
|
3158
|
+
font-size: ${$fontSize ? $fontSize : css`var(--redsift-typography-${$variant}-font-size)`};
|
|
3159
|
+
font-weight: var(--redsift-typography-${$variant}-font-weight);
|
|
3160
|
+
line-height: ${$lineHeight ? $lineHeight : css`var(--redsift-typography-${$variant}-line-height)`};
|
|
3161
|
+
text-transform: var(--redsift-typography-${$variant}-text-transform);
|
|
3162
|
+
`;
|
|
3163
|
+
}}
|
|
3164
|
+
|
|
3165
|
+
${_ref4 => {
|
|
3166
|
+
let {
|
|
3167
|
+
$noWrap
|
|
3168
|
+
} = _ref4;
|
|
3169
|
+
return $noWrap ? css`
|
|
3170
|
+
overflow: hidden;
|
|
3171
|
+
text-overflow: ellipsis;
|
|
3172
|
+
white-space: nowrap;
|
|
3173
|
+
` : css`
|
|
3174
|
+
word-break: break-word;
|
|
3175
|
+
`;
|
|
3176
|
+
}}
|
|
3177
|
+
`;
|
|
3178
|
+
|
|
3179
|
+
const _excluded$7 = ["as", "children", "className", "color", "fontFamily", "fontSize", "lineHeight", "noWrap", "variant"];
|
|
3180
|
+
const COMPONENT_NAME$7 = 'Text';
|
|
3181
|
+
const CLASSNAME$7 = 'redsift-text';
|
|
3182
|
+
const DEFAULT_PROPS$6 = {
|
|
3183
|
+
fontFamily: FontFamily.raleway
|
|
3184
|
+
};
|
|
3185
|
+
|
|
3186
|
+
/**
|
|
3187
|
+
* The Text component.
|
|
3188
|
+
*/
|
|
3189
|
+
const Text = /*#__PURE__*/forwardRef((props, ref) => {
|
|
3190
|
+
const {
|
|
3191
|
+
as,
|
|
3192
|
+
children,
|
|
3193
|
+
className,
|
|
3194
|
+
color,
|
|
3195
|
+
fontFamily,
|
|
3196
|
+
fontSize,
|
|
3197
|
+
lineHeight,
|
|
3198
|
+
noWrap,
|
|
3199
|
+
variant
|
|
3200
|
+
} = props,
|
|
3201
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$7);
|
|
3202
|
+
return /*#__PURE__*/React.createElement(StyledText, _extends({
|
|
3203
|
+
as: as
|
|
3204
|
+
}, forwardedProps, {
|
|
3205
|
+
className: classNames(Text.className, className),
|
|
3206
|
+
ref: ref,
|
|
3207
|
+
$as: as,
|
|
3208
|
+
$color: color,
|
|
3209
|
+
$fontFamily: fontFamily,
|
|
3210
|
+
$fontSize: fontSize,
|
|
3211
|
+
$lineHeight: lineHeight,
|
|
3212
|
+
$noWrap: noWrap,
|
|
3213
|
+
$variant: variant
|
|
3214
|
+
}), children);
|
|
3215
|
+
});
|
|
3216
|
+
Text.className = CLASSNAME$7;
|
|
3217
|
+
Text.defaultProps = DEFAULT_PROPS$6;
|
|
3218
|
+
Text.displayName = COMPONENT_NAME$7;
|
|
3219
|
+
|
|
3220
|
+
/**
|
|
3221
|
+
* Component style.
|
|
3222
|
+
*/
|
|
3223
|
+
const StyledNumber = styled(StyledText)`
|
|
3224
|
+
font-family: var(--redsift-typography-font-family-source-code-pro);
|
|
3225
|
+
`;
|
|
3226
|
+
|
|
3227
|
+
const _excluded$6 = ["as", "className", "color", "compactDisplay", "currency", "currencyDisplay", "currencySign", "fontSize", "lineHeight", "localeMatcher", "maximumFractionDigits", "maximumSignificantDigits", "minimumFractionDigits", "minimumIntegerDigits", "minimumSignificantDigits", "notation", "noWrap", "numberingSystem", "roundingIncrement", "roundingMode", "roundingPriority", "signDisplay", "trailingZeroDisplay", "type", "unit", "unitDisplay", "useGrouping", "value", "variant"];
|
|
3228
|
+
const COMPONENT_NAME$6 = 'Number';
|
|
3229
|
+
const CLASSNAME$6 = 'redsift-number';
|
|
3230
|
+
const DEFAULT_PROPS$5 = {
|
|
3231
|
+
compactDisplay: 'short',
|
|
3232
|
+
currencyDisplay: 'symbol',
|
|
3233
|
+
currencySign: 'standard',
|
|
3234
|
+
localeMatcher: 'best fit',
|
|
3235
|
+
notation: 'standard',
|
|
3236
|
+
signDisplay: 'auto',
|
|
3237
|
+
type: 'decimal',
|
|
3238
|
+
unitDisplay: 'short',
|
|
3239
|
+
roundingMode: 'halfExpand',
|
|
3240
|
+
roundingPriority: 'auto',
|
|
3241
|
+
trailingZeroDisplay: 'auto'
|
|
3242
|
+
};
|
|
3243
|
+
|
|
3244
|
+
/**
|
|
3245
|
+
* The Number component.
|
|
3246
|
+
*/
|
|
3247
|
+
const Number$1 = /*#__PURE__*/forwardRef((props, ref) => {
|
|
3248
|
+
const {
|
|
3249
|
+
as,
|
|
3250
|
+
className,
|
|
3251
|
+
color,
|
|
3252
|
+
compactDisplay,
|
|
3253
|
+
currency,
|
|
3254
|
+
currencyDisplay,
|
|
3255
|
+
currencySign,
|
|
3256
|
+
fontSize,
|
|
3257
|
+
lineHeight,
|
|
3258
|
+
localeMatcher,
|
|
3259
|
+
maximumFractionDigits,
|
|
3260
|
+
maximumSignificantDigits,
|
|
3261
|
+
minimumFractionDigits,
|
|
3262
|
+
minimumIntegerDigits,
|
|
3263
|
+
minimumSignificantDigits,
|
|
3264
|
+
notation,
|
|
3265
|
+
noWrap,
|
|
3266
|
+
numberingSystem,
|
|
3267
|
+
roundingIncrement,
|
|
3268
|
+
roundingMode,
|
|
3269
|
+
roundingPriority,
|
|
3270
|
+
signDisplay,
|
|
3271
|
+
trailingZeroDisplay,
|
|
3272
|
+
type,
|
|
3273
|
+
unit,
|
|
3274
|
+
unitDisplay,
|
|
3275
|
+
useGrouping,
|
|
3276
|
+
value,
|
|
3277
|
+
variant
|
|
3278
|
+
} = props,
|
|
3279
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$6);
|
|
3280
|
+
const formatter = $a916eb452884faea$export$b7a616150fdb9f44(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
3281
|
+
compactDisplay,
|
|
3282
|
+
currency,
|
|
3283
|
+
currencyDisplay,
|
|
3284
|
+
currencySign,
|
|
3285
|
+
localeMatcher
|
|
3286
|
+
}, maximumFractionDigits !== undefined && {
|
|
3287
|
+
maximumFractionDigits
|
|
3288
|
+
}), maximumSignificantDigits !== undefined && {
|
|
3289
|
+
maximumSignificantDigits
|
|
3290
|
+
}), minimumFractionDigits !== undefined && {
|
|
3291
|
+
minimumFractionDigits
|
|
3292
|
+
}), minimumIntegerDigits !== undefined && {
|
|
3293
|
+
minimumIntegerDigits
|
|
3294
|
+
}), minimumSignificantDigits !== undefined && {
|
|
3295
|
+
minimumSignificantDigits
|
|
3296
|
+
}), {}, {
|
|
3297
|
+
notation,
|
|
3298
|
+
numberingSystem,
|
|
3299
|
+
// @ts-ignore
|
|
3300
|
+
roundingIncrement,
|
|
3301
|
+
// @ts-ignore
|
|
3302
|
+
roundingMode,
|
|
3303
|
+
// @ts-ignore
|
|
3304
|
+
roundingPriority,
|
|
3305
|
+
signDisplay,
|
|
3306
|
+
style: type,
|
|
3307
|
+
// @ts-ignore
|
|
3308
|
+
trailingZeroDisplay,
|
|
3309
|
+
unit,
|
|
3310
|
+
unitDisplay,
|
|
3311
|
+
useGrouping
|
|
3312
|
+
}));
|
|
3313
|
+
return /*#__PURE__*/React.createElement(StyledNumber, _extends({
|
|
3314
|
+
as: as
|
|
3315
|
+
}, forwardedProps, {
|
|
3316
|
+
$as: as,
|
|
3317
|
+
className: classNames(Number$1.className, className),
|
|
3318
|
+
ref: ref,
|
|
3319
|
+
$color: color,
|
|
3320
|
+
$lineHeight: lineHeight,
|
|
3321
|
+
$fontSize: fontSize,
|
|
3322
|
+
$noWrap: noWrap,
|
|
3323
|
+
$variant: variant
|
|
3324
|
+
}), formatter.format(value));
|
|
3325
|
+
});
|
|
3326
|
+
Number$1.className = CLASSNAME$6;
|
|
3327
|
+
Number$1.defaultProps = DEFAULT_PROPS$5;
|
|
3328
|
+
Number$1.displayName = COMPONENT_NAME$6;
|
|
2819
3329
|
|
|
2820
3330
|
/**
|
|
2821
3331
|
* Component style.
|
|
@@ -3023,28 +3533,61 @@ let DashboardReducerActionType;
|
|
|
3023
3533
|
DashboardReducerActionType["ResetFilters"] = "reset-filters";
|
|
3024
3534
|
DashboardReducerActionType["FilterTable"] = "filter-table";
|
|
3025
3535
|
DashboardReducerActionType["FilterTableBatch"] = "filter-table-batch";
|
|
3536
|
+
DashboardReducerActionType["AppendFilterTableBatch"] = "append-filter-table-batch";
|
|
3026
3537
|
})(DashboardReducerActionType || (DashboardReducerActionType = {}));
|
|
3027
3538
|
|
|
3028
|
-
const
|
|
3539
|
+
const areEquals = (tableFilter, actionFilter) => {
|
|
3029
3540
|
return tableFilter.columnField === actionFilter.columnField && tableFilter.operatorValue === actionFilter.operatorValue;
|
|
3030
3541
|
};
|
|
3542
|
+
const addOrUpdateFilter = (oldFilters, newFilter) => {
|
|
3543
|
+
if (oldFilters.find(f => areEquals(f, newFilter))) {
|
|
3544
|
+
return oldFilters.map(f => {
|
|
3545
|
+
if (areEquals(f, newFilter)) {
|
|
3546
|
+
return newFilter;
|
|
3547
|
+
}
|
|
3548
|
+
return f;
|
|
3549
|
+
});
|
|
3550
|
+
} else {
|
|
3551
|
+
return [...oldFilters, newFilter];
|
|
3552
|
+
}
|
|
3553
|
+
};
|
|
3554
|
+
const addOrUpdateFilters = (oldFilters, newFilters) => {
|
|
3555
|
+
let updatedFilters = oldFilters;
|
|
3556
|
+
for (let i = 0; i < newFilters.length; i++) {
|
|
3557
|
+
updatedFilters = addOrUpdateFilter(updatedFilters, newFilters[i]);
|
|
3558
|
+
}
|
|
3559
|
+
return updatedFilters;
|
|
3560
|
+
};
|
|
3561
|
+
const replaceFilters = newFilters => {
|
|
3562
|
+
return Array.isArray(newFilters) ? newFilters : [newFilters];
|
|
3563
|
+
};
|
|
3564
|
+
const removeFilter = (oldFilters, newFilter) => {
|
|
3565
|
+
return oldFilters.filter(f => !areEquals(f, newFilter));
|
|
3566
|
+
};
|
|
3567
|
+
const removeAllFilters = () => {
|
|
3568
|
+
return [];
|
|
3569
|
+
};
|
|
3031
3570
|
const DashboardReducer = (state, action) => {
|
|
3032
3571
|
switch (action.type) {
|
|
3033
3572
|
case DashboardReducerActionType.ResetFilter:
|
|
3034
3573
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
3035
|
-
tableFilters: state.tableFilters
|
|
3574
|
+
tableFilters: removeFilter(state.tableFilters, action.filter)
|
|
3036
3575
|
});
|
|
3037
3576
|
case DashboardReducerActionType.ResetFilters:
|
|
3038
3577
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
3039
|
-
tableFilters:
|
|
3578
|
+
tableFilters: removeAllFilters()
|
|
3040
3579
|
});
|
|
3041
3580
|
case DashboardReducerActionType.FilterTable:
|
|
3042
3581
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
3043
|
-
tableFilters:
|
|
3582
|
+
tableFilters: addOrUpdateFilter(state.tableFilters, action.filter)
|
|
3044
3583
|
});
|
|
3045
3584
|
case DashboardReducerActionType.FilterTableBatch:
|
|
3046
3585
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
3047
|
-
tableFilters: action.filter
|
|
3586
|
+
tableFilters: replaceFilters(action.filter)
|
|
3587
|
+
});
|
|
3588
|
+
case DashboardReducerActionType.AppendFilterTableBatch:
|
|
3589
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
3590
|
+
tableFilters: addOrUpdateFilters(state.tableFilters, action.filter)
|
|
3048
3591
|
});
|
|
3049
3592
|
}
|
|
3050
3593
|
};
|
|
@@ -3336,7 +3879,7 @@ const useChartAsListbox = _ref => {
|
|
|
3336
3879
|
chartRef.addEventListener('keydown', keydown);
|
|
3337
3880
|
});
|
|
3338
3881
|
chart.on('renderlet', () => {
|
|
3339
|
-
// Add role and aria attributes to
|
|
3882
|
+
// Add role and aria attributes to each option.
|
|
3340
3883
|
chart.selectAll(`${querySelector} > title`).attr('id', (_, index) => `id${id}__option-${index}-title`);
|
|
3341
3884
|
chart.selectAll(`${querySelector} > text`).attr('aria-hidden', 'true');
|
|
3342
3885
|
|
|
@@ -3557,7 +4100,8 @@ const HorizontalBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3557
4100
|
className: classNames(HorizontalBarChart.className, className),
|
|
3558
4101
|
ref: containerRef
|
|
3559
4102
|
}), /*#__PURE__*/React.createElement(StyledHorizontalBarChartTitle, {
|
|
3560
|
-
className: `${HorizontalBarChart.className}__title
|
|
4103
|
+
className: `${HorizontalBarChart.className}__title`,
|
|
4104
|
+
alignItems: "center"
|
|
3561
4105
|
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
3562
4106
|
id: `id${id}__title`
|
|
3563
4107
|
}, title) : null, chart && isResetable ? /*#__PURE__*/React.createElement(Button, {
|
|
@@ -3569,7 +4113,9 @@ const HorizontalBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3569
4113
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({
|
|
3570
4114
|
type: DashboardReducerActionType.ResetFilter,
|
|
3571
4115
|
filter: {
|
|
3572
|
-
id: chart.anchorName()
|
|
4116
|
+
id: chart.anchorName(),
|
|
4117
|
+
columnField: datagridFilter.field,
|
|
4118
|
+
operatorValue: datagridFilter.operator
|
|
3573
4119
|
}
|
|
3574
4120
|
});
|
|
3575
4121
|
}
|
|
@@ -3782,7 +4328,7 @@ const PdfTableRow = _ref => {
|
|
|
3782
4328
|
marginRight: 7
|
|
3783
4329
|
},
|
|
3784
4330
|
key: `cell-${rowIndex}-${index}`
|
|
3785
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
4331
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
3786
4332
|
style: styles.tableCellText
|
|
3787
4333
|
}, '-'));
|
|
3788
4334
|
}
|
|
@@ -3793,7 +4339,7 @@ const PdfTableRow = _ref => {
|
|
|
3793
4339
|
marginRight: 7
|
|
3794
4340
|
},
|
|
3795
4341
|
key: `cell-${rowIndex}-${index}`
|
|
3796
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
4342
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
3797
4343
|
style: styles.tableCellText
|
|
3798
4344
|
}, Array.isArray(rowData[field]) ? rowData[field].join(', ') : rowData[field]));
|
|
3799
4345
|
}));
|
|
@@ -3834,7 +4380,7 @@ const PdfTable = _ref2 => {
|
|
|
3834
4380
|
marginRight: 7
|
|
3835
4381
|
},
|
|
3836
4382
|
key: `heading-${field}`
|
|
3837
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
4383
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
3838
4384
|
style: styles.tableCellHeaderText
|
|
3839
4385
|
}, headerName));
|
|
3840
4386
|
})), /*#__PURE__*/React.createElement(View, null, data.map((row, index) => {
|
|
@@ -3850,7 +4396,7 @@ const PdfTable = _ref2 => {
|
|
|
3850
4396
|
}
|
|
3851
4397
|
})), data.length >= 1000 ? /*#__PURE__*/React.createElement(View, {
|
|
3852
4398
|
style: styles.constraintsContainer
|
|
3853
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
4399
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
3854
4400
|
style: styles.constraints
|
|
3855
4401
|
}, (localeText === null || localeText === void 0 ? void 0 : localeText.maxSizeDisclaimer) || 'Due to processing constraints this pdf is limited to the first 1000 rows of data.')) : null);
|
|
3856
4402
|
};
|
|
@@ -3858,7 +4404,7 @@ const Pagination = _ref3 => {
|
|
|
3858
4404
|
let {
|
|
3859
4405
|
styles
|
|
3860
4406
|
} = _ref3;
|
|
3861
|
-
return /*#__PURE__*/React.createElement(Text, {
|
|
4407
|
+
return /*#__PURE__*/React.createElement(Text$1, {
|
|
3862
4408
|
style: styles.pageNumber,
|
|
3863
4409
|
render: _ref4 => {
|
|
3864
4410
|
let {
|
|
@@ -3890,7 +4436,7 @@ const PdfDocument = _ref5 => {
|
|
|
3890
4436
|
style: styles.logo
|
|
3891
4437
|
})) : null, introduction ? /*#__PURE__*/React.createElement(View, {
|
|
3892
4438
|
style: styles.introductionContainer
|
|
3893
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
4439
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
3894
4440
|
style: styles.introductionText
|
|
3895
4441
|
}, introduction)) : null, dashboardImage ? /*#__PURE__*/React.createElement(View, {
|
|
3896
4442
|
style: styles.dashboardImageContainer
|
|
@@ -4004,3076 +4550,55 @@ const PdfExportButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4004
4550
|
PdfExportButton.className = CLASSNAME$2;
|
|
4005
4551
|
PdfExportButton.displayName = COMPONENT_NAME$2;
|
|
4006
4552
|
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
}
|
|
4015
|
-
} else {
|
|
4016
|
-
let index = -1;
|
|
4017
|
-
for (let value of values) {
|
|
4018
|
-
if (value = +valueof(value, ++index, values)) {
|
|
4019
|
-
sum += value;
|
|
4020
|
-
}
|
|
4021
|
-
}
|
|
4022
|
-
}
|
|
4023
|
-
return sum;
|
|
4024
|
-
}
|
|
4553
|
+
/**
|
|
4554
|
+
* Component style.
|
|
4555
|
+
*/
|
|
4556
|
+
const StyledPieChart = styled.div`
|
|
4557
|
+
margin: 8px;
|
|
4558
|
+
padding: 8px;
|
|
4559
|
+
color: var(--redsift-color-neutral-black);
|
|
4025
4560
|
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4561
|
+
.redsift-piechart__title {
|
|
4562
|
+
display: flex;
|
|
4563
|
+
flex-direction: row;
|
|
4564
|
+
align-items: center;
|
|
4565
|
+
gap: 16px;
|
|
4566
|
+
}
|
|
4029
4567
|
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4568
|
+
${_ref => {
|
|
4569
|
+
let {
|
|
4570
|
+
$showLabels
|
|
4571
|
+
} = _ref;
|
|
4572
|
+
return !$showLabels ? css`
|
|
4573
|
+
g.pie-label-group text {
|
|
4574
|
+
display: none;
|
|
4575
|
+
}
|
|
4576
|
+
` : '';
|
|
4577
|
+
}}
|
|
4037
4578
|
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
// can test whether the search value is (self-) comparable. We can’t do this
|
|
4043
|
-
// for a comparator (except for specific, known comparators) because we can’t
|
|
4044
|
-
// tell if the comparator is symmetric, and an asymmetric comparator can’t be
|
|
4045
|
-
// used to test whether a single value is comparable.
|
|
4046
|
-
if (f.length !== 2) {
|
|
4047
|
-
compare1 = ascending;
|
|
4048
|
-
compare2 = (d, x) => ascending(f(d), x);
|
|
4049
|
-
delta = (d, x) => f(d) - x;
|
|
4050
|
-
} else {
|
|
4051
|
-
compare1 = f === ascending || f === descending ? f : zero$1;
|
|
4052
|
-
compare2 = f;
|
|
4053
|
-
delta = f;
|
|
4054
|
-
}
|
|
4579
|
+
g.pie-slice {
|
|
4580
|
+
text {
|
|
4581
|
+
cursor: pointer;
|
|
4582
|
+
}
|
|
4055
4583
|
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4584
|
+
path {
|
|
4585
|
+
cursor: pointer;
|
|
4586
|
+
${_ref2 => {
|
|
4587
|
+
let {
|
|
4588
|
+
$spaced
|
|
4589
|
+
} = _ref2;
|
|
4590
|
+
return $spaced ? css`
|
|
4591
|
+
stroke-width: 2px;
|
|
4592
|
+
stroke: #fff;
|
|
4593
|
+
` : '';
|
|
4594
|
+
}}
|
|
4064
4595
|
}
|
|
4065
|
-
return lo;
|
|
4066
4596
|
}
|
|
4067
4597
|
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
const mid = (lo + hi) >>> 1;
|
|
4073
|
-
if (compare2(a[mid], x) <= 0) lo = mid + 1;
|
|
4074
|
-
else hi = mid;
|
|
4075
|
-
} while (lo < hi);
|
|
4076
|
-
}
|
|
4077
|
-
return lo;
|
|
4078
|
-
}
|
|
4079
|
-
|
|
4080
|
-
function center(a, x, lo = 0, hi = a.length) {
|
|
4081
|
-
const i = left(a, x, lo, hi - 1);
|
|
4082
|
-
return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
|
|
4083
|
-
}
|
|
4084
|
-
|
|
4085
|
-
return {left, center, right};
|
|
4086
|
-
}
|
|
4087
|
-
|
|
4088
|
-
function zero$1() {
|
|
4089
|
-
return 0;
|
|
4090
|
-
}
|
|
4091
|
-
|
|
4092
|
-
function number$2(x) {
|
|
4093
|
-
return x === null ? NaN : +x;
|
|
4094
|
-
}
|
|
4095
|
-
|
|
4096
|
-
const ascendingBisect = bisector(ascending);
|
|
4097
|
-
const bisectRight = ascendingBisect.right;
|
|
4098
|
-
bisector(number$2).center;
|
|
4099
|
-
var bisect = bisectRight;
|
|
4100
|
-
|
|
4101
|
-
var e10 = Math.sqrt(50),
|
|
4102
|
-
e5 = Math.sqrt(10),
|
|
4103
|
-
e2 = Math.sqrt(2);
|
|
4104
|
-
|
|
4105
|
-
function tickStep(start, stop, count) {
|
|
4106
|
-
var step0 = Math.abs(stop - start) / Math.max(0, count),
|
|
4107
|
-
step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),
|
|
4108
|
-
error = step0 / step1;
|
|
4109
|
-
if (error >= e10) step1 *= 10;
|
|
4110
|
-
else if (error >= e5) step1 *= 5;
|
|
4111
|
-
else if (error >= e2) step1 *= 2;
|
|
4112
|
-
return stop < start ? -step1 : step1;
|
|
4113
|
-
}
|
|
4114
|
-
|
|
4115
|
-
function initRange(domain, range) {
|
|
4116
|
-
switch (arguments.length) {
|
|
4117
|
-
case 0: break;
|
|
4118
|
-
case 1: this.range(domain); break;
|
|
4119
|
-
default: this.range(range).domain(domain); break;
|
|
4120
|
-
}
|
|
4121
|
-
return this;
|
|
4122
|
-
}
|
|
4123
|
-
|
|
4124
|
-
function define(constructor, factory, prototype) {
|
|
4125
|
-
constructor.prototype = factory.prototype = prototype;
|
|
4126
|
-
prototype.constructor = constructor;
|
|
4127
|
-
}
|
|
4128
|
-
|
|
4129
|
-
function extend(parent, definition) {
|
|
4130
|
-
var prototype = Object.create(parent.prototype);
|
|
4131
|
-
for (var key in definition) prototype[key] = definition[key];
|
|
4132
|
-
return prototype;
|
|
4133
|
-
}
|
|
4134
|
-
|
|
4135
|
-
function Color() {}
|
|
4136
|
-
|
|
4137
|
-
var darker = 0.7;
|
|
4138
|
-
var brighter = 1 / darker;
|
|
4139
|
-
|
|
4140
|
-
var reI = "\\s*([+-]?\\d+)\\s*",
|
|
4141
|
-
reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
4142
|
-
reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
4143
|
-
reHex = /^#([0-9a-f]{3,8})$/,
|
|
4144
|
-
reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`),
|
|
4145
|
-
reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`),
|
|
4146
|
-
reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`),
|
|
4147
|
-
reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`),
|
|
4148
|
-
reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`),
|
|
4149
|
-
reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
|
|
4150
|
-
|
|
4151
|
-
var named = {
|
|
4152
|
-
aliceblue: 0xf0f8ff,
|
|
4153
|
-
antiquewhite: 0xfaebd7,
|
|
4154
|
-
aqua: 0x00ffff,
|
|
4155
|
-
aquamarine: 0x7fffd4,
|
|
4156
|
-
azure: 0xf0ffff,
|
|
4157
|
-
beige: 0xf5f5dc,
|
|
4158
|
-
bisque: 0xffe4c4,
|
|
4159
|
-
black: 0x000000,
|
|
4160
|
-
blanchedalmond: 0xffebcd,
|
|
4161
|
-
blue: 0x0000ff,
|
|
4162
|
-
blueviolet: 0x8a2be2,
|
|
4163
|
-
brown: 0xa52a2a,
|
|
4164
|
-
burlywood: 0xdeb887,
|
|
4165
|
-
cadetblue: 0x5f9ea0,
|
|
4166
|
-
chartreuse: 0x7fff00,
|
|
4167
|
-
chocolate: 0xd2691e,
|
|
4168
|
-
coral: 0xff7f50,
|
|
4169
|
-
cornflowerblue: 0x6495ed,
|
|
4170
|
-
cornsilk: 0xfff8dc,
|
|
4171
|
-
crimson: 0xdc143c,
|
|
4172
|
-
cyan: 0x00ffff,
|
|
4173
|
-
darkblue: 0x00008b,
|
|
4174
|
-
darkcyan: 0x008b8b,
|
|
4175
|
-
darkgoldenrod: 0xb8860b,
|
|
4176
|
-
darkgray: 0xa9a9a9,
|
|
4177
|
-
darkgreen: 0x006400,
|
|
4178
|
-
darkgrey: 0xa9a9a9,
|
|
4179
|
-
darkkhaki: 0xbdb76b,
|
|
4180
|
-
darkmagenta: 0x8b008b,
|
|
4181
|
-
darkolivegreen: 0x556b2f,
|
|
4182
|
-
darkorange: 0xff8c00,
|
|
4183
|
-
darkorchid: 0x9932cc,
|
|
4184
|
-
darkred: 0x8b0000,
|
|
4185
|
-
darksalmon: 0xe9967a,
|
|
4186
|
-
darkseagreen: 0x8fbc8f,
|
|
4187
|
-
darkslateblue: 0x483d8b,
|
|
4188
|
-
darkslategray: 0x2f4f4f,
|
|
4189
|
-
darkslategrey: 0x2f4f4f,
|
|
4190
|
-
darkturquoise: 0x00ced1,
|
|
4191
|
-
darkviolet: 0x9400d3,
|
|
4192
|
-
deeppink: 0xff1493,
|
|
4193
|
-
deepskyblue: 0x00bfff,
|
|
4194
|
-
dimgray: 0x696969,
|
|
4195
|
-
dimgrey: 0x696969,
|
|
4196
|
-
dodgerblue: 0x1e90ff,
|
|
4197
|
-
firebrick: 0xb22222,
|
|
4198
|
-
floralwhite: 0xfffaf0,
|
|
4199
|
-
forestgreen: 0x228b22,
|
|
4200
|
-
fuchsia: 0xff00ff,
|
|
4201
|
-
gainsboro: 0xdcdcdc,
|
|
4202
|
-
ghostwhite: 0xf8f8ff,
|
|
4203
|
-
gold: 0xffd700,
|
|
4204
|
-
goldenrod: 0xdaa520,
|
|
4205
|
-
gray: 0x808080,
|
|
4206
|
-
green: 0x008000,
|
|
4207
|
-
greenyellow: 0xadff2f,
|
|
4208
|
-
grey: 0x808080,
|
|
4209
|
-
honeydew: 0xf0fff0,
|
|
4210
|
-
hotpink: 0xff69b4,
|
|
4211
|
-
indianred: 0xcd5c5c,
|
|
4212
|
-
indigo: 0x4b0082,
|
|
4213
|
-
ivory: 0xfffff0,
|
|
4214
|
-
khaki: 0xf0e68c,
|
|
4215
|
-
lavender: 0xe6e6fa,
|
|
4216
|
-
lavenderblush: 0xfff0f5,
|
|
4217
|
-
lawngreen: 0x7cfc00,
|
|
4218
|
-
lemonchiffon: 0xfffacd,
|
|
4219
|
-
lightblue: 0xadd8e6,
|
|
4220
|
-
lightcoral: 0xf08080,
|
|
4221
|
-
lightcyan: 0xe0ffff,
|
|
4222
|
-
lightgoldenrodyellow: 0xfafad2,
|
|
4223
|
-
lightgray: 0xd3d3d3,
|
|
4224
|
-
lightgreen: 0x90ee90,
|
|
4225
|
-
lightgrey: 0xd3d3d3,
|
|
4226
|
-
lightpink: 0xffb6c1,
|
|
4227
|
-
lightsalmon: 0xffa07a,
|
|
4228
|
-
lightseagreen: 0x20b2aa,
|
|
4229
|
-
lightskyblue: 0x87cefa,
|
|
4230
|
-
lightslategray: 0x778899,
|
|
4231
|
-
lightslategrey: 0x778899,
|
|
4232
|
-
lightsteelblue: 0xb0c4de,
|
|
4233
|
-
lightyellow: 0xffffe0,
|
|
4234
|
-
lime: 0x00ff00,
|
|
4235
|
-
limegreen: 0x32cd32,
|
|
4236
|
-
linen: 0xfaf0e6,
|
|
4237
|
-
magenta: 0xff00ff,
|
|
4238
|
-
maroon: 0x800000,
|
|
4239
|
-
mediumaquamarine: 0x66cdaa,
|
|
4240
|
-
mediumblue: 0x0000cd,
|
|
4241
|
-
mediumorchid: 0xba55d3,
|
|
4242
|
-
mediumpurple: 0x9370db,
|
|
4243
|
-
mediumseagreen: 0x3cb371,
|
|
4244
|
-
mediumslateblue: 0x7b68ee,
|
|
4245
|
-
mediumspringgreen: 0x00fa9a,
|
|
4246
|
-
mediumturquoise: 0x48d1cc,
|
|
4247
|
-
mediumvioletred: 0xc71585,
|
|
4248
|
-
midnightblue: 0x191970,
|
|
4249
|
-
mintcream: 0xf5fffa,
|
|
4250
|
-
mistyrose: 0xffe4e1,
|
|
4251
|
-
moccasin: 0xffe4b5,
|
|
4252
|
-
navajowhite: 0xffdead,
|
|
4253
|
-
navy: 0x000080,
|
|
4254
|
-
oldlace: 0xfdf5e6,
|
|
4255
|
-
olive: 0x808000,
|
|
4256
|
-
olivedrab: 0x6b8e23,
|
|
4257
|
-
orange: 0xffa500,
|
|
4258
|
-
orangered: 0xff4500,
|
|
4259
|
-
orchid: 0xda70d6,
|
|
4260
|
-
palegoldenrod: 0xeee8aa,
|
|
4261
|
-
palegreen: 0x98fb98,
|
|
4262
|
-
paleturquoise: 0xafeeee,
|
|
4263
|
-
palevioletred: 0xdb7093,
|
|
4264
|
-
papayawhip: 0xffefd5,
|
|
4265
|
-
peachpuff: 0xffdab9,
|
|
4266
|
-
peru: 0xcd853f,
|
|
4267
|
-
pink: 0xffc0cb,
|
|
4268
|
-
plum: 0xdda0dd,
|
|
4269
|
-
powderblue: 0xb0e0e6,
|
|
4270
|
-
purple: 0x800080,
|
|
4271
|
-
rebeccapurple: 0x663399,
|
|
4272
|
-
red: 0xff0000,
|
|
4273
|
-
rosybrown: 0xbc8f8f,
|
|
4274
|
-
royalblue: 0x4169e1,
|
|
4275
|
-
saddlebrown: 0x8b4513,
|
|
4276
|
-
salmon: 0xfa8072,
|
|
4277
|
-
sandybrown: 0xf4a460,
|
|
4278
|
-
seagreen: 0x2e8b57,
|
|
4279
|
-
seashell: 0xfff5ee,
|
|
4280
|
-
sienna: 0xa0522d,
|
|
4281
|
-
silver: 0xc0c0c0,
|
|
4282
|
-
skyblue: 0x87ceeb,
|
|
4283
|
-
slateblue: 0x6a5acd,
|
|
4284
|
-
slategray: 0x708090,
|
|
4285
|
-
slategrey: 0x708090,
|
|
4286
|
-
snow: 0xfffafa,
|
|
4287
|
-
springgreen: 0x00ff7f,
|
|
4288
|
-
steelblue: 0x4682b4,
|
|
4289
|
-
tan: 0xd2b48c,
|
|
4290
|
-
teal: 0x008080,
|
|
4291
|
-
thistle: 0xd8bfd8,
|
|
4292
|
-
tomato: 0xff6347,
|
|
4293
|
-
turquoise: 0x40e0d0,
|
|
4294
|
-
violet: 0xee82ee,
|
|
4295
|
-
wheat: 0xf5deb3,
|
|
4296
|
-
white: 0xffffff,
|
|
4297
|
-
whitesmoke: 0xf5f5f5,
|
|
4298
|
-
yellow: 0xffff00,
|
|
4299
|
-
yellowgreen: 0x9acd32
|
|
4300
|
-
};
|
|
4301
|
-
|
|
4302
|
-
define(Color, color, {
|
|
4303
|
-
copy(channels) {
|
|
4304
|
-
return Object.assign(new this.constructor, this, channels);
|
|
4305
|
-
},
|
|
4306
|
-
displayable() {
|
|
4307
|
-
return this.rgb().displayable();
|
|
4308
|
-
},
|
|
4309
|
-
hex: color_formatHex, // Deprecated! Use color.formatHex.
|
|
4310
|
-
formatHex: color_formatHex,
|
|
4311
|
-
formatHex8: color_formatHex8,
|
|
4312
|
-
formatHsl: color_formatHsl,
|
|
4313
|
-
formatRgb: color_formatRgb,
|
|
4314
|
-
toString: color_formatRgb
|
|
4315
|
-
});
|
|
4316
|
-
|
|
4317
|
-
function color_formatHex() {
|
|
4318
|
-
return this.rgb().formatHex();
|
|
4319
|
-
}
|
|
4320
|
-
|
|
4321
|
-
function color_formatHex8() {
|
|
4322
|
-
return this.rgb().formatHex8();
|
|
4323
|
-
}
|
|
4324
|
-
|
|
4325
|
-
function color_formatHsl() {
|
|
4326
|
-
return hslConvert(this).formatHsl();
|
|
4327
|
-
}
|
|
4328
|
-
|
|
4329
|
-
function color_formatRgb() {
|
|
4330
|
-
return this.rgb().formatRgb();
|
|
4331
|
-
}
|
|
4332
|
-
|
|
4333
|
-
function color(format) {
|
|
4334
|
-
var m, l;
|
|
4335
|
-
format = (format + "").trim().toLowerCase();
|
|
4336
|
-
return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
|
|
4337
|
-
: l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
|
|
4338
|
-
: l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
|
|
4339
|
-
: l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
|
|
4340
|
-
: null) // invalid hex
|
|
4341
|
-
: (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
|
|
4342
|
-
: (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
|
|
4343
|
-
: (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
|
|
4344
|
-
: (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
|
|
4345
|
-
: (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
|
|
4346
|
-
: (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
|
|
4347
|
-
: named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
|
|
4348
|
-
: format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
|
|
4349
|
-
: null;
|
|
4350
|
-
}
|
|
4351
|
-
|
|
4352
|
-
function rgbn(n) {
|
|
4353
|
-
return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
|
|
4354
|
-
}
|
|
4355
|
-
|
|
4356
|
-
function rgba(r, g, b, a) {
|
|
4357
|
-
if (a <= 0) r = g = b = NaN;
|
|
4358
|
-
return new Rgb(r, g, b, a);
|
|
4359
|
-
}
|
|
4360
|
-
|
|
4361
|
-
function rgbConvert(o) {
|
|
4362
|
-
if (!(o instanceof Color)) o = color(o);
|
|
4363
|
-
if (!o) return new Rgb;
|
|
4364
|
-
o = o.rgb();
|
|
4365
|
-
return new Rgb(o.r, o.g, o.b, o.opacity);
|
|
4366
|
-
}
|
|
4367
|
-
|
|
4368
|
-
function rgb$1(r, g, b, opacity) {
|
|
4369
|
-
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
|
4370
|
-
}
|
|
4371
|
-
|
|
4372
|
-
function Rgb(r, g, b, opacity) {
|
|
4373
|
-
this.r = +r;
|
|
4374
|
-
this.g = +g;
|
|
4375
|
-
this.b = +b;
|
|
4376
|
-
this.opacity = +opacity;
|
|
4377
|
-
}
|
|
4378
|
-
|
|
4379
|
-
define(Rgb, rgb$1, extend(Color, {
|
|
4380
|
-
brighter(k) {
|
|
4381
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
4382
|
-
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
4383
|
-
},
|
|
4384
|
-
darker(k) {
|
|
4385
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
4386
|
-
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
4387
|
-
},
|
|
4388
|
-
rgb() {
|
|
4389
|
-
return this;
|
|
4390
|
-
},
|
|
4391
|
-
clamp() {
|
|
4392
|
-
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
4393
|
-
},
|
|
4394
|
-
displayable() {
|
|
4395
|
-
return (-0.5 <= this.r && this.r < 255.5)
|
|
4396
|
-
&& (-0.5 <= this.g && this.g < 255.5)
|
|
4397
|
-
&& (-0.5 <= this.b && this.b < 255.5)
|
|
4398
|
-
&& (0 <= this.opacity && this.opacity <= 1);
|
|
4399
|
-
},
|
|
4400
|
-
hex: rgb_formatHex, // Deprecated! Use color.formatHex.
|
|
4401
|
-
formatHex: rgb_formatHex,
|
|
4402
|
-
formatHex8: rgb_formatHex8,
|
|
4403
|
-
formatRgb: rgb_formatRgb,
|
|
4404
|
-
toString: rgb_formatRgb
|
|
4405
|
-
}));
|
|
4406
|
-
|
|
4407
|
-
function rgb_formatHex() {
|
|
4408
|
-
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
|
|
4409
|
-
}
|
|
4410
|
-
|
|
4411
|
-
function rgb_formatHex8() {
|
|
4412
|
-
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
4413
|
-
}
|
|
4414
|
-
|
|
4415
|
-
function rgb_formatRgb() {
|
|
4416
|
-
const a = clampa(this.opacity);
|
|
4417
|
-
return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
|
|
4418
|
-
}
|
|
4419
|
-
|
|
4420
|
-
function clampa(opacity) {
|
|
4421
|
-
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
|
4422
|
-
}
|
|
4423
|
-
|
|
4424
|
-
function clampi(value) {
|
|
4425
|
-
return Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
4426
|
-
}
|
|
4427
|
-
|
|
4428
|
-
function hex(value) {
|
|
4429
|
-
value = clampi(value);
|
|
4430
|
-
return (value < 16 ? "0" : "") + value.toString(16);
|
|
4431
|
-
}
|
|
4432
|
-
|
|
4433
|
-
function hsla(h, s, l, a) {
|
|
4434
|
-
if (a <= 0) h = s = l = NaN;
|
|
4435
|
-
else if (l <= 0 || l >= 1) h = s = NaN;
|
|
4436
|
-
else if (s <= 0) h = NaN;
|
|
4437
|
-
return new Hsl(h, s, l, a);
|
|
4438
|
-
}
|
|
4439
|
-
|
|
4440
|
-
function hslConvert(o) {
|
|
4441
|
-
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
4442
|
-
if (!(o instanceof Color)) o = color(o);
|
|
4443
|
-
if (!o) return new Hsl;
|
|
4444
|
-
if (o instanceof Hsl) return o;
|
|
4445
|
-
o = o.rgb();
|
|
4446
|
-
var r = o.r / 255,
|
|
4447
|
-
g = o.g / 255,
|
|
4448
|
-
b = o.b / 255,
|
|
4449
|
-
min = Math.min(r, g, b),
|
|
4450
|
-
max = Math.max(r, g, b),
|
|
4451
|
-
h = NaN,
|
|
4452
|
-
s = max - min,
|
|
4453
|
-
l = (max + min) / 2;
|
|
4454
|
-
if (s) {
|
|
4455
|
-
if (r === max) h = (g - b) / s + (g < b) * 6;
|
|
4456
|
-
else if (g === max) h = (b - r) / s + 2;
|
|
4457
|
-
else h = (r - g) / s + 4;
|
|
4458
|
-
s /= l < 0.5 ? max + min : 2 - max - min;
|
|
4459
|
-
h *= 60;
|
|
4460
|
-
} else {
|
|
4461
|
-
s = l > 0 && l < 1 ? 0 : h;
|
|
4462
|
-
}
|
|
4463
|
-
return new Hsl(h, s, l, o.opacity);
|
|
4464
|
-
}
|
|
4465
|
-
|
|
4466
|
-
function hsl(h, s, l, opacity) {
|
|
4467
|
-
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
|
4468
|
-
}
|
|
4469
|
-
|
|
4470
|
-
function Hsl(h, s, l, opacity) {
|
|
4471
|
-
this.h = +h;
|
|
4472
|
-
this.s = +s;
|
|
4473
|
-
this.l = +l;
|
|
4474
|
-
this.opacity = +opacity;
|
|
4475
|
-
}
|
|
4476
|
-
|
|
4477
|
-
define(Hsl, hsl, extend(Color, {
|
|
4478
|
-
brighter(k) {
|
|
4479
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
4480
|
-
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
4481
|
-
},
|
|
4482
|
-
darker(k) {
|
|
4483
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
4484
|
-
return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
|
4485
|
-
},
|
|
4486
|
-
rgb() {
|
|
4487
|
-
var h = this.h % 360 + (this.h < 0) * 360,
|
|
4488
|
-
s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
|
|
4489
|
-
l = this.l,
|
|
4490
|
-
m2 = l + (l < 0.5 ? l : 1 - l) * s,
|
|
4491
|
-
m1 = 2 * l - m2;
|
|
4492
|
-
return new Rgb(
|
|
4493
|
-
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
4494
|
-
hsl2rgb(h, m1, m2),
|
|
4495
|
-
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
|
|
4496
|
-
this.opacity
|
|
4497
|
-
);
|
|
4498
|
-
},
|
|
4499
|
-
clamp() {
|
|
4500
|
-
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
4501
|
-
},
|
|
4502
|
-
displayable() {
|
|
4503
|
-
return (0 <= this.s && this.s <= 1 || isNaN(this.s))
|
|
4504
|
-
&& (0 <= this.l && this.l <= 1)
|
|
4505
|
-
&& (0 <= this.opacity && this.opacity <= 1);
|
|
4506
|
-
},
|
|
4507
|
-
formatHsl() {
|
|
4508
|
-
const a = clampa(this.opacity);
|
|
4509
|
-
return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
|
|
4510
|
-
}
|
|
4511
|
-
}));
|
|
4512
|
-
|
|
4513
|
-
function clamph(value) {
|
|
4514
|
-
value = (value || 0) % 360;
|
|
4515
|
-
return value < 0 ? value + 360 : value;
|
|
4516
|
-
}
|
|
4517
|
-
|
|
4518
|
-
function clampt(value) {
|
|
4519
|
-
return Math.max(0, Math.min(1, value || 0));
|
|
4520
|
-
}
|
|
4521
|
-
|
|
4522
|
-
/* From FvD 13.37, CSS Color Module Level 3 */
|
|
4523
|
-
function hsl2rgb(h, m1, m2) {
|
|
4524
|
-
return (h < 60 ? m1 + (m2 - m1) * h / 60
|
|
4525
|
-
: h < 180 ? m2
|
|
4526
|
-
: h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
|
|
4527
|
-
: m1) * 255;
|
|
4528
|
-
}
|
|
4529
|
-
|
|
4530
|
-
var constant = x => () => x;
|
|
4531
|
-
|
|
4532
|
-
function linear(a, d) {
|
|
4533
|
-
return function(t) {
|
|
4534
|
-
return a + t * d;
|
|
4535
|
-
};
|
|
4536
|
-
}
|
|
4537
|
-
|
|
4538
|
-
function exponential(a, b, y) {
|
|
4539
|
-
return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
|
|
4540
|
-
return Math.pow(a + t * b, y);
|
|
4541
|
-
};
|
|
4542
|
-
}
|
|
4543
|
-
|
|
4544
|
-
function gamma(y) {
|
|
4545
|
-
return (y = +y) === 1 ? nogamma : function(a, b) {
|
|
4546
|
-
return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
|
|
4547
|
-
};
|
|
4548
|
-
}
|
|
4549
|
-
|
|
4550
|
-
function nogamma(a, b) {
|
|
4551
|
-
var d = b - a;
|
|
4552
|
-
return d ? linear(a, d) : constant(isNaN(a) ? b : a);
|
|
4553
|
-
}
|
|
4554
|
-
|
|
4555
|
-
var rgb = (function rgbGamma(y) {
|
|
4556
|
-
var color = gamma(y);
|
|
4557
|
-
|
|
4558
|
-
function rgb(start, end) {
|
|
4559
|
-
var r = color((start = rgb$1(start)).r, (end = rgb$1(end)).r),
|
|
4560
|
-
g = color(start.g, end.g),
|
|
4561
|
-
b = color(start.b, end.b),
|
|
4562
|
-
opacity = nogamma(start.opacity, end.opacity);
|
|
4563
|
-
return function(t) {
|
|
4564
|
-
start.r = r(t);
|
|
4565
|
-
start.g = g(t);
|
|
4566
|
-
start.b = b(t);
|
|
4567
|
-
start.opacity = opacity(t);
|
|
4568
|
-
return start + "";
|
|
4569
|
-
};
|
|
4570
|
-
}
|
|
4571
|
-
|
|
4572
|
-
rgb.gamma = rgbGamma;
|
|
4573
|
-
|
|
4574
|
-
return rgb;
|
|
4575
|
-
})(1);
|
|
4576
|
-
|
|
4577
|
-
function numberArray(a, b) {
|
|
4578
|
-
if (!b) b = [];
|
|
4579
|
-
var n = a ? Math.min(b.length, a.length) : 0,
|
|
4580
|
-
c = b.slice(),
|
|
4581
|
-
i;
|
|
4582
|
-
return function(t) {
|
|
4583
|
-
for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
|
|
4584
|
-
return c;
|
|
4585
|
-
};
|
|
4586
|
-
}
|
|
4587
|
-
|
|
4588
|
-
function isNumberArray(x) {
|
|
4589
|
-
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
4590
|
-
}
|
|
4591
|
-
|
|
4592
|
-
function genericArray(a, b) {
|
|
4593
|
-
var nb = b ? b.length : 0,
|
|
4594
|
-
na = a ? Math.min(nb, a.length) : 0,
|
|
4595
|
-
x = new Array(na),
|
|
4596
|
-
c = new Array(nb),
|
|
4597
|
-
i;
|
|
4598
|
-
|
|
4599
|
-
for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
|
|
4600
|
-
for (; i < nb; ++i) c[i] = b[i];
|
|
4601
|
-
|
|
4602
|
-
return function(t) {
|
|
4603
|
-
for (i = 0; i < na; ++i) c[i] = x[i](t);
|
|
4604
|
-
return c;
|
|
4605
|
-
};
|
|
4606
|
-
}
|
|
4607
|
-
|
|
4608
|
-
function date$1(a, b) {
|
|
4609
|
-
var d = new Date;
|
|
4610
|
-
return a = +a, b = +b, function(t) {
|
|
4611
|
-
return d.setTime(a * (1 - t) + b * t), d;
|
|
4612
|
-
};
|
|
4613
|
-
}
|
|
4614
|
-
|
|
4615
|
-
function interpolateNumber(a, b) {
|
|
4616
|
-
return a = +a, b = +b, function(t) {
|
|
4617
|
-
return a * (1 - t) + b * t;
|
|
4618
|
-
};
|
|
4619
|
-
}
|
|
4620
|
-
|
|
4621
|
-
function object(a, b) {
|
|
4622
|
-
var i = {},
|
|
4623
|
-
c = {},
|
|
4624
|
-
k;
|
|
4625
|
-
|
|
4626
|
-
if (a === null || typeof a !== "object") a = {};
|
|
4627
|
-
if (b === null || typeof b !== "object") b = {};
|
|
4628
|
-
|
|
4629
|
-
for (k in b) {
|
|
4630
|
-
if (k in a) {
|
|
4631
|
-
i[k] = interpolate(a[k], b[k]);
|
|
4632
|
-
} else {
|
|
4633
|
-
c[k] = b[k];
|
|
4634
|
-
}
|
|
4635
|
-
}
|
|
4636
|
-
|
|
4637
|
-
return function(t) {
|
|
4638
|
-
for (k in i) c[k] = i[k](t);
|
|
4639
|
-
return c;
|
|
4640
|
-
};
|
|
4641
|
-
}
|
|
4642
|
-
|
|
4643
|
-
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
|
|
4644
|
-
reB = new RegExp(reA.source, "g");
|
|
4645
|
-
|
|
4646
|
-
function zero(b) {
|
|
4647
|
-
return function() {
|
|
4648
|
-
return b;
|
|
4649
|
-
};
|
|
4650
|
-
}
|
|
4651
|
-
|
|
4652
|
-
function one(b) {
|
|
4653
|
-
return function(t) {
|
|
4654
|
-
return b(t) + "";
|
|
4655
|
-
};
|
|
4656
|
-
}
|
|
4657
|
-
|
|
4658
|
-
function string(a, b) {
|
|
4659
|
-
var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
|
|
4660
|
-
am, // current match in a
|
|
4661
|
-
bm, // current match in b
|
|
4662
|
-
bs, // string preceding current number in b, if any
|
|
4663
|
-
i = -1, // index in s
|
|
4664
|
-
s = [], // string constants and placeholders
|
|
4665
|
-
q = []; // number interpolators
|
|
4666
|
-
|
|
4667
|
-
// Coerce inputs to strings.
|
|
4668
|
-
a = a + "", b = b + "";
|
|
4669
|
-
|
|
4670
|
-
// Interpolate pairs of numbers in a & b.
|
|
4671
|
-
while ((am = reA.exec(a))
|
|
4672
|
-
&& (bm = reB.exec(b))) {
|
|
4673
|
-
if ((bs = bm.index) > bi) { // a string precedes the next number in b
|
|
4674
|
-
bs = b.slice(bi, bs);
|
|
4675
|
-
if (s[i]) s[i] += bs; // coalesce with previous string
|
|
4676
|
-
else s[++i] = bs;
|
|
4677
|
-
}
|
|
4678
|
-
if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
|
|
4679
|
-
if (s[i]) s[i] += bm; // coalesce with previous string
|
|
4680
|
-
else s[++i] = bm;
|
|
4681
|
-
} else { // interpolate non-matching numbers
|
|
4682
|
-
s[++i] = null;
|
|
4683
|
-
q.push({i: i, x: interpolateNumber(am, bm)});
|
|
4684
|
-
}
|
|
4685
|
-
bi = reB.lastIndex;
|
|
4686
|
-
}
|
|
4687
|
-
|
|
4688
|
-
// Add remains of b.
|
|
4689
|
-
if (bi < b.length) {
|
|
4690
|
-
bs = b.slice(bi);
|
|
4691
|
-
if (s[i]) s[i] += bs; // coalesce with previous string
|
|
4692
|
-
else s[++i] = bs;
|
|
4693
|
-
}
|
|
4694
|
-
|
|
4695
|
-
// Special optimization for only a single match.
|
|
4696
|
-
// Otherwise, interpolate each of the numbers and rejoin the string.
|
|
4697
|
-
return s.length < 2 ? (q[0]
|
|
4698
|
-
? one(q[0].x)
|
|
4699
|
-
: zero(b))
|
|
4700
|
-
: (b = q.length, function(t) {
|
|
4701
|
-
for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
|
|
4702
|
-
return s.join("");
|
|
4703
|
-
});
|
|
4704
|
-
}
|
|
4705
|
-
|
|
4706
|
-
function interpolate(a, b) {
|
|
4707
|
-
var t = typeof b, c;
|
|
4708
|
-
return b == null || t === "boolean" ? constant(b)
|
|
4709
|
-
: (t === "number" ? interpolateNumber
|
|
4710
|
-
: t === "string" ? ((c = color(b)) ? (b = c, rgb) : string)
|
|
4711
|
-
: b instanceof color ? rgb
|
|
4712
|
-
: b instanceof Date ? date$1
|
|
4713
|
-
: isNumberArray(b) ? numberArray
|
|
4714
|
-
: Array.isArray(b) ? genericArray
|
|
4715
|
-
: typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
|
|
4716
|
-
: interpolateNumber)(a, b);
|
|
4717
|
-
}
|
|
4718
|
-
|
|
4719
|
-
function interpolateRound(a, b) {
|
|
4720
|
-
return a = +a, b = +b, function(t) {
|
|
4721
|
-
return Math.round(a * (1 - t) + b * t);
|
|
4722
|
-
};
|
|
4723
|
-
}
|
|
4724
|
-
|
|
4725
|
-
function constants(x) {
|
|
4726
|
-
return function() {
|
|
4727
|
-
return x;
|
|
4728
|
-
};
|
|
4729
|
-
}
|
|
4730
|
-
|
|
4731
|
-
function number$1(x) {
|
|
4732
|
-
return +x;
|
|
4733
|
-
}
|
|
4734
|
-
|
|
4735
|
-
var unit = [0, 1];
|
|
4736
|
-
|
|
4737
|
-
function identity(x) {
|
|
4738
|
-
return x;
|
|
4739
|
-
}
|
|
4740
|
-
|
|
4741
|
-
function normalize(a, b) {
|
|
4742
|
-
return (b -= (a = +a))
|
|
4743
|
-
? function(x) { return (x - a) / b; }
|
|
4744
|
-
: constants(isNaN(b) ? NaN : 0.5);
|
|
4745
|
-
}
|
|
4746
|
-
|
|
4747
|
-
function clamper(a, b) {
|
|
4748
|
-
var t;
|
|
4749
|
-
if (a > b) t = a, a = b, b = t;
|
|
4750
|
-
return function(x) { return Math.max(a, Math.min(b, x)); };
|
|
4751
|
-
}
|
|
4752
|
-
|
|
4753
|
-
// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
|
|
4754
|
-
// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
|
|
4755
|
-
function bimap(domain, range, interpolate) {
|
|
4756
|
-
var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
|
|
4757
|
-
if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
|
|
4758
|
-
else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
|
|
4759
|
-
return function(x) { return r0(d0(x)); };
|
|
4760
|
-
}
|
|
4761
|
-
|
|
4762
|
-
function polymap(domain, range, interpolate) {
|
|
4763
|
-
var j = Math.min(domain.length, range.length) - 1,
|
|
4764
|
-
d = new Array(j),
|
|
4765
|
-
r = new Array(j),
|
|
4766
|
-
i = -1;
|
|
4767
|
-
|
|
4768
|
-
// Reverse descending domains.
|
|
4769
|
-
if (domain[j] < domain[0]) {
|
|
4770
|
-
domain = domain.slice().reverse();
|
|
4771
|
-
range = range.slice().reverse();
|
|
4772
|
-
}
|
|
4773
|
-
|
|
4774
|
-
while (++i < j) {
|
|
4775
|
-
d[i] = normalize(domain[i], domain[i + 1]);
|
|
4776
|
-
r[i] = interpolate(range[i], range[i + 1]);
|
|
4777
|
-
}
|
|
4778
|
-
|
|
4779
|
-
return function(x) {
|
|
4780
|
-
var i = bisect(domain, x, 1, j) - 1;
|
|
4781
|
-
return r[i](d[i](x));
|
|
4782
|
-
};
|
|
4783
|
-
}
|
|
4784
|
-
|
|
4785
|
-
function copy(source, target) {
|
|
4786
|
-
return target
|
|
4787
|
-
.domain(source.domain())
|
|
4788
|
-
.range(source.range())
|
|
4789
|
-
.interpolate(source.interpolate())
|
|
4790
|
-
.clamp(source.clamp())
|
|
4791
|
-
.unknown(source.unknown());
|
|
4792
|
-
}
|
|
4793
|
-
|
|
4794
|
-
function transformer() {
|
|
4795
|
-
var domain = unit,
|
|
4796
|
-
range = unit,
|
|
4797
|
-
interpolate$1 = interpolate,
|
|
4798
|
-
transform,
|
|
4799
|
-
untransform,
|
|
4800
|
-
unknown,
|
|
4801
|
-
clamp = identity,
|
|
4802
|
-
piecewise,
|
|
4803
|
-
output,
|
|
4804
|
-
input;
|
|
4805
|
-
|
|
4806
|
-
function rescale() {
|
|
4807
|
-
var n = Math.min(domain.length, range.length);
|
|
4808
|
-
if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);
|
|
4809
|
-
piecewise = n > 2 ? polymap : bimap;
|
|
4810
|
-
output = input = null;
|
|
4811
|
-
return scale;
|
|
4812
|
-
}
|
|
4813
|
-
|
|
4814
|
-
function scale(x) {
|
|
4815
|
-
return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
|
|
4816
|
-
}
|
|
4817
|
-
|
|
4818
|
-
scale.invert = function(y) {
|
|
4819
|
-
return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
|
|
4820
|
-
};
|
|
4821
|
-
|
|
4822
|
-
scale.domain = function(_) {
|
|
4823
|
-
return arguments.length ? (domain = Array.from(_, number$1), rescale()) : domain.slice();
|
|
4824
|
-
};
|
|
4825
|
-
|
|
4826
|
-
scale.range = function(_) {
|
|
4827
|
-
return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
|
|
4828
|
-
};
|
|
4829
|
-
|
|
4830
|
-
scale.rangeRound = function(_) {
|
|
4831
|
-
return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
|
|
4832
|
-
};
|
|
4833
|
-
|
|
4834
|
-
scale.clamp = function(_) {
|
|
4835
|
-
return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
|
|
4836
|
-
};
|
|
4837
|
-
|
|
4838
|
-
scale.interpolate = function(_) {
|
|
4839
|
-
return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
|
|
4840
|
-
};
|
|
4841
|
-
|
|
4842
|
-
scale.unknown = function(_) {
|
|
4843
|
-
return arguments.length ? (unknown = _, scale) : unknown;
|
|
4844
|
-
};
|
|
4845
|
-
|
|
4846
|
-
return function(t, u) {
|
|
4847
|
-
transform = t, untransform = u;
|
|
4848
|
-
return rescale();
|
|
4849
|
-
};
|
|
4850
|
-
}
|
|
4851
|
-
|
|
4852
|
-
function continuous() {
|
|
4853
|
-
return transformer()(identity, identity);
|
|
4854
|
-
}
|
|
4855
|
-
|
|
4856
|
-
function nice(domain, interval) {
|
|
4857
|
-
domain = domain.slice();
|
|
4858
|
-
|
|
4859
|
-
var i0 = 0,
|
|
4860
|
-
i1 = domain.length - 1,
|
|
4861
|
-
x0 = domain[i0],
|
|
4862
|
-
x1 = domain[i1],
|
|
4863
|
-
t;
|
|
4864
|
-
|
|
4865
|
-
if (x1 < x0) {
|
|
4866
|
-
t = i0, i0 = i1, i1 = t;
|
|
4867
|
-
t = x0, x0 = x1, x1 = t;
|
|
4868
|
-
}
|
|
4869
|
-
|
|
4870
|
-
domain[i0] = interval.floor(x0);
|
|
4871
|
-
domain[i1] = interval.ceil(x1);
|
|
4872
|
-
return domain;
|
|
4873
|
-
}
|
|
4874
|
-
|
|
4875
|
-
var t0$1 = new Date,
|
|
4876
|
-
t1$1 = new Date;
|
|
4877
|
-
|
|
4878
|
-
function newInterval$1(floori, offseti, count, field) {
|
|
4879
|
-
|
|
4880
|
-
function interval(date) {
|
|
4881
|
-
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
|
4882
|
-
}
|
|
4883
|
-
|
|
4884
|
-
interval.floor = function(date) {
|
|
4885
|
-
return floori(date = new Date(+date)), date;
|
|
4886
|
-
};
|
|
4887
|
-
|
|
4888
|
-
interval.ceil = function(date) {
|
|
4889
|
-
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
|
4890
|
-
};
|
|
4891
|
-
|
|
4892
|
-
interval.round = function(date) {
|
|
4893
|
-
var d0 = interval(date),
|
|
4894
|
-
d1 = interval.ceil(date);
|
|
4895
|
-
return date - d0 < d1 - date ? d0 : d1;
|
|
4896
|
-
};
|
|
4897
|
-
|
|
4898
|
-
interval.offset = function(date, step) {
|
|
4899
|
-
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
|
4900
|
-
};
|
|
4901
|
-
|
|
4902
|
-
interval.range = function(start, stop, step) {
|
|
4903
|
-
var range = [], previous;
|
|
4904
|
-
start = interval.ceil(start);
|
|
4905
|
-
step = step == null ? 1 : Math.floor(step);
|
|
4906
|
-
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
|
4907
|
-
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
|
4908
|
-
while (previous < start && start < stop);
|
|
4909
|
-
return range;
|
|
4910
|
-
};
|
|
4911
|
-
|
|
4912
|
-
interval.filter = function(test) {
|
|
4913
|
-
return newInterval$1(function(date) {
|
|
4914
|
-
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
|
4915
|
-
}, function(date, step) {
|
|
4916
|
-
if (date >= date) {
|
|
4917
|
-
if (step < 0) while (++step <= 0) {
|
|
4918
|
-
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
|
4919
|
-
} else while (--step >= 0) {
|
|
4920
|
-
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
|
|
4921
|
-
}
|
|
4922
|
-
}
|
|
4923
|
-
});
|
|
4924
|
-
};
|
|
4925
|
-
|
|
4926
|
-
if (count) {
|
|
4927
|
-
interval.count = function(start, end) {
|
|
4928
|
-
t0$1.setTime(+start), t1$1.setTime(+end);
|
|
4929
|
-
floori(t0$1), floori(t1$1);
|
|
4930
|
-
return Math.floor(count(t0$1, t1$1));
|
|
4931
|
-
};
|
|
4932
|
-
|
|
4933
|
-
interval.every = function(step) {
|
|
4934
|
-
step = Math.floor(step);
|
|
4935
|
-
return !isFinite(step) || !(step > 0) ? null
|
|
4936
|
-
: !(step > 1) ? interval
|
|
4937
|
-
: interval.filter(field
|
|
4938
|
-
? function(d) { return field(d) % step === 0; }
|
|
4939
|
-
: function(d) { return interval.count(0, d) % step === 0; });
|
|
4940
|
-
};
|
|
4941
|
-
}
|
|
4942
|
-
|
|
4943
|
-
return interval;
|
|
4944
|
-
}
|
|
4945
|
-
|
|
4946
|
-
var millisecond = newInterval$1(function() {
|
|
4947
|
-
// noop
|
|
4948
|
-
}, function(date, step) {
|
|
4949
|
-
date.setTime(+date + step);
|
|
4950
|
-
}, function(start, end) {
|
|
4951
|
-
return end - start;
|
|
4952
|
-
});
|
|
4953
|
-
|
|
4954
|
-
// An optimized implementation for this simple case.
|
|
4955
|
-
millisecond.every = function(k) {
|
|
4956
|
-
k = Math.floor(k);
|
|
4957
|
-
if (!isFinite(k) || !(k > 0)) return null;
|
|
4958
|
-
if (!(k > 1)) return millisecond;
|
|
4959
|
-
return newInterval$1(function(date) {
|
|
4960
|
-
date.setTime(Math.floor(date / k) * k);
|
|
4961
|
-
}, function(date, step) {
|
|
4962
|
-
date.setTime(+date + step * k);
|
|
4963
|
-
}, function(start, end) {
|
|
4964
|
-
return (end - start) / k;
|
|
4965
|
-
});
|
|
4966
|
-
};
|
|
4967
|
-
|
|
4968
|
-
var millisecond$1 = millisecond;
|
|
4969
|
-
millisecond.range;
|
|
4970
|
-
|
|
4971
|
-
const durationSecond$1 = 1000;
|
|
4972
|
-
const durationMinute$1 = durationSecond$1 * 60;
|
|
4973
|
-
const durationHour$1 = durationMinute$1 * 60;
|
|
4974
|
-
const durationDay$1 = durationHour$1 * 24;
|
|
4975
|
-
const durationWeek$1 = durationDay$1 * 7;
|
|
4976
|
-
const durationMonth = durationDay$1 * 30;
|
|
4977
|
-
const durationYear = durationDay$1 * 365;
|
|
4978
|
-
|
|
4979
|
-
var second = newInterval$1(function(date) {
|
|
4980
|
-
date.setTime(date - date.getMilliseconds());
|
|
4981
|
-
}, function(date, step) {
|
|
4982
|
-
date.setTime(+date + step * durationSecond$1);
|
|
4983
|
-
}, function(start, end) {
|
|
4984
|
-
return (end - start) / durationSecond$1;
|
|
4985
|
-
}, function(date) {
|
|
4986
|
-
return date.getUTCSeconds();
|
|
4987
|
-
});
|
|
4988
|
-
|
|
4989
|
-
var utcSecond = second;
|
|
4990
|
-
second.range;
|
|
4991
|
-
|
|
4992
|
-
var minute = newInterval$1(function(date) {
|
|
4993
|
-
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond$1);
|
|
4994
|
-
}, function(date, step) {
|
|
4995
|
-
date.setTime(+date + step * durationMinute$1);
|
|
4996
|
-
}, function(start, end) {
|
|
4997
|
-
return (end - start) / durationMinute$1;
|
|
4998
|
-
}, function(date) {
|
|
4999
|
-
return date.getMinutes();
|
|
5000
|
-
});
|
|
5001
|
-
|
|
5002
|
-
var timeMinute = minute;
|
|
5003
|
-
minute.range;
|
|
5004
|
-
|
|
5005
|
-
var hour$1 = newInterval$1(function(date) {
|
|
5006
|
-
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond$1 - date.getMinutes() * durationMinute$1);
|
|
5007
|
-
}, function(date, step) {
|
|
5008
|
-
date.setTime(+date + step * durationHour$1);
|
|
5009
|
-
}, function(start, end) {
|
|
5010
|
-
return (end - start) / durationHour$1;
|
|
5011
|
-
}, function(date) {
|
|
5012
|
-
return date.getHours();
|
|
5013
|
-
});
|
|
5014
|
-
|
|
5015
|
-
var timeHour = hour$1;
|
|
5016
|
-
hour$1.range;
|
|
5017
|
-
|
|
5018
|
-
var day$1 = newInterval$1(
|
|
5019
|
-
date => date.setHours(0, 0, 0, 0),
|
|
5020
|
-
(date, step) => date.setDate(date.getDate() + step),
|
|
5021
|
-
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute$1) / durationDay$1,
|
|
5022
|
-
date => date.getDate() - 1
|
|
5023
|
-
);
|
|
5024
|
-
|
|
5025
|
-
var timeDay = day$1;
|
|
5026
|
-
day$1.range;
|
|
5027
|
-
|
|
5028
|
-
function weekday$1(i) {
|
|
5029
|
-
return newInterval$1(function(date) {
|
|
5030
|
-
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
5031
|
-
date.setHours(0, 0, 0, 0);
|
|
5032
|
-
}, function(date, step) {
|
|
5033
|
-
date.setDate(date.getDate() + step * 7);
|
|
5034
|
-
}, function(start, end) {
|
|
5035
|
-
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute$1) / durationWeek$1;
|
|
5036
|
-
});
|
|
5037
|
-
}
|
|
5038
|
-
|
|
5039
|
-
var sunday$1 = weekday$1(0);
|
|
5040
|
-
var monday$1 = weekday$1(1);
|
|
5041
|
-
var tuesday$1 = weekday$1(2);
|
|
5042
|
-
var wednesday$1 = weekday$1(3);
|
|
5043
|
-
var thursday$1 = weekday$1(4);
|
|
5044
|
-
var friday$1 = weekday$1(5);
|
|
5045
|
-
var saturday$1 = weekday$1(6);
|
|
5046
|
-
|
|
5047
|
-
sunday$1.range;
|
|
5048
|
-
monday$1.range;
|
|
5049
|
-
tuesday$1.range;
|
|
5050
|
-
wednesday$1.range;
|
|
5051
|
-
thursday$1.range;
|
|
5052
|
-
friday$1.range;
|
|
5053
|
-
saturday$1.range;
|
|
5054
|
-
|
|
5055
|
-
var month$1 = newInterval$1(function(date) {
|
|
5056
|
-
date.setDate(1);
|
|
5057
|
-
date.setHours(0, 0, 0, 0);
|
|
5058
|
-
}, function(date, step) {
|
|
5059
|
-
date.setMonth(date.getMonth() + step);
|
|
5060
|
-
}, function(start, end) {
|
|
5061
|
-
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
|
5062
|
-
}, function(date) {
|
|
5063
|
-
return date.getMonth();
|
|
5064
|
-
});
|
|
5065
|
-
|
|
5066
|
-
var timeMonth = month$1;
|
|
5067
|
-
month$1.range;
|
|
5068
|
-
|
|
5069
|
-
var year$1 = newInterval$1(function(date) {
|
|
5070
|
-
date.setMonth(0, 1);
|
|
5071
|
-
date.setHours(0, 0, 0, 0);
|
|
5072
|
-
}, function(date, step) {
|
|
5073
|
-
date.setFullYear(date.getFullYear() + step);
|
|
5074
|
-
}, function(start, end) {
|
|
5075
|
-
return end.getFullYear() - start.getFullYear();
|
|
5076
|
-
}, function(date) {
|
|
5077
|
-
return date.getFullYear();
|
|
5078
|
-
});
|
|
5079
|
-
|
|
5080
|
-
// An optimized implementation for this simple case.
|
|
5081
|
-
year$1.every = function(k) {
|
|
5082
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval$1(function(date) {
|
|
5083
|
-
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
5084
|
-
date.setMonth(0, 1);
|
|
5085
|
-
date.setHours(0, 0, 0, 0);
|
|
5086
|
-
}, function(date, step) {
|
|
5087
|
-
date.setFullYear(date.getFullYear() + step * k);
|
|
5088
|
-
});
|
|
5089
|
-
};
|
|
5090
|
-
|
|
5091
|
-
var timeYear = year$1;
|
|
5092
|
-
year$1.range;
|
|
5093
|
-
|
|
5094
|
-
var utcMinute = newInterval$1(function(date) {
|
|
5095
|
-
date.setUTCSeconds(0, 0);
|
|
5096
|
-
}, function(date, step) {
|
|
5097
|
-
date.setTime(+date + step * durationMinute$1);
|
|
5098
|
-
}, function(start, end) {
|
|
5099
|
-
return (end - start) / durationMinute$1;
|
|
5100
|
-
}, function(date) {
|
|
5101
|
-
return date.getUTCMinutes();
|
|
5102
|
-
});
|
|
5103
|
-
|
|
5104
|
-
var utcMinute$1 = utcMinute;
|
|
5105
|
-
utcMinute.range;
|
|
5106
|
-
|
|
5107
|
-
var utcHour = newInterval$1(function(date) {
|
|
5108
|
-
date.setUTCMinutes(0, 0, 0);
|
|
5109
|
-
}, function(date, step) {
|
|
5110
|
-
date.setTime(+date + step * durationHour$1);
|
|
5111
|
-
}, function(start, end) {
|
|
5112
|
-
return (end - start) / durationHour$1;
|
|
5113
|
-
}, function(date) {
|
|
5114
|
-
return date.getUTCHours();
|
|
5115
|
-
});
|
|
5116
|
-
|
|
5117
|
-
var utcHour$1 = utcHour;
|
|
5118
|
-
utcHour.range;
|
|
5119
|
-
|
|
5120
|
-
var utcDay$2 = newInterval$1(function(date) {
|
|
5121
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
5122
|
-
}, function(date, step) {
|
|
5123
|
-
date.setUTCDate(date.getUTCDate() + step);
|
|
5124
|
-
}, function(start, end) {
|
|
5125
|
-
return (end - start) / durationDay$1;
|
|
5126
|
-
}, function(date) {
|
|
5127
|
-
return date.getUTCDate() - 1;
|
|
5128
|
-
});
|
|
5129
|
-
|
|
5130
|
-
var utcDay$3 = utcDay$2;
|
|
5131
|
-
utcDay$2.range;
|
|
5132
|
-
|
|
5133
|
-
function utcWeekday$1(i) {
|
|
5134
|
-
return newInterval$1(function(date) {
|
|
5135
|
-
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
|
5136
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
5137
|
-
}, function(date, step) {
|
|
5138
|
-
date.setUTCDate(date.getUTCDate() + step * 7);
|
|
5139
|
-
}, function(start, end) {
|
|
5140
|
-
return (end - start) / durationWeek$1;
|
|
5141
|
-
});
|
|
5142
|
-
}
|
|
5143
|
-
|
|
5144
|
-
var utcSunday$1 = utcWeekday$1(0);
|
|
5145
|
-
var utcMonday$1 = utcWeekday$1(1);
|
|
5146
|
-
var utcTuesday$1 = utcWeekday$1(2);
|
|
5147
|
-
var utcWednesday$1 = utcWeekday$1(3);
|
|
5148
|
-
var utcThursday$1 = utcWeekday$1(4);
|
|
5149
|
-
var utcFriday$1 = utcWeekday$1(5);
|
|
5150
|
-
var utcSaturday$1 = utcWeekday$1(6);
|
|
5151
|
-
|
|
5152
|
-
utcSunday$1.range;
|
|
5153
|
-
utcMonday$1.range;
|
|
5154
|
-
utcTuesday$1.range;
|
|
5155
|
-
utcWednesday$1.range;
|
|
5156
|
-
utcThursday$1.range;
|
|
5157
|
-
utcFriday$1.range;
|
|
5158
|
-
utcSaturday$1.range;
|
|
5159
|
-
|
|
5160
|
-
var utcMonth = newInterval$1(function(date) {
|
|
5161
|
-
date.setUTCDate(1);
|
|
5162
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
5163
|
-
}, function(date, step) {
|
|
5164
|
-
date.setUTCMonth(date.getUTCMonth() + step);
|
|
5165
|
-
}, function(start, end) {
|
|
5166
|
-
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
|
5167
|
-
}, function(date) {
|
|
5168
|
-
return date.getUTCMonth();
|
|
5169
|
-
});
|
|
5170
|
-
|
|
5171
|
-
var utcMonth$1 = utcMonth;
|
|
5172
|
-
utcMonth.range;
|
|
5173
|
-
|
|
5174
|
-
var utcYear$2 = newInterval$1(function(date) {
|
|
5175
|
-
date.setUTCMonth(0, 1);
|
|
5176
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
5177
|
-
}, function(date, step) {
|
|
5178
|
-
date.setUTCFullYear(date.getUTCFullYear() + step);
|
|
5179
|
-
}, function(start, end) {
|
|
5180
|
-
return end.getUTCFullYear() - start.getUTCFullYear();
|
|
5181
|
-
}, function(date) {
|
|
5182
|
-
return date.getUTCFullYear();
|
|
5183
|
-
});
|
|
5184
|
-
|
|
5185
|
-
// An optimized implementation for this simple case.
|
|
5186
|
-
utcYear$2.every = function(k) {
|
|
5187
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval$1(function(date) {
|
|
5188
|
-
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
|
5189
|
-
date.setUTCMonth(0, 1);
|
|
5190
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
5191
|
-
}, function(date, step) {
|
|
5192
|
-
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
|
5193
|
-
});
|
|
5194
|
-
};
|
|
5195
|
-
|
|
5196
|
-
var utcYear$3 = utcYear$2;
|
|
5197
|
-
utcYear$2.range;
|
|
5198
|
-
|
|
5199
|
-
function ticker(year, month, week, day, hour, minute) {
|
|
5200
|
-
|
|
5201
|
-
const tickIntervals = [
|
|
5202
|
-
[utcSecond, 1, durationSecond$1],
|
|
5203
|
-
[utcSecond, 5, 5 * durationSecond$1],
|
|
5204
|
-
[utcSecond, 15, 15 * durationSecond$1],
|
|
5205
|
-
[utcSecond, 30, 30 * durationSecond$1],
|
|
5206
|
-
[minute, 1, durationMinute$1],
|
|
5207
|
-
[minute, 5, 5 * durationMinute$1],
|
|
5208
|
-
[minute, 15, 15 * durationMinute$1],
|
|
5209
|
-
[minute, 30, 30 * durationMinute$1],
|
|
5210
|
-
[ hour, 1, durationHour$1 ],
|
|
5211
|
-
[ hour, 3, 3 * durationHour$1 ],
|
|
5212
|
-
[ hour, 6, 6 * durationHour$1 ],
|
|
5213
|
-
[ hour, 12, 12 * durationHour$1 ],
|
|
5214
|
-
[ day, 1, durationDay$1 ],
|
|
5215
|
-
[ day, 2, 2 * durationDay$1 ],
|
|
5216
|
-
[ week, 1, durationWeek$1 ],
|
|
5217
|
-
[ month, 1, durationMonth ],
|
|
5218
|
-
[ month, 3, 3 * durationMonth ],
|
|
5219
|
-
[ year, 1, durationYear ]
|
|
5220
|
-
];
|
|
5221
|
-
|
|
5222
|
-
function ticks(start, stop, count) {
|
|
5223
|
-
const reverse = stop < start;
|
|
5224
|
-
if (reverse) [start, stop] = [stop, start];
|
|
5225
|
-
const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count);
|
|
5226
|
-
const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop
|
|
5227
|
-
return reverse ? ticks.reverse() : ticks;
|
|
5228
|
-
}
|
|
5229
|
-
|
|
5230
|
-
function tickInterval(start, stop, count) {
|
|
5231
|
-
const target = Math.abs(stop - start) / count;
|
|
5232
|
-
const i = bisector(([,, step]) => step).right(tickIntervals, target);
|
|
5233
|
-
if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));
|
|
5234
|
-
if (i === 0) return millisecond$1.every(Math.max(tickStep(start, stop, count), 1));
|
|
5235
|
-
const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
|
|
5236
|
-
return t.every(step);
|
|
5237
|
-
}
|
|
5238
|
-
|
|
5239
|
-
return [ticks, tickInterval];
|
|
5240
|
-
}
|
|
5241
|
-
|
|
5242
|
-
ticker(utcYear$3, utcMonth$1, utcSunday$1, utcDay$3, utcHour$1, utcMinute$1);
|
|
5243
|
-
const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, sunday$1, timeDay, timeHour, timeMinute);
|
|
5244
|
-
|
|
5245
|
-
function localDate$1(d) {
|
|
5246
|
-
if (0 <= d.y && d.y < 100) {
|
|
5247
|
-
var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
5248
|
-
date.setFullYear(d.y);
|
|
5249
|
-
return date;
|
|
5250
|
-
}
|
|
5251
|
-
return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
5252
|
-
}
|
|
5253
|
-
|
|
5254
|
-
function utcDate$1(d) {
|
|
5255
|
-
if (0 <= d.y && d.y < 100) {
|
|
5256
|
-
var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
5257
|
-
date.setUTCFullYear(d.y);
|
|
5258
|
-
return date;
|
|
5259
|
-
}
|
|
5260
|
-
return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
5261
|
-
}
|
|
5262
|
-
|
|
5263
|
-
function newDate$1(y, m, d) {
|
|
5264
|
-
return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};
|
|
5265
|
-
}
|
|
5266
|
-
|
|
5267
|
-
function formatLocale$1(locale) {
|
|
5268
|
-
var locale_dateTime = locale.dateTime,
|
|
5269
|
-
locale_date = locale.date,
|
|
5270
|
-
locale_time = locale.time,
|
|
5271
|
-
locale_periods = locale.periods,
|
|
5272
|
-
locale_weekdays = locale.days,
|
|
5273
|
-
locale_shortWeekdays = locale.shortDays,
|
|
5274
|
-
locale_months = locale.months,
|
|
5275
|
-
locale_shortMonths = locale.shortMonths;
|
|
5276
|
-
|
|
5277
|
-
var periodRe = formatRe$1(locale_periods),
|
|
5278
|
-
periodLookup = formatLookup$1(locale_periods),
|
|
5279
|
-
weekdayRe = formatRe$1(locale_weekdays),
|
|
5280
|
-
weekdayLookup = formatLookup$1(locale_weekdays),
|
|
5281
|
-
shortWeekdayRe = formatRe$1(locale_shortWeekdays),
|
|
5282
|
-
shortWeekdayLookup = formatLookup$1(locale_shortWeekdays),
|
|
5283
|
-
monthRe = formatRe$1(locale_months),
|
|
5284
|
-
monthLookup = formatLookup$1(locale_months),
|
|
5285
|
-
shortMonthRe = formatRe$1(locale_shortMonths),
|
|
5286
|
-
shortMonthLookup = formatLookup$1(locale_shortMonths);
|
|
5287
|
-
|
|
5288
|
-
var formats = {
|
|
5289
|
-
"a": formatShortWeekday,
|
|
5290
|
-
"A": formatWeekday,
|
|
5291
|
-
"b": formatShortMonth,
|
|
5292
|
-
"B": formatMonth,
|
|
5293
|
-
"c": null,
|
|
5294
|
-
"d": formatDayOfMonth$1,
|
|
5295
|
-
"e": formatDayOfMonth$1,
|
|
5296
|
-
"f": formatMicroseconds$1,
|
|
5297
|
-
"g": formatYearISO$1,
|
|
5298
|
-
"G": formatFullYearISO$1,
|
|
5299
|
-
"H": formatHour24$1,
|
|
5300
|
-
"I": formatHour12$1,
|
|
5301
|
-
"j": formatDayOfYear$1,
|
|
5302
|
-
"L": formatMilliseconds$1,
|
|
5303
|
-
"m": formatMonthNumber$1,
|
|
5304
|
-
"M": formatMinutes$1,
|
|
5305
|
-
"p": formatPeriod,
|
|
5306
|
-
"q": formatQuarter,
|
|
5307
|
-
"Q": formatUnixTimestamp$1,
|
|
5308
|
-
"s": formatUnixTimestampSeconds$1,
|
|
5309
|
-
"S": formatSeconds$1,
|
|
5310
|
-
"u": formatWeekdayNumberMonday$1,
|
|
5311
|
-
"U": formatWeekNumberSunday$1,
|
|
5312
|
-
"V": formatWeekNumberISO$1,
|
|
5313
|
-
"w": formatWeekdayNumberSunday$1,
|
|
5314
|
-
"W": formatWeekNumberMonday$1,
|
|
5315
|
-
"x": null,
|
|
5316
|
-
"X": null,
|
|
5317
|
-
"y": formatYear$1,
|
|
5318
|
-
"Y": formatFullYear$1,
|
|
5319
|
-
"Z": formatZone$1,
|
|
5320
|
-
"%": formatLiteralPercent$1
|
|
5321
|
-
};
|
|
5322
|
-
|
|
5323
|
-
var utcFormats = {
|
|
5324
|
-
"a": formatUTCShortWeekday,
|
|
5325
|
-
"A": formatUTCWeekday,
|
|
5326
|
-
"b": formatUTCShortMonth,
|
|
5327
|
-
"B": formatUTCMonth,
|
|
5328
|
-
"c": null,
|
|
5329
|
-
"d": formatUTCDayOfMonth$1,
|
|
5330
|
-
"e": formatUTCDayOfMonth$1,
|
|
5331
|
-
"f": formatUTCMicroseconds$1,
|
|
5332
|
-
"g": formatUTCYearISO$1,
|
|
5333
|
-
"G": formatUTCFullYearISO$1,
|
|
5334
|
-
"H": formatUTCHour24$1,
|
|
5335
|
-
"I": formatUTCHour12$1,
|
|
5336
|
-
"j": formatUTCDayOfYear$1,
|
|
5337
|
-
"L": formatUTCMilliseconds$1,
|
|
5338
|
-
"m": formatUTCMonthNumber$1,
|
|
5339
|
-
"M": formatUTCMinutes$1,
|
|
5340
|
-
"p": formatUTCPeriod,
|
|
5341
|
-
"q": formatUTCQuarter,
|
|
5342
|
-
"Q": formatUnixTimestamp$1,
|
|
5343
|
-
"s": formatUnixTimestampSeconds$1,
|
|
5344
|
-
"S": formatUTCSeconds$1,
|
|
5345
|
-
"u": formatUTCWeekdayNumberMonday$1,
|
|
5346
|
-
"U": formatUTCWeekNumberSunday$1,
|
|
5347
|
-
"V": formatUTCWeekNumberISO$1,
|
|
5348
|
-
"w": formatUTCWeekdayNumberSunday$1,
|
|
5349
|
-
"W": formatUTCWeekNumberMonday$1,
|
|
5350
|
-
"x": null,
|
|
5351
|
-
"X": null,
|
|
5352
|
-
"y": formatUTCYear$1,
|
|
5353
|
-
"Y": formatUTCFullYear$1,
|
|
5354
|
-
"Z": formatUTCZone$1,
|
|
5355
|
-
"%": formatLiteralPercent$1
|
|
5356
|
-
};
|
|
5357
|
-
|
|
5358
|
-
var parses = {
|
|
5359
|
-
"a": parseShortWeekday,
|
|
5360
|
-
"A": parseWeekday,
|
|
5361
|
-
"b": parseShortMonth,
|
|
5362
|
-
"B": parseMonth,
|
|
5363
|
-
"c": parseLocaleDateTime,
|
|
5364
|
-
"d": parseDayOfMonth$1,
|
|
5365
|
-
"e": parseDayOfMonth$1,
|
|
5366
|
-
"f": parseMicroseconds$1,
|
|
5367
|
-
"g": parseYear$1,
|
|
5368
|
-
"G": parseFullYear$1,
|
|
5369
|
-
"H": parseHour24$1,
|
|
5370
|
-
"I": parseHour24$1,
|
|
5371
|
-
"j": parseDayOfYear$1,
|
|
5372
|
-
"L": parseMilliseconds$1,
|
|
5373
|
-
"m": parseMonthNumber$1,
|
|
5374
|
-
"M": parseMinutes$1,
|
|
5375
|
-
"p": parsePeriod,
|
|
5376
|
-
"q": parseQuarter$1,
|
|
5377
|
-
"Q": parseUnixTimestamp$1,
|
|
5378
|
-
"s": parseUnixTimestampSeconds$1,
|
|
5379
|
-
"S": parseSeconds$1,
|
|
5380
|
-
"u": parseWeekdayNumberMonday$1,
|
|
5381
|
-
"U": parseWeekNumberSunday$1,
|
|
5382
|
-
"V": parseWeekNumberISO$1,
|
|
5383
|
-
"w": parseWeekdayNumberSunday$1,
|
|
5384
|
-
"W": parseWeekNumberMonday$1,
|
|
5385
|
-
"x": parseLocaleDate,
|
|
5386
|
-
"X": parseLocaleTime,
|
|
5387
|
-
"y": parseYear$1,
|
|
5388
|
-
"Y": parseFullYear$1,
|
|
5389
|
-
"Z": parseZone$1,
|
|
5390
|
-
"%": parseLiteralPercent$1
|
|
5391
|
-
};
|
|
5392
|
-
|
|
5393
|
-
// These recursive directive definitions must be deferred.
|
|
5394
|
-
formats.x = newFormat(locale_date, formats);
|
|
5395
|
-
formats.X = newFormat(locale_time, formats);
|
|
5396
|
-
formats.c = newFormat(locale_dateTime, formats);
|
|
5397
|
-
utcFormats.x = newFormat(locale_date, utcFormats);
|
|
5398
|
-
utcFormats.X = newFormat(locale_time, utcFormats);
|
|
5399
|
-
utcFormats.c = newFormat(locale_dateTime, utcFormats);
|
|
5400
|
-
|
|
5401
|
-
function newFormat(specifier, formats) {
|
|
5402
|
-
return function(date) {
|
|
5403
|
-
var string = [],
|
|
5404
|
-
i = -1,
|
|
5405
|
-
j = 0,
|
|
5406
|
-
n = specifier.length,
|
|
5407
|
-
c,
|
|
5408
|
-
pad,
|
|
5409
|
-
format;
|
|
5410
|
-
|
|
5411
|
-
if (!(date instanceof Date)) date = new Date(+date);
|
|
5412
|
-
|
|
5413
|
-
while (++i < n) {
|
|
5414
|
-
if (specifier.charCodeAt(i) === 37) {
|
|
5415
|
-
string.push(specifier.slice(j, i));
|
|
5416
|
-
if ((pad = pads$1[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
|
|
5417
|
-
else pad = c === "e" ? " " : "0";
|
|
5418
|
-
if (format = formats[c]) c = format(date, pad);
|
|
5419
|
-
string.push(c);
|
|
5420
|
-
j = i + 1;
|
|
5421
|
-
}
|
|
5422
|
-
}
|
|
5423
|
-
|
|
5424
|
-
string.push(specifier.slice(j, i));
|
|
5425
|
-
return string.join("");
|
|
5426
|
-
};
|
|
5427
|
-
}
|
|
5428
|
-
|
|
5429
|
-
function newParse(specifier, Z) {
|
|
5430
|
-
return function(string) {
|
|
5431
|
-
var d = newDate$1(1900, undefined, 1),
|
|
5432
|
-
i = parseSpecifier(d, specifier, string += "", 0),
|
|
5433
|
-
week, day;
|
|
5434
|
-
if (i != string.length) return null;
|
|
5435
|
-
|
|
5436
|
-
// If a UNIX timestamp is specified, return it.
|
|
5437
|
-
if ("Q" in d) return new Date(d.Q);
|
|
5438
|
-
if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0));
|
|
5439
|
-
|
|
5440
|
-
// If this is utcParse, never use the local timezone.
|
|
5441
|
-
if (Z && !("Z" in d)) d.Z = 0;
|
|
5442
|
-
|
|
5443
|
-
// The am-pm flag is 0 for AM, and 1 for PM.
|
|
5444
|
-
if ("p" in d) d.H = d.H % 12 + d.p * 12;
|
|
5445
|
-
|
|
5446
|
-
// If the month was not specified, inherit from the quarter.
|
|
5447
|
-
if (d.m === undefined) d.m = "q" in d ? d.q : 0;
|
|
5448
|
-
|
|
5449
|
-
// Convert day-of-week and week-of-year to day-of-year.
|
|
5450
|
-
if ("V" in d) {
|
|
5451
|
-
if (d.V < 1 || d.V > 53) return null;
|
|
5452
|
-
if (!("w" in d)) d.w = 1;
|
|
5453
|
-
if ("Z" in d) {
|
|
5454
|
-
week = utcDate$1(newDate$1(d.y, 0, 1)), day = week.getUTCDay();
|
|
5455
|
-
week = day > 4 || day === 0 ? utcMonday$1.ceil(week) : utcMonday$1(week);
|
|
5456
|
-
week = utcDay$3.offset(week, (d.V - 1) * 7);
|
|
5457
|
-
d.y = week.getUTCFullYear();
|
|
5458
|
-
d.m = week.getUTCMonth();
|
|
5459
|
-
d.d = week.getUTCDate() + (d.w + 6) % 7;
|
|
5460
|
-
} else {
|
|
5461
|
-
week = localDate$1(newDate$1(d.y, 0, 1)), day = week.getDay();
|
|
5462
|
-
week = day > 4 || day === 0 ? monday$1.ceil(week) : monday$1(week);
|
|
5463
|
-
week = timeDay.offset(week, (d.V - 1) * 7);
|
|
5464
|
-
d.y = week.getFullYear();
|
|
5465
|
-
d.m = week.getMonth();
|
|
5466
|
-
d.d = week.getDate() + (d.w + 6) % 7;
|
|
5467
|
-
}
|
|
5468
|
-
} else if ("W" in d || "U" in d) {
|
|
5469
|
-
if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
|
|
5470
|
-
day = "Z" in d ? utcDate$1(newDate$1(d.y, 0, 1)).getUTCDay() : localDate$1(newDate$1(d.y, 0, 1)).getDay();
|
|
5471
|
-
d.m = 0;
|
|
5472
|
-
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
|
|
5473
|
-
}
|
|
5474
|
-
|
|
5475
|
-
// If a time zone is specified, all fields are interpreted as UTC and then
|
|
5476
|
-
// offset according to the specified time zone.
|
|
5477
|
-
if ("Z" in d) {
|
|
5478
|
-
d.H += d.Z / 100 | 0;
|
|
5479
|
-
d.M += d.Z % 100;
|
|
5480
|
-
return utcDate$1(d);
|
|
5481
|
-
}
|
|
5482
|
-
|
|
5483
|
-
// Otherwise, all fields are in local time.
|
|
5484
|
-
return localDate$1(d);
|
|
5485
|
-
};
|
|
5486
|
-
}
|
|
5487
|
-
|
|
5488
|
-
function parseSpecifier(d, specifier, string, j) {
|
|
5489
|
-
var i = 0,
|
|
5490
|
-
n = specifier.length,
|
|
5491
|
-
m = string.length,
|
|
5492
|
-
c,
|
|
5493
|
-
parse;
|
|
5494
|
-
|
|
5495
|
-
while (i < n) {
|
|
5496
|
-
if (j >= m) return -1;
|
|
5497
|
-
c = specifier.charCodeAt(i++);
|
|
5498
|
-
if (c === 37) {
|
|
5499
|
-
c = specifier.charAt(i++);
|
|
5500
|
-
parse = parses[c in pads$1 ? specifier.charAt(i++) : c];
|
|
5501
|
-
if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
|
|
5502
|
-
} else if (c != string.charCodeAt(j++)) {
|
|
5503
|
-
return -1;
|
|
5504
|
-
}
|
|
5505
|
-
}
|
|
5506
|
-
|
|
5507
|
-
return j;
|
|
5508
|
-
}
|
|
5509
|
-
|
|
5510
|
-
function parsePeriod(d, string, i) {
|
|
5511
|
-
var n = periodRe.exec(string.slice(i));
|
|
5512
|
-
return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
5513
|
-
}
|
|
5514
|
-
|
|
5515
|
-
function parseShortWeekday(d, string, i) {
|
|
5516
|
-
var n = shortWeekdayRe.exec(string.slice(i));
|
|
5517
|
-
return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
5518
|
-
}
|
|
5519
|
-
|
|
5520
|
-
function parseWeekday(d, string, i) {
|
|
5521
|
-
var n = weekdayRe.exec(string.slice(i));
|
|
5522
|
-
return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
5523
|
-
}
|
|
5524
|
-
|
|
5525
|
-
function parseShortMonth(d, string, i) {
|
|
5526
|
-
var n = shortMonthRe.exec(string.slice(i));
|
|
5527
|
-
return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
5528
|
-
}
|
|
5529
|
-
|
|
5530
|
-
function parseMonth(d, string, i) {
|
|
5531
|
-
var n = monthRe.exec(string.slice(i));
|
|
5532
|
-
return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
5533
|
-
}
|
|
5534
|
-
|
|
5535
|
-
function parseLocaleDateTime(d, string, i) {
|
|
5536
|
-
return parseSpecifier(d, locale_dateTime, string, i);
|
|
5537
|
-
}
|
|
5538
|
-
|
|
5539
|
-
function parseLocaleDate(d, string, i) {
|
|
5540
|
-
return parseSpecifier(d, locale_date, string, i);
|
|
5541
|
-
}
|
|
5542
|
-
|
|
5543
|
-
function parseLocaleTime(d, string, i) {
|
|
5544
|
-
return parseSpecifier(d, locale_time, string, i);
|
|
5545
|
-
}
|
|
5546
|
-
|
|
5547
|
-
function formatShortWeekday(d) {
|
|
5548
|
-
return locale_shortWeekdays[d.getDay()];
|
|
5549
|
-
}
|
|
5550
|
-
|
|
5551
|
-
function formatWeekday(d) {
|
|
5552
|
-
return locale_weekdays[d.getDay()];
|
|
5553
|
-
}
|
|
5554
|
-
|
|
5555
|
-
function formatShortMonth(d) {
|
|
5556
|
-
return locale_shortMonths[d.getMonth()];
|
|
5557
|
-
}
|
|
5558
|
-
|
|
5559
|
-
function formatMonth(d) {
|
|
5560
|
-
return locale_months[d.getMonth()];
|
|
5561
|
-
}
|
|
5562
|
-
|
|
5563
|
-
function formatPeriod(d) {
|
|
5564
|
-
return locale_periods[+(d.getHours() >= 12)];
|
|
5565
|
-
}
|
|
5566
|
-
|
|
5567
|
-
function formatQuarter(d) {
|
|
5568
|
-
return 1 + ~~(d.getMonth() / 3);
|
|
5569
|
-
}
|
|
5570
|
-
|
|
5571
|
-
function formatUTCShortWeekday(d) {
|
|
5572
|
-
return locale_shortWeekdays[d.getUTCDay()];
|
|
5573
|
-
}
|
|
5574
|
-
|
|
5575
|
-
function formatUTCWeekday(d) {
|
|
5576
|
-
return locale_weekdays[d.getUTCDay()];
|
|
5577
|
-
}
|
|
5578
|
-
|
|
5579
|
-
function formatUTCShortMonth(d) {
|
|
5580
|
-
return locale_shortMonths[d.getUTCMonth()];
|
|
5581
|
-
}
|
|
5582
|
-
|
|
5583
|
-
function formatUTCMonth(d) {
|
|
5584
|
-
return locale_months[d.getUTCMonth()];
|
|
5585
|
-
}
|
|
5586
|
-
|
|
5587
|
-
function formatUTCPeriod(d) {
|
|
5588
|
-
return locale_periods[+(d.getUTCHours() >= 12)];
|
|
5589
|
-
}
|
|
5590
|
-
|
|
5591
|
-
function formatUTCQuarter(d) {
|
|
5592
|
-
return 1 + ~~(d.getUTCMonth() / 3);
|
|
5593
|
-
}
|
|
5594
|
-
|
|
5595
|
-
return {
|
|
5596
|
-
format: function(specifier) {
|
|
5597
|
-
var f = newFormat(specifier += "", formats);
|
|
5598
|
-
f.toString = function() { return specifier; };
|
|
5599
|
-
return f;
|
|
5600
|
-
},
|
|
5601
|
-
parse: function(specifier) {
|
|
5602
|
-
var p = newParse(specifier += "", false);
|
|
5603
|
-
p.toString = function() { return specifier; };
|
|
5604
|
-
return p;
|
|
5605
|
-
},
|
|
5606
|
-
utcFormat: function(specifier) {
|
|
5607
|
-
var f = newFormat(specifier += "", utcFormats);
|
|
5608
|
-
f.toString = function() { return specifier; };
|
|
5609
|
-
return f;
|
|
5610
|
-
},
|
|
5611
|
-
utcParse: function(specifier) {
|
|
5612
|
-
var p = newParse(specifier += "", true);
|
|
5613
|
-
p.toString = function() { return specifier; };
|
|
5614
|
-
return p;
|
|
5615
|
-
}
|
|
5616
|
-
};
|
|
5617
|
-
}
|
|
5618
|
-
|
|
5619
|
-
var pads$1 = {"-": "", "_": " ", "0": "0"},
|
|
5620
|
-
numberRe$1 = /^\s*\d+/, // note: ignores next directive
|
|
5621
|
-
percentRe$1 = /^%/,
|
|
5622
|
-
requoteRe$1 = /[\\^$*+?|[\]().{}]/g;
|
|
5623
|
-
|
|
5624
|
-
function pad$1(value, fill, width) {
|
|
5625
|
-
var sign = value < 0 ? "-" : "",
|
|
5626
|
-
string = (sign ? -value : value) + "",
|
|
5627
|
-
length = string.length;
|
|
5628
|
-
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
|
|
5629
|
-
}
|
|
5630
|
-
|
|
5631
|
-
function requote$1(s) {
|
|
5632
|
-
return s.replace(requoteRe$1, "\\$&");
|
|
5633
|
-
}
|
|
5634
|
-
|
|
5635
|
-
function formatRe$1(names) {
|
|
5636
|
-
return new RegExp("^(?:" + names.map(requote$1).join("|") + ")", "i");
|
|
5637
|
-
}
|
|
5638
|
-
|
|
5639
|
-
function formatLookup$1(names) {
|
|
5640
|
-
return new Map(names.map((name, i) => [name.toLowerCase(), i]));
|
|
5641
|
-
}
|
|
5642
|
-
|
|
5643
|
-
function parseWeekdayNumberSunday$1(d, string, i) {
|
|
5644
|
-
var n = numberRe$1.exec(string.slice(i, i + 1));
|
|
5645
|
-
return n ? (d.w = +n[0], i + n[0].length) : -1;
|
|
5646
|
-
}
|
|
5647
|
-
|
|
5648
|
-
function parseWeekdayNumberMonday$1(d, string, i) {
|
|
5649
|
-
var n = numberRe$1.exec(string.slice(i, i + 1));
|
|
5650
|
-
return n ? (d.u = +n[0], i + n[0].length) : -1;
|
|
5651
|
-
}
|
|
5652
|
-
|
|
5653
|
-
function parseWeekNumberSunday$1(d, string, i) {
|
|
5654
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
5655
|
-
return n ? (d.U = +n[0], i + n[0].length) : -1;
|
|
5656
|
-
}
|
|
5657
|
-
|
|
5658
|
-
function parseWeekNumberISO$1(d, string, i) {
|
|
5659
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
5660
|
-
return n ? (d.V = +n[0], i + n[0].length) : -1;
|
|
5661
|
-
}
|
|
5662
|
-
|
|
5663
|
-
function parseWeekNumberMonday$1(d, string, i) {
|
|
5664
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
5665
|
-
return n ? (d.W = +n[0], i + n[0].length) : -1;
|
|
5666
|
-
}
|
|
5667
|
-
|
|
5668
|
-
function parseFullYear$1(d, string, i) {
|
|
5669
|
-
var n = numberRe$1.exec(string.slice(i, i + 4));
|
|
5670
|
-
return n ? (d.y = +n[0], i + n[0].length) : -1;
|
|
5671
|
-
}
|
|
5672
|
-
|
|
5673
|
-
function parseYear$1(d, string, i) {
|
|
5674
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
5675
|
-
return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
|
|
5676
|
-
}
|
|
5677
|
-
|
|
5678
|
-
function parseZone$1(d, string, i) {
|
|
5679
|
-
var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
|
|
5680
|
-
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
|
|
5681
|
-
}
|
|
5682
|
-
|
|
5683
|
-
function parseQuarter$1(d, string, i) {
|
|
5684
|
-
var n = numberRe$1.exec(string.slice(i, i + 1));
|
|
5685
|
-
return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
|
|
5686
|
-
}
|
|
5687
|
-
|
|
5688
|
-
function parseMonthNumber$1(d, string, i) {
|
|
5689
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
5690
|
-
return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
|
|
5691
|
-
}
|
|
5692
|
-
|
|
5693
|
-
function parseDayOfMonth$1(d, string, i) {
|
|
5694
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
5695
|
-
return n ? (d.d = +n[0], i + n[0].length) : -1;
|
|
5696
|
-
}
|
|
5697
|
-
|
|
5698
|
-
function parseDayOfYear$1(d, string, i) {
|
|
5699
|
-
var n = numberRe$1.exec(string.slice(i, i + 3));
|
|
5700
|
-
return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
|
|
5701
|
-
}
|
|
5702
|
-
|
|
5703
|
-
function parseHour24$1(d, string, i) {
|
|
5704
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
5705
|
-
return n ? (d.H = +n[0], i + n[0].length) : -1;
|
|
5706
|
-
}
|
|
5707
|
-
|
|
5708
|
-
function parseMinutes$1(d, string, i) {
|
|
5709
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
5710
|
-
return n ? (d.M = +n[0], i + n[0].length) : -1;
|
|
5711
|
-
}
|
|
5712
|
-
|
|
5713
|
-
function parseSeconds$1(d, string, i) {
|
|
5714
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
5715
|
-
return n ? (d.S = +n[0], i + n[0].length) : -1;
|
|
5716
|
-
}
|
|
5717
|
-
|
|
5718
|
-
function parseMilliseconds$1(d, string, i) {
|
|
5719
|
-
var n = numberRe$1.exec(string.slice(i, i + 3));
|
|
5720
|
-
return n ? (d.L = +n[0], i + n[0].length) : -1;
|
|
5721
|
-
}
|
|
5722
|
-
|
|
5723
|
-
function parseMicroseconds$1(d, string, i) {
|
|
5724
|
-
var n = numberRe$1.exec(string.slice(i, i + 6));
|
|
5725
|
-
return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;
|
|
5726
|
-
}
|
|
5727
|
-
|
|
5728
|
-
function parseLiteralPercent$1(d, string, i) {
|
|
5729
|
-
var n = percentRe$1.exec(string.slice(i, i + 1));
|
|
5730
|
-
return n ? i + n[0].length : -1;
|
|
5731
|
-
}
|
|
5732
|
-
|
|
5733
|
-
function parseUnixTimestamp$1(d, string, i) {
|
|
5734
|
-
var n = numberRe$1.exec(string.slice(i));
|
|
5735
|
-
return n ? (d.Q = +n[0], i + n[0].length) : -1;
|
|
5736
|
-
}
|
|
5737
|
-
|
|
5738
|
-
function parseUnixTimestampSeconds$1(d, string, i) {
|
|
5739
|
-
var n = numberRe$1.exec(string.slice(i));
|
|
5740
|
-
return n ? (d.s = +n[0], i + n[0].length) : -1;
|
|
5741
|
-
}
|
|
5742
|
-
|
|
5743
|
-
function formatDayOfMonth$1(d, p) {
|
|
5744
|
-
return pad$1(d.getDate(), p, 2);
|
|
5745
|
-
}
|
|
5746
|
-
|
|
5747
|
-
function formatHour24$1(d, p) {
|
|
5748
|
-
return pad$1(d.getHours(), p, 2);
|
|
5749
|
-
}
|
|
5750
|
-
|
|
5751
|
-
function formatHour12$1(d, p) {
|
|
5752
|
-
return pad$1(d.getHours() % 12 || 12, p, 2);
|
|
5753
|
-
}
|
|
5754
|
-
|
|
5755
|
-
function formatDayOfYear$1(d, p) {
|
|
5756
|
-
return pad$1(1 + timeDay.count(timeYear(d), d), p, 3);
|
|
5757
|
-
}
|
|
5758
|
-
|
|
5759
|
-
function formatMilliseconds$1(d, p) {
|
|
5760
|
-
return pad$1(d.getMilliseconds(), p, 3);
|
|
5761
|
-
}
|
|
5762
|
-
|
|
5763
|
-
function formatMicroseconds$1(d, p) {
|
|
5764
|
-
return formatMilliseconds$1(d, p) + "000";
|
|
5765
|
-
}
|
|
5766
|
-
|
|
5767
|
-
function formatMonthNumber$1(d, p) {
|
|
5768
|
-
return pad$1(d.getMonth() + 1, p, 2);
|
|
5769
|
-
}
|
|
5770
|
-
|
|
5771
|
-
function formatMinutes$1(d, p) {
|
|
5772
|
-
return pad$1(d.getMinutes(), p, 2);
|
|
5773
|
-
}
|
|
5774
|
-
|
|
5775
|
-
function formatSeconds$1(d, p) {
|
|
5776
|
-
return pad$1(d.getSeconds(), p, 2);
|
|
5777
|
-
}
|
|
5778
|
-
|
|
5779
|
-
function formatWeekdayNumberMonday$1(d) {
|
|
5780
|
-
var day = d.getDay();
|
|
5781
|
-
return day === 0 ? 7 : day;
|
|
5782
|
-
}
|
|
5783
|
-
|
|
5784
|
-
function formatWeekNumberSunday$1(d, p) {
|
|
5785
|
-
return pad$1(sunday$1.count(timeYear(d) - 1, d), p, 2);
|
|
5786
|
-
}
|
|
5787
|
-
|
|
5788
|
-
function dISO$1(d) {
|
|
5789
|
-
var day = d.getDay();
|
|
5790
|
-
return (day >= 4 || day === 0) ? thursday$1(d) : thursday$1.ceil(d);
|
|
5791
|
-
}
|
|
5792
|
-
|
|
5793
|
-
function formatWeekNumberISO$1(d, p) {
|
|
5794
|
-
d = dISO$1(d);
|
|
5795
|
-
return pad$1(thursday$1.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);
|
|
5796
|
-
}
|
|
5797
|
-
|
|
5798
|
-
function formatWeekdayNumberSunday$1(d) {
|
|
5799
|
-
return d.getDay();
|
|
5800
|
-
}
|
|
5801
|
-
|
|
5802
|
-
function formatWeekNumberMonday$1(d, p) {
|
|
5803
|
-
return pad$1(monday$1.count(timeYear(d) - 1, d), p, 2);
|
|
5804
|
-
}
|
|
5805
|
-
|
|
5806
|
-
function formatYear$1(d, p) {
|
|
5807
|
-
return pad$1(d.getFullYear() % 100, p, 2);
|
|
5808
|
-
}
|
|
5809
|
-
|
|
5810
|
-
function formatYearISO$1(d, p) {
|
|
5811
|
-
d = dISO$1(d);
|
|
5812
|
-
return pad$1(d.getFullYear() % 100, p, 2);
|
|
5813
|
-
}
|
|
5814
|
-
|
|
5815
|
-
function formatFullYear$1(d, p) {
|
|
5816
|
-
return pad$1(d.getFullYear() % 10000, p, 4);
|
|
5817
|
-
}
|
|
5818
|
-
|
|
5819
|
-
function formatFullYearISO$1(d, p) {
|
|
5820
|
-
var day = d.getDay();
|
|
5821
|
-
d = (day >= 4 || day === 0) ? thursday$1(d) : thursday$1.ceil(d);
|
|
5822
|
-
return pad$1(d.getFullYear() % 10000, p, 4);
|
|
5823
|
-
}
|
|
5824
|
-
|
|
5825
|
-
function formatZone$1(d) {
|
|
5826
|
-
var z = d.getTimezoneOffset();
|
|
5827
|
-
return (z > 0 ? "-" : (z *= -1, "+"))
|
|
5828
|
-
+ pad$1(z / 60 | 0, "0", 2)
|
|
5829
|
-
+ pad$1(z % 60, "0", 2);
|
|
5830
|
-
}
|
|
5831
|
-
|
|
5832
|
-
function formatUTCDayOfMonth$1(d, p) {
|
|
5833
|
-
return pad$1(d.getUTCDate(), p, 2);
|
|
5834
|
-
}
|
|
5835
|
-
|
|
5836
|
-
function formatUTCHour24$1(d, p) {
|
|
5837
|
-
return pad$1(d.getUTCHours(), p, 2);
|
|
5838
|
-
}
|
|
5839
|
-
|
|
5840
|
-
function formatUTCHour12$1(d, p) {
|
|
5841
|
-
return pad$1(d.getUTCHours() % 12 || 12, p, 2);
|
|
5842
|
-
}
|
|
5843
|
-
|
|
5844
|
-
function formatUTCDayOfYear$1(d, p) {
|
|
5845
|
-
return pad$1(1 + utcDay$3.count(utcYear$3(d), d), p, 3);
|
|
5846
|
-
}
|
|
5847
|
-
|
|
5848
|
-
function formatUTCMilliseconds$1(d, p) {
|
|
5849
|
-
return pad$1(d.getUTCMilliseconds(), p, 3);
|
|
5850
|
-
}
|
|
5851
|
-
|
|
5852
|
-
function formatUTCMicroseconds$1(d, p) {
|
|
5853
|
-
return formatUTCMilliseconds$1(d, p) + "000";
|
|
5854
|
-
}
|
|
5855
|
-
|
|
5856
|
-
function formatUTCMonthNumber$1(d, p) {
|
|
5857
|
-
return pad$1(d.getUTCMonth() + 1, p, 2);
|
|
5858
|
-
}
|
|
5859
|
-
|
|
5860
|
-
function formatUTCMinutes$1(d, p) {
|
|
5861
|
-
return pad$1(d.getUTCMinutes(), p, 2);
|
|
5862
|
-
}
|
|
5863
|
-
|
|
5864
|
-
function formatUTCSeconds$1(d, p) {
|
|
5865
|
-
return pad$1(d.getUTCSeconds(), p, 2);
|
|
5866
|
-
}
|
|
5867
|
-
|
|
5868
|
-
function formatUTCWeekdayNumberMonday$1(d) {
|
|
5869
|
-
var dow = d.getUTCDay();
|
|
5870
|
-
return dow === 0 ? 7 : dow;
|
|
5871
|
-
}
|
|
5872
|
-
|
|
5873
|
-
function formatUTCWeekNumberSunday$1(d, p) {
|
|
5874
|
-
return pad$1(utcSunday$1.count(utcYear$3(d) - 1, d), p, 2);
|
|
5875
|
-
}
|
|
5876
|
-
|
|
5877
|
-
function UTCdISO$1(d) {
|
|
5878
|
-
var day = d.getUTCDay();
|
|
5879
|
-
return (day >= 4 || day === 0) ? utcThursday$1(d) : utcThursday$1.ceil(d);
|
|
5880
|
-
}
|
|
5881
|
-
|
|
5882
|
-
function formatUTCWeekNumberISO$1(d, p) {
|
|
5883
|
-
d = UTCdISO$1(d);
|
|
5884
|
-
return pad$1(utcThursday$1.count(utcYear$3(d), d) + (utcYear$3(d).getUTCDay() === 4), p, 2);
|
|
5885
|
-
}
|
|
5886
|
-
|
|
5887
|
-
function formatUTCWeekdayNumberSunday$1(d) {
|
|
5888
|
-
return d.getUTCDay();
|
|
5889
|
-
}
|
|
5890
|
-
|
|
5891
|
-
function formatUTCWeekNumberMonday$1(d, p) {
|
|
5892
|
-
return pad$1(utcMonday$1.count(utcYear$3(d) - 1, d), p, 2);
|
|
5893
|
-
}
|
|
5894
|
-
|
|
5895
|
-
function formatUTCYear$1(d, p) {
|
|
5896
|
-
return pad$1(d.getUTCFullYear() % 100, p, 2);
|
|
5897
|
-
}
|
|
5898
|
-
|
|
5899
|
-
function formatUTCYearISO$1(d, p) {
|
|
5900
|
-
d = UTCdISO$1(d);
|
|
5901
|
-
return pad$1(d.getUTCFullYear() % 100, p, 2);
|
|
5902
|
-
}
|
|
5903
|
-
|
|
5904
|
-
function formatUTCFullYear$1(d, p) {
|
|
5905
|
-
return pad$1(d.getUTCFullYear() % 10000, p, 4);
|
|
5906
|
-
}
|
|
5907
|
-
|
|
5908
|
-
function formatUTCFullYearISO$1(d, p) {
|
|
5909
|
-
var day = d.getUTCDay();
|
|
5910
|
-
d = (day >= 4 || day === 0) ? utcThursday$1(d) : utcThursday$1.ceil(d);
|
|
5911
|
-
return pad$1(d.getUTCFullYear() % 10000, p, 4);
|
|
5912
|
-
}
|
|
5913
|
-
|
|
5914
|
-
function formatUTCZone$1() {
|
|
5915
|
-
return "+0000";
|
|
5916
|
-
}
|
|
5917
|
-
|
|
5918
|
-
function formatLiteralPercent$1() {
|
|
5919
|
-
return "%";
|
|
5920
|
-
}
|
|
5921
|
-
|
|
5922
|
-
function formatUnixTimestamp$1(d) {
|
|
5923
|
-
return +d;
|
|
5924
|
-
}
|
|
5925
|
-
|
|
5926
|
-
function formatUnixTimestampSeconds$1(d) {
|
|
5927
|
-
return Math.floor(+d / 1000);
|
|
5928
|
-
}
|
|
5929
|
-
|
|
5930
|
-
var locale$1;
|
|
5931
|
-
var timeFormat$1;
|
|
5932
|
-
|
|
5933
|
-
defaultLocale$1({
|
|
5934
|
-
dateTime: "%x, %X",
|
|
5935
|
-
date: "%-m/%-d/%Y",
|
|
5936
|
-
time: "%-I:%M:%S %p",
|
|
5937
|
-
periods: ["AM", "PM"],
|
|
5938
|
-
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
5939
|
-
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
5940
|
-
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
5941
|
-
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
5942
|
-
});
|
|
5943
|
-
|
|
5944
|
-
function defaultLocale$1(definition) {
|
|
5945
|
-
locale$1 = formatLocale$1(definition);
|
|
5946
|
-
timeFormat$1 = locale$1.format;
|
|
5947
|
-
locale$1.parse;
|
|
5948
|
-
locale$1.utcFormat;
|
|
5949
|
-
locale$1.utcParse;
|
|
5950
|
-
return locale$1;
|
|
5951
|
-
}
|
|
5952
|
-
|
|
5953
|
-
function date(t) {
|
|
5954
|
-
return new Date(t);
|
|
5955
|
-
}
|
|
5956
|
-
|
|
5957
|
-
function number(t) {
|
|
5958
|
-
return t instanceof Date ? +t : +new Date(+t);
|
|
5959
|
-
}
|
|
5960
|
-
|
|
5961
|
-
function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {
|
|
5962
|
-
var scale = continuous(),
|
|
5963
|
-
invert = scale.invert,
|
|
5964
|
-
domain = scale.domain;
|
|
5965
|
-
|
|
5966
|
-
var formatMillisecond = format(".%L"),
|
|
5967
|
-
formatSecond = format(":%S"),
|
|
5968
|
-
formatMinute = format("%I:%M"),
|
|
5969
|
-
formatHour = format("%I %p"),
|
|
5970
|
-
formatDay = format("%a %d"),
|
|
5971
|
-
formatWeek = format("%b %d"),
|
|
5972
|
-
formatMonth = format("%B"),
|
|
5973
|
-
formatYear = format("%Y");
|
|
5974
|
-
|
|
5975
|
-
function tickFormat(date) {
|
|
5976
|
-
return (second(date) < date ? formatMillisecond
|
|
5977
|
-
: minute(date) < date ? formatSecond
|
|
5978
|
-
: hour(date) < date ? formatMinute
|
|
5979
|
-
: day(date) < date ? formatHour
|
|
5980
|
-
: month(date) < date ? (week(date) < date ? formatDay : formatWeek)
|
|
5981
|
-
: year(date) < date ? formatMonth
|
|
5982
|
-
: formatYear)(date);
|
|
5983
|
-
}
|
|
5984
|
-
|
|
5985
|
-
scale.invert = function(y) {
|
|
5986
|
-
return new Date(invert(y));
|
|
5987
|
-
};
|
|
5988
|
-
|
|
5989
|
-
scale.domain = function(_) {
|
|
5990
|
-
return arguments.length ? domain(Array.from(_, number)) : domain().map(date);
|
|
5991
|
-
};
|
|
5992
|
-
|
|
5993
|
-
scale.ticks = function(interval) {
|
|
5994
|
-
var d = domain();
|
|
5995
|
-
return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);
|
|
5996
|
-
};
|
|
5997
|
-
|
|
5998
|
-
scale.tickFormat = function(count, specifier) {
|
|
5999
|
-
return specifier == null ? tickFormat : format(specifier);
|
|
6000
|
-
};
|
|
6001
|
-
|
|
6002
|
-
scale.nice = function(interval) {
|
|
6003
|
-
var d = domain();
|
|
6004
|
-
if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);
|
|
6005
|
-
return interval ? domain(nice(d, interval)) : scale;
|
|
6006
|
-
};
|
|
6007
|
-
|
|
6008
|
-
scale.copy = function() {
|
|
6009
|
-
return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
|
|
6010
|
-
};
|
|
6011
|
-
|
|
6012
|
-
return scale;
|
|
6013
|
-
}
|
|
6014
|
-
|
|
6015
|
-
function time() {
|
|
6016
|
-
return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, sunday$1, timeDay, timeHour, timeMinute, utcSecond, timeFormat$1).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);
|
|
6017
|
-
}
|
|
6018
|
-
|
|
6019
|
-
var t0 = new Date,
|
|
6020
|
-
t1 = new Date;
|
|
6021
|
-
|
|
6022
|
-
function newInterval(floori, offseti, count, field) {
|
|
6023
|
-
|
|
6024
|
-
function interval(date) {
|
|
6025
|
-
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
|
6026
|
-
}
|
|
6027
|
-
|
|
6028
|
-
interval.floor = function(date) {
|
|
6029
|
-
return floori(date = new Date(+date)), date;
|
|
6030
|
-
};
|
|
6031
|
-
|
|
6032
|
-
interval.ceil = function(date) {
|
|
6033
|
-
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
|
6034
|
-
};
|
|
6035
|
-
|
|
6036
|
-
interval.round = function(date) {
|
|
6037
|
-
var d0 = interval(date),
|
|
6038
|
-
d1 = interval.ceil(date);
|
|
6039
|
-
return date - d0 < d1 - date ? d0 : d1;
|
|
6040
|
-
};
|
|
6041
|
-
|
|
6042
|
-
interval.offset = function(date, step) {
|
|
6043
|
-
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
|
6044
|
-
};
|
|
6045
|
-
|
|
6046
|
-
interval.range = function(start, stop, step) {
|
|
6047
|
-
var range = [], previous;
|
|
6048
|
-
start = interval.ceil(start);
|
|
6049
|
-
step = step == null ? 1 : Math.floor(step);
|
|
6050
|
-
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
|
6051
|
-
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
|
6052
|
-
while (previous < start && start < stop);
|
|
6053
|
-
return range;
|
|
6054
|
-
};
|
|
6055
|
-
|
|
6056
|
-
interval.filter = function(test) {
|
|
6057
|
-
return newInterval(function(date) {
|
|
6058
|
-
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
|
6059
|
-
}, function(date, step) {
|
|
6060
|
-
if (date >= date) {
|
|
6061
|
-
if (step < 0) while (++step <= 0) {
|
|
6062
|
-
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
|
6063
|
-
} else while (--step >= 0) {
|
|
6064
|
-
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
|
|
6065
|
-
}
|
|
6066
|
-
}
|
|
6067
|
-
});
|
|
6068
|
-
};
|
|
6069
|
-
|
|
6070
|
-
if (count) {
|
|
6071
|
-
interval.count = function(start, end) {
|
|
6072
|
-
t0.setTime(+start), t1.setTime(+end);
|
|
6073
|
-
floori(t0), floori(t1);
|
|
6074
|
-
return Math.floor(count(t0, t1));
|
|
6075
|
-
};
|
|
6076
|
-
|
|
6077
|
-
interval.every = function(step) {
|
|
6078
|
-
step = Math.floor(step);
|
|
6079
|
-
return !isFinite(step) || !(step > 0) ? null
|
|
6080
|
-
: !(step > 1) ? interval
|
|
6081
|
-
: interval.filter(field
|
|
6082
|
-
? function(d) { return field(d) % step === 0; }
|
|
6083
|
-
: function(d) { return interval.count(0, d) % step === 0; });
|
|
6084
|
-
};
|
|
6085
|
-
}
|
|
6086
|
-
|
|
6087
|
-
return interval;
|
|
6088
|
-
}
|
|
6089
|
-
|
|
6090
|
-
const durationSecond = 1000;
|
|
6091
|
-
const durationMinute = durationSecond * 60;
|
|
6092
|
-
const durationHour = durationMinute * 60;
|
|
6093
|
-
const durationDay = durationHour * 24;
|
|
6094
|
-
const durationWeek = durationDay * 7;
|
|
6095
|
-
|
|
6096
|
-
var hour = newInterval(function(date) {
|
|
6097
|
-
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
|
6098
|
-
}, function(date, step) {
|
|
6099
|
-
date.setTime(+date + step * durationHour);
|
|
6100
|
-
}, function(start, end) {
|
|
6101
|
-
return (end - start) / durationHour;
|
|
6102
|
-
}, function(date) {
|
|
6103
|
-
return date.getHours();
|
|
6104
|
-
});
|
|
6105
|
-
|
|
6106
|
-
var d3timeHour = hour;
|
|
6107
|
-
var hours = hour.range;
|
|
6108
|
-
|
|
6109
|
-
var day = newInterval(
|
|
6110
|
-
date => date.setHours(0, 0, 0, 0),
|
|
6111
|
-
(date, step) => date.setDate(date.getDate() + step),
|
|
6112
|
-
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
|
|
6113
|
-
date => date.getDate() - 1
|
|
6114
|
-
);
|
|
6115
|
-
|
|
6116
|
-
var d3timeDay = day;
|
|
6117
|
-
var days = day.range;
|
|
6118
|
-
|
|
6119
|
-
function weekday(i) {
|
|
6120
|
-
return newInterval(function(date) {
|
|
6121
|
-
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
6122
|
-
date.setHours(0, 0, 0, 0);
|
|
6123
|
-
}, function(date, step) {
|
|
6124
|
-
date.setDate(date.getDate() + step * 7);
|
|
6125
|
-
}, function(start, end) {
|
|
6126
|
-
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
|
6127
|
-
});
|
|
6128
|
-
}
|
|
6129
|
-
|
|
6130
|
-
var sunday = weekday(0);
|
|
6131
|
-
var monday = weekday(1);
|
|
6132
|
-
var tuesday = weekday(2);
|
|
6133
|
-
var wednesday = weekday(3);
|
|
6134
|
-
var thursday = weekday(4);
|
|
6135
|
-
var friday = weekday(5);
|
|
6136
|
-
var saturday = weekday(6);
|
|
6137
|
-
|
|
6138
|
-
var sundays = sunday.range;
|
|
6139
|
-
monday.range;
|
|
6140
|
-
tuesday.range;
|
|
6141
|
-
wednesday.range;
|
|
6142
|
-
thursday.range;
|
|
6143
|
-
friday.range;
|
|
6144
|
-
saturday.range;
|
|
6145
|
-
|
|
6146
|
-
var month = newInterval(function(date) {
|
|
6147
|
-
date.setDate(1);
|
|
6148
|
-
date.setHours(0, 0, 0, 0);
|
|
6149
|
-
}, function(date, step) {
|
|
6150
|
-
date.setMonth(date.getMonth() + step);
|
|
6151
|
-
}, function(start, end) {
|
|
6152
|
-
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
|
6153
|
-
}, function(date) {
|
|
6154
|
-
return date.getMonth();
|
|
6155
|
-
});
|
|
6156
|
-
|
|
6157
|
-
var d3timeMonth = month;
|
|
6158
|
-
var months = month.range;
|
|
6159
|
-
|
|
6160
|
-
var year = newInterval(function(date) {
|
|
6161
|
-
date.setMonth(0, 1);
|
|
6162
|
-
date.setHours(0, 0, 0, 0);
|
|
6163
|
-
}, function(date, step) {
|
|
6164
|
-
date.setFullYear(date.getFullYear() + step);
|
|
6165
|
-
}, function(start, end) {
|
|
6166
|
-
return end.getFullYear() - start.getFullYear();
|
|
6167
|
-
}, function(date) {
|
|
6168
|
-
return date.getFullYear();
|
|
6169
|
-
});
|
|
6170
|
-
|
|
6171
|
-
// An optimized implementation for this simple case.
|
|
6172
|
-
year.every = function(k) {
|
|
6173
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
|
|
6174
|
-
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
6175
|
-
date.setMonth(0, 1);
|
|
6176
|
-
date.setHours(0, 0, 0, 0);
|
|
6177
|
-
}, function(date, step) {
|
|
6178
|
-
date.setFullYear(date.getFullYear() + step * k);
|
|
6179
|
-
});
|
|
6180
|
-
};
|
|
6181
|
-
|
|
6182
|
-
var d3timeYear = year;
|
|
6183
|
-
var years = year.range;
|
|
6184
|
-
|
|
6185
|
-
var utcDay = newInterval(function(date) {
|
|
6186
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
6187
|
-
}, function(date, step) {
|
|
6188
|
-
date.setUTCDate(date.getUTCDate() + step);
|
|
6189
|
-
}, function(start, end) {
|
|
6190
|
-
return (end - start) / durationDay;
|
|
6191
|
-
}, function(date) {
|
|
6192
|
-
return date.getUTCDate() - 1;
|
|
6193
|
-
});
|
|
6194
|
-
|
|
6195
|
-
var utcDay$1 = utcDay;
|
|
6196
|
-
utcDay.range;
|
|
6197
|
-
|
|
6198
|
-
function utcWeekday(i) {
|
|
6199
|
-
return newInterval(function(date) {
|
|
6200
|
-
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
|
6201
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
6202
|
-
}, function(date, step) {
|
|
6203
|
-
date.setUTCDate(date.getUTCDate() + step * 7);
|
|
6204
|
-
}, function(start, end) {
|
|
6205
|
-
return (end - start) / durationWeek;
|
|
6206
|
-
});
|
|
6207
|
-
}
|
|
6208
|
-
|
|
6209
|
-
var utcSunday = utcWeekday(0);
|
|
6210
|
-
var utcMonday = utcWeekday(1);
|
|
6211
|
-
var utcTuesday = utcWeekday(2);
|
|
6212
|
-
var utcWednesday = utcWeekday(3);
|
|
6213
|
-
var utcThursday = utcWeekday(4);
|
|
6214
|
-
var utcFriday = utcWeekday(5);
|
|
6215
|
-
var utcSaturday = utcWeekday(6);
|
|
6216
|
-
|
|
6217
|
-
utcSunday.range;
|
|
6218
|
-
utcMonday.range;
|
|
6219
|
-
utcTuesday.range;
|
|
6220
|
-
utcWednesday.range;
|
|
6221
|
-
utcThursday.range;
|
|
6222
|
-
utcFriday.range;
|
|
6223
|
-
utcSaturday.range;
|
|
6224
|
-
|
|
6225
|
-
var utcYear = newInterval(function(date) {
|
|
6226
|
-
date.setUTCMonth(0, 1);
|
|
6227
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
6228
|
-
}, function(date, step) {
|
|
6229
|
-
date.setUTCFullYear(date.getUTCFullYear() + step);
|
|
6230
|
-
}, function(start, end) {
|
|
6231
|
-
return end.getUTCFullYear() - start.getUTCFullYear();
|
|
6232
|
-
}, function(date) {
|
|
6233
|
-
return date.getUTCFullYear();
|
|
6234
|
-
});
|
|
6235
|
-
|
|
6236
|
-
// An optimized implementation for this simple case.
|
|
6237
|
-
utcYear.every = function(k) {
|
|
6238
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
|
|
6239
|
-
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
|
6240
|
-
date.setUTCMonth(0, 1);
|
|
6241
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
6242
|
-
}, function(date, step) {
|
|
6243
|
-
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
|
6244
|
-
});
|
|
6245
|
-
};
|
|
6246
|
-
|
|
6247
|
-
var utcYear$1 = utcYear;
|
|
6248
|
-
utcYear.range;
|
|
6249
|
-
|
|
6250
|
-
function localDate(d) {
|
|
6251
|
-
if (0 <= d.y && d.y < 100) {
|
|
6252
|
-
var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
6253
|
-
date.setFullYear(d.y);
|
|
6254
|
-
return date;
|
|
6255
|
-
}
|
|
6256
|
-
return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
6257
|
-
}
|
|
6258
|
-
|
|
6259
|
-
function utcDate(d) {
|
|
6260
|
-
if (0 <= d.y && d.y < 100) {
|
|
6261
|
-
var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
6262
|
-
date.setUTCFullYear(d.y);
|
|
6263
|
-
return date;
|
|
6264
|
-
}
|
|
6265
|
-
return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
6266
|
-
}
|
|
6267
|
-
|
|
6268
|
-
function newDate(y, m, d) {
|
|
6269
|
-
return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};
|
|
6270
|
-
}
|
|
6271
|
-
|
|
6272
|
-
function formatLocale(locale) {
|
|
6273
|
-
var locale_dateTime = locale.dateTime,
|
|
6274
|
-
locale_date = locale.date,
|
|
6275
|
-
locale_time = locale.time,
|
|
6276
|
-
locale_periods = locale.periods,
|
|
6277
|
-
locale_weekdays = locale.days,
|
|
6278
|
-
locale_shortWeekdays = locale.shortDays,
|
|
6279
|
-
locale_months = locale.months,
|
|
6280
|
-
locale_shortMonths = locale.shortMonths;
|
|
6281
|
-
|
|
6282
|
-
var periodRe = formatRe(locale_periods),
|
|
6283
|
-
periodLookup = formatLookup(locale_periods),
|
|
6284
|
-
weekdayRe = formatRe(locale_weekdays),
|
|
6285
|
-
weekdayLookup = formatLookup(locale_weekdays),
|
|
6286
|
-
shortWeekdayRe = formatRe(locale_shortWeekdays),
|
|
6287
|
-
shortWeekdayLookup = formatLookup(locale_shortWeekdays),
|
|
6288
|
-
monthRe = formatRe(locale_months),
|
|
6289
|
-
monthLookup = formatLookup(locale_months),
|
|
6290
|
-
shortMonthRe = formatRe(locale_shortMonths),
|
|
6291
|
-
shortMonthLookup = formatLookup(locale_shortMonths);
|
|
6292
|
-
|
|
6293
|
-
var formats = {
|
|
6294
|
-
"a": formatShortWeekday,
|
|
6295
|
-
"A": formatWeekday,
|
|
6296
|
-
"b": formatShortMonth,
|
|
6297
|
-
"B": formatMonth,
|
|
6298
|
-
"c": null,
|
|
6299
|
-
"d": formatDayOfMonth,
|
|
6300
|
-
"e": formatDayOfMonth,
|
|
6301
|
-
"f": formatMicroseconds,
|
|
6302
|
-
"g": formatYearISO,
|
|
6303
|
-
"G": formatFullYearISO,
|
|
6304
|
-
"H": formatHour24,
|
|
6305
|
-
"I": formatHour12,
|
|
6306
|
-
"j": formatDayOfYear,
|
|
6307
|
-
"L": formatMilliseconds,
|
|
6308
|
-
"m": formatMonthNumber,
|
|
6309
|
-
"M": formatMinutes,
|
|
6310
|
-
"p": formatPeriod,
|
|
6311
|
-
"q": formatQuarter,
|
|
6312
|
-
"Q": formatUnixTimestamp,
|
|
6313
|
-
"s": formatUnixTimestampSeconds,
|
|
6314
|
-
"S": formatSeconds,
|
|
6315
|
-
"u": formatWeekdayNumberMonday,
|
|
6316
|
-
"U": formatWeekNumberSunday,
|
|
6317
|
-
"V": formatWeekNumberISO,
|
|
6318
|
-
"w": formatWeekdayNumberSunday,
|
|
6319
|
-
"W": formatWeekNumberMonday,
|
|
6320
|
-
"x": null,
|
|
6321
|
-
"X": null,
|
|
6322
|
-
"y": formatYear,
|
|
6323
|
-
"Y": formatFullYear,
|
|
6324
|
-
"Z": formatZone,
|
|
6325
|
-
"%": formatLiteralPercent
|
|
6326
|
-
};
|
|
6327
|
-
|
|
6328
|
-
var utcFormats = {
|
|
6329
|
-
"a": formatUTCShortWeekday,
|
|
6330
|
-
"A": formatUTCWeekday,
|
|
6331
|
-
"b": formatUTCShortMonth,
|
|
6332
|
-
"B": formatUTCMonth,
|
|
6333
|
-
"c": null,
|
|
6334
|
-
"d": formatUTCDayOfMonth,
|
|
6335
|
-
"e": formatUTCDayOfMonth,
|
|
6336
|
-
"f": formatUTCMicroseconds,
|
|
6337
|
-
"g": formatUTCYearISO,
|
|
6338
|
-
"G": formatUTCFullYearISO,
|
|
6339
|
-
"H": formatUTCHour24,
|
|
6340
|
-
"I": formatUTCHour12,
|
|
6341
|
-
"j": formatUTCDayOfYear,
|
|
6342
|
-
"L": formatUTCMilliseconds,
|
|
6343
|
-
"m": formatUTCMonthNumber,
|
|
6344
|
-
"M": formatUTCMinutes,
|
|
6345
|
-
"p": formatUTCPeriod,
|
|
6346
|
-
"q": formatUTCQuarter,
|
|
6347
|
-
"Q": formatUnixTimestamp,
|
|
6348
|
-
"s": formatUnixTimestampSeconds,
|
|
6349
|
-
"S": formatUTCSeconds,
|
|
6350
|
-
"u": formatUTCWeekdayNumberMonday,
|
|
6351
|
-
"U": formatUTCWeekNumberSunday,
|
|
6352
|
-
"V": formatUTCWeekNumberISO,
|
|
6353
|
-
"w": formatUTCWeekdayNumberSunday,
|
|
6354
|
-
"W": formatUTCWeekNumberMonday,
|
|
6355
|
-
"x": null,
|
|
6356
|
-
"X": null,
|
|
6357
|
-
"y": formatUTCYear,
|
|
6358
|
-
"Y": formatUTCFullYear,
|
|
6359
|
-
"Z": formatUTCZone,
|
|
6360
|
-
"%": formatLiteralPercent
|
|
6361
|
-
};
|
|
6362
|
-
|
|
6363
|
-
var parses = {
|
|
6364
|
-
"a": parseShortWeekday,
|
|
6365
|
-
"A": parseWeekday,
|
|
6366
|
-
"b": parseShortMonth,
|
|
6367
|
-
"B": parseMonth,
|
|
6368
|
-
"c": parseLocaleDateTime,
|
|
6369
|
-
"d": parseDayOfMonth,
|
|
6370
|
-
"e": parseDayOfMonth,
|
|
6371
|
-
"f": parseMicroseconds,
|
|
6372
|
-
"g": parseYear,
|
|
6373
|
-
"G": parseFullYear,
|
|
6374
|
-
"H": parseHour24,
|
|
6375
|
-
"I": parseHour24,
|
|
6376
|
-
"j": parseDayOfYear,
|
|
6377
|
-
"L": parseMilliseconds,
|
|
6378
|
-
"m": parseMonthNumber,
|
|
6379
|
-
"M": parseMinutes,
|
|
6380
|
-
"p": parsePeriod,
|
|
6381
|
-
"q": parseQuarter,
|
|
6382
|
-
"Q": parseUnixTimestamp,
|
|
6383
|
-
"s": parseUnixTimestampSeconds,
|
|
6384
|
-
"S": parseSeconds,
|
|
6385
|
-
"u": parseWeekdayNumberMonday,
|
|
6386
|
-
"U": parseWeekNumberSunday,
|
|
6387
|
-
"V": parseWeekNumberISO,
|
|
6388
|
-
"w": parseWeekdayNumberSunday,
|
|
6389
|
-
"W": parseWeekNumberMonday,
|
|
6390
|
-
"x": parseLocaleDate,
|
|
6391
|
-
"X": parseLocaleTime,
|
|
6392
|
-
"y": parseYear,
|
|
6393
|
-
"Y": parseFullYear,
|
|
6394
|
-
"Z": parseZone,
|
|
6395
|
-
"%": parseLiteralPercent
|
|
6396
|
-
};
|
|
6397
|
-
|
|
6398
|
-
// These recursive directive definitions must be deferred.
|
|
6399
|
-
formats.x = newFormat(locale_date, formats);
|
|
6400
|
-
formats.X = newFormat(locale_time, formats);
|
|
6401
|
-
formats.c = newFormat(locale_dateTime, formats);
|
|
6402
|
-
utcFormats.x = newFormat(locale_date, utcFormats);
|
|
6403
|
-
utcFormats.X = newFormat(locale_time, utcFormats);
|
|
6404
|
-
utcFormats.c = newFormat(locale_dateTime, utcFormats);
|
|
6405
|
-
|
|
6406
|
-
function newFormat(specifier, formats) {
|
|
6407
|
-
return function(date) {
|
|
6408
|
-
var string = [],
|
|
6409
|
-
i = -1,
|
|
6410
|
-
j = 0,
|
|
6411
|
-
n = specifier.length,
|
|
6412
|
-
c,
|
|
6413
|
-
pad,
|
|
6414
|
-
format;
|
|
6415
|
-
|
|
6416
|
-
if (!(date instanceof Date)) date = new Date(+date);
|
|
6417
|
-
|
|
6418
|
-
while (++i < n) {
|
|
6419
|
-
if (specifier.charCodeAt(i) === 37) {
|
|
6420
|
-
string.push(specifier.slice(j, i));
|
|
6421
|
-
if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
|
|
6422
|
-
else pad = c === "e" ? " " : "0";
|
|
6423
|
-
if (format = formats[c]) c = format(date, pad);
|
|
6424
|
-
string.push(c);
|
|
6425
|
-
j = i + 1;
|
|
6426
|
-
}
|
|
6427
|
-
}
|
|
6428
|
-
|
|
6429
|
-
string.push(specifier.slice(j, i));
|
|
6430
|
-
return string.join("");
|
|
6431
|
-
};
|
|
6432
|
-
}
|
|
6433
|
-
|
|
6434
|
-
function newParse(specifier, Z) {
|
|
6435
|
-
return function(string) {
|
|
6436
|
-
var d = newDate(1900, undefined, 1),
|
|
6437
|
-
i = parseSpecifier(d, specifier, string += "", 0),
|
|
6438
|
-
week, day;
|
|
6439
|
-
if (i != string.length) return null;
|
|
6440
|
-
|
|
6441
|
-
// If a UNIX timestamp is specified, return it.
|
|
6442
|
-
if ("Q" in d) return new Date(d.Q);
|
|
6443
|
-
if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0));
|
|
6444
|
-
|
|
6445
|
-
// If this is utcParse, never use the local timezone.
|
|
6446
|
-
if (Z && !("Z" in d)) d.Z = 0;
|
|
6447
|
-
|
|
6448
|
-
// The am-pm flag is 0 for AM, and 1 for PM.
|
|
6449
|
-
if ("p" in d) d.H = d.H % 12 + d.p * 12;
|
|
6450
|
-
|
|
6451
|
-
// If the month was not specified, inherit from the quarter.
|
|
6452
|
-
if (d.m === undefined) d.m = "q" in d ? d.q : 0;
|
|
6453
|
-
|
|
6454
|
-
// Convert day-of-week and week-of-year to day-of-year.
|
|
6455
|
-
if ("V" in d) {
|
|
6456
|
-
if (d.V < 1 || d.V > 53) return null;
|
|
6457
|
-
if (!("w" in d)) d.w = 1;
|
|
6458
|
-
if ("Z" in d) {
|
|
6459
|
-
week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
|
|
6460
|
-
week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
|
|
6461
|
-
week = utcDay$1.offset(week, (d.V - 1) * 7);
|
|
6462
|
-
d.y = week.getUTCFullYear();
|
|
6463
|
-
d.m = week.getUTCMonth();
|
|
6464
|
-
d.d = week.getUTCDate() + (d.w + 6) % 7;
|
|
6465
|
-
} else {
|
|
6466
|
-
week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
|
|
6467
|
-
week = day > 4 || day === 0 ? monday.ceil(week) : monday(week);
|
|
6468
|
-
week = d3timeDay.offset(week, (d.V - 1) * 7);
|
|
6469
|
-
d.y = week.getFullYear();
|
|
6470
|
-
d.m = week.getMonth();
|
|
6471
|
-
d.d = week.getDate() + (d.w + 6) % 7;
|
|
6472
|
-
}
|
|
6473
|
-
} else if ("W" in d || "U" in d) {
|
|
6474
|
-
if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
|
|
6475
|
-
day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
|
|
6476
|
-
d.m = 0;
|
|
6477
|
-
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
|
|
6478
|
-
}
|
|
6479
|
-
|
|
6480
|
-
// If a time zone is specified, all fields are interpreted as UTC and then
|
|
6481
|
-
// offset according to the specified time zone.
|
|
6482
|
-
if ("Z" in d) {
|
|
6483
|
-
d.H += d.Z / 100 | 0;
|
|
6484
|
-
d.M += d.Z % 100;
|
|
6485
|
-
return utcDate(d);
|
|
6486
|
-
}
|
|
6487
|
-
|
|
6488
|
-
// Otherwise, all fields are in local time.
|
|
6489
|
-
return localDate(d);
|
|
6490
|
-
};
|
|
6491
|
-
}
|
|
6492
|
-
|
|
6493
|
-
function parseSpecifier(d, specifier, string, j) {
|
|
6494
|
-
var i = 0,
|
|
6495
|
-
n = specifier.length,
|
|
6496
|
-
m = string.length,
|
|
6497
|
-
c,
|
|
6498
|
-
parse;
|
|
6499
|
-
|
|
6500
|
-
while (i < n) {
|
|
6501
|
-
if (j >= m) return -1;
|
|
6502
|
-
c = specifier.charCodeAt(i++);
|
|
6503
|
-
if (c === 37) {
|
|
6504
|
-
c = specifier.charAt(i++);
|
|
6505
|
-
parse = parses[c in pads ? specifier.charAt(i++) : c];
|
|
6506
|
-
if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
|
|
6507
|
-
} else if (c != string.charCodeAt(j++)) {
|
|
6508
|
-
return -1;
|
|
6509
|
-
}
|
|
6510
|
-
}
|
|
6511
|
-
|
|
6512
|
-
return j;
|
|
6513
|
-
}
|
|
6514
|
-
|
|
6515
|
-
function parsePeriod(d, string, i) {
|
|
6516
|
-
var n = periodRe.exec(string.slice(i));
|
|
6517
|
-
return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
6518
|
-
}
|
|
6519
|
-
|
|
6520
|
-
function parseShortWeekday(d, string, i) {
|
|
6521
|
-
var n = shortWeekdayRe.exec(string.slice(i));
|
|
6522
|
-
return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
6523
|
-
}
|
|
6524
|
-
|
|
6525
|
-
function parseWeekday(d, string, i) {
|
|
6526
|
-
var n = weekdayRe.exec(string.slice(i));
|
|
6527
|
-
return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
6528
|
-
}
|
|
6529
|
-
|
|
6530
|
-
function parseShortMonth(d, string, i) {
|
|
6531
|
-
var n = shortMonthRe.exec(string.slice(i));
|
|
6532
|
-
return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
6533
|
-
}
|
|
6534
|
-
|
|
6535
|
-
function parseMonth(d, string, i) {
|
|
6536
|
-
var n = monthRe.exec(string.slice(i));
|
|
6537
|
-
return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
6538
|
-
}
|
|
6539
|
-
|
|
6540
|
-
function parseLocaleDateTime(d, string, i) {
|
|
6541
|
-
return parseSpecifier(d, locale_dateTime, string, i);
|
|
6542
|
-
}
|
|
6543
|
-
|
|
6544
|
-
function parseLocaleDate(d, string, i) {
|
|
6545
|
-
return parseSpecifier(d, locale_date, string, i);
|
|
6546
|
-
}
|
|
6547
|
-
|
|
6548
|
-
function parseLocaleTime(d, string, i) {
|
|
6549
|
-
return parseSpecifier(d, locale_time, string, i);
|
|
6550
|
-
}
|
|
6551
|
-
|
|
6552
|
-
function formatShortWeekday(d) {
|
|
6553
|
-
return locale_shortWeekdays[d.getDay()];
|
|
6554
|
-
}
|
|
6555
|
-
|
|
6556
|
-
function formatWeekday(d) {
|
|
6557
|
-
return locale_weekdays[d.getDay()];
|
|
6558
|
-
}
|
|
6559
|
-
|
|
6560
|
-
function formatShortMonth(d) {
|
|
6561
|
-
return locale_shortMonths[d.getMonth()];
|
|
6562
|
-
}
|
|
6563
|
-
|
|
6564
|
-
function formatMonth(d) {
|
|
6565
|
-
return locale_months[d.getMonth()];
|
|
6566
|
-
}
|
|
6567
|
-
|
|
6568
|
-
function formatPeriod(d) {
|
|
6569
|
-
return locale_periods[+(d.getHours() >= 12)];
|
|
6570
|
-
}
|
|
6571
|
-
|
|
6572
|
-
function formatQuarter(d) {
|
|
6573
|
-
return 1 + ~~(d.getMonth() / 3);
|
|
6574
|
-
}
|
|
6575
|
-
|
|
6576
|
-
function formatUTCShortWeekday(d) {
|
|
6577
|
-
return locale_shortWeekdays[d.getUTCDay()];
|
|
6578
|
-
}
|
|
6579
|
-
|
|
6580
|
-
function formatUTCWeekday(d) {
|
|
6581
|
-
return locale_weekdays[d.getUTCDay()];
|
|
6582
|
-
}
|
|
6583
|
-
|
|
6584
|
-
function formatUTCShortMonth(d) {
|
|
6585
|
-
return locale_shortMonths[d.getUTCMonth()];
|
|
6586
|
-
}
|
|
6587
|
-
|
|
6588
|
-
function formatUTCMonth(d) {
|
|
6589
|
-
return locale_months[d.getUTCMonth()];
|
|
6590
|
-
}
|
|
6591
|
-
|
|
6592
|
-
function formatUTCPeriod(d) {
|
|
6593
|
-
return locale_periods[+(d.getUTCHours() >= 12)];
|
|
6594
|
-
}
|
|
6595
|
-
|
|
6596
|
-
function formatUTCQuarter(d) {
|
|
6597
|
-
return 1 + ~~(d.getUTCMonth() / 3);
|
|
6598
|
-
}
|
|
6599
|
-
|
|
6600
|
-
return {
|
|
6601
|
-
format: function(specifier) {
|
|
6602
|
-
var f = newFormat(specifier += "", formats);
|
|
6603
|
-
f.toString = function() { return specifier; };
|
|
6604
|
-
return f;
|
|
6605
|
-
},
|
|
6606
|
-
parse: function(specifier) {
|
|
6607
|
-
var p = newParse(specifier += "", false);
|
|
6608
|
-
p.toString = function() { return specifier; };
|
|
6609
|
-
return p;
|
|
6610
|
-
},
|
|
6611
|
-
utcFormat: function(specifier) {
|
|
6612
|
-
var f = newFormat(specifier += "", utcFormats);
|
|
6613
|
-
f.toString = function() { return specifier; };
|
|
6614
|
-
return f;
|
|
6615
|
-
},
|
|
6616
|
-
utcParse: function(specifier) {
|
|
6617
|
-
var p = newParse(specifier += "", true);
|
|
6618
|
-
p.toString = function() { return specifier; };
|
|
6619
|
-
return p;
|
|
6620
|
-
}
|
|
6621
|
-
};
|
|
6622
|
-
}
|
|
6623
|
-
|
|
6624
|
-
var pads = {"-": "", "_": " ", "0": "0"},
|
|
6625
|
-
numberRe = /^\s*\d+/, // note: ignores next directive
|
|
6626
|
-
percentRe = /^%/,
|
|
6627
|
-
requoteRe = /[\\^$*+?|[\]().{}]/g;
|
|
6628
|
-
|
|
6629
|
-
function pad(value, fill, width) {
|
|
6630
|
-
var sign = value < 0 ? "-" : "",
|
|
6631
|
-
string = (sign ? -value : value) + "",
|
|
6632
|
-
length = string.length;
|
|
6633
|
-
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
|
|
6634
|
-
}
|
|
6635
|
-
|
|
6636
|
-
function requote(s) {
|
|
6637
|
-
return s.replace(requoteRe, "\\$&");
|
|
6638
|
-
}
|
|
6639
|
-
|
|
6640
|
-
function formatRe(names) {
|
|
6641
|
-
return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
|
|
6642
|
-
}
|
|
6643
|
-
|
|
6644
|
-
function formatLookup(names) {
|
|
6645
|
-
return new Map(names.map((name, i) => [name.toLowerCase(), i]));
|
|
6646
|
-
}
|
|
6647
|
-
|
|
6648
|
-
function parseWeekdayNumberSunday(d, string, i) {
|
|
6649
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
6650
|
-
return n ? (d.w = +n[0], i + n[0].length) : -1;
|
|
6651
|
-
}
|
|
6652
|
-
|
|
6653
|
-
function parseWeekdayNumberMonday(d, string, i) {
|
|
6654
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
6655
|
-
return n ? (d.u = +n[0], i + n[0].length) : -1;
|
|
6656
|
-
}
|
|
6657
|
-
|
|
6658
|
-
function parseWeekNumberSunday(d, string, i) {
|
|
6659
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
6660
|
-
return n ? (d.U = +n[0], i + n[0].length) : -1;
|
|
6661
|
-
}
|
|
6662
|
-
|
|
6663
|
-
function parseWeekNumberISO(d, string, i) {
|
|
6664
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
6665
|
-
return n ? (d.V = +n[0], i + n[0].length) : -1;
|
|
6666
|
-
}
|
|
6667
|
-
|
|
6668
|
-
function parseWeekNumberMonday(d, string, i) {
|
|
6669
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
6670
|
-
return n ? (d.W = +n[0], i + n[0].length) : -1;
|
|
6671
|
-
}
|
|
6672
|
-
|
|
6673
|
-
function parseFullYear(d, string, i) {
|
|
6674
|
-
var n = numberRe.exec(string.slice(i, i + 4));
|
|
6675
|
-
return n ? (d.y = +n[0], i + n[0].length) : -1;
|
|
6676
|
-
}
|
|
6677
|
-
|
|
6678
|
-
function parseYear(d, string, i) {
|
|
6679
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
6680
|
-
return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
|
|
6681
|
-
}
|
|
6682
|
-
|
|
6683
|
-
function parseZone(d, string, i) {
|
|
6684
|
-
var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
|
|
6685
|
-
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
|
|
6686
|
-
}
|
|
6687
|
-
|
|
6688
|
-
function parseQuarter(d, string, i) {
|
|
6689
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
6690
|
-
return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
|
|
6691
|
-
}
|
|
6692
|
-
|
|
6693
|
-
function parseMonthNumber(d, string, i) {
|
|
6694
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
6695
|
-
return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
|
|
6696
|
-
}
|
|
6697
|
-
|
|
6698
|
-
function parseDayOfMonth(d, string, i) {
|
|
6699
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
6700
|
-
return n ? (d.d = +n[0], i + n[0].length) : -1;
|
|
6701
|
-
}
|
|
6702
|
-
|
|
6703
|
-
function parseDayOfYear(d, string, i) {
|
|
6704
|
-
var n = numberRe.exec(string.slice(i, i + 3));
|
|
6705
|
-
return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
|
|
6706
|
-
}
|
|
6707
|
-
|
|
6708
|
-
function parseHour24(d, string, i) {
|
|
6709
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
6710
|
-
return n ? (d.H = +n[0], i + n[0].length) : -1;
|
|
6711
|
-
}
|
|
6712
|
-
|
|
6713
|
-
function parseMinutes(d, string, i) {
|
|
6714
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
6715
|
-
return n ? (d.M = +n[0], i + n[0].length) : -1;
|
|
6716
|
-
}
|
|
6717
|
-
|
|
6718
|
-
function parseSeconds(d, string, i) {
|
|
6719
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
6720
|
-
return n ? (d.S = +n[0], i + n[0].length) : -1;
|
|
6721
|
-
}
|
|
6722
|
-
|
|
6723
|
-
function parseMilliseconds(d, string, i) {
|
|
6724
|
-
var n = numberRe.exec(string.slice(i, i + 3));
|
|
6725
|
-
return n ? (d.L = +n[0], i + n[0].length) : -1;
|
|
6726
|
-
}
|
|
6727
|
-
|
|
6728
|
-
function parseMicroseconds(d, string, i) {
|
|
6729
|
-
var n = numberRe.exec(string.slice(i, i + 6));
|
|
6730
|
-
return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;
|
|
6731
|
-
}
|
|
6732
|
-
|
|
6733
|
-
function parseLiteralPercent(d, string, i) {
|
|
6734
|
-
var n = percentRe.exec(string.slice(i, i + 1));
|
|
6735
|
-
return n ? i + n[0].length : -1;
|
|
6736
|
-
}
|
|
6737
|
-
|
|
6738
|
-
function parseUnixTimestamp(d, string, i) {
|
|
6739
|
-
var n = numberRe.exec(string.slice(i));
|
|
6740
|
-
return n ? (d.Q = +n[0], i + n[0].length) : -1;
|
|
6741
|
-
}
|
|
6742
|
-
|
|
6743
|
-
function parseUnixTimestampSeconds(d, string, i) {
|
|
6744
|
-
var n = numberRe.exec(string.slice(i));
|
|
6745
|
-
return n ? (d.s = +n[0], i + n[0].length) : -1;
|
|
6746
|
-
}
|
|
6747
|
-
|
|
6748
|
-
function formatDayOfMonth(d, p) {
|
|
6749
|
-
return pad(d.getDate(), p, 2);
|
|
6750
|
-
}
|
|
6751
|
-
|
|
6752
|
-
function formatHour24(d, p) {
|
|
6753
|
-
return pad(d.getHours(), p, 2);
|
|
6754
|
-
}
|
|
6755
|
-
|
|
6756
|
-
function formatHour12(d, p) {
|
|
6757
|
-
return pad(d.getHours() % 12 || 12, p, 2);
|
|
6758
|
-
}
|
|
6759
|
-
|
|
6760
|
-
function formatDayOfYear(d, p) {
|
|
6761
|
-
return pad(1 + d3timeDay.count(d3timeYear(d), d), p, 3);
|
|
6762
|
-
}
|
|
6763
|
-
|
|
6764
|
-
function formatMilliseconds(d, p) {
|
|
6765
|
-
return pad(d.getMilliseconds(), p, 3);
|
|
6766
|
-
}
|
|
6767
|
-
|
|
6768
|
-
function formatMicroseconds(d, p) {
|
|
6769
|
-
return formatMilliseconds(d, p) + "000";
|
|
6770
|
-
}
|
|
6771
|
-
|
|
6772
|
-
function formatMonthNumber(d, p) {
|
|
6773
|
-
return pad(d.getMonth() + 1, p, 2);
|
|
6774
|
-
}
|
|
6775
|
-
|
|
6776
|
-
function formatMinutes(d, p) {
|
|
6777
|
-
return pad(d.getMinutes(), p, 2);
|
|
6778
|
-
}
|
|
6779
|
-
|
|
6780
|
-
function formatSeconds(d, p) {
|
|
6781
|
-
return pad(d.getSeconds(), p, 2);
|
|
6782
|
-
}
|
|
6783
|
-
|
|
6784
|
-
function formatWeekdayNumberMonday(d) {
|
|
6785
|
-
var day = d.getDay();
|
|
6786
|
-
return day === 0 ? 7 : day;
|
|
6787
|
-
}
|
|
6788
|
-
|
|
6789
|
-
function formatWeekNumberSunday(d, p) {
|
|
6790
|
-
return pad(sunday.count(d3timeYear(d) - 1, d), p, 2);
|
|
6791
|
-
}
|
|
6792
|
-
|
|
6793
|
-
function dISO(d) {
|
|
6794
|
-
var day = d.getDay();
|
|
6795
|
-
return (day >= 4 || day === 0) ? thursday(d) : thursday.ceil(d);
|
|
6796
|
-
}
|
|
6797
|
-
|
|
6798
|
-
function formatWeekNumberISO(d, p) {
|
|
6799
|
-
d = dISO(d);
|
|
6800
|
-
return pad(thursday.count(d3timeYear(d), d) + (d3timeYear(d).getDay() === 4), p, 2);
|
|
6801
|
-
}
|
|
6802
|
-
|
|
6803
|
-
function formatWeekdayNumberSunday(d) {
|
|
6804
|
-
return d.getDay();
|
|
6805
|
-
}
|
|
6806
|
-
|
|
6807
|
-
function formatWeekNumberMonday(d, p) {
|
|
6808
|
-
return pad(monday.count(d3timeYear(d) - 1, d), p, 2);
|
|
6809
|
-
}
|
|
6810
|
-
|
|
6811
|
-
function formatYear(d, p) {
|
|
6812
|
-
return pad(d.getFullYear() % 100, p, 2);
|
|
6813
|
-
}
|
|
6814
|
-
|
|
6815
|
-
function formatYearISO(d, p) {
|
|
6816
|
-
d = dISO(d);
|
|
6817
|
-
return pad(d.getFullYear() % 100, p, 2);
|
|
6818
|
-
}
|
|
6819
|
-
|
|
6820
|
-
function formatFullYear(d, p) {
|
|
6821
|
-
return pad(d.getFullYear() % 10000, p, 4);
|
|
6822
|
-
}
|
|
6823
|
-
|
|
6824
|
-
function formatFullYearISO(d, p) {
|
|
6825
|
-
var day = d.getDay();
|
|
6826
|
-
d = (day >= 4 || day === 0) ? thursday(d) : thursday.ceil(d);
|
|
6827
|
-
return pad(d.getFullYear() % 10000, p, 4);
|
|
6828
|
-
}
|
|
6829
|
-
|
|
6830
|
-
function formatZone(d) {
|
|
6831
|
-
var z = d.getTimezoneOffset();
|
|
6832
|
-
return (z > 0 ? "-" : (z *= -1, "+"))
|
|
6833
|
-
+ pad(z / 60 | 0, "0", 2)
|
|
6834
|
-
+ pad(z % 60, "0", 2);
|
|
6835
|
-
}
|
|
6836
|
-
|
|
6837
|
-
function formatUTCDayOfMonth(d, p) {
|
|
6838
|
-
return pad(d.getUTCDate(), p, 2);
|
|
6839
|
-
}
|
|
6840
|
-
|
|
6841
|
-
function formatUTCHour24(d, p) {
|
|
6842
|
-
return pad(d.getUTCHours(), p, 2);
|
|
6843
|
-
}
|
|
6844
|
-
|
|
6845
|
-
function formatUTCHour12(d, p) {
|
|
6846
|
-
return pad(d.getUTCHours() % 12 || 12, p, 2);
|
|
6847
|
-
}
|
|
6848
|
-
|
|
6849
|
-
function formatUTCDayOfYear(d, p) {
|
|
6850
|
-
return pad(1 + utcDay$1.count(utcYear$1(d), d), p, 3);
|
|
6851
|
-
}
|
|
6852
|
-
|
|
6853
|
-
function formatUTCMilliseconds(d, p) {
|
|
6854
|
-
return pad(d.getUTCMilliseconds(), p, 3);
|
|
6855
|
-
}
|
|
6856
|
-
|
|
6857
|
-
function formatUTCMicroseconds(d, p) {
|
|
6858
|
-
return formatUTCMilliseconds(d, p) + "000";
|
|
6859
|
-
}
|
|
6860
|
-
|
|
6861
|
-
function formatUTCMonthNumber(d, p) {
|
|
6862
|
-
return pad(d.getUTCMonth() + 1, p, 2);
|
|
6863
|
-
}
|
|
6864
|
-
|
|
6865
|
-
function formatUTCMinutes(d, p) {
|
|
6866
|
-
return pad(d.getUTCMinutes(), p, 2);
|
|
6867
|
-
}
|
|
6868
|
-
|
|
6869
|
-
function formatUTCSeconds(d, p) {
|
|
6870
|
-
return pad(d.getUTCSeconds(), p, 2);
|
|
6871
|
-
}
|
|
6872
|
-
|
|
6873
|
-
function formatUTCWeekdayNumberMonday(d) {
|
|
6874
|
-
var dow = d.getUTCDay();
|
|
6875
|
-
return dow === 0 ? 7 : dow;
|
|
6876
|
-
}
|
|
6877
|
-
|
|
6878
|
-
function formatUTCWeekNumberSunday(d, p) {
|
|
6879
|
-
return pad(utcSunday.count(utcYear$1(d) - 1, d), p, 2);
|
|
6880
|
-
}
|
|
6881
|
-
|
|
6882
|
-
function UTCdISO(d) {
|
|
6883
|
-
var day = d.getUTCDay();
|
|
6884
|
-
return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
|
|
6885
|
-
}
|
|
6886
|
-
|
|
6887
|
-
function formatUTCWeekNumberISO(d, p) {
|
|
6888
|
-
d = UTCdISO(d);
|
|
6889
|
-
return pad(utcThursday.count(utcYear$1(d), d) + (utcYear$1(d).getUTCDay() === 4), p, 2);
|
|
6890
|
-
}
|
|
6891
|
-
|
|
6892
|
-
function formatUTCWeekdayNumberSunday(d) {
|
|
6893
|
-
return d.getUTCDay();
|
|
6894
|
-
}
|
|
6895
|
-
|
|
6896
|
-
function formatUTCWeekNumberMonday(d, p) {
|
|
6897
|
-
return pad(utcMonday.count(utcYear$1(d) - 1, d), p, 2);
|
|
6898
|
-
}
|
|
6899
|
-
|
|
6900
|
-
function formatUTCYear(d, p) {
|
|
6901
|
-
return pad(d.getUTCFullYear() % 100, p, 2);
|
|
6902
|
-
}
|
|
6903
|
-
|
|
6904
|
-
function formatUTCYearISO(d, p) {
|
|
6905
|
-
d = UTCdISO(d);
|
|
6906
|
-
return pad(d.getUTCFullYear() % 100, p, 2);
|
|
6907
|
-
}
|
|
6908
|
-
|
|
6909
|
-
function formatUTCFullYear(d, p) {
|
|
6910
|
-
return pad(d.getUTCFullYear() % 10000, p, 4);
|
|
6911
|
-
}
|
|
6912
|
-
|
|
6913
|
-
function formatUTCFullYearISO(d, p) {
|
|
6914
|
-
var day = d.getUTCDay();
|
|
6915
|
-
d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
|
|
6916
|
-
return pad(d.getUTCFullYear() % 10000, p, 4);
|
|
6917
|
-
}
|
|
6918
|
-
|
|
6919
|
-
function formatUTCZone() {
|
|
6920
|
-
return "+0000";
|
|
6921
|
-
}
|
|
6922
|
-
|
|
6923
|
-
function formatLiteralPercent() {
|
|
6924
|
-
return "%";
|
|
6925
|
-
}
|
|
6926
|
-
|
|
6927
|
-
function formatUnixTimestamp(d) {
|
|
6928
|
-
return +d;
|
|
6929
|
-
}
|
|
6930
|
-
|
|
6931
|
-
function formatUnixTimestampSeconds(d) {
|
|
6932
|
-
return Math.floor(+d / 1000);
|
|
6933
|
-
}
|
|
6934
|
-
|
|
6935
|
-
var locale;
|
|
6936
|
-
var timeFormat;
|
|
6937
|
-
var utcFormat;
|
|
6938
|
-
var utcParse;
|
|
6939
|
-
|
|
6940
|
-
defaultLocale({
|
|
6941
|
-
dateTime: "%x, %X",
|
|
6942
|
-
date: "%-m/%-d/%Y",
|
|
6943
|
-
time: "%-I:%M:%S %p",
|
|
6944
|
-
periods: ["AM", "PM"],
|
|
6945
|
-
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
6946
|
-
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
6947
|
-
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
6948
|
-
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
6949
|
-
});
|
|
6950
|
-
|
|
6951
|
-
function defaultLocale(definition) {
|
|
6952
|
-
locale = formatLocale(definition);
|
|
6953
|
-
timeFormat = locale.format;
|
|
6954
|
-
locale.parse;
|
|
6955
|
-
utcFormat = locale.utcFormat;
|
|
6956
|
-
utcParse = locale.utcParse;
|
|
6957
|
-
return locale;
|
|
6958
|
-
}
|
|
6959
|
-
|
|
6960
|
-
var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ";
|
|
6961
|
-
|
|
6962
|
-
function formatIsoNative(date) {
|
|
6963
|
-
return date.toISOString();
|
|
6964
|
-
}
|
|
6965
|
-
|
|
6966
|
-
Date.prototype.toISOString
|
|
6967
|
-
? formatIsoNative
|
|
6968
|
-
: utcFormat(isoSpecifier);
|
|
6969
|
-
|
|
6970
|
-
function parseIsoNative(string) {
|
|
6971
|
-
var date = new Date(string);
|
|
6972
|
-
return isNaN(date) ? null : date;
|
|
6973
|
-
}
|
|
6974
|
-
|
|
6975
|
-
var parseIso = +new Date("2000-01-01T00:00:00.000Z")
|
|
6976
|
-
? parseIsoNative
|
|
6977
|
-
: utcParse(isoSpecifier);
|
|
6978
|
-
|
|
6979
|
-
var d3isoParse = parseIso;
|
|
6980
|
-
|
|
6981
|
-
function Transform(k, x, y) {
|
|
6982
|
-
this.k = k;
|
|
6983
|
-
this.x = x;
|
|
6984
|
-
this.y = y;
|
|
6985
|
-
}
|
|
6986
|
-
|
|
6987
|
-
Transform.prototype = {
|
|
6988
|
-
constructor: Transform,
|
|
6989
|
-
scale: function(k) {
|
|
6990
|
-
return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
|
|
6991
|
-
},
|
|
6992
|
-
translate: function(x, y) {
|
|
6993
|
-
return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
|
|
6994
|
-
},
|
|
6995
|
-
apply: function(point) {
|
|
6996
|
-
return [point[0] * this.k + this.x, point[1] * this.k + this.y];
|
|
6997
|
-
},
|
|
6998
|
-
applyX: function(x) {
|
|
6999
|
-
return x * this.k + this.x;
|
|
7000
|
-
},
|
|
7001
|
-
applyY: function(y) {
|
|
7002
|
-
return y * this.k + this.y;
|
|
7003
|
-
},
|
|
7004
|
-
invert: function(location) {
|
|
7005
|
-
return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
|
|
7006
|
-
},
|
|
7007
|
-
invertX: function(x) {
|
|
7008
|
-
return (x - this.x) / this.k;
|
|
7009
|
-
},
|
|
7010
|
-
invertY: function(y) {
|
|
7011
|
-
return (y - this.y) / this.k;
|
|
7012
|
-
},
|
|
7013
|
-
rescaleX: function(x) {
|
|
7014
|
-
return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
|
|
7015
|
-
},
|
|
7016
|
-
rescaleY: function(y) {
|
|
7017
|
-
return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
|
|
7018
|
-
},
|
|
7019
|
-
toString: function() {
|
|
7020
|
-
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
7021
|
-
}
|
|
7022
|
-
};
|
|
7023
|
-
|
|
7024
|
-
new Transform(1, 0, 0);
|
|
7025
|
-
|
|
7026
|
-
Transform.prototype;
|
|
7027
|
-
|
|
7028
|
-
/**
|
|
7029
|
-
* Component style.
|
|
7030
|
-
*/
|
|
7031
|
-
const StyledPieChart = styled.div`
|
|
7032
|
-
margin: 8px;
|
|
7033
|
-
padding: 8px;
|
|
7034
|
-
color: var(--redsift-color-neutral-black);
|
|
7035
|
-
|
|
7036
|
-
.redsift-piechart__title {
|
|
7037
|
-
display: flex;
|
|
7038
|
-
flex-direction: row;
|
|
7039
|
-
align-items: center;
|
|
7040
|
-
gap: 16px;
|
|
7041
|
-
}
|
|
7042
|
-
|
|
7043
|
-
${_ref => {
|
|
7044
|
-
let {
|
|
7045
|
-
$showLabels
|
|
7046
|
-
} = _ref;
|
|
7047
|
-
return !$showLabels ? css`
|
|
7048
|
-
g.pie-label-group text {
|
|
7049
|
-
display: none;
|
|
7050
|
-
}
|
|
7051
|
-
` : '';
|
|
7052
|
-
}}
|
|
7053
|
-
|
|
7054
|
-
g.pie-slice {
|
|
7055
|
-
text {
|
|
7056
|
-
cursor: pointer;
|
|
7057
|
-
}
|
|
7058
|
-
|
|
7059
|
-
path {
|
|
7060
|
-
cursor: pointer;
|
|
7061
|
-
${_ref2 => {
|
|
7062
|
-
let {
|
|
7063
|
-
$spaced
|
|
7064
|
-
} = _ref2;
|
|
7065
|
-
return $spaced ? css`
|
|
7066
|
-
stroke-width: 2px;
|
|
7067
|
-
stroke: #fff;
|
|
7068
|
-
` : '';
|
|
7069
|
-
}}
|
|
7070
|
-
}
|
|
7071
|
-
}
|
|
7072
|
-
|
|
7073
|
-
g.pie-slice.deselected {
|
|
7074
|
-
path {
|
|
7075
|
-
fill-opacity: 0.5;
|
|
7076
|
-
fill: var(--redsift-color-neutral-lightgrey);
|
|
4598
|
+
g.pie-slice.deselected {
|
|
4599
|
+
path {
|
|
4600
|
+
fill-opacity: 0.5;
|
|
4601
|
+
fill: var(--redsift-color-neutral-lightgrey);
|
|
7077
4602
|
}
|
|
7078
4603
|
}
|
|
7079
4604
|
|
|
@@ -7354,7 +4879,8 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7354
4879
|
$spaced: variant === PieChartVariant.spaced || variant === PieChartVariant.spacedDonut,
|
|
7355
4880
|
$showLabels: labelVariant === PieChartLabelVariant.internal
|
|
7356
4881
|
}), /*#__PURE__*/React.createElement(StyledPieChartTitle, {
|
|
7357
|
-
className: `${PieChart.className}__title
|
|
4882
|
+
className: `${PieChart.className}__title`,
|
|
4883
|
+
alignItems: "center"
|
|
7358
4884
|
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
7359
4885
|
id: `id${id}__title`
|
|
7360
4886
|
}, title) : null, chart && isResetable ? /*#__PURE__*/React.createElement(Button, {
|
|
@@ -7366,7 +4892,9 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7366
4892
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({
|
|
7367
4893
|
type: DashboardReducerActionType.ResetFilter,
|
|
7368
4894
|
filter: {
|
|
7369
|
-
id: chart.anchorName()
|
|
4895
|
+
id: chart.anchorName(),
|
|
4896
|
+
columnField: datagridFilter.field,
|
|
4897
|
+
operatorValue: datagridFilter.operator
|
|
7370
4898
|
}
|
|
7371
4899
|
});
|
|
7372
4900
|
}
|
|
@@ -7403,7 +4931,24 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7403
4931
|
return /*#__PURE__*/React.createElement(StyledPieChartLabel, {
|
|
7404
4932
|
key: `pie-external-label _${index}`,
|
|
7405
4933
|
$color: d3colors(key)
|
|
7406
|
-
}, /*#__PURE__*/React.createElement("div", null), labelVariant === PieChartLabelVariant.externalLabelValue ? /*#__PURE__*/React.createElement(
|
|
4934
|
+
}, /*#__PURE__*/React.createElement("div", null), labelVariant === PieChartLabelVariant.externalLabelValue ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Number$1, {
|
|
4935
|
+
as: "b",
|
|
4936
|
+
maximumFractionDigits: 2,
|
|
4937
|
+
value: value,
|
|
4938
|
+
variant: "inherit"
|
|
4939
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
4940
|
+
variant: "caption"
|
|
4941
|
+
}, key)) : labelVariant === PieChartLabelVariant.externalLabelPercent ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Number$1, {
|
|
4942
|
+
as: "b",
|
|
4943
|
+
maximumFractionDigits: 2,
|
|
4944
|
+
type: "percent",
|
|
4945
|
+
value: value / sum(chart.data(), d => d.value),
|
|
4946
|
+
variant: "inherit"
|
|
4947
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
4948
|
+
variant: "caption"
|
|
4949
|
+
}, key)) : /*#__PURE__*/React.createElement(Text, {
|
|
4950
|
+
variant: "caption"
|
|
4951
|
+
}, key));
|
|
7407
4952
|
})) : null)), caption ? /*#__PURE__*/React.createElement(StyledPieChartCaption, {
|
|
7408
4953
|
className: `${PieChart.className}__caption`,
|
|
7409
4954
|
id: `id${id}__caption`
|
|
@@ -7475,14 +5020,10 @@ const StyledTimeSeriesBarChart = styled.div`
|
|
|
7475
5020
|
user-select: none;
|
|
7476
5021
|
}
|
|
7477
5022
|
`;
|
|
7478
|
-
const StyledTimeSeriesBarChartTitle = styled
|
|
7479
|
-
align-items: center;
|
|
7480
|
-
display: flex;
|
|
7481
|
-
flex-direction: row;
|
|
5023
|
+
const StyledTimeSeriesBarChartTitle = styled(Flexbox)`
|
|
7482
5024
|
font-family: var(--redsift-typography-h4-font-family);
|
|
7483
5025
|
font-size: var(--redsift-typography-h4-font-size);
|
|
7484
5026
|
font-weight: var(--redsift-typography-h4-font-weight);
|
|
7485
|
-
gap: 16px;
|
|
7486
5027
|
line-height: var(--redsift-typography-h4-line-height);
|
|
7487
5028
|
`;
|
|
7488
5029
|
const StyledTimeSeriesBarChartCaption = styled.p`
|
|
@@ -7567,39 +5108,39 @@ const parseDateTimeGroup = (data, dateTimeGroup, dateTimeFieldName) => {
|
|
|
7567
5108
|
switch (dateTimeGroup) {
|
|
7568
5109
|
case 'hour':
|
|
7569
5110
|
return {
|
|
7570
|
-
group: g =>
|
|
7571
|
-
round: x =>
|
|
7572
|
-
x:
|
|
7573
|
-
xUnits:
|
|
5111
|
+
group: g => timeHour(g),
|
|
5112
|
+
round: x => timeHour(x),
|
|
5113
|
+
x: scaleTime().domain([timeHour.offset(startDate, -1), timeHour.offset(endDate, 2)]),
|
|
5114
|
+
xUnits: timeHours
|
|
7574
5115
|
};
|
|
7575
5116
|
case 'day':
|
|
7576
5117
|
return {
|
|
7577
|
-
group: g =>
|
|
7578
|
-
round: x =>
|
|
7579
|
-
x:
|
|
7580
|
-
xUnits:
|
|
5118
|
+
group: g => timeDay(g),
|
|
5119
|
+
round: x => timeDay(x),
|
|
5120
|
+
x: scaleTime().domain([timeDay.offset(startDate, -1), timeDay.offset(endDate, 2)]),
|
|
5121
|
+
xUnits: timeDays
|
|
7581
5122
|
};
|
|
7582
5123
|
case 'week':
|
|
7583
5124
|
return {
|
|
7584
|
-
group: g =>
|
|
7585
|
-
round: x =>
|
|
7586
|
-
x:
|
|
7587
|
-
xUnits:
|
|
5125
|
+
group: g => timeWeek(g),
|
|
5126
|
+
round: x => timeWeek(x),
|
|
5127
|
+
x: scaleTime().domain([timeWeek.offset(startDate, -1), timeWeek.offset(endDate, 2)]),
|
|
5128
|
+
xUnits: timeWeeks
|
|
7588
5129
|
};
|
|
7589
5130
|
case 'year':
|
|
7590
5131
|
return {
|
|
7591
|
-
group: g =>
|
|
7592
|
-
round: x =>
|
|
7593
|
-
x:
|
|
7594
|
-
xUnits:
|
|
5132
|
+
group: g => timeYear(g),
|
|
5133
|
+
round: x => timeYear(x),
|
|
5134
|
+
x: scaleTime().domain([timeYear.offset(startDate, -2), timeYear.offset(endDate, 2)]),
|
|
5135
|
+
xUnits: timeYears
|
|
7595
5136
|
};
|
|
7596
5137
|
case 'month':
|
|
7597
5138
|
default:
|
|
7598
5139
|
return {
|
|
7599
|
-
group: g =>
|
|
7600
|
-
round: x =>
|
|
7601
|
-
x:
|
|
7602
|
-
xUnits:
|
|
5140
|
+
group: g => timeMonth(g),
|
|
5141
|
+
round: x => timeMonth(x),
|
|
5142
|
+
x: scaleTime().domain([timeMonth.offset(startDate, -1), timeMonth.offset(endDate, 2)]),
|
|
5143
|
+
xUnits: timeMonths
|
|
7603
5144
|
};
|
|
7604
5145
|
}
|
|
7605
5146
|
};
|
|
@@ -7796,10 +5337,10 @@ const TimeSeriesBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7796
5337
|
const chartFilters = chartFiltersObj === null || chartFiltersObj === void 0 ? void 0 : chartFiltersObj[0];
|
|
7797
5338
|
const chartFilterStart = chartFilters === null || chartFilters === void 0 ? void 0 : chartFilters[0];
|
|
7798
5339
|
const chartFilterEnd = chartFilters === null || chartFilters === void 0 ? void 0 : chartFilters[1];
|
|
7799
|
-
if (chartFilterStart !==
|
|
5340
|
+
if (chartFilterStart !== isoParse(filterStart.value) && chartFilterEnd !== isoParse(filterEnd.value)) {
|
|
7800
5341
|
var _d3isoParse, _d3isoParse2;
|
|
7801
5342
|
chart.filter(null);
|
|
7802
|
-
chart.filter(filters.RangedFilter(((_d3isoParse =
|
|
5343
|
+
chart.filter(filters.RangedFilter(((_d3isoParse = isoParse(filterStart.value)) === null || _d3isoParse === void 0 ? void 0 : _d3isoParse.getTime()) || 0, ((_d3isoParse2 = isoParse(filterEnd.value)) === null || _d3isoParse2 === void 0 ? void 0 : _d3isoParse2.getTime()) || 0));
|
|
7803
5344
|
redrawAll();
|
|
7804
5345
|
}
|
|
7805
5346
|
}
|
|
@@ -7808,7 +5349,8 @@ const TimeSeriesBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7808
5349
|
className: classNames(TimeSeriesBarChart.className, className),
|
|
7809
5350
|
ref: containerRef
|
|
7810
5351
|
}), /*#__PURE__*/React.createElement(StyledTimeSeriesBarChartTitle, {
|
|
7811
|
-
className: `${TimeSeriesBarChart.className}__title
|
|
5352
|
+
className: `${TimeSeriesBarChart.className}__title`,
|
|
5353
|
+
alignItems: "center"
|
|
7812
5354
|
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
7813
5355
|
id: `id${id}__title`
|
|
7814
5356
|
}, title) : null, chart && isResetable ? /*#__PURE__*/React.createElement(Button, {
|
|
@@ -7820,13 +5362,17 @@ const TimeSeriesBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7820
5362
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({
|
|
7821
5363
|
type: DashboardReducerActionType.ResetFilter,
|
|
7822
5364
|
filter: {
|
|
7823
|
-
id: `${chart.anchorName()}-start
|
|
5365
|
+
id: `${chart.anchorName()}-start`,
|
|
5366
|
+
columnField: columnToFilter,
|
|
5367
|
+
operatorValue: 'after'
|
|
7824
5368
|
}
|
|
7825
5369
|
});
|
|
7826
5370
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({
|
|
7827
5371
|
type: DashboardReducerActionType.ResetFilter,
|
|
7828
5372
|
filter: {
|
|
7829
|
-
id: `${chart.anchorName()}-end
|
|
5373
|
+
id: `${chart.anchorName()}-end`,
|
|
5374
|
+
columnField: columnToFilter,
|
|
5375
|
+
operatorValue: 'onOrBefore'
|
|
7830
5376
|
}
|
|
7831
5377
|
});
|
|
7832
5378
|
}
|