victory-vendor 36.9.2 → 37.0.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 (245) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib-vendor/d3-array/src/array.js +2 -4
  3. package/lib-vendor/d3-array/src/ascending.js +0 -1
  4. package/lib-vendor/d3-array/src/bin.js +25 -45
  5. package/lib-vendor/d3-array/src/bisect.js +4 -13
  6. package/lib-vendor/d3-array/src/bisector.js +3 -17
  7. package/lib-vendor/d3-array/src/constant.js +0 -1
  8. package/lib-vendor/d3-array/src/count.js +0 -4
  9. package/lib-vendor/d3-array/src/cross.js +0 -7
  10. package/lib-vendor/d3-array/src/cumsum.js +1 -2
  11. package/lib-vendor/d3-array/src/descending.js +0 -1
  12. package/lib-vendor/d3-array/src/deviation.js +0 -3
  13. package/lib-vendor/d3-array/src/difference.js +0 -4
  14. package/lib-vendor/d3-array/src/disjoint.js +1 -6
  15. package/lib-vendor/d3-array/src/every.js +0 -3
  16. package/lib-vendor/d3-array/src/extent.js +0 -4
  17. package/lib-vendor/d3-array/src/filter.js +0 -3
  18. package/lib-vendor/d3-array/src/fsum.js +6 -22
  19. package/lib-vendor/d3-array/src/greatest.js +0 -7
  20. package/lib-vendor/d3-array/src/greatestIndex.js +0 -7
  21. package/lib-vendor/d3-array/src/group.js +0 -18
  22. package/lib-vendor/d3-array/src/groupSort.js +2 -9
  23. package/lib-vendor/d3-array/src/identity.js +0 -1
  24. package/lib-vendor/d3-array/src/index.js +2 -61
  25. package/lib-vendor/d3-array/src/intersection.js +0 -5
  26. package/lib-vendor/d3-array/src/least.js +0 -7
  27. package/lib-vendor/d3-array/src/leastIndex.js +0 -7
  28. package/lib-vendor/d3-array/src/map.js +0 -1
  29. package/lib-vendor/d3-array/src/max.js +0 -4
  30. package/lib-vendor/d3-array/src/maxIndex.js +0 -4
  31. package/lib-vendor/d3-array/src/mean.js +0 -4
  32. package/lib-vendor/d3-array/src/median.js +0 -3
  33. package/lib-vendor/d3-array/src/merge.js +0 -2
  34. package/lib-vendor/d3-array/src/min.js +0 -4
  35. package/lib-vendor/d3-array/src/minIndex.js +0 -4
  36. package/lib-vendor/d3-array/src/mode.js +0 -7
  37. package/lib-vendor/d3-array/src/nice.js +0 -5
  38. package/lib-vendor/d3-array/src/number.js +0 -3
  39. package/lib-vendor/d3-array/src/pairs.js +0 -4
  40. package/lib-vendor/d3-array/src/permute.js +0 -1
  41. package/lib-vendor/d3-array/src/quantile.js +10 -19
  42. package/lib-vendor/d3-array/src/quickselect.js +0 -10
  43. package/lib-vendor/d3-array/src/range.js +2 -5
  44. package/lib-vendor/d3-array/src/rank.js +0 -7
  45. package/lib-vendor/d3-array/src/reduce.js +2 -6
  46. package/lib-vendor/d3-array/src/reverse.js +0 -1
  47. package/lib-vendor/d3-array/src/scan.js +0 -3
  48. package/lib-vendor/d3-array/src/shuffle.js +2 -8
  49. package/lib-vendor/d3-array/src/some.js +0 -3
  50. package/lib-vendor/d3-array/src/sort.js +0 -10
  51. package/lib-vendor/d3-array/src/subset.js +0 -3
  52. package/lib-vendor/d3-array/src/sum.js +0 -4
  53. package/lib-vendor/d3-array/src/superset.js +1 -6
  54. package/lib-vendor/d3-array/src/threshold/freedmanDiaconis.js +0 -4
  55. package/lib-vendor/d3-array/src/threshold/scott.js +0 -4
  56. package/lib-vendor/d3-array/src/threshold/sturges.js +0 -3
  57. package/lib-vendor/d3-array/src/ticks.js +12 -19
  58. package/lib-vendor/d3-array/src/transpose.js +0 -6
  59. package/lib-vendor/d3-array/src/union.js +0 -4
  60. package/lib-vendor/d3-array/src/variance.js +0 -4
  61. package/lib-vendor/d3-array/src/zip.js +0 -3
  62. package/lib-vendor/d3-color/src/color.js +25 -72
  63. package/lib-vendor/d3-color/src/cubehelix.js +21 -34
  64. package/lib-vendor/d3-color/src/define.js +0 -4
  65. package/lib-vendor/d3-color/src/index.js +2 -8
  66. package/lib-vendor/d3-color/src/lab.js +16 -45
  67. package/lib-vendor/d3-color/src/math.js +2 -4
  68. package/lib-vendor/d3-ease/src/back.js +4 -19
  69. package/lib-vendor/d3-ease/src/bounce.js +9 -12
  70. package/lib-vendor/d3-ease/src/circle.js +0 -3
  71. package/lib-vendor/d3-ease/src/cubic.js +0 -3
  72. package/lib-vendor/d3-ease/src/elastic.js +6 -29
  73. package/lib-vendor/d3-ease/src/exp.js +0 -4
  74. package/lib-vendor/d3-ease/src/index.js +0 -10
  75. package/lib-vendor/d3-ease/src/linear.js +0 -2
  76. package/lib-vendor/d3-ease/src/math.js +0 -1
  77. package/lib-vendor/d3-ease/src/poly.js +4 -19
  78. package/lib-vendor/d3-ease/src/quad.js +0 -3
  79. package/lib-vendor/d3-ease/src/sin.js +1 -4
  80. package/lib-vendor/d3-format/src/defaultLocale.js +0 -6
  81. package/lib-vendor/d3-format/src/exponent.js +0 -2
  82. package/lib-vendor/d3-format/src/formatDecimal.js +6 -7
  83. package/lib-vendor/d3-format/src/formatGroup.js +4 -7
  84. package/lib-vendor/d3-format/src/formatNumerals.js +0 -1
  85. package/lib-vendor/d3-format/src/formatPrefixAuto.js +3 -7
  86. package/lib-vendor/d3-format/src/formatRounded.js +1 -3
  87. package/lib-vendor/d3-format/src/formatSpecifier.js +0 -3
  88. package/lib-vendor/d3-format/src/formatTrim.js +0 -4
  89. package/lib-vendor/d3-format/src/formatTypes.js +2 -8
  90. package/lib-vendor/d3-format/src/identity.js +0 -1
  91. package/lib-vendor/d3-format/src/index.js +2 -11
  92. package/lib-vendor/d3-format/src/locale.js +62 -69
  93. package/lib-vendor/d3-format/src/precisionFixed.js +0 -3
  94. package/lib-vendor/d3-format/src/precisionPrefix.js +0 -3
  95. package/lib-vendor/d3-format/src/precisionRound.js +0 -3
  96. package/lib-vendor/d3-interpolate/src/array.js +6 -17
  97. package/lib-vendor/d3-interpolate/src/basis.js +5 -7
  98. package/lib-vendor/d3-interpolate/src/basisClosed.js +4 -6
  99. package/lib-vendor/d3-interpolate/src/color.js +0 -7
  100. package/lib-vendor/d3-interpolate/src/constant.js +0 -2
  101. package/lib-vendor/d3-interpolate/src/cubehelix.js +7 -18
  102. package/lib-vendor/d3-interpolate/src/date.js +0 -1
  103. package/lib-vendor/d3-interpolate/src/discrete.js +0 -1
  104. package/lib-vendor/d3-interpolate/src/hcl.js +7 -16
  105. package/lib-vendor/d3-interpolate/src/hsl.js +7 -16
  106. package/lib-vendor/d3-interpolate/src/hue.js +0 -2
  107. package/lib-vendor/d3-interpolate/src/index.js +2 -26
  108. package/lib-vendor/d3-interpolate/src/lab.js +3 -7
  109. package/lib-vendor/d3-interpolate/src/number.js +0 -1
  110. package/lib-vendor/d3-interpolate/src/numberArray.js +2 -5
  111. package/lib-vendor/d3-interpolate/src/object.js +2 -8
  112. package/lib-vendor/d3-interpolate/src/piecewise.js +3 -8
  113. package/lib-vendor/d3-interpolate/src/quantize.js +0 -3
  114. package/lib-vendor/d3-interpolate/src/rgb.js +13 -31
  115. package/lib-vendor/d3-interpolate/src/round.js +0 -1
  116. package/lib-vendor/d3-interpolate/src/string.js +21 -29
  117. package/lib-vendor/d3-interpolate/src/transform/decompose.js +1 -3
  118. package/lib-vendor/d3-interpolate/src/transform/index.js +6 -23
  119. package/lib-vendor/d3-interpolate/src/transform/parse.js +3 -8
  120. package/lib-vendor/d3-interpolate/src/value.js +3 -16
  121. package/lib-vendor/d3-interpolate/src/zoom.js +24 -33
  122. package/lib-vendor/d3-path/src/index.js +0 -2
  123. package/lib-vendor/d3-path/src/path.js +53 -41
  124. package/lib-vendor/d3-scale/src/band.js +13 -35
  125. package/lib-vendor/d3-scale/src/colors.js +0 -1
  126. package/lib-vendor/d3-scale/src/constant.js +0 -1
  127. package/lib-vendor/d3-scale/src/continuous.js +19 -43
  128. package/lib-vendor/d3-scale/src/diverging.js +12 -42
  129. package/lib-vendor/d3-scale/src/identity.js +0 -10
  130. package/lib-vendor/d3-scale/src/index.js +2 -22
  131. package/lib-vendor/d3-scale/src/init.js +0 -8
  132. package/lib-vendor/d3-scale/src/linear.js +2 -23
  133. package/lib-vendor/d3-scale/src/log.js +0 -33
  134. package/lib-vendor/d3-scale/src/nice.js +4 -7
  135. package/lib-vendor/d3-scale/src/number.js +0 -1
  136. package/lib-vendor/d3-scale/src/ordinal.js +4 -20
  137. package/lib-vendor/d3-scale/src/pow.js +1 -16
  138. package/lib-vendor/d3-scale/src/quantile.js +4 -20
  139. package/lib-vendor/d3-scale/src/quantize.js +5 -20
  140. package/lib-vendor/d3-scale/src/radial.js +3 -22
  141. package/lib-vendor/d3-scale/src/sequential.js +8 -38
  142. package/lib-vendor/d3-scale/src/sequentialQuantile.js +1 -14
  143. package/lib-vendor/d3-scale/src/symlog.js +1 -12
  144. package/lib-vendor/d3-scale/src/threshold.js +3 -13
  145. package/lib-vendor/d3-scale/src/tickFormat.js +1 -8
  146. package/lib-vendor/d3-scale/src/time.js +11 -31
  147. package/lib-vendor/d3-scale/src/utcTime.js +0 -5
  148. package/lib-vendor/d3-shape/src/arc.js +114 -114
  149. package/lib-vendor/d3-shape/src/area.js +12 -40
  150. package/lib-vendor/d3-shape/src/areaRadial.js +7 -16
  151. package/lib-vendor/d3-shape/src/array.js +1 -3
  152. package/lib-vendor/d3-shape/src/constant.js +0 -1
  153. package/lib-vendor/d3-shape/src/curve/basis.js +0 -14
  154. package/lib-vendor/d3-shape/src/curve/basisClosed.js +0 -20
  155. package/lib-vendor/d3-shape/src/curve/basisOpen.js +1 -11
  156. package/lib-vendor/d3-shape/src/curve/bump.js +0 -24
  157. package/lib-vendor/d3-shape/src/curve/bundle.js +9 -24
  158. package/lib-vendor/d3-shape/src/curve/cardinal.js +2 -18
  159. package/lib-vendor/d3-shape/src/curve/cardinalClosed.js +2 -25
  160. package/lib-vendor/d3-shape/src/curve/cardinalOpen.js +2 -16
  161. package/lib-vendor/d3-shape/src/curve/catmullRom.js +8 -30
  162. package/lib-vendor/d3-shape/src/curve/catmullRomClosed.js +3 -28
  163. package/lib-vendor/d3-shape/src/curve/catmullRomOpen.js +3 -19
  164. package/lib-vendor/d3-shape/src/curve/linear.js +0 -7
  165. package/lib-vendor/d3-shape/src/curve/linearClosed.js +0 -5
  166. package/lib-vendor/d3-shape/src/curve/monotone.js +16 -34
  167. package/lib-vendor/d3-shape/src/curve/natural.js +10 -25
  168. package/lib-vendor/d3-shape/src/curve/radial.js +1 -9
  169. package/lib-vendor/d3-shape/src/curve/step.js +0 -13
  170. package/lib-vendor/d3-shape/src/descending.js +0 -1
  171. package/lib-vendor/d3-shape/src/identity.js +0 -1
  172. package/lib-vendor/d3-shape/src/index.js +2 -55
  173. package/lib-vendor/d3-shape/src/line.js +7 -24
  174. package/lib-vendor/d3-shape/src/lineRadial.js +2 -11
  175. package/lib-vendor/d3-shape/src/link.js +0 -21
  176. package/lib-vendor/d3-shape/src/math.js +11 -24
  177. package/lib-vendor/d3-shape/src/noop.js +0 -1
  178. package/lib-vendor/d3-shape/src/offset/diverging.js +0 -2
  179. package/lib-vendor/d3-shape/src/offset/expand.js +0 -6
  180. package/lib-vendor/d3-shape/src/offset/none.js +0 -3
  181. package/lib-vendor/d3-shape/src/offset/silhouette.js +0 -6
  182. package/lib-vendor/d3-shape/src/offset/wiggle.js +5 -13
  183. package/lib-vendor/d3-shape/src/order/appearance.js +4 -10
  184. package/lib-vendor/d3-shape/src/order/ascending.js +3 -9
  185. package/lib-vendor/d3-shape/src/order/descending.js +0 -3
  186. package/lib-vendor/d3-shape/src/order/insideOut.js +8 -15
  187. package/lib-vendor/d3-shape/src/order/none.js +1 -4
  188. package/lib-vendor/d3-shape/src/order/reverse.js +0 -3
  189. package/lib-vendor/d3-shape/src/pie.js +21 -37
  190. package/lib-vendor/d3-shape/src/point.js +0 -2
  191. package/lib-vendor/d3-shape/src/pointRadial.js +0 -1
  192. package/lib-vendor/d3-shape/src/stack.js +7 -24
  193. package/lib-vendor/d3-shape/src/symbol/asterisk.js +2 -6
  194. package/lib-vendor/d3-shape/src/symbol/circle.js +2 -6
  195. package/lib-vendor/d3-shape/src/symbol/cross.js +2 -6
  196. package/lib-vendor/d3-shape/src/symbol/diamond.js +2 -6
  197. package/lib-vendor/d3-shape/src/symbol/diamond2.js +2 -6
  198. package/lib-vendor/d3-shape/src/symbol/plus.js +2 -6
  199. package/lib-vendor/d3-shape/src/symbol/square.js +2 -6
  200. package/lib-vendor/d3-shape/src/symbol/square2.js +2 -6
  201. package/lib-vendor/d3-shape/src/symbol/star.js +2 -8
  202. package/lib-vendor/d3-shape/src/symbol/triangle.js +2 -6
  203. package/lib-vendor/d3-shape/src/symbol/triangle2.js +2 -7
  204. package/lib-vendor/d3-shape/src/symbol/wye.js +5 -9
  205. package/lib-vendor/d3-shape/src/symbol/x.js +2 -6
  206. package/lib-vendor/d3-shape/src/symbol.js +3 -27
  207. package/lib-vendor/d3-time/src/day.js +2 -8
  208. package/lib-vendor/d3-time/src/duration.js +7 -14
  209. package/lib-vendor/d3-time/src/hour.js +2 -8
  210. package/lib-vendor/d3-time/src/index.js +2 -21
  211. package/lib-vendor/d3-time/src/interval.js +3 -17
  212. package/lib-vendor/d3-time/src/millisecond.js +6 -10
  213. package/lib-vendor/d3-time/src/minute.js +2 -8
  214. package/lib-vendor/d3-time/src/month.js +2 -7
  215. package/lib-vendor/d3-time/src/second.js +2 -8
  216. package/lib-vendor/d3-time/src/ticks.js +0 -23
  217. package/lib-vendor/d3-time/src/utcDay.js +2 -8
  218. package/lib-vendor/d3-time/src/utcHour.js +2 -8
  219. package/lib-vendor/d3-time/src/utcMinute.js +2 -8
  220. package/lib-vendor/d3-time/src/utcMonth.js +2 -7
  221. package/lib-vendor/d3-time/src/utcWeek.js +14 -33
  222. package/lib-vendor/d3-time/src/utcYear.js +4 -9
  223. package/lib-vendor/d3-time/src/week.js +14 -33
  224. package/lib-vendor/d3-time/src/year.js +4 -9
  225. package/lib-vendor/d3-time-format/src/defaultLocale.js +0 -8
  226. package/lib-vendor/d3-time-format/src/index.js +2 -9
  227. package/lib-vendor/d3-time-format/src/isoFormat.js +2 -8
  228. package/lib-vendor/d3-time-format/src/isoParse.js +1 -6
  229. package/lib-vendor/d3-time-format/src/locale.js +56 -163
  230. package/lib-vendor/d3-timer/src/index.js +0 -4
  231. package/lib-vendor/d3-timer/src/interval.js +1 -8
  232. package/lib-vendor/d3-timer/src/timeout.js +0 -2
  233. package/lib-vendor/d3-timer/src/timer.js +21 -42
  234. package/lib-vendor/d3-voronoi/src/Beach.js +33 -65
  235. package/lib-vendor/d3-voronoi/src/Cell.js +31 -48
  236. package/lib-vendor/d3-voronoi/src/Circle.js +12 -25
  237. package/lib-vendor/d3-voronoi/src/Diagram.js +26 -51
  238. package/lib-vendor/d3-voronoi/src/Edge.js +24 -46
  239. package/lib-vendor/d3-voronoi/src/RedBlackTree.js +20 -57
  240. package/lib-vendor/d3-voronoi/src/constant.js +0 -1
  241. package/lib-vendor/d3-voronoi/src/index.js +0 -2
  242. package/lib-vendor/d3-voronoi/src/point.js +0 -2
  243. package/lib-vendor/d3-voronoi/src/voronoi.js +4 -20
  244. package/lib-vendor/internmap/src/index.js +0 -24
  245. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # victory-vendor
2
2
 
3
+ ## 37.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Upgrade babel dependencies and build target to modern browsers ([#2804](https://github.com/FormidableLabs/victory/pull/2804))
8
+
3
9
  ## 36.9.2
4
10
 
5
11
  ## 36.9.1
@@ -5,7 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.slice = exports.map = void 0;
7
7
  var array = Array.prototype;
8
- var slice = array.slice;
9
- exports.slice = slice;
10
- var map = array.map;
11
- exports.map = map;
8
+ var slice = exports.slice = array.slice;
9
+ var map = exports.map = array.map;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = ascending;
7
-
8
7
  function ascending(a, b) {
9
8
  return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
10
9
  }
@@ -4,72 +4,59 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = bin;
7
-
8
7
  var _array = require("./array.js");
9
-
10
8
  var _bisect = _interopRequireDefault(require("./bisect.js"));
11
-
12
9
  var _constant = _interopRequireDefault(require("./constant.js"));
13
-
14
10
  var _extent = _interopRequireDefault(require("./extent.js"));
15
-
16
11
  var _identity = _interopRequireDefault(require("./identity.js"));
17
-
18
12
  var _nice = _interopRequireDefault(require("./nice.js"));
19
-
20
13
  var _ticks = _interopRequireWildcard(require("./ticks.js"));
21
-
22
14
  var _sturges = _interopRequireDefault(require("./threshold/sturges.js"));
23
-
24
- 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); }
25
-
26
- 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; }
27
-
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
-
30
18
  function bin() {
31
19
  var value = _identity.default,
32
- domain = _extent.default,
33
- threshold = _sturges.default;
34
-
20
+ domain = _extent.default,
21
+ threshold = _sturges.default;
35
22
  function histogram(data) {
36
23
  if (!Array.isArray(data)) data = Array.from(data);
37
24
  var i,
38
- n = data.length,
39
- x,
40
- step,
41
- values = new Array(n);
42
-
25
+ n = data.length,
26
+ x,
27
+ step,
28
+ values = new Array(n);
43
29
  for (i = 0; i < n; ++i) {
44
30
  values[i] = value(data[i], i, data);
45
31
  }
46
-
47
32
  var xz = domain(values),
48
- x0 = xz[0],
49
- x1 = xz[1],
50
- tz = threshold(values, x0, x1); // Convert number of thresholds into uniform thresholds, and nice the
51
- // default domain accordingly.
33
+ x0 = xz[0],
34
+ x1 = xz[1],
35
+ tz = threshold(values, x0, x1);
52
36
 
37
+ // Convert number of thresholds into uniform thresholds, and nice the
38
+ // default domain accordingly.
53
39
  if (!Array.isArray(tz)) {
54
40
  const max = x1,
55
- tn = +tz;
41
+ tn = +tz;
56
42
  if (domain === _extent.default) [x0, x1] = (0, _nice.default)(x0, x1, tn);
57
- tz = (0, _ticks.default)(x0, x1, tn); // If the domain is aligned with the first tick (which it will by
43
+ tz = (0, _ticks.default)(x0, x1, tn);
44
+
45
+ // If the domain is aligned with the first tick (which it will by
58
46
  // default), then we can use quantization rather than bisection to bin
59
47
  // values, which is substantially faster.
48
+ if (tz[0] <= x0) step = (0, _ticks.tickIncrement)(x0, x1, tn);
60
49
 
61
- if (tz[0] <= x0) step = (0, _ticks.tickIncrement)(x0, x1, tn); // If the last threshold is coincident with the domain’s upper bound, the
50
+ // If the last threshold is coincident with the domain’s upper bound, the
62
51
  // last bin will be zero-width. If the default domain is used, and this
63
52
  // last threshold is coincident with the maximum input value, we can
64
53
  // extend the niced upper bound by one tick to ensure uniform bin widths;
65
54
  // otherwise, we simply remove the last threshold. Note that we don’t
66
55
  // coerce values or the domain to numbers, and thus must be careful to
67
56
  // compare order (>=) rather than strict equality (===)!
68
-
69
57
  if (tz[tz.length - 1] >= x1) {
70
58
  if (max >= x1 && domain === _extent.default) {
71
59
  const step = (0, _ticks.tickIncrement)(x0, x1, tn);
72
-
73
60
  if (isFinite(step)) {
74
61
  if (step > 0) {
75
62
  x1 = (Math.floor(x1 / step) + 1) * step;
@@ -81,25 +68,23 @@ function bin() {
81
68
  tz.pop();
82
69
  }
83
70
  }
84
- } // Remove any thresholds outside the domain.
85
-
71
+ }
86
72
 
73
+ // Remove any thresholds outside the domain.
87
74
  var m = tz.length;
88
-
89
75
  while (tz[0] <= x0) tz.shift(), --m;
90
-
91
76
  while (tz[m - 1] > x1) tz.pop(), --m;
92
-
93
77
  var bins = new Array(m + 1),
94
- bin; // Initialize bins.
78
+ bin;
95
79
 
80
+ // Initialize bins.
96
81
  for (i = 0; i <= m; ++i) {
97
82
  bin = bins[i] = [];
98
83
  bin.x0 = i > 0 ? tz[i - 1] : x0;
99
84
  bin.x1 = i < m ? tz[i] : x1;
100
- } // Assign data to bins by value, ignoring any outside the domain.
101
-
85
+ }
102
86
 
87
+ // Assign data to bins by value, ignoring any outside the domain.
103
88
  if (isFinite(step)) {
104
89
  if (step > 0) {
105
90
  for (i = 0; i < n; ++i) {
@@ -122,21 +107,16 @@ function bin() {
122
107
  }
123
108
  }
124
109
  }
125
-
126
110
  return bins;
127
111
  }
128
-
129
112
  histogram.value = function (_) {
130
113
  return arguments.length ? (value = typeof _ === "function" ? _ : (0, _constant.default)(_), histogram) : value;
131
114
  };
132
-
133
115
  histogram.domain = function (_) {
134
116
  return arguments.length ? (domain = typeof _ === "function" ? _ : (0, _constant.default)([_[0], _[1]]), histogram) : domain;
135
117
  };
136
-
137
118
  histogram.thresholds = function (_) {
138
119
  return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? (0, _constant.default)(_array.slice.call(_)) : (0, _constant.default)(_), histogram) : threshold;
139
120
  };
140
-
141
121
  return histogram;
142
122
  }
@@ -4,21 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.bisectRight = exports.bisectLeft = exports.bisectCenter = void 0;
7
-
8
7
  var _ascending = _interopRequireDefault(require("./ascending.js"));
9
-
10
8
  var _bisector = _interopRequireDefault(require("./bisector.js"));
11
-
12
9
  var _number = _interopRequireDefault(require("./number.js"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  const ascendingBisect = (0, _bisector.default)(_ascending.default);
17
- const bisectRight = ascendingBisect.right;
18
- exports.bisectRight = bisectRight;
19
- const bisectLeft = ascendingBisect.left;
20
- exports.bisectLeft = bisectLeft;
21
- const bisectCenter = (0, _bisector.default)(_number.default).center;
22
- exports.bisectCenter = bisectCenter;
23
- var _default = bisectRight;
24
- exports.default = _default;
12
+ const bisectRight = exports.bisectRight = ascendingBisect.right;
13
+ const bisectLeft = exports.bisectLeft = ascendingBisect.left;
14
+ const bisectCenter = exports.bisectCenter = (0, _bisector.default)(_number.default).center;
15
+ var _default = exports.default = bisectRight;
@@ -4,70 +4,56 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = bisector;
7
-
8
7
  var _ascending = _interopRequireDefault(require("./ascending.js"));
9
-
10
8
  var _descending = _interopRequireDefault(require("./descending.js"));
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  function bisector(f) {
15
- let compare1, compare2, delta; // If an accessor is specified, promote it to a comparator. In this case we
11
+ let compare1, compare2, delta;
12
+
13
+ // If an accessor is specified, promote it to a comparator. In this case we
16
14
  // can test whether the search value is (self-) comparable. We can’t do this
17
15
  // for a comparator (except for specific, known comparators) because we can’t
18
16
  // tell if the comparator is symmetric, and an asymmetric comparator can’t be
19
17
  // used to test whether a single value is comparable.
20
-
21
18
  if (f.length !== 2) {
22
19
  compare1 = _ascending.default;
23
-
24
20
  compare2 = (d, x) => (0, _ascending.default)(f(d), x);
25
-
26
21
  delta = (d, x) => f(d) - x;
27
22
  } else {
28
23
  compare1 = f === _ascending.default || f === _descending.default ? f : zero;
29
24
  compare2 = f;
30
25
  delta = f;
31
26
  }
32
-
33
27
  function left(a, x, lo = 0, hi = a.length) {
34
28
  if (lo < hi) {
35
29
  if (compare1(x, x) !== 0) return hi;
36
-
37
30
  do {
38
31
  const mid = lo + hi >>> 1;
39
32
  if (compare2(a[mid], x) < 0) lo = mid + 1;else hi = mid;
40
33
  } while (lo < hi);
41
34
  }
42
-
43
35
  return lo;
44
36
  }
45
-
46
37
  function right(a, x, lo = 0, hi = a.length) {
47
38
  if (lo < hi) {
48
39
  if (compare1(x, x) !== 0) return hi;
49
-
50
40
  do {
51
41
  const mid = lo + hi >>> 1;
52
42
  if (compare2(a[mid], x) <= 0) lo = mid + 1;else hi = mid;
53
43
  } while (lo < hi);
54
44
  }
55
-
56
45
  return lo;
57
46
  }
58
-
59
47
  function center(a, x, lo = 0, hi = a.length) {
60
48
  const i = left(a, x, lo, hi - 1);
61
49
  return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
62
50
  }
63
-
64
51
  return {
65
52
  left,
66
53
  center,
67
54
  right
68
55
  };
69
56
  }
70
-
71
57
  function zero() {
72
58
  return 0;
73
59
  }
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = constant;
7
-
8
7
  function constant(x) {
9
8
  return () => x;
10
9
  }
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = count;
7
-
8
7
  function count(values, valueof) {
9
8
  let count = 0;
10
-
11
9
  if (valueof === undefined) {
12
10
  for (let value of values) {
13
11
  if (value != null && (value = +value) >= value) {
@@ -16,13 +14,11 @@ function count(values, valueof) {
16
14
  }
17
15
  } else {
18
16
  let index = -1;
19
-
20
17
  for (let value of values) {
21
18
  if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
22
19
  ++count;
23
20
  }
24
21
  }
25
22
  }
26
-
27
23
  return count;
28
24
  }
@@ -4,23 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = cross;
7
-
8
7
  function length(array) {
9
8
  return array.length | 0;
10
9
  }
11
-
12
10
  function empty(length) {
13
11
  return !(length > 0);
14
12
  }
15
-
16
13
  function arrayify(values) {
17
14
  return typeof values !== "object" || "length" in values ? values : Array.from(values);
18
15
  }
19
-
20
16
  function reducer(reduce) {
21
17
  return values => reduce(...values);
22
18
  }
23
-
24
19
  function cross(...values) {
25
20
  const reduce = typeof values[values.length - 1] === "function" && reducer(values.pop());
26
21
  values = values.map(arrayify);
@@ -29,11 +24,9 @@ function cross(...values) {
29
24
  const index = new Array(j + 1).fill(0);
30
25
  const product = [];
31
26
  if (j < 0 || lengths.some(empty)) return product;
32
-
33
27
  while (true) {
34
28
  product.push(index.map((j, i) => values[i][j]));
35
29
  let i = j;
36
-
37
30
  while (++index[i] === lengths[i]) {
38
31
  if (i === 0) return reduce ? product.map(reduce) : product;
39
32
  index[i--] = 0;
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = cumsum;
7
-
8
7
  function cumsum(values, valueof) {
9
8
  var sum = 0,
10
- index = 0;
9
+ index = 0;
11
10
  return Float64Array.from(values, valueof === undefined ? v => sum += +v || 0 : v => sum += +valueof(v, index++, values) || 0);
12
11
  }
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = descending;
7
-
8
7
  function descending(a, b) {
9
8
  return a == null || b == null ? NaN : b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
10
9
  }
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = deviation;
7
-
8
7
  var _variance = _interopRequireDefault(require("./variance.js"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  function deviation(values, valueof) {
13
10
  const v = (0, _variance.default)(values, valueof);
14
11
  return v ? Math.sqrt(v) : v;
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = difference;
7
-
8
7
  var _index = require("../../../lib-vendor/internmap/src/index.js");
9
-
10
8
  function difference(values, ...others) {
11
9
  values = new _index.InternSet(values);
12
-
13
10
  for (const other of others) {
14
11
  for (const value of other) {
15
12
  values.delete(value);
16
13
  }
17
14
  }
18
-
19
15
  return values;
20
16
  }
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = disjoint;
7
-
8
7
  var _index = require("../../../lib-vendor/internmap/src/index.js");
9
-
10
8
  function disjoint(values, other) {
11
9
  const iterator = other[Symbol.iterator](),
12
- set = new _index.InternSet();
13
-
10
+ set = new _index.InternSet();
14
11
  for (const v of values) {
15
12
  if (set.has(v)) return false;
16
13
  let value, done;
17
-
18
14
  while (({
19
15
  value,
20
16
  done
@@ -24,6 +20,5 @@ function disjoint(values, other) {
24
20
  set.add(value);
25
21
  }
26
22
  }
27
-
28
23
  return true;
29
24
  }
@@ -4,16 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = every;
7
-
8
7
  function every(values, test) {
9
8
  if (typeof test !== "function") throw new TypeError("test is not a function");
10
9
  let index = -1;
11
-
12
10
  for (const value of values) {
13
11
  if (!test(value, ++index, values)) {
14
12
  return false;
15
13
  }
16
14
  }
17
-
18
15
  return true;
19
16
  }
@@ -4,11 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = extent;
7
-
8
7
  function extent(values, valueof) {
9
8
  let min;
10
9
  let max;
11
-
12
10
  if (valueof === undefined) {
13
11
  for (const value of values) {
14
12
  if (value != null) {
@@ -22,7 +20,6 @@ function extent(values, valueof) {
22
20
  }
23
21
  } else {
24
22
  let index = -1;
25
-
26
23
  for (let value of values) {
27
24
  if ((value = valueof(value, ++index, values)) != null) {
28
25
  if (min === undefined) {
@@ -34,6 +31,5 @@ function extent(values, valueof) {
34
31
  }
35
32
  }
36
33
  }
37
-
38
34
  return [min, max];
39
35
  }
@@ -4,17 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = filter;
7
-
8
7
  function filter(values, test) {
9
8
  if (typeof test !== "function") throw new TypeError("test is not a function");
10
9
  const array = [];
11
10
  let index = -1;
12
-
13
11
  for (const value of values) {
14
12
  if (test(value, ++index, values)) {
15
13
  array.push(value);
16
14
  }
17
15
  }
18
-
19
16
  return array;
20
17
  }
@@ -6,42 +6,35 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.Adder = void 0;
7
7
  exports.fcumsum = fcumsum;
8
8
  exports.fsum = fsum;
9
-
10
9
  // https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423
11
10
  class Adder {
12
11
  constructor() {
13
12
  this._partials = new Float64Array(32);
14
13
  this._n = 0;
15
14
  }
16
-
17
15
  add(x) {
18
16
  const p = this._partials;
19
17
  let i = 0;
20
-
21
18
  for (let j = 0; j < this._n && j < 32; j++) {
22
19
  const y = p[j],
23
- hi = x + y,
24
- lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);
20
+ hi = x + y,
21
+ lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);
25
22
  if (lo) p[i++] = lo;
26
23
  x = hi;
27
24
  }
28
-
29
25
  p[i] = x;
30
26
  this._n = i + 1;
31
27
  return this;
32
28
  }
33
-
34
29
  valueOf() {
35
30
  const p = this._partials;
36
31
  let n = this._n,
37
- x,
38
- y,
39
- lo,
40
- hi = 0;
41
-
32
+ x,
33
+ y,
34
+ lo,
35
+ hi = 0;
42
36
  if (n > 0) {
43
37
  hi = p[--n];
44
-
45
38
  while (n > 0) {
46
39
  x = hi;
47
40
  y = p[--n];
@@ -49,24 +42,18 @@ class Adder {
49
42
  lo = y - (hi - x);
50
43
  if (lo) break;
51
44
  }
52
-
53
45
  if (n > 0 && (lo < 0 && p[n - 1] < 0 || lo > 0 && p[n - 1] > 0)) {
54
46
  y = lo * 2;
55
47
  x = hi + y;
56
48
  if (y == x - hi) hi = x;
57
49
  }
58
50
  }
59
-
60
51
  return hi;
61
52
  }
62
-
63
53
  }
64
-
65
54
  exports.Adder = Adder;
66
-
67
55
  function fsum(values, valueof) {
68
56
  const adder = new Adder();
69
-
70
57
  if (valueof === undefined) {
71
58
  for (let value of values) {
72
59
  if (value = +value) {
@@ -75,17 +62,14 @@ function fsum(values, valueof) {
75
62
  }
76
63
  } else {
77
64
  let index = -1;
78
-
79
65
  for (let value of values) {
80
66
  if (value = +valueof(value, ++index, values)) {
81
67
  adder.add(value);
82
68
  }
83
69
  }
84
70
  }
85
-
86
71
  return +adder;
87
72
  }
88
-
89
73
  function fcumsum(values, valueof) {
90
74
  const adder = new Adder();
91
75
  let index = -1;
@@ -4,21 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = greatest;
7
-
8
7
  var _ascending = _interopRequireDefault(require("./ascending.js"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  function greatest(values, compare = _ascending.default) {
13
10
  let max;
14
11
  let defined = false;
15
-
16
12
  if (compare.length === 1) {
17
13
  let maxValue;
18
-
19
14
  for (const element of values) {
20
15
  const value = compare(element);
21
-
22
16
  if (defined ? (0, _ascending.default)(value, maxValue) > 0 : (0, _ascending.default)(value, value) === 0) {
23
17
  max = element;
24
18
  maxValue = value;
@@ -33,6 +27,5 @@ function greatest(values, compare = _ascending.default) {
33
27
  }
34
28
  }
35
29
  }
36
-
37
30
  return max;
38
31
  }
@@ -4,27 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = greatestIndex;
7
-
8
7
  var _ascending = _interopRequireDefault(require("./ascending.js"));
9
-
10
8
  var _maxIndex = _interopRequireDefault(require("./maxIndex.js"));
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  function greatestIndex(values, compare = _ascending.default) {
15
11
  if (compare.length === 1) return (0, _maxIndex.default)(values, compare);
16
12
  let maxValue;
17
13
  let max = -1;
18
14
  let index = -1;
19
-
20
15
  for (const value of values) {
21
16
  ++index;
22
-
23
17
  if (max < 0 ? compare(value, value) === 0 : compare(value, maxValue) > 0) {
24
18
  maxValue = value;
25
19
  max = index;
26
20
  }
27
21
  }
28
-
29
22
  return max;
30
23
  }