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.
Files changed (279) hide show
  1. package/LICENSE.txt +30 -0
  2. package/README.md +70 -0
  3. package/d3-array.js +7 -0
  4. package/d3-ease.js +7 -0
  5. package/d3-interpolate.js +7 -0
  6. package/d3-scale.js +7 -0
  7. package/d3-shape.js +7 -0
  8. package/d3-time.js +7 -0
  9. package/d3-timer.js +7 -0
  10. package/es/d3-array.js +6 -0
  11. package/es/d3-color.js +6 -0
  12. package/es/d3-ease.js +6 -0
  13. package/es/d3-format.js +6 -0
  14. package/es/d3-interpolate.js +6 -0
  15. package/es/d3-path.js +6 -0
  16. package/es/d3-scale.js +6 -0
  17. package/es/d3-shape.js +6 -0
  18. package/es/d3-time-format.js +6 -0
  19. package/es/d3-time.js +6 -0
  20. package/es/d3-timer.js +6 -0
  21. package/es/internmap.js +6 -0
  22. package/lib/d3-array.js +6 -0
  23. package/lib/d3-color.js +6 -0
  24. package/lib/d3-ease.js +6 -0
  25. package/lib/d3-format.js +6 -0
  26. package/lib/d3-interpolate.js +6 -0
  27. package/lib/d3-path.js +6 -0
  28. package/lib/d3-scale.js +6 -0
  29. package/lib/d3-shape.js +6 -0
  30. package/lib/d3-time-format.js +6 -0
  31. package/lib/d3-time.js +6 -0
  32. package/lib/d3-timer.js +6 -0
  33. package/lib/internmap.js +6 -0
  34. package/lib-vendor/d3-array/LICENSE +13 -0
  35. package/lib-vendor/d3-array/src/array.js +11 -0
  36. package/lib-vendor/d3-array/src/ascending.js +10 -0
  37. package/lib-vendor/d3-array/src/bin.js +142 -0
  38. package/lib-vendor/d3-array/src/bisect.js +24 -0
  39. package/lib-vendor/d3-array/src/bisector.js +73 -0
  40. package/lib-vendor/d3-array/src/constant.js +10 -0
  41. package/lib-vendor/d3-array/src/count.js +28 -0
  42. package/lib-vendor/d3-array/src/cross.js +42 -0
  43. package/lib-vendor/d3-array/src/cumsum.js +12 -0
  44. package/lib-vendor/d3-array/src/descending.js +10 -0
  45. package/lib-vendor/d3-array/src/deviation.js +15 -0
  46. package/lib-vendor/d3-array/src/difference.js +20 -0
  47. package/lib-vendor/d3-array/src/disjoint.js +29 -0
  48. package/lib-vendor/d3-array/src/every.js +19 -0
  49. package/lib-vendor/d3-array/src/extent.js +39 -0
  50. package/lib-vendor/d3-array/src/filter.js +20 -0
  51. package/lib-vendor/d3-array/src/fsum.js +93 -0
  52. package/lib-vendor/d3-array/src/greatest.js +38 -0
  53. package/lib-vendor/d3-array/src/greatestIndex.js +30 -0
  54. package/lib-vendor/d3-array/src/group.js +85 -0
  55. package/lib-vendor/d3-array/src/groupSort.js +22 -0
  56. package/lib-vendor/d3-array/src/identity.js +10 -0
  57. package/lib-vendor/d3-array/src/index.js +567 -0
  58. package/lib-vendor/d3-array/src/intersection.js +28 -0
  59. package/lib-vendor/d3-array/src/least.js +38 -0
  60. package/lib-vendor/d3-array/src/leastIndex.js +30 -0
  61. package/lib-vendor/d3-array/src/map.js +12 -0
  62. package/lib-vendor/d3-array/src/max.js +28 -0
  63. package/lib-vendor/d3-array/src/maxIndex.js +30 -0
  64. package/lib-vendor/d3-array/src/mean.js +29 -0
  65. package/lib-vendor/d3-array/src/median.js +14 -0
  66. package/lib-vendor/d3-array/src/merge.js +16 -0
  67. package/lib-vendor/d3-array/src/min.js +28 -0
  68. package/lib-vendor/d3-array/src/minIndex.js +30 -0
  69. package/lib-vendor/d3-array/src/mode.js +40 -0
  70. package/lib-vendor/d3-array/src/nice.js +28 -0
  71. package/lib-vendor/d3-array/src/number.js +29 -0
  72. package/lib-vendor/d3-array/src/pairs.js +25 -0
  73. package/lib-vendor/d3-array/src/permute.js +10 -0
  74. package/lib-vendor/d3-array/src/quantile.js +46 -0
  75. package/lib-vendor/d3-array/src/quickselect.js +53 -0
  76. package/lib-vendor/d3-array/src/range.js +19 -0
  77. package/lib-vendor/d3-array/src/rank.js +34 -0
  78. package/lib-vendor/d3-array/src/reduce.js +32 -0
  79. package/lib-vendor/d3-array/src/reverse.js +11 -0
  80. package/lib-vendor/d3-array/src/scan.js +15 -0
  81. package/lib-vendor/d3-array/src/shuffle.js +26 -0
  82. package/lib-vendor/d3-array/src/some.js +19 -0
  83. package/lib-vendor/d3-array/src/sort.js +55 -0
  84. package/lib-vendor/d3-array/src/subset.js +14 -0
  85. package/lib-vendor/d3-array/src/sum.js +28 -0
  86. package/lib-vendor/d3-array/src/superset.js +33 -0
  87. package/lib-vendor/d3-array/src/threshold/freedmanDiaconis.js +16 -0
  88. package/lib-vendor/d3-array/src/threshold/scott.js +16 -0
  89. package/lib-vendor/d3-array/src/threshold/sturges.js +14 -0
  90. package/lib-vendor/d3-array/src/ticks.js +60 -0
  91. package/lib-vendor/d3-array/src/transpose.js +26 -0
  92. package/lib-vendor/d3-array/src/union.js +20 -0
  93. package/lib-vendor/d3-array/src/variance.js +35 -0
  94. package/lib-vendor/d3-array/src/zip.js +14 -0
  95. package/lib-vendor/d3-color/LICENSE +13 -0
  96. package/lib-vendor/d3-color/src/color.js +413 -0
  97. package/lib-vendor/d3-color/src/cubehelix.js +74 -0
  98. package/lib-vendor/d3-color/src/define.js +20 -0
  99. package/lib-vendor/d3-color/src/index.js +65 -0
  100. package/lib-vendor/d3-color/src/lab.js +146 -0
  101. package/lib-vendor/d3-color/src/math.js +10 -0
  102. package/lib-vendor/d3-ease/LICENSE +28 -0
  103. package/lib-vendor/d3-ease/src/back.js +46 -0
  104. package/lib-vendor/d3-ease/src/bounce.js +30 -0
  105. package/lib-vendor/d3-ease/src/circle.js +20 -0
  106. package/lib-vendor/d3-ease/src/cubic.js +20 -0
  107. package/lib-vendor/d3-ease/src/elastic.js +72 -0
  108. package/lib-vendor/d3-ease/src/exp.js +22 -0
  109. package/lib-vendor/d3-ease/src/index.js +247 -0
  110. package/lib-vendor/d3-ease/src/linear.js +10 -0
  111. package/lib-vendor/d3-ease/src/math.js +11 -0
  112. package/lib-vendor/d3-ease/src/poly.js +46 -0
  113. package/lib-vendor/d3-ease/src/quad.js +20 -0
  114. package/lib-vendor/d3-ease/src/sin.js +22 -0
  115. package/lib-vendor/d3-format/LICENSE +13 -0
  116. package/lib-vendor/d3-format/src/defaultLocale.js +29 -0
  117. package/lib-vendor/d3-format/src/exponent.js +12 -0
  118. package/lib-vendor/d3-format/src/formatDecimal.js +24 -0
  119. package/lib-vendor/d3-format/src/formatGroup.js +25 -0
  120. package/lib-vendor/d3-format/src/formatNumerals.js +14 -0
  121. package/lib-vendor/d3-format/src/formatPrefixAuto.js +22 -0
  122. package/lib-vendor/d3-format/src/formatRounded.js +16 -0
  123. package/lib-vendor/d3-format/src/formatSpecifier.js +45 -0
  124. package/lib-vendor/d3-format/src/formatTrim.js +29 -0
  125. package/lib-vendor/d3-format/src/formatTypes.js +31 -0
  126. package/lib-vendor/d3-format/src/identity.js +10 -0
  127. package/lib-vendor/d3-format/src/index.js +77 -0
  128. package/lib-vendor/d3-format/src/locale.js +159 -0
  129. package/lib-vendor/d3-format/src/precisionFixed.js +14 -0
  130. package/lib-vendor/d3-format/src/precisionPrefix.js +14 -0
  131. package/lib-vendor/d3-format/src/precisionRound.js +15 -0
  132. package/lib-vendor/d3-interpolate/LICENSE +13 -0
  133. package/lib-vendor/d3-interpolate/src/array.js +39 -0
  134. package/lib-vendor/d3-interpolate/src/basis.js +25 -0
  135. package/lib-vendor/d3-interpolate/src/basisClosed.js +20 -0
  136. package/lib-vendor/d3-interpolate/src/color.js +40 -0
  137. package/lib-vendor/d3-interpolate/src/constant.js +10 -0
  138. package/lib-vendor/d3-interpolate/src/cubehelix.js +43 -0
  139. package/lib-vendor/d3-interpolate/src/date.js +13 -0
  140. package/lib-vendor/d3-interpolate/src/discrete.js +13 -0
  141. package/lib-vendor/d3-interpolate/src/hcl.js +36 -0
  142. package/lib-vendor/d3-interpolate/src/hsl.js +36 -0
  143. package/lib-vendor/d3-interpolate/src/hue.js +16 -0
  144. package/lib-vendor/d3-interpolate/src/index.js +215 -0
  145. package/lib-vendor/d3-interpolate/src/lab.js +26 -0
  146. package/lib-vendor/d3-interpolate/src/number.js +12 -0
  147. package/lib-vendor/d3-interpolate/src/numberArray.js +23 -0
  148. package/lib-vendor/d3-interpolate/src/object.js +32 -0
  149. package/lib-vendor/d3-interpolate/src/piecewise.js +25 -0
  150. package/lib-vendor/d3-interpolate/src/quantize.js +14 -0
  151. package/lib-vendor/d3-interpolate/src/rgb.js +77 -0
  152. package/lib-vendor/d3-interpolate/src/round.js +12 -0
  153. package/lib-vendor/d3-interpolate/src/string.js +83 -0
  154. package/lib-vendor/d3-interpolate/src/transform/decompose.js +33 -0
  155. package/lib-vendor/d3-interpolate/src/transform/index.js +100 -0
  156. package/lib-vendor/d3-interpolate/src/transform/parse.js +30 -0
  157. package/lib-vendor/d3-interpolate/src/value.js +36 -0
  158. package/lib-vendor/d3-interpolate/src/zoom.js +75 -0
  159. package/lib-vendor/d3-path/LICENSE +13 -0
  160. package/lib-vendor/d3-path/src/index.js +15 -0
  161. package/lib-vendor/d3-path/src/path.js +120 -0
  162. package/lib-vendor/d3-scale/LICENSE +13 -0
  163. package/lib-vendor/d3-scale/src/band.js +109 -0
  164. package/lib-vendor/d3-scale/src/colors.js +12 -0
  165. package/lib-vendor/d3-scale/src/constant.js +12 -0
  166. package/lib-vendor/d3-scale/src/continuous.js +140 -0
  167. package/lib-vendor/d3-scale/src/diverging.js +121 -0
  168. package/lib-vendor/d3-scale/src/identity.js +37 -0
  169. package/lib-vendor/d3-scale/src/index.js +213 -0
  170. package/lib-vendor/d3-scale/src/init.js +46 -0
  171. package/lib-vendor/d3-scale/src/linear.js +88 -0
  172. package/lib-vendor/d3-scale/src/log.js +156 -0
  173. package/lib-vendor/d3-scale/src/nice.js +24 -0
  174. package/lib-vendor/d3-scale/src/number.js +10 -0
  175. package/lib-vendor/d3-scale/src/ordinal.js +60 -0
  176. package/lib-vendor/d3-scale/src/pow.js +59 -0
  177. package/lib-vendor/d3-scale/src/quantile.js +64 -0
  178. package/lib-vendor/d3-scale/src/quantize.js +61 -0
  179. package/lib-vendor/d3-scale/src/radial.js +72 -0
  180. package/lib-vendor/d3-scale/src/sequential.js +120 -0
  181. package/lib-vendor/d3-scale/src/sequentialQuantile.js +51 -0
  182. package/lib-vendor/d3-scale/src/symlog.js +46 -0
  183. package/lib-vendor/d3-scale/src/threshold.js +44 -0
  184. package/lib-vendor/d3-scale/src/tickFormat.js +44 -0
  185. package/lib-vendor/d3-scale/src/time.js +82 -0
  186. package/lib-vendor/d3-scale/src/utcTime.js +18 -0
  187. package/lib-vendor/d3-shape/LICENSE +13 -0
  188. package/lib-vendor/d3-shape/src/arc.js +243 -0
  189. package/lib-vendor/d3-shape/src/area.js +125 -0
  190. package/lib-vendor/d3-shape/src/areaRadial.js +51 -0
  191. package/lib-vendor/d3-shape/src/array.js +14 -0
  192. package/lib-vendor/d3-shape/src/constant.js +12 -0
  193. package/lib-vendor/d3-shape/src/curve/basis.js +76 -0
  194. package/lib-vendor/d3-shape/src/curve/basisClosed.js +90 -0
  195. package/lib-vendor/d3-shape/src/curve/basisOpen.js +64 -0
  196. package/lib-vendor/d3-shape/src/curve/bump.js +104 -0
  197. package/lib-vendor/d3-shape/src/curve/bundle.js +65 -0
  198. package/lib-vendor/d3-shape/src/curve/cardinal.js +85 -0
  199. package/lib-vendor/d3-shape/src/curve/cardinalClosed.js +99 -0
  200. package/lib-vendor/d3-shape/src/curve/cardinalOpen.js +74 -0
  201. package/lib-vendor/d3-shape/src/curve/catmullRom.js +114 -0
  202. package/lib-vendor/d3-shape/src/curve/catmullRomClosed.js +108 -0
  203. package/lib-vendor/d3-shape/src/curve/catmullRomOpen.js +83 -0
  204. package/lib-vendor/d3-shape/src/curve/linear.js +49 -0
  205. package/lib-vendor/d3-shape/src/curve/linearClosed.js +33 -0
  206. package/lib-vendor/d3-shape/src/curve/monotone.js +139 -0
  207. package/lib-vendor/d3-shape/src/curve/natural.js +82 -0
  208. package/lib-vendor/d3-shape/src/curve/radial.js +45 -0
  209. package/lib-vendor/d3-shape/src/curve/step.js +76 -0
  210. package/lib-vendor/d3-shape/src/descending.js +10 -0
  211. package/lib-vendor/d3-shape/src/identity.js +10 -0
  212. package/lib-vendor/d3-shape/src/index.js +483 -0
  213. package/lib-vendor/d3-shape/src/line.js +68 -0
  214. package/lib-vendor/d3-shape/src/lineRadial.js +33 -0
  215. package/lib-vendor/d3-shape/src/link.js +90 -0
  216. package/lib-vendor/d3-shape/src/math.js +39 -0
  217. package/lib-vendor/d3-shape/src/noop.js +8 -0
  218. package/lib-vendor/d3-shape/src/offset/diverging.js +22 -0
  219. package/lib-vendor/d3-shape/src/offset/expand.js +22 -0
  220. package/lib-vendor/d3-shape/src/offset/none.js +18 -0
  221. package/lib-vendor/d3-shape/src/offset/silhouette.js +22 -0
  222. package/lib-vendor/d3-shape/src/offset/wiggle.js +38 -0
  223. package/lib-vendor/d3-shape/src/order/appearance.js +29 -0
  224. package/lib-vendor/d3-shape/src/order/ascending.js +29 -0
  225. package/lib-vendor/d3-shape/src/order/descending.js +14 -0
  226. package/lib-vendor/d3-shape/src/order/insideOut.js +38 -0
  227. package/lib-vendor/d3-shape/src/order/none.js +15 -0
  228. package/lib-vendor/d3-shape/src/order/reverse.js +14 -0
  229. package/lib-vendor/d3-shape/src/pie.js +95 -0
  230. package/lib-vendor/d3-shape/src/point.js +15 -0
  231. package/lib-vendor/d3-shape/src/pointRadial.js +10 -0
  232. package/lib-vendor/d3-shape/src/stack.js +72 -0
  233. package/lib-vendor/d3-shape/src/symbol/asterisk.js +25 -0
  234. package/lib-vendor/d3-shape/src/symbol/circle.js +18 -0
  235. package/lib-vendor/d3-shape/src/symbol/cross.js +29 -0
  236. package/lib-vendor/d3-shape/src/symbol/diamond.js +24 -0
  237. package/lib-vendor/d3-shape/src/symbol/diamond2.js +21 -0
  238. package/lib-vendor/d3-shape/src/symbol/plus.js +20 -0
  239. package/lib-vendor/d3-shape/src/symbol/square.js +18 -0
  240. package/lib-vendor/d3-shape/src/symbol/square2.js +21 -0
  241. package/lib-vendor/d3-shape/src/symbol/star.js +34 -0
  242. package/lib-vendor/d3-shape/src/symbol/triangle.js +21 -0
  243. package/lib-vendor/d3-shape/src/symbol/triangle2.js +24 -0
  244. package/lib-vendor/d3-shape/src/symbol/wye.js +36 -0
  245. package/lib-vendor/d3-shape/src/symbol/x.js +20 -0
  246. package/lib-vendor/d3-shape/src/symbol.js +73 -0
  247. package/lib-vendor/d3-time/LICENSE +13 -0
  248. package/lib-vendor/d3-time/src/day.js +18 -0
  249. package/lib-vendor/d3-time/src/duration.js +20 -0
  250. package/lib-vendor/d3-time/src/hour.js +26 -0
  251. package/lib-vendor/d3-time/src/index.js +433 -0
  252. package/lib-vendor/d3-time/src/interval.js +79 -0
  253. package/lib-vendor/d3-time/src/millisecond.js +35 -0
  254. package/lib-vendor/d3-time/src/minute.js +26 -0
  255. package/lib-vendor/d3-time/src/month.js +25 -0
  256. package/lib-vendor/d3-time/src/second.js +26 -0
  257. package/lib-vendor/d3-time/src/ticks.js +71 -0
  258. package/lib-vendor/d3-time/src/utcDay.js +26 -0
  259. package/lib-vendor/d3-time/src/utcHour.js +26 -0
  260. package/lib-vendor/d3-time/src/utcMinute.js +26 -0
  261. package/lib-vendor/d3-time/src/utcMonth.js +25 -0
  262. package/lib-vendor/d3-time/src/utcWeek.js +52 -0
  263. package/lib-vendor/d3-time/src/utcYear.js +36 -0
  264. package/lib-vendor/d3-time/src/week.js +52 -0
  265. package/lib-vendor/d3-time/src/year.js +36 -0
  266. package/lib-vendor/d3-time-format/LICENSE +13 -0
  267. package/lib-vendor/d3-time-format/src/defaultLocale.js +40 -0
  268. package/lib-vendor/d3-time-format/src/index.js +67 -0
  269. package/lib-vendor/d3-time-format/src/isoFormat.js +19 -0
  270. package/lib-vendor/d3-time-format/src/isoParse.js +19 -0
  271. package/lib-vendor/d3-time-format/src/locale.js +713 -0
  272. package/lib-vendor/d3-timer/LICENSE +13 -0
  273. package/lib-vendor/d3-timer/src/index.js +43 -0
  274. package/lib-vendor/d3-timer/src/interval.js +30 -0
  275. package/lib-vendor/d3-timer/src/timeout.js +18 -0
  276. package/lib-vendor/d3-timer/src/timer.js +138 -0
  277. package/lib-vendor/internmap/LICENSE +13 -0
  278. package/lib-vendor/internmap/src/index.js +111 -0
  279. package/package.json +43 -0
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.bumpRadial = bumpRadial;
7
+ exports.bumpX = bumpX;
8
+ exports.bumpY = bumpY;
9
+
10
+ var _pointRadial = _interopRequireDefault(require("../pointRadial.js"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ class Bump {
15
+ constructor(context, x) {
16
+ this._context = context;
17
+ this._x = x;
18
+ }
19
+
20
+ areaStart() {
21
+ this._line = 0;
22
+ }
23
+
24
+ areaEnd() {
25
+ this._line = NaN;
26
+ }
27
+
28
+ lineStart() {
29
+ this._point = 0;
30
+ }
31
+
32
+ lineEnd() {
33
+ if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
34
+ this._line = 1 - this._line;
35
+ }
36
+
37
+ point(x, y) {
38
+ x = +x, y = +y;
39
+
40
+ switch (this._point) {
41
+ case 0:
42
+ {
43
+ this._point = 1;
44
+ if (this._line) this._context.lineTo(x, y);else this._context.moveTo(x, y);
45
+ break;
46
+ }
47
+
48
+ case 1:
49
+ this._point = 2;
50
+ // falls through
51
+
52
+ default:
53
+ {
54
+ if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);
55
+ break;
56
+ }
57
+ }
58
+
59
+ this._x0 = x, this._y0 = y;
60
+ }
61
+
62
+ }
63
+
64
+ class BumpRadial {
65
+ constructor(context) {
66
+ this._context = context;
67
+ }
68
+
69
+ lineStart() {
70
+ this._point = 0;
71
+ }
72
+
73
+ lineEnd() {}
74
+
75
+ point(x, y) {
76
+ x = +x, y = +y;
77
+
78
+ if (this._point++ === 0) {
79
+ this._x0 = x, this._y0 = y;
80
+ } else {
81
+ const p0 = (0, _pointRadial.default)(this._x0, this._y0);
82
+ const p1 = (0, _pointRadial.default)(this._x0, this._y0 = (this._y0 + y) / 2);
83
+ const p2 = (0, _pointRadial.default)(x, this._y0);
84
+ const p3 = (0, _pointRadial.default)(x, y);
85
+
86
+ this._context.moveTo(...p0);
87
+
88
+ this._context.bezierCurveTo(...p1, ...p2, ...p3);
89
+ }
90
+ }
91
+
92
+ }
93
+
94
+ function bumpX(context) {
95
+ return new Bump(context, true);
96
+ }
97
+
98
+ function bumpY(context) {
99
+ return new Bump(context, false);
100
+ }
101
+
102
+ function bumpRadial(context) {
103
+ return new BumpRadial(context);
104
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _basis = require("./basis.js");
9
+
10
+ function Bundle(context, beta) {
11
+ this._basis = new _basis.Basis(context);
12
+ this._beta = beta;
13
+ }
14
+
15
+ Bundle.prototype = {
16
+ lineStart: function () {
17
+ this._x = [];
18
+ this._y = [];
19
+
20
+ this._basis.lineStart();
21
+ },
22
+ lineEnd: function () {
23
+ var x = this._x,
24
+ y = this._y,
25
+ j = x.length - 1;
26
+
27
+ if (j > 0) {
28
+ var x0 = x[0],
29
+ y0 = y[0],
30
+ dx = x[j] - x0,
31
+ dy = y[j] - y0,
32
+ i = -1,
33
+ t;
34
+
35
+ while (++i <= j) {
36
+ t = i / j;
37
+
38
+ this._basis.point(this._beta * x[i] + (1 - this._beta) * (x0 + t * dx), this._beta * y[i] + (1 - this._beta) * (y0 + t * dy));
39
+ }
40
+ }
41
+
42
+ this._x = this._y = null;
43
+
44
+ this._basis.lineEnd();
45
+ },
46
+ point: function (x, y) {
47
+ this._x.push(+x);
48
+
49
+ this._y.push(+y);
50
+ }
51
+ };
52
+
53
+ var _default = function custom(beta) {
54
+ function bundle(context) {
55
+ return beta === 1 ? new _basis.Basis(context) : new Bundle(context, beta);
56
+ }
57
+
58
+ bundle.beta = function (beta) {
59
+ return custom(+beta);
60
+ };
61
+
62
+ return bundle;
63
+ }(0.85);
64
+
65
+ exports.default = _default;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Cardinal = Cardinal;
7
+ exports.default = void 0;
8
+ exports.point = point;
9
+
10
+ function point(that, x, y) {
11
+ that._context.bezierCurveTo(that._x1 + that._k * (that._x2 - that._x0), that._y1 + that._k * (that._y2 - that._y0), that._x2 + that._k * (that._x1 - x), that._y2 + that._k * (that._y1 - y), that._x2, that._y2);
12
+ }
13
+
14
+ function Cardinal(context, tension) {
15
+ this._context = context;
16
+ this._k = (1 - tension) / 6;
17
+ }
18
+
19
+ Cardinal.prototype = {
20
+ areaStart: function () {
21
+ this._line = 0;
22
+ },
23
+ areaEnd: function () {
24
+ this._line = NaN;
25
+ },
26
+ lineStart: function () {
27
+ this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
28
+ this._point = 0;
29
+ },
30
+ lineEnd: function () {
31
+ switch (this._point) {
32
+ case 2:
33
+ this._context.lineTo(this._x2, this._y2);
34
+
35
+ break;
36
+
37
+ case 3:
38
+ point(this, this._x1, this._y1);
39
+ break;
40
+ }
41
+
42
+ if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
43
+ this._line = 1 - this._line;
44
+ },
45
+ point: function (x, y) {
46
+ x = +x, y = +y;
47
+
48
+ switch (this._point) {
49
+ case 0:
50
+ this._point = 1;
51
+ this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
52
+ break;
53
+
54
+ case 1:
55
+ this._point = 2;
56
+ this._x1 = x, this._y1 = y;
57
+ break;
58
+
59
+ case 2:
60
+ this._point = 3;
61
+ // falls through
62
+
63
+ default:
64
+ point(this, x, y);
65
+ break;
66
+ }
67
+
68
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
69
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
70
+ }
71
+ };
72
+
73
+ var _default = function custom(tension) {
74
+ function cardinal(context) {
75
+ return new Cardinal(context, tension);
76
+ }
77
+
78
+ cardinal.tension = function (tension) {
79
+ return custom(+tension);
80
+ };
81
+
82
+ return cardinal;
83
+ }(0);
84
+
85
+ exports.default = _default;
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CardinalClosed = CardinalClosed;
7
+ exports.default = void 0;
8
+
9
+ var _noop = _interopRequireDefault(require("../noop.js"));
10
+
11
+ var _cardinal = require("./cardinal.js");
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+
15
+ function CardinalClosed(context, tension) {
16
+ this._context = context;
17
+ this._k = (1 - tension) / 6;
18
+ }
19
+
20
+ CardinalClosed.prototype = {
21
+ areaStart: _noop.default,
22
+ areaEnd: _noop.default,
23
+ lineStart: function () {
24
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
25
+ this._point = 0;
26
+ },
27
+ lineEnd: function () {
28
+ switch (this._point) {
29
+ case 1:
30
+ {
31
+ this._context.moveTo(this._x3, this._y3);
32
+
33
+ this._context.closePath();
34
+
35
+ break;
36
+ }
37
+
38
+ case 2:
39
+ {
40
+ this._context.lineTo(this._x3, this._y3);
41
+
42
+ this._context.closePath();
43
+
44
+ break;
45
+ }
46
+
47
+ case 3:
48
+ {
49
+ this.point(this._x3, this._y3);
50
+ this.point(this._x4, this._y4);
51
+ this.point(this._x5, this._y5);
52
+ break;
53
+ }
54
+ }
55
+ },
56
+ point: function (x, y) {
57
+ x = +x, y = +y;
58
+
59
+ switch (this._point) {
60
+ case 0:
61
+ this._point = 1;
62
+ this._x3 = x, this._y3 = y;
63
+ break;
64
+
65
+ case 1:
66
+ this._point = 2;
67
+
68
+ this._context.moveTo(this._x4 = x, this._y4 = y);
69
+
70
+ break;
71
+
72
+ case 2:
73
+ this._point = 3;
74
+ this._x5 = x, this._y5 = y;
75
+ break;
76
+
77
+ default:
78
+ (0, _cardinal.point)(this, x, y);
79
+ break;
80
+ }
81
+
82
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
83
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
84
+ }
85
+ };
86
+
87
+ var _default = function custom(tension) {
88
+ function cardinal(context) {
89
+ return new CardinalClosed(context, tension);
90
+ }
91
+
92
+ cardinal.tension = function (tension) {
93
+ return custom(+tension);
94
+ };
95
+
96
+ return cardinal;
97
+ }(0);
98
+
99
+ exports.default = _default;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CardinalOpen = CardinalOpen;
7
+ exports.default = void 0;
8
+
9
+ var _cardinal = require("./cardinal.js");
10
+
11
+ function CardinalOpen(context, tension) {
12
+ this._context = context;
13
+ this._k = (1 - tension) / 6;
14
+ }
15
+
16
+ CardinalOpen.prototype = {
17
+ areaStart: function () {
18
+ this._line = 0;
19
+ },
20
+ areaEnd: function () {
21
+ this._line = NaN;
22
+ },
23
+ lineStart: function () {
24
+ this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
25
+ this._point = 0;
26
+ },
27
+ lineEnd: function () {
28
+ if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
29
+ this._line = 1 - this._line;
30
+ },
31
+ point: function (x, y) {
32
+ x = +x, y = +y;
33
+
34
+ switch (this._point) {
35
+ case 0:
36
+ this._point = 1;
37
+ break;
38
+
39
+ case 1:
40
+ this._point = 2;
41
+ break;
42
+
43
+ case 2:
44
+ this._point = 3;
45
+ this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
46
+ break;
47
+
48
+ case 3:
49
+ this._point = 4;
50
+ // falls through
51
+
52
+ default:
53
+ (0, _cardinal.point)(this, x, y);
54
+ break;
55
+ }
56
+
57
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
58
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
59
+ }
60
+ };
61
+
62
+ var _default = function custom(tension) {
63
+ function cardinal(context) {
64
+ return new CardinalOpen(context, tension);
65
+ }
66
+
67
+ cardinal.tension = function (tension) {
68
+ return custom(+tension);
69
+ };
70
+
71
+ return cardinal;
72
+ }(0);
73
+
74
+ exports.default = _default;
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ exports.point = point;
8
+
9
+ var _math = require("../math.js");
10
+
11
+ var _cardinal = require("./cardinal.js");
12
+
13
+ function point(that, x, y) {
14
+ var x1 = that._x1,
15
+ y1 = that._y1,
16
+ x2 = that._x2,
17
+ y2 = that._y2;
18
+
19
+ if (that._l01_a > _math.epsilon) {
20
+ var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,
21
+ n = 3 * that._l01_a * (that._l01_a + that._l12_a);
22
+ x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;
23
+ y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;
24
+ }
25
+
26
+ if (that._l23_a > _math.epsilon) {
27
+ var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,
28
+ m = 3 * that._l23_a * (that._l23_a + that._l12_a);
29
+ x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;
30
+ y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;
31
+ }
32
+
33
+ that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);
34
+ }
35
+
36
+ function CatmullRom(context, alpha) {
37
+ this._context = context;
38
+ this._alpha = alpha;
39
+ }
40
+
41
+ CatmullRom.prototype = {
42
+ areaStart: function () {
43
+ this._line = 0;
44
+ },
45
+ areaEnd: function () {
46
+ this._line = NaN;
47
+ },
48
+ lineStart: function () {
49
+ this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
50
+ this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
51
+ },
52
+ lineEnd: function () {
53
+ switch (this._point) {
54
+ case 2:
55
+ this._context.lineTo(this._x2, this._y2);
56
+
57
+ break;
58
+
59
+ case 3:
60
+ this.point(this._x2, this._y2);
61
+ break;
62
+ }
63
+
64
+ if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
65
+ this._line = 1 - this._line;
66
+ },
67
+ point: function (x, y) {
68
+ x = +x, y = +y;
69
+
70
+ if (this._point) {
71
+ var x23 = this._x2 - x,
72
+ y23 = this._y2 - y;
73
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
74
+ }
75
+
76
+ switch (this._point) {
77
+ case 0:
78
+ this._point = 1;
79
+ this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
80
+ break;
81
+
82
+ case 1:
83
+ this._point = 2;
84
+ break;
85
+
86
+ case 2:
87
+ this._point = 3;
88
+ // falls through
89
+
90
+ default:
91
+ point(this, x, y);
92
+ break;
93
+ }
94
+
95
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
96
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
97
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
98
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
99
+ }
100
+ };
101
+
102
+ var _default = function custom(alpha) {
103
+ function catmullRom(context) {
104
+ return alpha ? new CatmullRom(context, alpha) : new _cardinal.Cardinal(context, 0);
105
+ }
106
+
107
+ catmullRom.alpha = function (alpha) {
108
+ return custom(+alpha);
109
+ };
110
+
111
+ return catmullRom;
112
+ }(0.5);
113
+
114
+ exports.default = _default;
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _cardinalClosed = require("./cardinalClosed.js");
9
+
10
+ var _noop = _interopRequireDefault(require("../noop.js"));
11
+
12
+ var _catmullRom = require("./catmullRom.js");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ function CatmullRomClosed(context, alpha) {
17
+ this._context = context;
18
+ this._alpha = alpha;
19
+ }
20
+
21
+ CatmullRomClosed.prototype = {
22
+ areaStart: _noop.default,
23
+ areaEnd: _noop.default,
24
+ lineStart: function () {
25
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
26
+ this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
27
+ },
28
+ lineEnd: function () {
29
+ switch (this._point) {
30
+ case 1:
31
+ {
32
+ this._context.moveTo(this._x3, this._y3);
33
+
34
+ this._context.closePath();
35
+
36
+ break;
37
+ }
38
+
39
+ case 2:
40
+ {
41
+ this._context.lineTo(this._x3, this._y3);
42
+
43
+ this._context.closePath();
44
+
45
+ break;
46
+ }
47
+
48
+ case 3:
49
+ {
50
+ this.point(this._x3, this._y3);
51
+ this.point(this._x4, this._y4);
52
+ this.point(this._x5, this._y5);
53
+ break;
54
+ }
55
+ }
56
+ },
57
+ point: function (x, y) {
58
+ x = +x, y = +y;
59
+
60
+ if (this._point) {
61
+ var x23 = this._x2 - x,
62
+ y23 = this._y2 - y;
63
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
64
+ }
65
+
66
+ switch (this._point) {
67
+ case 0:
68
+ this._point = 1;
69
+ this._x3 = x, this._y3 = y;
70
+ break;
71
+
72
+ case 1:
73
+ this._point = 2;
74
+
75
+ this._context.moveTo(this._x4 = x, this._y4 = y);
76
+
77
+ break;
78
+
79
+ case 2:
80
+ this._point = 3;
81
+ this._x5 = x, this._y5 = y;
82
+ break;
83
+
84
+ default:
85
+ (0, _catmullRom.point)(this, x, y);
86
+ break;
87
+ }
88
+
89
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
90
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
91
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
92
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
93
+ }
94
+ };
95
+
96
+ var _default = function custom(alpha) {
97
+ function catmullRom(context) {
98
+ return alpha ? new CatmullRomClosed(context, alpha) : new _cardinalClosed.CardinalClosed(context, 0);
99
+ }
100
+
101
+ catmullRom.alpha = function (alpha) {
102
+ return custom(+alpha);
103
+ };
104
+
105
+ return catmullRom;
106
+ }(0.5);
107
+
108
+ exports.default = _default;