Converted to d3 v4 plus move contain mutations indside reduce https://bl.ocks.org/mbostock/1046712
Converted https://bl.ocks.org/mbostock/1046712 to d3 v4
I hereby claim:
- I am bachstatter on github.
- I am bachstatter (https://keybase.io/bachstatter) on keybase.
- I have a public key ASDul4lHHRyBblMBKnvJSVmMcQbr-ZCp1I3hZtRqqunXOwo
To claim this, I am signing this object:
This file contains 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
import { get } from 'lodash' | |
// add second argument to get() where default is wanted | |
const parsePayment = (payment) => { | |
const payerInfo = get(payment, ['payer', 'payer_info']) | |
const item = get(payment, 'transactions[0]') | |
return { | |
id: payment.id, | |
created: moment(payment.create_time).format('X'), | |
email: get(payerInfo, ['email']), | |
firstName: get(payerInfo, ['first_name']), |
This file contains 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
import { get } from 'lodash' | |
// add second argument to get() where default is wanted | |
const parsePayment = (payment) => { | |
const payerInfo = get(payment, ['payer', 'payer_info']) | |
const item = get(payment, 'transactions[0]') | |
return { | |
id: payment.id, | |
created: moment(payment.create_time).format('X'), | |
email: get(payerInfo, ['email']), | |
firstName: get(payerInfo, ['first_name']), |