title: Add value to object, calculated from 2 other columns D3js
body: <p>I am trying to add an element to each object in an array (read in from csv). The calculation comes from 2 other elements from that same object.</p>
  
  <p>I now have seperate object and adds that to the end of the array, and not as I wish as element to each object.</p>
  
  <p>Here's my code</p>
  
  <pre><code>    d3.csv("database.csv", function(error, data) {
  
              data = data.filter( function(row) {  //filter out inactive data
              return row['active']  !== "NO";
              });
  
              Angleabs = {'Angleabs': data.map( function (d) { //calculate absolute angle for use in a worldmap from longitude and latitude
              return (Math.sqrt(Math.pow(+d.lon,2) + Math.pow(+d.lat,2)))
              })};
  
              data.push(Angleabs);
  
              console.log(data);
              });
  </code></pre>
  
  <p>Thanks,</p>
  
  <p>Roger</p>