Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixLabelOverlap not applying when minimizing with Webpack #511

Closed
tylermassey opened this issue Mar 8, 2017 · 5 comments
Closed

fixLabelOverlap not applying when minimizing with Webpack #511

tylermassey opened this issue Mar 8, 2017 · 5 comments
Assignees
Labels
Status: Needs More Info ✋ A question or report that needs more info to be addressable

Comments

@tylermassey
Copy link

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"

@boygirl boygirl added Type: Bug 🐛 Oh no! A bug or unintentional behavior Status: Needs More Info ✋ A question or report that needs more info to be addressable and removed Type: Bug 🐛 Oh no! A bug or unintentional behavior labels Mar 11, 2017
@boygirl boygirl self-assigned this Mar 17, 2017
@boygirl
Copy link
Contributor

boygirl commented Mar 20, 2017

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 boygirl closed this as completed Mar 21, 2017
@nwshane
Copy link

nwshane commented Mar 21, 2017

@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!

@nwshane
Copy link

nwshane commented Mar 21, 2017

@boygirl Alternatively, can you recommend a workaround?

@tylermassey
Copy link
Author

@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.

@nwshane
Copy link

nwshane commented Mar 22, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs More Info ✋ A question or report that needs more info to be addressable
Projects
None yet
Development

No branches or pull requests

3 participants