victory-errorbar 36.8.1 → 36.8.3

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/es/error-bar.js CHANGED
@@ -109,14 +109,12 @@ var defaultProps = {
109
109
  role: "presentation",
110
110
  shapeRendering: "auto"
111
111
  };
112
- export var ErrorBar = function (props) {
113
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
114
- var _props = props,
115
- groupComponent = _props.groupComponent;
112
+ export var ErrorBar = function (initialProps) {
113
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
114
+ var groupComponent = props.groupComponent;
116
115
  var userProps = UserProps.getSafeUserProps(props);
117
- var _props2 = props,
118
- tabIndex = _props2.tabIndex,
119
- ariaLabel = _props2.ariaLabel;
116
+ var tabIndex = props.tabIndex,
117
+ ariaLabel = props.ariaLabel;
120
118
  var error = calculateError(props);
121
119
  var children = [error.right ? renderBorder(props, error, "right") : null, error.left ? renderBorder(props, error, "left") : null, error.bottom ? renderBorder(props, error, "bottom") : null, error.top ? renderBorder(props, error, "top") : null, error.right ? renderCross(props, error, "right") : null, error.left ? renderCross(props, error, "left") : null, error.bottom ? renderCross(props, error, "bottom") : null, error.top ? renderCross(props, error, "top") : null].filter(Boolean);
122
120
  return /*#__PURE__*/React.cloneElement(groupComponent, _objectSpread({
@@ -1,4 +1,4 @@
1
1
  export declare const getData: (props: any) => any;
2
2
  export declare const getDomain: (props: any, axis: any) => any;
3
- export declare const getBaseProps: (props: any, fallbackProps: any) => any;
3
+ export declare const getBaseProps: (initialProps: any, fallbackProps: any) => any;
4
4
  //# sourceMappingURL=helper-methods.d.ts.map
@@ -156,29 +156,30 @@ var getLabelProps = function (dataProps, text, style) {
156
156
  return _defaults({}, labelProps, Helpers.omit(tooltipTheme, ["style"]));
157
157
  };
158
158
 
159
- export var getBaseProps = function (props, fallbackProps) {
160
- var modifiedProps = Helpers.modifyProps(props, fallbackProps, "errorbar");
161
- props = _assign({}, modifiedProps, getCalculatedValues(modifiedProps));
162
- var _props = props,
163
- borderWidth = _props.borderWidth,
164
- data = _props.data,
165
- domain = _props.domain,
166
- events = _props.events,
167
- groupComponent = _props.groupComponent,
168
- height = _props.height,
169
- horizontal = _props.horizontal,
170
- labels = _props.labels,
171
- name = _props.name,
172
- origin = _props.origin,
173
- padding = _props.padding,
174
- polar = _props.polar,
175
- scale = _props.scale,
176
- sharedEvents = _props.sharedEvents,
177
- standalone = _props.standalone,
178
- style = _props.style,
179
- theme = _props.theme,
180
- width = _props.width,
181
- disableInlineStyles = _props.disableInlineStyles;
159
+ export var getBaseProps = function (initialProps, fallbackProps) {
160
+ var modifiedProps = Helpers.modifyProps(initialProps, fallbackProps, "errorbar");
161
+
162
+ var props = _assign({}, modifiedProps, getCalculatedValues(modifiedProps));
163
+
164
+ var borderWidth = props.borderWidth,
165
+ data = props.data,
166
+ domain = props.domain,
167
+ events = props.events,
168
+ groupComponent = props.groupComponent,
169
+ height = props.height,
170
+ horizontal = props.horizontal,
171
+ labels = props.labels,
172
+ name = props.name,
173
+ origin = props.origin,
174
+ padding = props.padding,
175
+ polar = props.polar,
176
+ scale = props.scale,
177
+ sharedEvents = props.sharedEvents,
178
+ standalone = props.standalone,
179
+ style = props.style,
180
+ theme = props.theme,
181
+ width = props.width,
182
+ disableInlineStyles = props.disableInlineStyles;
182
183
  var initialChildProps = {
183
184
  parent: {
184
185
  data: data,
@@ -205,13 +206,13 @@ export var getBaseProps = function (props, fallbackProps) {
205
206
  x = _Helpers$scalePoint.x,
206
207
  y = _Helpers$scalePoint.y;
207
208
 
208
- datum = formatDataFromDomain(datum, domain);
209
- var errorX = getErrors(props, datum, "x");
210
- var errorY = getErrors(props, datum, "y");
209
+ var formattedDatum = formatDataFromDomain(datum, domain);
210
+ var errorX = getErrors(props, formattedDatum, "x");
211
+ var errorY = getErrors(props, formattedDatum, "y");
211
212
  var dataProps = {
212
213
  borderWidth: borderWidth,
213
214
  data: data,
214
- datum: datum,
215
+ datum: formattedDatum,
215
216
  errorX: horizontal ? errorY : errorX,
216
217
  errorY: horizontal ? errorX : errorY,
217
218
  groupComponent: groupComponent,
@@ -37,6 +37,7 @@ declare class VictoryErrorBarBase extends React.Component<VictoryErrorBarProps>
37
37
  animate?: React.Validator<boolean | import("victory-core").AnimatePropTypeInterface | null | undefined> | undefined;
38
38
  colorScale?: React.Validator<import("victory-core").ColorScalePropType | null | undefined> | undefined;
39
39
  containerComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
40
+ disableInlineStyles?: React.Validator<boolean | null | undefined> | undefined;
40
41
  externalEventMutations?: React.Validator<import("victory-core").EventCallbackInterface<string | string[], StringOrNumberOrList>[] | null | undefined> | undefined;
41
42
  groupComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
42
43
  height?: React.Validator<number | null | undefined> | undefined;
@@ -115,7 +116,7 @@ export declare const VictoryErrorBar: {
115
116
  cacheValues(obj: any): void;
116
117
  getBaseProps(props: any, getSharedEventState: any): Record<string, object>;
117
118
  getAllEvents(props: any): any;
118
- getComponentProps(component: any, type: any, index: any): any;
119
+ getComponentProps(component: React.ReactNode, type: string, index: string | number): any;
119
120
  renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
120
121
  animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
121
122
  renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>;
package/lib/error-bar.js CHANGED
@@ -124,16 +124,14 @@ var defaultProps = {
124
124
  shapeRendering: "auto"
125
125
  };
126
126
 
127
- var ErrorBar = function (props) {
128
- props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), props));
129
- var _props = props,
130
- groupComponent = _props.groupComponent;
127
+ var ErrorBar = function (initialProps) {
128
+ var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
129
+ var groupComponent = props.groupComponent;
131
130
 
132
131
  var userProps = _victoryCore.UserProps.getSafeUserProps(props);
133
132
 
134
- var _props2 = props,
135
- tabIndex = _props2.tabIndex,
136
- ariaLabel = _props2.ariaLabel;
133
+ var tabIndex = props.tabIndex,
134
+ ariaLabel = props.ariaLabel;
137
135
  var error = calculateError(props);
138
136
  var children = [error.right ? renderBorder(props, error, "right") : null, error.left ? renderBorder(props, error, "left") : null, error.bottom ? renderBorder(props, error, "bottom") : null, error.top ? renderBorder(props, error, "top") : null, error.right ? renderCross(props, error, "right") : null, error.left ? renderCross(props, error, "left") : null, error.bottom ? renderCross(props, error, "bottom") : null, error.top ? renderCross(props, error, "top") : null].filter(Boolean);
139
137
  return /*#__PURE__*/_react.default.cloneElement(groupComponent, _objectSpread({
@@ -1,4 +1,4 @@
1
1
  export declare const getData: (props: any) => any;
2
2
  export declare const getDomain: (props: any, axis: any) => any;
3
- export declare const getBaseProps: (props: any, fallbackProps: any) => any;
3
+ export declare const getBaseProps: (initialProps: any, fallbackProps: any) => any;
4
4
  //# sourceMappingURL=helper-methods.d.ts.map
@@ -180,30 +180,29 @@ var getLabelProps = function (dataProps, text, style) {
180
180
  return (0, _defaults2.default)({}, labelProps, _victoryCore.Helpers.omit(tooltipTheme, ["style"]));
181
181
  };
182
182
 
183
- var getBaseProps = function (props, fallbackProps) {
184
- var modifiedProps = _victoryCore.Helpers.modifyProps(props, fallbackProps, "errorbar");
185
-
186
- props = (0, _assign2.default)({}, modifiedProps, getCalculatedValues(modifiedProps));
187
- var _props = props,
188
- borderWidth = _props.borderWidth,
189
- data = _props.data,
190
- domain = _props.domain,
191
- events = _props.events,
192
- groupComponent = _props.groupComponent,
193
- height = _props.height,
194
- horizontal = _props.horizontal,
195
- labels = _props.labels,
196
- name = _props.name,
197
- origin = _props.origin,
198
- padding = _props.padding,
199
- polar = _props.polar,
200
- scale = _props.scale,
201
- sharedEvents = _props.sharedEvents,
202
- standalone = _props.standalone,
203
- style = _props.style,
204
- theme = _props.theme,
205
- width = _props.width,
206
- disableInlineStyles = _props.disableInlineStyles;
183
+ var getBaseProps = function (initialProps, fallbackProps) {
184
+ var modifiedProps = _victoryCore.Helpers.modifyProps(initialProps, fallbackProps, "errorbar");
185
+
186
+ var props = (0, _assign2.default)({}, modifiedProps, getCalculatedValues(modifiedProps));
187
+ var borderWidth = props.borderWidth,
188
+ data = props.data,
189
+ domain = props.domain,
190
+ events = props.events,
191
+ groupComponent = props.groupComponent,
192
+ height = props.height,
193
+ horizontal = props.horizontal,
194
+ labels = props.labels,
195
+ name = props.name,
196
+ origin = props.origin,
197
+ padding = props.padding,
198
+ polar = props.polar,
199
+ scale = props.scale,
200
+ sharedEvents = props.sharedEvents,
201
+ standalone = props.standalone,
202
+ style = props.style,
203
+ theme = props.theme,
204
+ width = props.width,
205
+ disableInlineStyles = props.disableInlineStyles;
207
206
  var initialChildProps = {
208
207
  parent: {
209
208
  data: data,
@@ -230,13 +229,13 @@ var getBaseProps = function (props, fallbackProps) {
230
229
  x = _Helpers$scalePoint.x,
231
230
  y = _Helpers$scalePoint.y;
232
231
 
233
- datum = formatDataFromDomain(datum, domain);
234
- var errorX = getErrors(props, datum, "x");
235
- var errorY = getErrors(props, datum, "y");
232
+ var formattedDatum = formatDataFromDomain(datum, domain);
233
+ var errorX = getErrors(props, formattedDatum, "x");
234
+ var errorY = getErrors(props, formattedDatum, "y");
236
235
  var dataProps = {
237
236
  borderWidth: borderWidth,
238
237
  data: data,
239
- datum: datum,
238
+ datum: formattedDatum,
240
239
  errorX: horizontal ? errorY : errorX,
241
240
  errorY: horizontal ? errorX : errorY,
242
241
  groupComponent: groupComponent,
@@ -37,6 +37,7 @@ declare class VictoryErrorBarBase extends React.Component<VictoryErrorBarProps>
37
37
  animate?: React.Validator<boolean | import("victory-core").AnimatePropTypeInterface | null | undefined> | undefined;
38
38
  colorScale?: React.Validator<import("victory-core").ColorScalePropType | null | undefined> | undefined;
39
39
  containerComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
40
+ disableInlineStyles?: React.Validator<boolean | null | undefined> | undefined;
40
41
  externalEventMutations?: React.Validator<import("victory-core").EventCallbackInterface<string | string[], StringOrNumberOrList>[] | null | undefined> | undefined;
41
42
  groupComponent?: React.Validator<React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined> | undefined;
42
43
  height?: React.Validator<number | null | undefined> | undefined;
@@ -115,7 +116,7 @@ export declare const VictoryErrorBar: {
115
116
  cacheValues(obj: any): void;
116
117
  getBaseProps(props: any, getSharedEventState: any): Record<string, object>;
117
118
  getAllEvents(props: any): any;
118
- getComponentProps(component: any, type: any, index: any): any;
119
+ getComponentProps(component: React.ReactNode, type: string, index: string | number): any;
119
120
  renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
120
121
  animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
121
122
  renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-errorbar",
3
- "version": "36.8.1",
3
+ "version": "36.8.3",
4
4
  "description": "Error Bar Component for Victory",
5
5
  "keywords": [
6
6
  "data visualization",
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "lodash": "^4.17.19",
24
24
  "prop-types": "^15.8.1",
25
- "victory-core": "^36.8.1"
25
+ "victory-core": "^36.8.3"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": ">=16.6.0"
package/src/error-bar.tsx CHANGED
@@ -116,8 +116,10 @@ const defaultProps = {
116
116
  shapeRendering: "auto",
117
117
  };
118
118
 
119
- export const ErrorBar = (props: ErrorBarProps & typeof ErrorBar.default) => {
120
- props = evaluateProps({ ...defaultProps, ...props });
119
+ export const ErrorBar = (
120
+ initialProps: ErrorBarProps & typeof ErrorBar.default,
121
+ ) => {
122
+ const props = evaluateProps({ ...defaultProps, ...initialProps });
121
123
  const { groupComponent } = props;
122
124
  const userProps = UserProps.getSafeUserProps(props);
123
125
  const { tabIndex, ariaLabel } = props;
@@ -165,9 +165,13 @@ const getLabelProps = (dataProps, text, style) => {
165
165
  return defaults({}, labelProps, Helpers.omit(tooltipTheme, ["style"]));
166
166
  };
167
167
 
168
- export const getBaseProps = (props, fallbackProps) => {
169
- const modifiedProps = Helpers.modifyProps(props, fallbackProps, "errorbar");
170
- props = assign({}, modifiedProps, getCalculatedValues(modifiedProps));
168
+ export const getBaseProps = (initialProps, fallbackProps) => {
169
+ const modifiedProps = Helpers.modifyProps(
170
+ initialProps,
171
+ fallbackProps,
172
+ "errorbar",
173
+ );
174
+ const props = assign({}, modifiedProps, getCalculatedValues(modifiedProps));
171
175
  const {
172
176
  borderWidth,
173
177
  data,
@@ -210,13 +214,13 @@ export const getBaseProps = (props, fallbackProps) => {
210
214
  return data.reduce((childProps, datum, index) => {
211
215
  const eventKey = !isNil(datum.eventKey) ? datum.eventKey : index;
212
216
  const { x, y } = Helpers.scalePoint(assign({}, props, { scale }), datum);
213
- datum = formatDataFromDomain(datum, domain);
214
- const errorX = getErrors(props, datum, "x");
215
- const errorY = getErrors(props, datum, "y");
217
+ const formattedDatum = formatDataFromDomain(datum, domain);
218
+ const errorX = getErrors(props, formattedDatum, "x");
219
+ const errorY = getErrors(props, formattedDatum, "y");
216
220
  const dataProps = {
217
221
  borderWidth,
218
222
  data,
219
- datum,
223
+ datum: formattedDatum,
220
224
  errorX: horizontal ? errorY : errorX,
221
225
  errorY: horizontal ? errorX : errorY,
222
226
  groupComponent,