victory-errorbar 37.3.2 → 37.3.4
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/CHANGELOG.md +8 -0
- package/dist/victory-errorbar.js +294 -248
- package/dist/victory-errorbar.min.js +1 -1
- package/es/error-bar.d.ts +4 -1
- package/es/error-bar.js +2 -2
- package/es/helper-methods.js +4 -4
- package/es/victory-errorbar.d.ts +8 -8
- package/lib/error-bar.d.ts +4 -1
- package/lib/error-bar.js +2 -2
- package/lib/helper-methods.js +4 -4
- package/lib/victory-errorbar.d.ts +8 -8
- package/package.json +2 -30
- package/src/error-bar.tsx +1 -1
- package/src/helper-methods.tsx +2 -1
package/es/error-bar.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { VictoryCommonPrimitiveProps } from "victory-core";
|
|
2
|
+
import { VictoryCommonPrimitiveProps, EventsMixinClass } from "victory-core";
|
|
3
3
|
export interface ErrorBarProps extends VictoryCommonPrimitiveProps {
|
|
4
4
|
borderWidth?: number;
|
|
5
5
|
datum?: any;
|
|
@@ -28,5 +28,8 @@ export interface ErrorProps {
|
|
|
28
28
|
errorIndex: number;
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
+
interface ErrorBar extends EventsMixinClass<ErrorBarProps> {
|
|
32
|
+
}
|
|
31
33
|
export declare const ErrorBar: any;
|
|
34
|
+
export {};
|
|
32
35
|
//# sourceMappingURL=error-bar.d.ts.map
|
package/es/error-bar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _defaults from "lodash/defaults";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import defaults from "lodash/defaults";
|
|
3
3
|
import { Helpers, Line, UserProps } from "victory-core";
|
|
4
4
|
const renderBorder = (props, error, type) => {
|
|
5
5
|
const vertical = type === "right" || type === "left";
|
|
@@ -104,7 +104,7 @@ const defaultProps = {
|
|
|
104
104
|
shapeRendering: "auto"
|
|
105
105
|
};
|
|
106
106
|
export const ErrorBar = initialProps => {
|
|
107
|
-
const props = evaluateProps(
|
|
107
|
+
const props = evaluateProps(defaults({}, initialProps, defaultProps));
|
|
108
108
|
const {
|
|
109
109
|
groupComponent
|
|
110
110
|
} = props;
|
package/es/helper-methods.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import assign from "lodash/assign";
|
|
2
|
+
import defaults from "lodash/defaults";
|
|
3
3
|
import { Helpers, LabelHelpers, Scale, Domain, Data, Collection } from "victory-core";
|
|
4
4
|
const getErrors = (props, datum, axis) => {
|
|
5
5
|
/**
|
|
@@ -143,7 +143,7 @@ const getLabelProps = (dataProps, text, style) => {
|
|
|
143
143
|
return labelProps;
|
|
144
144
|
}
|
|
145
145
|
const tooltipTheme = theme && theme.tooltip || {};
|
|
146
|
-
return
|
|
146
|
+
return defaults({}, labelProps, Helpers.omit(tooltipTheme, ["style"]));
|
|
147
147
|
};
|
|
148
148
|
export const getBaseProps = (initialProps, fallbackProps) => {
|
|
149
149
|
const modifiedProps = Helpers.modifyProps(initialProps, fallbackProps, "errorbar");
|
|
@@ -191,7 +191,7 @@ export const getBaseProps = (initialProps, fallbackProps) => {
|
|
|
191
191
|
const {
|
|
192
192
|
x,
|
|
193
193
|
y
|
|
194
|
-
} = Helpers.scalePoint(
|
|
194
|
+
} = Helpers.scalePoint(assign({}, props, {
|
|
195
195
|
scale
|
|
196
196
|
}), datum);
|
|
197
197
|
const formattedDatum = formatDataFromDomain(datum, domain);
|
package/es/victory-errorbar.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EventPropTypeInterface, StringOrNumberOrCallback, StringOrNumberOrList, VictoryDatableProps, VictoryCommonProps, VictoryMultiLabelableProps, VictoryStyleInterface, EventsMixinClass } from "victory-core";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type VictoryErrorBarTTargetType = "data" | "labels" | "parent";
|
|
4
|
+
export type ErrorType = StringOrNumberOrList | ((...args: any[]) => StringOrNumberOrList);
|
|
5
5
|
export interface VictoryErrorBarProps extends Omit<VictoryCommonProps, "polar">, VictoryDatableProps, VictoryMultiLabelableProps {
|
|
6
6
|
borderWidth?: number;
|
|
7
7
|
errorX?: ErrorType;
|
|
@@ -50,9 +50,9 @@ export declare const VictoryErrorBar: {
|
|
|
50
50
|
getAllEvents(props: any): any;
|
|
51
51
|
getComponentProps(component: React.ReactNode, type: string, index: string | number): any;
|
|
52
52
|
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
53
|
-
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement
|
|
53
|
+
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement;
|
|
54
54
|
renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
55
|
-
renderData(props: any, shouldRenderDatum?: (
|
|
55
|
+
renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
56
56
|
context: unknown;
|
|
57
57
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("victory-core").EventMixinCommonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
58
58
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
@@ -69,17 +69,17 @@ export declare const VictoryErrorBar: {
|
|
|
69
69
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextContext: any): void;
|
|
70
70
|
componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
71
71
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
72
|
-
componentEvents: import("@/victory-core/lib/victory-util/events").ComponentEvent
|
|
72
|
+
componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
|
|
73
73
|
getSharedEventState: (key: string, value: string) => unknown;
|
|
74
74
|
baseProps: Record<string, object>;
|
|
75
75
|
dataKeys: string[];
|
|
76
76
|
hasEvents: unknown;
|
|
77
77
|
events: unknown;
|
|
78
78
|
};
|
|
79
|
-
getBaseProps?(props: import("victory-core").EventMixinCommonProps):
|
|
80
|
-
role?:
|
|
79
|
+
getBaseProps?(props: import("victory-core").EventMixinCommonProps): import("victory-core").EventMixinCalculatedValues["baseProps"];
|
|
80
|
+
role?: import("victory-core").VictoryComponentRole;
|
|
81
81
|
expectedComponents?: string[] | undefined;
|
|
82
|
-
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: React.ReactNode
|
|
82
|
+
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: Array<React.ReactNode>, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined;
|
|
83
83
|
animationWhitelist?: string[] | undefined;
|
|
84
84
|
} & typeof VictoryErrorBarBase;
|
|
85
85
|
export {};
|
package/lib/error-bar.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { VictoryCommonPrimitiveProps } from "victory-core";
|
|
2
|
+
import { VictoryCommonPrimitiveProps, EventsMixinClass } from "victory-core";
|
|
3
3
|
export interface ErrorBarProps extends VictoryCommonPrimitiveProps {
|
|
4
4
|
borderWidth?: number;
|
|
5
5
|
datum?: any;
|
|
@@ -28,5 +28,8 @@ export interface ErrorProps {
|
|
|
28
28
|
errorIndex: number;
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
+
interface ErrorBar extends EventsMixinClass<ErrorBarProps> {
|
|
32
|
+
}
|
|
31
33
|
export declare const ErrorBar: any;
|
|
34
|
+
export {};
|
|
32
35
|
//# sourceMappingURL=error-bar.d.ts.map
|
package/lib/error-bar.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ErrorBar = void 0;
|
|
7
|
-
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
|
9
9
|
var _victoryCore = require("victory-core");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
const renderBorder = (props, error, type) => {
|
|
@@ -111,7 +111,7 @@ const defaultProps = {
|
|
|
111
111
|
shapeRendering: "auto"
|
|
112
112
|
};
|
|
113
113
|
const ErrorBar = initialProps => {
|
|
114
|
-
const props = evaluateProps((0,
|
|
114
|
+
const props = evaluateProps((0, _defaults.default)({}, initialProps, defaultProps));
|
|
115
115
|
const {
|
|
116
116
|
groupComponent
|
|
117
117
|
} = props;
|
package/lib/helper-methods.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getDomain = exports.getData = exports.getBaseProps = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _assign = _interopRequireDefault(require("lodash/assign"));
|
|
8
|
+
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
|
9
9
|
var _victoryCore = require("victory-core");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
const getErrors = (props, datum, axis) => {
|
|
@@ -152,7 +152,7 @@ const getLabelProps = (dataProps, text, style) => {
|
|
|
152
152
|
return labelProps;
|
|
153
153
|
}
|
|
154
154
|
const tooltipTheme = theme && theme.tooltip || {};
|
|
155
|
-
return (0,
|
|
155
|
+
return (0, _defaults.default)({}, labelProps, _victoryCore.Helpers.omit(tooltipTheme, ["style"]));
|
|
156
156
|
};
|
|
157
157
|
const getBaseProps = (initialProps, fallbackProps) => {
|
|
158
158
|
const modifiedProps = _victoryCore.Helpers.modifyProps(initialProps, fallbackProps, "errorbar");
|
|
@@ -200,7 +200,7 @@ const getBaseProps = (initialProps, fallbackProps) => {
|
|
|
200
200
|
const {
|
|
201
201
|
x,
|
|
202
202
|
y
|
|
203
|
-
} = _victoryCore.Helpers.scalePoint((0,
|
|
203
|
+
} = _victoryCore.Helpers.scalePoint((0, _assign.default)({}, props, {
|
|
204
204
|
scale
|
|
205
205
|
}), datum);
|
|
206
206
|
const formattedDatum = formatDataFromDomain(datum, domain);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EventPropTypeInterface, StringOrNumberOrCallback, StringOrNumberOrList, VictoryDatableProps, VictoryCommonProps, VictoryMultiLabelableProps, VictoryStyleInterface, EventsMixinClass } from "victory-core";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type VictoryErrorBarTTargetType = "data" | "labels" | "parent";
|
|
4
|
+
export type ErrorType = StringOrNumberOrList | ((...args: any[]) => StringOrNumberOrList);
|
|
5
5
|
export interface VictoryErrorBarProps extends Omit<VictoryCommonProps, "polar">, VictoryDatableProps, VictoryMultiLabelableProps {
|
|
6
6
|
borderWidth?: number;
|
|
7
7
|
errorX?: ErrorType;
|
|
@@ -50,9 +50,9 @@ export declare const VictoryErrorBar: {
|
|
|
50
50
|
getAllEvents(props: any): any;
|
|
51
51
|
getComponentProps(component: React.ReactNode, type: string, index: string | number): any;
|
|
52
52
|
renderContainer(component: any, children: any): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
53
|
-
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement
|
|
53
|
+
animateComponent(props: import("victory-core").EventMixinCommonProps, defaultAnimationWhitelist: string[]): React.ReactElement;
|
|
54
54
|
renderContinuousData(props: import("victory-core").EventMixinCommonProps): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
55
|
-
renderData(props: any, shouldRenderDatum?: (
|
|
55
|
+
renderData(props: any, shouldRenderDatum?: (datum: any) => boolean): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
56
56
|
context: unknown;
|
|
57
57
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("victory-core").EventMixinCommonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
58
58
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
@@ -69,17 +69,17 @@ export declare const VictoryErrorBar: {
|
|
|
69
69
|
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextContext: any): void;
|
|
70
70
|
componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
71
71
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("victory-core").EventMixinCommonProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
72
|
-
componentEvents: import("@/victory-core/lib/victory-util/events").ComponentEvent
|
|
72
|
+
componentEvents: Array<import("@/victory-core/lib/victory-util/events").ComponentEvent>;
|
|
73
73
|
getSharedEventState: (key: string, value: string) => unknown;
|
|
74
74
|
baseProps: Record<string, object>;
|
|
75
75
|
dataKeys: string[];
|
|
76
76
|
hasEvents: unknown;
|
|
77
77
|
events: unknown;
|
|
78
78
|
};
|
|
79
|
-
getBaseProps?(props: import("victory-core").EventMixinCommonProps):
|
|
80
|
-
role?:
|
|
79
|
+
getBaseProps?(props: import("victory-core").EventMixinCommonProps): import("victory-core").EventMixinCalculatedValues["baseProps"];
|
|
80
|
+
role?: import("victory-core").VictoryComponentRole;
|
|
81
81
|
expectedComponents?: string[] | undefined;
|
|
82
|
-
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: React.ReactNode
|
|
82
|
+
getChildren?: ((props: import("victory-core").EventMixinCommonProps, childComponents?: Array<React.ReactNode>, calculatedProps?: import("victory-core").EventMixinCommonProps | undefined) => void) | undefined;
|
|
83
83
|
animationWhitelist?: string[] | undefined;
|
|
84
84
|
} & typeof VictoryErrorBarBase;
|
|
85
85
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-errorbar",
|
|
3
|
-
"version": "37.3.
|
|
3
|
+
"version": "37.3.4",
|
|
4
4
|
"description": "Error Bar Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
|
-
"victory-core": "37.3.
|
|
24
|
+
"victory-core": "37.3.4"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"victory-vendor": "*"
|
|
@@ -183,32 +183,6 @@
|
|
|
183
183
|
"pnpm-lock.yaml"
|
|
184
184
|
]
|
|
185
185
|
},
|
|
186
|
-
"format": {
|
|
187
|
-
"command": "nps format:pkg",
|
|
188
|
-
"files": [
|
|
189
|
-
"src/**",
|
|
190
|
-
"*.json",
|
|
191
|
-
"../../.prettierignore",
|
|
192
|
-
"../../.prettierrc.json"
|
|
193
|
-
],
|
|
194
|
-
"output": [],
|
|
195
|
-
"packageLocks": [
|
|
196
|
-
"pnpm-lock.yaml"
|
|
197
|
-
]
|
|
198
|
-
},
|
|
199
|
-
"format:fix": {
|
|
200
|
-
"command": "pnpm run format || nps format:pkg:fix",
|
|
201
|
-
"files": [
|
|
202
|
-
"src/**",
|
|
203
|
-
"*.json",
|
|
204
|
-
"../../.prettierignore",
|
|
205
|
-
"../../.prettierrc.json"
|
|
206
|
-
],
|
|
207
|
-
"output": [],
|
|
208
|
-
"packageLocks": [
|
|
209
|
-
"pnpm-lock.yaml"
|
|
210
|
-
]
|
|
211
|
-
},
|
|
212
186
|
"lint": {
|
|
213
187
|
"command": "eslint src",
|
|
214
188
|
"files": [
|
|
@@ -271,8 +245,6 @@
|
|
|
271
245
|
"check": "wireit",
|
|
272
246
|
"types:check": "wireit",
|
|
273
247
|
"types:create": "wireit",
|
|
274
|
-
"format": "wireit",
|
|
275
|
-
"format:fix": "wireit",
|
|
276
248
|
"lint": "wireit",
|
|
277
249
|
"lint:fix": "wireit",
|
|
278
250
|
"jest": "wireit"
|
package/src/error-bar.tsx
CHANGED
package/src/helper-methods.tsx
CHANGED