Open michchan opened 5 years ago
Same here
You can solve this issue by going in: node_modules > react-ease-chart > lid > pie-chart > hybrid > index.js in index.js you just have to remove
.transition().duration(750).attrTween('d', this.tweenSlice);
that line from:
path.enter().append('path').attr('class', 'pie-chart-slice').attr('fill', getSliceFill).on('mouseover', mouseover).on('mouseout', mouseout).on('mousemove', mousemove).on('click', click).each(function (d, i) {return currentSlices.splice(i, 1, d); }).transition().duration(750).attrTween('d', this.tweenSlice);
this block of code!
I hope this will solve your problem!
Is this safe (editing node_modules by hand). I'm trying it now.
yeah! there is no bad in it!
Okay. When I do, the error starts coming from several other lines. I have to remove those as well yh?
On editing node_modules - When next I do an npm install, the lines will come back yh...
yes! you have to remove .transition() method from all lines! and you have to move the react-easy-chart folder from node_modules to another place! and require it from that path! and don't remove it from package.json! hope it will help.
Thanks a lot. It works.
My 2 cents: You have to restart the app to reflect node_modules changes. I had to do that.
Ok, this is a massive blocker to using react-easy-chart
. Editing node_modules
is not a valid solution. Is clearly a bug with the module, and needs fixing at source :(
I used PieChart in a component. It works when it first rendered. But I got this error after any state update: TypeError: undefined is not a function (near '...', click).transition().duration(750).att...') logCapturedError — react-dom.development.js:16477
This is how I used the PieChart:
It works when I forked from the repo and comment out the some lines of codes (transition) like this:
Versions: react-easy-chart: 1.0.0 react: ^16.6.0 react-dom: ^16.6.0