victory-errorbar 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-errorbar.js +16275 -16704
- package/dist/victory-errorbar.min.js +1 -1
- package/es/error-bar.js +20 -15
- package/es/victory-errorbar.js +52 -90
- package/lib/error-bar.js +21 -14
- package/lib/helper-methods.js +1 -1
- package/lib/index.js +4 -4
- package/lib/victory-errorbar.js +52 -92
- package/package.json +5 -5
- package/src/error-bar.js +8 -5
- package/src/victory-errorbar.js +5 -6
package/src/error-bar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-statements */
|
|
2
2
|
import React from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { Helpers, CommonProps, Line } from "victory-core";
|
|
4
|
+
import { Helpers, CommonProps, Line, UserProps } from "victory-core";
|
|
5
5
|
import { assign } from "lodash";
|
|
6
6
|
|
|
7
7
|
const renderBorder = (props, error, type) => {
|
|
@@ -17,7 +17,8 @@ const renderBorder = (props, error, type) => {
|
|
|
17
17
|
x1: vertical ? error[type] : props.x - props.borderWidth,
|
|
18
18
|
x2: vertical ? error[type] : props.x + props.borderWidth,
|
|
19
19
|
y1: vertical ? props.y - props.borderWidth : error[type],
|
|
20
|
-
y2: vertical ? props.y + props.borderWidth : error[type]
|
|
20
|
+
y2: vertical ? props.y + props.borderWidth : error[type],
|
|
21
|
+
"data-type": `border-${type}`
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
24
|
|
|
@@ -34,7 +35,8 @@ const renderCross = (props, error, type) => {
|
|
|
34
35
|
x1: props.x,
|
|
35
36
|
x2: vertical ? props.x : error[type],
|
|
36
37
|
y1: props.y,
|
|
37
|
-
y2: vertical ? error[type] : props.y
|
|
38
|
+
y2: vertical ? error[type] : props.y,
|
|
39
|
+
"data-type": `cross-${type}`
|
|
38
40
|
});
|
|
39
41
|
};
|
|
40
42
|
|
|
@@ -80,7 +82,8 @@ const evaluateProps = (props) => {
|
|
|
80
82
|
|
|
81
83
|
const ErrorBar = (props) => {
|
|
82
84
|
props = evaluateProps(props);
|
|
83
|
-
const
|
|
85
|
+
const userProps = UserProps.getSafeUserProps(props);
|
|
86
|
+
const { tabIndex, ariaLabel } = props;
|
|
84
87
|
const error = calculateError(props);
|
|
85
88
|
const children = [
|
|
86
89
|
error.right ? renderBorder(props, error, "right") : null,
|
|
@@ -94,7 +97,7 @@ const ErrorBar = (props) => {
|
|
|
94
97
|
].filter(Boolean);
|
|
95
98
|
return React.cloneElement(
|
|
96
99
|
props.groupComponent,
|
|
97
|
-
{ "aria-label": ariaLabel,
|
|
100
|
+
{ tabIndex, "aria-label": ariaLabel, ...userProps },
|
|
98
101
|
children
|
|
99
102
|
);
|
|
100
103
|
};
|
package/src/victory-errorbar.js
CHANGED
|
@@ -106,13 +106,12 @@ class VictoryErrorBar extends React.Component {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const children = this.renderData(props);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
);
|
|
113
|
-
return props.standalone
|
|
114
|
-
? this.renderContainer(container, children)
|
|
109
|
+
|
|
110
|
+
const component = props.standalone
|
|
111
|
+
? this.renderContainer(props.containerComponent, children)
|
|
115
112
|
: children;
|
|
113
|
+
|
|
114
|
+
return UserProps.withSafeUserProps(component, props);
|
|
116
115
|
}
|
|
117
116
|
}
|
|
118
117
|
|