When using the UglifyJS plugin in Webpack, fixLabelOverlap={true} on VictoryAxis is not working.
I think I've narrowed down the issue to the mangle option of UglifyJS. When setting mangle to be true, the issue shows up. Webpack 2 uses UglifyJS with that config by default when doing production builds (e.g. webpack -p).
Here's an example plugin config that produces the issue for me
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
minimize: true,
mangle: false,
output: {
comments: false
}
})
Versions:
"victory": "0.17.0"
"webpack": "2.2.1"
the fixLabelOverlap method was checking for labels using child.type.name which was not maintained when uglified. Adding a static role to VictoryLabel, and checking by role as in other Victory components.
@boygirl I have this problem as well, and updated just now to 0.18.3, hoping that would fix it (since this issue is marked as released). Still not working, though.
Any chance this will be released soon? I need it the next day or so or I'll have to use a different charting library.
Thanks for your work on this and on Victory in general!
@boygirl Alternatively, can you recommend a workaround?
@nwshane One workaround is to not use the mangle option when uglifying your bundle. As my current project is not in production yet, this is what I'm doing until a fix is released.
@tylermassey Thanks, I'll do that if necessary - I'd like to avoid that though because I'm using create-react-app and I don't want to have to eject the configuration :)