@mui/x-charts-vendor 7.12.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/README.md +76 -0
- package/d3-color.d.ts +5 -0
- package/d3-color.js +7 -0
- package/d3-delaunay.d.ts +5 -0
- package/d3-delaunay.js +7 -0
- package/d3-interpolate.d.ts +5 -0
- package/d3-interpolate.js +7 -0
- package/d3-scale.d.ts +5 -0
- package/d3-scale.js +7 -0
- package/d3-shape.d.ts +5 -0
- package/d3-shape.js +7 -0
- package/d3-time.d.ts +5 -0
- package/d3-time.js +7 -0
- package/es/d3-array.js +6 -0
- package/es/d3-color.js +6 -0
- package/es/d3-delaunay.js +6 -0
- package/es/d3-format.js +6 -0
- package/es/d3-interpolate.js +6 -0
- package/es/d3-path.js +6 -0
- package/es/d3-scale.js +6 -0
- package/es/d3-shape.js +6 -0
- package/es/d3-time-format.js +6 -0
- package/es/d3-time.js +6 -0
- package/es/delaunator.js +6 -0
- package/es/internmap.js +6 -0
- package/es/robust-predicates.js +6 -0
- package/lib/d3-array.js +6 -0
- package/lib/d3-color.js +6 -0
- package/lib/d3-delaunay.js +6 -0
- package/lib/d3-format.js +6 -0
- package/lib/d3-interpolate.js +6 -0
- package/lib/d3-path.js +6 -0
- package/lib/d3-scale.js +6 -0
- package/lib/d3-shape.js +6 -0
- package/lib/d3-time-format.js +6 -0
- package/lib/d3-time.js +6 -0
- package/lib/delaunator.js +6 -0
- package/lib/internmap.js +6 -0
- package/lib/robust-predicates.js +6 -0
- package/lib-vendor/d3-array/LICENSE +13 -0
- package/lib-vendor/d3-array/dist/d3-array.js +1349 -0
- package/lib-vendor/d3-array/dist/d3-array.min.js +777 -0
- package/lib-vendor/d3-array/src/array.js +9 -0
- package/lib-vendor/d3-array/src/ascending.js +9 -0
- package/lib-vendor/d3-array/src/bin.js +126 -0
- package/lib-vendor/d3-array/src/bisect.js +15 -0
- package/lib-vendor/d3-array/src/bisector.js +59 -0
- package/lib-vendor/d3-array/src/blur.js +122 -0
- package/lib-vendor/d3-array/src/constant.js +9 -0
- package/lib-vendor/d3-array/src/count.js +24 -0
- package/lib-vendor/d3-array/src/cross.js +35 -0
- package/lib-vendor/d3-array/src/cumsum.js +11 -0
- package/lib-vendor/d3-array/src/descending.js +9 -0
- package/lib-vendor/d3-array/src/deviation.js +12 -0
- package/lib-vendor/d3-array/src/difference.js +16 -0
- package/lib-vendor/d3-array/src/disjoint.js +24 -0
- package/lib-vendor/d3-array/src/every.js +16 -0
- package/lib-vendor/d3-array/src/extent.js +35 -0
- package/lib-vendor/d3-array/src/filter.js +17 -0
- package/lib-vendor/d3-array/src/fsum.js +77 -0
- package/lib-vendor/d3-array/src/greatest.js +31 -0
- package/lib-vendor/d3-array/src/greatestIndex.js +23 -0
- package/lib-vendor/d3-array/src/group.js +67 -0
- package/lib-vendor/d3-array/src/groupSort.js +15 -0
- package/lib-vendor/d3-array/src/identity.js +9 -0
- package/lib-vendor/d3-array/src/index.js +539 -0
- package/lib-vendor/d3-array/src/intersection.js +23 -0
- package/lib-vendor/d3-array/src/least.js +31 -0
- package/lib-vendor/d3-array/src/leastIndex.js +23 -0
- package/lib-vendor/d3-array/src/map.js +11 -0
- package/lib-vendor/d3-array/src/max.js +24 -0
- package/lib-vendor/d3-array/src/maxIndex.js +26 -0
- package/lib-vendor/d3-array/src/mean.js +25 -0
- package/lib-vendor/d3-array/src/median.js +16 -0
- package/lib-vendor/d3-array/src/merge.js +14 -0
- package/lib-vendor/d3-array/src/min.js +24 -0
- package/lib-vendor/d3-array/src/minIndex.js +26 -0
- package/lib-vendor/d3-array/src/mode.js +33 -0
- package/lib-vendor/d3-array/src/nice.js +23 -0
- package/lib-vendor/d3-array/src/number.js +26 -0
- package/lib-vendor/d3-array/src/pairs.js +21 -0
- package/lib-vendor/d3-array/src/permute.js +9 -0
- package/lib-vendor/d3-array/src/quantile.js +55 -0
- package/lib-vendor/d3-array/src/quickselect.js +47 -0
- package/lib-vendor/d3-array/src/range.js +16 -0
- package/lib-vendor/d3-array/src/rank.js +30 -0
- package/lib-vendor/d3-array/src/reduce.js +28 -0
- package/lib-vendor/d3-array/src/reverse.js +10 -0
- package/lib-vendor/d3-array/src/scan.js +12 -0
- package/lib-vendor/d3-array/src/shuffle.js +20 -0
- package/lib-vendor/d3-array/src/some.js +16 -0
- package/lib-vendor/d3-array/src/sort.js +45 -0
- package/lib-vendor/d3-array/src/subset.js +11 -0
- package/lib-vendor/d3-array/src/sum.js +24 -0
- package/lib-vendor/d3-array/src/superset.js +28 -0
- package/lib-vendor/d3-array/src/threshold/freedmanDiaconis.js +14 -0
- package/lib-vendor/d3-array/src/threshold/scott.js +14 -0
- package/lib-vendor/d3-array/src/threshold/sturges.js +11 -0
- package/lib-vendor/d3-array/src/ticks.js +60 -0
- package/lib-vendor/d3-array/src/transpose.js +20 -0
- package/lib-vendor/d3-array/src/union.js +16 -0
- package/lib-vendor/d3-array/src/variance.js +31 -0
- package/lib-vendor/d3-array/src/zip.js +11 -0
- package/lib-vendor/d3-color/LICENSE +13 -0
- package/lib-vendor/d3-color/dist/d3-color.js +532 -0
- package/lib-vendor/d3-color/dist/d3-color.min.js +446 -0
- package/lib-vendor/d3-color/src/color.js +366 -0
- package/lib-vendor/d3-color/src/cubehelix.js +61 -0
- package/lib-vendor/d3-color/src/define.js +16 -0
- package/lib-vendor/d3-color/src/index.js +59 -0
- package/lib-vendor/d3-color/src/lab.js +117 -0
- package/lib-vendor/d3-color/src/math.js +8 -0
- package/lib-vendor/d3-delaunay/LICENSE +14 -0
- package/lib-vendor/d3-delaunay/dist/d3-delaunay.js +1398 -0
- package/lib-vendor/d3-delaunay/dist/d3-delaunay.min.js +853 -0
- package/lib-vendor/d3-delaunay/src/delaunay.js +282 -0
- package/lib-vendor/d3-delaunay/src/index.js +20 -0
- package/lib-vendor/d3-delaunay/src/path.js +43 -0
- package/lib-vendor/d3-delaunay/src/polygon.js +24 -0
- package/lib-vendor/d3-delaunay/src/voronoi.js +390 -0
- package/lib-vendor/d3-format/LICENSE +13 -0
- package/lib-vendor/d3-format/dist/d3-format.js +313 -0
- package/lib-vendor/d3-format/dist/d3-format.min.js +193 -0
- package/lib-vendor/d3-format/src/defaultLocale.js +23 -0
- package/lib-vendor/d3-format/src/exponent.js +10 -0
- package/lib-vendor/d3-format/src/formatDecimal.js +23 -0
- package/lib-vendor/d3-format/src/formatGroup.js +22 -0
- package/lib-vendor/d3-format/src/formatNumerals.js +13 -0
- package/lib-vendor/d3-format/src/formatPrefixAuto.js +18 -0
- package/lib-vendor/d3-format/src/formatRounded.js +14 -0
- package/lib-vendor/d3-format/src/formatSpecifier.js +42 -0
- package/lib-vendor/d3-format/src/formatTrim.js +25 -0
- package/lib-vendor/d3-format/src/formatTypes.js +25 -0
- package/lib-vendor/d3-format/src/identity.js +9 -0
- package/lib-vendor/d3-format/src/index.js +68 -0
- package/lib-vendor/d3-format/src/locale.js +152 -0
- package/lib-vendor/d3-format/src/precisionFixed.js +11 -0
- package/lib-vendor/d3-format/src/precisionPrefix.js +11 -0
- package/lib-vendor/d3-format/src/precisionRound.js +12 -0
- package/lib-vendor/d3-interpolate/LICENSE +13 -0
- package/lib-vendor/d3-interpolate/dist/d3-interpolate.js +543 -0
- package/lib-vendor/d3-interpolate/dist/d3-interpolate.min.js +362 -0
- package/lib-vendor/d3-interpolate/src/array.js +28 -0
- package/lib-vendor/d3-interpolate/src/basis.js +23 -0
- package/lib-vendor/d3-interpolate/src/basisClosed.js +18 -0
- package/lib-vendor/d3-interpolate/src/color.js +33 -0
- package/lib-vendor/d3-interpolate/src/constant.js +8 -0
- package/lib-vendor/d3-interpolate/src/cubehelix.js +32 -0
- package/lib-vendor/d3-interpolate/src/date.js +12 -0
- package/lib-vendor/d3-interpolate/src/discrete.js +12 -0
- package/lib-vendor/d3-interpolate/src/hcl.js +27 -0
- package/lib-vendor/d3-interpolate/src/hsl.js +27 -0
- package/lib-vendor/d3-interpolate/src/hue.js +14 -0
- package/lib-vendor/d3-interpolate/src/index.js +191 -0
- package/lib-vendor/d3-interpolate/src/lab.js +22 -0
- package/lib-vendor/d3-interpolate/src/number.js +11 -0
- package/lib-vendor/d3-interpolate/src/numberArray.js +20 -0
- package/lib-vendor/d3-interpolate/src/object.js +26 -0
- package/lib-vendor/d3-interpolate/src/piecewise.js +20 -0
- package/lib-vendor/d3-interpolate/src/quantize.js +11 -0
- package/lib-vendor/d3-interpolate/src/rgb.js +59 -0
- package/lib-vendor/d3-interpolate/src/round.js +11 -0
- package/lib-vendor/d3-interpolate/src/string.js +75 -0
- package/lib-vendor/d3-interpolate/src/transform/decompose.js +31 -0
- package/lib-vendor/d3-interpolate/src/transform/index.js +83 -0
- package/lib-vendor/d3-interpolate/src/transform/parse.js +25 -0
- package/lib-vendor/d3-interpolate/src/value.js +23 -0
- package/lib-vendor/d3-interpolate/src/zoom.js +66 -0
- package/lib-vendor/d3-path/LICENSE +13 -0
- package/lib-vendor/d3-path/dist/d3-path.js +161 -0
- package/lib-vendor/d3-path/dist/d3-path.min.js +92 -0
- package/lib-vendor/d3-path/src/index.js +24 -0
- package/lib-vendor/d3-path/src/path.js +158 -0
- package/lib-vendor/d3-scale/LICENSE +13 -0
- package/lib-vendor/d3-scale/dist/d3-scale.js +944 -0
- package/lib-vendor/d3-scale/dist/d3-scale.min.js +690 -0
- package/lib-vendor/d3-scale/src/band.js +87 -0
- package/lib-vendor/d3-scale/src/colors.js +11 -0
- package/lib-vendor/d3-scale/src/constant.js +11 -0
- package/lib-vendor/d3-scale/src/continuous.js +116 -0
- package/lib-vendor/d3-scale/src/diverging.js +91 -0
- package/lib-vendor/d3-scale/src/identity.js +27 -0
- package/lib-vendor/d3-scale/src/index.js +193 -0
- package/lib-vendor/d3-scale/src/init.js +38 -0
- package/lib-vendor/d3-scale/src/linear.js +67 -0
- package/lib-vendor/d3-scale/src/log.js +123 -0
- package/lib-vendor/d3-scale/src/nice.js +21 -0
- package/lib-vendor/d3-scale/src/number.js +9 -0
- package/lib-vendor/d3-scale/src/ordinal.js +44 -0
- package/lib-vendor/d3-scale/src/pow.js +44 -0
- package/lib-vendor/d3-scale/src/quantile.js +48 -0
- package/lib-vendor/d3-scale/src/quantize.js +46 -0
- package/lib-vendor/d3-scale/src/radial.js +53 -0
- package/lib-vendor/d3-scale/src/sequential.js +90 -0
- package/lib-vendor/d3-scale/src/sequentialQuantile.js +38 -0
- package/lib-vendor/d3-scale/src/symlog.js +35 -0
- package/lib-vendor/d3-scale/src/threshold.js +34 -0
- package/lib-vendor/d3-scale/src/tickFormat.js +37 -0
- package/lib-vendor/d3-scale/src/time.js +62 -0
- package/lib-vendor/d3-scale/src/utcTime.js +13 -0
- package/lib-vendor/d3-shape/LICENSE +13 -0
- package/lib-vendor/d3-shape/dist/d3-shape.js +2004 -0
- package/lib-vendor/d3-shape/dist/d3-shape.min.js +1389 -0
- package/lib-vendor/d3-shape/src/arc.js +250 -0
- package/lib-vendor/d3-shape/src/area.js +98 -0
- package/lib-vendor/d3-shape/src/areaRadial.js +42 -0
- package/lib-vendor/d3-shape/src/array.js +12 -0
- package/lib-vendor/d3-shape/src/constant.js +11 -0
- package/lib-vendor/d3-shape/src/curve/basis.js +62 -0
- package/lib-vendor/d3-shape/src/curve/basisClosed.js +70 -0
- package/lib-vendor/d3-shape/src/curve/basisOpen.js +54 -0
- package/lib-vendor/d3-shape/src/curve/bump.js +81 -0
- package/lib-vendor/d3-shape/src/curve/bundle.js +50 -0
- package/lib-vendor/d3-shape/src/curve/cardinal.js +69 -0
- package/lib-vendor/d3-shape/src/curve/cardinalClosed.js +76 -0
- package/lib-vendor/d3-shape/src/curve/cardinalOpen.js +60 -0
- package/lib-vendor/d3-shape/src/curve/catmullRom.js +92 -0
- package/lib-vendor/d3-shape/src/curve/catmullRomClosed.js +83 -0
- package/lib-vendor/d3-shape/src/curve/catmullRomOpen.js +67 -0
- package/lib-vendor/d3-shape/src/curve/linear.js +42 -0
- package/lib-vendor/d3-shape/src/curve/linearClosed.js +28 -0
- package/lib-vendor/d3-shape/src/curve/monotone.js +121 -0
- package/lib-vendor/d3-shape/src/curve/natural.js +67 -0
- package/lib-vendor/d3-shape/src/curve/radial.js +37 -0
- package/lib-vendor/d3-shape/src/curve/step.js +63 -0
- package/lib-vendor/d3-shape/src/descending.js +9 -0
- package/lib-vendor/d3-shape/src/identity.js +9 -0
- package/lib-vendor/d3-shape/src/index.js +436 -0
- package/lib-vendor/d3-shape/src/line.js +52 -0
- package/lib-vendor/d3-shape/src/lineRadial.js +24 -0
- package/lib-vendor/d3-shape/src/link.js +70 -0
- package/lib-vendor/d3-shape/src/math.js +26 -0
- package/lib-vendor/d3-shape/src/noop.js +7 -0
- package/lib-vendor/d3-shape/src/offset/diverging.js +20 -0
- package/lib-vendor/d3-shape/src/offset/expand.js +16 -0
- package/lib-vendor/d3-shape/src/offset/none.js +15 -0
- package/lib-vendor/d3-shape/src/offset/silhouette.js +16 -0
- package/lib-vendor/d3-shape/src/offset/wiggle.js +30 -0
- package/lib-vendor/d3-shape/src/order/appearance.js +23 -0
- package/lib-vendor/d3-shape/src/order/ascending.js +23 -0
- package/lib-vendor/d3-shape/src/order/descending.js +11 -0
- package/lib-vendor/d3-shape/src/order/insideOut.js +31 -0
- package/lib-vendor/d3-shape/src/order/none.js +12 -0
- package/lib-vendor/d3-shape/src/order/reverse.js +11 -0
- package/lib-vendor/d3-shape/src/path.js +22 -0
- package/lib-vendor/d3-shape/src/pie.js +79 -0
- package/lib-vendor/d3-shape/src/point.js +13 -0
- package/lib-vendor/d3-shape/src/pointRadial.js +9 -0
- package/lib-vendor/d3-shape/src/stack.js +55 -0
- package/lib-vendor/d3-shape/src/symbol/asterisk.js +21 -0
- package/lib-vendor/d3-shape/src/symbol/circle.js +14 -0
- package/lib-vendor/d3-shape/src/symbol/cross.js +25 -0
- package/lib-vendor/d3-shape/src/symbol/diamond.js +20 -0
- package/lib-vendor/d3-shape/src/symbol/diamond2.js +17 -0
- package/lib-vendor/d3-shape/src/symbol/plus.js +16 -0
- package/lib-vendor/d3-shape/src/symbol/square.js +14 -0
- package/lib-vendor/d3-shape/src/symbol/square2.js +17 -0
- package/lib-vendor/d3-shape/src/symbol/star.js +28 -0
- package/lib-vendor/d3-shape/src/symbol/times.js +16 -0
- package/lib-vendor/d3-shape/src/symbol/triangle.js +17 -0
- package/lib-vendor/d3-shape/src/symbol/triangle2.js +19 -0
- package/lib-vendor/d3-shape/src/symbol/wye.js +32 -0
- package/lib-vendor/d3-shape/src/symbol.js +50 -0
- package/lib-vendor/d3-time/LICENSE +13 -0
- package/lib-vendor/d3-time/dist/d3-time.js +367 -0
- package/lib-vendor/d3-time/dist/d3-time.min.js +190 -0
- package/lib-vendor/d3-time/src/day.js +30 -0
- package/lib-vendor/d3-time/src/duration.js +13 -0
- package/lib-vendor/d3-time/src/hour.js +28 -0
- package/lib-vendor/d3-time/src/index.js +417 -0
- package/lib-vendor/d3-time/src/interval.js +61 -0
- package/lib-vendor/d3-time/src/millisecond.js +29 -0
- package/lib-vendor/d3-time/src/minute.js +28 -0
- package/lib-vendor/d3-time/src/month.js +29 -0
- package/lib-vendor/d3-time/src/second.js +18 -0
- package/lib-vendor/d3-time/src/ticks.js +41 -0
- package/lib-vendor/d3-time/src/week.js +56 -0
- package/lib-vendor/d3-time/src/year.js +51 -0
- package/lib-vendor/d3-time-format/LICENSE +13 -0
- package/lib-vendor/d3-time-format/dist/d3-time-format.js +648 -0
- package/lib-vendor/d3-time-format/dist/d3-time-format.min.js +528 -0
- package/lib-vendor/d3-time-format/src/defaultLocale.js +32 -0
- package/lib-vendor/d3-time-format/src/index.js +60 -0
- package/lib-vendor/d3-time-format/src/isoFormat.js +13 -0
- package/lib-vendor/d3-time-format/src/isoParse.js +14 -0
- package/lib-vendor/d3-time-format/src/locale.js +606 -0
- package/lib-vendor/delaunator/LICENSE +15 -0
- package/lib-vendor/delaunator/delaunator.js +688 -0
- package/lib-vendor/delaunator/delaunator.min.js +316 -0
- package/lib-vendor/delaunator/index.js +440 -0
- package/lib-vendor/internmap/LICENSE +13 -0
- package/lib-vendor/internmap/dist/internmap.js +93 -0
- package/lib-vendor/internmap/dist/internmap.min.js +81 -0
- package/lib-vendor/internmap/src/index.js +87 -0
- package/lib-vendor/robust-predicates/LICENSE +24 -0
- package/lib-vendor/robust-predicates/esm/incircle.js +667 -0
- package/lib-vendor/robust-predicates/esm/insphere.js +693 -0
- package/lib-vendor/robust-predicates/esm/orient2d.js +174 -0
- package/lib-vendor/robust-predicates/esm/orient3d.js +422 -0
- package/lib-vendor/robust-predicates/esm/util.js +147 -0
- package/lib-vendor/robust-predicates/index.js +57 -0
- package/lib-vendor/robust-predicates/umd/incircle.js +798 -0
- package/lib-vendor/robust-predicates/umd/incircle.min.js +170 -0
- package/lib-vendor/robust-predicates/umd/insphere.js +828 -0
- package/lib-vendor/robust-predicates/umd/insphere.min.js +223 -0
- package/lib-vendor/robust-predicates/umd/orient2d.js +260 -0
- package/lib-vendor/robust-predicates/umd/orient2d.min.js +69 -0
- package/lib-vendor/robust-predicates/umd/orient3d.js +550 -0
- package/lib-vendor/robust-predicates/umd/orient3d.min.js +133 -0
- package/lib-vendor/robust-predicates/umd/predicates.js +2073 -0
- package/lib-vendor/robust-predicates/umd/predicates.min.js +468 -0
- package/package.json +63 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// https://d3js.org/d3-format/ v3.1.0 Copyright 2010-2021 Mike Bostock
|
|
4
|
+
(function (global, factory) {
|
|
5
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}));
|
|
6
|
+
})(this, function (exports) {
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
function formatDecimal(x) {
|
|
10
|
+
return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString("en").replace(/,/g, "") : x.toString(10);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Computes the decimal coefficient and exponent of the specified number x with
|
|
14
|
+
// significant digits p, where x is positive and p is in [1, 21] or undefined.
|
|
15
|
+
// For example, formatDecimalParts(1.23) returns ["123", 0].
|
|
16
|
+
function formatDecimalParts(x, p) {
|
|
17
|
+
if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
|
|
18
|
+
var i,
|
|
19
|
+
coefficient = x.slice(0, i);
|
|
20
|
+
|
|
21
|
+
// The string returned by toExponential either has the form \d\.\d+e[-+]\d+
|
|
22
|
+
// (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
|
|
23
|
+
return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)];
|
|
24
|
+
}
|
|
25
|
+
function exponent(x) {
|
|
26
|
+
return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
|
|
27
|
+
}
|
|
28
|
+
function formatGroup(grouping, thousands) {
|
|
29
|
+
return function (value, width) {
|
|
30
|
+
var i = value.length,
|
|
31
|
+
t = [],
|
|
32
|
+
j = 0,
|
|
33
|
+
g = grouping[0],
|
|
34
|
+
length = 0;
|
|
35
|
+
while (i > 0 && g > 0) {
|
|
36
|
+
if (length + g + 1 > width) g = Math.max(1, width - length);
|
|
37
|
+
t.push(value.substring(i -= g, i + g));
|
|
38
|
+
if ((length += g + 1) > width) break;
|
|
39
|
+
g = grouping[j = (j + 1) % grouping.length];
|
|
40
|
+
}
|
|
41
|
+
return t.reverse().join(thousands);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function formatNumerals(numerals) {
|
|
45
|
+
return function (value) {
|
|
46
|
+
return value.replace(/[0-9]/g, function (i) {
|
|
47
|
+
return numerals[+i];
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// [[fill]align][sign][symbol][0][width][,][.precision][~][type]
|
|
53
|
+
var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
|
54
|
+
function formatSpecifier(specifier) {
|
|
55
|
+
if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
|
|
56
|
+
var match;
|
|
57
|
+
return new FormatSpecifier({
|
|
58
|
+
fill: match[1],
|
|
59
|
+
align: match[2],
|
|
60
|
+
sign: match[3],
|
|
61
|
+
symbol: match[4],
|
|
62
|
+
zero: match[5],
|
|
63
|
+
width: match[6],
|
|
64
|
+
comma: match[7],
|
|
65
|
+
precision: match[8] && match[8].slice(1),
|
|
66
|
+
trim: match[9],
|
|
67
|
+
type: match[10]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
|
|
71
|
+
|
|
72
|
+
function FormatSpecifier(specifier) {
|
|
73
|
+
this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
|
|
74
|
+
this.align = specifier.align === undefined ? ">" : specifier.align + "";
|
|
75
|
+
this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
|
|
76
|
+
this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
|
|
77
|
+
this.zero = !!specifier.zero;
|
|
78
|
+
this.width = specifier.width === undefined ? undefined : +specifier.width;
|
|
79
|
+
this.comma = !!specifier.comma;
|
|
80
|
+
this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
|
|
81
|
+
this.trim = !!specifier.trim;
|
|
82
|
+
this.type = specifier.type === undefined ? "" : specifier.type + "";
|
|
83
|
+
}
|
|
84
|
+
FormatSpecifier.prototype.toString = function () {
|
|
85
|
+
return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === undefined ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
|
|
89
|
+
function formatTrim(s) {
|
|
90
|
+
out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
|
|
91
|
+
switch (s[i]) {
|
|
92
|
+
case ".":
|
|
93
|
+
i0 = i1 = i;
|
|
94
|
+
break;
|
|
95
|
+
case "0":
|
|
96
|
+
if (i0 === 0) i0 = i;
|
|
97
|
+
i1 = i;
|
|
98
|
+
break;
|
|
99
|
+
default:
|
|
100
|
+
if (!+s[i]) break out;
|
|
101
|
+
if (i0 > 0) i0 = 0;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
|
|
106
|
+
}
|
|
107
|
+
var prefixExponent;
|
|
108
|
+
function formatPrefixAuto(x, p) {
|
|
109
|
+
var d = formatDecimalParts(x, p);
|
|
110
|
+
if (!d) return x + "";
|
|
111
|
+
var coefficient = d[0],
|
|
112
|
+
exponent = d[1],
|
|
113
|
+
i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
|
|
114
|
+
n = coefficient.length;
|
|
115
|
+
return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!
|
|
116
|
+
}
|
|
117
|
+
function formatRounded(x, p) {
|
|
118
|
+
var d = formatDecimalParts(x, p);
|
|
119
|
+
if (!d) return x + "";
|
|
120
|
+
var coefficient = d[0],
|
|
121
|
+
exponent = d[1];
|
|
122
|
+
return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0");
|
|
123
|
+
}
|
|
124
|
+
var formatTypes = {
|
|
125
|
+
"%": (x, p) => (x * 100).toFixed(p),
|
|
126
|
+
"b": x => Math.round(x).toString(2),
|
|
127
|
+
"c": x => x + "",
|
|
128
|
+
"d": formatDecimal,
|
|
129
|
+
"e": (x, p) => x.toExponential(p),
|
|
130
|
+
"f": (x, p) => x.toFixed(p),
|
|
131
|
+
"g": (x, p) => x.toPrecision(p),
|
|
132
|
+
"o": x => Math.round(x).toString(8),
|
|
133
|
+
"p": (x, p) => formatRounded(x * 100, p),
|
|
134
|
+
"r": formatRounded,
|
|
135
|
+
"s": formatPrefixAuto,
|
|
136
|
+
"X": x => Math.round(x).toString(16).toUpperCase(),
|
|
137
|
+
"x": x => Math.round(x).toString(16)
|
|
138
|
+
};
|
|
139
|
+
function identity(x) {
|
|
140
|
+
return x;
|
|
141
|
+
}
|
|
142
|
+
var map = Array.prototype.map,
|
|
143
|
+
prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
|
|
144
|
+
function formatLocale(locale) {
|
|
145
|
+
var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
|
|
146
|
+
currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
|
|
147
|
+
currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
|
|
148
|
+
decimal = locale.decimal === undefined ? "." : locale.decimal + "",
|
|
149
|
+
numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),
|
|
150
|
+
percent = locale.percent === undefined ? "%" : locale.percent + "",
|
|
151
|
+
minus = locale.minus === undefined ? "−" : locale.minus + "",
|
|
152
|
+
nan = locale.nan === undefined ? "NaN" : locale.nan + "";
|
|
153
|
+
function newFormat(specifier) {
|
|
154
|
+
specifier = formatSpecifier(specifier);
|
|
155
|
+
var fill = specifier.fill,
|
|
156
|
+
align = specifier.align,
|
|
157
|
+
sign = specifier.sign,
|
|
158
|
+
symbol = specifier.symbol,
|
|
159
|
+
zero = specifier.zero,
|
|
160
|
+
width = specifier.width,
|
|
161
|
+
comma = specifier.comma,
|
|
162
|
+
precision = specifier.precision,
|
|
163
|
+
trim = specifier.trim,
|
|
164
|
+
type = specifier.type;
|
|
165
|
+
|
|
166
|
+
// The "n" type is an alias for ",g".
|
|
167
|
+
if (type === "n") comma = true, type = "g";
|
|
168
|
+
|
|
169
|
+
// The "" type, and any invalid type, is an alias for ".12~g".
|
|
170
|
+
else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g";
|
|
171
|
+
|
|
172
|
+
// If zero fill is specified, padding goes after sign and before digits.
|
|
173
|
+
if (zero || fill === "0" && align === "=") zero = true, fill = "0", align = "=";
|
|
174
|
+
|
|
175
|
+
// Compute the prefix and suffix.
|
|
176
|
+
// For SI-prefix, the suffix is lazily computed.
|
|
177
|
+
var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
|
|
178
|
+
suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
|
|
179
|
+
|
|
180
|
+
// What format function should we use?
|
|
181
|
+
// Is this an integer type?
|
|
182
|
+
// Can this type generate exponential notation?
|
|
183
|
+
var formatType = formatTypes[type],
|
|
184
|
+
maybeSuffix = /[defgprs%]/.test(type);
|
|
185
|
+
|
|
186
|
+
// Set the default precision if not specified,
|
|
187
|
+
// or clamp the specified precision to the supported range.
|
|
188
|
+
// For significant precision, it must be in [1, 21].
|
|
189
|
+
// For fixed precision, it must be in [0, 20].
|
|
190
|
+
precision = precision === undefined ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
|
|
191
|
+
function format(value) {
|
|
192
|
+
var valuePrefix = prefix,
|
|
193
|
+
valueSuffix = suffix,
|
|
194
|
+
i,
|
|
195
|
+
n,
|
|
196
|
+
c;
|
|
197
|
+
if (type === "c") {
|
|
198
|
+
valueSuffix = formatType(value) + valueSuffix;
|
|
199
|
+
value = "";
|
|
200
|
+
} else {
|
|
201
|
+
value = +value;
|
|
202
|
+
|
|
203
|
+
// Determine the sign. -0 is not less than 0, but 1 / -0 is!
|
|
204
|
+
var valueNegative = value < 0 || 1 / value < 0;
|
|
205
|
+
|
|
206
|
+
// Perform the initial formatting.
|
|
207
|
+
value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
|
|
208
|
+
|
|
209
|
+
// Trim insignificant zeros.
|
|
210
|
+
if (trim) value = formatTrim(value);
|
|
211
|
+
|
|
212
|
+
// If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.
|
|
213
|
+
if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
|
|
214
|
+
|
|
215
|
+
// Compute the prefix and suffix.
|
|
216
|
+
valuePrefix = (valueNegative ? sign === "(" ? sign : minus : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
|
|
217
|
+
valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
|
|
218
|
+
|
|
219
|
+
// Break the formatted value into the integer “value” part that can be
|
|
220
|
+
// grouped, and fractional or exponential “suffix” part that is not.
|
|
221
|
+
if (maybeSuffix) {
|
|
222
|
+
i = -1, n = value.length;
|
|
223
|
+
while (++i < n) {
|
|
224
|
+
if (c = value.charCodeAt(i), 48 > c || c > 57) {
|
|
225
|
+
valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
|
|
226
|
+
value = value.slice(0, i);
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// If the fill character is not "0", grouping is applied before padding.
|
|
234
|
+
if (comma && !zero) value = group(value, Infinity);
|
|
235
|
+
|
|
236
|
+
// Compute the padding.
|
|
237
|
+
var length = valuePrefix.length + value.length + valueSuffix.length,
|
|
238
|
+
padding = length < width ? new Array(width - length + 1).join(fill) : "";
|
|
239
|
+
|
|
240
|
+
// If the fill character is "0", grouping is applied after padding.
|
|
241
|
+
if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
|
|
242
|
+
|
|
243
|
+
// Reconstruct the final output based on the desired alignment.
|
|
244
|
+
switch (align) {
|
|
245
|
+
case "<":
|
|
246
|
+
value = valuePrefix + value + valueSuffix + padding;
|
|
247
|
+
break;
|
|
248
|
+
case "=":
|
|
249
|
+
value = valuePrefix + padding + value + valueSuffix;
|
|
250
|
+
break;
|
|
251
|
+
case "^":
|
|
252
|
+
value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
|
|
253
|
+
break;
|
|
254
|
+
default:
|
|
255
|
+
value = padding + valuePrefix + value + valueSuffix;
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
return numerals(value);
|
|
259
|
+
}
|
|
260
|
+
format.toString = function () {
|
|
261
|
+
return specifier + "";
|
|
262
|
+
};
|
|
263
|
+
return format;
|
|
264
|
+
}
|
|
265
|
+
function formatPrefix(specifier, value) {
|
|
266
|
+
var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
|
|
267
|
+
e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
|
|
268
|
+
k = Math.pow(10, -e),
|
|
269
|
+
prefix = prefixes[8 + e / 3];
|
|
270
|
+
return function (value) {
|
|
271
|
+
return f(k * value) + prefix;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
format: newFormat,
|
|
276
|
+
formatPrefix: formatPrefix
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
var locale;
|
|
280
|
+
exports.format = void 0;
|
|
281
|
+
exports.formatPrefix = void 0;
|
|
282
|
+
defaultLocale({
|
|
283
|
+
thousands: ",",
|
|
284
|
+
grouping: [3],
|
|
285
|
+
currency: ["$", ""]
|
|
286
|
+
});
|
|
287
|
+
function defaultLocale(definition) {
|
|
288
|
+
locale = formatLocale(definition);
|
|
289
|
+
exports.format = locale.format;
|
|
290
|
+
exports.formatPrefix = locale.formatPrefix;
|
|
291
|
+
return locale;
|
|
292
|
+
}
|
|
293
|
+
function precisionFixed(step) {
|
|
294
|
+
return Math.max(0, -exponent(Math.abs(step)));
|
|
295
|
+
}
|
|
296
|
+
function precisionPrefix(step, value) {
|
|
297
|
+
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
|
|
298
|
+
}
|
|
299
|
+
function precisionRound(step, max) {
|
|
300
|
+
step = Math.abs(step), max = Math.abs(max) - step;
|
|
301
|
+
return Math.max(0, exponent(max) - exponent(step)) + 1;
|
|
302
|
+
}
|
|
303
|
+
exports.FormatSpecifier = FormatSpecifier;
|
|
304
|
+
exports.formatDefaultLocale = defaultLocale;
|
|
305
|
+
exports.formatLocale = formatLocale;
|
|
306
|
+
exports.formatSpecifier = formatSpecifier;
|
|
307
|
+
exports.precisionFixed = precisionFixed;
|
|
308
|
+
exports.precisionPrefix = precisionPrefix;
|
|
309
|
+
exports.precisionRound = precisionRound;
|
|
310
|
+
Object.defineProperty(exports, '__esModule', {
|
|
311
|
+
value: true
|
|
312
|
+
});
|
|
313
|
+
});
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// https://d3js.org/d3-format/ v3.1.0 Copyright 2010-2021 Mike Bostock
|
|
4
|
+
!function (t, i) {
|
|
5
|
+
"object" == typeof exports && "undefined" != typeof module ? i(exports) : "function" == typeof define && define.amd ? define(["exports"], i) : i((t = "undefined" != typeof globalThis ? globalThis : t || self).d3 = t.d3 || {});
|
|
6
|
+
}(this, function (t) {
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
function i(t, i) {
|
|
10
|
+
if ((r = (t = i ? t.toExponential(i - 1) : t.toExponential()).indexOf("e")) < 0) return null;
|
|
11
|
+
var r,
|
|
12
|
+
n = t.slice(0, r);
|
|
13
|
+
return [n.length > 1 ? n[0] + n.slice(2) : n, +t.slice(r + 1)];
|
|
14
|
+
}
|
|
15
|
+
function r(t) {
|
|
16
|
+
return (t = i(Math.abs(t))) ? t[1] : NaN;
|
|
17
|
+
}
|
|
18
|
+
var n,
|
|
19
|
+
e = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
|
20
|
+
function o(t) {
|
|
21
|
+
if (!(i = e.exec(t))) throw new Error("invalid format: " + t);
|
|
22
|
+
var i;
|
|
23
|
+
return new a({
|
|
24
|
+
fill: i[1],
|
|
25
|
+
align: i[2],
|
|
26
|
+
sign: i[3],
|
|
27
|
+
symbol: i[4],
|
|
28
|
+
zero: i[5],
|
|
29
|
+
width: i[6],
|
|
30
|
+
comma: i[7],
|
|
31
|
+
precision: i[8] && i[8].slice(1),
|
|
32
|
+
trim: i[9],
|
|
33
|
+
type: i[10]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function a(t) {
|
|
37
|
+
this.fill = void 0 === t.fill ? " " : t.fill + "", this.align = void 0 === t.align ? ">" : t.align + "", this.sign = void 0 === t.sign ? "-" : t.sign + "", this.symbol = void 0 === t.symbol ? "" : t.symbol + "", this.zero = !!t.zero, this.width = void 0 === t.width ? void 0 : +t.width, this.comma = !!t.comma, this.precision = void 0 === t.precision ? void 0 : +t.precision, this.trim = !!t.trim, this.type = void 0 === t.type ? "" : t.type + "";
|
|
38
|
+
}
|
|
39
|
+
function s(t, r) {
|
|
40
|
+
var n = i(t, r);
|
|
41
|
+
if (!n) return t + "";
|
|
42
|
+
var e = n[0],
|
|
43
|
+
o = n[1];
|
|
44
|
+
return o < 0 ? "0." + new Array(-o).join("0") + e : e.length > o + 1 ? e.slice(0, o + 1) + "." + e.slice(o + 1) : e + new Array(o - e.length + 2).join("0");
|
|
45
|
+
}
|
|
46
|
+
o.prototype = a.prototype, a.prototype.toString = function () {
|
|
47
|
+
return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (void 0 === this.width ? "" : Math.max(1, 0 | this.width)) + (this.comma ? "," : "") + (void 0 === this.precision ? "" : "." + Math.max(0, 0 | this.precision)) + (this.trim ? "~" : "") + this.type;
|
|
48
|
+
};
|
|
49
|
+
var c = {
|
|
50
|
+
"%": (t, i) => (100 * t).toFixed(i),
|
|
51
|
+
b: t => Math.round(t).toString(2),
|
|
52
|
+
c: t => t + "",
|
|
53
|
+
d: function (t) {
|
|
54
|
+
return Math.abs(t = Math.round(t)) >= 1e21 ? t.toLocaleString("en").replace(/,/g, "") : t.toString(10);
|
|
55
|
+
},
|
|
56
|
+
e: (t, i) => t.toExponential(i),
|
|
57
|
+
f: (t, i) => t.toFixed(i),
|
|
58
|
+
g: (t, i) => t.toPrecision(i),
|
|
59
|
+
o: t => Math.round(t).toString(8),
|
|
60
|
+
p: (t, i) => s(100 * t, i),
|
|
61
|
+
r: s,
|
|
62
|
+
s: function (t, r) {
|
|
63
|
+
var e = i(t, r);
|
|
64
|
+
if (!e) return t + "";
|
|
65
|
+
var o = e[0],
|
|
66
|
+
a = e[1],
|
|
67
|
+
s = a - (n = 3 * Math.max(-8, Math.min(8, Math.floor(a / 3)))) + 1,
|
|
68
|
+
c = o.length;
|
|
69
|
+
return s === c ? o : s > c ? o + new Array(s - c + 1).join("0") : s > 0 ? o.slice(0, s) + "." + o.slice(s) : "0." + new Array(1 - s).join("0") + i(t, Math.max(0, r + s - 1))[0];
|
|
70
|
+
},
|
|
71
|
+
X: t => Math.round(t).toString(16).toUpperCase(),
|
|
72
|
+
x: t => Math.round(t).toString(16)
|
|
73
|
+
};
|
|
74
|
+
function h(t) {
|
|
75
|
+
return t;
|
|
76
|
+
}
|
|
77
|
+
var l,
|
|
78
|
+
u = Array.prototype.map,
|
|
79
|
+
f = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
|
|
80
|
+
function d(t) {
|
|
81
|
+
var i,
|
|
82
|
+
e,
|
|
83
|
+
a = void 0 === t.grouping || void 0 === t.thousands ? h : (i = u.call(t.grouping, Number), e = t.thousands + "", function (t, r) {
|
|
84
|
+
for (var n = t.length, o = [], a = 0, s = i[0], c = 0; n > 0 && s > 0 && (c + s + 1 > r && (s = Math.max(1, r - c)), o.push(t.substring(n -= s, n + s)), !((c += s + 1) > r));) s = i[a = (a + 1) % i.length];
|
|
85
|
+
return o.reverse().join(e);
|
|
86
|
+
}),
|
|
87
|
+
s = void 0 === t.currency ? "" : t.currency[0] + "",
|
|
88
|
+
l = void 0 === t.currency ? "" : t.currency[1] + "",
|
|
89
|
+
d = void 0 === t.decimal ? "." : t.decimal + "",
|
|
90
|
+
m = void 0 === t.numerals ? h : function (t) {
|
|
91
|
+
return function (i) {
|
|
92
|
+
return i.replace(/[0-9]/g, function (i) {
|
|
93
|
+
return t[+i];
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
}(u.call(t.numerals, String)),
|
|
97
|
+
p = void 0 === t.percent ? "%" : t.percent + "",
|
|
98
|
+
g = void 0 === t.minus ? "−" : t.minus + "",
|
|
99
|
+
v = void 0 === t.nan ? "NaN" : t.nan + "";
|
|
100
|
+
function M(t) {
|
|
101
|
+
var i = (t = o(t)).fill,
|
|
102
|
+
r = t.align,
|
|
103
|
+
e = t.sign,
|
|
104
|
+
h = t.symbol,
|
|
105
|
+
u = t.zero,
|
|
106
|
+
M = t.width,
|
|
107
|
+
y = t.comma,
|
|
108
|
+
x = t.precision,
|
|
109
|
+
b = t.trim,
|
|
110
|
+
w = t.type;
|
|
111
|
+
"n" === w ? (y = !0, w = "g") : c[w] || (void 0 === x && (x = 12), b = !0, w = "g"), (u || "0" === i && "=" === r) && (u = !0, i = "0", r = "=");
|
|
112
|
+
var S = "$" === h ? s : "#" === h && /[boxX]/.test(w) ? "0" + w.toLowerCase() : "",
|
|
113
|
+
j = "$" === h ? l : /[%p]/.test(w) ? p : "",
|
|
114
|
+
k = c[w],
|
|
115
|
+
P = /[defgprs%]/.test(w);
|
|
116
|
+
function z(t) {
|
|
117
|
+
var o,
|
|
118
|
+
s,
|
|
119
|
+
c,
|
|
120
|
+
h = S,
|
|
121
|
+
l = j;
|
|
122
|
+
if ("c" === w) l = k(t) + l, t = "";else {
|
|
123
|
+
var p = (t = +t) < 0 || 1 / t < 0;
|
|
124
|
+
if (t = isNaN(t) ? v : k(Math.abs(t), x), b && (t = function (t) {
|
|
125
|
+
t: for (var i, r = t.length, n = 1, e = -1; n < r; ++n) switch (t[n]) {
|
|
126
|
+
case ".":
|
|
127
|
+
e = i = n;
|
|
128
|
+
break;
|
|
129
|
+
case "0":
|
|
130
|
+
0 === e && (e = n), i = n;
|
|
131
|
+
break;
|
|
132
|
+
default:
|
|
133
|
+
if (!+t[n]) break t;
|
|
134
|
+
e > 0 && (e = 0);
|
|
135
|
+
}
|
|
136
|
+
return e > 0 ? t.slice(0, e) + t.slice(i + 1) : t;
|
|
137
|
+
}(t)), p && 0 == +t && "+" !== e && (p = !1), h = (p ? "(" === e ? e : g : "-" === e || "(" === e ? "" : e) + h, l = ("s" === w ? f[8 + n / 3] : "") + l + (p && "(" === e ? ")" : ""), P) for (o = -1, s = t.length; ++o < s;) if (48 > (c = t.charCodeAt(o)) || c > 57) {
|
|
138
|
+
l = (46 === c ? d + t.slice(o + 1) : t.slice(o)) + l, t = t.slice(0, o);
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
y && !u && (t = a(t, 1 / 0));
|
|
143
|
+
var z = h.length + t.length + l.length,
|
|
144
|
+
A = z < M ? new Array(M - z + 1).join(i) : "";
|
|
145
|
+
switch (y && u && (t = a(A + t, A.length ? M - l.length : 1 / 0), A = ""), r) {
|
|
146
|
+
case "<":
|
|
147
|
+
t = h + t + l + A;
|
|
148
|
+
break;
|
|
149
|
+
case "=":
|
|
150
|
+
t = h + A + t + l;
|
|
151
|
+
break;
|
|
152
|
+
case "^":
|
|
153
|
+
t = A.slice(0, z = A.length >> 1) + h + t + l + A.slice(z);
|
|
154
|
+
break;
|
|
155
|
+
default:
|
|
156
|
+
t = A + h + t + l;
|
|
157
|
+
}
|
|
158
|
+
return m(t);
|
|
159
|
+
}
|
|
160
|
+
return x = void 0 === x ? 6 : /[gprs]/.test(w) ? Math.max(1, Math.min(21, x)) : Math.max(0, Math.min(20, x)), z.toString = function () {
|
|
161
|
+
return t + "";
|
|
162
|
+
}, z;
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
format: M,
|
|
166
|
+
formatPrefix: function (t, i) {
|
|
167
|
+
var n = M(((t = o(t)).type = "f", t)),
|
|
168
|
+
e = 3 * Math.max(-8, Math.min(8, Math.floor(r(i) / 3))),
|
|
169
|
+
a = Math.pow(10, -e),
|
|
170
|
+
s = f[8 + e / 3];
|
|
171
|
+
return function (t) {
|
|
172
|
+
return n(a * t) + s;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function m(i) {
|
|
178
|
+
return l = d(i), t.format = l.format, t.formatPrefix = l.formatPrefix, l;
|
|
179
|
+
}
|
|
180
|
+
t.format = void 0, t.formatPrefix = void 0, m({
|
|
181
|
+
thousands: ",",
|
|
182
|
+
grouping: [3],
|
|
183
|
+
currency: ["$", ""]
|
|
184
|
+
}), t.FormatSpecifier = a, t.formatDefaultLocale = m, t.formatLocale = d, t.formatSpecifier = o, t.precisionFixed = function (t) {
|
|
185
|
+
return Math.max(0, -r(Math.abs(t)));
|
|
186
|
+
}, t.precisionPrefix = function (t, i) {
|
|
187
|
+
return Math.max(0, 3 * Math.max(-8, Math.min(8, Math.floor(r(i) / 3))) - r(Math.abs(t)));
|
|
188
|
+
}, t.precisionRound = function (t, i) {
|
|
189
|
+
return t = Math.abs(t), i = Math.abs(i) - t, Math.max(0, r(i) - r(t)) + 1;
|
|
190
|
+
}, Object.defineProperty(t, "__esModule", {
|
|
191
|
+
value: !0
|
|
192
|
+
});
|
|
193
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = defaultLocale;
|
|
8
|
+
exports.formatPrefix = exports.format = void 0;
|
|
9
|
+
var _locale = _interopRequireDefault(require("./locale.js"));
|
|
10
|
+
var locale;
|
|
11
|
+
var format;
|
|
12
|
+
var formatPrefix;
|
|
13
|
+
defaultLocale({
|
|
14
|
+
thousands: ",",
|
|
15
|
+
grouping: [3],
|
|
16
|
+
currency: ["$", ""]
|
|
17
|
+
});
|
|
18
|
+
function defaultLocale(definition) {
|
|
19
|
+
locale = (0, _locale.default)(definition);
|
|
20
|
+
exports.format = format = locale.format;
|
|
21
|
+
exports.formatPrefix = formatPrefix = locale.formatPrefix;
|
|
22
|
+
return locale;
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
var _formatDecimal = require("./formatDecimal.js");
|
|
8
|
+
function _default(x) {
|
|
9
|
+
return x = (0, _formatDecimal.formatDecimalParts)(Math.abs(x)), x ? x[1] : NaN;
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
exports.formatDecimalParts = formatDecimalParts;
|
|
8
|
+
function _default(x) {
|
|
9
|
+
return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString("en").replace(/,/g, "") : x.toString(10);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Computes the decimal coefficient and exponent of the specified number x with
|
|
13
|
+
// significant digits p, where x is positive and p is in [1, 21] or undefined.
|
|
14
|
+
// For example, formatDecimalParts(1.23) returns ["123", 0].
|
|
15
|
+
function formatDecimalParts(x, p) {
|
|
16
|
+
if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
|
|
17
|
+
var i,
|
|
18
|
+
coefficient = x.slice(0, i);
|
|
19
|
+
|
|
20
|
+
// The string returned by toExponential either has the form \d\.\d+e[-+]\d+
|
|
21
|
+
// (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
|
|
22
|
+
return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)];
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
function _default(grouping, thousands) {
|
|
8
|
+
return function (value, width) {
|
|
9
|
+
var i = value.length,
|
|
10
|
+
t = [],
|
|
11
|
+
j = 0,
|
|
12
|
+
g = grouping[0],
|
|
13
|
+
length = 0;
|
|
14
|
+
while (i > 0 && g > 0) {
|
|
15
|
+
if (length + g + 1 > width) g = Math.max(1, width - length);
|
|
16
|
+
t.push(value.substring(i -= g, i + g));
|
|
17
|
+
if ((length += g + 1) > width) break;
|
|
18
|
+
g = grouping[j = (j + 1) % grouping.length];
|
|
19
|
+
}
|
|
20
|
+
return t.reverse().join(thousands);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
function _default(numerals) {
|
|
8
|
+
return function (value) {
|
|
9
|
+
return value.replace(/[0-9]/g, function (i) {
|
|
10
|
+
return numerals[+i];
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
exports.prefixExponent = void 0;
|
|
8
|
+
var _formatDecimal = require("./formatDecimal.js");
|
|
9
|
+
var prefixExponent;
|
|
10
|
+
function _default(x, p) {
|
|
11
|
+
var d = (0, _formatDecimal.formatDecimalParts)(x, p);
|
|
12
|
+
if (!d) return x + "";
|
|
13
|
+
var coefficient = d[0],
|
|
14
|
+
exponent = d[1],
|
|
15
|
+
i = exponent - (exports.prefixExponent = prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
|
|
16
|
+
n = coefficient.length;
|
|
17
|
+
return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + (0, _formatDecimal.formatDecimalParts)(x, Math.max(0, p + i - 1))[0]; // less than 1y!
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
var _formatDecimal = require("./formatDecimal.js");
|
|
8
|
+
function _default(x, p) {
|
|
9
|
+
var d = (0, _formatDecimal.formatDecimalParts)(x, p);
|
|
10
|
+
if (!d) return x + "";
|
|
11
|
+
var coefficient = d[0],
|
|
12
|
+
exponent = d[1];
|
|
13
|
+
return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0");
|
|
14
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FormatSpecifier = FormatSpecifier;
|
|
7
|
+
exports.default = formatSpecifier;
|
|
8
|
+
// [[fill]align][sign][symbol][0][width][,][.precision][~][type]
|
|
9
|
+
var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
|
10
|
+
function formatSpecifier(specifier) {
|
|
11
|
+
if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
|
|
12
|
+
var match;
|
|
13
|
+
return new FormatSpecifier({
|
|
14
|
+
fill: match[1],
|
|
15
|
+
align: match[2],
|
|
16
|
+
sign: match[3],
|
|
17
|
+
symbol: match[4],
|
|
18
|
+
zero: match[5],
|
|
19
|
+
width: match[6],
|
|
20
|
+
comma: match[7],
|
|
21
|
+
precision: match[8] && match[8].slice(1),
|
|
22
|
+
trim: match[9],
|
|
23
|
+
type: match[10]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
|
|
27
|
+
|
|
28
|
+
function FormatSpecifier(specifier) {
|
|
29
|
+
this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
|
|
30
|
+
this.align = specifier.align === undefined ? ">" : specifier.align + "";
|
|
31
|
+
this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
|
|
32
|
+
this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
|
|
33
|
+
this.zero = !!specifier.zero;
|
|
34
|
+
this.width = specifier.width === undefined ? undefined : +specifier.width;
|
|
35
|
+
this.comma = !!specifier.comma;
|
|
36
|
+
this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
|
|
37
|
+
this.trim = !!specifier.trim;
|
|
38
|
+
this.type = specifier.type === undefined ? "" : specifier.type + "";
|
|
39
|
+
}
|
|
40
|
+
FormatSpecifier.prototype.toString = function () {
|
|
41
|
+
return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === undefined ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
|
|
42
|
+
};
|