victory-bar 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 +10 -0
- package/dist/victory-bar.js +587 -255
- package/dist/victory-bar.min.js +1 -1
- package/es/bar-helper-methods.js +2 -2
- package/es/bar.js +2 -2
- package/es/geometry-helper-methods.d.ts +97 -13
- package/es/helper-methods.d.ts +4 -4
- package/es/helper-methods.js +11 -1
- package/es/victory-bar.d.ts +11 -10
- package/es/victory-bar.js +13 -3
- package/lib/bar-helper-methods.js +2 -2
- package/lib/bar.js +3 -3
- package/lib/geometry-helper-methods.d.ts +97 -13
- package/lib/helper-methods.d.ts +4 -4
- package/lib/helper-methods.js +10 -0
- package/lib/victory-bar.d.ts +11 -10
- package/lib/victory-bar.js +12 -2
- package/package.json +3 -31
- package/src/bar-helper-methods.ts +1 -1
- package/src/bar.tsx +1 -1
- package/src/helper-methods.ts +7 -0
- package/src/victory-bar.tsx +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-bar",
|
|
3
|
-
"version": "37.3.
|
|
3
|
+
"version": "37.3.4",
|
|
4
4
|
"description": "Bar Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
|
-
"victory-core": "37.3.
|
|
25
|
-
"victory-vendor": "37.3.
|
|
24
|
+
"victory-core": "37.3.4",
|
|
25
|
+
"victory-vendor": "37.3.4"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=16.6.0"
|
|
@@ -190,32 +190,6 @@
|
|
|
190
190
|
"pnpm-lock.yaml"
|
|
191
191
|
]
|
|
192
192
|
},
|
|
193
|
-
"format": {
|
|
194
|
-
"command": "nps format:pkg",
|
|
195
|
-
"files": [
|
|
196
|
-
"src/**",
|
|
197
|
-
"*.json",
|
|
198
|
-
"../../.prettierignore",
|
|
199
|
-
"../../.prettierrc.json"
|
|
200
|
-
],
|
|
201
|
-
"output": [],
|
|
202
|
-
"packageLocks": [
|
|
203
|
-
"pnpm-lock.yaml"
|
|
204
|
-
]
|
|
205
|
-
},
|
|
206
|
-
"format:fix": {
|
|
207
|
-
"command": "pnpm run format || nps format:pkg:fix",
|
|
208
|
-
"files": [
|
|
209
|
-
"src/**",
|
|
210
|
-
"*.json",
|
|
211
|
-
"../../.prettierignore",
|
|
212
|
-
"../../.prettierrc.json"
|
|
213
|
-
],
|
|
214
|
-
"output": [],
|
|
215
|
-
"packageLocks": [
|
|
216
|
-
"pnpm-lock.yaml"
|
|
217
|
-
]
|
|
218
|
-
},
|
|
219
193
|
"lint": {
|
|
220
194
|
"command": "eslint src",
|
|
221
195
|
"files": [
|
|
@@ -283,8 +257,6 @@
|
|
|
283
257
|
"check": "wireit",
|
|
284
258
|
"types:check": "wireit",
|
|
285
259
|
"types:create": "wireit",
|
|
286
|
-
"format": "wireit",
|
|
287
|
-
"format:fix": "wireit",
|
|
288
260
|
"lint": "wireit",
|
|
289
261
|
"lint:fix": "wireit",
|
|
290
262
|
"jest": "wireit"
|
package/src/bar.tsx
CHANGED
package/src/helper-methods.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
Helpers,
|
|
6
6
|
LabelHelpers,
|
|
7
7
|
Scale,
|
|
8
|
+
VictoryClipContainer,
|
|
8
9
|
} from "victory-core";
|
|
9
10
|
|
|
10
11
|
export const getBarPosition = (props, datum) => {
|
|
@@ -61,6 +62,12 @@ const getCalculatedValues = (props) => {
|
|
|
61
62
|
let data = Data.getData(props);
|
|
62
63
|
data = Data.formatDataFromDomain(data, domain, 0);
|
|
63
64
|
|
|
65
|
+
// when inside a zoom container, reset the _x and _y properties of each datum to the original
|
|
66
|
+
// x and y property values so they will not be clipped. See https://github.com/FormidableLabs/victory/pull/2970
|
|
67
|
+
if (props.groupComponent.type === VictoryClipContainer) {
|
|
68
|
+
data = data.map((datum) => ({ ...datum, _x: datum.x, _y: datum.y }));
|
|
69
|
+
}
|
|
70
|
+
|
|
64
71
|
return { style, data, scale, domain, origin };
|
|
65
72
|
};
|
|
66
73
|
|
package/src/victory-bar.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
EventPropTypeInterface,
|
|
14
14
|
NumberOrCallback,
|
|
15
15
|
StringOrNumberOrCallback,
|
|
16
|
+
VictoryClipContainer,
|
|
16
17
|
VictoryCommonProps,
|
|
17
18
|
VictoryDatableProps,
|
|
18
19
|
VictoryMultiLabelableProps,
|
|
@@ -127,7 +128,9 @@ class VictoryBarBase extends React.Component<VictoryBarProps> {
|
|
|
127
128
|
"groupComponent",
|
|
128
129
|
"containerComponent",
|
|
129
130
|
];
|
|
130
|
-
|
|
131
|
+
// passed to addEvents.renderData to prevent data props with undefined _x or _y from excluding data from render.
|
|
132
|
+
// used when inside of VictoryZoomContainer
|
|
133
|
+
static shouldRenderDatum = () => true;
|
|
131
134
|
// Overridden in native versions
|
|
132
135
|
shouldAnimate() {
|
|
133
136
|
return !!this.props.animate;
|
|
@@ -141,7 +144,15 @@ class VictoryBarBase extends React.Component<VictoryBarProps> {
|
|
|
141
144
|
return this.animateComponent(props, animationWhitelist);
|
|
142
145
|
}
|
|
143
146
|
|
|
144
|
-
|
|
147
|
+
let children;
|
|
148
|
+
// when inside a zoom container (the only place VictoryClipContainer is used), all data
|
|
149
|
+
// should be renderable so bars won't dissappear before they've fully exited the container's bounds
|
|
150
|
+
// see https://github.com/FormidableLabs/victory/pull/2970
|
|
151
|
+
if (props.groupComponent.type === VictoryClipContainer) {
|
|
152
|
+
children = this.renderData(props, VictoryBarBase.shouldRenderDatum);
|
|
153
|
+
} else {
|
|
154
|
+
children = this.renderData(props);
|
|
155
|
+
}
|
|
145
156
|
|
|
146
157
|
const component = props.standalone
|
|
147
158
|
? this.renderContainer(props.containerComponent, children)
|