angular-dc icon indicating copy to clipboard operation
angular-dc copied to clipboard

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

Open smee opened this issue 11 years ago • 6 comments

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.

smee avatar Feb 20 '15 10:02 smee

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

TomNeyland avatar Feb 23 '15 15:02 TomNeyland

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 https://github.com/TomNeyland/angular-dc/pull/34#issuecomment-75566125.

smee avatar Feb 23 '15 15:02 smee

Cool, figured as much but thought I'd check

TomNeyland avatar Feb 23 '15 20:02 TomNeyland

TODO: Review after #38

TomNeyland avatar Jun 03 '15 06:06 TomNeyland

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

brdo avatar Oct 24 '15 15:10 brdo

Any updates on this one?

baweaver avatar Aug 16 '16 23:08 baweaver