Victory-native: VictoryLine is not working when adding animate prop

Created on 16 Apr 2018  路  8Comments  路  Source: FormidableLabs/victory-native

_From @JensonMiralles on April 16, 2018 3:26_

VictoryLine is not working when adding animate prop (React Native)

_Copied from original issue: FormidableLabs/victory#972_

Most helpful comment

@JensonMiralles

This issue is caused by a change in react-native-svg@^6.2.x. Since this change ClipPath components are not updating their widths which causes animating line and area charts to always be rendered with a 0 width ClipPath.

You can get around this by:

1) Using an earlier version of react-native-svg. Compatible versions are described here

2) Replacing the groupComponent in VictoryLine with a standard <G/> tag. You will not see curtaining transitions (no more 'onLoad' transitions, or nice transitions for changing numbers of data points), but regular animations will work correctly.

All 8 comments

@JensonMiralles

This issue is caused by a change in react-native-svg@^6.2.x. Since this change ClipPath components are not updating their widths which causes animating line and area charts to always be rendered with a 0 width ClipPath.

You can get around this by:

1) Using an earlier version of react-native-svg. Compatible versions are described here

2) Replacing the groupComponent in VictoryLine with a standard <G/> tag. You will not see curtaining transitions (no more 'onLoad' transitions, or nice transitions for changing numbers of data points), but regular animations will work correctly.

Oh okay, got that! thanks! 馃榿

@boygirl can you elaborate on the second part im trying this and getting invariant violation errors:

          <VictoryLine
            groupComponent={"<G/>"}
            style={{
              data: { stroke: "red" },
              parent: { border: "1px solid #ccc" }
            }}
            data={data1}
            x="x"
            y="y"
          />

still not working when using
"react-native-svg": "^6.1.4",

@boygirl

@waltermvp you will need to omit the ^ in your version, as this is breaking with [email protected]

@waltermvp you can also try groupComponent={<G/>}. It needs to be an element, not a string.

@boygirl got it working, thank you so very much.

This issue is fixed with [email protected]

Was this page helpful?
0 / 5 - 0 ratings