Created
December 17, 2017 10:25
-
-
Save levvsha/5d474135ab22f325ce596363b83eb5a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const nestByDate = d3.nest() | |
| .key(d => d.date) | |
| .entries(data); | |
| const percentsByDate = {}; | |
| nestByDate.forEach(dateItem => { | |
| percentsByDate[dateItem.key] = {}; | |
| dateItem.values.forEach(item => { | |
| percentsByDate[dateItem.key][item.regionId] = item.percent; | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment