victory-group 36.5.3 → 36.6.2

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.
@@ -0,0 +1,52 @@
1
+ export declare function getCalculatedProps(props: any, childComponents: any): {
2
+ datasets: any;
3
+ categories: any;
4
+ range: any;
5
+ domain: {
6
+ x: any;
7
+ y: any;
8
+ };
9
+ horizontal: any;
10
+ scale: {
11
+ x: import("victory-core").D3Scale<any>;
12
+ y: import("victory-core").D3Scale<any>;
13
+ };
14
+ style: any;
15
+ colorScale: any;
16
+ color: any;
17
+ offset: any;
18
+ origin: any;
19
+ padding: {
20
+ top: any;
21
+ bottom: any;
22
+ left: any;
23
+ right: any;
24
+ };
25
+ };
26
+ export declare function useMemoizedProps(initialProps: any): {
27
+ datasets: any;
28
+ categories: any;
29
+ range: any;
30
+ domain: {
31
+ x: any;
32
+ y: any;
33
+ };
34
+ horizontal: any;
35
+ scale: {
36
+ x: import("victory-core").D3Scale<any>;
37
+ y: import("victory-core").D3Scale<any>;
38
+ };
39
+ style: any;
40
+ colorScale: any;
41
+ color: any;
42
+ offset: any;
43
+ origin: any;
44
+ padding: {
45
+ top: any;
46
+ bottom: any;
47
+ left: any;
48
+ right: any;
49
+ };
50
+ };
51
+ export declare function getChildren(props: any, childComponents?: any, calculatedProps?: any): any;
52
+ //# sourceMappingURL=helper-methods.d.ts.map
@@ -46,8 +46,8 @@ export function getCalculatedProps(props, childComponents) {
46
46
  color = _props.color,
47
47
  polar = _props.polar,
48
48
  horizontal = _props.horizontal;
49
- var categories = props.categories || Wrapper.getCategories(props, childComponents);
50
- var datasets = props.datasets || Wrapper.getDataFromChildren(props);
49
+ var categories = props.categories || Wrapper.getCategories(props, childComponents, null);
50
+ var datasets = props.datasets || Wrapper.getDataFromChildren(props, null);
51
51
  var domain = {
52
52
  x: Wrapper.getDomain(_assign({}, props, {
53
53
  categories: categories
package/es/index.d.ts CHANGED
@@ -1,37 +1,2 @@
1
- import * as React from "react";
2
- import {
3
- CategoryPropType,
4
- ColorScalePropType,
5
- DomainPropType,
6
- DomainPaddingPropType,
7
- EventPropTypeInterface,
8
- StringOrNumberOrCallback,
9
- VictoryCommonProps,
10
- VictoryDatableProps,
11
- VictoryMultiLabelableProps,
12
- VictoryStyleInterface,
13
- } from "victory-core";
14
-
15
- export type VictoryGroupTTargetType = "data" | "labels" | "parent";
16
-
17
- export interface VictoryGroupProps
18
- extends VictoryCommonProps,
19
- VictoryDatableProps,
20
- VictoryMultiLabelableProps {
21
- categories?: CategoryPropType;
22
- children?: React.ReactNode;
23
- color?: string;
24
- colorScale?: ColorScalePropType;
25
- domain?: DomainPropType;
26
- domainPadding?: DomainPaddingPropType;
27
- events?: EventPropTypeInterface<
28
- VictoryGroupTTargetType,
29
- StringOrNumberOrCallback
30
- >[];
31
- eventKey?: StringOrNumberOrCallback;
32
- horizontal?: boolean;
33
- offset?: number;
34
- style?: VictoryStyleInterface;
35
- }
36
-
37
- export class VictoryGroup extends React.Component<VictoryGroupProps, any> {}
1
+ export * from "./victory-group";
2
+ //# sourceMappingURL=index.d.ts.map
package/es/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default as VictoryGroup } from "./victory-group";
1
+ export * from "./victory-group";
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { CategoryPropType, ColorScalePropType, DomainPaddingPropType, DomainPropType, EventPropTypeInterface, StringOrNumberOrCallback, VictoryCommonProps, VictoryDatableProps, VictoryMultiLabelableProps, VictoryStyleInterface, VictoryComponentConfiguration } from "victory-core";
3
+ export declare type VictoryGroupTTargetType = "data" | "labels" | "parent";
4
+ export interface VictoryGroupProps extends VictoryCommonProps, VictoryDatableProps, VictoryMultiLabelableProps {
5
+ categories?: CategoryPropType;
6
+ children?: React.ReactNode;
7
+ color?: string;
8
+ colorScale?: ColorScalePropType;
9
+ domain?: DomainPropType;
10
+ domainPadding?: DomainPaddingPropType;
11
+ events?: EventPropTypeInterface<VictoryGroupTTargetType, StringOrNumberOrCallback>[];
12
+ eventKey?: StringOrNumberOrCallback;
13
+ horizontal?: boolean;
14
+ offset?: number;
15
+ style?: VictoryStyleInterface;
16
+ displayName?: string;
17
+ }
18
+ export declare const VictoryGroup: React.NamedExoticComponent<VictoryGroupProps> & VictoryComponentConfiguration<VictoryGroupProps>;
19
+ //# sourceMappingURL=victory-group.d.ts.map
@@ -21,9 +21,9 @@ var fallbackProps = {
21
21
  offset: 0
22
22
  };
23
23
 
24
- var VictoryGroup = function (initialProps) {
24
+ var VictoryGroupBase = function (initialProps) {
25
25
  // eslint-disable-next-line no-use-before-define
26
- var role = VictoryGroupMemo.role;
26
+ var role = VictoryGroup === null || VictoryGroup === void 0 ? void 0 : VictoryGroup.role;
27
27
 
28
28
  var _Hooks$useAnimationSt = Hooks.useAnimationState(),
29
29
  getAnimationProps = _Hooks$useAnimationSt.getAnimationProps,
@@ -53,7 +53,7 @@ var VictoryGroup = function (initialProps) {
53
53
  var children = getChildren(props, childComponents, calculatedProps);
54
54
  return children.map(function (child, index) {
55
55
  var childProps = _assign({
56
- animate: getAnimationProps(props, child, index, "victory-group")
56
+ animate: getAnimationProps(props, child, index)
57
57
  }, child.props);
58
58
 
59
59
  return /*#__PURE__*/React.cloneElement(child, childProps);
@@ -115,27 +115,24 @@ var VictoryGroup = function (initialProps) {
115
115
  return /*#__PURE__*/React.cloneElement(container, container.props, newChildren);
116
116
  };
117
117
 
118
- VictoryGroup.propTypes = _objectSpread(_objectSpread(_objectSpread({}, CommonProps.baseProps), CommonProps.dataProps), {}, {
118
+ VictoryGroupBase.propTypes = _objectSpread(_objectSpread(_objectSpread({}, CommonProps.baseProps), CommonProps.dataProps), {}, {
119
119
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
120
- color: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
121
- colorScale: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.oneOf(["grayscale", "qualitative", "heatmap", "warm", "cool", "red", "green", "blue"])]),
122
120
  horizontal: PropTypes.bool,
123
121
  offset: PropTypes.number
124
122
  });
125
- VictoryGroup.defaultProps = {
123
+ VictoryGroupBase.defaultProps = {
126
124
  containerComponent: /*#__PURE__*/React.createElement(VictoryContainer, null),
127
125
  groupComponent: /*#__PURE__*/React.createElement("g", null),
128
126
  samples: 50,
129
127
  sortOrder: "ascending",
130
128
  standalone: true,
131
129
  theme: VictoryTheme.grayscale
132
- }; // We need to attatch the static properties to the memoized version, or else
133
- // VictoryChart will not be able to get this component's role type
134
-
135
- var VictoryGroupMemo = /*#__PURE__*/React.memo(VictoryGroup, isEqual);
136
- VictoryGroupMemo.displayName = "VictoryGroup";
137
- VictoryGroupMemo.role = "group";
138
- VictoryGroupMemo.expectedComponents = ["groupComponent", "containerComponent", "labelComponent"];
139
- VictoryGroupMemo.getChildren = getChildren;
140
- export default VictoryGroupMemo;
130
+ };
131
+ var componentConfig = {
132
+ role: "group",
133
+ expectedComponents: ["groupComponent", "containerComponent", "labelComponent"],
134
+ getChildren: getChildren
135
+ };
136
+ export var VictoryGroup = Object.assign( /*#__PURE__*/React.memo(VictoryGroupBase, isEqual), componentConfig);
137
+ VictoryGroup.displayName = "VictoryGroup";
141
138
  //# sourceMappingURL=victory-group.js.map
@@ -0,0 +1,52 @@
1
+ export declare function getCalculatedProps(props: any, childComponents: any): {
2
+ datasets: any;
3
+ categories: any;
4
+ range: any;
5
+ domain: {
6
+ x: any;
7
+ y: any;
8
+ };
9
+ horizontal: any;
10
+ scale: {
11
+ x: import("victory-core").D3Scale<any>;
12
+ y: import("victory-core").D3Scale<any>;
13
+ };
14
+ style: any;
15
+ colorScale: any;
16
+ color: any;
17
+ offset: any;
18
+ origin: any;
19
+ padding: {
20
+ top: any;
21
+ bottom: any;
22
+ left: any;
23
+ right: any;
24
+ };
25
+ };
26
+ export declare function useMemoizedProps(initialProps: any): {
27
+ datasets: any;
28
+ categories: any;
29
+ range: any;
30
+ domain: {
31
+ x: any;
32
+ y: any;
33
+ };
34
+ horizontal: any;
35
+ scale: {
36
+ x: import("victory-core").D3Scale<any>;
37
+ y: import("victory-core").D3Scale<any>;
38
+ };
39
+ style: any;
40
+ colorScale: any;
41
+ color: any;
42
+ offset: any;
43
+ origin: any;
44
+ padding: {
45
+ top: any;
46
+ bottom: any;
47
+ left: any;
48
+ right: any;
49
+ };
50
+ };
51
+ export declare function getChildren(props: any, childComponents?: any, calculatedProps?: any): any;
52
+ //# sourceMappingURL=helper-methods.d.ts.map
@@ -63,9 +63,9 @@ function getCalculatedProps(props, childComponents) {
63
63
  polar = _props.polar,
64
64
  horizontal = _props.horizontal;
65
65
 
66
- var categories = props.categories || _victoryCore.Wrapper.getCategories(props, childComponents);
66
+ var categories = props.categories || _victoryCore.Wrapper.getCategories(props, childComponents, null);
67
67
 
68
- var datasets = props.datasets || _victoryCore.Wrapper.getDataFromChildren(props);
68
+ var datasets = props.datasets || _victoryCore.Wrapper.getDataFromChildren(props, null);
69
69
 
70
70
  var domain = {
71
71
  x: _victoryCore.Wrapper.getDomain((0, _assign2.default)({}, props, {
package/lib/index.d.ts CHANGED
@@ -1,37 +1,2 @@
1
- import * as React from "react";
2
- import {
3
- CategoryPropType,
4
- ColorScalePropType,
5
- DomainPropType,
6
- DomainPaddingPropType,
7
- EventPropTypeInterface,
8
- StringOrNumberOrCallback,
9
- VictoryCommonProps,
10
- VictoryDatableProps,
11
- VictoryMultiLabelableProps,
12
- VictoryStyleInterface,
13
- } from "victory-core";
14
-
15
- export type VictoryGroupTTargetType = "data" | "labels" | "parent";
16
-
17
- export interface VictoryGroupProps
18
- extends VictoryCommonProps,
19
- VictoryDatableProps,
20
- VictoryMultiLabelableProps {
21
- categories?: CategoryPropType;
22
- children?: React.ReactNode;
23
- color?: string;
24
- colorScale?: ColorScalePropType;
25
- domain?: DomainPropType;
26
- domainPadding?: DomainPaddingPropType;
27
- events?: EventPropTypeInterface<
28
- VictoryGroupTTargetType,
29
- StringOrNumberOrCallback
30
- >[];
31
- eventKey?: StringOrNumberOrCallback;
32
- horizontal?: boolean;
33
- offset?: number;
34
- style?: VictoryStyleInterface;
35
- }
36
-
37
- export class VictoryGroup extends React.Component<VictoryGroupProps, any> {}
1
+ export * from "./victory-group";
2
+ //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -3,14 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "VictoryGroup", {
7
- enumerable: true,
8
- get: function () {
9
- return _victoryGroup.default;
10
- }
11
- });
12
6
 
13
- var _victoryGroup = _interopRequireDefault(require("./victory-group"));
7
+ var _victoryGroup = require("./victory-group");
14
8
 
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ Object.keys(_victoryGroup).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _victoryGroup[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _victoryGroup[key];
16
+ }
17
+ });
18
+ });
16
19
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { CategoryPropType, ColorScalePropType, DomainPaddingPropType, DomainPropType, EventPropTypeInterface, StringOrNumberOrCallback, VictoryCommonProps, VictoryDatableProps, VictoryMultiLabelableProps, VictoryStyleInterface, VictoryComponentConfiguration } from "victory-core";
3
+ export declare type VictoryGroupTTargetType = "data" | "labels" | "parent";
4
+ export interface VictoryGroupProps extends VictoryCommonProps, VictoryDatableProps, VictoryMultiLabelableProps {
5
+ categories?: CategoryPropType;
6
+ children?: React.ReactNode;
7
+ color?: string;
8
+ colorScale?: ColorScalePropType;
9
+ domain?: DomainPropType;
10
+ domainPadding?: DomainPaddingPropType;
11
+ events?: EventPropTypeInterface<VictoryGroupTTargetType, StringOrNumberOrCallback>[];
12
+ eventKey?: StringOrNumberOrCallback;
13
+ horizontal?: boolean;
14
+ offset?: number;
15
+ style?: VictoryStyleInterface;
16
+ displayName?: string;
17
+ }
18
+ export declare const VictoryGroup: React.NamedExoticComponent<VictoryGroupProps> & VictoryComponentConfiguration<VictoryGroupProps>;
19
+ //# sourceMappingURL=victory-group.d.ts.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.VictoryGroup = void 0;
7
7
 
8
8
  var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
9
9
 
@@ -38,9 +38,9 @@ var fallbackProps = {
38
38
  offset: 0
39
39
  };
40
40
 
41
- var VictoryGroup = function (initialProps) {
41
+ var VictoryGroupBase = function (initialProps) {
42
42
  // eslint-disable-next-line no-use-before-define
43
- var role = VictoryGroupMemo.role;
43
+ var role = VictoryGroup === null || VictoryGroup === void 0 ? void 0 : VictoryGroup.role;
44
44
 
45
45
  var _Hooks$useAnimationSt = _victoryCore.Hooks.useAnimationState(),
46
46
  getAnimationProps = _Hooks$useAnimationSt.getAnimationProps,
@@ -75,7 +75,7 @@ var VictoryGroup = function (initialProps) {
75
75
  var children = (0, _helperMethods.getChildren)(props, childComponents, calculatedProps);
76
76
  return children.map(function (child, index) {
77
77
  var childProps = (0, _assign2.default)({
78
- animate: getAnimationProps(props, child, index, "victory-group")
78
+ animate: getAnimationProps(props, child, index)
79
79
  }, child.props);
80
80
  return /*#__PURE__*/_react.default.cloneElement(child, childProps);
81
81
  });
@@ -141,29 +141,25 @@ var VictoryGroup = function (initialProps) {
141
141
  return /*#__PURE__*/_react.default.cloneElement(container, container.props, newChildren);
142
142
  };
143
143
 
144
- VictoryGroup.propTypes = _objectSpread(_objectSpread(_objectSpread({}, _victoryCore.CommonProps.baseProps), _victoryCore.CommonProps.dataProps), {}, {
144
+ VictoryGroupBase.propTypes = _objectSpread(_objectSpread(_objectSpread({}, _victoryCore.CommonProps.baseProps), _victoryCore.CommonProps.dataProps), {}, {
145
145
  children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
146
- color: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]),
147
- colorScale: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.oneOf(["grayscale", "qualitative", "heatmap", "warm", "cool", "red", "green", "blue"])]),
148
146
  horizontal: _propTypes.default.bool,
149
147
  offset: _propTypes.default.number
150
148
  });
151
- VictoryGroup.defaultProps = {
149
+ VictoryGroupBase.defaultProps = {
152
150
  containerComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryContainer, null),
153
151
  groupComponent: /*#__PURE__*/_react.default.createElement("g", null),
154
152
  samples: 50,
155
153
  sortOrder: "ascending",
156
154
  standalone: true,
157
155
  theme: _victoryCore.VictoryTheme.grayscale
158
- }; // We need to attatch the static properties to the memoized version, or else
159
- // VictoryChart will not be able to get this component's role type
160
-
161
- var VictoryGroupMemo = /*#__PURE__*/_react.default.memo(VictoryGroup, _reactFastCompare.default);
162
-
163
- VictoryGroupMemo.displayName = "VictoryGroup";
164
- VictoryGroupMemo.role = "group";
165
- VictoryGroupMemo.expectedComponents = ["groupComponent", "containerComponent", "labelComponent"];
166
- VictoryGroupMemo.getChildren = _helperMethods.getChildren;
167
- var _default = VictoryGroupMemo;
168
- exports.default = _default;
156
+ };
157
+ var componentConfig = {
158
+ role: "group",
159
+ expectedComponents: ["groupComponent", "containerComponent", "labelComponent"],
160
+ getChildren: _helperMethods.getChildren
161
+ };
162
+ var VictoryGroup = Object.assign( /*#__PURE__*/_react.default.memo(VictoryGroupBase, _reactFastCompare.default), componentConfig);
163
+ exports.VictoryGroup = VictoryGroup;
164
+ VictoryGroup.displayName = "VictoryGroup";
169
165
  //# sourceMappingURL=victory-group.js.map