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

[fix] do not overwrite chart's function names, append instead #34

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

smee
Copy link

@smee smee commented Feb 20, 2015

In getValidOptionsForChart the code is

return _(chart).functions().extend(directiveOptions).map(function(s) {
           return 'dc' + s.charAt(0).toUpperCase() + s.substring(1);
      }).value();

The lodash function extend assumes it operates on objects, not on arrays. The effect is that array elements get replaced (the first directiveOptions.length elements of _.functions(chart) get replaced). If I now use a newer version of lodash, the order of elements returned by _.functions(...) has changed and the element 'dimension' gets replaced, which leads errors later on.

Resolution: Append the elements of directiveOptions using concat.

@TomNeyland
Copy link
Owner

@smee I'll try to pull and check this out today, I need to review the recent changes to lodash, but if thats the case then this makes sense.

Also, I noticed several changes to the UMD wrapper for dist/angular-dc.js, were those manual edits you made or did the newest version of grunt-umd introduce those changes?

@smee
Copy link
Author

smee commented Feb 23, 2015

Those changes are the result of the grunt build. The only manual change was
one line in the source file (replaced extend with concat).
Am 23.02.2015 16:36 schrieb "Tom Neyland" [email protected]:

@smee https://github.com/smee I'll try to pull and check this out
today, I need to review the recent changes to lodash, but if thats the case
then this makes sense.

Also, I noticed several changes to the UMD wrapper for dist/angular-dc.js,
were those manual edits you made or did the newest version of grunt-umd
introduce those changes?


Reply to this email directly or view it on GitHub
#34 (comment).

@TomNeyland
Copy link
Owner

Cool, figured as much but thought I'd check

@smee smee mentioned this pull request Apr 14, 2015
@TomNeyland
Copy link
Owner

TODO: Review after #38

@brdo
Copy link

brdo commented Oct 24, 2015

What's the status on this merge? Is there another work around in the meantime?

@baweaver
Copy link

Any updates on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants