Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

value/values on rollup function #17

Closed
Niekes opened this issue Aug 15, 2017 · 2 comments
Closed

value/values on rollup function #17

Niekes opened this issue Aug 15, 2017 · 2 comments

Comments

@Niekes
Copy link

Niekes commented Aug 15, 2017

Maybe I get this wrong but why does the rollup function creates an object with the key "value". I expected "values". Is this wanted behaviour ?

And how can I get "values" as key ?
https://jsfiddle.net/niekes/u6h4summ/1/

@mbostock
Copy link
Member

mbostock commented Aug 16, 2017

Yes, this is the expected behavior. Per the README:

The return value of the rollup function will replace the array of leaf values in either the associative array returned by nest.map or nest.object; for nest.entries, it replaces the leaf entry.values with entry.value.

You can try using array.map if you want to change the structure of the returned object. If you have further questions, also consider using Stack Overflow or the d3-js Google group to ask for help. Thank you!

@Niekes
Copy link
Author

Niekes commented Aug 17, 2017

Ok, thanks !

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

No branches or pull requests

2 participants