victory-core 36.3.2 → 36.5.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 (253) hide show
  1. package/dist/victory-core.js +15084 -15018
  2. package/dist/victory-core.min.js +1 -1
  3. package/es/index.d.ts +38 -941
  4. package/es/index.js +19 -28
  5. package/es/types.d.ts +33 -0
  6. package/es/types.js +1 -0
  7. package/es/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  8. package/es/victory-accessible-group/victory-accessible-group.js +35 -45
  9. package/es/victory-animation/util.d.ts +66 -0
  10. package/es/victory-animation/util.js +3 -2
  11. package/es/victory-animation/victory-animation.d.ts +69 -0
  12. package/es/victory-animation/victory-animation.js +92 -102
  13. package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
  14. package/es/victory-clip-container/victory-clip-container.js +75 -82
  15. package/es/victory-container/victory-container.d.ts +99 -0
  16. package/es/victory-container/victory-container.js +97 -107
  17. package/es/victory-label/victory-label.d.ts +61 -0
  18. package/es/victory-label/victory-label.js +43 -31
  19. package/es/victory-portal/portal-context.d.ts +11 -0
  20. package/es/victory-portal/portal-context.js +3 -4
  21. package/es/victory-portal/portal.d.ts +28 -0
  22. package/es/victory-portal/portal.js +44 -50
  23. package/es/victory-portal/victory-portal.d.ts +31 -0
  24. package/es/victory-portal/victory-portal.js +38 -47
  25. package/es/victory-primitives/arc.d.ts +21 -0
  26. package/es/victory-primitives/arc.js +9 -9
  27. package/es/victory-primitives/background.d.ts +22 -0
  28. package/es/victory-primitives/background.js +12 -12
  29. package/es/victory-primitives/border.d.ts +18 -0
  30. package/es/victory-primitives/border.js +9 -9
  31. package/es/victory-primitives/circle.d.ts +2 -0
  32. package/es/victory-primitives/circle.js +17 -10
  33. package/es/victory-primitives/clip-path.d.ts +14 -0
  34. package/es/victory-primitives/clip-path.js +6 -6
  35. package/es/victory-primitives/index.d.ts +14 -0
  36. package/es/victory-primitives/index.js +14 -0
  37. package/es/victory-primitives/line-segment.d.ts +19 -0
  38. package/es/victory-primitives/line-segment.js +9 -9
  39. package/es/victory-primitives/line.d.ts +2 -0
  40. package/es/victory-primitives/line.js +17 -10
  41. package/es/victory-primitives/path.d.ts +2 -0
  42. package/es/victory-primitives/path.js +15 -8
  43. package/es/victory-primitives/point.d.ts +21 -0
  44. package/es/victory-primitives/point.js +15 -23
  45. package/es/victory-primitives/rect.d.ts +2 -0
  46. package/es/victory-primitives/rect.js +17 -10
  47. package/es/victory-primitives/text.d.ts +16 -0
  48. package/es/victory-primitives/text.js +13 -8
  49. package/es/victory-primitives/tspan.d.ts +2 -0
  50. package/es/victory-primitives/tspan.js +7 -6
  51. package/es/victory-primitives/types.d.ts +7 -0
  52. package/es/victory-primitives/types.js +1 -0
  53. package/es/victory-primitives/whisker.d.ts +24 -0
  54. package/es/victory-primitives/whisker.js +12 -12
  55. package/es/victory-theme/grayscale.d.ts +2 -0
  56. package/es/victory-theme/grayscale.js +1 -1
  57. package/es/victory-theme/material.d.ts +2 -0
  58. package/es/victory-theme/material.js +1 -1
  59. package/es/victory-theme/victory-theme-definition.d.ts +244 -0
  60. package/es/victory-theme/victory-theme-definition.js +1 -0
  61. package/es/victory-theme/victory-theme.d.ts +5 -0
  62. package/es/victory-theme/victory-theme.js +6 -5
  63. package/es/victory-transition/victory-transition.d.ts +59 -0
  64. package/es/victory-transition/victory-transition.js +38 -44
  65. package/es/victory-util/add-events.js +328 -319
  66. package/es/victory-util/axis.js +12 -6
  67. package/es/victory-util/collection.js +7 -5
  68. package/es/victory-util/common-props.js +2 -2
  69. package/es/victory-util/data.js +8 -6
  70. package/es/victory-util/default-transitions.js +0 -1
  71. package/es/victory-util/domain.js +7 -5
  72. package/es/victory-util/events.js +8 -4
  73. package/es/victory-util/helpers.js +1 -3
  74. package/es/victory-util/hooks/use-animation-state.js +11 -5
  75. package/es/victory-util/immutable.js +0 -1
  76. package/es/victory-util/label-helpers.js +0 -2
  77. package/es/victory-util/line-helpers.js +1 -1
  78. package/es/victory-util/log.js +0 -1
  79. package/es/victory-util/point-path-helpers.d.ts +9 -0
  80. package/es/victory-util/point-path-helpers.js +59 -61
  81. package/es/victory-util/scale.js +19 -19
  82. package/es/victory-util/selection.d.ts +23 -0
  83. package/es/victory-util/selection.js +0 -2
  84. package/es/victory-util/style.js +0 -2
  85. package/es/victory-util/textsize.d.ts +8 -0
  86. package/es/victory-util/textsize.js +11 -7
  87. package/es/victory-util/timer-context.d.ts +11 -0
  88. package/es/victory-util/timer-context.js +1 -1
  89. package/es/victory-util/timer.d.ts +16 -0
  90. package/es/victory-util/timer.js +16 -13
  91. package/es/victory-util/types.d.ts +188 -0
  92. package/es/victory-util/types.js +1 -0
  93. package/es/victory-util/user-props.js +44 -4
  94. package/es/victory-util/wrapper.js +18 -12
  95. package/lib/index.d.ts +38 -941
  96. package/lib/index.js +201 -189
  97. package/lib/types.d.ts +33 -0
  98. package/lib/types.js +1 -0
  99. package/lib/victory-accessible-group/victory-accessible-group.d.ts +25 -0
  100. package/lib/victory-accessible-group/victory-accessible-group.js +37 -45
  101. package/lib/victory-animation/util.d.ts +66 -0
  102. package/lib/victory-animation/util.js +4 -3
  103. package/lib/victory-animation/victory-animation.d.ts +69 -0
  104. package/lib/victory-animation/victory-animation.js +97 -102
  105. package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
  106. package/lib/victory-clip-container/victory-clip-container.js +81 -82
  107. package/lib/victory-container/victory-container.d.ts +99 -0
  108. package/lib/victory-container/victory-container.js +102 -107
  109. package/lib/victory-label/victory-label.d.ts +61 -0
  110. package/lib/victory-label/victory-label.js +49 -32
  111. package/lib/victory-portal/portal-context.d.ts +11 -0
  112. package/lib/victory-portal/portal-context.js +4 -5
  113. package/lib/victory-portal/portal.d.ts +28 -0
  114. package/lib/victory-portal/portal.js +49 -50
  115. package/lib/victory-portal/victory-portal.d.ts +31 -0
  116. package/lib/victory-portal/victory-portal.js +43 -47
  117. package/lib/victory-primitives/arc.d.ts +21 -0
  118. package/lib/victory-primitives/arc.js +13 -10
  119. package/lib/victory-primitives/background.d.ts +22 -0
  120. package/lib/victory-primitives/background.js +16 -13
  121. package/lib/victory-primitives/border.d.ts +18 -0
  122. package/lib/victory-primitives/border.js +13 -10
  123. package/lib/victory-primitives/circle.d.ts +2 -0
  124. package/lib/victory-primitives/circle.js +17 -8
  125. package/lib/victory-primitives/clip-path.d.ts +14 -0
  126. package/lib/victory-primitives/clip-path.js +7 -5
  127. package/lib/victory-primitives/index.d.ts +14 -0
  128. package/lib/victory-primitives/index.js +187 -0
  129. package/lib/victory-primitives/line-segment.d.ts +19 -0
  130. package/lib/victory-primitives/line-segment.js +13 -10
  131. package/lib/victory-primitives/line.d.ts +2 -0
  132. package/lib/victory-primitives/line.js +17 -8
  133. package/lib/victory-primitives/path.d.ts +2 -0
  134. package/lib/victory-primitives/path.js +15 -6
  135. package/lib/victory-primitives/point.d.ts +21 -0
  136. package/lib/victory-primitives/point.js +21 -25
  137. package/lib/victory-primitives/rect.d.ts +2 -0
  138. package/lib/victory-primitives/rect.js +17 -8
  139. package/lib/victory-primitives/text.d.ts +16 -0
  140. package/lib/victory-primitives/text.js +14 -7
  141. package/lib/victory-primitives/tspan.d.ts +2 -0
  142. package/lib/victory-primitives/tspan.js +7 -4
  143. package/lib/victory-primitives/types.d.ts +7 -0
  144. package/lib/victory-primitives/types.js +1 -0
  145. package/lib/victory-primitives/whisker.d.ts +24 -0
  146. package/lib/victory-primitives/whisker.js +16 -13
  147. package/lib/victory-theme/grayscale.d.ts +2 -0
  148. package/lib/victory-theme/grayscale.js +3 -3
  149. package/lib/victory-theme/material.d.ts +2 -0
  150. package/lib/victory-theme/material.js +3 -3
  151. package/lib/victory-theme/victory-theme-definition.d.ts +244 -0
  152. package/lib/victory-theme/victory-theme-definition.js +1 -0
  153. package/lib/victory-theme/victory-theme.d.ts +5 -0
  154. package/lib/victory-theme/victory-theme.js +22 -8
  155. package/lib/victory-transition/victory-transition.d.ts +59 -0
  156. package/lib/victory-transition/victory-transition.js +43 -45
  157. package/lib/victory-util/add-events.js +326 -316
  158. package/lib/victory-util/axis.js +20 -11
  159. package/lib/victory-util/collection.js +10 -8
  160. package/lib/victory-util/common-props.js +6 -4
  161. package/lib/victory-util/data.js +13 -7
  162. package/lib/victory-util/default-transitions.js +1 -2
  163. package/lib/victory-util/domain.js +11 -5
  164. package/lib/victory-util/events.js +17 -11
  165. package/lib/victory-util/helpers.js +14 -16
  166. package/lib/victory-util/hooks/index.js +4 -4
  167. package/lib/victory-util/hooks/use-animation-state.js +14 -6
  168. package/lib/victory-util/immutable.js +3 -5
  169. package/lib/victory-util/label-helpers.js +6 -6
  170. package/lib/victory-util/line-helpers.js +4 -2
  171. package/lib/victory-util/log.js +0 -1
  172. package/lib/victory-util/point-path-helpers.d.ts +9 -0
  173. package/lib/victory-util/point-path-helpers.js +86 -73
  174. package/lib/victory-util/prop-types.js +5 -3
  175. package/lib/victory-util/scale.js +24 -21
  176. package/lib/victory-util/selection.d.ts +23 -0
  177. package/lib/victory-util/selection.js +5 -5
  178. package/lib/victory-util/style.js +0 -2
  179. package/lib/victory-util/textsize.d.ts +8 -0
  180. package/lib/victory-util/textsize.js +12 -8
  181. package/lib/victory-util/timer-context.d.ts +11 -0
  182. package/lib/victory-util/timer-context.js +1 -1
  183. package/lib/victory-util/timer.d.ts +16 -0
  184. package/lib/victory-util/timer.js +16 -13
  185. package/lib/victory-util/types.d.ts +188 -0
  186. package/lib/victory-util/types.js +1 -0
  187. package/lib/victory-util/user-props.js +53 -6
  188. package/lib/victory-util/wrapper.js +31 -23
  189. package/package.json +6 -13
  190. package/src/index.ts +42 -0
  191. package/src/types.ts +45 -0
  192. package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +10 -3
  193. package/src/victory-animation/{util.js → util.ts} +5 -4
  194. package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +90 -13
  195. package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +32 -6
  196. package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
  197. package/src/victory-label/{victory-label.js → victory-label.tsx} +80 -19
  198. package/src/victory-portal/portal-context.ts +14 -0
  199. package/src/victory-portal/{portal.js → portal.tsx} +23 -12
  200. package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +21 -6
  201. package/src/victory-primitives/{arc.js → arc.tsx} +15 -5
  202. package/src/victory-primitives/{background.js → background.tsx} +17 -7
  203. package/src/victory-primitives/{border.js → border.tsx} +12 -5
  204. package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
  205. package/src/victory-primitives/clip-path.tsx +25 -0
  206. package/src/victory-primitives/index.ts +14 -0
  207. package/src/victory-primitives/{line-segment.js → line-segment.tsx} +13 -5
  208. package/src/victory-primitives/{line.js → line.tsx} +4 -3
  209. package/src/victory-primitives/{path.js → path.tsx} +4 -3
  210. package/src/victory-primitives/{point.js → point.tsx} +25 -20
  211. package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
  212. package/src/victory-primitives/{text.js → text.tsx} +9 -3
  213. package/src/victory-primitives/tspan.tsx +7 -0
  214. package/src/victory-primitives/types.ts +19 -0
  215. package/src/victory-primitives/{whisker.js → whisker.tsx} +20 -7
  216. package/src/victory-theme/{grayscale.js → grayscale.tsx} +2 -1
  217. package/src/victory-theme/{material.js → material.tsx} +2 -1
  218. package/src/victory-theme/victory-theme-definition.ts +261 -0
  219. package/src/victory-theme/victory-theme.tsx +5 -0
  220. package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +68 -19
  221. package/src/victory-util/add-events.js +7 -5
  222. package/src/victory-util/axis.js +3 -1
  223. package/src/victory-util/collection.js +0 -1
  224. package/src/victory-util/common-props.js +2 -2
  225. package/src/victory-util/data.js +0 -1
  226. package/src/victory-util/default-transitions.js +0 -1
  227. package/src/victory-util/domain.js +0 -1
  228. package/src/victory-util/events.js +1 -1
  229. package/src/victory-util/helpers.js +0 -1
  230. package/src/victory-util/immutable.js +0 -1
  231. package/src/victory-util/label-helpers.js +0 -1
  232. package/src/victory-util/line-helpers.js +1 -1
  233. package/src/victory-util/log.js +0 -1
  234. package/src/victory-util/point-path-helpers.ts +119 -0
  235. package/src/victory-util/prop-types.js +0 -1
  236. package/src/victory-util/scale.js +18 -10
  237. package/src/victory-util/selection.d.ts +23 -0
  238. package/src/victory-util/selection.js +0 -1
  239. package/src/victory-util/style.js +0 -1
  240. package/src/victory-util/textsize.d.ts +8 -0
  241. package/src/victory-util/{timer-context.js → timer-context.ts} +0 -0
  242. package/src/victory-util/{timer.js → timer.ts} +20 -5
  243. package/src/victory-util/transitions.js +0 -1
  244. package/src/victory-util/types.ts +247 -0
  245. package/src/victory-util/user-props.js +31 -1
  246. package/src/victory-util/wrapper.js +0 -1
  247. package/src/index.d.ts +0 -941
  248. package/src/index.js +0 -51
  249. package/src/victory-portal/portal-context.js +0 -10
  250. package/src/victory-primitives/clip-path.js +0 -18
  251. package/src/victory-primitives/tspan.js +0 -5
  252. package/src/victory-theme/victory-theme.js +0 -7
  253. package/src/victory-util/point-path-helpers.js +0 -121
@@ -11,15 +11,18 @@ import _identity from "lodash/identity";
11
11
  import _defaults from "lodash/defaults";
12
12
  import _assign from "lodash/assign";
13
13
 
14
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
14
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
15
15
 
16
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
16
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
17
 
18
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
18
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
19
 
20
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
20
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
21
+
22
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
23
+
24
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
21
25
 
22
- /* eslint-disable func-style */
23
26
  import React from "react";
24
27
  import * as Collection from "./collection";
25
28
  import * as Domain from "./domain";
@@ -251,7 +254,10 @@ export function getTickFormat(props, scale) {
251
254
  var stringMap = props.stringMap && props.stringMap[axis];
252
255
 
253
256
  if (!tickFormat) {
254
- var defaultTickFormat = getDefaultTickFormat(props);
257
+ var defaultTickFormat = getDefaultTickFormat(props); // If there is no user-provided tick format, we use d3's tickFormat function
258
+ // by default. This changed the default formatting for some scale types when
259
+ // we upgraded to d3-scale@4..
260
+
255
261
  var scaleTickFormat = scale.tickFormat && _isFunction(scale.tickFormat) ? scale.tickFormat() : function (x) {
256
262
  return x;
257
263
  };
@@ -1,12 +1,14 @@
1
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
2
 
3
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
4
 
5
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
6
 
7
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
8
 
9
- /* eslint-disable func-style */
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10
12
 
11
13
  /* eslint-disable no-use-before-define */
12
14
  function isNonEmptyArray(collection) {
@@ -48,10 +48,10 @@ export var baseProps = {
48
48
  eventHandlers: PropTypes.object
49
49
  })),
50
50
  externalEventMutations: PropTypes.arrayOf(PropTypes.shape({
51
- callback: PropTypes.function,
51
+ callback: PropTypes.func,
52
52
  childName: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
53
53
  eventKey: PropTypes.oneOfType([PropTypes.array, CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]), PropTypes.string]),
54
- mutation: PropTypes.function,
54
+ mutation: PropTypes.func,
55
55
  target: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
56
56
  })),
57
57
  groupComponent: PropTypes.element,
@@ -12,15 +12,17 @@ import _range from "lodash/range";
12
12
  import _uniq from "lodash/uniq";
13
13
  import _assign from "lodash/assign";
14
14
 
15
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
15
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
16
16
 
17
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
17
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
18
 
19
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
19
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
20
20
 
21
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
21
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
22
22
 
23
- /* eslint-disable func-style */
23
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
24
+
25
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
24
26
 
25
27
  /* eslint-disable no-use-before-define */
26
28
  import React from "react";
@@ -212,7 +214,7 @@ export function createStringMap(props, axis) {
212
214
  var stringsFromCategories = getStringsFromCategories(props, axis);
213
215
  var stringsFromData = getStringsFromData(props, axis);
214
216
 
215
- var allStrings = _uniq(_toConsumableArray(stringsFromAxes).concat(_toConsumableArray(stringsFromCategories), _toConsumableArray(stringsFromData)));
217
+ var allStrings = _uniq([].concat(_toConsumableArray(stringsFromAxes), _toConsumableArray(stringsFromCategories), _toConsumableArray(stringsFromData)));
216
218
 
217
219
  return allStrings.length === 0 ? null : allStrings.reduce(function (memo, string, index) {
218
220
  memo[string] = index + 1;
@@ -1,4 +1,3 @@
1
- /* eslint-disable func-style */
2
1
  export function continuousTransitions() {
3
2
  return {
4
3
  onLoad: {
@@ -5,15 +5,17 @@ import _sortedUniq from "lodash/sortedUniq";
5
5
  import _isPlainObject from "lodash/isPlainObject";
6
6
  import _flatten from "lodash/flatten";
7
7
 
8
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
8
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9
9
 
10
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
10
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
11
 
12
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
12
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13
13
 
14
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
14
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
15
15
 
16
- /* eslint-disable func-style */
16
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
17
+
18
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17
19
 
18
20
  /* eslint-disable no-use-before-define */
19
21
  import React from "react";
@@ -10,13 +10,17 @@ import _assign from "lodash/assign";
10
10
 
11
11
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
12
 
13
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
13
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
14
14
 
15
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
15
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
16
 
17
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
17
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
18
 
19
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
19
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
20
+
21
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
22
+
23
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
20
24
 
21
25
  var GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
22
26
  /* Returns all own and shared events that should be attached to a single target element,
@@ -5,8 +5,6 @@ import _property from "lodash/property";
5
5
  import _isFunction from "lodash/isFunction";
6
6
  import _defaults from "lodash/defaults";
7
7
 
8
- /* eslint-disable func-style */
9
-
10
8
  /* eslint-disable no-use-before-define */
11
9
  import React from "react";
12
10
 
@@ -295,7 +293,7 @@ export function reduceChildren(children, iteratee) {
295
293
  var nestedChildren = child.type && child.type.role === "stack" && _isFunction(child.type.getChildren) ? child.type.getChildren(childProps) : React.Children.toArray(child.props.children).map(function (c) {
296
294
  var nestedChildProps = _assign({}, c.props, _pick(childProps, sharedProps));
297
295
 
298
- return React.cloneElement(c, nestedChildProps);
296
+ return /*#__PURE__*/React.cloneElement(c, nestedChildProps);
299
297
  });
300
298
 
301
299
  var _childNames = nestedChildren.map(function (c, i) {
@@ -1,15 +1,21 @@
1
1
  import _some from "lodash/some";
2
2
  import _defaults from "lodash/defaults";
3
3
 
4
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
+
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
7
 
6
8
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
9
 
8
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+
12
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+
14
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
15
 
10
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
16
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
11
17
 
12
- function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
18
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
13
19
 
14
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
21
 
@@ -32,7 +38,7 @@ export var useAnimationState = function () {
32
38
 
33
39
  var setState = React.useCallback(function (newState) {
34
40
  _setState(function (oldState) {
35
- return _objectSpread({}, oldState, newState);
41
+ return _objectSpread(_objectSpread({}, oldState), newState);
36
42
  });
37
43
  }, [_setState]); // This is a copy of Wrapper.getAnimationProps
38
44
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable func-style */
2
1
  export var IMMUTABLE_ITERABLE = "@@__IMMUTABLE_ITERABLE__@@";
3
2
  export var IMMUTABLE_RECORD = "@@__IMMUTABLE_RECORD__@@";
4
3
  export var IMMUTABLE_LIST = "@@__IMMUTABLE_LIST__@@";
@@ -1,7 +1,5 @@
1
1
  import _defaults from "lodash/defaults";
2
2
 
3
- /* eslint-disable func-style */
4
-
5
3
  /* eslint-disable no-use-before-define */
6
4
  import * as Helpers from "./helpers";
7
5
 
@@ -1,4 +1,4 @@
1
- import * as d3Shape from "d3-shape";
1
+ import * as d3Shape from "victory-vendor/d3-shape";
2
2
 
3
3
  var defined = function (d) {
4
4
  var y = d._y1 !== undefined ? d._y1 : d._y;
@@ -2,7 +2,6 @@
2
2
 
3
3
  /* eslint-disable no-console */
4
4
  // TODO: Use "warning" npm module like React is switching to.
5
- // eslint-disable-next-line func-style
6
5
  export function warn(message) {
7
6
  if (process.env.NODE_ENV !== "production") {
8
7
  if (console && console.warn) {
@@ -0,0 +1,9 @@
1
+ export declare function circle(x: number, y: number, size: number): string;
2
+ export declare function square(x: number, y: number, size: number): string;
3
+ export declare function diamond(x: number, y: number, size: number): string;
4
+ export declare function triangleDown(x: number, y: number, size: number): string;
5
+ export declare function triangleUp(x: number, y: number, size: number): string;
6
+ export declare function plus(x: number, y: number, size: number): string;
7
+ export declare function cross(x: number, y: number, size: number): string;
8
+ export declare function minus(x: number, y: number, size: number): string;
9
+ export declare function star(x: number, y: number, size: number): string;
@@ -1,73 +1,71 @@
1
1
  import _range from "lodash/range";
2
- export default {
3
- circle: function (x, y, size) {
4
- return "M ".concat(x, ", ").concat(y, "\n m ").concat(-size, ", 0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(size * 2, ",0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(-size * 2, ",0");
5
- },
6
- square: function (x, y, size) {
7
- var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
2
+ export function circle(x, y, size) {
3
+ return "M ".concat(x, ", ").concat(y, "\n m ").concat(-size, ", 0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(size * 2, ",0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(-size * 2, ",0");
4
+ }
5
+ export function square(x, y, size) {
6
+ var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
8
7
 
9
- var x0 = x - baseSize;
10
- var y1 = y + baseSize;
11
- var distance = x + baseSize - x0;
12
- return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(distance, "\n h-").concat(distance, "\n z");
13
- },
14
- diamond: function (x, y, size) {
15
- var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
8
+ var x0 = x - baseSize;
9
+ var y1 = y + baseSize;
10
+ var distance = x + baseSize - x0;
11
+ return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(distance, "\n h-").concat(distance, "\n z");
12
+ }
13
+ export function diamond(x, y, size) {
14
+ var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
16
15
 
17
- var length = Math.sqrt(2 * (baseSize * baseSize));
18
- return "M ".concat(x, ", ").concat(y + length, "\n l ").concat(length, ", -").concat(length, "\n l -").concat(length, ", -").concat(length, "\n l -").concat(length, ", ").concat(length, "\n l ").concat(length, ", ").concat(length, "\n z");
19
- },
20
- triangleDown: function (x, y, size) {
21
- var height = size / 2 * Math.sqrt(3);
22
- var x0 = x - size;
23
- var x1 = x + size;
24
- var y0 = y - size;
25
- var y1 = y + height;
26
- return "M ".concat(x0, ", ").concat(y0, "\n L ").concat(x1, ", ").concat(y0, "\n L ").concat(x, ", ").concat(y1, "\n z");
27
- },
28
- triangleUp: function (x, y, size) {
29
- var height = size / 2 * Math.sqrt(3);
30
- var x0 = x - size;
31
- var x1 = x + size;
32
- var y0 = y - height;
33
- var y1 = y + size;
34
- return "M ".concat(x0, ", ").concat(y1, "\n L ").concat(x1, ", ").concat(y1, "\n L ").concat(x, ", ").concat(y0, "\n z");
35
- },
36
- plus: function (x, y, size) {
37
- var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
16
+ var length = Math.sqrt(2 * (baseSize * baseSize));
17
+ return "M ".concat(x, ", ").concat(y + length, "\n l ").concat(length, ", -").concat(length, "\n l -").concat(length, ", -").concat(length, "\n l -").concat(length, ", ").concat(length, "\n l ").concat(length, ", ").concat(length, "\n z");
18
+ }
19
+ export function triangleDown(x, y, size) {
20
+ var height = size / 2 * Math.sqrt(3);
21
+ var x0 = x - size;
22
+ var x1 = x + size;
23
+ var y0 = y - size;
24
+ var y1 = y + height;
25
+ return "M ".concat(x0, ", ").concat(y0, "\n L ").concat(x1, ", ").concat(y0, "\n L ").concat(x, ", ").concat(y1, "\n z");
26
+ }
27
+ export function triangleUp(x, y, size) {
28
+ var height = size / 2 * Math.sqrt(3);
29
+ var x0 = x - size;
30
+ var x1 = x + size;
31
+ var y0 = y - height;
32
+ var y1 = y + size;
33
+ return "M ".concat(x0, ", ").concat(y1, "\n L ").concat(x1, ", ").concat(y1, "\n L ").concat(x, ", ").concat(y0, "\n z");
34
+ }
35
+ export function plus(x, y, size) {
36
+ var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
38
37
 
39
- var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
38
+ var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
40
39
 
41
- return "\n M ".concat(x - distance / 2, ", ").concat(y + baseSize, "\n v-").concat(distance, "\n h-").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h-").concat(distance, "\n v").concat(distance, "\n z");
42
- },
43
- cross: function (x, y, size) {
44
- var baseSize = 0.8 * size; // eslint-disable-line no-magic-numbers
40
+ return "\n M ".concat(x - distance / 2, ", ").concat(y + baseSize, "\n v-").concat(distance, "\n h-").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h-").concat(distance, "\n v").concat(distance, "\n z");
41
+ }
42
+ export function cross(x, y, size) {
43
+ var baseSize = 0.8 * size; // eslint-disable-line no-magic-numbers
45
44
 
46
- var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
45
+ var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
47
46
 
48
- return "\n M ".concat(x - distance / 2, ", ").concat(y + baseSize + distance, "\n v-").concat(distance * 2, "\n h-").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h-").concat(distance, "\n v").concat(distance * 2, "\n z");
49
- },
50
- minus: function (x, y, size) {
51
- var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
47
+ return "\n M ".concat(x - distance / 2, ", ").concat(y + baseSize + distance, "\n v-").concat(distance * 2, "\n h-").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v-").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h").concat(distance, "\n v").concat(distance, "\n h-").concat(distance, "\n v").concat(distance * 2, "\n z");
48
+ }
49
+ export function minus(x, y, size) {
50
+ var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
52
51
 
53
- var lineHeight = baseSize - baseSize * 0.3; // eslint-disable-line no-magic-numbers
52
+ var lineHeight = baseSize - baseSize * 0.3; // eslint-disable-line no-magic-numbers
54
53
 
55
- var x0 = x - baseSize;
56
- var y1 = y + lineHeight / 2;
57
- var distance = x + baseSize - x0;
58
- return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(lineHeight, "\n h-").concat(distance, "\n z");
59
- },
60
- star: function (x, y, size) {
61
- var baseSize = 1.35 * size; // eslint-disable-line no-magic-numbers
54
+ var x0 = x - baseSize;
55
+ var y1 = y + lineHeight / 2;
56
+ var distance = x + baseSize - x0;
57
+ return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(lineHeight, "\n h-").concat(distance, "\n z");
58
+ }
59
+ export function star(x, y, size) {
60
+ var baseSize = 1.35 * size; // eslint-disable-line no-magic-numbers
62
61
 
63
- var angle = Math.PI / 5; // eslint-disable-line no-magic-numbers
64
- // eslint-disable-next-line no-magic-numbers
62
+ var angle = Math.PI / 5; // eslint-disable-line no-magic-numbers
63
+ // eslint-disable-next-line no-magic-numbers
65
64
 
66
- var starCoords = _range(10).map(function (index) {
67
- var length = index % 2 === 0 ? baseSize : baseSize / 2;
68
- return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y);
69
- });
65
+ var starCoords = _range(10).map(function (index) {
66
+ var length = index % 2 === 0 ? baseSize : baseSize / 2;
67
+ return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y);
68
+ });
70
69
 
71
- return "M ".concat(starCoords.join("L"), " z");
72
- }
73
- };
70
+ return "M ".concat(starCoords.join("L"), " z");
71
+ }
@@ -3,7 +3,7 @@ import _isFunction from "lodash/isFunction";
3
3
  import _includes from "lodash/includes";
4
4
  import * as Helpers from "./helpers";
5
5
  import * as Collection from "./collection";
6
- import * as d3Scale from "d3-scale";
6
+ import * as d3Scale from "victory-vendor/d3-scale";
7
7
  var supportedScaleStrings = ["linear", "time", "log", "sqrt"]; // Private Functions
8
8
 
9
9
  function toNewName(scale) {
@@ -106,29 +106,29 @@ export function getScaleFromProps(props, axis) {
106
106
  export function getScaleType(props, axis) {
107
107
  // if the scale was not given in props, it will be set to linear or time depending on data
108
108
  return getScaleTypeFromProps(props, axis) || getScaleTypeFromData(props, axis);
109
- }
109
+ } // Ordered type inference off of function fields.
110
+ // **Note**: Brittle because reliant on d3 internals.
111
+
112
+ var DUCK_TYPES = [{
113
+ name: "quantile",
114
+ method: "quantiles"
115
+ }, {
116
+ name: "log",
117
+ method: "base"
118
+ } // TODO(2214): Re-evaluate (1) duck typing approach, and (2) if duck typing,
119
+ // do we need a different approach? (Multiple keys? Stringifying functions?)
120
+ // https://github.com/FormidableLabs/victory/issues/2214
121
+ // Below are matches that don't seem to otherwise occur in Victory code base.
122
+ // { name: "ordinal", method: "unknown" },
123
+ // { name: "pow-sqrt", method: "exponent" },
124
+ // { name: "quantize-threshold", method: "invertExtent" }
125
+ ];
110
126
  export function getType(scale) {
111
127
  if (typeof scale === "string") {
112
128
  return scale;
113
129
  }
114
130
 
115
- var duckTypes = [{
116
- name: "log",
117
- method: "base"
118
- }, {
119
- name: "ordinal",
120
- method: "unknown"
121
- }, {
122
- name: "pow-sqrt",
123
- method: "exponent"
124
- }, {
125
- name: "quantile",
126
- method: "quantiles"
127
- }, {
128
- name: "quantize-threshold",
129
- method: "invertExtent"
130
- }];
131
- var scaleType = duckTypes.filter(function (type) {
131
+ var scaleType = DUCK_TYPES.filter(function (type) {
132
132
  return scale[type.method] !== undefined;
133
133
  })[0];
134
134
  return scaleType ? scaleType.name : undefined;
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { DomainPropType, ScalePropType, SVGCoordinateType } from "./types";
3
+
4
+ export function getParentSVG(evt: React.SyntheticEvent): string;
5
+
6
+ export function getSVGEventCoordinates(
7
+ evt: React.SyntheticEvent,
8
+ svg?: SVGElement
9
+ ): SVGCoordinateType;
10
+
11
+ export function getDomainCoordinates(
12
+ props: any,
13
+ domain?: DomainPropType
14
+ ): DomainPropType;
15
+
16
+ export function getDataCoordinates(
17
+ props: any,
18
+ scale: ScalePropType,
19
+ x: number,
20
+ y: number
21
+ ): SVGCoordinateType;
22
+
23
+ export function getBounds(props: any): SVGCoordinateType;
@@ -1,5 +1,3 @@
1
- /* eslint-disable func-style */
2
-
3
1
  /* eslint-disable no-use-before-define */
4
2
  import * as Collection from "./collection"; // Private Functions
5
3
 
@@ -1,5 +1,3 @@
1
- /* eslint-disable func-style */
2
-
3
1
  /**
4
2
  * Given an object with CSS/SVG transform definitions, return the string value
5
3
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -0,0 +1,8 @@
1
+ import { TextSizeStyleInterface } from "./types";
2
+
3
+ export function approximateTextSize(
4
+ text: string,
5
+ style?: TextSizeStyleInterface
6
+ ): { width: number; height: number };
7
+
8
+ export function convertLengthToPixels(length: string, fontSize: number): number;
@@ -1,13 +1,17 @@
1
1
  import _defaults from "lodash/defaults";
2
2
  import _assign from "lodash/assign";
3
3
 
4
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
4
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
5
 
6
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
6
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
7
 
8
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
8
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
9
 
10
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
10
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
+
12
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
+
14
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
11
15
 
12
16
  // Based on measuring specific character widths
13
17
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
@@ -116,10 +120,10 @@ var fonts = {
116
120
  Verdana: {
117
121
  widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.35, 0.39375, 0.459375, 0.81875, 0.6359375, 1.0765625, 0.759375, 0.26875, 0.4546875, 0.4546875, 0.6359375, 0.81875, 0.3640625, 0.4546875, 0.3640625, 0.4703125, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.4546875, 0.4546875, 0.81875, 0.81875, 0.81875, 0.546875, 1, 0.684375, 0.6859375, 0.6984375, 0.771875, 0.6328125, 0.575, 0.7765625, 0.7515625, 0.421875, 0.4546875, 0.69375, 0.5578125, 0.84375, 0.7484375, 0.7875, 0.603125, 0.7875, 0.7, 0.684375, 0.6171875, 0.7328125, 0.684375, 0.9890625, 0.6859375, 0.615625, 0.6859375, 0.4546875, 0.46875, 0.4546875, 0.81875, 0.6421875, 0.6359375, 0.6015625, 0.6234375, 0.521875, 0.6234375, 0.596875, 0.384375, 0.6234375, 0.6328125, 0.275, 0.3765625, 0.5921875, 0.275, 0.9734375, 0.6328125, 0.6078125, 0.6234375, 0.6234375, 0.43125, 0.521875, 0.3953125, 0.6328125, 0.5921875, 0.81875, 0.5921875, 0.5921875, 0.5265625, 0.6359375, 0.4546875, 0.6359375, 0.81875],
118
122
  avg: 0.6171875000000003
119
- } //https://developer.mozilla.org/en/docs/Web/CSS/length
120
- // Absolute sizes in pixels for obsolete measurement units.
123
+ }
124
+ }; //https://developer.mozilla.org/en/docs/Web/CSS/length
125
+ // Absolute sizes in pixels for obsolete measurement units.
121
126
 
122
- };
123
127
  var absoluteMeasurementUnitsToPixels = {
124
128
  mm: 3.8,
125
129
  sm: 38,
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import Timer from "./timer";
3
+ /**
4
+ * The React context object consumers may use to access or override the global
5
+ * timer.
6
+ */
7
+ declare const TimerContext: React.Context<{
8
+ transitionTimer: Timer;
9
+ animationTimer: Timer;
10
+ }>;
11
+ export default TimerContext;
@@ -5,7 +5,7 @@ import Timer from "./timer";
5
5
  * timer.
6
6
  */
7
7
 
8
- var TimerContext = React.createContext({
8
+ var TimerContext = /*#__PURE__*/React.createContext({
9
9
  transitionTimer: new Timer(),
10
10
  animationTimer: new Timer()
11
11
  });
@@ -0,0 +1,16 @@
1
+ declare type Callback = (elapsed: number, duration: number) => void;
2
+ export default class Timer {
3
+ private shouldAnimate;
4
+ private readonly subscribers;
5
+ private activeSubscriptions;
6
+ private timer;
7
+ constructor();
8
+ bypassAnimation(): void;
9
+ resumeAnimation(): void;
10
+ loop: () => void;
11
+ start(): void;
12
+ stop(): void;
13
+ subscribe(callback: Callback, duration: number): number;
14
+ unsubscribe(id: any): void;
15
+ }
16
+ export {};