data = restructuredData.map(r=>{
var males = Array.from({length:r.to.male}).map(d=>Object.assign({disp:r.to.male,color:'#80C9FF'},r)) ;
var females = Array.from({length:r.to.female}).map(d=>Object.assign({disp:r.to.female,color:'#FFA7D4'},r));
return males.concat(females)
})
.reduce((a,b)=>a.concat(b))
.map(d=>{
var shuffled = shuffleIt(d.from.coordinates.slice(),1)
var shuffledTo = shuffleIt(d.to.coordinates.slice(),diff(d.disp))
return Object.assign({},
d,
{from:Object.assign({},d.from,{coordinates:shuffled})},
{to:Object.assign({},d.to,{coordinates:shuffledTo})}
)
})