victory icon indicating copy to clipboard operation
victory copied to clipboard

VictoryArea -- Cannot read property 'left' of underfined

Open vnu opened this issue 9 years ago • 7 comments

I am trying victory for the first time and my code is pretty straightforward and I keep running into the left of undefined error. The error, however doesn't occur for VictoryBar or VictoryPie.

return (
            <div className="row">
                <VictoryArea/>
            </div>
        );

The console error

Uncaught TypeError: Cannot read property 'left' of undefined
    at totalPadding (clip-path.js:72)
    at ClipPath.calculateAttributes (clip-path.js:76)
    at ClipPath.shouldComponentUpdate (clip-path.js:49)
    at ReactCompositeComponentWrapper.updateComponent (ReactCompositeComponent.js:464)
    at ReactCompositeComponentWrapper.wrapper [as updateComponent] (ReactPerf.js:66)
    at ReactCompositeComponentWrapper.receiveComponent (ReactCompositeComponent.js:405)
    at Object.receiveComponent (ReactReconciler.js:87)
    at Object.updateChildren (ReactChildReconciler.js:84)
    at ReactDOMComponent._reconcilerUpdateChildren (ReactMultiChild.js:216)
    at ReactDOMComponent._updateChildren (ReactMultiChild.js:351)

vnu avatar Mar 14 '17 21:03 vnu

@vnu can you provide a little more detail. I tried to reproduce your issue, https://jsfiddle.net/boygirl/ehkyzdew/, but I'm not seeing your error.

boygirl avatar Mar 14 '17 21:03 boygirl

@boygirl What kind of details would help you? I was able to see the graph in the js fiddle as well. I'm not sure why this is not working with my existing code and what is different between Area / Bar / Pie that Bar and Pie works but Area doesn't :/

vnu avatar Mar 15 '17 18:03 vnu

What version of Victory are you on? Are you rendering VictoryArea with any props? The only thing I can think of that is different between VictoryArea and those other components is that VictoryArea renders inside a container that uses clipPath by default so that it can animate correctly. You can check and see whether that is the problem if you add the prop groupComponent={<g/>} to your VictoryArea component and seeing if that fixes the issue.

boygirl avatar Mar 15 '17 20:03 boygirl

I am having the same error (but with VictoryLine and it occurs for me in the jsfiddle link posted above as well when I open up the inspector: screen shot 2017-03-15 at 3 48 50 pm

sisiguo avatar Mar 15 '17 22:03 sisiguo

@vnu looks like the issue is in [email protected] I'll get this fixed

boygirl avatar Mar 15 '17 23:03 boygirl

Fixed in [email protected]

boygirl avatar Mar 16 '17 06:03 boygirl

Thanks @boygirl for fixing this.

vnu avatar Mar 21 '17 21:03 vnu