victory icon indicating copy to clipboard operation
victory copied to clipboard

Updating version to 37.1.1 - viewBox issue

Open vuksharu93 opened this issue 1 year ago • 10 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Victory version

37.1.1

Code Sandbox link

No response

Bug report

After updating the version from 37.0.2 to 37.1.1 none of the charts are displayed and I'm getting the warning: 
Invalid `viewBox` prop:0 0 undefined undefined

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Environment

- Device: iPhone SE / Samsung Galaxy A51
- OS: iOS version 17.5.1 / Android version 13
- Node: 18.17.0
- npm:

vuksharu93 avatar Sep 09 '24 11:09 vuksharu93

image

vuksharu93 avatar Sep 09 '24 11:09 vuksharu93

I am facing the same issue. I thought of adding width and height to the container component props, but it did not work.

roqmarcelo avatar Sep 10 '24 14:09 roqmarcelo

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it with us.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

Common concerns

"I didn't have time to create one"

That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.

"You can reproduce it by yourself by creating a project and following these steps"

This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.

victory-ci avatar Sep 16 '24 20:09 victory-ci

Experiencing the same issue. It seems to be coming from the container and, in my case, removing the containerComponent prop fixes the warning and layout issues. Can confirm that downgrading victory deps to 37.0.2 also fixes it.

adamhari avatar Sep 17 '24 14:09 adamhari

Created a snack with the issue here

adamhari avatar Sep 18 '24 01:09 adamhari

@adamhari Thanks! Yes, it works when you delete containerComponent (with VictoryVoronoiContainer), but I need that :D So, I will use 37.0.2 for now

vuksharu93 avatar Sep 18 '24 07:09 vuksharu93

Thanks for the reproduction, will add it to the queue

carbonrobot avatar Sep 25 '24 20:09 carbonrobot

I checked and version 36.8.3 doesn't have this problem either.

jsimonassi avatar Apr 28 '25 21:04 jsimonassi

Hey, it seems like adding both initialProps and props to VictoryContainer in VictoryVoronoiContainer helps to solve this.

This is patch I use: victory-native+37.3.6.patch

diff --git a/node_modules/victory-native/lib/components/victory-voronoi-container.js b/node_modules/victory-native/lib/components/victory-voronoi-container.js
index 0bce814..2a23061 100644
--- a/node_modules/victory-native/lib/components/victory-voronoi-container.js
+++ b/node_modules/victory-native/lib/components/victory-voronoi-container.js
@@ -18,7 +18,7 @@ const VictoryVoronoiContainer = initialProps => {
     labelComponent: initialProps.labelComponent ?? /*#__PURE__*/_react.default.createElement(_victoryTooltip.VictoryTooltip, null),
     voronoiPadding: initialProps.voronoiPadding ?? DEFAULT_VORONOI_PADDING
   });
-  return /*#__PURE__*/_react.default.createElement(_victoryContainer.VictoryContainer, props);
+  return /*#__PURE__*/_react.default.createElement(_victoryContainer.VictoryContainer, {...initialProps, ...props});
 };
 exports.VictoryVoronoiContainer = VictoryVoronoiContainer;
 VictoryVoronoiContainer.role = "container";

You can use it with yarn patch or patch-package.

palicko avatar Aug 07 '25 15:08 palicko

Hey, it seems like adding both initialProps and props to VictoryContainer in VictoryVoronoiContainer helps to solve this.

This is patch I use: victory-native+37.3.6.patch

diff --git a/node_modules/victory-native/lib/components/victory-voronoi-container.js b/node_modules/victory-native/lib/components/victory-voronoi-container.js
index 0bce814..2a23061 100644
--- a/node_modules/victory-native/lib/components/victory-voronoi-container.js
+++ b/node_modules/victory-native/lib/components/victory-voronoi-container.js
@@ -18,7 +18,7 @@ const VictoryVoronoiContainer = initialProps => {
     labelComponent: initialProps.labelComponent ?? /*#__PURE__*/_react.default.createElement(_victoryTooltip.VictoryTooltip, null),
     voronoiPadding: initialProps.voronoiPadding ?? DEFAULT_VORONOI_PADDING
   });
-  return /*#__PURE__*/_react.default.createElement(_victoryContainer.VictoryContainer, props);
+  return /*#__PURE__*/_react.default.createElement(_victoryContainer.VictoryContainer, {...initialProps, ...props});
 };
 exports.VictoryVoronoiContainer = VictoryVoronoiContainer;
 VictoryVoronoiContainer.role = "container";

You can use it with yarn patch or patch-package.

This is a great lead, I'm working on a PR which should fix the root issue.

adamhari avatar Aug 07 '25 16:08 adamhari