@redsift/dashboard 7.6.1 → 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 +255 -3195
- package/index.js.map +1 -1
- package/package.json +7 -4
package/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { config, rowChart, redrawAll, filterAll, pieChart, barChart, filters } f
|
|
|
9
9
|
import { saveAs } from 'file-saver';
|
|
10
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;
|
|
@@ -2641,10 +2641,10 @@ const StyledIcon = styled.span`
|
|
|
2641
2641
|
}}
|
|
2642
2642
|
`;
|
|
2643
2643
|
|
|
2644
|
-
const _excluded$
|
|
2645
|
-
const COMPONENT_NAME$
|
|
2646
|
-
const CLASSNAME$
|
|
2647
|
-
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 = {
|
|
2648
2648
|
size: IconSize.medium
|
|
2649
2649
|
};
|
|
2650
2650
|
|
|
@@ -2662,7 +2662,7 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2662
2662
|
size,
|
|
2663
2663
|
svgProps
|
|
2664
2664
|
} = props,
|
|
2665
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
2665
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$b);
|
|
2666
2666
|
return /*#__PURE__*/React.createElement(StyledIcon, _extends({}, forwardedProps, {
|
|
2667
2667
|
$color: color,
|
|
2668
2668
|
$size: size,
|
|
@@ -2684,9 +2684,9 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2684
2684
|
fill: "currentColor"
|
|
2685
2685
|
})), badge ? badge : null);
|
|
2686
2686
|
});
|
|
2687
|
-
Icon.className = CLASSNAME$
|
|
2688
|
-
Icon.defaultProps = DEFAULT_PROPS$
|
|
2689
|
-
Icon.displayName = COMPONENT_NAME$
|
|
2687
|
+
Icon.className = CLASSNAME$b;
|
|
2688
|
+
Icon.defaultProps = DEFAULT_PROPS$a;
|
|
2689
|
+
Icon.displayName = COMPONENT_NAME$b;
|
|
2690
2690
|
|
|
2691
2691
|
/**
|
|
2692
2692
|
* Component variant.
|
|
@@ -2869,7 +2869,7 @@ var spinnerTools = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My
|
|
|
2869
2869
|
|
|
2870
2870
|
var spinnerWebsite = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNDAwIDQwMCIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iIHRleHQtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogIDxzdHlsZT4KICAgIC5zcGlubmluZyB7CiAgICAgIGFuaW1hdGlvbjogc3Bpbm5pbmcta2V5ZnJhbWVzIDMwMDBtcyBsaW5lYXIgaW5maW5pdGUgbm9ybWFsIGZvcndhcmRzOwogICAgICB0cmFuc2Zvcm0tb3JpZ2luOiBjZW50ZXI7CiAgICAgIGFuaW1hdGlvbi10aW1pbmctZnVuY3Rpb246IGN1YmljLWJlemllcigwLjQyLCAwLCAwLjU4LCAxKTsKICAgIH0KICAgIEBrZXlmcmFtZXMgc3Bpbm5pbmcta2V5ZnJhbWVzIHsKICAgICAgMCUgewogICAgICAgIHRyYW5zZm9ybTogIHJvdGF0ZSgwZGVnKTsKICAgICAgfQoKICAgICAgMzMlIHsKICAgICAgICB0cmFuc2Zvcm06ICByb3RhdGUoMTgwZGVnKTsKICAgICAgfQoKICAgICAgNTAlIHsKICAgICAgICB0cmFuc2Zvcm06IHJvdGF0ZSgxODBkZWcpOwogICAgICB9CgogICAgICA4MyUgewogICAgICAgIHRyYW5zZm9ybTogIHJvdGF0ZSgzNjBkZWcpOwogICAgICB9CgogICAgICAxMDAlIHsKICAgICAgICB0cmFuc2Zvcm06ICByb3RhdGUoMzYwZGVnKQogICAgICB9CiAgICB9CiAgPC9zdHlsZT4KICA8cGF0aAogICAgbWFzaz0idXJsKCNzcGlubmVyLXUtbWFza3MpIgogICAgZmlsbD0iIzAwNzllMSIKICAgIGQ9Ik0zMTggMTg2LjlWMTA4LjhMMjAwIDU3IDgyIDEwOC44djc4LjFDODIgMjU5IDEzMi4zIDMyNi40IDIwMCAzNDNjNjcuNy0xNi42IDExOC04NCAxMTgtMTU2LjF6TTQwMCAyMDBjMCAxMTAuNS04OS41IDIwMC0yMDAgMjAwUzAgMzEwLjUgMCAyMDAgODkuNSAwIDIwMCAwczIwMCA4OS41IDIwMCAyMDB6IgogIC8+CiAgPG1hc2sgaWQ9InNwaW5uZXItdS1tYXNrcyI+CiAgICA8cGF0aAogICAgICBjbGFzcz0ic3Bpbm5pbmciCiAgICAgIGQ9Ik0wLDIwMEMwLDg5LjU0MzA1LDg5LjU0MzA1LDAsMjAwLDB2NDAwQzg5LjU0MzA1LDQwMCwwLDMxMC40NTY5NSwwLDIwMFoiCiAgICAgIGZpbGw9IiNmZmYiCiAgICAvPgogIDwvbWFzaz4KICA8cGF0aAogICAgbWFzaz0idXJsKCNzcGlubmVyLXUtbWFza3MyKSIKICAgIGZpbGw9IiMwMDc5ZTEiCiAgICBkPSJNODIsMTg2LjkzOXYtNzguMDg5TDIwMCw1N2wxMTgsNTEuODV2NzguMDg5QzMxOCwyNTkuMDAyLDI2Ny42ODYsMzI2LjQwMiwyMDAsMzQzQzEzMi4zMTQsMzI2LjQwMiw4MiwyNTkuMDAyLDgyLDE4Ni45MzlaIgogIC8+CiAgPG1hc2sgaWQ9InNwaW5uZXItdS1tYXNrczIiPgogICAgPHBhdGgKICAgICAgY2xhc3M9InNwaW5uaW5nIgogICAgICBkPSJNNDAwIDIwMEM0MDAgMzEwLjUgMzEwLjUgNDAwIDIwMCA0MDBWMGMxMTAuNSAwIDIwMCA4OS41IDIwMCAyMDB6IgogICAgICBmaWxsPSIjZmZmIgogICAgLz4KICA8L21hc2s+Cjwvc3ZnPg==';
|
|
2871
2871
|
|
|
2872
|
-
const _excluded$
|
|
2872
|
+
const _excluded$a = ["aria-hidden", "aria-label", "className", "color", "size"];
|
|
2873
2873
|
const colorToFile = {
|
|
2874
2874
|
default: spinnerDefault,
|
|
2875
2875
|
hardenize: spinnerHardenize,
|
|
@@ -2881,9 +2881,9 @@ const colorToFile = {
|
|
|
2881
2881
|
tools: spinnerTools,
|
|
2882
2882
|
website: spinnerWebsite
|
|
2883
2883
|
};
|
|
2884
|
-
const COMPONENT_NAME$
|
|
2885
|
-
const CLASSNAME$
|
|
2886
|
-
const DEFAULT_PROPS$
|
|
2884
|
+
const COMPONENT_NAME$a = 'Spinner';
|
|
2885
|
+
const CLASSNAME$a = 'redsift-shield';
|
|
2886
|
+
const DEFAULT_PROPS$9 = {
|
|
2887
2887
|
color: ColorPalette.default,
|
|
2888
2888
|
size: SpinnerSize.medium
|
|
2889
2889
|
};
|
|
@@ -2924,7 +2924,7 @@ const Spinner = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2924
2924
|
color: propsColor,
|
|
2925
2925
|
size
|
|
2926
2926
|
} = props,
|
|
2927
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
2927
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$a);
|
|
2928
2928
|
const {
|
|
2929
2929
|
width,
|
|
2930
2930
|
height
|
|
@@ -2946,14 +2946,14 @@ const Spinner = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2946
2946
|
$size: size
|
|
2947
2947
|
}));
|
|
2948
2948
|
});
|
|
2949
|
-
Spinner.className = CLASSNAME$
|
|
2950
|
-
Spinner.defaultProps = DEFAULT_PROPS$
|
|
2951
|
-
Spinner.displayName = COMPONENT_NAME$
|
|
2949
|
+
Spinner.className = CLASSNAME$a;
|
|
2950
|
+
Spinner.defaultProps = DEFAULT_PROPS$9;
|
|
2951
|
+
Spinner.displayName = COMPONENT_NAME$a;
|
|
2952
2952
|
|
|
2953
|
-
const _excluded$
|
|
2954
|
-
const COMPONENT_NAME$
|
|
2955
|
-
const CLASSNAME$
|
|
2956
|
-
const DEFAULT_PROPS$
|
|
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 = {
|
|
2957
2957
|
color: ColorPalette.default,
|
|
2958
2958
|
height: 'fit-content',
|
|
2959
2959
|
variant: ButtonVariant.primary
|
|
@@ -2990,7 +2990,7 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2990
2990
|
rightIcon,
|
|
2991
2991
|
variant
|
|
2992
2992
|
} = props,
|
|
2993
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
2993
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$9);
|
|
2994
2994
|
return /*#__PURE__*/React.createElement(StyledButton, _extends({}, forwardedProps, buttonProps, {
|
|
2995
2995
|
$color: color,
|
|
2996
2996
|
$fullWidth: fullWidth,
|
|
@@ -3014,9 +3014,50 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
3014
3014
|
className: "right"
|
|
3015
3015
|
}) : null);
|
|
3016
3016
|
});
|
|
3017
|
-
Button.className = CLASSNAME$
|
|
3018
|
-
Button.defaultProps = DEFAULT_PROPS$
|
|
3019
|
-
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;
|
|
3020
3061
|
|
|
3021
3062
|
/**
|
|
3022
3063
|
* Component variant.
|
|
@@ -3492,28 +3533,61 @@ let DashboardReducerActionType;
|
|
|
3492
3533
|
DashboardReducerActionType["ResetFilters"] = "reset-filters";
|
|
3493
3534
|
DashboardReducerActionType["FilterTable"] = "filter-table";
|
|
3494
3535
|
DashboardReducerActionType["FilterTableBatch"] = "filter-table-batch";
|
|
3536
|
+
DashboardReducerActionType["AppendFilterTableBatch"] = "append-filter-table-batch";
|
|
3495
3537
|
})(DashboardReducerActionType || (DashboardReducerActionType = {}));
|
|
3496
3538
|
|
|
3497
|
-
const
|
|
3539
|
+
const areEquals = (tableFilter, actionFilter) => {
|
|
3498
3540
|
return tableFilter.columnField === actionFilter.columnField && tableFilter.operatorValue === actionFilter.operatorValue;
|
|
3499
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
|
+
};
|
|
3500
3570
|
const DashboardReducer = (state, action) => {
|
|
3501
3571
|
switch (action.type) {
|
|
3502
3572
|
case DashboardReducerActionType.ResetFilter:
|
|
3503
3573
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
3504
|
-
tableFilters: state.tableFilters
|
|
3574
|
+
tableFilters: removeFilter(state.tableFilters, action.filter)
|
|
3505
3575
|
});
|
|
3506
3576
|
case DashboardReducerActionType.ResetFilters:
|
|
3507
3577
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
3508
|
-
tableFilters:
|
|
3578
|
+
tableFilters: removeAllFilters()
|
|
3509
3579
|
});
|
|
3510
3580
|
case DashboardReducerActionType.FilterTable:
|
|
3511
3581
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
3512
|
-
tableFilters:
|
|
3582
|
+
tableFilters: addOrUpdateFilter(state.tableFilters, action.filter)
|
|
3513
3583
|
});
|
|
3514
3584
|
case DashboardReducerActionType.FilterTableBatch:
|
|
3515
3585
|
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
3516
|
-
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)
|
|
3517
3591
|
});
|
|
3518
3592
|
}
|
|
3519
3593
|
};
|
|
@@ -3805,7 +3879,7 @@ const useChartAsListbox = _ref => {
|
|
|
3805
3879
|
chartRef.addEventListener('keydown', keydown);
|
|
3806
3880
|
});
|
|
3807
3881
|
chart.on('renderlet', () => {
|
|
3808
|
-
// Add role and aria attributes to
|
|
3882
|
+
// Add role and aria attributes to each option.
|
|
3809
3883
|
chart.selectAll(`${querySelector} > title`).attr('id', (_, index) => `id${id}__option-${index}-title`);
|
|
3810
3884
|
chart.selectAll(`${querySelector} > text`).attr('aria-hidden', 'true');
|
|
3811
3885
|
|
|
@@ -4026,7 +4100,8 @@ const HorizontalBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4026
4100
|
className: classNames(HorizontalBarChart.className, className),
|
|
4027
4101
|
ref: containerRef
|
|
4028
4102
|
}), /*#__PURE__*/React.createElement(StyledHorizontalBarChartTitle, {
|
|
4029
|
-
className: `${HorizontalBarChart.className}__title
|
|
4103
|
+
className: `${HorizontalBarChart.className}__title`,
|
|
4104
|
+
alignItems: "center"
|
|
4030
4105
|
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
4031
4106
|
id: `id${id}__title`
|
|
4032
4107
|
}, title) : null, chart && isResetable ? /*#__PURE__*/React.createElement(Button, {
|
|
@@ -4038,7 +4113,9 @@ const HorizontalBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4038
4113
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({
|
|
4039
4114
|
type: DashboardReducerActionType.ResetFilter,
|
|
4040
4115
|
filter: {
|
|
4041
|
-
id: chart.anchorName()
|
|
4116
|
+
id: chart.anchorName(),
|
|
4117
|
+
columnField: datagridFilter.field,
|
|
4118
|
+
operatorValue: datagridFilter.operator
|
|
4042
4119
|
}
|
|
4043
4120
|
});
|
|
4044
4121
|
}
|
|
@@ -4473,3156 +4550,135 @@ const PdfExportButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4473
4550
|
PdfExportButton.className = CLASSNAME$2;
|
|
4474
4551
|
PdfExportButton.displayName = COMPONENT_NAME$2;
|
|
4475
4552
|
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
}
|
|
4490
|
-
}
|
|
4553
|
+
/**
|
|
4554
|
+
* Component style.
|
|
4555
|
+
*/
|
|
4556
|
+
const StyledPieChart = styled.div`
|
|
4557
|
+
margin: 8px;
|
|
4558
|
+
padding: 8px;
|
|
4559
|
+
color: var(--redsift-color-neutral-black);
|
|
4560
|
+
|
|
4561
|
+
.redsift-piechart__title {
|
|
4562
|
+
display: flex;
|
|
4563
|
+
flex-direction: row;
|
|
4564
|
+
align-items: center;
|
|
4565
|
+
gap: 16px;
|
|
4491
4566
|
}
|
|
4492
|
-
return sum;
|
|
4493
|
-
}
|
|
4494
4567
|
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4568
|
+
${_ref => {
|
|
4569
|
+
let {
|
|
4570
|
+
$showLabels
|
|
4571
|
+
} = _ref;
|
|
4572
|
+
return !$showLabels ? css`
|
|
4573
|
+
g.pie-label-group text {
|
|
4574
|
+
display: none;
|
|
4575
|
+
}
|
|
4576
|
+
` : '';
|
|
4577
|
+
}}
|
|
4498
4578
|
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
: b >= a ? 0
|
|
4504
|
-
: NaN;
|
|
4505
|
-
}
|
|
4579
|
+
g.pie-slice {
|
|
4580
|
+
text {
|
|
4581
|
+
cursor: pointer;
|
|
4582
|
+
}
|
|
4506
4583
|
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
} else {
|
|
4520
|
-
compare1 = f === ascending || f === descending ? f : zero$1;
|
|
4521
|
-
compare2 = f;
|
|
4522
|
-
delta = f;
|
|
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
|
+
}}
|
|
4595
|
+
}
|
|
4523
4596
|
}
|
|
4524
4597
|
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
const mid = (lo + hi) >>> 1;
|
|
4530
|
-
if (compare2(a[mid], x) < 0) lo = mid + 1;
|
|
4531
|
-
else hi = mid;
|
|
4532
|
-
} while (lo < hi);
|
|
4598
|
+
g.pie-slice.deselected {
|
|
4599
|
+
path {
|
|
4600
|
+
fill-opacity: 0.5;
|
|
4601
|
+
fill: var(--redsift-color-neutral-lightgrey);
|
|
4533
4602
|
}
|
|
4534
|
-
return lo;
|
|
4535
4603
|
}
|
|
4536
4604
|
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
const mid = (lo + hi) >>> 1;
|
|
4542
|
-
if (compare2(a[mid], x) <= 0) lo = mid + 1;
|
|
4543
|
-
else hi = mid;
|
|
4544
|
-
} while (lo < hi);
|
|
4605
|
+
g.pie-slice.focused,
|
|
4606
|
+
g.pie-slice:hover {
|
|
4607
|
+
path {
|
|
4608
|
+
fill-opacity: 0.8;
|
|
4545
4609
|
}
|
|
4546
|
-
return lo;
|
|
4547
4610
|
}
|
|
4548
4611
|
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4612
|
+
g.pie-slice.deselected.focused {
|
|
4613
|
+
path {
|
|
4614
|
+
fill-opacity: 0.3;
|
|
4615
|
+
}
|
|
4552
4616
|
}
|
|
4553
4617
|
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
function zero$1() {
|
|
4558
|
-
return 0;
|
|
4559
|
-
}
|
|
4560
|
-
|
|
4561
|
-
function number$2(x) {
|
|
4562
|
-
return x === null ? NaN : +x;
|
|
4563
|
-
}
|
|
4564
|
-
|
|
4565
|
-
const ascendingBisect = bisector(ascending);
|
|
4566
|
-
const bisectRight = ascendingBisect.right;
|
|
4567
|
-
bisector(number$2).center;
|
|
4568
|
-
var bisect = bisectRight;
|
|
4569
|
-
|
|
4570
|
-
var e10 = Math.sqrt(50),
|
|
4571
|
-
e5 = Math.sqrt(10),
|
|
4572
|
-
e2 = Math.sqrt(2);
|
|
4573
|
-
|
|
4574
|
-
function tickStep(start, stop, count) {
|
|
4575
|
-
var step0 = Math.abs(stop - start) / Math.max(0, count),
|
|
4576
|
-
step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),
|
|
4577
|
-
error = step0 / step1;
|
|
4578
|
-
if (error >= e10) step1 *= 10;
|
|
4579
|
-
else if (error >= e5) step1 *= 5;
|
|
4580
|
-
else if (error >= e2) step1 *= 2;
|
|
4581
|
-
return stop < start ? -step1 : step1;
|
|
4582
|
-
}
|
|
4583
|
-
|
|
4584
|
-
function initRange(domain, range) {
|
|
4585
|
-
switch (arguments.length) {
|
|
4586
|
-
case 0: break;
|
|
4587
|
-
case 1: this.range(domain); break;
|
|
4588
|
-
default: this.range(range).domain(domain); break;
|
|
4618
|
+
svg:hover,
|
|
4619
|
+
svg:focus {
|
|
4620
|
+
outline: none;
|
|
4589
4621
|
}
|
|
4590
|
-
return this;
|
|
4591
|
-
}
|
|
4592
|
-
|
|
4593
|
-
function define(constructor, factory, prototype) {
|
|
4594
|
-
constructor.prototype = factory.prototype = prototype;
|
|
4595
|
-
prototype.constructor = constructor;
|
|
4596
|
-
}
|
|
4597
|
-
|
|
4598
|
-
function extend(parent, definition) {
|
|
4599
|
-
var prototype = Object.create(parent.prototype);
|
|
4600
|
-
for (var key in definition) prototype[key] = definition[key];
|
|
4601
|
-
return prototype;
|
|
4602
|
-
}
|
|
4603
|
-
|
|
4604
|
-
function Color() {}
|
|
4605
|
-
|
|
4606
|
-
var darker = 0.7;
|
|
4607
|
-
var brighter = 1 / darker;
|
|
4608
|
-
|
|
4609
|
-
var reI = "\\s*([+-]?\\d+)\\s*",
|
|
4610
|
-
reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
4611
|
-
reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
|
4612
|
-
reHex = /^#([0-9a-f]{3,8})$/,
|
|
4613
|
-
reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`),
|
|
4614
|
-
reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`),
|
|
4615
|
-
reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`),
|
|
4616
|
-
reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`),
|
|
4617
|
-
reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`),
|
|
4618
|
-
reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
|
|
4619
|
-
|
|
4620
|
-
var named = {
|
|
4621
|
-
aliceblue: 0xf0f8ff,
|
|
4622
|
-
antiquewhite: 0xfaebd7,
|
|
4623
|
-
aqua: 0x00ffff,
|
|
4624
|
-
aquamarine: 0x7fffd4,
|
|
4625
|
-
azure: 0xf0ffff,
|
|
4626
|
-
beige: 0xf5f5dc,
|
|
4627
|
-
bisque: 0xffe4c4,
|
|
4628
|
-
black: 0x000000,
|
|
4629
|
-
blanchedalmond: 0xffebcd,
|
|
4630
|
-
blue: 0x0000ff,
|
|
4631
|
-
blueviolet: 0x8a2be2,
|
|
4632
|
-
brown: 0xa52a2a,
|
|
4633
|
-
burlywood: 0xdeb887,
|
|
4634
|
-
cadetblue: 0x5f9ea0,
|
|
4635
|
-
chartreuse: 0x7fff00,
|
|
4636
|
-
chocolate: 0xd2691e,
|
|
4637
|
-
coral: 0xff7f50,
|
|
4638
|
-
cornflowerblue: 0x6495ed,
|
|
4639
|
-
cornsilk: 0xfff8dc,
|
|
4640
|
-
crimson: 0xdc143c,
|
|
4641
|
-
cyan: 0x00ffff,
|
|
4642
|
-
darkblue: 0x00008b,
|
|
4643
|
-
darkcyan: 0x008b8b,
|
|
4644
|
-
darkgoldenrod: 0xb8860b,
|
|
4645
|
-
darkgray: 0xa9a9a9,
|
|
4646
|
-
darkgreen: 0x006400,
|
|
4647
|
-
darkgrey: 0xa9a9a9,
|
|
4648
|
-
darkkhaki: 0xbdb76b,
|
|
4649
|
-
darkmagenta: 0x8b008b,
|
|
4650
|
-
darkolivegreen: 0x556b2f,
|
|
4651
|
-
darkorange: 0xff8c00,
|
|
4652
|
-
darkorchid: 0x9932cc,
|
|
4653
|
-
darkred: 0x8b0000,
|
|
4654
|
-
darksalmon: 0xe9967a,
|
|
4655
|
-
darkseagreen: 0x8fbc8f,
|
|
4656
|
-
darkslateblue: 0x483d8b,
|
|
4657
|
-
darkslategray: 0x2f4f4f,
|
|
4658
|
-
darkslategrey: 0x2f4f4f,
|
|
4659
|
-
darkturquoise: 0x00ced1,
|
|
4660
|
-
darkviolet: 0x9400d3,
|
|
4661
|
-
deeppink: 0xff1493,
|
|
4662
|
-
deepskyblue: 0x00bfff,
|
|
4663
|
-
dimgray: 0x696969,
|
|
4664
|
-
dimgrey: 0x696969,
|
|
4665
|
-
dodgerblue: 0x1e90ff,
|
|
4666
|
-
firebrick: 0xb22222,
|
|
4667
|
-
floralwhite: 0xfffaf0,
|
|
4668
|
-
forestgreen: 0x228b22,
|
|
4669
|
-
fuchsia: 0xff00ff,
|
|
4670
|
-
gainsboro: 0xdcdcdc,
|
|
4671
|
-
ghostwhite: 0xf8f8ff,
|
|
4672
|
-
gold: 0xffd700,
|
|
4673
|
-
goldenrod: 0xdaa520,
|
|
4674
|
-
gray: 0x808080,
|
|
4675
|
-
green: 0x008000,
|
|
4676
|
-
greenyellow: 0xadff2f,
|
|
4677
|
-
grey: 0x808080,
|
|
4678
|
-
honeydew: 0xf0fff0,
|
|
4679
|
-
hotpink: 0xff69b4,
|
|
4680
|
-
indianred: 0xcd5c5c,
|
|
4681
|
-
indigo: 0x4b0082,
|
|
4682
|
-
ivory: 0xfffff0,
|
|
4683
|
-
khaki: 0xf0e68c,
|
|
4684
|
-
lavender: 0xe6e6fa,
|
|
4685
|
-
lavenderblush: 0xfff0f5,
|
|
4686
|
-
lawngreen: 0x7cfc00,
|
|
4687
|
-
lemonchiffon: 0xfffacd,
|
|
4688
|
-
lightblue: 0xadd8e6,
|
|
4689
|
-
lightcoral: 0xf08080,
|
|
4690
|
-
lightcyan: 0xe0ffff,
|
|
4691
|
-
lightgoldenrodyellow: 0xfafad2,
|
|
4692
|
-
lightgray: 0xd3d3d3,
|
|
4693
|
-
lightgreen: 0x90ee90,
|
|
4694
|
-
lightgrey: 0xd3d3d3,
|
|
4695
|
-
lightpink: 0xffb6c1,
|
|
4696
|
-
lightsalmon: 0xffa07a,
|
|
4697
|
-
lightseagreen: 0x20b2aa,
|
|
4698
|
-
lightskyblue: 0x87cefa,
|
|
4699
|
-
lightslategray: 0x778899,
|
|
4700
|
-
lightslategrey: 0x778899,
|
|
4701
|
-
lightsteelblue: 0xb0c4de,
|
|
4702
|
-
lightyellow: 0xffffe0,
|
|
4703
|
-
lime: 0x00ff00,
|
|
4704
|
-
limegreen: 0x32cd32,
|
|
4705
|
-
linen: 0xfaf0e6,
|
|
4706
|
-
magenta: 0xff00ff,
|
|
4707
|
-
maroon: 0x800000,
|
|
4708
|
-
mediumaquamarine: 0x66cdaa,
|
|
4709
|
-
mediumblue: 0x0000cd,
|
|
4710
|
-
mediumorchid: 0xba55d3,
|
|
4711
|
-
mediumpurple: 0x9370db,
|
|
4712
|
-
mediumseagreen: 0x3cb371,
|
|
4713
|
-
mediumslateblue: 0x7b68ee,
|
|
4714
|
-
mediumspringgreen: 0x00fa9a,
|
|
4715
|
-
mediumturquoise: 0x48d1cc,
|
|
4716
|
-
mediumvioletred: 0xc71585,
|
|
4717
|
-
midnightblue: 0x191970,
|
|
4718
|
-
mintcream: 0xf5fffa,
|
|
4719
|
-
mistyrose: 0xffe4e1,
|
|
4720
|
-
moccasin: 0xffe4b5,
|
|
4721
|
-
navajowhite: 0xffdead,
|
|
4722
|
-
navy: 0x000080,
|
|
4723
|
-
oldlace: 0xfdf5e6,
|
|
4724
|
-
olive: 0x808000,
|
|
4725
|
-
olivedrab: 0x6b8e23,
|
|
4726
|
-
orange: 0xffa500,
|
|
4727
|
-
orangered: 0xff4500,
|
|
4728
|
-
orchid: 0xda70d6,
|
|
4729
|
-
palegoldenrod: 0xeee8aa,
|
|
4730
|
-
palegreen: 0x98fb98,
|
|
4731
|
-
paleturquoise: 0xafeeee,
|
|
4732
|
-
palevioletred: 0xdb7093,
|
|
4733
|
-
papayawhip: 0xffefd5,
|
|
4734
|
-
peachpuff: 0xffdab9,
|
|
4735
|
-
peru: 0xcd853f,
|
|
4736
|
-
pink: 0xffc0cb,
|
|
4737
|
-
plum: 0xdda0dd,
|
|
4738
|
-
powderblue: 0xb0e0e6,
|
|
4739
|
-
purple: 0x800080,
|
|
4740
|
-
rebeccapurple: 0x663399,
|
|
4741
|
-
red: 0xff0000,
|
|
4742
|
-
rosybrown: 0xbc8f8f,
|
|
4743
|
-
royalblue: 0x4169e1,
|
|
4744
|
-
saddlebrown: 0x8b4513,
|
|
4745
|
-
salmon: 0xfa8072,
|
|
4746
|
-
sandybrown: 0xf4a460,
|
|
4747
|
-
seagreen: 0x2e8b57,
|
|
4748
|
-
seashell: 0xfff5ee,
|
|
4749
|
-
sienna: 0xa0522d,
|
|
4750
|
-
silver: 0xc0c0c0,
|
|
4751
|
-
skyblue: 0x87ceeb,
|
|
4752
|
-
slateblue: 0x6a5acd,
|
|
4753
|
-
slategray: 0x708090,
|
|
4754
|
-
slategrey: 0x708090,
|
|
4755
|
-
snow: 0xfffafa,
|
|
4756
|
-
springgreen: 0x00ff7f,
|
|
4757
|
-
steelblue: 0x4682b4,
|
|
4758
|
-
tan: 0xd2b48c,
|
|
4759
|
-
teal: 0x008080,
|
|
4760
|
-
thistle: 0xd8bfd8,
|
|
4761
|
-
tomato: 0xff6347,
|
|
4762
|
-
turquoise: 0x40e0d0,
|
|
4763
|
-
violet: 0xee82ee,
|
|
4764
|
-
wheat: 0xf5deb3,
|
|
4765
|
-
white: 0xffffff,
|
|
4766
|
-
whitesmoke: 0xf5f5f5,
|
|
4767
|
-
yellow: 0xffff00,
|
|
4768
|
-
yellowgreen: 0x9acd32
|
|
4769
|
-
};
|
|
4770
|
-
|
|
4771
|
-
define(Color, color, {
|
|
4772
|
-
copy(channels) {
|
|
4773
|
-
return Object.assign(new this.constructor, this, channels);
|
|
4774
|
-
},
|
|
4775
|
-
displayable() {
|
|
4776
|
-
return this.rgb().displayable();
|
|
4777
|
-
},
|
|
4778
|
-
hex: color_formatHex, // Deprecated! Use color.formatHex.
|
|
4779
|
-
formatHex: color_formatHex,
|
|
4780
|
-
formatHex8: color_formatHex8,
|
|
4781
|
-
formatHsl: color_formatHsl,
|
|
4782
|
-
formatRgb: color_formatRgb,
|
|
4783
|
-
toString: color_formatRgb
|
|
4784
|
-
});
|
|
4785
|
-
|
|
4786
|
-
function color_formatHex() {
|
|
4787
|
-
return this.rgb().formatHex();
|
|
4788
|
-
}
|
|
4789
|
-
|
|
4790
|
-
function color_formatHex8() {
|
|
4791
|
-
return this.rgb().formatHex8();
|
|
4792
|
-
}
|
|
4793
|
-
|
|
4794
|
-
function color_formatHsl() {
|
|
4795
|
-
return hslConvert(this).formatHsl();
|
|
4796
|
-
}
|
|
4797
|
-
|
|
4798
|
-
function color_formatRgb() {
|
|
4799
|
-
return this.rgb().formatRgb();
|
|
4800
|
-
}
|
|
4801
|
-
|
|
4802
|
-
function color(format) {
|
|
4803
|
-
var m, l;
|
|
4804
|
-
format = (format + "").trim().toLowerCase();
|
|
4805
|
-
return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
|
|
4806
|
-
: l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
|
|
4807
|
-
: l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
|
|
4808
|
-
: 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
|
|
4809
|
-
: null) // invalid hex
|
|
4810
|
-
: (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
|
|
4811
|
-
: (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
|
|
4812
|
-
: (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
|
|
4813
|
-
: (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
|
|
4814
|
-
: (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
|
|
4815
|
-
: (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
|
|
4816
|
-
: named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
|
|
4817
|
-
: format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
|
|
4818
|
-
: null;
|
|
4819
|
-
}
|
|
4820
|
-
|
|
4821
|
-
function rgbn(n) {
|
|
4822
|
-
return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
|
|
4823
|
-
}
|
|
4824
|
-
|
|
4825
|
-
function rgba(r, g, b, a) {
|
|
4826
|
-
if (a <= 0) r = g = b = NaN;
|
|
4827
|
-
return new Rgb(r, g, b, a);
|
|
4828
|
-
}
|
|
4829
|
-
|
|
4830
|
-
function rgbConvert(o) {
|
|
4831
|
-
if (!(o instanceof Color)) o = color(o);
|
|
4832
|
-
if (!o) return new Rgb;
|
|
4833
|
-
o = o.rgb();
|
|
4834
|
-
return new Rgb(o.r, o.g, o.b, o.opacity);
|
|
4835
|
-
}
|
|
4836
|
-
|
|
4837
|
-
function rgb$1(r, g, b, opacity) {
|
|
4838
|
-
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
|
4839
|
-
}
|
|
4840
|
-
|
|
4841
|
-
function Rgb(r, g, b, opacity) {
|
|
4842
|
-
this.r = +r;
|
|
4843
|
-
this.g = +g;
|
|
4844
|
-
this.b = +b;
|
|
4845
|
-
this.opacity = +opacity;
|
|
4846
|
-
}
|
|
4847
|
-
|
|
4848
|
-
define(Rgb, rgb$1, extend(Color, {
|
|
4849
|
-
brighter(k) {
|
|
4850
|
-
k = k == null ? brighter : Math.pow(brighter, k);
|
|
4851
|
-
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
4852
|
-
},
|
|
4853
|
-
darker(k) {
|
|
4854
|
-
k = k == null ? darker : Math.pow(darker, k);
|
|
4855
|
-
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
|
4856
|
-
},
|
|
4857
|
-
rgb() {
|
|
4858
|
-
return this;
|
|
4859
|
-
},
|
|
4860
|
-
clamp() {
|
|
4861
|
-
return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
|
|
4862
|
-
},
|
|
4863
|
-
displayable() {
|
|
4864
|
-
return (-0.5 <= this.r && this.r < 255.5)
|
|
4865
|
-
&& (-0.5 <= this.g && this.g < 255.5)
|
|
4866
|
-
&& (-0.5 <= this.b && this.b < 255.5)
|
|
4867
|
-
&& (0 <= this.opacity && this.opacity <= 1);
|
|
4868
|
-
},
|
|
4869
|
-
hex: rgb_formatHex, // Deprecated! Use color.formatHex.
|
|
4870
|
-
formatHex: rgb_formatHex,
|
|
4871
|
-
formatHex8: rgb_formatHex8,
|
|
4872
|
-
formatRgb: rgb_formatRgb,
|
|
4873
|
-
toString: rgb_formatRgb
|
|
4874
|
-
}));
|
|
4875
|
-
|
|
4876
|
-
function rgb_formatHex() {
|
|
4877
|
-
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
|
|
4878
|
-
}
|
|
4879
|
-
|
|
4880
|
-
function rgb_formatHex8() {
|
|
4881
|
-
return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
4882
|
-
}
|
|
4883
4622
|
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
|
|
4887
|
-
}
|
|
4888
|
-
|
|
4889
|
-
function clampa(opacity) {
|
|
4890
|
-
return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
|
|
4891
|
-
}
|
|
4892
|
-
|
|
4893
|
-
function clampi(value) {
|
|
4894
|
-
return Math.max(0, Math.min(255, Math.round(value) || 0));
|
|
4895
|
-
}
|
|
4896
|
-
|
|
4897
|
-
function hex(value) {
|
|
4898
|
-
value = clampi(value);
|
|
4899
|
-
return (value < 16 ? "0" : "") + value.toString(16);
|
|
4900
|
-
}
|
|
4901
|
-
|
|
4902
|
-
function hsla(h, s, l, a) {
|
|
4903
|
-
if (a <= 0) h = s = l = NaN;
|
|
4904
|
-
else if (l <= 0 || l >= 1) h = s = NaN;
|
|
4905
|
-
else if (s <= 0) h = NaN;
|
|
4906
|
-
return new Hsl(h, s, l, a);
|
|
4907
|
-
}
|
|
4908
|
-
|
|
4909
|
-
function hslConvert(o) {
|
|
4910
|
-
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
|
4911
|
-
if (!(o instanceof Color)) o = color(o);
|
|
4912
|
-
if (!o) return new Hsl;
|
|
4913
|
-
if (o instanceof Hsl) return o;
|
|
4914
|
-
o = o.rgb();
|
|
4915
|
-
var r = o.r / 255,
|
|
4916
|
-
g = o.g / 255,
|
|
4917
|
-
b = o.b / 255,
|
|
4918
|
-
min = Math.min(r, g, b),
|
|
4919
|
-
max = Math.max(r, g, b),
|
|
4920
|
-
h = NaN,
|
|
4921
|
-
s = max - min,
|
|
4922
|
-
l = (max + min) / 2;
|
|
4923
|
-
if (s) {
|
|
4924
|
-
if (r === max) h = (g - b) / s + (g < b) * 6;
|
|
4925
|
-
else if (g === max) h = (b - r) / s + 2;
|
|
4926
|
-
else h = (r - g) / s + 4;
|
|
4927
|
-
s /= l < 0.5 ? max + min : 2 - max - min;
|
|
4928
|
-
h *= 60;
|
|
4929
|
-
} else {
|
|
4930
|
-
s = l > 0 && l < 1 ? 0 : h;
|
|
4623
|
+
svg:focus-visible {
|
|
4624
|
+
outline: auto;
|
|
4931
4625
|
}
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
this.l = +l;
|
|
4943
|
-
this.opacity = +opacity;
|
|
4944
|
-
}
|
|
4626
|
+
`;
|
|
4627
|
+
const StyledPieChartContainer = styled.div`
|
|
4628
|
+
display: flex;
|
|
4629
|
+
align-items: center;
|
|
4630
|
+
gap: 16px;
|
|
4631
|
+
font-family: var(--redsift-typography-font-family-source-code-pro);
|
|
4632
|
+
font-size: 11px;
|
|
4633
|
+
justify-content: center;
|
|
4634
|
+
margin: 8px 0;
|
|
4635
|
+
position: relative;
|
|
4945
4636
|
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
var h = this.h % 360 + (this.h < 0) * 360,
|
|
4957
|
-
s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
|
|
4958
|
-
l = this.l,
|
|
4959
|
-
m2 = l + (l < 0.5 ? l : 1 - l) * s,
|
|
4960
|
-
m1 = 2 * l - m2;
|
|
4961
|
-
return new Rgb(
|
|
4962
|
-
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
|
|
4963
|
-
hsl2rgb(h, m1, m2),
|
|
4964
|
-
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
|
|
4965
|
-
this.opacity
|
|
4966
|
-
);
|
|
4967
|
-
},
|
|
4968
|
-
clamp() {
|
|
4969
|
-
return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
|
|
4970
|
-
},
|
|
4971
|
-
displayable() {
|
|
4972
|
-
return (0 <= this.s && this.s <= 1 || isNaN(this.s))
|
|
4973
|
-
&& (0 <= this.l && this.l <= 1)
|
|
4974
|
-
&& (0 <= this.opacity && this.opacity <= 1);
|
|
4975
|
-
},
|
|
4976
|
-
formatHsl() {
|
|
4977
|
-
const a = clampa(this.opacity);
|
|
4978
|
-
return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
|
|
4637
|
+
.redsift-piechart-container__chart {
|
|
4638
|
+
position: relative;
|
|
4639
|
+
${_ref3 => {
|
|
4640
|
+
let {
|
|
4641
|
+
$isEmpty
|
|
4642
|
+
} = _ref3;
|
|
4643
|
+
return $isEmpty ? css`
|
|
4644
|
+
display: none;
|
|
4645
|
+
` : '';
|
|
4646
|
+
}};
|
|
4979
4647
|
}
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
function clamph(value) {
|
|
4983
|
-
value = (value || 0) % 360;
|
|
4984
|
-
return value < 0 ? value + 360 : value;
|
|
4985
|
-
}
|
|
4986
|
-
|
|
4987
|
-
function clampt(value) {
|
|
4988
|
-
return Math.max(0, Math.min(1, value || 0));
|
|
4989
|
-
}
|
|
4990
|
-
|
|
4991
|
-
/* From FvD 13.37, CSS Color Module Level 3 */
|
|
4992
|
-
function hsl2rgb(h, m1, m2) {
|
|
4993
|
-
return (h < 60 ? m1 + (m2 - m1) * h / 60
|
|
4994
|
-
: h < 180 ? m2
|
|
4995
|
-
: h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
|
|
4996
|
-
: m1) * 255;
|
|
4997
|
-
}
|
|
4998
|
-
|
|
4999
|
-
var constant = x => () => x;
|
|
5000
|
-
|
|
5001
|
-
function linear(a, d) {
|
|
5002
|
-
return function(t) {
|
|
5003
|
-
return a + t * d;
|
|
5004
|
-
};
|
|
5005
|
-
}
|
|
5006
|
-
|
|
5007
|
-
function exponential(a, b, y) {
|
|
5008
|
-
return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
|
|
5009
|
-
return Math.pow(a + t * b, y);
|
|
5010
|
-
};
|
|
5011
|
-
}
|
|
5012
|
-
|
|
5013
|
-
function gamma(y) {
|
|
5014
|
-
return (y = +y) === 1 ? nogamma : function(a, b) {
|
|
5015
|
-
return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
|
|
5016
|
-
};
|
|
5017
|
-
}
|
|
5018
|
-
|
|
5019
|
-
function nogamma(a, b) {
|
|
5020
|
-
var d = b - a;
|
|
5021
|
-
return d ? linear(a, d) : constant(isNaN(a) ? b : a);
|
|
5022
|
-
}
|
|
4648
|
+
`;
|
|
5023
4649
|
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
}
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
}
|
|
5056
|
-
|
|
5057
|
-
function isNumberArray(x) {
|
|
5058
|
-
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
5059
|
-
}
|
|
5060
|
-
|
|
5061
|
-
function genericArray(a, b) {
|
|
5062
|
-
var nb = b ? b.length : 0,
|
|
5063
|
-
na = a ? Math.min(nb, a.length) : 0,
|
|
5064
|
-
x = new Array(na),
|
|
5065
|
-
c = new Array(nb),
|
|
5066
|
-
i;
|
|
5067
|
-
|
|
5068
|
-
for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
|
|
5069
|
-
for (; i < nb; ++i) c[i] = b[i];
|
|
5070
|
-
|
|
5071
|
-
return function(t) {
|
|
5072
|
-
for (i = 0; i < na; ++i) c[i] = x[i](t);
|
|
5073
|
-
return c;
|
|
5074
|
-
};
|
|
5075
|
-
}
|
|
5076
|
-
|
|
5077
|
-
function date$1(a, b) {
|
|
5078
|
-
var d = new Date;
|
|
5079
|
-
return a = +a, b = +b, function(t) {
|
|
5080
|
-
return d.setTime(a * (1 - t) + b * t), d;
|
|
5081
|
-
};
|
|
5082
|
-
}
|
|
5083
|
-
|
|
5084
|
-
function interpolateNumber(a, b) {
|
|
5085
|
-
return a = +a, b = +b, function(t) {
|
|
5086
|
-
return a * (1 - t) + b * t;
|
|
5087
|
-
};
|
|
5088
|
-
}
|
|
5089
|
-
|
|
5090
|
-
function object(a, b) {
|
|
5091
|
-
var i = {},
|
|
5092
|
-
c = {},
|
|
5093
|
-
k;
|
|
5094
|
-
|
|
5095
|
-
if (a === null || typeof a !== "object") a = {};
|
|
5096
|
-
if (b === null || typeof b !== "object") b = {};
|
|
5097
|
-
|
|
5098
|
-
for (k in b) {
|
|
5099
|
-
if (k in a) {
|
|
5100
|
-
i[k] = interpolate(a[k], b[k]);
|
|
5101
|
-
} else {
|
|
5102
|
-
c[k] = b[k];
|
|
5103
|
-
}
|
|
5104
|
-
}
|
|
5105
|
-
|
|
5106
|
-
return function(t) {
|
|
5107
|
-
for (k in i) c[k] = i[k](t);
|
|
5108
|
-
return c;
|
|
5109
|
-
};
|
|
5110
|
-
}
|
|
5111
|
-
|
|
5112
|
-
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
|
|
5113
|
-
reB = new RegExp(reA.source, "g");
|
|
5114
|
-
|
|
5115
|
-
function zero(b) {
|
|
5116
|
-
return function() {
|
|
5117
|
-
return b;
|
|
5118
|
-
};
|
|
5119
|
-
}
|
|
5120
|
-
|
|
5121
|
-
function one(b) {
|
|
5122
|
-
return function(t) {
|
|
5123
|
-
return b(t) + "";
|
|
5124
|
-
};
|
|
5125
|
-
}
|
|
5126
|
-
|
|
5127
|
-
function string(a, b) {
|
|
5128
|
-
var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
|
|
5129
|
-
am, // current match in a
|
|
5130
|
-
bm, // current match in b
|
|
5131
|
-
bs, // string preceding current number in b, if any
|
|
5132
|
-
i = -1, // index in s
|
|
5133
|
-
s = [], // string constants and placeholders
|
|
5134
|
-
q = []; // number interpolators
|
|
5135
|
-
|
|
5136
|
-
// Coerce inputs to strings.
|
|
5137
|
-
a = a + "", b = b + "";
|
|
5138
|
-
|
|
5139
|
-
// Interpolate pairs of numbers in a & b.
|
|
5140
|
-
while ((am = reA.exec(a))
|
|
5141
|
-
&& (bm = reB.exec(b))) {
|
|
5142
|
-
if ((bs = bm.index) > bi) { // a string precedes the next number in b
|
|
5143
|
-
bs = b.slice(bi, bs);
|
|
5144
|
-
if (s[i]) s[i] += bs; // coalesce with previous string
|
|
5145
|
-
else s[++i] = bs;
|
|
5146
|
-
}
|
|
5147
|
-
if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
|
|
5148
|
-
if (s[i]) s[i] += bm; // coalesce with previous string
|
|
5149
|
-
else s[++i] = bm;
|
|
5150
|
-
} else { // interpolate non-matching numbers
|
|
5151
|
-
s[++i] = null;
|
|
5152
|
-
q.push({i: i, x: interpolateNumber(am, bm)});
|
|
5153
|
-
}
|
|
5154
|
-
bi = reB.lastIndex;
|
|
5155
|
-
}
|
|
5156
|
-
|
|
5157
|
-
// Add remains of b.
|
|
5158
|
-
if (bi < b.length) {
|
|
5159
|
-
bs = b.slice(bi);
|
|
5160
|
-
if (s[i]) s[i] += bs; // coalesce with previous string
|
|
5161
|
-
else s[++i] = bs;
|
|
5162
|
-
}
|
|
5163
|
-
|
|
5164
|
-
// Special optimization for only a single match.
|
|
5165
|
-
// Otherwise, interpolate each of the numbers and rejoin the string.
|
|
5166
|
-
return s.length < 2 ? (q[0]
|
|
5167
|
-
? one(q[0].x)
|
|
5168
|
-
: zero(b))
|
|
5169
|
-
: (b = q.length, function(t) {
|
|
5170
|
-
for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
|
|
5171
|
-
return s.join("");
|
|
5172
|
-
});
|
|
5173
|
-
}
|
|
5174
|
-
|
|
5175
|
-
function interpolate(a, b) {
|
|
5176
|
-
var t = typeof b, c;
|
|
5177
|
-
return b == null || t === "boolean" ? constant(b)
|
|
5178
|
-
: (t === "number" ? interpolateNumber
|
|
5179
|
-
: t === "string" ? ((c = color(b)) ? (b = c, rgb) : string)
|
|
5180
|
-
: b instanceof color ? rgb
|
|
5181
|
-
: b instanceof Date ? date$1
|
|
5182
|
-
: isNumberArray(b) ? numberArray
|
|
5183
|
-
: Array.isArray(b) ? genericArray
|
|
5184
|
-
: typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
|
|
5185
|
-
: interpolateNumber)(a, b);
|
|
5186
|
-
}
|
|
5187
|
-
|
|
5188
|
-
function interpolateRound(a, b) {
|
|
5189
|
-
return a = +a, b = +b, function(t) {
|
|
5190
|
-
return Math.round(a * (1 - t) + b * t);
|
|
5191
|
-
};
|
|
5192
|
-
}
|
|
5193
|
-
|
|
5194
|
-
function constants(x) {
|
|
5195
|
-
return function() {
|
|
5196
|
-
return x;
|
|
5197
|
-
};
|
|
5198
|
-
}
|
|
5199
|
-
|
|
5200
|
-
function number$1(x) {
|
|
5201
|
-
return +x;
|
|
5202
|
-
}
|
|
5203
|
-
|
|
5204
|
-
var unit = [0, 1];
|
|
5205
|
-
|
|
5206
|
-
function identity(x) {
|
|
5207
|
-
return x;
|
|
5208
|
-
}
|
|
5209
|
-
|
|
5210
|
-
function normalize(a, b) {
|
|
5211
|
-
return (b -= (a = +a))
|
|
5212
|
-
? function(x) { return (x - a) / b; }
|
|
5213
|
-
: constants(isNaN(b) ? NaN : 0.5);
|
|
5214
|
-
}
|
|
5215
|
-
|
|
5216
|
-
function clamper(a, b) {
|
|
5217
|
-
var t;
|
|
5218
|
-
if (a > b) t = a, a = b, b = t;
|
|
5219
|
-
return function(x) { return Math.max(a, Math.min(b, x)); };
|
|
5220
|
-
}
|
|
5221
|
-
|
|
5222
|
-
// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
|
|
5223
|
-
// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
|
|
5224
|
-
function bimap(domain, range, interpolate) {
|
|
5225
|
-
var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
|
|
5226
|
-
if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
|
|
5227
|
-
else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
|
|
5228
|
-
return function(x) { return r0(d0(x)); };
|
|
5229
|
-
}
|
|
5230
|
-
|
|
5231
|
-
function polymap(domain, range, interpolate) {
|
|
5232
|
-
var j = Math.min(domain.length, range.length) - 1,
|
|
5233
|
-
d = new Array(j),
|
|
5234
|
-
r = new Array(j),
|
|
5235
|
-
i = -1;
|
|
5236
|
-
|
|
5237
|
-
// Reverse descending domains.
|
|
5238
|
-
if (domain[j] < domain[0]) {
|
|
5239
|
-
domain = domain.slice().reverse();
|
|
5240
|
-
range = range.slice().reverse();
|
|
5241
|
-
}
|
|
5242
|
-
|
|
5243
|
-
while (++i < j) {
|
|
5244
|
-
d[i] = normalize(domain[i], domain[i + 1]);
|
|
5245
|
-
r[i] = interpolate(range[i], range[i + 1]);
|
|
5246
|
-
}
|
|
5247
|
-
|
|
5248
|
-
return function(x) {
|
|
5249
|
-
var i = bisect(domain, x, 1, j) - 1;
|
|
5250
|
-
return r[i](d[i](x));
|
|
5251
|
-
};
|
|
5252
|
-
}
|
|
5253
|
-
|
|
5254
|
-
function copy(source, target) {
|
|
5255
|
-
return target
|
|
5256
|
-
.domain(source.domain())
|
|
5257
|
-
.range(source.range())
|
|
5258
|
-
.interpolate(source.interpolate())
|
|
5259
|
-
.clamp(source.clamp())
|
|
5260
|
-
.unknown(source.unknown());
|
|
5261
|
-
}
|
|
5262
|
-
|
|
5263
|
-
function transformer() {
|
|
5264
|
-
var domain = unit,
|
|
5265
|
-
range = unit,
|
|
5266
|
-
interpolate$1 = interpolate,
|
|
5267
|
-
transform,
|
|
5268
|
-
untransform,
|
|
5269
|
-
unknown,
|
|
5270
|
-
clamp = identity,
|
|
5271
|
-
piecewise,
|
|
5272
|
-
output,
|
|
5273
|
-
input;
|
|
5274
|
-
|
|
5275
|
-
function rescale() {
|
|
5276
|
-
var n = Math.min(domain.length, range.length);
|
|
5277
|
-
if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);
|
|
5278
|
-
piecewise = n > 2 ? polymap : bimap;
|
|
5279
|
-
output = input = null;
|
|
5280
|
-
return scale;
|
|
5281
|
-
}
|
|
5282
|
-
|
|
5283
|
-
function scale(x) {
|
|
5284
|
-
return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
|
|
5285
|
-
}
|
|
5286
|
-
|
|
5287
|
-
scale.invert = function(y) {
|
|
5288
|
-
return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
|
|
5289
|
-
};
|
|
5290
|
-
|
|
5291
|
-
scale.domain = function(_) {
|
|
5292
|
-
return arguments.length ? (domain = Array.from(_, number$1), rescale()) : domain.slice();
|
|
5293
|
-
};
|
|
5294
|
-
|
|
5295
|
-
scale.range = function(_) {
|
|
5296
|
-
return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
|
|
5297
|
-
};
|
|
5298
|
-
|
|
5299
|
-
scale.rangeRound = function(_) {
|
|
5300
|
-
return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
|
|
5301
|
-
};
|
|
5302
|
-
|
|
5303
|
-
scale.clamp = function(_) {
|
|
5304
|
-
return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
|
|
5305
|
-
};
|
|
5306
|
-
|
|
5307
|
-
scale.interpolate = function(_) {
|
|
5308
|
-
return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
|
|
5309
|
-
};
|
|
5310
|
-
|
|
5311
|
-
scale.unknown = function(_) {
|
|
5312
|
-
return arguments.length ? (unknown = _, scale) : unknown;
|
|
5313
|
-
};
|
|
5314
|
-
|
|
5315
|
-
return function(t, u) {
|
|
5316
|
-
transform = t, untransform = u;
|
|
5317
|
-
return rescale();
|
|
5318
|
-
};
|
|
5319
|
-
}
|
|
5320
|
-
|
|
5321
|
-
function continuous() {
|
|
5322
|
-
return transformer()(identity, identity);
|
|
5323
|
-
}
|
|
5324
|
-
|
|
5325
|
-
function nice(domain, interval) {
|
|
5326
|
-
domain = domain.slice();
|
|
5327
|
-
|
|
5328
|
-
var i0 = 0,
|
|
5329
|
-
i1 = domain.length - 1,
|
|
5330
|
-
x0 = domain[i0],
|
|
5331
|
-
x1 = domain[i1],
|
|
5332
|
-
t;
|
|
5333
|
-
|
|
5334
|
-
if (x1 < x0) {
|
|
5335
|
-
t = i0, i0 = i1, i1 = t;
|
|
5336
|
-
t = x0, x0 = x1, x1 = t;
|
|
5337
|
-
}
|
|
5338
|
-
|
|
5339
|
-
domain[i0] = interval.floor(x0);
|
|
5340
|
-
domain[i1] = interval.ceil(x1);
|
|
5341
|
-
return domain;
|
|
5342
|
-
}
|
|
5343
|
-
|
|
5344
|
-
var t0$1 = new Date,
|
|
5345
|
-
t1$1 = new Date;
|
|
5346
|
-
|
|
5347
|
-
function newInterval$1(floori, offseti, count, field) {
|
|
5348
|
-
|
|
5349
|
-
function interval(date) {
|
|
5350
|
-
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
|
5351
|
-
}
|
|
5352
|
-
|
|
5353
|
-
interval.floor = function(date) {
|
|
5354
|
-
return floori(date = new Date(+date)), date;
|
|
5355
|
-
};
|
|
5356
|
-
|
|
5357
|
-
interval.ceil = function(date) {
|
|
5358
|
-
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
|
5359
|
-
};
|
|
5360
|
-
|
|
5361
|
-
interval.round = function(date) {
|
|
5362
|
-
var d0 = interval(date),
|
|
5363
|
-
d1 = interval.ceil(date);
|
|
5364
|
-
return date - d0 < d1 - date ? d0 : d1;
|
|
5365
|
-
};
|
|
5366
|
-
|
|
5367
|
-
interval.offset = function(date, step) {
|
|
5368
|
-
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
|
5369
|
-
};
|
|
5370
|
-
|
|
5371
|
-
interval.range = function(start, stop, step) {
|
|
5372
|
-
var range = [], previous;
|
|
5373
|
-
start = interval.ceil(start);
|
|
5374
|
-
step = step == null ? 1 : Math.floor(step);
|
|
5375
|
-
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
|
5376
|
-
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
|
5377
|
-
while (previous < start && start < stop);
|
|
5378
|
-
return range;
|
|
5379
|
-
};
|
|
5380
|
-
|
|
5381
|
-
interval.filter = function(test) {
|
|
5382
|
-
return newInterval$1(function(date) {
|
|
5383
|
-
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
|
5384
|
-
}, function(date, step) {
|
|
5385
|
-
if (date >= date) {
|
|
5386
|
-
if (step < 0) while (++step <= 0) {
|
|
5387
|
-
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
|
5388
|
-
} else while (--step >= 0) {
|
|
5389
|
-
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
|
|
5390
|
-
}
|
|
5391
|
-
}
|
|
5392
|
-
});
|
|
5393
|
-
};
|
|
5394
|
-
|
|
5395
|
-
if (count) {
|
|
5396
|
-
interval.count = function(start, end) {
|
|
5397
|
-
t0$1.setTime(+start), t1$1.setTime(+end);
|
|
5398
|
-
floori(t0$1), floori(t1$1);
|
|
5399
|
-
return Math.floor(count(t0$1, t1$1));
|
|
5400
|
-
};
|
|
5401
|
-
|
|
5402
|
-
interval.every = function(step) {
|
|
5403
|
-
step = Math.floor(step);
|
|
5404
|
-
return !isFinite(step) || !(step > 0) ? null
|
|
5405
|
-
: !(step > 1) ? interval
|
|
5406
|
-
: interval.filter(field
|
|
5407
|
-
? function(d) { return field(d) % step === 0; }
|
|
5408
|
-
: function(d) { return interval.count(0, d) % step === 0; });
|
|
5409
|
-
};
|
|
5410
|
-
}
|
|
5411
|
-
|
|
5412
|
-
return interval;
|
|
5413
|
-
}
|
|
5414
|
-
|
|
5415
|
-
var millisecond = newInterval$1(function() {
|
|
5416
|
-
// noop
|
|
5417
|
-
}, function(date, step) {
|
|
5418
|
-
date.setTime(+date + step);
|
|
5419
|
-
}, function(start, end) {
|
|
5420
|
-
return end - start;
|
|
5421
|
-
});
|
|
5422
|
-
|
|
5423
|
-
// An optimized implementation for this simple case.
|
|
5424
|
-
millisecond.every = function(k) {
|
|
5425
|
-
k = Math.floor(k);
|
|
5426
|
-
if (!isFinite(k) || !(k > 0)) return null;
|
|
5427
|
-
if (!(k > 1)) return millisecond;
|
|
5428
|
-
return newInterval$1(function(date) {
|
|
5429
|
-
date.setTime(Math.floor(date / k) * k);
|
|
5430
|
-
}, function(date, step) {
|
|
5431
|
-
date.setTime(+date + step * k);
|
|
5432
|
-
}, function(start, end) {
|
|
5433
|
-
return (end - start) / k;
|
|
5434
|
-
});
|
|
5435
|
-
};
|
|
5436
|
-
|
|
5437
|
-
var millisecond$1 = millisecond;
|
|
5438
|
-
millisecond.range;
|
|
5439
|
-
|
|
5440
|
-
const durationSecond$1 = 1000;
|
|
5441
|
-
const durationMinute$1 = durationSecond$1 * 60;
|
|
5442
|
-
const durationHour$1 = durationMinute$1 * 60;
|
|
5443
|
-
const durationDay$1 = durationHour$1 * 24;
|
|
5444
|
-
const durationWeek$1 = durationDay$1 * 7;
|
|
5445
|
-
const durationMonth = durationDay$1 * 30;
|
|
5446
|
-
const durationYear = durationDay$1 * 365;
|
|
5447
|
-
|
|
5448
|
-
var second = newInterval$1(function(date) {
|
|
5449
|
-
date.setTime(date - date.getMilliseconds());
|
|
5450
|
-
}, function(date, step) {
|
|
5451
|
-
date.setTime(+date + step * durationSecond$1);
|
|
5452
|
-
}, function(start, end) {
|
|
5453
|
-
return (end - start) / durationSecond$1;
|
|
5454
|
-
}, function(date) {
|
|
5455
|
-
return date.getUTCSeconds();
|
|
5456
|
-
});
|
|
5457
|
-
|
|
5458
|
-
var utcSecond = second;
|
|
5459
|
-
second.range;
|
|
5460
|
-
|
|
5461
|
-
var minute = newInterval$1(function(date) {
|
|
5462
|
-
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond$1);
|
|
5463
|
-
}, function(date, step) {
|
|
5464
|
-
date.setTime(+date + step * durationMinute$1);
|
|
5465
|
-
}, function(start, end) {
|
|
5466
|
-
return (end - start) / durationMinute$1;
|
|
5467
|
-
}, function(date) {
|
|
5468
|
-
return date.getMinutes();
|
|
5469
|
-
});
|
|
5470
|
-
|
|
5471
|
-
var timeMinute = minute;
|
|
5472
|
-
minute.range;
|
|
5473
|
-
|
|
5474
|
-
var hour$1 = newInterval$1(function(date) {
|
|
5475
|
-
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond$1 - date.getMinutes() * durationMinute$1);
|
|
5476
|
-
}, function(date, step) {
|
|
5477
|
-
date.setTime(+date + step * durationHour$1);
|
|
5478
|
-
}, function(start, end) {
|
|
5479
|
-
return (end - start) / durationHour$1;
|
|
5480
|
-
}, function(date) {
|
|
5481
|
-
return date.getHours();
|
|
5482
|
-
});
|
|
5483
|
-
|
|
5484
|
-
var timeHour = hour$1;
|
|
5485
|
-
hour$1.range;
|
|
5486
|
-
|
|
5487
|
-
var day$1 = newInterval$1(
|
|
5488
|
-
date => date.setHours(0, 0, 0, 0),
|
|
5489
|
-
(date, step) => date.setDate(date.getDate() + step),
|
|
5490
|
-
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute$1) / durationDay$1,
|
|
5491
|
-
date => date.getDate() - 1
|
|
5492
|
-
);
|
|
5493
|
-
|
|
5494
|
-
var timeDay = day$1;
|
|
5495
|
-
day$1.range;
|
|
5496
|
-
|
|
5497
|
-
function weekday$1(i) {
|
|
5498
|
-
return newInterval$1(function(date) {
|
|
5499
|
-
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
5500
|
-
date.setHours(0, 0, 0, 0);
|
|
5501
|
-
}, function(date, step) {
|
|
5502
|
-
date.setDate(date.getDate() + step * 7);
|
|
5503
|
-
}, function(start, end) {
|
|
5504
|
-
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute$1) / durationWeek$1;
|
|
5505
|
-
});
|
|
5506
|
-
}
|
|
5507
|
-
|
|
5508
|
-
var sunday$1 = weekday$1(0);
|
|
5509
|
-
var monday$1 = weekday$1(1);
|
|
5510
|
-
var tuesday$1 = weekday$1(2);
|
|
5511
|
-
var wednesday$1 = weekday$1(3);
|
|
5512
|
-
var thursday$1 = weekday$1(4);
|
|
5513
|
-
var friday$1 = weekday$1(5);
|
|
5514
|
-
var saturday$1 = weekday$1(6);
|
|
5515
|
-
|
|
5516
|
-
sunday$1.range;
|
|
5517
|
-
monday$1.range;
|
|
5518
|
-
tuesday$1.range;
|
|
5519
|
-
wednesday$1.range;
|
|
5520
|
-
thursday$1.range;
|
|
5521
|
-
friday$1.range;
|
|
5522
|
-
saturday$1.range;
|
|
5523
|
-
|
|
5524
|
-
var month$1 = newInterval$1(function(date) {
|
|
5525
|
-
date.setDate(1);
|
|
5526
|
-
date.setHours(0, 0, 0, 0);
|
|
5527
|
-
}, function(date, step) {
|
|
5528
|
-
date.setMonth(date.getMonth() + step);
|
|
5529
|
-
}, function(start, end) {
|
|
5530
|
-
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
|
5531
|
-
}, function(date) {
|
|
5532
|
-
return date.getMonth();
|
|
5533
|
-
});
|
|
5534
|
-
|
|
5535
|
-
var timeMonth = month$1;
|
|
5536
|
-
month$1.range;
|
|
5537
|
-
|
|
5538
|
-
var year$1 = newInterval$1(function(date) {
|
|
5539
|
-
date.setMonth(0, 1);
|
|
5540
|
-
date.setHours(0, 0, 0, 0);
|
|
5541
|
-
}, function(date, step) {
|
|
5542
|
-
date.setFullYear(date.getFullYear() + step);
|
|
5543
|
-
}, function(start, end) {
|
|
5544
|
-
return end.getFullYear() - start.getFullYear();
|
|
5545
|
-
}, function(date) {
|
|
5546
|
-
return date.getFullYear();
|
|
5547
|
-
});
|
|
5548
|
-
|
|
5549
|
-
// An optimized implementation for this simple case.
|
|
5550
|
-
year$1.every = function(k) {
|
|
5551
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval$1(function(date) {
|
|
5552
|
-
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
5553
|
-
date.setMonth(0, 1);
|
|
5554
|
-
date.setHours(0, 0, 0, 0);
|
|
5555
|
-
}, function(date, step) {
|
|
5556
|
-
date.setFullYear(date.getFullYear() + step * k);
|
|
5557
|
-
});
|
|
5558
|
-
};
|
|
5559
|
-
|
|
5560
|
-
var timeYear = year$1;
|
|
5561
|
-
year$1.range;
|
|
5562
|
-
|
|
5563
|
-
var utcMinute = newInterval$1(function(date) {
|
|
5564
|
-
date.setUTCSeconds(0, 0);
|
|
5565
|
-
}, function(date, step) {
|
|
5566
|
-
date.setTime(+date + step * durationMinute$1);
|
|
5567
|
-
}, function(start, end) {
|
|
5568
|
-
return (end - start) / durationMinute$1;
|
|
5569
|
-
}, function(date) {
|
|
5570
|
-
return date.getUTCMinutes();
|
|
5571
|
-
});
|
|
5572
|
-
|
|
5573
|
-
var utcMinute$1 = utcMinute;
|
|
5574
|
-
utcMinute.range;
|
|
5575
|
-
|
|
5576
|
-
var utcHour = newInterval$1(function(date) {
|
|
5577
|
-
date.setUTCMinutes(0, 0, 0);
|
|
5578
|
-
}, function(date, step) {
|
|
5579
|
-
date.setTime(+date + step * durationHour$1);
|
|
5580
|
-
}, function(start, end) {
|
|
5581
|
-
return (end - start) / durationHour$1;
|
|
5582
|
-
}, function(date) {
|
|
5583
|
-
return date.getUTCHours();
|
|
5584
|
-
});
|
|
5585
|
-
|
|
5586
|
-
var utcHour$1 = utcHour;
|
|
5587
|
-
utcHour.range;
|
|
5588
|
-
|
|
5589
|
-
var utcDay$2 = newInterval$1(function(date) {
|
|
5590
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
5591
|
-
}, function(date, step) {
|
|
5592
|
-
date.setUTCDate(date.getUTCDate() + step);
|
|
5593
|
-
}, function(start, end) {
|
|
5594
|
-
return (end - start) / durationDay$1;
|
|
5595
|
-
}, function(date) {
|
|
5596
|
-
return date.getUTCDate() - 1;
|
|
5597
|
-
});
|
|
5598
|
-
|
|
5599
|
-
var utcDay$3 = utcDay$2;
|
|
5600
|
-
utcDay$2.range;
|
|
5601
|
-
|
|
5602
|
-
function utcWeekday$1(i) {
|
|
5603
|
-
return newInterval$1(function(date) {
|
|
5604
|
-
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
|
5605
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
5606
|
-
}, function(date, step) {
|
|
5607
|
-
date.setUTCDate(date.getUTCDate() + step * 7);
|
|
5608
|
-
}, function(start, end) {
|
|
5609
|
-
return (end - start) / durationWeek$1;
|
|
5610
|
-
});
|
|
5611
|
-
}
|
|
5612
|
-
|
|
5613
|
-
var utcSunday$1 = utcWeekday$1(0);
|
|
5614
|
-
var utcMonday$1 = utcWeekday$1(1);
|
|
5615
|
-
var utcTuesday$1 = utcWeekday$1(2);
|
|
5616
|
-
var utcWednesday$1 = utcWeekday$1(3);
|
|
5617
|
-
var utcThursday$1 = utcWeekday$1(4);
|
|
5618
|
-
var utcFriday$1 = utcWeekday$1(5);
|
|
5619
|
-
var utcSaturday$1 = utcWeekday$1(6);
|
|
5620
|
-
|
|
5621
|
-
utcSunday$1.range;
|
|
5622
|
-
utcMonday$1.range;
|
|
5623
|
-
utcTuesday$1.range;
|
|
5624
|
-
utcWednesday$1.range;
|
|
5625
|
-
utcThursday$1.range;
|
|
5626
|
-
utcFriday$1.range;
|
|
5627
|
-
utcSaturday$1.range;
|
|
5628
|
-
|
|
5629
|
-
var utcMonth = newInterval$1(function(date) {
|
|
5630
|
-
date.setUTCDate(1);
|
|
5631
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
5632
|
-
}, function(date, step) {
|
|
5633
|
-
date.setUTCMonth(date.getUTCMonth() + step);
|
|
5634
|
-
}, function(start, end) {
|
|
5635
|
-
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
|
5636
|
-
}, function(date) {
|
|
5637
|
-
return date.getUTCMonth();
|
|
5638
|
-
});
|
|
5639
|
-
|
|
5640
|
-
var utcMonth$1 = utcMonth;
|
|
5641
|
-
utcMonth.range;
|
|
5642
|
-
|
|
5643
|
-
var utcYear$2 = newInterval$1(function(date) {
|
|
5644
|
-
date.setUTCMonth(0, 1);
|
|
5645
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
5646
|
-
}, function(date, step) {
|
|
5647
|
-
date.setUTCFullYear(date.getUTCFullYear() + step);
|
|
5648
|
-
}, function(start, end) {
|
|
5649
|
-
return end.getUTCFullYear() - start.getUTCFullYear();
|
|
5650
|
-
}, function(date) {
|
|
5651
|
-
return date.getUTCFullYear();
|
|
5652
|
-
});
|
|
5653
|
-
|
|
5654
|
-
// An optimized implementation for this simple case.
|
|
5655
|
-
utcYear$2.every = function(k) {
|
|
5656
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval$1(function(date) {
|
|
5657
|
-
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
|
5658
|
-
date.setUTCMonth(0, 1);
|
|
5659
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
5660
|
-
}, function(date, step) {
|
|
5661
|
-
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
|
5662
|
-
});
|
|
5663
|
-
};
|
|
5664
|
-
|
|
5665
|
-
var utcYear$3 = utcYear$2;
|
|
5666
|
-
utcYear$2.range;
|
|
5667
|
-
|
|
5668
|
-
function ticker(year, month, week, day, hour, minute) {
|
|
5669
|
-
|
|
5670
|
-
const tickIntervals = [
|
|
5671
|
-
[utcSecond, 1, durationSecond$1],
|
|
5672
|
-
[utcSecond, 5, 5 * durationSecond$1],
|
|
5673
|
-
[utcSecond, 15, 15 * durationSecond$1],
|
|
5674
|
-
[utcSecond, 30, 30 * durationSecond$1],
|
|
5675
|
-
[minute, 1, durationMinute$1],
|
|
5676
|
-
[minute, 5, 5 * durationMinute$1],
|
|
5677
|
-
[minute, 15, 15 * durationMinute$1],
|
|
5678
|
-
[minute, 30, 30 * durationMinute$1],
|
|
5679
|
-
[ hour, 1, durationHour$1 ],
|
|
5680
|
-
[ hour, 3, 3 * durationHour$1 ],
|
|
5681
|
-
[ hour, 6, 6 * durationHour$1 ],
|
|
5682
|
-
[ hour, 12, 12 * durationHour$1 ],
|
|
5683
|
-
[ day, 1, durationDay$1 ],
|
|
5684
|
-
[ day, 2, 2 * durationDay$1 ],
|
|
5685
|
-
[ week, 1, durationWeek$1 ],
|
|
5686
|
-
[ month, 1, durationMonth ],
|
|
5687
|
-
[ month, 3, 3 * durationMonth ],
|
|
5688
|
-
[ year, 1, durationYear ]
|
|
5689
|
-
];
|
|
5690
|
-
|
|
5691
|
-
function ticks(start, stop, count) {
|
|
5692
|
-
const reverse = stop < start;
|
|
5693
|
-
if (reverse) [start, stop] = [stop, start];
|
|
5694
|
-
const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count);
|
|
5695
|
-
const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop
|
|
5696
|
-
return reverse ? ticks.reverse() : ticks;
|
|
5697
|
-
}
|
|
5698
|
-
|
|
5699
|
-
function tickInterval(start, stop, count) {
|
|
5700
|
-
const target = Math.abs(stop - start) / count;
|
|
5701
|
-
const i = bisector(([,, step]) => step).right(tickIntervals, target);
|
|
5702
|
-
if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));
|
|
5703
|
-
if (i === 0) return millisecond$1.every(Math.max(tickStep(start, stop, count), 1));
|
|
5704
|
-
const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
|
|
5705
|
-
return t.every(step);
|
|
5706
|
-
}
|
|
5707
|
-
|
|
5708
|
-
return [ticks, tickInterval];
|
|
5709
|
-
}
|
|
5710
|
-
|
|
5711
|
-
ticker(utcYear$3, utcMonth$1, utcSunday$1, utcDay$3, utcHour$1, utcMinute$1);
|
|
5712
|
-
const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, sunday$1, timeDay, timeHour, timeMinute);
|
|
5713
|
-
|
|
5714
|
-
function localDate$1(d) {
|
|
5715
|
-
if (0 <= d.y && d.y < 100) {
|
|
5716
|
-
var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
5717
|
-
date.setFullYear(d.y);
|
|
5718
|
-
return date;
|
|
5719
|
-
}
|
|
5720
|
-
return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
5721
|
-
}
|
|
5722
|
-
|
|
5723
|
-
function utcDate$1(d) {
|
|
5724
|
-
if (0 <= d.y && d.y < 100) {
|
|
5725
|
-
var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
5726
|
-
date.setUTCFullYear(d.y);
|
|
5727
|
-
return date;
|
|
5728
|
-
}
|
|
5729
|
-
return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
5730
|
-
}
|
|
5731
|
-
|
|
5732
|
-
function newDate$1(y, m, d) {
|
|
5733
|
-
return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};
|
|
5734
|
-
}
|
|
5735
|
-
|
|
5736
|
-
function formatLocale$1(locale) {
|
|
5737
|
-
var locale_dateTime = locale.dateTime,
|
|
5738
|
-
locale_date = locale.date,
|
|
5739
|
-
locale_time = locale.time,
|
|
5740
|
-
locale_periods = locale.periods,
|
|
5741
|
-
locale_weekdays = locale.days,
|
|
5742
|
-
locale_shortWeekdays = locale.shortDays,
|
|
5743
|
-
locale_months = locale.months,
|
|
5744
|
-
locale_shortMonths = locale.shortMonths;
|
|
5745
|
-
|
|
5746
|
-
var periodRe = formatRe$1(locale_periods),
|
|
5747
|
-
periodLookup = formatLookup$1(locale_periods),
|
|
5748
|
-
weekdayRe = formatRe$1(locale_weekdays),
|
|
5749
|
-
weekdayLookup = formatLookup$1(locale_weekdays),
|
|
5750
|
-
shortWeekdayRe = formatRe$1(locale_shortWeekdays),
|
|
5751
|
-
shortWeekdayLookup = formatLookup$1(locale_shortWeekdays),
|
|
5752
|
-
monthRe = formatRe$1(locale_months),
|
|
5753
|
-
monthLookup = formatLookup$1(locale_months),
|
|
5754
|
-
shortMonthRe = formatRe$1(locale_shortMonths),
|
|
5755
|
-
shortMonthLookup = formatLookup$1(locale_shortMonths);
|
|
5756
|
-
|
|
5757
|
-
var formats = {
|
|
5758
|
-
"a": formatShortWeekday,
|
|
5759
|
-
"A": formatWeekday,
|
|
5760
|
-
"b": formatShortMonth,
|
|
5761
|
-
"B": formatMonth,
|
|
5762
|
-
"c": null,
|
|
5763
|
-
"d": formatDayOfMonth$1,
|
|
5764
|
-
"e": formatDayOfMonth$1,
|
|
5765
|
-
"f": formatMicroseconds$1,
|
|
5766
|
-
"g": formatYearISO$1,
|
|
5767
|
-
"G": formatFullYearISO$1,
|
|
5768
|
-
"H": formatHour24$1,
|
|
5769
|
-
"I": formatHour12$1,
|
|
5770
|
-
"j": formatDayOfYear$1,
|
|
5771
|
-
"L": formatMilliseconds$1,
|
|
5772
|
-
"m": formatMonthNumber$1,
|
|
5773
|
-
"M": formatMinutes$1,
|
|
5774
|
-
"p": formatPeriod,
|
|
5775
|
-
"q": formatQuarter,
|
|
5776
|
-
"Q": formatUnixTimestamp$1,
|
|
5777
|
-
"s": formatUnixTimestampSeconds$1,
|
|
5778
|
-
"S": formatSeconds$1,
|
|
5779
|
-
"u": formatWeekdayNumberMonday$1,
|
|
5780
|
-
"U": formatWeekNumberSunday$1,
|
|
5781
|
-
"V": formatWeekNumberISO$1,
|
|
5782
|
-
"w": formatWeekdayNumberSunday$1,
|
|
5783
|
-
"W": formatWeekNumberMonday$1,
|
|
5784
|
-
"x": null,
|
|
5785
|
-
"X": null,
|
|
5786
|
-
"y": formatYear$1,
|
|
5787
|
-
"Y": formatFullYear$1,
|
|
5788
|
-
"Z": formatZone$1,
|
|
5789
|
-
"%": formatLiteralPercent$1
|
|
5790
|
-
};
|
|
5791
|
-
|
|
5792
|
-
var utcFormats = {
|
|
5793
|
-
"a": formatUTCShortWeekday,
|
|
5794
|
-
"A": formatUTCWeekday,
|
|
5795
|
-
"b": formatUTCShortMonth,
|
|
5796
|
-
"B": formatUTCMonth,
|
|
5797
|
-
"c": null,
|
|
5798
|
-
"d": formatUTCDayOfMonth$1,
|
|
5799
|
-
"e": formatUTCDayOfMonth$1,
|
|
5800
|
-
"f": formatUTCMicroseconds$1,
|
|
5801
|
-
"g": formatUTCYearISO$1,
|
|
5802
|
-
"G": formatUTCFullYearISO$1,
|
|
5803
|
-
"H": formatUTCHour24$1,
|
|
5804
|
-
"I": formatUTCHour12$1,
|
|
5805
|
-
"j": formatUTCDayOfYear$1,
|
|
5806
|
-
"L": formatUTCMilliseconds$1,
|
|
5807
|
-
"m": formatUTCMonthNumber$1,
|
|
5808
|
-
"M": formatUTCMinutes$1,
|
|
5809
|
-
"p": formatUTCPeriod,
|
|
5810
|
-
"q": formatUTCQuarter,
|
|
5811
|
-
"Q": formatUnixTimestamp$1,
|
|
5812
|
-
"s": formatUnixTimestampSeconds$1,
|
|
5813
|
-
"S": formatUTCSeconds$1,
|
|
5814
|
-
"u": formatUTCWeekdayNumberMonday$1,
|
|
5815
|
-
"U": formatUTCWeekNumberSunday$1,
|
|
5816
|
-
"V": formatUTCWeekNumberISO$1,
|
|
5817
|
-
"w": formatUTCWeekdayNumberSunday$1,
|
|
5818
|
-
"W": formatUTCWeekNumberMonday$1,
|
|
5819
|
-
"x": null,
|
|
5820
|
-
"X": null,
|
|
5821
|
-
"y": formatUTCYear$1,
|
|
5822
|
-
"Y": formatUTCFullYear$1,
|
|
5823
|
-
"Z": formatUTCZone$1,
|
|
5824
|
-
"%": formatLiteralPercent$1
|
|
5825
|
-
};
|
|
5826
|
-
|
|
5827
|
-
var parses = {
|
|
5828
|
-
"a": parseShortWeekday,
|
|
5829
|
-
"A": parseWeekday,
|
|
5830
|
-
"b": parseShortMonth,
|
|
5831
|
-
"B": parseMonth,
|
|
5832
|
-
"c": parseLocaleDateTime,
|
|
5833
|
-
"d": parseDayOfMonth$1,
|
|
5834
|
-
"e": parseDayOfMonth$1,
|
|
5835
|
-
"f": parseMicroseconds$1,
|
|
5836
|
-
"g": parseYear$1,
|
|
5837
|
-
"G": parseFullYear$1,
|
|
5838
|
-
"H": parseHour24$1,
|
|
5839
|
-
"I": parseHour24$1,
|
|
5840
|
-
"j": parseDayOfYear$1,
|
|
5841
|
-
"L": parseMilliseconds$1,
|
|
5842
|
-
"m": parseMonthNumber$1,
|
|
5843
|
-
"M": parseMinutes$1,
|
|
5844
|
-
"p": parsePeriod,
|
|
5845
|
-
"q": parseQuarter$1,
|
|
5846
|
-
"Q": parseUnixTimestamp$1,
|
|
5847
|
-
"s": parseUnixTimestampSeconds$1,
|
|
5848
|
-
"S": parseSeconds$1,
|
|
5849
|
-
"u": parseWeekdayNumberMonday$1,
|
|
5850
|
-
"U": parseWeekNumberSunday$1,
|
|
5851
|
-
"V": parseWeekNumberISO$1,
|
|
5852
|
-
"w": parseWeekdayNumberSunday$1,
|
|
5853
|
-
"W": parseWeekNumberMonday$1,
|
|
5854
|
-
"x": parseLocaleDate,
|
|
5855
|
-
"X": parseLocaleTime,
|
|
5856
|
-
"y": parseYear$1,
|
|
5857
|
-
"Y": parseFullYear$1,
|
|
5858
|
-
"Z": parseZone$1,
|
|
5859
|
-
"%": parseLiteralPercent$1
|
|
5860
|
-
};
|
|
5861
|
-
|
|
5862
|
-
// These recursive directive definitions must be deferred.
|
|
5863
|
-
formats.x = newFormat(locale_date, formats);
|
|
5864
|
-
formats.X = newFormat(locale_time, formats);
|
|
5865
|
-
formats.c = newFormat(locale_dateTime, formats);
|
|
5866
|
-
utcFormats.x = newFormat(locale_date, utcFormats);
|
|
5867
|
-
utcFormats.X = newFormat(locale_time, utcFormats);
|
|
5868
|
-
utcFormats.c = newFormat(locale_dateTime, utcFormats);
|
|
5869
|
-
|
|
5870
|
-
function newFormat(specifier, formats) {
|
|
5871
|
-
return function(date) {
|
|
5872
|
-
var string = [],
|
|
5873
|
-
i = -1,
|
|
5874
|
-
j = 0,
|
|
5875
|
-
n = specifier.length,
|
|
5876
|
-
c,
|
|
5877
|
-
pad,
|
|
5878
|
-
format;
|
|
5879
|
-
|
|
5880
|
-
if (!(date instanceof Date)) date = new Date(+date);
|
|
5881
|
-
|
|
5882
|
-
while (++i < n) {
|
|
5883
|
-
if (specifier.charCodeAt(i) === 37) {
|
|
5884
|
-
string.push(specifier.slice(j, i));
|
|
5885
|
-
if ((pad = pads$1[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
|
|
5886
|
-
else pad = c === "e" ? " " : "0";
|
|
5887
|
-
if (format = formats[c]) c = format(date, pad);
|
|
5888
|
-
string.push(c);
|
|
5889
|
-
j = i + 1;
|
|
5890
|
-
}
|
|
5891
|
-
}
|
|
5892
|
-
|
|
5893
|
-
string.push(specifier.slice(j, i));
|
|
5894
|
-
return string.join("");
|
|
5895
|
-
};
|
|
5896
|
-
}
|
|
5897
|
-
|
|
5898
|
-
function newParse(specifier, Z) {
|
|
5899
|
-
return function(string) {
|
|
5900
|
-
var d = newDate$1(1900, undefined, 1),
|
|
5901
|
-
i = parseSpecifier(d, specifier, string += "", 0),
|
|
5902
|
-
week, day;
|
|
5903
|
-
if (i != string.length) return null;
|
|
5904
|
-
|
|
5905
|
-
// If a UNIX timestamp is specified, return it.
|
|
5906
|
-
if ("Q" in d) return new Date(d.Q);
|
|
5907
|
-
if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0));
|
|
5908
|
-
|
|
5909
|
-
// If this is utcParse, never use the local timezone.
|
|
5910
|
-
if (Z && !("Z" in d)) d.Z = 0;
|
|
5911
|
-
|
|
5912
|
-
// The am-pm flag is 0 for AM, and 1 for PM.
|
|
5913
|
-
if ("p" in d) d.H = d.H % 12 + d.p * 12;
|
|
5914
|
-
|
|
5915
|
-
// If the month was not specified, inherit from the quarter.
|
|
5916
|
-
if (d.m === undefined) d.m = "q" in d ? d.q : 0;
|
|
5917
|
-
|
|
5918
|
-
// Convert day-of-week and week-of-year to day-of-year.
|
|
5919
|
-
if ("V" in d) {
|
|
5920
|
-
if (d.V < 1 || d.V > 53) return null;
|
|
5921
|
-
if (!("w" in d)) d.w = 1;
|
|
5922
|
-
if ("Z" in d) {
|
|
5923
|
-
week = utcDate$1(newDate$1(d.y, 0, 1)), day = week.getUTCDay();
|
|
5924
|
-
week = day > 4 || day === 0 ? utcMonday$1.ceil(week) : utcMonday$1(week);
|
|
5925
|
-
week = utcDay$3.offset(week, (d.V - 1) * 7);
|
|
5926
|
-
d.y = week.getUTCFullYear();
|
|
5927
|
-
d.m = week.getUTCMonth();
|
|
5928
|
-
d.d = week.getUTCDate() + (d.w + 6) % 7;
|
|
5929
|
-
} else {
|
|
5930
|
-
week = localDate$1(newDate$1(d.y, 0, 1)), day = week.getDay();
|
|
5931
|
-
week = day > 4 || day === 0 ? monday$1.ceil(week) : monday$1(week);
|
|
5932
|
-
week = timeDay.offset(week, (d.V - 1) * 7);
|
|
5933
|
-
d.y = week.getFullYear();
|
|
5934
|
-
d.m = week.getMonth();
|
|
5935
|
-
d.d = week.getDate() + (d.w + 6) % 7;
|
|
5936
|
-
}
|
|
5937
|
-
} else if ("W" in d || "U" in d) {
|
|
5938
|
-
if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
|
|
5939
|
-
day = "Z" in d ? utcDate$1(newDate$1(d.y, 0, 1)).getUTCDay() : localDate$1(newDate$1(d.y, 0, 1)).getDay();
|
|
5940
|
-
d.m = 0;
|
|
5941
|
-
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
|
|
5942
|
-
}
|
|
5943
|
-
|
|
5944
|
-
// If a time zone is specified, all fields are interpreted as UTC and then
|
|
5945
|
-
// offset according to the specified time zone.
|
|
5946
|
-
if ("Z" in d) {
|
|
5947
|
-
d.H += d.Z / 100 | 0;
|
|
5948
|
-
d.M += d.Z % 100;
|
|
5949
|
-
return utcDate$1(d);
|
|
5950
|
-
}
|
|
5951
|
-
|
|
5952
|
-
// Otherwise, all fields are in local time.
|
|
5953
|
-
return localDate$1(d);
|
|
5954
|
-
};
|
|
5955
|
-
}
|
|
5956
|
-
|
|
5957
|
-
function parseSpecifier(d, specifier, string, j) {
|
|
5958
|
-
var i = 0,
|
|
5959
|
-
n = specifier.length,
|
|
5960
|
-
m = string.length,
|
|
5961
|
-
c,
|
|
5962
|
-
parse;
|
|
5963
|
-
|
|
5964
|
-
while (i < n) {
|
|
5965
|
-
if (j >= m) return -1;
|
|
5966
|
-
c = specifier.charCodeAt(i++);
|
|
5967
|
-
if (c === 37) {
|
|
5968
|
-
c = specifier.charAt(i++);
|
|
5969
|
-
parse = parses[c in pads$1 ? specifier.charAt(i++) : c];
|
|
5970
|
-
if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
|
|
5971
|
-
} else if (c != string.charCodeAt(j++)) {
|
|
5972
|
-
return -1;
|
|
5973
|
-
}
|
|
5974
|
-
}
|
|
5975
|
-
|
|
5976
|
-
return j;
|
|
5977
|
-
}
|
|
5978
|
-
|
|
5979
|
-
function parsePeriod(d, string, i) {
|
|
5980
|
-
var n = periodRe.exec(string.slice(i));
|
|
5981
|
-
return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
5982
|
-
}
|
|
5983
|
-
|
|
5984
|
-
function parseShortWeekday(d, string, i) {
|
|
5985
|
-
var n = shortWeekdayRe.exec(string.slice(i));
|
|
5986
|
-
return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
5987
|
-
}
|
|
5988
|
-
|
|
5989
|
-
function parseWeekday(d, string, i) {
|
|
5990
|
-
var n = weekdayRe.exec(string.slice(i));
|
|
5991
|
-
return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
5992
|
-
}
|
|
5993
|
-
|
|
5994
|
-
function parseShortMonth(d, string, i) {
|
|
5995
|
-
var n = shortMonthRe.exec(string.slice(i));
|
|
5996
|
-
return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
5997
|
-
}
|
|
5998
|
-
|
|
5999
|
-
function parseMonth(d, string, i) {
|
|
6000
|
-
var n = monthRe.exec(string.slice(i));
|
|
6001
|
-
return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
6002
|
-
}
|
|
6003
|
-
|
|
6004
|
-
function parseLocaleDateTime(d, string, i) {
|
|
6005
|
-
return parseSpecifier(d, locale_dateTime, string, i);
|
|
6006
|
-
}
|
|
6007
|
-
|
|
6008
|
-
function parseLocaleDate(d, string, i) {
|
|
6009
|
-
return parseSpecifier(d, locale_date, string, i);
|
|
6010
|
-
}
|
|
6011
|
-
|
|
6012
|
-
function parseLocaleTime(d, string, i) {
|
|
6013
|
-
return parseSpecifier(d, locale_time, string, i);
|
|
6014
|
-
}
|
|
6015
|
-
|
|
6016
|
-
function formatShortWeekday(d) {
|
|
6017
|
-
return locale_shortWeekdays[d.getDay()];
|
|
6018
|
-
}
|
|
6019
|
-
|
|
6020
|
-
function formatWeekday(d) {
|
|
6021
|
-
return locale_weekdays[d.getDay()];
|
|
6022
|
-
}
|
|
6023
|
-
|
|
6024
|
-
function formatShortMonth(d) {
|
|
6025
|
-
return locale_shortMonths[d.getMonth()];
|
|
6026
|
-
}
|
|
6027
|
-
|
|
6028
|
-
function formatMonth(d) {
|
|
6029
|
-
return locale_months[d.getMonth()];
|
|
6030
|
-
}
|
|
6031
|
-
|
|
6032
|
-
function formatPeriod(d) {
|
|
6033
|
-
return locale_periods[+(d.getHours() >= 12)];
|
|
6034
|
-
}
|
|
6035
|
-
|
|
6036
|
-
function formatQuarter(d) {
|
|
6037
|
-
return 1 + ~~(d.getMonth() / 3);
|
|
6038
|
-
}
|
|
6039
|
-
|
|
6040
|
-
function formatUTCShortWeekday(d) {
|
|
6041
|
-
return locale_shortWeekdays[d.getUTCDay()];
|
|
6042
|
-
}
|
|
6043
|
-
|
|
6044
|
-
function formatUTCWeekday(d) {
|
|
6045
|
-
return locale_weekdays[d.getUTCDay()];
|
|
6046
|
-
}
|
|
6047
|
-
|
|
6048
|
-
function formatUTCShortMonth(d) {
|
|
6049
|
-
return locale_shortMonths[d.getUTCMonth()];
|
|
6050
|
-
}
|
|
6051
|
-
|
|
6052
|
-
function formatUTCMonth(d) {
|
|
6053
|
-
return locale_months[d.getUTCMonth()];
|
|
6054
|
-
}
|
|
6055
|
-
|
|
6056
|
-
function formatUTCPeriod(d) {
|
|
6057
|
-
return locale_periods[+(d.getUTCHours() >= 12)];
|
|
6058
|
-
}
|
|
6059
|
-
|
|
6060
|
-
function formatUTCQuarter(d) {
|
|
6061
|
-
return 1 + ~~(d.getUTCMonth() / 3);
|
|
6062
|
-
}
|
|
6063
|
-
|
|
6064
|
-
return {
|
|
6065
|
-
format: function(specifier) {
|
|
6066
|
-
var f = newFormat(specifier += "", formats);
|
|
6067
|
-
f.toString = function() { return specifier; };
|
|
6068
|
-
return f;
|
|
6069
|
-
},
|
|
6070
|
-
parse: function(specifier) {
|
|
6071
|
-
var p = newParse(specifier += "", false);
|
|
6072
|
-
p.toString = function() { return specifier; };
|
|
6073
|
-
return p;
|
|
6074
|
-
},
|
|
6075
|
-
utcFormat: function(specifier) {
|
|
6076
|
-
var f = newFormat(specifier += "", utcFormats);
|
|
6077
|
-
f.toString = function() { return specifier; };
|
|
6078
|
-
return f;
|
|
6079
|
-
},
|
|
6080
|
-
utcParse: function(specifier) {
|
|
6081
|
-
var p = newParse(specifier += "", true);
|
|
6082
|
-
p.toString = function() { return specifier; };
|
|
6083
|
-
return p;
|
|
6084
|
-
}
|
|
6085
|
-
};
|
|
6086
|
-
}
|
|
6087
|
-
|
|
6088
|
-
var pads$1 = {"-": "", "_": " ", "0": "0"},
|
|
6089
|
-
numberRe$1 = /^\s*\d+/, // note: ignores next directive
|
|
6090
|
-
percentRe$1 = /^%/,
|
|
6091
|
-
requoteRe$1 = /[\\^$*+?|[\]().{}]/g;
|
|
6092
|
-
|
|
6093
|
-
function pad$1(value, fill, width) {
|
|
6094
|
-
var sign = value < 0 ? "-" : "",
|
|
6095
|
-
string = (sign ? -value : value) + "",
|
|
6096
|
-
length = string.length;
|
|
6097
|
-
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
|
|
6098
|
-
}
|
|
6099
|
-
|
|
6100
|
-
function requote$1(s) {
|
|
6101
|
-
return s.replace(requoteRe$1, "\\$&");
|
|
6102
|
-
}
|
|
6103
|
-
|
|
6104
|
-
function formatRe$1(names) {
|
|
6105
|
-
return new RegExp("^(?:" + names.map(requote$1).join("|") + ")", "i");
|
|
6106
|
-
}
|
|
6107
|
-
|
|
6108
|
-
function formatLookup$1(names) {
|
|
6109
|
-
return new Map(names.map((name, i) => [name.toLowerCase(), i]));
|
|
6110
|
-
}
|
|
6111
|
-
|
|
6112
|
-
function parseWeekdayNumberSunday$1(d, string, i) {
|
|
6113
|
-
var n = numberRe$1.exec(string.slice(i, i + 1));
|
|
6114
|
-
return n ? (d.w = +n[0], i + n[0].length) : -1;
|
|
6115
|
-
}
|
|
6116
|
-
|
|
6117
|
-
function parseWeekdayNumberMonday$1(d, string, i) {
|
|
6118
|
-
var n = numberRe$1.exec(string.slice(i, i + 1));
|
|
6119
|
-
return n ? (d.u = +n[0], i + n[0].length) : -1;
|
|
6120
|
-
}
|
|
6121
|
-
|
|
6122
|
-
function parseWeekNumberSunday$1(d, string, i) {
|
|
6123
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
6124
|
-
return n ? (d.U = +n[0], i + n[0].length) : -1;
|
|
6125
|
-
}
|
|
6126
|
-
|
|
6127
|
-
function parseWeekNumberISO$1(d, string, i) {
|
|
6128
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
6129
|
-
return n ? (d.V = +n[0], i + n[0].length) : -1;
|
|
6130
|
-
}
|
|
6131
|
-
|
|
6132
|
-
function parseWeekNumberMonday$1(d, string, i) {
|
|
6133
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
6134
|
-
return n ? (d.W = +n[0], i + n[0].length) : -1;
|
|
6135
|
-
}
|
|
6136
|
-
|
|
6137
|
-
function parseFullYear$1(d, string, i) {
|
|
6138
|
-
var n = numberRe$1.exec(string.slice(i, i + 4));
|
|
6139
|
-
return n ? (d.y = +n[0], i + n[0].length) : -1;
|
|
6140
|
-
}
|
|
6141
|
-
|
|
6142
|
-
function parseYear$1(d, string, i) {
|
|
6143
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
6144
|
-
return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
|
|
6145
|
-
}
|
|
6146
|
-
|
|
6147
|
-
function parseZone$1(d, string, i) {
|
|
6148
|
-
var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
|
|
6149
|
-
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
|
|
6150
|
-
}
|
|
6151
|
-
|
|
6152
|
-
function parseQuarter$1(d, string, i) {
|
|
6153
|
-
var n = numberRe$1.exec(string.slice(i, i + 1));
|
|
6154
|
-
return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
|
|
6155
|
-
}
|
|
6156
|
-
|
|
6157
|
-
function parseMonthNumber$1(d, string, i) {
|
|
6158
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
6159
|
-
return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
|
|
6160
|
-
}
|
|
6161
|
-
|
|
6162
|
-
function parseDayOfMonth$1(d, string, i) {
|
|
6163
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
6164
|
-
return n ? (d.d = +n[0], i + n[0].length) : -1;
|
|
6165
|
-
}
|
|
6166
|
-
|
|
6167
|
-
function parseDayOfYear$1(d, string, i) {
|
|
6168
|
-
var n = numberRe$1.exec(string.slice(i, i + 3));
|
|
6169
|
-
return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
|
|
6170
|
-
}
|
|
6171
|
-
|
|
6172
|
-
function parseHour24$1(d, string, i) {
|
|
6173
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
6174
|
-
return n ? (d.H = +n[0], i + n[0].length) : -1;
|
|
6175
|
-
}
|
|
6176
|
-
|
|
6177
|
-
function parseMinutes$1(d, string, i) {
|
|
6178
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
6179
|
-
return n ? (d.M = +n[0], i + n[0].length) : -1;
|
|
6180
|
-
}
|
|
6181
|
-
|
|
6182
|
-
function parseSeconds$1(d, string, i) {
|
|
6183
|
-
var n = numberRe$1.exec(string.slice(i, i + 2));
|
|
6184
|
-
return n ? (d.S = +n[0], i + n[0].length) : -1;
|
|
6185
|
-
}
|
|
6186
|
-
|
|
6187
|
-
function parseMilliseconds$1(d, string, i) {
|
|
6188
|
-
var n = numberRe$1.exec(string.slice(i, i + 3));
|
|
6189
|
-
return n ? (d.L = +n[0], i + n[0].length) : -1;
|
|
6190
|
-
}
|
|
6191
|
-
|
|
6192
|
-
function parseMicroseconds$1(d, string, i) {
|
|
6193
|
-
var n = numberRe$1.exec(string.slice(i, i + 6));
|
|
6194
|
-
return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;
|
|
6195
|
-
}
|
|
6196
|
-
|
|
6197
|
-
function parseLiteralPercent$1(d, string, i) {
|
|
6198
|
-
var n = percentRe$1.exec(string.slice(i, i + 1));
|
|
6199
|
-
return n ? i + n[0].length : -1;
|
|
6200
|
-
}
|
|
6201
|
-
|
|
6202
|
-
function parseUnixTimestamp$1(d, string, i) {
|
|
6203
|
-
var n = numberRe$1.exec(string.slice(i));
|
|
6204
|
-
return n ? (d.Q = +n[0], i + n[0].length) : -1;
|
|
6205
|
-
}
|
|
6206
|
-
|
|
6207
|
-
function parseUnixTimestampSeconds$1(d, string, i) {
|
|
6208
|
-
var n = numberRe$1.exec(string.slice(i));
|
|
6209
|
-
return n ? (d.s = +n[0], i + n[0].length) : -1;
|
|
6210
|
-
}
|
|
6211
|
-
|
|
6212
|
-
function formatDayOfMonth$1(d, p) {
|
|
6213
|
-
return pad$1(d.getDate(), p, 2);
|
|
6214
|
-
}
|
|
6215
|
-
|
|
6216
|
-
function formatHour24$1(d, p) {
|
|
6217
|
-
return pad$1(d.getHours(), p, 2);
|
|
6218
|
-
}
|
|
6219
|
-
|
|
6220
|
-
function formatHour12$1(d, p) {
|
|
6221
|
-
return pad$1(d.getHours() % 12 || 12, p, 2);
|
|
6222
|
-
}
|
|
6223
|
-
|
|
6224
|
-
function formatDayOfYear$1(d, p) {
|
|
6225
|
-
return pad$1(1 + timeDay.count(timeYear(d), d), p, 3);
|
|
6226
|
-
}
|
|
6227
|
-
|
|
6228
|
-
function formatMilliseconds$1(d, p) {
|
|
6229
|
-
return pad$1(d.getMilliseconds(), p, 3);
|
|
6230
|
-
}
|
|
6231
|
-
|
|
6232
|
-
function formatMicroseconds$1(d, p) {
|
|
6233
|
-
return formatMilliseconds$1(d, p) + "000";
|
|
6234
|
-
}
|
|
6235
|
-
|
|
6236
|
-
function formatMonthNumber$1(d, p) {
|
|
6237
|
-
return pad$1(d.getMonth() + 1, p, 2);
|
|
6238
|
-
}
|
|
6239
|
-
|
|
6240
|
-
function formatMinutes$1(d, p) {
|
|
6241
|
-
return pad$1(d.getMinutes(), p, 2);
|
|
6242
|
-
}
|
|
6243
|
-
|
|
6244
|
-
function formatSeconds$1(d, p) {
|
|
6245
|
-
return pad$1(d.getSeconds(), p, 2);
|
|
6246
|
-
}
|
|
6247
|
-
|
|
6248
|
-
function formatWeekdayNumberMonday$1(d) {
|
|
6249
|
-
var day = d.getDay();
|
|
6250
|
-
return day === 0 ? 7 : day;
|
|
6251
|
-
}
|
|
6252
|
-
|
|
6253
|
-
function formatWeekNumberSunday$1(d, p) {
|
|
6254
|
-
return pad$1(sunday$1.count(timeYear(d) - 1, d), p, 2);
|
|
6255
|
-
}
|
|
6256
|
-
|
|
6257
|
-
function dISO$1(d) {
|
|
6258
|
-
var day = d.getDay();
|
|
6259
|
-
return (day >= 4 || day === 0) ? thursday$1(d) : thursday$1.ceil(d);
|
|
6260
|
-
}
|
|
6261
|
-
|
|
6262
|
-
function formatWeekNumberISO$1(d, p) {
|
|
6263
|
-
d = dISO$1(d);
|
|
6264
|
-
return pad$1(thursday$1.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);
|
|
6265
|
-
}
|
|
6266
|
-
|
|
6267
|
-
function formatWeekdayNumberSunday$1(d) {
|
|
6268
|
-
return d.getDay();
|
|
6269
|
-
}
|
|
6270
|
-
|
|
6271
|
-
function formatWeekNumberMonday$1(d, p) {
|
|
6272
|
-
return pad$1(monday$1.count(timeYear(d) - 1, d), p, 2);
|
|
6273
|
-
}
|
|
6274
|
-
|
|
6275
|
-
function formatYear$1(d, p) {
|
|
6276
|
-
return pad$1(d.getFullYear() % 100, p, 2);
|
|
6277
|
-
}
|
|
6278
|
-
|
|
6279
|
-
function formatYearISO$1(d, p) {
|
|
6280
|
-
d = dISO$1(d);
|
|
6281
|
-
return pad$1(d.getFullYear() % 100, p, 2);
|
|
6282
|
-
}
|
|
6283
|
-
|
|
6284
|
-
function formatFullYear$1(d, p) {
|
|
6285
|
-
return pad$1(d.getFullYear() % 10000, p, 4);
|
|
6286
|
-
}
|
|
6287
|
-
|
|
6288
|
-
function formatFullYearISO$1(d, p) {
|
|
6289
|
-
var day = d.getDay();
|
|
6290
|
-
d = (day >= 4 || day === 0) ? thursday$1(d) : thursday$1.ceil(d);
|
|
6291
|
-
return pad$1(d.getFullYear() % 10000, p, 4);
|
|
6292
|
-
}
|
|
6293
|
-
|
|
6294
|
-
function formatZone$1(d) {
|
|
6295
|
-
var z = d.getTimezoneOffset();
|
|
6296
|
-
return (z > 0 ? "-" : (z *= -1, "+"))
|
|
6297
|
-
+ pad$1(z / 60 | 0, "0", 2)
|
|
6298
|
-
+ pad$1(z % 60, "0", 2);
|
|
6299
|
-
}
|
|
6300
|
-
|
|
6301
|
-
function formatUTCDayOfMonth$1(d, p) {
|
|
6302
|
-
return pad$1(d.getUTCDate(), p, 2);
|
|
6303
|
-
}
|
|
6304
|
-
|
|
6305
|
-
function formatUTCHour24$1(d, p) {
|
|
6306
|
-
return pad$1(d.getUTCHours(), p, 2);
|
|
6307
|
-
}
|
|
6308
|
-
|
|
6309
|
-
function formatUTCHour12$1(d, p) {
|
|
6310
|
-
return pad$1(d.getUTCHours() % 12 || 12, p, 2);
|
|
6311
|
-
}
|
|
6312
|
-
|
|
6313
|
-
function formatUTCDayOfYear$1(d, p) {
|
|
6314
|
-
return pad$1(1 + utcDay$3.count(utcYear$3(d), d), p, 3);
|
|
6315
|
-
}
|
|
6316
|
-
|
|
6317
|
-
function formatUTCMilliseconds$1(d, p) {
|
|
6318
|
-
return pad$1(d.getUTCMilliseconds(), p, 3);
|
|
6319
|
-
}
|
|
6320
|
-
|
|
6321
|
-
function formatUTCMicroseconds$1(d, p) {
|
|
6322
|
-
return formatUTCMilliseconds$1(d, p) + "000";
|
|
6323
|
-
}
|
|
6324
|
-
|
|
6325
|
-
function formatUTCMonthNumber$1(d, p) {
|
|
6326
|
-
return pad$1(d.getUTCMonth() + 1, p, 2);
|
|
6327
|
-
}
|
|
6328
|
-
|
|
6329
|
-
function formatUTCMinutes$1(d, p) {
|
|
6330
|
-
return pad$1(d.getUTCMinutes(), p, 2);
|
|
6331
|
-
}
|
|
6332
|
-
|
|
6333
|
-
function formatUTCSeconds$1(d, p) {
|
|
6334
|
-
return pad$1(d.getUTCSeconds(), p, 2);
|
|
6335
|
-
}
|
|
6336
|
-
|
|
6337
|
-
function formatUTCWeekdayNumberMonday$1(d) {
|
|
6338
|
-
var dow = d.getUTCDay();
|
|
6339
|
-
return dow === 0 ? 7 : dow;
|
|
6340
|
-
}
|
|
6341
|
-
|
|
6342
|
-
function formatUTCWeekNumberSunday$1(d, p) {
|
|
6343
|
-
return pad$1(utcSunday$1.count(utcYear$3(d) - 1, d), p, 2);
|
|
6344
|
-
}
|
|
6345
|
-
|
|
6346
|
-
function UTCdISO$1(d) {
|
|
6347
|
-
var day = d.getUTCDay();
|
|
6348
|
-
return (day >= 4 || day === 0) ? utcThursday$1(d) : utcThursday$1.ceil(d);
|
|
6349
|
-
}
|
|
6350
|
-
|
|
6351
|
-
function formatUTCWeekNumberISO$1(d, p) {
|
|
6352
|
-
d = UTCdISO$1(d);
|
|
6353
|
-
return pad$1(utcThursday$1.count(utcYear$3(d), d) + (utcYear$3(d).getUTCDay() === 4), p, 2);
|
|
6354
|
-
}
|
|
6355
|
-
|
|
6356
|
-
function formatUTCWeekdayNumberSunday$1(d) {
|
|
6357
|
-
return d.getUTCDay();
|
|
6358
|
-
}
|
|
6359
|
-
|
|
6360
|
-
function formatUTCWeekNumberMonday$1(d, p) {
|
|
6361
|
-
return pad$1(utcMonday$1.count(utcYear$3(d) - 1, d), p, 2);
|
|
6362
|
-
}
|
|
6363
|
-
|
|
6364
|
-
function formatUTCYear$1(d, p) {
|
|
6365
|
-
return pad$1(d.getUTCFullYear() % 100, p, 2);
|
|
6366
|
-
}
|
|
6367
|
-
|
|
6368
|
-
function formatUTCYearISO$1(d, p) {
|
|
6369
|
-
d = UTCdISO$1(d);
|
|
6370
|
-
return pad$1(d.getUTCFullYear() % 100, p, 2);
|
|
6371
|
-
}
|
|
6372
|
-
|
|
6373
|
-
function formatUTCFullYear$1(d, p) {
|
|
6374
|
-
return pad$1(d.getUTCFullYear() % 10000, p, 4);
|
|
6375
|
-
}
|
|
6376
|
-
|
|
6377
|
-
function formatUTCFullYearISO$1(d, p) {
|
|
6378
|
-
var day = d.getUTCDay();
|
|
6379
|
-
d = (day >= 4 || day === 0) ? utcThursday$1(d) : utcThursday$1.ceil(d);
|
|
6380
|
-
return pad$1(d.getUTCFullYear() % 10000, p, 4);
|
|
6381
|
-
}
|
|
6382
|
-
|
|
6383
|
-
function formatUTCZone$1() {
|
|
6384
|
-
return "+0000";
|
|
6385
|
-
}
|
|
6386
|
-
|
|
6387
|
-
function formatLiteralPercent$1() {
|
|
6388
|
-
return "%";
|
|
6389
|
-
}
|
|
6390
|
-
|
|
6391
|
-
function formatUnixTimestamp$1(d) {
|
|
6392
|
-
return +d;
|
|
6393
|
-
}
|
|
6394
|
-
|
|
6395
|
-
function formatUnixTimestampSeconds$1(d) {
|
|
6396
|
-
return Math.floor(+d / 1000);
|
|
6397
|
-
}
|
|
6398
|
-
|
|
6399
|
-
var locale$1;
|
|
6400
|
-
var timeFormat$1;
|
|
6401
|
-
|
|
6402
|
-
defaultLocale$1({
|
|
6403
|
-
dateTime: "%x, %X",
|
|
6404
|
-
date: "%-m/%-d/%Y",
|
|
6405
|
-
time: "%-I:%M:%S %p",
|
|
6406
|
-
periods: ["AM", "PM"],
|
|
6407
|
-
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
6408
|
-
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
6409
|
-
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
6410
|
-
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
6411
|
-
});
|
|
6412
|
-
|
|
6413
|
-
function defaultLocale$1(definition) {
|
|
6414
|
-
locale$1 = formatLocale$1(definition);
|
|
6415
|
-
timeFormat$1 = locale$1.format;
|
|
6416
|
-
locale$1.parse;
|
|
6417
|
-
locale$1.utcFormat;
|
|
6418
|
-
locale$1.utcParse;
|
|
6419
|
-
return locale$1;
|
|
6420
|
-
}
|
|
6421
|
-
|
|
6422
|
-
function date(t) {
|
|
6423
|
-
return new Date(t);
|
|
6424
|
-
}
|
|
6425
|
-
|
|
6426
|
-
function number(t) {
|
|
6427
|
-
return t instanceof Date ? +t : +new Date(+t);
|
|
6428
|
-
}
|
|
6429
|
-
|
|
6430
|
-
function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {
|
|
6431
|
-
var scale = continuous(),
|
|
6432
|
-
invert = scale.invert,
|
|
6433
|
-
domain = scale.domain;
|
|
6434
|
-
|
|
6435
|
-
var formatMillisecond = format(".%L"),
|
|
6436
|
-
formatSecond = format(":%S"),
|
|
6437
|
-
formatMinute = format("%I:%M"),
|
|
6438
|
-
formatHour = format("%I %p"),
|
|
6439
|
-
formatDay = format("%a %d"),
|
|
6440
|
-
formatWeek = format("%b %d"),
|
|
6441
|
-
formatMonth = format("%B"),
|
|
6442
|
-
formatYear = format("%Y");
|
|
6443
|
-
|
|
6444
|
-
function tickFormat(date) {
|
|
6445
|
-
return (second(date) < date ? formatMillisecond
|
|
6446
|
-
: minute(date) < date ? formatSecond
|
|
6447
|
-
: hour(date) < date ? formatMinute
|
|
6448
|
-
: day(date) < date ? formatHour
|
|
6449
|
-
: month(date) < date ? (week(date) < date ? formatDay : formatWeek)
|
|
6450
|
-
: year(date) < date ? formatMonth
|
|
6451
|
-
: formatYear)(date);
|
|
6452
|
-
}
|
|
6453
|
-
|
|
6454
|
-
scale.invert = function(y) {
|
|
6455
|
-
return new Date(invert(y));
|
|
6456
|
-
};
|
|
6457
|
-
|
|
6458
|
-
scale.domain = function(_) {
|
|
6459
|
-
return arguments.length ? domain(Array.from(_, number)) : domain().map(date);
|
|
6460
|
-
};
|
|
6461
|
-
|
|
6462
|
-
scale.ticks = function(interval) {
|
|
6463
|
-
var d = domain();
|
|
6464
|
-
return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);
|
|
6465
|
-
};
|
|
6466
|
-
|
|
6467
|
-
scale.tickFormat = function(count, specifier) {
|
|
6468
|
-
return specifier == null ? tickFormat : format(specifier);
|
|
6469
|
-
};
|
|
6470
|
-
|
|
6471
|
-
scale.nice = function(interval) {
|
|
6472
|
-
var d = domain();
|
|
6473
|
-
if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);
|
|
6474
|
-
return interval ? domain(nice(d, interval)) : scale;
|
|
6475
|
-
};
|
|
6476
|
-
|
|
6477
|
-
scale.copy = function() {
|
|
6478
|
-
return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
|
|
6479
|
-
};
|
|
6480
|
-
|
|
6481
|
-
return scale;
|
|
6482
|
-
}
|
|
6483
|
-
|
|
6484
|
-
function time() {
|
|
6485
|
-
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);
|
|
6486
|
-
}
|
|
6487
|
-
|
|
6488
|
-
var t0 = new Date,
|
|
6489
|
-
t1 = new Date;
|
|
6490
|
-
|
|
6491
|
-
function newInterval(floori, offseti, count, field) {
|
|
6492
|
-
|
|
6493
|
-
function interval(date) {
|
|
6494
|
-
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
|
6495
|
-
}
|
|
6496
|
-
|
|
6497
|
-
interval.floor = function(date) {
|
|
6498
|
-
return floori(date = new Date(+date)), date;
|
|
6499
|
-
};
|
|
6500
|
-
|
|
6501
|
-
interval.ceil = function(date) {
|
|
6502
|
-
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
|
6503
|
-
};
|
|
6504
|
-
|
|
6505
|
-
interval.round = function(date) {
|
|
6506
|
-
var d0 = interval(date),
|
|
6507
|
-
d1 = interval.ceil(date);
|
|
6508
|
-
return date - d0 < d1 - date ? d0 : d1;
|
|
6509
|
-
};
|
|
6510
|
-
|
|
6511
|
-
interval.offset = function(date, step) {
|
|
6512
|
-
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
|
6513
|
-
};
|
|
6514
|
-
|
|
6515
|
-
interval.range = function(start, stop, step) {
|
|
6516
|
-
var range = [], previous;
|
|
6517
|
-
start = interval.ceil(start);
|
|
6518
|
-
step = step == null ? 1 : Math.floor(step);
|
|
6519
|
-
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
|
6520
|
-
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
|
6521
|
-
while (previous < start && start < stop);
|
|
6522
|
-
return range;
|
|
6523
|
-
};
|
|
6524
|
-
|
|
6525
|
-
interval.filter = function(test) {
|
|
6526
|
-
return newInterval(function(date) {
|
|
6527
|
-
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
|
6528
|
-
}, function(date, step) {
|
|
6529
|
-
if (date >= date) {
|
|
6530
|
-
if (step < 0) while (++step <= 0) {
|
|
6531
|
-
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
|
6532
|
-
} else while (--step >= 0) {
|
|
6533
|
-
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
|
|
6534
|
-
}
|
|
6535
|
-
}
|
|
6536
|
-
});
|
|
6537
|
-
};
|
|
6538
|
-
|
|
6539
|
-
if (count) {
|
|
6540
|
-
interval.count = function(start, end) {
|
|
6541
|
-
t0.setTime(+start), t1.setTime(+end);
|
|
6542
|
-
floori(t0), floori(t1);
|
|
6543
|
-
return Math.floor(count(t0, t1));
|
|
6544
|
-
};
|
|
6545
|
-
|
|
6546
|
-
interval.every = function(step) {
|
|
6547
|
-
step = Math.floor(step);
|
|
6548
|
-
return !isFinite(step) || !(step > 0) ? null
|
|
6549
|
-
: !(step > 1) ? interval
|
|
6550
|
-
: interval.filter(field
|
|
6551
|
-
? function(d) { return field(d) % step === 0; }
|
|
6552
|
-
: function(d) { return interval.count(0, d) % step === 0; });
|
|
6553
|
-
};
|
|
6554
|
-
}
|
|
6555
|
-
|
|
6556
|
-
return interval;
|
|
6557
|
-
}
|
|
6558
|
-
|
|
6559
|
-
const durationSecond = 1000;
|
|
6560
|
-
const durationMinute = durationSecond * 60;
|
|
6561
|
-
const durationHour = durationMinute * 60;
|
|
6562
|
-
const durationDay = durationHour * 24;
|
|
6563
|
-
const durationWeek = durationDay * 7;
|
|
6564
|
-
|
|
6565
|
-
var hour = newInterval(function(date) {
|
|
6566
|
-
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
|
6567
|
-
}, function(date, step) {
|
|
6568
|
-
date.setTime(+date + step * durationHour);
|
|
6569
|
-
}, function(start, end) {
|
|
6570
|
-
return (end - start) / durationHour;
|
|
6571
|
-
}, function(date) {
|
|
6572
|
-
return date.getHours();
|
|
6573
|
-
});
|
|
6574
|
-
|
|
6575
|
-
var d3timeHour = hour;
|
|
6576
|
-
var hours = hour.range;
|
|
6577
|
-
|
|
6578
|
-
var day = newInterval(
|
|
6579
|
-
date => date.setHours(0, 0, 0, 0),
|
|
6580
|
-
(date, step) => date.setDate(date.getDate() + step),
|
|
6581
|
-
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
|
|
6582
|
-
date => date.getDate() - 1
|
|
6583
|
-
);
|
|
6584
|
-
|
|
6585
|
-
var d3timeDay = day;
|
|
6586
|
-
var days = day.range;
|
|
6587
|
-
|
|
6588
|
-
function weekday(i) {
|
|
6589
|
-
return newInterval(function(date) {
|
|
6590
|
-
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
6591
|
-
date.setHours(0, 0, 0, 0);
|
|
6592
|
-
}, function(date, step) {
|
|
6593
|
-
date.setDate(date.getDate() + step * 7);
|
|
6594
|
-
}, function(start, end) {
|
|
6595
|
-
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
|
6596
|
-
});
|
|
6597
|
-
}
|
|
6598
|
-
|
|
6599
|
-
var sunday = weekday(0);
|
|
6600
|
-
var monday = weekday(1);
|
|
6601
|
-
var tuesday = weekday(2);
|
|
6602
|
-
var wednesday = weekday(3);
|
|
6603
|
-
var thursday = weekday(4);
|
|
6604
|
-
var friday = weekday(5);
|
|
6605
|
-
var saturday = weekday(6);
|
|
6606
|
-
|
|
6607
|
-
var sundays = sunday.range;
|
|
6608
|
-
monday.range;
|
|
6609
|
-
tuesday.range;
|
|
6610
|
-
wednesday.range;
|
|
6611
|
-
thursday.range;
|
|
6612
|
-
friday.range;
|
|
6613
|
-
saturday.range;
|
|
6614
|
-
|
|
6615
|
-
var month = newInterval(function(date) {
|
|
6616
|
-
date.setDate(1);
|
|
6617
|
-
date.setHours(0, 0, 0, 0);
|
|
6618
|
-
}, function(date, step) {
|
|
6619
|
-
date.setMonth(date.getMonth() + step);
|
|
6620
|
-
}, function(start, end) {
|
|
6621
|
-
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
|
6622
|
-
}, function(date) {
|
|
6623
|
-
return date.getMonth();
|
|
6624
|
-
});
|
|
6625
|
-
|
|
6626
|
-
var d3timeMonth = month;
|
|
6627
|
-
var months = month.range;
|
|
6628
|
-
|
|
6629
|
-
var year = newInterval(function(date) {
|
|
6630
|
-
date.setMonth(0, 1);
|
|
6631
|
-
date.setHours(0, 0, 0, 0);
|
|
6632
|
-
}, function(date, step) {
|
|
6633
|
-
date.setFullYear(date.getFullYear() + step);
|
|
6634
|
-
}, function(start, end) {
|
|
6635
|
-
return end.getFullYear() - start.getFullYear();
|
|
6636
|
-
}, function(date) {
|
|
6637
|
-
return date.getFullYear();
|
|
6638
|
-
});
|
|
6639
|
-
|
|
6640
|
-
// An optimized implementation for this simple case.
|
|
6641
|
-
year.every = function(k) {
|
|
6642
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
|
|
6643
|
-
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
6644
|
-
date.setMonth(0, 1);
|
|
6645
|
-
date.setHours(0, 0, 0, 0);
|
|
6646
|
-
}, function(date, step) {
|
|
6647
|
-
date.setFullYear(date.getFullYear() + step * k);
|
|
6648
|
-
});
|
|
6649
|
-
};
|
|
6650
|
-
|
|
6651
|
-
var d3timeYear = year;
|
|
6652
|
-
var years = year.range;
|
|
6653
|
-
|
|
6654
|
-
var utcDay = newInterval(function(date) {
|
|
6655
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
6656
|
-
}, function(date, step) {
|
|
6657
|
-
date.setUTCDate(date.getUTCDate() + step);
|
|
6658
|
-
}, function(start, end) {
|
|
6659
|
-
return (end - start) / durationDay;
|
|
6660
|
-
}, function(date) {
|
|
6661
|
-
return date.getUTCDate() - 1;
|
|
6662
|
-
});
|
|
6663
|
-
|
|
6664
|
-
var utcDay$1 = utcDay;
|
|
6665
|
-
utcDay.range;
|
|
6666
|
-
|
|
6667
|
-
function utcWeekday(i) {
|
|
6668
|
-
return newInterval(function(date) {
|
|
6669
|
-
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
|
6670
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
6671
|
-
}, function(date, step) {
|
|
6672
|
-
date.setUTCDate(date.getUTCDate() + step * 7);
|
|
6673
|
-
}, function(start, end) {
|
|
6674
|
-
return (end - start) / durationWeek;
|
|
6675
|
-
});
|
|
6676
|
-
}
|
|
6677
|
-
|
|
6678
|
-
var utcSunday = utcWeekday(0);
|
|
6679
|
-
var utcMonday = utcWeekday(1);
|
|
6680
|
-
var utcTuesday = utcWeekday(2);
|
|
6681
|
-
var utcWednesday = utcWeekday(3);
|
|
6682
|
-
var utcThursday = utcWeekday(4);
|
|
6683
|
-
var utcFriday = utcWeekday(5);
|
|
6684
|
-
var utcSaturday = utcWeekday(6);
|
|
6685
|
-
|
|
6686
|
-
utcSunday.range;
|
|
6687
|
-
utcMonday.range;
|
|
6688
|
-
utcTuesday.range;
|
|
6689
|
-
utcWednesday.range;
|
|
6690
|
-
utcThursday.range;
|
|
6691
|
-
utcFriday.range;
|
|
6692
|
-
utcSaturday.range;
|
|
6693
|
-
|
|
6694
|
-
var utcYear = newInterval(function(date) {
|
|
6695
|
-
date.setUTCMonth(0, 1);
|
|
6696
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
6697
|
-
}, function(date, step) {
|
|
6698
|
-
date.setUTCFullYear(date.getUTCFullYear() + step);
|
|
6699
|
-
}, function(start, end) {
|
|
6700
|
-
return end.getUTCFullYear() - start.getUTCFullYear();
|
|
6701
|
-
}, function(date) {
|
|
6702
|
-
return date.getUTCFullYear();
|
|
6703
|
-
});
|
|
6704
|
-
|
|
6705
|
-
// An optimized implementation for this simple case.
|
|
6706
|
-
utcYear.every = function(k) {
|
|
6707
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
|
|
6708
|
-
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
|
6709
|
-
date.setUTCMonth(0, 1);
|
|
6710
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
6711
|
-
}, function(date, step) {
|
|
6712
|
-
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
|
6713
|
-
});
|
|
6714
|
-
};
|
|
6715
|
-
|
|
6716
|
-
var utcYear$1 = utcYear;
|
|
6717
|
-
utcYear.range;
|
|
6718
|
-
|
|
6719
|
-
function localDate(d) {
|
|
6720
|
-
if (0 <= d.y && d.y < 100) {
|
|
6721
|
-
var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
6722
|
-
date.setFullYear(d.y);
|
|
6723
|
-
return date;
|
|
6724
|
-
}
|
|
6725
|
-
return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
|
|
6726
|
-
}
|
|
6727
|
-
|
|
6728
|
-
function utcDate(d) {
|
|
6729
|
-
if (0 <= d.y && d.y < 100) {
|
|
6730
|
-
var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
6731
|
-
date.setUTCFullYear(d.y);
|
|
6732
|
-
return date;
|
|
6733
|
-
}
|
|
6734
|
-
return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
|
|
6735
|
-
}
|
|
6736
|
-
|
|
6737
|
-
function newDate(y, m, d) {
|
|
6738
|
-
return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};
|
|
6739
|
-
}
|
|
6740
|
-
|
|
6741
|
-
function formatLocale(locale) {
|
|
6742
|
-
var locale_dateTime = locale.dateTime,
|
|
6743
|
-
locale_date = locale.date,
|
|
6744
|
-
locale_time = locale.time,
|
|
6745
|
-
locale_periods = locale.periods,
|
|
6746
|
-
locale_weekdays = locale.days,
|
|
6747
|
-
locale_shortWeekdays = locale.shortDays,
|
|
6748
|
-
locale_months = locale.months,
|
|
6749
|
-
locale_shortMonths = locale.shortMonths;
|
|
6750
|
-
|
|
6751
|
-
var periodRe = formatRe(locale_periods),
|
|
6752
|
-
periodLookup = formatLookup(locale_periods),
|
|
6753
|
-
weekdayRe = formatRe(locale_weekdays),
|
|
6754
|
-
weekdayLookup = formatLookup(locale_weekdays),
|
|
6755
|
-
shortWeekdayRe = formatRe(locale_shortWeekdays),
|
|
6756
|
-
shortWeekdayLookup = formatLookup(locale_shortWeekdays),
|
|
6757
|
-
monthRe = formatRe(locale_months),
|
|
6758
|
-
monthLookup = formatLookup(locale_months),
|
|
6759
|
-
shortMonthRe = formatRe(locale_shortMonths),
|
|
6760
|
-
shortMonthLookup = formatLookup(locale_shortMonths);
|
|
6761
|
-
|
|
6762
|
-
var formats = {
|
|
6763
|
-
"a": formatShortWeekday,
|
|
6764
|
-
"A": formatWeekday,
|
|
6765
|
-
"b": formatShortMonth,
|
|
6766
|
-
"B": formatMonth,
|
|
6767
|
-
"c": null,
|
|
6768
|
-
"d": formatDayOfMonth,
|
|
6769
|
-
"e": formatDayOfMonth,
|
|
6770
|
-
"f": formatMicroseconds,
|
|
6771
|
-
"g": formatYearISO,
|
|
6772
|
-
"G": formatFullYearISO,
|
|
6773
|
-
"H": formatHour24,
|
|
6774
|
-
"I": formatHour12,
|
|
6775
|
-
"j": formatDayOfYear,
|
|
6776
|
-
"L": formatMilliseconds,
|
|
6777
|
-
"m": formatMonthNumber,
|
|
6778
|
-
"M": formatMinutes,
|
|
6779
|
-
"p": formatPeriod,
|
|
6780
|
-
"q": formatQuarter,
|
|
6781
|
-
"Q": formatUnixTimestamp,
|
|
6782
|
-
"s": formatUnixTimestampSeconds,
|
|
6783
|
-
"S": formatSeconds,
|
|
6784
|
-
"u": formatWeekdayNumberMonday,
|
|
6785
|
-
"U": formatWeekNumberSunday,
|
|
6786
|
-
"V": formatWeekNumberISO,
|
|
6787
|
-
"w": formatWeekdayNumberSunday,
|
|
6788
|
-
"W": formatWeekNumberMonday,
|
|
6789
|
-
"x": null,
|
|
6790
|
-
"X": null,
|
|
6791
|
-
"y": formatYear,
|
|
6792
|
-
"Y": formatFullYear,
|
|
6793
|
-
"Z": formatZone,
|
|
6794
|
-
"%": formatLiteralPercent
|
|
6795
|
-
};
|
|
6796
|
-
|
|
6797
|
-
var utcFormats = {
|
|
6798
|
-
"a": formatUTCShortWeekday,
|
|
6799
|
-
"A": formatUTCWeekday,
|
|
6800
|
-
"b": formatUTCShortMonth,
|
|
6801
|
-
"B": formatUTCMonth,
|
|
6802
|
-
"c": null,
|
|
6803
|
-
"d": formatUTCDayOfMonth,
|
|
6804
|
-
"e": formatUTCDayOfMonth,
|
|
6805
|
-
"f": formatUTCMicroseconds,
|
|
6806
|
-
"g": formatUTCYearISO,
|
|
6807
|
-
"G": formatUTCFullYearISO,
|
|
6808
|
-
"H": formatUTCHour24,
|
|
6809
|
-
"I": formatUTCHour12,
|
|
6810
|
-
"j": formatUTCDayOfYear,
|
|
6811
|
-
"L": formatUTCMilliseconds,
|
|
6812
|
-
"m": formatUTCMonthNumber,
|
|
6813
|
-
"M": formatUTCMinutes,
|
|
6814
|
-
"p": formatUTCPeriod,
|
|
6815
|
-
"q": formatUTCQuarter,
|
|
6816
|
-
"Q": formatUnixTimestamp,
|
|
6817
|
-
"s": formatUnixTimestampSeconds,
|
|
6818
|
-
"S": formatUTCSeconds,
|
|
6819
|
-
"u": formatUTCWeekdayNumberMonday,
|
|
6820
|
-
"U": formatUTCWeekNumberSunday,
|
|
6821
|
-
"V": formatUTCWeekNumberISO,
|
|
6822
|
-
"w": formatUTCWeekdayNumberSunday,
|
|
6823
|
-
"W": formatUTCWeekNumberMonday,
|
|
6824
|
-
"x": null,
|
|
6825
|
-
"X": null,
|
|
6826
|
-
"y": formatUTCYear,
|
|
6827
|
-
"Y": formatUTCFullYear,
|
|
6828
|
-
"Z": formatUTCZone,
|
|
6829
|
-
"%": formatLiteralPercent
|
|
6830
|
-
};
|
|
6831
|
-
|
|
6832
|
-
var parses = {
|
|
6833
|
-
"a": parseShortWeekday,
|
|
6834
|
-
"A": parseWeekday,
|
|
6835
|
-
"b": parseShortMonth,
|
|
6836
|
-
"B": parseMonth,
|
|
6837
|
-
"c": parseLocaleDateTime,
|
|
6838
|
-
"d": parseDayOfMonth,
|
|
6839
|
-
"e": parseDayOfMonth,
|
|
6840
|
-
"f": parseMicroseconds,
|
|
6841
|
-
"g": parseYear,
|
|
6842
|
-
"G": parseFullYear,
|
|
6843
|
-
"H": parseHour24,
|
|
6844
|
-
"I": parseHour24,
|
|
6845
|
-
"j": parseDayOfYear,
|
|
6846
|
-
"L": parseMilliseconds,
|
|
6847
|
-
"m": parseMonthNumber,
|
|
6848
|
-
"M": parseMinutes,
|
|
6849
|
-
"p": parsePeriod,
|
|
6850
|
-
"q": parseQuarter,
|
|
6851
|
-
"Q": parseUnixTimestamp,
|
|
6852
|
-
"s": parseUnixTimestampSeconds,
|
|
6853
|
-
"S": parseSeconds,
|
|
6854
|
-
"u": parseWeekdayNumberMonday,
|
|
6855
|
-
"U": parseWeekNumberSunday,
|
|
6856
|
-
"V": parseWeekNumberISO,
|
|
6857
|
-
"w": parseWeekdayNumberSunday,
|
|
6858
|
-
"W": parseWeekNumberMonday,
|
|
6859
|
-
"x": parseLocaleDate,
|
|
6860
|
-
"X": parseLocaleTime,
|
|
6861
|
-
"y": parseYear,
|
|
6862
|
-
"Y": parseFullYear,
|
|
6863
|
-
"Z": parseZone,
|
|
6864
|
-
"%": parseLiteralPercent
|
|
6865
|
-
};
|
|
6866
|
-
|
|
6867
|
-
// These recursive directive definitions must be deferred.
|
|
6868
|
-
formats.x = newFormat(locale_date, formats);
|
|
6869
|
-
formats.X = newFormat(locale_time, formats);
|
|
6870
|
-
formats.c = newFormat(locale_dateTime, formats);
|
|
6871
|
-
utcFormats.x = newFormat(locale_date, utcFormats);
|
|
6872
|
-
utcFormats.X = newFormat(locale_time, utcFormats);
|
|
6873
|
-
utcFormats.c = newFormat(locale_dateTime, utcFormats);
|
|
6874
|
-
|
|
6875
|
-
function newFormat(specifier, formats) {
|
|
6876
|
-
return function(date) {
|
|
6877
|
-
var string = [],
|
|
6878
|
-
i = -1,
|
|
6879
|
-
j = 0,
|
|
6880
|
-
n = specifier.length,
|
|
6881
|
-
c,
|
|
6882
|
-
pad,
|
|
6883
|
-
format;
|
|
6884
|
-
|
|
6885
|
-
if (!(date instanceof Date)) date = new Date(+date);
|
|
6886
|
-
|
|
6887
|
-
while (++i < n) {
|
|
6888
|
-
if (specifier.charCodeAt(i) === 37) {
|
|
6889
|
-
string.push(specifier.slice(j, i));
|
|
6890
|
-
if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
|
|
6891
|
-
else pad = c === "e" ? " " : "0";
|
|
6892
|
-
if (format = formats[c]) c = format(date, pad);
|
|
6893
|
-
string.push(c);
|
|
6894
|
-
j = i + 1;
|
|
6895
|
-
}
|
|
6896
|
-
}
|
|
6897
|
-
|
|
6898
|
-
string.push(specifier.slice(j, i));
|
|
6899
|
-
return string.join("");
|
|
6900
|
-
};
|
|
6901
|
-
}
|
|
6902
|
-
|
|
6903
|
-
function newParse(specifier, Z) {
|
|
6904
|
-
return function(string) {
|
|
6905
|
-
var d = newDate(1900, undefined, 1),
|
|
6906
|
-
i = parseSpecifier(d, specifier, string += "", 0),
|
|
6907
|
-
week, day;
|
|
6908
|
-
if (i != string.length) return null;
|
|
6909
|
-
|
|
6910
|
-
// If a UNIX timestamp is specified, return it.
|
|
6911
|
-
if ("Q" in d) return new Date(d.Q);
|
|
6912
|
-
if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0));
|
|
6913
|
-
|
|
6914
|
-
// If this is utcParse, never use the local timezone.
|
|
6915
|
-
if (Z && !("Z" in d)) d.Z = 0;
|
|
6916
|
-
|
|
6917
|
-
// The am-pm flag is 0 for AM, and 1 for PM.
|
|
6918
|
-
if ("p" in d) d.H = d.H % 12 + d.p * 12;
|
|
6919
|
-
|
|
6920
|
-
// If the month was not specified, inherit from the quarter.
|
|
6921
|
-
if (d.m === undefined) d.m = "q" in d ? d.q : 0;
|
|
6922
|
-
|
|
6923
|
-
// Convert day-of-week and week-of-year to day-of-year.
|
|
6924
|
-
if ("V" in d) {
|
|
6925
|
-
if (d.V < 1 || d.V > 53) return null;
|
|
6926
|
-
if (!("w" in d)) d.w = 1;
|
|
6927
|
-
if ("Z" in d) {
|
|
6928
|
-
week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
|
|
6929
|
-
week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
|
|
6930
|
-
week = utcDay$1.offset(week, (d.V - 1) * 7);
|
|
6931
|
-
d.y = week.getUTCFullYear();
|
|
6932
|
-
d.m = week.getUTCMonth();
|
|
6933
|
-
d.d = week.getUTCDate() + (d.w + 6) % 7;
|
|
6934
|
-
} else {
|
|
6935
|
-
week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
|
|
6936
|
-
week = day > 4 || day === 0 ? monday.ceil(week) : monday(week);
|
|
6937
|
-
week = d3timeDay.offset(week, (d.V - 1) * 7);
|
|
6938
|
-
d.y = week.getFullYear();
|
|
6939
|
-
d.m = week.getMonth();
|
|
6940
|
-
d.d = week.getDate() + (d.w + 6) % 7;
|
|
6941
|
-
}
|
|
6942
|
-
} else if ("W" in d || "U" in d) {
|
|
6943
|
-
if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
|
|
6944
|
-
day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
|
|
6945
|
-
d.m = 0;
|
|
6946
|
-
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
|
|
6947
|
-
}
|
|
6948
|
-
|
|
6949
|
-
// If a time zone is specified, all fields are interpreted as UTC and then
|
|
6950
|
-
// offset according to the specified time zone.
|
|
6951
|
-
if ("Z" in d) {
|
|
6952
|
-
d.H += d.Z / 100 | 0;
|
|
6953
|
-
d.M += d.Z % 100;
|
|
6954
|
-
return utcDate(d);
|
|
6955
|
-
}
|
|
6956
|
-
|
|
6957
|
-
// Otherwise, all fields are in local time.
|
|
6958
|
-
return localDate(d);
|
|
6959
|
-
};
|
|
6960
|
-
}
|
|
6961
|
-
|
|
6962
|
-
function parseSpecifier(d, specifier, string, j) {
|
|
6963
|
-
var i = 0,
|
|
6964
|
-
n = specifier.length,
|
|
6965
|
-
m = string.length,
|
|
6966
|
-
c,
|
|
6967
|
-
parse;
|
|
6968
|
-
|
|
6969
|
-
while (i < n) {
|
|
6970
|
-
if (j >= m) return -1;
|
|
6971
|
-
c = specifier.charCodeAt(i++);
|
|
6972
|
-
if (c === 37) {
|
|
6973
|
-
c = specifier.charAt(i++);
|
|
6974
|
-
parse = parses[c in pads ? specifier.charAt(i++) : c];
|
|
6975
|
-
if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
|
|
6976
|
-
} else if (c != string.charCodeAt(j++)) {
|
|
6977
|
-
return -1;
|
|
6978
|
-
}
|
|
6979
|
-
}
|
|
6980
|
-
|
|
6981
|
-
return j;
|
|
6982
|
-
}
|
|
6983
|
-
|
|
6984
|
-
function parsePeriod(d, string, i) {
|
|
6985
|
-
var n = periodRe.exec(string.slice(i));
|
|
6986
|
-
return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
6987
|
-
}
|
|
6988
|
-
|
|
6989
|
-
function parseShortWeekday(d, string, i) {
|
|
6990
|
-
var n = shortWeekdayRe.exec(string.slice(i));
|
|
6991
|
-
return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
6992
|
-
}
|
|
6993
|
-
|
|
6994
|
-
function parseWeekday(d, string, i) {
|
|
6995
|
-
var n = weekdayRe.exec(string.slice(i));
|
|
6996
|
-
return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
6997
|
-
}
|
|
6998
|
-
|
|
6999
|
-
function parseShortMonth(d, string, i) {
|
|
7000
|
-
var n = shortMonthRe.exec(string.slice(i));
|
|
7001
|
-
return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
7002
|
-
}
|
|
7003
|
-
|
|
7004
|
-
function parseMonth(d, string, i) {
|
|
7005
|
-
var n = monthRe.exec(string.slice(i));
|
|
7006
|
-
return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
|
7007
|
-
}
|
|
7008
|
-
|
|
7009
|
-
function parseLocaleDateTime(d, string, i) {
|
|
7010
|
-
return parseSpecifier(d, locale_dateTime, string, i);
|
|
7011
|
-
}
|
|
7012
|
-
|
|
7013
|
-
function parseLocaleDate(d, string, i) {
|
|
7014
|
-
return parseSpecifier(d, locale_date, string, i);
|
|
7015
|
-
}
|
|
7016
|
-
|
|
7017
|
-
function parseLocaleTime(d, string, i) {
|
|
7018
|
-
return parseSpecifier(d, locale_time, string, i);
|
|
7019
|
-
}
|
|
7020
|
-
|
|
7021
|
-
function formatShortWeekday(d) {
|
|
7022
|
-
return locale_shortWeekdays[d.getDay()];
|
|
7023
|
-
}
|
|
7024
|
-
|
|
7025
|
-
function formatWeekday(d) {
|
|
7026
|
-
return locale_weekdays[d.getDay()];
|
|
7027
|
-
}
|
|
7028
|
-
|
|
7029
|
-
function formatShortMonth(d) {
|
|
7030
|
-
return locale_shortMonths[d.getMonth()];
|
|
7031
|
-
}
|
|
7032
|
-
|
|
7033
|
-
function formatMonth(d) {
|
|
7034
|
-
return locale_months[d.getMonth()];
|
|
7035
|
-
}
|
|
7036
|
-
|
|
7037
|
-
function formatPeriod(d) {
|
|
7038
|
-
return locale_periods[+(d.getHours() >= 12)];
|
|
7039
|
-
}
|
|
7040
|
-
|
|
7041
|
-
function formatQuarter(d) {
|
|
7042
|
-
return 1 + ~~(d.getMonth() / 3);
|
|
7043
|
-
}
|
|
7044
|
-
|
|
7045
|
-
function formatUTCShortWeekday(d) {
|
|
7046
|
-
return locale_shortWeekdays[d.getUTCDay()];
|
|
7047
|
-
}
|
|
7048
|
-
|
|
7049
|
-
function formatUTCWeekday(d) {
|
|
7050
|
-
return locale_weekdays[d.getUTCDay()];
|
|
7051
|
-
}
|
|
7052
|
-
|
|
7053
|
-
function formatUTCShortMonth(d) {
|
|
7054
|
-
return locale_shortMonths[d.getUTCMonth()];
|
|
7055
|
-
}
|
|
7056
|
-
|
|
7057
|
-
function formatUTCMonth(d) {
|
|
7058
|
-
return locale_months[d.getUTCMonth()];
|
|
7059
|
-
}
|
|
7060
|
-
|
|
7061
|
-
function formatUTCPeriod(d) {
|
|
7062
|
-
return locale_periods[+(d.getUTCHours() >= 12)];
|
|
7063
|
-
}
|
|
7064
|
-
|
|
7065
|
-
function formatUTCQuarter(d) {
|
|
7066
|
-
return 1 + ~~(d.getUTCMonth() / 3);
|
|
7067
|
-
}
|
|
7068
|
-
|
|
7069
|
-
return {
|
|
7070
|
-
format: function(specifier) {
|
|
7071
|
-
var f = newFormat(specifier += "", formats);
|
|
7072
|
-
f.toString = function() { return specifier; };
|
|
7073
|
-
return f;
|
|
7074
|
-
},
|
|
7075
|
-
parse: function(specifier) {
|
|
7076
|
-
var p = newParse(specifier += "", false);
|
|
7077
|
-
p.toString = function() { return specifier; };
|
|
7078
|
-
return p;
|
|
7079
|
-
},
|
|
7080
|
-
utcFormat: function(specifier) {
|
|
7081
|
-
var f = newFormat(specifier += "", utcFormats);
|
|
7082
|
-
f.toString = function() { return specifier; };
|
|
7083
|
-
return f;
|
|
7084
|
-
},
|
|
7085
|
-
utcParse: function(specifier) {
|
|
7086
|
-
var p = newParse(specifier += "", true);
|
|
7087
|
-
p.toString = function() { return specifier; };
|
|
7088
|
-
return p;
|
|
7089
|
-
}
|
|
7090
|
-
};
|
|
7091
|
-
}
|
|
7092
|
-
|
|
7093
|
-
var pads = {"-": "", "_": " ", "0": "0"},
|
|
7094
|
-
numberRe = /^\s*\d+/, // note: ignores next directive
|
|
7095
|
-
percentRe = /^%/,
|
|
7096
|
-
requoteRe = /[\\^$*+?|[\]().{}]/g;
|
|
7097
|
-
|
|
7098
|
-
function pad(value, fill, width) {
|
|
7099
|
-
var sign = value < 0 ? "-" : "",
|
|
7100
|
-
string = (sign ? -value : value) + "",
|
|
7101
|
-
length = string.length;
|
|
7102
|
-
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
|
|
7103
|
-
}
|
|
7104
|
-
|
|
7105
|
-
function requote(s) {
|
|
7106
|
-
return s.replace(requoteRe, "\\$&");
|
|
7107
|
-
}
|
|
7108
|
-
|
|
7109
|
-
function formatRe(names) {
|
|
7110
|
-
return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
|
|
7111
|
-
}
|
|
7112
|
-
|
|
7113
|
-
function formatLookup(names) {
|
|
7114
|
-
return new Map(names.map((name, i) => [name.toLowerCase(), i]));
|
|
7115
|
-
}
|
|
7116
|
-
|
|
7117
|
-
function parseWeekdayNumberSunday(d, string, i) {
|
|
7118
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
7119
|
-
return n ? (d.w = +n[0], i + n[0].length) : -1;
|
|
7120
|
-
}
|
|
7121
|
-
|
|
7122
|
-
function parseWeekdayNumberMonday(d, string, i) {
|
|
7123
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
7124
|
-
return n ? (d.u = +n[0], i + n[0].length) : -1;
|
|
7125
|
-
}
|
|
7126
|
-
|
|
7127
|
-
function parseWeekNumberSunday(d, string, i) {
|
|
7128
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
7129
|
-
return n ? (d.U = +n[0], i + n[0].length) : -1;
|
|
7130
|
-
}
|
|
7131
|
-
|
|
7132
|
-
function parseWeekNumberISO(d, string, i) {
|
|
7133
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
7134
|
-
return n ? (d.V = +n[0], i + n[0].length) : -1;
|
|
7135
|
-
}
|
|
7136
|
-
|
|
7137
|
-
function parseWeekNumberMonday(d, string, i) {
|
|
7138
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
7139
|
-
return n ? (d.W = +n[0], i + n[0].length) : -1;
|
|
7140
|
-
}
|
|
7141
|
-
|
|
7142
|
-
function parseFullYear(d, string, i) {
|
|
7143
|
-
var n = numberRe.exec(string.slice(i, i + 4));
|
|
7144
|
-
return n ? (d.y = +n[0], i + n[0].length) : -1;
|
|
7145
|
-
}
|
|
7146
|
-
|
|
7147
|
-
function parseYear(d, string, i) {
|
|
7148
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
7149
|
-
return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
|
|
7150
|
-
}
|
|
7151
|
-
|
|
7152
|
-
function parseZone(d, string, i) {
|
|
7153
|
-
var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
|
|
7154
|
-
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
|
|
7155
|
-
}
|
|
7156
|
-
|
|
7157
|
-
function parseQuarter(d, string, i) {
|
|
7158
|
-
var n = numberRe.exec(string.slice(i, i + 1));
|
|
7159
|
-
return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
|
|
7160
|
-
}
|
|
7161
|
-
|
|
7162
|
-
function parseMonthNumber(d, string, i) {
|
|
7163
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
7164
|
-
return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
|
|
7165
|
-
}
|
|
7166
|
-
|
|
7167
|
-
function parseDayOfMonth(d, string, i) {
|
|
7168
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
7169
|
-
return n ? (d.d = +n[0], i + n[0].length) : -1;
|
|
7170
|
-
}
|
|
7171
|
-
|
|
7172
|
-
function parseDayOfYear(d, string, i) {
|
|
7173
|
-
var n = numberRe.exec(string.slice(i, i + 3));
|
|
7174
|
-
return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
|
|
7175
|
-
}
|
|
7176
|
-
|
|
7177
|
-
function parseHour24(d, string, i) {
|
|
7178
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
7179
|
-
return n ? (d.H = +n[0], i + n[0].length) : -1;
|
|
7180
|
-
}
|
|
7181
|
-
|
|
7182
|
-
function parseMinutes(d, string, i) {
|
|
7183
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
7184
|
-
return n ? (d.M = +n[0], i + n[0].length) : -1;
|
|
7185
|
-
}
|
|
7186
|
-
|
|
7187
|
-
function parseSeconds(d, string, i) {
|
|
7188
|
-
var n = numberRe.exec(string.slice(i, i + 2));
|
|
7189
|
-
return n ? (d.S = +n[0], i + n[0].length) : -1;
|
|
7190
|
-
}
|
|
7191
|
-
|
|
7192
|
-
function parseMilliseconds(d, string, i) {
|
|
7193
|
-
var n = numberRe.exec(string.slice(i, i + 3));
|
|
7194
|
-
return n ? (d.L = +n[0], i + n[0].length) : -1;
|
|
7195
|
-
}
|
|
7196
|
-
|
|
7197
|
-
function parseMicroseconds(d, string, i) {
|
|
7198
|
-
var n = numberRe.exec(string.slice(i, i + 6));
|
|
7199
|
-
return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;
|
|
7200
|
-
}
|
|
7201
|
-
|
|
7202
|
-
function parseLiteralPercent(d, string, i) {
|
|
7203
|
-
var n = percentRe.exec(string.slice(i, i + 1));
|
|
7204
|
-
return n ? i + n[0].length : -1;
|
|
7205
|
-
}
|
|
7206
|
-
|
|
7207
|
-
function parseUnixTimestamp(d, string, i) {
|
|
7208
|
-
var n = numberRe.exec(string.slice(i));
|
|
7209
|
-
return n ? (d.Q = +n[0], i + n[0].length) : -1;
|
|
7210
|
-
}
|
|
7211
|
-
|
|
7212
|
-
function parseUnixTimestampSeconds(d, string, i) {
|
|
7213
|
-
var n = numberRe.exec(string.slice(i));
|
|
7214
|
-
return n ? (d.s = +n[0], i + n[0].length) : -1;
|
|
7215
|
-
}
|
|
7216
|
-
|
|
7217
|
-
function formatDayOfMonth(d, p) {
|
|
7218
|
-
return pad(d.getDate(), p, 2);
|
|
7219
|
-
}
|
|
7220
|
-
|
|
7221
|
-
function formatHour24(d, p) {
|
|
7222
|
-
return pad(d.getHours(), p, 2);
|
|
7223
|
-
}
|
|
7224
|
-
|
|
7225
|
-
function formatHour12(d, p) {
|
|
7226
|
-
return pad(d.getHours() % 12 || 12, p, 2);
|
|
7227
|
-
}
|
|
7228
|
-
|
|
7229
|
-
function formatDayOfYear(d, p) {
|
|
7230
|
-
return pad(1 + d3timeDay.count(d3timeYear(d), d), p, 3);
|
|
7231
|
-
}
|
|
7232
|
-
|
|
7233
|
-
function formatMilliseconds(d, p) {
|
|
7234
|
-
return pad(d.getMilliseconds(), p, 3);
|
|
7235
|
-
}
|
|
7236
|
-
|
|
7237
|
-
function formatMicroseconds(d, p) {
|
|
7238
|
-
return formatMilliseconds(d, p) + "000";
|
|
7239
|
-
}
|
|
7240
|
-
|
|
7241
|
-
function formatMonthNumber(d, p) {
|
|
7242
|
-
return pad(d.getMonth() + 1, p, 2);
|
|
7243
|
-
}
|
|
7244
|
-
|
|
7245
|
-
function formatMinutes(d, p) {
|
|
7246
|
-
return pad(d.getMinutes(), p, 2);
|
|
7247
|
-
}
|
|
7248
|
-
|
|
7249
|
-
function formatSeconds(d, p) {
|
|
7250
|
-
return pad(d.getSeconds(), p, 2);
|
|
7251
|
-
}
|
|
7252
|
-
|
|
7253
|
-
function formatWeekdayNumberMonday(d) {
|
|
7254
|
-
var day = d.getDay();
|
|
7255
|
-
return day === 0 ? 7 : day;
|
|
7256
|
-
}
|
|
7257
|
-
|
|
7258
|
-
function formatWeekNumberSunday(d, p) {
|
|
7259
|
-
return pad(sunday.count(d3timeYear(d) - 1, d), p, 2);
|
|
7260
|
-
}
|
|
7261
|
-
|
|
7262
|
-
function dISO(d) {
|
|
7263
|
-
var day = d.getDay();
|
|
7264
|
-
return (day >= 4 || day === 0) ? thursday(d) : thursday.ceil(d);
|
|
7265
|
-
}
|
|
7266
|
-
|
|
7267
|
-
function formatWeekNumberISO(d, p) {
|
|
7268
|
-
d = dISO(d);
|
|
7269
|
-
return pad(thursday.count(d3timeYear(d), d) + (d3timeYear(d).getDay() === 4), p, 2);
|
|
7270
|
-
}
|
|
7271
|
-
|
|
7272
|
-
function formatWeekdayNumberSunday(d) {
|
|
7273
|
-
return d.getDay();
|
|
7274
|
-
}
|
|
7275
|
-
|
|
7276
|
-
function formatWeekNumberMonday(d, p) {
|
|
7277
|
-
return pad(monday.count(d3timeYear(d) - 1, d), p, 2);
|
|
7278
|
-
}
|
|
7279
|
-
|
|
7280
|
-
function formatYear(d, p) {
|
|
7281
|
-
return pad(d.getFullYear() % 100, p, 2);
|
|
7282
|
-
}
|
|
7283
|
-
|
|
7284
|
-
function formatYearISO(d, p) {
|
|
7285
|
-
d = dISO(d);
|
|
7286
|
-
return pad(d.getFullYear() % 100, p, 2);
|
|
7287
|
-
}
|
|
7288
|
-
|
|
7289
|
-
function formatFullYear(d, p) {
|
|
7290
|
-
return pad(d.getFullYear() % 10000, p, 4);
|
|
7291
|
-
}
|
|
7292
|
-
|
|
7293
|
-
function formatFullYearISO(d, p) {
|
|
7294
|
-
var day = d.getDay();
|
|
7295
|
-
d = (day >= 4 || day === 0) ? thursday(d) : thursday.ceil(d);
|
|
7296
|
-
return pad(d.getFullYear() % 10000, p, 4);
|
|
7297
|
-
}
|
|
7298
|
-
|
|
7299
|
-
function formatZone(d) {
|
|
7300
|
-
var z = d.getTimezoneOffset();
|
|
7301
|
-
return (z > 0 ? "-" : (z *= -1, "+"))
|
|
7302
|
-
+ pad(z / 60 | 0, "0", 2)
|
|
7303
|
-
+ pad(z % 60, "0", 2);
|
|
7304
|
-
}
|
|
7305
|
-
|
|
7306
|
-
function formatUTCDayOfMonth(d, p) {
|
|
7307
|
-
return pad(d.getUTCDate(), p, 2);
|
|
7308
|
-
}
|
|
7309
|
-
|
|
7310
|
-
function formatUTCHour24(d, p) {
|
|
7311
|
-
return pad(d.getUTCHours(), p, 2);
|
|
7312
|
-
}
|
|
7313
|
-
|
|
7314
|
-
function formatUTCHour12(d, p) {
|
|
7315
|
-
return pad(d.getUTCHours() % 12 || 12, p, 2);
|
|
7316
|
-
}
|
|
7317
|
-
|
|
7318
|
-
function formatUTCDayOfYear(d, p) {
|
|
7319
|
-
return pad(1 + utcDay$1.count(utcYear$1(d), d), p, 3);
|
|
7320
|
-
}
|
|
7321
|
-
|
|
7322
|
-
function formatUTCMilliseconds(d, p) {
|
|
7323
|
-
return pad(d.getUTCMilliseconds(), p, 3);
|
|
7324
|
-
}
|
|
7325
|
-
|
|
7326
|
-
function formatUTCMicroseconds(d, p) {
|
|
7327
|
-
return formatUTCMilliseconds(d, p) + "000";
|
|
7328
|
-
}
|
|
7329
|
-
|
|
7330
|
-
function formatUTCMonthNumber(d, p) {
|
|
7331
|
-
return pad(d.getUTCMonth() + 1, p, 2);
|
|
7332
|
-
}
|
|
7333
|
-
|
|
7334
|
-
function formatUTCMinutes(d, p) {
|
|
7335
|
-
return pad(d.getUTCMinutes(), p, 2);
|
|
7336
|
-
}
|
|
7337
|
-
|
|
7338
|
-
function formatUTCSeconds(d, p) {
|
|
7339
|
-
return pad(d.getUTCSeconds(), p, 2);
|
|
7340
|
-
}
|
|
7341
|
-
|
|
7342
|
-
function formatUTCWeekdayNumberMonday(d) {
|
|
7343
|
-
var dow = d.getUTCDay();
|
|
7344
|
-
return dow === 0 ? 7 : dow;
|
|
7345
|
-
}
|
|
7346
|
-
|
|
7347
|
-
function formatUTCWeekNumberSunday(d, p) {
|
|
7348
|
-
return pad(utcSunday.count(utcYear$1(d) - 1, d), p, 2);
|
|
7349
|
-
}
|
|
7350
|
-
|
|
7351
|
-
function UTCdISO(d) {
|
|
7352
|
-
var day = d.getUTCDay();
|
|
7353
|
-
return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
|
|
7354
|
-
}
|
|
7355
|
-
|
|
7356
|
-
function formatUTCWeekNumberISO(d, p) {
|
|
7357
|
-
d = UTCdISO(d);
|
|
7358
|
-
return pad(utcThursday.count(utcYear$1(d), d) + (utcYear$1(d).getUTCDay() === 4), p, 2);
|
|
7359
|
-
}
|
|
7360
|
-
|
|
7361
|
-
function formatUTCWeekdayNumberSunday(d) {
|
|
7362
|
-
return d.getUTCDay();
|
|
7363
|
-
}
|
|
7364
|
-
|
|
7365
|
-
function formatUTCWeekNumberMonday(d, p) {
|
|
7366
|
-
return pad(utcMonday.count(utcYear$1(d) - 1, d), p, 2);
|
|
7367
|
-
}
|
|
7368
|
-
|
|
7369
|
-
function formatUTCYear(d, p) {
|
|
7370
|
-
return pad(d.getUTCFullYear() % 100, p, 2);
|
|
7371
|
-
}
|
|
7372
|
-
|
|
7373
|
-
function formatUTCYearISO(d, p) {
|
|
7374
|
-
d = UTCdISO(d);
|
|
7375
|
-
return pad(d.getUTCFullYear() % 100, p, 2);
|
|
7376
|
-
}
|
|
7377
|
-
|
|
7378
|
-
function formatUTCFullYear(d, p) {
|
|
7379
|
-
return pad(d.getUTCFullYear() % 10000, p, 4);
|
|
7380
|
-
}
|
|
7381
|
-
|
|
7382
|
-
function formatUTCFullYearISO(d, p) {
|
|
7383
|
-
var day = d.getUTCDay();
|
|
7384
|
-
d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
|
|
7385
|
-
return pad(d.getUTCFullYear() % 10000, p, 4);
|
|
7386
|
-
}
|
|
7387
|
-
|
|
7388
|
-
function formatUTCZone() {
|
|
7389
|
-
return "+0000";
|
|
7390
|
-
}
|
|
7391
|
-
|
|
7392
|
-
function formatLiteralPercent() {
|
|
7393
|
-
return "%";
|
|
7394
|
-
}
|
|
7395
|
-
|
|
7396
|
-
function formatUnixTimestamp(d) {
|
|
7397
|
-
return +d;
|
|
7398
|
-
}
|
|
7399
|
-
|
|
7400
|
-
function formatUnixTimestampSeconds(d) {
|
|
7401
|
-
return Math.floor(+d / 1000);
|
|
7402
|
-
}
|
|
7403
|
-
|
|
7404
|
-
var locale;
|
|
7405
|
-
var timeFormat;
|
|
7406
|
-
var utcFormat;
|
|
7407
|
-
var utcParse;
|
|
7408
|
-
|
|
7409
|
-
defaultLocale({
|
|
7410
|
-
dateTime: "%x, %X",
|
|
7411
|
-
date: "%-m/%-d/%Y",
|
|
7412
|
-
time: "%-I:%M:%S %p",
|
|
7413
|
-
periods: ["AM", "PM"],
|
|
7414
|
-
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
7415
|
-
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
7416
|
-
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
7417
|
-
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
7418
|
-
});
|
|
7419
|
-
|
|
7420
|
-
function defaultLocale(definition) {
|
|
7421
|
-
locale = formatLocale(definition);
|
|
7422
|
-
timeFormat = locale.format;
|
|
7423
|
-
locale.parse;
|
|
7424
|
-
utcFormat = locale.utcFormat;
|
|
7425
|
-
utcParse = locale.utcParse;
|
|
7426
|
-
return locale;
|
|
7427
|
-
}
|
|
7428
|
-
|
|
7429
|
-
var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ";
|
|
7430
|
-
|
|
7431
|
-
function formatIsoNative(date) {
|
|
7432
|
-
return date.toISOString();
|
|
7433
|
-
}
|
|
7434
|
-
|
|
7435
|
-
Date.prototype.toISOString
|
|
7436
|
-
? formatIsoNative
|
|
7437
|
-
: utcFormat(isoSpecifier);
|
|
7438
|
-
|
|
7439
|
-
function parseIsoNative(string) {
|
|
7440
|
-
var date = new Date(string);
|
|
7441
|
-
return isNaN(date) ? null : date;
|
|
7442
|
-
}
|
|
7443
|
-
|
|
7444
|
-
var parseIso = +new Date("2000-01-01T00:00:00.000Z")
|
|
7445
|
-
? parseIsoNative
|
|
7446
|
-
: utcParse(isoSpecifier);
|
|
7447
|
-
|
|
7448
|
-
var d3isoParse = parseIso;
|
|
7449
|
-
|
|
7450
|
-
function Transform(k, x, y) {
|
|
7451
|
-
this.k = k;
|
|
7452
|
-
this.x = x;
|
|
7453
|
-
this.y = y;
|
|
7454
|
-
}
|
|
7455
|
-
|
|
7456
|
-
Transform.prototype = {
|
|
7457
|
-
constructor: Transform,
|
|
7458
|
-
scale: function(k) {
|
|
7459
|
-
return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
|
|
7460
|
-
},
|
|
7461
|
-
translate: function(x, y) {
|
|
7462
|
-
return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
|
|
7463
|
-
},
|
|
7464
|
-
apply: function(point) {
|
|
7465
|
-
return [point[0] * this.k + this.x, point[1] * this.k + this.y];
|
|
7466
|
-
},
|
|
7467
|
-
applyX: function(x) {
|
|
7468
|
-
return x * this.k + this.x;
|
|
7469
|
-
},
|
|
7470
|
-
applyY: function(y) {
|
|
7471
|
-
return y * this.k + this.y;
|
|
7472
|
-
},
|
|
7473
|
-
invert: function(location) {
|
|
7474
|
-
return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
|
|
7475
|
-
},
|
|
7476
|
-
invertX: function(x) {
|
|
7477
|
-
return (x - this.x) / this.k;
|
|
7478
|
-
},
|
|
7479
|
-
invertY: function(y) {
|
|
7480
|
-
return (y - this.y) / this.k;
|
|
7481
|
-
},
|
|
7482
|
-
rescaleX: function(x) {
|
|
7483
|
-
return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
|
|
7484
|
-
},
|
|
7485
|
-
rescaleY: function(y) {
|
|
7486
|
-
return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
|
|
7487
|
-
},
|
|
7488
|
-
toString: function() {
|
|
7489
|
-
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
|
7490
|
-
}
|
|
7491
|
-
};
|
|
7492
|
-
|
|
7493
|
-
new Transform(1, 0, 0);
|
|
7494
|
-
|
|
7495
|
-
Transform.prototype;
|
|
7496
|
-
|
|
7497
|
-
/**
|
|
7498
|
-
* Component style.
|
|
7499
|
-
*/
|
|
7500
|
-
const StyledPieChart = styled.div`
|
|
7501
|
-
margin: 8px;
|
|
7502
|
-
padding: 8px;
|
|
7503
|
-
color: var(--redsift-color-neutral-black);
|
|
7504
|
-
|
|
7505
|
-
.redsift-piechart__title {
|
|
7506
|
-
display: flex;
|
|
7507
|
-
flex-direction: row;
|
|
7508
|
-
align-items: center;
|
|
7509
|
-
gap: 16px;
|
|
7510
|
-
}
|
|
7511
|
-
|
|
7512
|
-
${_ref => {
|
|
7513
|
-
let {
|
|
7514
|
-
$showLabels
|
|
7515
|
-
} = _ref;
|
|
7516
|
-
return !$showLabels ? css`
|
|
7517
|
-
g.pie-label-group text {
|
|
7518
|
-
display: none;
|
|
7519
|
-
}
|
|
7520
|
-
` : '';
|
|
7521
|
-
}}
|
|
7522
|
-
|
|
7523
|
-
g.pie-slice {
|
|
7524
|
-
text {
|
|
7525
|
-
cursor: pointer;
|
|
7526
|
-
}
|
|
7527
|
-
|
|
7528
|
-
path {
|
|
7529
|
-
cursor: pointer;
|
|
7530
|
-
${_ref2 => {
|
|
7531
|
-
let {
|
|
7532
|
-
$spaced
|
|
7533
|
-
} = _ref2;
|
|
7534
|
-
return $spaced ? css`
|
|
7535
|
-
stroke-width: 2px;
|
|
7536
|
-
stroke: #fff;
|
|
7537
|
-
` : '';
|
|
7538
|
-
}}
|
|
7539
|
-
}
|
|
7540
|
-
}
|
|
7541
|
-
|
|
7542
|
-
g.pie-slice.deselected {
|
|
7543
|
-
path {
|
|
7544
|
-
fill-opacity: 0.5;
|
|
7545
|
-
fill: var(--redsift-color-neutral-lightgrey);
|
|
7546
|
-
}
|
|
7547
|
-
}
|
|
7548
|
-
|
|
7549
|
-
g.pie-slice.focused,
|
|
7550
|
-
g.pie-slice:hover {
|
|
7551
|
-
path {
|
|
7552
|
-
fill-opacity: 0.8;
|
|
7553
|
-
}
|
|
7554
|
-
}
|
|
7555
|
-
|
|
7556
|
-
g.pie-slice.deselected.focused {
|
|
7557
|
-
path {
|
|
7558
|
-
fill-opacity: 0.3;
|
|
7559
|
-
}
|
|
7560
|
-
}
|
|
7561
|
-
|
|
7562
|
-
svg:hover,
|
|
7563
|
-
svg:focus {
|
|
7564
|
-
outline: none;
|
|
7565
|
-
}
|
|
7566
|
-
|
|
7567
|
-
svg:focus-visible {
|
|
7568
|
-
outline: auto;
|
|
7569
|
-
}
|
|
7570
|
-
`;
|
|
7571
|
-
const StyledPieChartContainer = styled.div`
|
|
7572
|
-
display: flex;
|
|
7573
|
-
align-items: center;
|
|
7574
|
-
gap: 16px;
|
|
7575
|
-
font-family: var(--redsift-typography-font-family-source-code-pro);
|
|
7576
|
-
font-size: 11px;
|
|
7577
|
-
justify-content: center;
|
|
7578
|
-
margin: 8px 0;
|
|
7579
|
-
position: relative;
|
|
7580
|
-
|
|
7581
|
-
.redsift-piechart-container__chart {
|
|
7582
|
-
position: relative;
|
|
7583
|
-
${_ref3 => {
|
|
7584
|
-
let {
|
|
7585
|
-
$isEmpty
|
|
7586
|
-
} = _ref3;
|
|
7587
|
-
return $isEmpty ? css`
|
|
7588
|
-
display: none;
|
|
7589
|
-
` : '';
|
|
7590
|
-
}};
|
|
7591
|
-
}
|
|
7592
|
-
`;
|
|
7593
|
-
|
|
7594
|
-
const _excluded$1 = ["aria-label", "aria-labelledby", "caping", "caption", "className", "data", "datagridFilter", "isResetable", "labelVariant", "dimension", "group", "isDimensionArray", "localeText", "onFilter", "others", "setLabels", "size", "text", "middleText", "subtext", "theme", "title", "variant"];
|
|
7595
|
-
const COMPONENT_NAME$1 = 'PieChart';
|
|
7596
|
-
const CLASSNAME$1 = 'redsift-piechart';
|
|
7597
|
-
const DEFAULT_PROPS$1 = {
|
|
7598
|
-
isResetable: true,
|
|
7599
|
-
labelVariant: PieChartLabelVariant.internal,
|
|
7600
|
-
localeText: {
|
|
7601
|
-
resetLabel: 'Reset'
|
|
7602
|
-
},
|
|
7603
|
-
others: true,
|
|
7604
|
-
size: PieChartSize.medium,
|
|
7605
|
-
theme: PieChartTheme.default,
|
|
7606
|
-
variant: PieChartVariant.plain
|
|
7607
|
-
};
|
|
7608
|
-
const sizeToDimension$1 = size => {
|
|
7609
|
-
switch (size) {
|
|
7610
|
-
case PieChartSize.small:
|
|
7611
|
-
return {
|
|
7612
|
-
width: 200,
|
|
7613
|
-
height: 200
|
|
7614
|
-
};
|
|
7615
|
-
case PieChartSize.large:
|
|
7616
|
-
return {
|
|
7617
|
-
width: 300,
|
|
7618
|
-
height: 300
|
|
7619
|
-
};
|
|
7620
|
-
case PieChartSize.medium:
|
|
7621
|
-
default:
|
|
7622
|
-
return {
|
|
7623
|
-
width: 240,
|
|
7624
|
-
height: 240
|
|
7625
|
-
};
|
|
4650
|
+
const _excluded$1 = ["aria-label", "aria-labelledby", "caping", "caption", "className", "data", "datagridFilter", "isResetable", "labelVariant", "dimension", "group", "isDimensionArray", "localeText", "onFilter", "others", "setLabels", "size", "text", "middleText", "subtext", "theme", "title", "variant"];
|
|
4651
|
+
const COMPONENT_NAME$1 = 'PieChart';
|
|
4652
|
+
const CLASSNAME$1 = 'redsift-piechart';
|
|
4653
|
+
const DEFAULT_PROPS$1 = {
|
|
4654
|
+
isResetable: true,
|
|
4655
|
+
labelVariant: PieChartLabelVariant.internal,
|
|
4656
|
+
localeText: {
|
|
4657
|
+
resetLabel: 'Reset'
|
|
4658
|
+
},
|
|
4659
|
+
others: true,
|
|
4660
|
+
size: PieChartSize.medium,
|
|
4661
|
+
theme: PieChartTheme.default,
|
|
4662
|
+
variant: PieChartVariant.plain
|
|
4663
|
+
};
|
|
4664
|
+
const sizeToDimension$1 = size => {
|
|
4665
|
+
switch (size) {
|
|
4666
|
+
case PieChartSize.small:
|
|
4667
|
+
return {
|
|
4668
|
+
width: 200,
|
|
4669
|
+
height: 200
|
|
4670
|
+
};
|
|
4671
|
+
case PieChartSize.large:
|
|
4672
|
+
return {
|
|
4673
|
+
width: 300,
|
|
4674
|
+
height: 300
|
|
4675
|
+
};
|
|
4676
|
+
case PieChartSize.medium:
|
|
4677
|
+
default:
|
|
4678
|
+
return {
|
|
4679
|
+
width: 240,
|
|
4680
|
+
height: 240
|
|
4681
|
+
};
|
|
7626
4682
|
}
|
|
7627
4683
|
};
|
|
7628
4684
|
const sizeToSmallFontSize = size => {
|
|
@@ -7823,7 +4879,8 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7823
4879
|
$spaced: variant === PieChartVariant.spaced || variant === PieChartVariant.spacedDonut,
|
|
7824
4880
|
$showLabels: labelVariant === PieChartLabelVariant.internal
|
|
7825
4881
|
}), /*#__PURE__*/React.createElement(StyledPieChartTitle, {
|
|
7826
|
-
className: `${PieChart.className}__title
|
|
4882
|
+
className: `${PieChart.className}__title`,
|
|
4883
|
+
alignItems: "center"
|
|
7827
4884
|
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
7828
4885
|
id: `id${id}__title`
|
|
7829
4886
|
}, title) : null, chart && isResetable ? /*#__PURE__*/React.createElement(Button, {
|
|
@@ -7835,7 +4892,9 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7835
4892
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({
|
|
7836
4893
|
type: DashboardReducerActionType.ResetFilter,
|
|
7837
4894
|
filter: {
|
|
7838
|
-
id: chart.anchorName()
|
|
4895
|
+
id: chart.anchorName(),
|
|
4896
|
+
columnField: datagridFilter.field,
|
|
4897
|
+
operatorValue: datagridFilter.operator
|
|
7839
4898
|
}
|
|
7840
4899
|
});
|
|
7841
4900
|
}
|
|
@@ -7961,14 +5020,10 @@ const StyledTimeSeriesBarChart = styled.div`
|
|
|
7961
5020
|
user-select: none;
|
|
7962
5021
|
}
|
|
7963
5022
|
`;
|
|
7964
|
-
const StyledTimeSeriesBarChartTitle = styled
|
|
7965
|
-
align-items: center;
|
|
7966
|
-
display: flex;
|
|
7967
|
-
flex-direction: row;
|
|
5023
|
+
const StyledTimeSeriesBarChartTitle = styled(Flexbox)`
|
|
7968
5024
|
font-family: var(--redsift-typography-h4-font-family);
|
|
7969
5025
|
font-size: var(--redsift-typography-h4-font-size);
|
|
7970
5026
|
font-weight: var(--redsift-typography-h4-font-weight);
|
|
7971
|
-
gap: 16px;
|
|
7972
5027
|
line-height: var(--redsift-typography-h4-line-height);
|
|
7973
5028
|
`;
|
|
7974
5029
|
const StyledTimeSeriesBarChartCaption = styled.p`
|
|
@@ -8053,39 +5108,39 @@ const parseDateTimeGroup = (data, dateTimeGroup, dateTimeFieldName) => {
|
|
|
8053
5108
|
switch (dateTimeGroup) {
|
|
8054
5109
|
case 'hour':
|
|
8055
5110
|
return {
|
|
8056
|
-
group: g =>
|
|
8057
|
-
round: x =>
|
|
8058
|
-
x:
|
|
8059
|
-
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
|
|
8060
5115
|
};
|
|
8061
5116
|
case 'day':
|
|
8062
5117
|
return {
|
|
8063
|
-
group: g =>
|
|
8064
|
-
round: x =>
|
|
8065
|
-
x:
|
|
8066
|
-
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
|
|
8067
5122
|
};
|
|
8068
5123
|
case 'week':
|
|
8069
5124
|
return {
|
|
8070
|
-
group: g =>
|
|
8071
|
-
round: x =>
|
|
8072
|
-
x:
|
|
8073
|
-
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
|
|
8074
5129
|
};
|
|
8075
5130
|
case 'year':
|
|
8076
5131
|
return {
|
|
8077
|
-
group: g =>
|
|
8078
|
-
round: x =>
|
|
8079
|
-
x:
|
|
8080
|
-
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
|
|
8081
5136
|
};
|
|
8082
5137
|
case 'month':
|
|
8083
5138
|
default:
|
|
8084
5139
|
return {
|
|
8085
|
-
group: g =>
|
|
8086
|
-
round: x =>
|
|
8087
|
-
x:
|
|
8088
|
-
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
|
|
8089
5144
|
};
|
|
8090
5145
|
}
|
|
8091
5146
|
};
|
|
@@ -8282,10 +5337,10 @@ const TimeSeriesBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
8282
5337
|
const chartFilters = chartFiltersObj === null || chartFiltersObj === void 0 ? void 0 : chartFiltersObj[0];
|
|
8283
5338
|
const chartFilterStart = chartFilters === null || chartFilters === void 0 ? void 0 : chartFilters[0];
|
|
8284
5339
|
const chartFilterEnd = chartFilters === null || chartFilters === void 0 ? void 0 : chartFilters[1];
|
|
8285
|
-
if (chartFilterStart !==
|
|
5340
|
+
if (chartFilterStart !== isoParse(filterStart.value) && chartFilterEnd !== isoParse(filterEnd.value)) {
|
|
8286
5341
|
var _d3isoParse, _d3isoParse2;
|
|
8287
5342
|
chart.filter(null);
|
|
8288
|
-
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));
|
|
8289
5344
|
redrawAll();
|
|
8290
5345
|
}
|
|
8291
5346
|
}
|
|
@@ -8294,7 +5349,8 @@ const TimeSeriesBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
8294
5349
|
className: classNames(TimeSeriesBarChart.className, className),
|
|
8295
5350
|
ref: containerRef
|
|
8296
5351
|
}), /*#__PURE__*/React.createElement(StyledTimeSeriesBarChartTitle, {
|
|
8297
|
-
className: `${TimeSeriesBarChart.className}__title
|
|
5352
|
+
className: `${TimeSeriesBarChart.className}__title`,
|
|
5353
|
+
alignItems: "center"
|
|
8298
5354
|
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
8299
5355
|
id: `id${id}__title`
|
|
8300
5356
|
}, title) : null, chart && isResetable ? /*#__PURE__*/React.createElement(Button, {
|
|
@@ -8306,13 +5362,17 @@ const TimeSeriesBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
8306
5362
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({
|
|
8307
5363
|
type: DashboardReducerActionType.ResetFilter,
|
|
8308
5364
|
filter: {
|
|
8309
|
-
id: `${chart.anchorName()}-start
|
|
5365
|
+
id: `${chart.anchorName()}-start`,
|
|
5366
|
+
columnField: columnToFilter,
|
|
5367
|
+
operatorValue: 'after'
|
|
8310
5368
|
}
|
|
8311
5369
|
});
|
|
8312
5370
|
dispatch === null || dispatch === void 0 ? void 0 : dispatch({
|
|
8313
5371
|
type: DashboardReducerActionType.ResetFilter,
|
|
8314
5372
|
filter: {
|
|
8315
|
-
id: `${chart.anchorName()}-end
|
|
5373
|
+
id: `${chart.anchorName()}-end`,
|
|
5374
|
+
columnField: columnToFilter,
|
|
5375
|
+
operatorValue: 'onOrBefore'
|
|
8316
5376
|
}
|
|
8317
5377
|
});
|
|
8318
5378
|
}
|