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.
- package/dist/victory-core.js +15084 -15018
- package/dist/victory-core.min.js +1 -1
- package/es/index.d.ts +38 -941
- package/es/index.js +19 -28
- package/es/types.d.ts +33 -0
- package/es/types.js +1 -0
- package/es/victory-accessible-group/victory-accessible-group.d.ts +25 -0
- package/es/victory-accessible-group/victory-accessible-group.js +35 -45
- package/es/victory-animation/util.d.ts +66 -0
- package/es/victory-animation/util.js +3 -2
- package/es/victory-animation/victory-animation.d.ts +69 -0
- package/es/victory-animation/victory-animation.js +92 -102
- package/es/victory-clip-container/victory-clip-container.d.ts +76 -0
- package/es/victory-clip-container/victory-clip-container.js +75 -82
- package/es/victory-container/victory-container.d.ts +99 -0
- package/es/victory-container/victory-container.js +97 -107
- package/es/victory-label/victory-label.d.ts +61 -0
- package/es/victory-label/victory-label.js +43 -31
- package/es/victory-portal/portal-context.d.ts +11 -0
- package/es/victory-portal/portal-context.js +3 -4
- package/es/victory-portal/portal.d.ts +28 -0
- package/es/victory-portal/portal.js +44 -50
- package/es/victory-portal/victory-portal.d.ts +31 -0
- package/es/victory-portal/victory-portal.js +38 -47
- package/es/victory-primitives/arc.d.ts +21 -0
- package/es/victory-primitives/arc.js +9 -9
- package/es/victory-primitives/background.d.ts +22 -0
- package/es/victory-primitives/background.js +12 -12
- package/es/victory-primitives/border.d.ts +18 -0
- package/es/victory-primitives/border.js +9 -9
- package/es/victory-primitives/circle.d.ts +2 -0
- package/es/victory-primitives/circle.js +17 -10
- package/es/victory-primitives/clip-path.d.ts +14 -0
- package/es/victory-primitives/clip-path.js +6 -6
- package/es/victory-primitives/index.d.ts +14 -0
- package/es/victory-primitives/index.js +14 -0
- package/es/victory-primitives/line-segment.d.ts +19 -0
- package/es/victory-primitives/line-segment.js +9 -9
- package/es/victory-primitives/line.d.ts +2 -0
- package/es/victory-primitives/line.js +17 -10
- package/es/victory-primitives/path.d.ts +2 -0
- package/es/victory-primitives/path.js +15 -8
- package/es/victory-primitives/point.d.ts +21 -0
- package/es/victory-primitives/point.js +15 -23
- package/es/victory-primitives/rect.d.ts +2 -0
- package/es/victory-primitives/rect.js +17 -10
- package/es/victory-primitives/text.d.ts +16 -0
- package/es/victory-primitives/text.js +13 -8
- package/es/victory-primitives/tspan.d.ts +2 -0
- package/es/victory-primitives/tspan.js +7 -6
- package/es/victory-primitives/types.d.ts +7 -0
- package/es/victory-primitives/types.js +1 -0
- package/es/victory-primitives/whisker.d.ts +24 -0
- package/es/victory-primitives/whisker.js +12 -12
- package/es/victory-theme/grayscale.d.ts +2 -0
- package/es/victory-theme/grayscale.js +1 -1
- package/es/victory-theme/material.d.ts +2 -0
- package/es/victory-theme/material.js +1 -1
- package/es/victory-theme/victory-theme-definition.d.ts +244 -0
- package/es/victory-theme/victory-theme-definition.js +1 -0
- package/es/victory-theme/victory-theme.d.ts +5 -0
- package/es/victory-theme/victory-theme.js +6 -5
- package/es/victory-transition/victory-transition.d.ts +59 -0
- package/es/victory-transition/victory-transition.js +38 -44
- package/es/victory-util/add-events.js +328 -319
- package/es/victory-util/axis.js +12 -6
- package/es/victory-util/collection.js +7 -5
- package/es/victory-util/common-props.js +2 -2
- package/es/victory-util/data.js +8 -6
- package/es/victory-util/default-transitions.js +0 -1
- package/es/victory-util/domain.js +7 -5
- package/es/victory-util/events.js +8 -4
- package/es/victory-util/helpers.js +1 -3
- package/es/victory-util/hooks/use-animation-state.js +11 -5
- package/es/victory-util/immutable.js +0 -1
- package/es/victory-util/label-helpers.js +0 -2
- package/es/victory-util/line-helpers.js +1 -1
- package/es/victory-util/log.js +0 -1
- package/es/victory-util/point-path-helpers.d.ts +9 -0
- package/es/victory-util/point-path-helpers.js +59 -61
- package/es/victory-util/scale.js +19 -19
- package/es/victory-util/selection.d.ts +23 -0
- package/es/victory-util/selection.js +0 -2
- package/es/victory-util/style.js +0 -2
- package/es/victory-util/textsize.d.ts +8 -0
- package/es/victory-util/textsize.js +11 -7
- package/es/victory-util/timer-context.d.ts +11 -0
- package/es/victory-util/timer-context.js +1 -1
- package/es/victory-util/timer.d.ts +16 -0
- package/es/victory-util/timer.js +16 -13
- package/es/victory-util/types.d.ts +188 -0
- package/es/victory-util/types.js +1 -0
- package/es/victory-util/user-props.js +44 -4
- package/es/victory-util/wrapper.js +18 -12
- package/lib/index.d.ts +38 -941
- package/lib/index.js +201 -189
- package/lib/types.d.ts +33 -0
- package/lib/types.js +1 -0
- package/lib/victory-accessible-group/victory-accessible-group.d.ts +25 -0
- package/lib/victory-accessible-group/victory-accessible-group.js +37 -45
- package/lib/victory-animation/util.d.ts +66 -0
- package/lib/victory-animation/util.js +4 -3
- package/lib/victory-animation/victory-animation.d.ts +69 -0
- package/lib/victory-animation/victory-animation.js +97 -102
- package/lib/victory-clip-container/victory-clip-container.d.ts +76 -0
- package/lib/victory-clip-container/victory-clip-container.js +81 -82
- package/lib/victory-container/victory-container.d.ts +99 -0
- package/lib/victory-container/victory-container.js +102 -107
- package/lib/victory-label/victory-label.d.ts +61 -0
- package/lib/victory-label/victory-label.js +49 -32
- package/lib/victory-portal/portal-context.d.ts +11 -0
- package/lib/victory-portal/portal-context.js +4 -5
- package/lib/victory-portal/portal.d.ts +28 -0
- package/lib/victory-portal/portal.js +49 -50
- package/lib/victory-portal/victory-portal.d.ts +31 -0
- package/lib/victory-portal/victory-portal.js +43 -47
- package/lib/victory-primitives/arc.d.ts +21 -0
- package/lib/victory-primitives/arc.js +13 -10
- package/lib/victory-primitives/background.d.ts +22 -0
- package/lib/victory-primitives/background.js +16 -13
- package/lib/victory-primitives/border.d.ts +18 -0
- package/lib/victory-primitives/border.js +13 -10
- package/lib/victory-primitives/circle.d.ts +2 -0
- package/lib/victory-primitives/circle.js +17 -8
- package/lib/victory-primitives/clip-path.d.ts +14 -0
- package/lib/victory-primitives/clip-path.js +7 -5
- package/lib/victory-primitives/index.d.ts +14 -0
- package/lib/victory-primitives/index.js +187 -0
- package/lib/victory-primitives/line-segment.d.ts +19 -0
- package/lib/victory-primitives/line-segment.js +13 -10
- package/lib/victory-primitives/line.d.ts +2 -0
- package/lib/victory-primitives/line.js +17 -8
- package/lib/victory-primitives/path.d.ts +2 -0
- package/lib/victory-primitives/path.js +15 -6
- package/lib/victory-primitives/point.d.ts +21 -0
- package/lib/victory-primitives/point.js +21 -25
- package/lib/victory-primitives/rect.d.ts +2 -0
- package/lib/victory-primitives/rect.js +17 -8
- package/lib/victory-primitives/text.d.ts +16 -0
- package/lib/victory-primitives/text.js +14 -7
- package/lib/victory-primitives/tspan.d.ts +2 -0
- package/lib/victory-primitives/tspan.js +7 -4
- package/lib/victory-primitives/types.d.ts +7 -0
- package/lib/victory-primitives/types.js +1 -0
- package/lib/victory-primitives/whisker.d.ts +24 -0
- package/lib/victory-primitives/whisker.js +16 -13
- package/lib/victory-theme/grayscale.d.ts +2 -0
- package/lib/victory-theme/grayscale.js +3 -3
- package/lib/victory-theme/material.d.ts +2 -0
- package/lib/victory-theme/material.js +3 -3
- package/lib/victory-theme/victory-theme-definition.d.ts +244 -0
- package/lib/victory-theme/victory-theme-definition.js +1 -0
- package/lib/victory-theme/victory-theme.d.ts +5 -0
- package/lib/victory-theme/victory-theme.js +22 -8
- package/lib/victory-transition/victory-transition.d.ts +59 -0
- package/lib/victory-transition/victory-transition.js +43 -45
- package/lib/victory-util/add-events.js +326 -316
- package/lib/victory-util/axis.js +20 -11
- package/lib/victory-util/collection.js +10 -8
- package/lib/victory-util/common-props.js +6 -4
- package/lib/victory-util/data.js +13 -7
- package/lib/victory-util/default-transitions.js +1 -2
- package/lib/victory-util/domain.js +11 -5
- package/lib/victory-util/events.js +17 -11
- package/lib/victory-util/helpers.js +14 -16
- package/lib/victory-util/hooks/index.js +4 -4
- package/lib/victory-util/hooks/use-animation-state.js +14 -6
- package/lib/victory-util/immutable.js +3 -5
- package/lib/victory-util/label-helpers.js +6 -6
- package/lib/victory-util/line-helpers.js +4 -2
- package/lib/victory-util/log.js +0 -1
- package/lib/victory-util/point-path-helpers.d.ts +9 -0
- package/lib/victory-util/point-path-helpers.js +86 -73
- package/lib/victory-util/prop-types.js +5 -3
- package/lib/victory-util/scale.js +24 -21
- package/lib/victory-util/selection.d.ts +23 -0
- package/lib/victory-util/selection.js +5 -5
- package/lib/victory-util/style.js +0 -2
- package/lib/victory-util/textsize.d.ts +8 -0
- package/lib/victory-util/textsize.js +12 -8
- package/lib/victory-util/timer-context.d.ts +11 -0
- package/lib/victory-util/timer-context.js +1 -1
- package/lib/victory-util/timer.d.ts +16 -0
- package/lib/victory-util/timer.js +16 -13
- package/lib/victory-util/types.d.ts +188 -0
- package/lib/victory-util/types.js +1 -0
- package/lib/victory-util/user-props.js +53 -6
- package/lib/victory-util/wrapper.js +31 -23
- package/package.json +6 -13
- package/src/index.ts +42 -0
- package/src/types.ts +45 -0
- package/src/victory-accessible-group/{victory-accessible-group.js → victory-accessible-group.tsx} +10 -3
- package/src/victory-animation/{util.js → util.ts} +5 -4
- package/src/victory-animation/{victory-animation.js → victory-animation.tsx} +90 -13
- package/src/victory-clip-container/{victory-clip-container.js → victory-clip-container.tsx} +32 -6
- package/src/victory-container/{victory-container.js → victory-container.tsx} +70 -26
- package/src/victory-label/{victory-label.js → victory-label.tsx} +80 -19
- package/src/victory-portal/portal-context.ts +14 -0
- package/src/victory-portal/{portal.js → portal.tsx} +23 -12
- package/src/victory-portal/{victory-portal.js → victory-portal.tsx} +21 -6
- package/src/victory-primitives/{arc.js → arc.tsx} +15 -5
- package/src/victory-primitives/{background.js → background.tsx} +17 -7
- package/src/victory-primitives/{border.js → border.tsx} +12 -5
- package/src/victory-primitives/{circle.js → circle.tsx} +4 -3
- package/src/victory-primitives/clip-path.tsx +25 -0
- package/src/victory-primitives/index.ts +14 -0
- package/src/victory-primitives/{line-segment.js → line-segment.tsx} +13 -5
- package/src/victory-primitives/{line.js → line.tsx} +4 -3
- package/src/victory-primitives/{path.js → path.tsx} +4 -3
- package/src/victory-primitives/{point.js → point.tsx} +25 -20
- package/src/victory-primitives/{rect.js → rect.tsx} +4 -2
- package/src/victory-primitives/{text.js → text.tsx} +9 -3
- package/src/victory-primitives/tspan.tsx +7 -0
- package/src/victory-primitives/types.ts +19 -0
- package/src/victory-primitives/{whisker.js → whisker.tsx} +20 -7
- package/src/victory-theme/{grayscale.js → grayscale.tsx} +2 -1
- package/src/victory-theme/{material.js → material.tsx} +2 -1
- package/src/victory-theme/victory-theme-definition.ts +261 -0
- package/src/victory-theme/victory-theme.tsx +5 -0
- package/src/victory-transition/{victory-transition.js → victory-transition.tsx} +68 -19
- package/src/victory-util/add-events.js +7 -5
- package/src/victory-util/axis.js +3 -1
- package/src/victory-util/collection.js +0 -1
- package/src/victory-util/common-props.js +2 -2
- package/src/victory-util/data.js +0 -1
- package/src/victory-util/default-transitions.js +0 -1
- package/src/victory-util/domain.js +0 -1
- package/src/victory-util/events.js +1 -1
- package/src/victory-util/helpers.js +0 -1
- package/src/victory-util/immutable.js +0 -1
- package/src/victory-util/label-helpers.js +0 -1
- package/src/victory-util/line-helpers.js +1 -1
- package/src/victory-util/log.js +0 -1
- package/src/victory-util/point-path-helpers.ts +119 -0
- package/src/victory-util/prop-types.js +0 -1
- package/src/victory-util/scale.js +18 -10
- package/src/victory-util/selection.d.ts +23 -0
- package/src/victory-util/selection.js +0 -1
- package/src/victory-util/style.js +0 -1
- package/src/victory-util/textsize.d.ts +8 -0
- package/src/victory-util/{timer-context.js → timer-context.ts} +0 -0
- package/src/victory-util/{timer.js → timer.ts} +20 -5
- package/src/victory-util/transitions.js +0 -1
- package/src/victory-util/types.ts +247 -0
- package/src/victory-util/user-props.js +31 -1
- package/src/victory-util/wrapper.js +0 -1
- package/src/index.d.ts +0 -941
- package/src/index.js +0 -51
- package/src/victory-portal/portal-context.js +0 -10
- package/src/victory-primitives/clip-path.js +0 -18
- package/src/victory-primitives/tspan.js +0 -5
- package/src/victory-theme/victory-theme.js +0 -7
- package/src/victory-util/point-path-helpers.js +0 -121
|
@@ -3,81 +3,94 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.circle = circle;
|
|
7
|
+
exports.cross = cross;
|
|
8
|
+
exports.diamond = diamond;
|
|
9
|
+
exports.minus = minus;
|
|
10
|
+
exports.plus = plus;
|
|
11
|
+
exports.square = square;
|
|
12
|
+
exports.star = star;
|
|
13
|
+
exports.triangleDown = triangleDown;
|
|
14
|
+
exports.triangleUp = triangleUp;
|
|
7
15
|
|
|
8
16
|
var _range2 = _interopRequireDefault(require("lodash/range"));
|
|
9
17
|
|
|
10
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
19
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
20
|
+
function circle(x, y, size) {
|
|
21
|
+
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");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function square(x, y, size) {
|
|
25
|
+
var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
|
|
26
|
+
|
|
27
|
+
var x0 = x - baseSize;
|
|
28
|
+
var y1 = y + baseSize;
|
|
29
|
+
var distance = x + baseSize - x0;
|
|
30
|
+
return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(distance, "\n h-").concat(distance, "\n z");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function diamond(x, y, size) {
|
|
34
|
+
var baseSize = 0.87 * size; // eslint-disable-line no-magic-numbers
|
|
35
|
+
|
|
36
|
+
var length = Math.sqrt(2 * (baseSize * baseSize));
|
|
37
|
+
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");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function triangleDown(x, y, size) {
|
|
41
|
+
var height = size / 2 * Math.sqrt(3);
|
|
42
|
+
var x0 = x - size;
|
|
43
|
+
var x1 = x + size;
|
|
44
|
+
var y0 = y - size;
|
|
45
|
+
var y1 = y + height;
|
|
46
|
+
return "M ".concat(x0, ", ").concat(y0, "\n L ").concat(x1, ", ").concat(y0, "\n L ").concat(x, ", ").concat(y1, "\n z");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function triangleUp(x, y, size) {
|
|
50
|
+
var height = size / 2 * Math.sqrt(3);
|
|
51
|
+
var x0 = x - size;
|
|
52
|
+
var x1 = x + size;
|
|
53
|
+
var y0 = y - height;
|
|
54
|
+
var y1 = y + size;
|
|
55
|
+
return "M ".concat(x0, ", ").concat(y1, "\n L ").concat(x1, ", ").concat(y1, "\n L ").concat(x, ", ").concat(y0, "\n z");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function plus(x, y, size) {
|
|
59
|
+
var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
|
|
60
|
+
|
|
61
|
+
var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
|
|
62
|
+
|
|
63
|
+
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");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function cross(x, y, size) {
|
|
67
|
+
var baseSize = 0.8 * size; // eslint-disable-line no-magic-numbers
|
|
68
|
+
|
|
69
|
+
var distance = baseSize / 1.5; // eslint-disable-line no-magic-numbers
|
|
70
|
+
|
|
71
|
+
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");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function minus(x, y, size) {
|
|
75
|
+
var baseSize = 1.1 * size; // eslint-disable-line no-magic-numbers
|
|
76
|
+
|
|
77
|
+
var lineHeight = baseSize - baseSize * 0.3; // eslint-disable-line no-magic-numbers
|
|
78
|
+
|
|
79
|
+
var x0 = x - baseSize;
|
|
80
|
+
var y1 = y + lineHeight / 2;
|
|
81
|
+
var distance = x + baseSize - x0;
|
|
82
|
+
return "M ".concat(x0, ", ").concat(y1, "\n h").concat(distance, "\n v-").concat(lineHeight, "\n h-").concat(distance, "\n z");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function star(x, y, size) {
|
|
86
|
+
var baseSize = 1.35 * size; // eslint-disable-line no-magic-numbers
|
|
87
|
+
|
|
88
|
+
var angle = Math.PI / 5; // eslint-disable-line no-magic-numbers
|
|
89
|
+
// eslint-disable-next-line no-magic-numbers
|
|
90
|
+
|
|
91
|
+
var starCoords = (0, _range2.default)(10).map(function (index) {
|
|
92
|
+
var length = index % 2 === 0 ? baseSize : baseSize / 2;
|
|
93
|
+
return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y);
|
|
94
|
+
});
|
|
95
|
+
return "M ".concat(starCoords.join("L"), " z");
|
|
96
|
+
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.deprecated = deprecated;
|
|
7
6
|
exports.allOfType = allOfType;
|
|
8
|
-
exports.
|
|
7
|
+
exports.deprecated = deprecated;
|
|
8
|
+
exports.scale = exports.regExp = exports.nonNegative = exports.matchDataLength = exports.integer = exports.homogeneousArray = exports.greaterThanZero = exports.domain = void 0;
|
|
9
9
|
|
|
10
10
|
var _isRegExp2 = _interopRequireDefault(require("lodash/isRegExp"));
|
|
11
11
|
|
|
@@ -17,7 +17,9 @@ var Log = _interopRequireWildcard(require("./log"));
|
|
|
17
17
|
|
|
18
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
19
|
|
|
20
|
-
function
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getScaleFromName = getScaleFromName;
|
|
7
6
|
exports.getBaseScale = getBaseScale;
|
|
8
7
|
exports.getDefaultScale = getDefaultScale;
|
|
8
|
+
exports.getScaleFromName = getScaleFromName;
|
|
9
9
|
exports.getScaleFromProps = getScaleFromProps;
|
|
10
10
|
exports.getScaleType = getScaleType;
|
|
11
11
|
exports.getType = getType;
|
|
@@ -20,9 +20,11 @@ var Helpers = _interopRequireWildcard(require("./helpers"));
|
|
|
20
20
|
|
|
21
21
|
var Collection = _interopRequireWildcard(require("./collection"));
|
|
22
22
|
|
|
23
|
-
var d3Scale = _interopRequireWildcard(require("d3-scale"));
|
|
23
|
+
var d3Scale = _interopRequireWildcard(require("victory-vendor/d3-scale"));
|
|
24
24
|
|
|
25
|
-
function
|
|
25
|
+
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); }
|
|
26
|
+
|
|
27
|
+
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; }
|
|
26
28
|
|
|
27
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
30
|
|
|
@@ -132,30 +134,31 @@ function getScaleFromProps(props, axis) {
|
|
|
132
134
|
function getScaleType(props, axis) {
|
|
133
135
|
// if the scale was not given in props, it will be set to linear or time depending on data
|
|
134
136
|
return getScaleTypeFromProps(props, axis) || getScaleTypeFromData(props, axis);
|
|
135
|
-
}
|
|
137
|
+
} // Ordered type inference off of function fields.
|
|
138
|
+
// **Note**: Brittle because reliant on d3 internals.
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
var DUCK_TYPES = [{
|
|
142
|
+
name: "quantile",
|
|
143
|
+
method: "quantiles"
|
|
144
|
+
}, {
|
|
145
|
+
name: "log",
|
|
146
|
+
method: "base"
|
|
147
|
+
} // TODO(2214): Re-evaluate (1) duck typing approach, and (2) if duck typing,
|
|
148
|
+
// do we need a different approach? (Multiple keys? Stringifying functions?)
|
|
149
|
+
// https://github.com/FormidableLabs/victory/issues/2214
|
|
150
|
+
// Below are matches that don't seem to otherwise occur in Victory code base.
|
|
151
|
+
// { name: "ordinal", method: "unknown" },
|
|
152
|
+
// { name: "pow-sqrt", method: "exponent" },
|
|
153
|
+
// { name: "quantize-threshold", method: "invertExtent" }
|
|
154
|
+
];
|
|
136
155
|
|
|
137
156
|
function getType(scale) {
|
|
138
157
|
if (typeof scale === "string") {
|
|
139
158
|
return scale;
|
|
140
159
|
}
|
|
141
160
|
|
|
142
|
-
var
|
|
143
|
-
name: "log",
|
|
144
|
-
method: "base"
|
|
145
|
-
}, {
|
|
146
|
-
name: "ordinal",
|
|
147
|
-
method: "unknown"
|
|
148
|
-
}, {
|
|
149
|
-
name: "pow-sqrt",
|
|
150
|
-
method: "exponent"
|
|
151
|
-
}, {
|
|
152
|
-
name: "quantile",
|
|
153
|
-
method: "quantiles"
|
|
154
|
-
}, {
|
|
155
|
-
name: "quantize-threshold",
|
|
156
|
-
method: "invertExtent"
|
|
157
|
-
}];
|
|
158
|
-
var scaleType = duckTypes.filter(function (type) {
|
|
161
|
+
var scaleType = DUCK_TYPES.filter(function (type) {
|
|
159
162
|
return scale[type.method] !== undefined;
|
|
160
163
|
})[0];
|
|
161
164
|
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;
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getBounds = getBounds;
|
|
7
|
+
exports.getDataCoordinates = getDataCoordinates;
|
|
8
|
+
exports.getDomainCoordinates = getDomainCoordinates;
|
|
6
9
|
exports.getParentSVG = getParentSVG;
|
|
7
10
|
exports.getSVGEventCoordinates = getSVGEventCoordinates;
|
|
8
|
-
exports.getDomainCoordinates = getDomainCoordinates;
|
|
9
|
-
exports.getDataCoordinates = getDataCoordinates;
|
|
10
|
-
exports.getBounds = getBounds;
|
|
11
11
|
|
|
12
12
|
var Collection = _interopRequireWildcard(require("./collection"));
|
|
13
13
|
|
|
14
|
-
function
|
|
14
|
+
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); }
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
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; }
|
|
17
17
|
|
|
18
18
|
/* eslint-disable no-use-before-define */
|
|
19
19
|
// Private Functions
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getColorScale = getColorScale;
|
|
7
7
|
exports.toTransformString = void 0;
|
|
8
8
|
|
|
9
|
-
/* eslint-disable func-style */
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
10
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
13
11
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.convertLengthToPixels = exports.approximateTextSize = exports._approximateTextSizeInternal = void 0;
|
|
7
7
|
|
|
8
8
|
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
|
|
9
9
|
|
|
@@ -11,13 +11,17 @@ var _assign2 = _interopRequireDefault(require("lodash/assign"));
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
|
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
|
|
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
26
|
// Based on measuring specific character widths
|
|
23
27
|
// as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
|
|
@@ -126,10 +130,10 @@ var fonts = {
|
|
|
126
130
|
Verdana: {
|
|
127
131
|
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],
|
|
128
132
|
avg: 0.6171875000000003
|
|
129
|
-
}
|
|
130
|
-
|
|
133
|
+
}
|
|
134
|
+
}; //https://developer.mozilla.org/en/docs/Web/CSS/length
|
|
135
|
+
// Absolute sizes in pixels for obsolete measurement units.
|
|
131
136
|
|
|
132
|
-
};
|
|
133
137
|
var absoluteMeasurementUnitsToPixels = {
|
|
134
138
|
mm: 3.8,
|
|
135
139
|
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;
|
|
@@ -15,7 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
15
15
|
* The React context object consumers may use to access or override the global
|
|
16
16
|
* timer.
|
|
17
17
|
*/
|
|
18
|
-
var TimerContext = _react.default.createContext({
|
|
18
|
+
var TimerContext = /*#__PURE__*/_react.default.createContext({
|
|
19
19
|
transitionTimer: new _timer.default(),
|
|
20
20
|
animationTimer: new _timer.default()
|
|
21
21
|
});
|
|
@@ -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 {};
|
|
@@ -5,23 +5,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _d3Timer = require("d3-timer");
|
|
8
|
+
var _d3Timer = require("victory-vendor/d3-timer");
|
|
9
9
|
|
|
10
10
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
11
|
|
|
12
12
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
13
13
|
|
|
14
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
14
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15
15
|
|
|
16
|
-
var Timer =
|
|
17
|
-
/*#__PURE__*/
|
|
18
|
-
function () {
|
|
16
|
+
var Timer = /*#__PURE__*/function () {
|
|
19
17
|
function Timer() {
|
|
18
|
+
var _this = this;
|
|
19
|
+
|
|
20
20
|
_classCallCheck(this, Timer);
|
|
21
21
|
|
|
22
|
+
this.shouldAnimate = void 0;
|
|
23
|
+
this.subscribers = void 0;
|
|
24
|
+
this.activeSubscriptions = void 0;
|
|
25
|
+
this.timer = void 0;
|
|
26
|
+
|
|
27
|
+
this.loop = function () {
|
|
28
|
+
_this.subscribers.forEach(function (s) {
|
|
29
|
+
s.callback((0, _d3Timer.now)() - s.startTime, s.duration);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
22
33
|
this.shouldAnimate = true;
|
|
23
34
|
this.subscribers = [];
|
|
24
|
-
this.loop = this.loop.bind(this);
|
|
25
35
|
this.timer = null;
|
|
26
36
|
this.activeSubscriptions = 0;
|
|
27
37
|
}
|
|
@@ -36,13 +46,6 @@ function () {
|
|
|
36
46
|
value: function resumeAnimation() {
|
|
37
47
|
this.shouldAnimate = true;
|
|
38
48
|
}
|
|
39
|
-
}, {
|
|
40
|
-
key: "loop",
|
|
41
|
-
value: function loop() {
|
|
42
|
-
this.subscribers.forEach(function (s) {
|
|
43
|
-
s.callback((0, _d3Timer.now)() - s.startTime, s.duration);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
49
|
}, {
|
|
47
50
|
key: "start",
|
|
48
51
|
value: function start() {
|