Victory: fixLabelOverlap not applying when minimizing with Webpack

Created on 8 Mar 2017  路  5Comments  路  Source: FormidableLabs/victory

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"

needs investigation

All 5 comments

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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devth picture devth  路  4Comments

captDaylight picture captDaylight  路  5Comments

icd2k3 picture icd2k3  路  3Comments

michowski picture michowski  路  4Comments

seddonm1 picture seddonm1  路  5Comments