victory-bar 36.6.4 → 36.6.5
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/es/{victory-bar-beta.d.ts → v37/victory-bar-v1.d.ts} +3 -2
- package/es/{victory-bar-beta.js → v37/victory-bar-v1.js} +4 -3
- package/es/v37/{victory-bar.d.ts → victory-bar-v2.d.ts} +3 -2
- package/es/v37/{victory-bar.js → victory-bar-v2.js} +2 -2
- package/es/v37/victory-bar.stories.d.ts +1 -1
- package/es/v37/victory-bar.stories.js +1 -1
- package/lib/{victory-bar-beta.d.ts → v37/victory-bar-v1.d.ts} +3 -2
- package/lib/{victory-bar-beta.js → v37/victory-bar-v1.js} +9 -7
- package/lib/v37/{victory-bar.d.ts → victory-bar-v2.d.ts} +3 -2
- package/lib/v37/{victory-bar.js → victory-bar-v2.js} +6 -6
- package/lib/v37/victory-bar.stories.d.ts +1 -1
- package/lib/v37/victory-bar.stories.js +4 -4
- package/package.json +3 -3
- package/src/{victory-bar-beta.tsx → v37/victory-bar-v1.tsx} +8 -6
- package/src/v37/{victory-bar.tsx → victory-bar-v2.tsx} +4 -4
- package/src/v37/victory-bar.stories.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# victory-bar
|
|
2
2
|
|
|
3
|
+
## 36.6.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`6f4972123`](https://github.com/FormidableLabs/victory/commit/6f49721238332bb5ee879571a45b34a04e44d416), [`6f4972123`](https://github.com/FormidableLabs/victory/commit/6f49721238332bb5ee879571a45b34a04e44d416)]:
|
|
8
|
+
- victory-core@36.6.5
|
|
9
|
+
- victory-vendor@36.6.5
|
|
10
|
+
|
|
3
11
|
## 36.6.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { NumberOrCallback, VictoryCommonProps, VictoryDatableProps
|
|
2
|
+
import { NumberOrCallback, VictoryCommonProps, VictoryDatableProps } from "victory-core";
|
|
3
|
+
import { VictoryProviderProps } from "victory-core/es/v37";
|
|
3
4
|
export declare type VictoryBarAlignmentType = "start" | "middle" | "end";
|
|
4
5
|
export interface VictoryBarProps extends VictoryCommonProps, VictoryDatableProps {
|
|
5
6
|
alignment?: VictoryBarAlignmentType;
|
|
@@ -20,4 +21,4 @@ export interface VictoryBarProps extends VictoryCommonProps, VictoryDatableProps
|
|
|
20
21
|
export declare function withContainer<Props extends VictoryCommonProps>(WrappedComponent: (props: Props) => React.ReactElement, initialProviderProps?: Partial<VictoryProviderProps>): (props: Props) => JSX.Element;
|
|
21
22
|
declare const _default: (props: VictoryBarProps) => JSX.Element;
|
|
22
23
|
export default _default;
|
|
23
|
-
//# sourceMappingURL=victory-bar-
|
|
24
|
+
//# sourceMappingURL=victory-bar-v1.d.ts.map
|
|
@@ -6,9 +6,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
|
|
7
7
|
/* eslint-disable react/no-multi-comp */
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
9
|
+
import { VictoryContainer } from "victory-core";
|
|
10
|
+
import { useData, useDomain, useScale, VictoryProvider } from "victory-core/es/v37";
|
|
11
|
+
import Bar from "../bar";
|
|
12
|
+
import { getBarPosition } from "../helper-methods"; // This is a demo component that uses VictoryProvider to access calculated props and state.
|
|
12
13
|
// This component does not include events, animations, or styling.
|
|
13
14
|
// To test out, swap out the VictoryBar export in ./index.js and run `pnpm run storybook:server`.
|
|
14
15
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Datum, NumberOrCallback
|
|
2
|
+
import { Datum, NumberOrCallback } from "victory-core";
|
|
3
|
+
import { VictoryCalculatedStateProps } from "victory-core/es/v37";
|
|
3
4
|
export declare type VictoryBarAlignmentType = "start" | "middle" | "end";
|
|
4
5
|
export interface VictoryBarProps extends VictoryCalculatedStateProps {
|
|
5
6
|
alignment?: VictoryBarAlignmentType;
|
|
@@ -20,4 +21,4 @@ export interface VictoryBarProps extends VictoryCalculatedStateProps {
|
|
|
20
21
|
}
|
|
21
22
|
declare const _default: React.FC<VictoryBarProps>;
|
|
22
23
|
export default _default;
|
|
23
|
-
//# sourceMappingURL=victory-bar.d.ts.map
|
|
24
|
+
//# sourceMappingURL=victory-bar-v2.d.ts.map
|
|
@@ -12,7 +12,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
12
12
|
|
|
13
13
|
/* eslint-disable react/no-multi-comp */
|
|
14
14
|
import * as React from "react";
|
|
15
|
-
import { useData, useDomain, useScale, useVictoryProviderSync, withContainer } from "victory-core";
|
|
15
|
+
import { useData, useDomain, useScale, useVictoryProviderSync, withContainer } from "victory-core/es/v37";
|
|
16
16
|
import Bar from "../bar";
|
|
17
17
|
import { getBarPosition } from "../helper-methods";
|
|
18
18
|
|
|
@@ -54,7 +54,7 @@ function VictoryBar(_ref) {
|
|
|
54
54
|
// component props. However, I am anticipating confusion about which props
|
|
55
55
|
// we will need to pass back up to the provider vs. the props that are only
|
|
56
56
|
// used in this component.
|
|
57
|
-
useVictoryProviderSync(
|
|
57
|
+
useVictoryProviderSync(_objectSpread({
|
|
58
58
|
data: data,
|
|
59
59
|
includeZero: includeZero,
|
|
60
60
|
sortOrder: sortOrder
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: React.FC<import("./victory-bar").VictoryBarProps>;
|
|
4
|
+
component: React.FC<import("./victory-bar-v2").VictoryBarProps>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
export declare const Demo: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/no-multi-comp */
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import VictoryBar from "./victory-bar";
|
|
3
|
+
import VictoryBar from "./victory-bar-v2";
|
|
4
4
|
import VictoryChart from "victory-chart/es/v37/victory-chart";
|
|
5
5
|
export default {
|
|
6
6
|
title: "v37/VictoryBar",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { NumberOrCallback, VictoryCommonProps, VictoryDatableProps
|
|
2
|
+
import { NumberOrCallback, VictoryCommonProps, VictoryDatableProps } from "victory-core";
|
|
3
|
+
import { VictoryProviderProps } from "victory-core/es/v37";
|
|
3
4
|
export declare type VictoryBarAlignmentType = "start" | "middle" | "end";
|
|
4
5
|
export interface VictoryBarProps extends VictoryCommonProps, VictoryDatableProps {
|
|
5
6
|
alignment?: VictoryBarAlignmentType;
|
|
@@ -20,4 +21,4 @@ export interface VictoryBarProps extends VictoryCommonProps, VictoryDatableProps
|
|
|
20
21
|
export declare function withContainer<Props extends VictoryCommonProps>(WrappedComponent: (props: Props) => React.ReactElement, initialProviderProps?: Partial<VictoryProviderProps>): (props: Props) => JSX.Element;
|
|
21
22
|
declare const _default: (props: VictoryBarProps) => JSX.Element;
|
|
22
23
|
export default _default;
|
|
23
|
-
//# sourceMappingURL=victory-bar-
|
|
24
|
+
//# sourceMappingURL=victory-bar-v1.d.ts.map
|
|
@@ -10,9 +10,11 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
|
|
11
11
|
var _victoryCore = require("victory-core");
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _v = require("victory-core/es/v37");
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _bar = _interopRequireDefault(require("../bar"));
|
|
16
|
+
|
|
17
|
+
var _helperMethods = require("../helper-methods");
|
|
16
18
|
|
|
17
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
20
|
|
|
@@ -62,10 +64,10 @@ function withContainer(WrappedComponent) {
|
|
|
62
64
|
containerComponent = _props$containerCompo === void 0 ? /*#__PURE__*/React.createElement(_victoryCore.VictoryContainer, null) : _props$containerCompo;
|
|
63
65
|
|
|
64
66
|
if (standalone) {
|
|
65
|
-
return /*#__PURE__*/React.createElement(
|
|
67
|
+
return /*#__PURE__*/React.createElement(_v.VictoryProvider, providerProps, /*#__PURE__*/React.cloneElement(containerComponent, providerProps, /*#__PURE__*/React.createElement(WrappedComponent, props)));
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
return /*#__PURE__*/React.createElement(
|
|
70
|
+
return /*#__PURE__*/React.createElement(_v.VictoryProvider, providerProps, /*#__PURE__*/React.createElement(WrappedComponent, props));
|
|
69
71
|
};
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -82,9 +84,9 @@ function VictoryBar(_ref) {
|
|
|
82
84
|
cornerRadius = _ref.cornerRadius,
|
|
83
85
|
_ref$horizontal = _ref.horizontal,
|
|
84
86
|
horizontal = _ref$horizontal === void 0 ? false : _ref$horizontal;
|
|
85
|
-
var scale = (0,
|
|
86
|
-
var data = (0,
|
|
87
|
-
var domain = (0,
|
|
87
|
+
var scale = (0, _v.useScale)();
|
|
88
|
+
var data = (0, _v.useData)();
|
|
89
|
+
var domain = (0, _v.useDomain)();
|
|
88
90
|
var children = data.map(function (datum, i) {
|
|
89
91
|
var _getBarPosition = (0, _helperMethods.getBarPosition)({
|
|
90
92
|
domain: domain,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Datum, NumberOrCallback
|
|
2
|
+
import { Datum, NumberOrCallback } from "victory-core";
|
|
3
|
+
import { VictoryCalculatedStateProps } from "victory-core/es/v37";
|
|
3
4
|
export declare type VictoryBarAlignmentType = "start" | "middle" | "end";
|
|
4
5
|
export interface VictoryBarProps extends VictoryCalculatedStateProps {
|
|
5
6
|
alignment?: VictoryBarAlignmentType;
|
|
@@ -20,4 +21,4 @@ export interface VictoryBarProps extends VictoryCalculatedStateProps {
|
|
|
20
21
|
}
|
|
21
22
|
declare const _default: React.FC<VictoryBarProps>;
|
|
22
23
|
export default _default;
|
|
23
|
-
//# sourceMappingURL=victory-bar.d.ts.map
|
|
24
|
+
//# sourceMappingURL=victory-bar-v2.d.ts.map
|
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _v = require("victory-core/es/v37");
|
|
11
11
|
|
|
12
12
|
var _bar = _interopRequireDefault(require("../bar"));
|
|
13
13
|
|
|
@@ -69,15 +69,15 @@ function VictoryBar(_ref) {
|
|
|
69
69
|
// component props. However, I am anticipating confusion about which props
|
|
70
70
|
// we will need to pass back up to the provider vs. the props that are only
|
|
71
71
|
// used in this component.
|
|
72
|
-
(0,
|
|
72
|
+
(0, _v.useVictoryProviderSync)(_objectSpread({
|
|
73
73
|
data: data,
|
|
74
74
|
includeZero: includeZero,
|
|
75
75
|
sortOrder: sortOrder
|
|
76
76
|
}, props));
|
|
77
|
-
var scale = (0,
|
|
78
|
-
var domain = (0,
|
|
77
|
+
var scale = (0, _v.useScale)();
|
|
78
|
+
var domain = (0, _v.useDomain)(); // TODO: Do we need to get this from context?
|
|
79
79
|
|
|
80
|
-
var formattedData = (0,
|
|
80
|
+
var formattedData = (0, _v.useData)();
|
|
81
81
|
var barPositionProps = {
|
|
82
82
|
domain: domain,
|
|
83
83
|
scale: scale,
|
|
@@ -109,6 +109,6 @@ function VictoryBar(_ref) {
|
|
|
109
109
|
} // @ts-expect-error we need to work out what props this withContainer wrapper accepts
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
var _default = (0,
|
|
112
|
+
var _default = (0, _v.withContainer)(VictoryBar);
|
|
113
113
|
|
|
114
114
|
exports.default = _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: React.FC<import("./victory-bar").VictoryBarProps>;
|
|
4
|
+
component: React.FC<import("./victory-bar-v2").VictoryBarProps>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
7
|
export declare const Demo: {
|
|
@@ -7,7 +7,7 @@ exports.default = exports.WithChart = exports.Demo = void 0;
|
|
|
7
7
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _victoryBarV = _interopRequireDefault(require("./victory-bar-v2"));
|
|
11
11
|
|
|
12
12
|
var _victoryChart = _interopRequireDefault(require("victory-chart/es/v37/victory-chart"));
|
|
13
13
|
|
|
@@ -20,12 +20,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
20
20
|
/* eslint-disable react/no-multi-comp */
|
|
21
21
|
var _default = {
|
|
22
22
|
title: "v37/VictoryBar",
|
|
23
|
-
component:
|
|
23
|
+
component: _victoryBarV.default
|
|
24
24
|
};
|
|
25
25
|
exports.default = _default;
|
|
26
26
|
|
|
27
27
|
var Demo = function (props) {
|
|
28
|
-
return /*#__PURE__*/React.createElement(
|
|
28
|
+
return /*#__PURE__*/React.createElement(_victoryBarV.default, props);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
exports.Demo = Demo;
|
|
@@ -34,7 +34,7 @@ Demo.args = {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
var WithChart = function (props) {
|
|
37
|
-
return /*#__PURE__*/React.createElement(_victoryChart.default, props, /*#__PURE__*/React.createElement(
|
|
37
|
+
return /*#__PURE__*/React.createElement(_victoryChart.default, props, /*#__PURE__*/React.createElement(_victoryBarV.default, null));
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
exports.WithChart = WithChart;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-bar",
|
|
3
|
-
"version": "36.6.
|
|
3
|
+
"version": "36.6.5",
|
|
4
4
|
"description": "Bar Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
24
|
"prop-types": "^15.8.1",
|
|
25
|
-
"victory-core": "^36.6.
|
|
26
|
-
"victory-vendor": "^36.6.
|
|
25
|
+
"victory-core": "^36.6.5",
|
|
26
|
+
"victory-vendor": "^36.6.5"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": ">=16.6.0"
|
|
@@ -3,17 +3,19 @@ import * as React from "react";
|
|
|
3
3
|
import {
|
|
4
4
|
Datum,
|
|
5
5
|
NumberOrCallback,
|
|
6
|
-
useData,
|
|
7
|
-
useDomain,
|
|
8
|
-
useScale,
|
|
9
6
|
VictoryCommonProps,
|
|
10
7
|
VictoryContainer,
|
|
11
8
|
VictoryDatableProps,
|
|
9
|
+
} from "victory-core";
|
|
10
|
+
import {
|
|
11
|
+
useData,
|
|
12
|
+
useDomain,
|
|
13
|
+
useScale,
|
|
12
14
|
VictoryProvider,
|
|
13
15
|
VictoryProviderProps,
|
|
14
|
-
} from "victory-core";
|
|
15
|
-
import Bar from "
|
|
16
|
-
import { getBarPosition } from "
|
|
16
|
+
} from "victory-core/es/v37";
|
|
17
|
+
import Bar from "../bar";
|
|
18
|
+
import { getBarPosition } from "../helper-methods";
|
|
17
19
|
|
|
18
20
|
// This is a demo component that uses VictoryProvider to access calculated props and state.
|
|
19
21
|
// This component does not include events, animations, or styling.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* eslint-disable react/no-multi-comp */
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
import { Datum, NumberOrCallback } from "victory-core";
|
|
3
4
|
import {
|
|
4
|
-
Datum,
|
|
5
|
-
NumberOrCallback,
|
|
6
5
|
useData,
|
|
7
6
|
useDomain,
|
|
8
7
|
useScale,
|
|
9
8
|
useVictoryProviderSync,
|
|
10
9
|
VictoryCalculatedStateProps,
|
|
11
10
|
withContainer,
|
|
12
|
-
} from "victory-core";
|
|
11
|
+
} from "victory-core/es/v37";
|
|
12
|
+
|
|
13
13
|
import Bar from "../bar";
|
|
14
14
|
import { BarProps } from "..";
|
|
15
15
|
import { getBarPosition } from "../helper-methods";
|
|
@@ -57,7 +57,7 @@ function VictoryBar({
|
|
|
57
57
|
// component props. However, I am anticipating confusion about which props
|
|
58
58
|
// we will need to pass back up to the provider vs. the props that are only
|
|
59
59
|
// used in this component.
|
|
60
|
-
useVictoryProviderSync(
|
|
60
|
+
useVictoryProviderSync({
|
|
61
61
|
data,
|
|
62
62
|
includeZero,
|
|
63
63
|
sortOrder,
|