victory-vendor 36.4.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/LICENSE.txt +30 -0
- package/README.md +70 -0
- package/d3-array.js +7 -0
- package/d3-ease.js +7 -0
- package/d3-interpolate.js +7 -0
- package/d3-scale.js +7 -0
- package/d3-shape.js +7 -0
- package/d3-time.js +7 -0
- package/d3-timer.js +7 -0
- package/es/d3-array.js +6 -0
- package/es/d3-color.js +6 -0
- package/es/d3-ease.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/d3-timer.js +6 -0
- package/es/internmap.js +6 -0
- package/lib/d3-array.js +6 -0
- package/lib/d3-color.js +6 -0
- package/lib/d3-ease.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/d3-timer.js +6 -0
- package/lib/internmap.js +6 -0
- package/lib-vendor/d3-array/LICENSE +13 -0
- package/lib-vendor/d3-array/src/array.js +11 -0
- package/lib-vendor/d3-array/src/ascending.js +10 -0
- package/lib-vendor/d3-array/src/bin.js +142 -0
- package/lib-vendor/d3-array/src/bisect.js +24 -0
- package/lib-vendor/d3-array/src/bisector.js +73 -0
- package/lib-vendor/d3-array/src/constant.js +10 -0
- package/lib-vendor/d3-array/src/count.js +28 -0
- package/lib-vendor/d3-array/src/cross.js +42 -0
- package/lib-vendor/d3-array/src/cumsum.js +12 -0
- package/lib-vendor/d3-array/src/descending.js +10 -0
- package/lib-vendor/d3-array/src/deviation.js +15 -0
- package/lib-vendor/d3-array/src/difference.js +20 -0
- package/lib-vendor/d3-array/src/disjoint.js +29 -0
- package/lib-vendor/d3-array/src/every.js +19 -0
- package/lib-vendor/d3-array/src/extent.js +39 -0
- package/lib-vendor/d3-array/src/filter.js +20 -0
- package/lib-vendor/d3-array/src/fsum.js +93 -0
- package/lib-vendor/d3-array/src/greatest.js +38 -0
- package/lib-vendor/d3-array/src/greatestIndex.js +30 -0
- package/lib-vendor/d3-array/src/group.js +85 -0
- package/lib-vendor/d3-array/src/groupSort.js +22 -0
- package/lib-vendor/d3-array/src/identity.js +10 -0
- package/lib-vendor/d3-array/src/index.js +567 -0
- package/lib-vendor/d3-array/src/intersection.js +28 -0
- package/lib-vendor/d3-array/src/least.js +38 -0
- package/lib-vendor/d3-array/src/leastIndex.js +30 -0
- package/lib-vendor/d3-array/src/map.js +12 -0
- package/lib-vendor/d3-array/src/max.js +28 -0
- package/lib-vendor/d3-array/src/maxIndex.js +30 -0
- package/lib-vendor/d3-array/src/mean.js +29 -0
- package/lib-vendor/d3-array/src/median.js +14 -0
- package/lib-vendor/d3-array/src/merge.js +16 -0
- package/lib-vendor/d3-array/src/min.js +28 -0
- package/lib-vendor/d3-array/src/minIndex.js +30 -0
- package/lib-vendor/d3-array/src/mode.js +40 -0
- package/lib-vendor/d3-array/src/nice.js +28 -0
- package/lib-vendor/d3-array/src/number.js +29 -0
- package/lib-vendor/d3-array/src/pairs.js +25 -0
- package/lib-vendor/d3-array/src/permute.js +10 -0
- package/lib-vendor/d3-array/src/quantile.js +46 -0
- package/lib-vendor/d3-array/src/quickselect.js +53 -0
- package/lib-vendor/d3-array/src/range.js +19 -0
- package/lib-vendor/d3-array/src/rank.js +34 -0
- package/lib-vendor/d3-array/src/reduce.js +32 -0
- package/lib-vendor/d3-array/src/reverse.js +11 -0
- package/lib-vendor/d3-array/src/scan.js +15 -0
- package/lib-vendor/d3-array/src/shuffle.js +26 -0
- package/lib-vendor/d3-array/src/some.js +19 -0
- package/lib-vendor/d3-array/src/sort.js +55 -0
- package/lib-vendor/d3-array/src/subset.js +14 -0
- package/lib-vendor/d3-array/src/sum.js +28 -0
- package/lib-vendor/d3-array/src/superset.js +33 -0
- package/lib-vendor/d3-array/src/threshold/freedmanDiaconis.js +16 -0
- package/lib-vendor/d3-array/src/threshold/scott.js +16 -0
- package/lib-vendor/d3-array/src/threshold/sturges.js +14 -0
- package/lib-vendor/d3-array/src/ticks.js +60 -0
- package/lib-vendor/d3-array/src/transpose.js +26 -0
- package/lib-vendor/d3-array/src/union.js +20 -0
- package/lib-vendor/d3-array/src/variance.js +35 -0
- package/lib-vendor/d3-array/src/zip.js +14 -0
- package/lib-vendor/d3-color/LICENSE +13 -0
- package/lib-vendor/d3-color/src/color.js +413 -0
- package/lib-vendor/d3-color/src/cubehelix.js +74 -0
- package/lib-vendor/d3-color/src/define.js +20 -0
- package/lib-vendor/d3-color/src/index.js +65 -0
- package/lib-vendor/d3-color/src/lab.js +146 -0
- package/lib-vendor/d3-color/src/math.js +10 -0
- package/lib-vendor/d3-ease/LICENSE +28 -0
- package/lib-vendor/d3-ease/src/back.js +46 -0
- package/lib-vendor/d3-ease/src/bounce.js +30 -0
- package/lib-vendor/d3-ease/src/circle.js +20 -0
- package/lib-vendor/d3-ease/src/cubic.js +20 -0
- package/lib-vendor/d3-ease/src/elastic.js +72 -0
- package/lib-vendor/d3-ease/src/exp.js +22 -0
- package/lib-vendor/d3-ease/src/index.js +247 -0
- package/lib-vendor/d3-ease/src/linear.js +10 -0
- package/lib-vendor/d3-ease/src/math.js +11 -0
- package/lib-vendor/d3-ease/src/poly.js +46 -0
- package/lib-vendor/d3-ease/src/quad.js +20 -0
- package/lib-vendor/d3-ease/src/sin.js +22 -0
- package/lib-vendor/d3-format/LICENSE +13 -0
- package/lib-vendor/d3-format/src/defaultLocale.js +29 -0
- package/lib-vendor/d3-format/src/exponent.js +12 -0
- package/lib-vendor/d3-format/src/formatDecimal.js +24 -0
- package/lib-vendor/d3-format/src/formatGroup.js +25 -0
- package/lib-vendor/d3-format/src/formatNumerals.js +14 -0
- package/lib-vendor/d3-format/src/formatPrefixAuto.js +22 -0
- package/lib-vendor/d3-format/src/formatRounded.js +16 -0
- package/lib-vendor/d3-format/src/formatSpecifier.js +45 -0
- package/lib-vendor/d3-format/src/formatTrim.js +29 -0
- package/lib-vendor/d3-format/src/formatTypes.js +31 -0
- package/lib-vendor/d3-format/src/identity.js +10 -0
- package/lib-vendor/d3-format/src/index.js +77 -0
- package/lib-vendor/d3-format/src/locale.js +159 -0
- package/lib-vendor/d3-format/src/precisionFixed.js +14 -0
- package/lib-vendor/d3-format/src/precisionPrefix.js +14 -0
- package/lib-vendor/d3-format/src/precisionRound.js +15 -0
- package/lib-vendor/d3-interpolate/LICENSE +13 -0
- package/lib-vendor/d3-interpolate/src/array.js +39 -0
- package/lib-vendor/d3-interpolate/src/basis.js +25 -0
- package/lib-vendor/d3-interpolate/src/basisClosed.js +20 -0
- package/lib-vendor/d3-interpolate/src/color.js +40 -0
- package/lib-vendor/d3-interpolate/src/constant.js +10 -0
- package/lib-vendor/d3-interpolate/src/cubehelix.js +43 -0
- package/lib-vendor/d3-interpolate/src/date.js +13 -0
- package/lib-vendor/d3-interpolate/src/discrete.js +13 -0
- package/lib-vendor/d3-interpolate/src/hcl.js +36 -0
- package/lib-vendor/d3-interpolate/src/hsl.js +36 -0
- package/lib-vendor/d3-interpolate/src/hue.js +16 -0
- package/lib-vendor/d3-interpolate/src/index.js +215 -0
- package/lib-vendor/d3-interpolate/src/lab.js +26 -0
- package/lib-vendor/d3-interpolate/src/number.js +12 -0
- package/lib-vendor/d3-interpolate/src/numberArray.js +23 -0
- package/lib-vendor/d3-interpolate/src/object.js +32 -0
- package/lib-vendor/d3-interpolate/src/piecewise.js +25 -0
- package/lib-vendor/d3-interpolate/src/quantize.js +14 -0
- package/lib-vendor/d3-interpolate/src/rgb.js +77 -0
- package/lib-vendor/d3-interpolate/src/round.js +12 -0
- package/lib-vendor/d3-interpolate/src/string.js +83 -0
- package/lib-vendor/d3-interpolate/src/transform/decompose.js +33 -0
- package/lib-vendor/d3-interpolate/src/transform/index.js +100 -0
- package/lib-vendor/d3-interpolate/src/transform/parse.js +30 -0
- package/lib-vendor/d3-interpolate/src/value.js +36 -0
- package/lib-vendor/d3-interpolate/src/zoom.js +75 -0
- package/lib-vendor/d3-path/LICENSE +13 -0
- package/lib-vendor/d3-path/src/index.js +15 -0
- package/lib-vendor/d3-path/src/path.js +120 -0
- package/lib-vendor/d3-scale/LICENSE +13 -0
- package/lib-vendor/d3-scale/src/band.js +109 -0
- package/lib-vendor/d3-scale/src/colors.js +12 -0
- package/lib-vendor/d3-scale/src/constant.js +12 -0
- package/lib-vendor/d3-scale/src/continuous.js +140 -0
- package/lib-vendor/d3-scale/src/diverging.js +121 -0
- package/lib-vendor/d3-scale/src/identity.js +37 -0
- package/lib-vendor/d3-scale/src/index.js +213 -0
- package/lib-vendor/d3-scale/src/init.js +46 -0
- package/lib-vendor/d3-scale/src/linear.js +88 -0
- package/lib-vendor/d3-scale/src/log.js +156 -0
- package/lib-vendor/d3-scale/src/nice.js +24 -0
- package/lib-vendor/d3-scale/src/number.js +10 -0
- package/lib-vendor/d3-scale/src/ordinal.js +60 -0
- package/lib-vendor/d3-scale/src/pow.js +59 -0
- package/lib-vendor/d3-scale/src/quantile.js +64 -0
- package/lib-vendor/d3-scale/src/quantize.js +61 -0
- package/lib-vendor/d3-scale/src/radial.js +72 -0
- package/lib-vendor/d3-scale/src/sequential.js +120 -0
- package/lib-vendor/d3-scale/src/sequentialQuantile.js +51 -0
- package/lib-vendor/d3-scale/src/symlog.js +46 -0
- package/lib-vendor/d3-scale/src/threshold.js +44 -0
- package/lib-vendor/d3-scale/src/tickFormat.js +44 -0
- package/lib-vendor/d3-scale/src/time.js +82 -0
- package/lib-vendor/d3-scale/src/utcTime.js +18 -0
- package/lib-vendor/d3-shape/LICENSE +13 -0
- package/lib-vendor/d3-shape/src/arc.js +243 -0
- package/lib-vendor/d3-shape/src/area.js +125 -0
- package/lib-vendor/d3-shape/src/areaRadial.js +51 -0
- package/lib-vendor/d3-shape/src/array.js +14 -0
- package/lib-vendor/d3-shape/src/constant.js +12 -0
- package/lib-vendor/d3-shape/src/curve/basis.js +76 -0
- package/lib-vendor/d3-shape/src/curve/basisClosed.js +90 -0
- package/lib-vendor/d3-shape/src/curve/basisOpen.js +64 -0
- package/lib-vendor/d3-shape/src/curve/bump.js +104 -0
- package/lib-vendor/d3-shape/src/curve/bundle.js +65 -0
- package/lib-vendor/d3-shape/src/curve/cardinal.js +85 -0
- package/lib-vendor/d3-shape/src/curve/cardinalClosed.js +99 -0
- package/lib-vendor/d3-shape/src/curve/cardinalOpen.js +74 -0
- package/lib-vendor/d3-shape/src/curve/catmullRom.js +114 -0
- package/lib-vendor/d3-shape/src/curve/catmullRomClosed.js +108 -0
- package/lib-vendor/d3-shape/src/curve/catmullRomOpen.js +83 -0
- package/lib-vendor/d3-shape/src/curve/linear.js +49 -0
- package/lib-vendor/d3-shape/src/curve/linearClosed.js +33 -0
- package/lib-vendor/d3-shape/src/curve/monotone.js +139 -0
- package/lib-vendor/d3-shape/src/curve/natural.js +82 -0
- package/lib-vendor/d3-shape/src/curve/radial.js +45 -0
- package/lib-vendor/d3-shape/src/curve/step.js +76 -0
- package/lib-vendor/d3-shape/src/descending.js +10 -0
- package/lib-vendor/d3-shape/src/identity.js +10 -0
- package/lib-vendor/d3-shape/src/index.js +483 -0
- package/lib-vendor/d3-shape/src/line.js +68 -0
- package/lib-vendor/d3-shape/src/lineRadial.js +33 -0
- package/lib-vendor/d3-shape/src/link.js +90 -0
- package/lib-vendor/d3-shape/src/math.js +39 -0
- package/lib-vendor/d3-shape/src/noop.js +8 -0
- package/lib-vendor/d3-shape/src/offset/diverging.js +22 -0
- package/lib-vendor/d3-shape/src/offset/expand.js +22 -0
- package/lib-vendor/d3-shape/src/offset/none.js +18 -0
- package/lib-vendor/d3-shape/src/offset/silhouette.js +22 -0
- package/lib-vendor/d3-shape/src/offset/wiggle.js +38 -0
- package/lib-vendor/d3-shape/src/order/appearance.js +29 -0
- package/lib-vendor/d3-shape/src/order/ascending.js +29 -0
- package/lib-vendor/d3-shape/src/order/descending.js +14 -0
- package/lib-vendor/d3-shape/src/order/insideOut.js +38 -0
- package/lib-vendor/d3-shape/src/order/none.js +15 -0
- package/lib-vendor/d3-shape/src/order/reverse.js +14 -0
- package/lib-vendor/d3-shape/src/pie.js +95 -0
- package/lib-vendor/d3-shape/src/point.js +15 -0
- package/lib-vendor/d3-shape/src/pointRadial.js +10 -0
- package/lib-vendor/d3-shape/src/stack.js +72 -0
- package/lib-vendor/d3-shape/src/symbol/asterisk.js +25 -0
- package/lib-vendor/d3-shape/src/symbol/circle.js +18 -0
- package/lib-vendor/d3-shape/src/symbol/cross.js +29 -0
- package/lib-vendor/d3-shape/src/symbol/diamond.js +24 -0
- package/lib-vendor/d3-shape/src/symbol/diamond2.js +21 -0
- package/lib-vendor/d3-shape/src/symbol/plus.js +20 -0
- package/lib-vendor/d3-shape/src/symbol/square.js +18 -0
- package/lib-vendor/d3-shape/src/symbol/square2.js +21 -0
- package/lib-vendor/d3-shape/src/symbol/star.js +34 -0
- package/lib-vendor/d3-shape/src/symbol/triangle.js +21 -0
- package/lib-vendor/d3-shape/src/symbol/triangle2.js +24 -0
- package/lib-vendor/d3-shape/src/symbol/wye.js +36 -0
- package/lib-vendor/d3-shape/src/symbol/x.js +20 -0
- package/lib-vendor/d3-shape/src/symbol.js +73 -0
- package/lib-vendor/d3-time/LICENSE +13 -0
- package/lib-vendor/d3-time/src/day.js +18 -0
- package/lib-vendor/d3-time/src/duration.js +20 -0
- package/lib-vendor/d3-time/src/hour.js +26 -0
- package/lib-vendor/d3-time/src/index.js +433 -0
- package/lib-vendor/d3-time/src/interval.js +79 -0
- package/lib-vendor/d3-time/src/millisecond.js +35 -0
- package/lib-vendor/d3-time/src/minute.js +26 -0
- package/lib-vendor/d3-time/src/month.js +25 -0
- package/lib-vendor/d3-time/src/second.js +26 -0
- package/lib-vendor/d3-time/src/ticks.js +71 -0
- package/lib-vendor/d3-time/src/utcDay.js +26 -0
- package/lib-vendor/d3-time/src/utcHour.js +26 -0
- package/lib-vendor/d3-time/src/utcMinute.js +26 -0
- package/lib-vendor/d3-time/src/utcMonth.js +25 -0
- package/lib-vendor/d3-time/src/utcWeek.js +52 -0
- package/lib-vendor/d3-time/src/utcYear.js +36 -0
- package/lib-vendor/d3-time/src/week.js +52 -0
- package/lib-vendor/d3-time/src/year.js +36 -0
- package/lib-vendor/d3-time-format/LICENSE +13 -0
- package/lib-vendor/d3-time-format/src/defaultLocale.js +40 -0
- package/lib-vendor/d3-time-format/src/index.js +67 -0
- package/lib-vendor/d3-time-format/src/isoFormat.js +19 -0
- package/lib-vendor/d3-time-format/src/isoParse.js +19 -0
- package/lib-vendor/d3-time-format/src/locale.js +713 -0
- package/lib-vendor/d3-timer/LICENSE +13 -0
- package/lib-vendor/d3-timer/src/index.js +43 -0
- package/lib-vendor/d3-timer/src/interval.js +30 -0
- package/lib-vendor/d3-timer/src/timeout.js +18 -0
- package/lib-vendor/d3-timer/src/timer.js +138 -0
- package/lib-vendor/internmap/LICENSE +13 -0
- package/lib-vendor/internmap/src/index.js +111 -0
- package/package.json +43 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Cubehelix = Cubehelix;
|
|
7
|
+
exports.default = cubehelix;
|
|
8
|
+
|
|
9
|
+
var _define = _interopRequireWildcard(require("./define.js"));
|
|
10
|
+
|
|
11
|
+
var _color = require("./color.js");
|
|
12
|
+
|
|
13
|
+
var _math = require("./math.js");
|
|
14
|
+
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
|
|
19
|
+
var A = -0.14861,
|
|
20
|
+
B = +1.78277,
|
|
21
|
+
C = -0.29227,
|
|
22
|
+
D = -0.90649,
|
|
23
|
+
E = +1.97294,
|
|
24
|
+
ED = E * D,
|
|
25
|
+
EB = E * B,
|
|
26
|
+
BC_DA = B * C - D * A;
|
|
27
|
+
|
|
28
|
+
function cubehelixConvert(o) {
|
|
29
|
+
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
|
|
30
|
+
if (!(o instanceof _color.Rgb)) o = (0, _color.rgbConvert)(o);
|
|
31
|
+
var r = o.r / 255,
|
|
32
|
+
g = o.g / 255,
|
|
33
|
+
b = o.b / 255,
|
|
34
|
+
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
|
|
35
|
+
bl = b - l,
|
|
36
|
+
k = (E * (g - l) - C * bl) / D,
|
|
37
|
+
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)),
|
|
38
|
+
// NaN if l=0 or l=1
|
|
39
|
+
h = s ? Math.atan2(k, bl) * _math.degrees - 120 : NaN;
|
|
40
|
+
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function cubehelix(h, s, l, opacity) {
|
|
44
|
+
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function Cubehelix(h, s, l, opacity) {
|
|
48
|
+
this.h = +h;
|
|
49
|
+
this.s = +s;
|
|
50
|
+
this.l = +l;
|
|
51
|
+
this.opacity = +opacity;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
(0, _define.default)(Cubehelix, cubehelix, (0, _define.extend)(_color.Color, {
|
|
55
|
+
brighter(k) {
|
|
56
|
+
k = k == null ? _color.brighter : Math.pow(_color.brighter, k);
|
|
57
|
+
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
darker(k) {
|
|
61
|
+
k = k == null ? _color.darker : Math.pow(_color.darker, k);
|
|
62
|
+
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
rgb() {
|
|
66
|
+
var h = isNaN(this.h) ? 0 : (this.h + 120) * _math.radians,
|
|
67
|
+
l = +this.l,
|
|
68
|
+
a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
|
|
69
|
+
cosh = Math.cos(h),
|
|
70
|
+
sinh = Math.sin(h);
|
|
71
|
+
return new _color.Rgb(255 * (l + a * (A * cosh + B * sinh)), 255 * (l + a * (C * cosh + D * sinh)), 255 * (l + a * (E * cosh)), this.opacity);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
exports.extend = extend;
|
|
8
|
+
|
|
9
|
+
function _default(constructor, factory, prototype) {
|
|
10
|
+
constructor.prototype = factory.prototype = prototype;
|
|
11
|
+
prototype.constructor = constructor;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function extend(parent, definition) {
|
|
15
|
+
var prototype = Object.create(parent.prototype);
|
|
16
|
+
|
|
17
|
+
for (var key in definition) prototype[key] = definition[key];
|
|
18
|
+
|
|
19
|
+
return prototype;
|
|
20
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "color", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _color.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "cubehelix", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _cubehelix.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "gray", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _lab.gray;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "hcl", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _lab.hcl;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "hsl", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _color.hsl;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "lab", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _lab.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "lch", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _lab.lch;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "rgb", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _color.rgb;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
var _color = _interopRequireWildcard(require("./color.js"));
|
|
56
|
+
|
|
57
|
+
var _lab = _interopRequireWildcard(require("./lab.js"));
|
|
58
|
+
|
|
59
|
+
var _cubehelix = _interopRequireDefault(require("./cubehelix.js"));
|
|
60
|
+
|
|
61
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
62
|
+
|
|
63
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
64
|
+
|
|
65
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Hcl = Hcl;
|
|
7
|
+
exports.Lab = Lab;
|
|
8
|
+
exports.default = lab;
|
|
9
|
+
exports.gray = gray;
|
|
10
|
+
exports.hcl = hcl;
|
|
11
|
+
exports.lch = lch;
|
|
12
|
+
|
|
13
|
+
var _define = _interopRequireWildcard(require("./define.js"));
|
|
14
|
+
|
|
15
|
+
var _color = require("./color.js");
|
|
16
|
+
|
|
17
|
+
var _math = require("./math.js");
|
|
18
|
+
|
|
19
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
+
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
|
|
23
|
+
// https://observablehq.com/@mbostock/lab-and-rgb
|
|
24
|
+
const K = 18,
|
|
25
|
+
Xn = 0.96422,
|
|
26
|
+
Yn = 1,
|
|
27
|
+
Zn = 0.82521,
|
|
28
|
+
t0 = 4 / 29,
|
|
29
|
+
t1 = 6 / 29,
|
|
30
|
+
t2 = 3 * t1 * t1,
|
|
31
|
+
t3 = t1 * t1 * t1;
|
|
32
|
+
|
|
33
|
+
function labConvert(o) {
|
|
34
|
+
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
|
|
35
|
+
if (o instanceof Hcl) return hcl2lab(o);
|
|
36
|
+
if (!(o instanceof _color.Rgb)) o = (0, _color.rgbConvert)(o);
|
|
37
|
+
var r = rgb2lrgb(o.r),
|
|
38
|
+
g = rgb2lrgb(o.g),
|
|
39
|
+
b = rgb2lrgb(o.b),
|
|
40
|
+
y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn),
|
|
41
|
+
x,
|
|
42
|
+
z;
|
|
43
|
+
if (r === g && g === b) x = z = y;else {
|
|
44
|
+
x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
|
|
45
|
+
z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
|
|
46
|
+
}
|
|
47
|
+
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function gray(l, opacity) {
|
|
51
|
+
return new Lab(l, 0, 0, opacity == null ? 1 : opacity);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function lab(l, a, b, opacity) {
|
|
55
|
+
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function Lab(l, a, b, opacity) {
|
|
59
|
+
this.l = +l;
|
|
60
|
+
this.a = +a;
|
|
61
|
+
this.b = +b;
|
|
62
|
+
this.opacity = +opacity;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
(0, _define.default)(Lab, lab, (0, _define.extend)(_color.Color, {
|
|
66
|
+
brighter(k) {
|
|
67
|
+
return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
darker(k) {
|
|
71
|
+
return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
rgb() {
|
|
75
|
+
var y = (this.l + 16) / 116,
|
|
76
|
+
x = isNaN(this.a) ? y : y + this.a / 500,
|
|
77
|
+
z = isNaN(this.b) ? y : y - this.b / 200;
|
|
78
|
+
x = Xn * lab2xyz(x);
|
|
79
|
+
y = Yn * lab2xyz(y);
|
|
80
|
+
z = Zn * lab2xyz(z);
|
|
81
|
+
return new _color.Rgb(lrgb2rgb(3.1338561 * x - 1.6168667 * y - 0.4906146 * z), lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), lrgb2rgb(0.0719453 * x - 0.2289914 * y + 1.4052427 * z), this.opacity);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
}));
|
|
85
|
+
|
|
86
|
+
function xyz2lab(t) {
|
|
87
|
+
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function lab2xyz(t) {
|
|
91
|
+
return t > t1 ? t * t * t : t2 * (t - t0);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function lrgb2rgb(x) {
|
|
95
|
+
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function rgb2lrgb(x) {
|
|
99
|
+
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function hclConvert(o) {
|
|
103
|
+
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
|
|
104
|
+
if (!(o instanceof Lab)) o = labConvert(o);
|
|
105
|
+
if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
|
|
106
|
+
|
|
107
|
+
var h = Math.atan2(o.b, o.a) * _math.degrees;
|
|
108
|
+
|
|
109
|
+
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function lch(l, c, h, opacity) {
|
|
113
|
+
return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function hcl(h, c, l, opacity) {
|
|
117
|
+
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function Hcl(h, c, l, opacity) {
|
|
121
|
+
this.h = +h;
|
|
122
|
+
this.c = +c;
|
|
123
|
+
this.l = +l;
|
|
124
|
+
this.opacity = +opacity;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function hcl2lab(o) {
|
|
128
|
+
if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
|
|
129
|
+
var h = o.h * _math.radians;
|
|
130
|
+
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
(0, _define.default)(Hcl, hcl, (0, _define.extend)(_color.Color, {
|
|
134
|
+
brighter(k) {
|
|
135
|
+
return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
darker(k) {
|
|
139
|
+
return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
rgb() {
|
|
143
|
+
return hcl2lab(this).rgb();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Copyright 2010-2021 Mike Bostock
|
|
2
|
+
Copyright 2001 Robert Penner
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
6
|
+
are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
* Neither the name of the author nor the names of contributors may be used to
|
|
16
|
+
endorse or promote products derived from this software without specific prior
|
|
17
|
+
written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
23
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
24
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
25
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
26
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
28
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.backOut = exports.backInOut = exports.backIn = void 0;
|
|
7
|
+
var overshoot = 1.70158;
|
|
8
|
+
|
|
9
|
+
var backIn = function custom(s) {
|
|
10
|
+
s = +s;
|
|
11
|
+
|
|
12
|
+
function backIn(t) {
|
|
13
|
+
return (t = +t) * t * (s * (t - 1) + t);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
backIn.overshoot = custom;
|
|
17
|
+
return backIn;
|
|
18
|
+
}(overshoot);
|
|
19
|
+
|
|
20
|
+
exports.backIn = backIn;
|
|
21
|
+
|
|
22
|
+
var backOut = function custom(s) {
|
|
23
|
+
s = +s;
|
|
24
|
+
|
|
25
|
+
function backOut(t) {
|
|
26
|
+
return --t * t * ((t + 1) * s + t) + 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
backOut.overshoot = custom;
|
|
30
|
+
return backOut;
|
|
31
|
+
}(overshoot);
|
|
32
|
+
|
|
33
|
+
exports.backOut = backOut;
|
|
34
|
+
|
|
35
|
+
var backInOut = function custom(s) {
|
|
36
|
+
s = +s;
|
|
37
|
+
|
|
38
|
+
function backInOut(t) {
|
|
39
|
+
return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
backInOut.overshoot = custom;
|
|
43
|
+
return backInOut;
|
|
44
|
+
}(overshoot);
|
|
45
|
+
|
|
46
|
+
exports.backInOut = backInOut;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.bounceIn = bounceIn;
|
|
7
|
+
exports.bounceInOut = bounceInOut;
|
|
8
|
+
exports.bounceOut = bounceOut;
|
|
9
|
+
var b1 = 4 / 11,
|
|
10
|
+
b2 = 6 / 11,
|
|
11
|
+
b3 = 8 / 11,
|
|
12
|
+
b4 = 3 / 4,
|
|
13
|
+
b5 = 9 / 11,
|
|
14
|
+
b6 = 10 / 11,
|
|
15
|
+
b7 = 15 / 16,
|
|
16
|
+
b8 = 21 / 22,
|
|
17
|
+
b9 = 63 / 64,
|
|
18
|
+
b0 = 1 / b1 / b1;
|
|
19
|
+
|
|
20
|
+
function bounceIn(t) {
|
|
21
|
+
return 1 - bounceOut(1 - t);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function bounceOut(t) {
|
|
25
|
+
return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function bounceInOut(t) {
|
|
29
|
+
return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.circleIn = circleIn;
|
|
7
|
+
exports.circleInOut = circleInOut;
|
|
8
|
+
exports.circleOut = circleOut;
|
|
9
|
+
|
|
10
|
+
function circleIn(t) {
|
|
11
|
+
return 1 - Math.sqrt(1 - t * t);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function circleOut(t) {
|
|
15
|
+
return Math.sqrt(1 - --t * t);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function circleInOut(t) {
|
|
19
|
+
return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.cubicIn = cubicIn;
|
|
7
|
+
exports.cubicInOut = cubicInOut;
|
|
8
|
+
exports.cubicOut = cubicOut;
|
|
9
|
+
|
|
10
|
+
function cubicIn(t) {
|
|
11
|
+
return t * t * t;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function cubicOut(t) {
|
|
15
|
+
return --t * t * t + 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function cubicInOut(t) {
|
|
19
|
+
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
|
|
20
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.elasticOut = exports.elasticInOut = exports.elasticIn = void 0;
|
|
7
|
+
|
|
8
|
+
var _math = require("./math.js");
|
|
9
|
+
|
|
10
|
+
var tau = 2 * Math.PI,
|
|
11
|
+
amplitude = 1,
|
|
12
|
+
period = 0.3;
|
|
13
|
+
|
|
14
|
+
var elasticIn = function custom(a, p) {
|
|
15
|
+
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
|
|
16
|
+
|
|
17
|
+
function elasticIn(t) {
|
|
18
|
+
return a * (0, _math.tpmt)(- --t) * Math.sin((s - t) / p);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
elasticIn.amplitude = function (a) {
|
|
22
|
+
return custom(a, p * tau);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
elasticIn.period = function (p) {
|
|
26
|
+
return custom(a, p);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return elasticIn;
|
|
30
|
+
}(amplitude, period);
|
|
31
|
+
|
|
32
|
+
exports.elasticIn = elasticIn;
|
|
33
|
+
|
|
34
|
+
var elasticOut = function custom(a, p) {
|
|
35
|
+
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
|
|
36
|
+
|
|
37
|
+
function elasticOut(t) {
|
|
38
|
+
return 1 - a * (0, _math.tpmt)(t = +t) * Math.sin((t + s) / p);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
elasticOut.amplitude = function (a) {
|
|
42
|
+
return custom(a, p * tau);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
elasticOut.period = function (p) {
|
|
46
|
+
return custom(a, p);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return elasticOut;
|
|
50
|
+
}(amplitude, period);
|
|
51
|
+
|
|
52
|
+
exports.elasticOut = elasticOut;
|
|
53
|
+
|
|
54
|
+
var elasticInOut = function custom(a, p) {
|
|
55
|
+
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
|
|
56
|
+
|
|
57
|
+
function elasticInOut(t) {
|
|
58
|
+
return ((t = t * 2 - 1) < 0 ? a * (0, _math.tpmt)(-t) * Math.sin((s - t) / p) : 2 - a * (0, _math.tpmt)(t) * Math.sin((s + t) / p)) / 2;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
elasticInOut.amplitude = function (a) {
|
|
62
|
+
return custom(a, p * tau);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
elasticInOut.period = function (p) {
|
|
66
|
+
return custom(a, p);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return elasticInOut;
|
|
70
|
+
}(amplitude, period);
|
|
71
|
+
|
|
72
|
+
exports.elasticInOut = elasticInOut;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.expIn = expIn;
|
|
7
|
+
exports.expInOut = expInOut;
|
|
8
|
+
exports.expOut = expOut;
|
|
9
|
+
|
|
10
|
+
var _math = require("./math.js");
|
|
11
|
+
|
|
12
|
+
function expIn(t) {
|
|
13
|
+
return (0, _math.tpmt)(1 - +t);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function expOut(t) {
|
|
17
|
+
return 1 - (0, _math.tpmt)(t);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function expInOut(t) {
|
|
21
|
+
return ((t *= 2) <= 1 ? (0, _math.tpmt)(1 - t) : 2 - (0, _math.tpmt)(t - 1)) / 2;
|
|
22
|
+
}
|