Skip to content

Commit

Permalink
Fixing missing world trade data for PS
Browse files Browse the repository at this point in the history
  • Loading branch information
romsson committed Sep 24, 2014
1 parent 22184eb commit 10b697e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion media/js/explore/viz_general.js
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,16 @@ var flat_data,
}

flat_data.map(function(d){
d.world_trade = world_totals[d.year].filter(function(z){ return d.item_id==z.product_id })[0]['world_trade']
if (typeof world_totals[d.year].filter(function(z){ return d.item_id==z.product_id })[0] != "undefined")
{
d.world_trade = world_totals[d.year].filter(function(z){ return d.item_id==z.product_id })[0]['world_trade']
}
else // if not then assign value as 0
{
d.world_trade = 0
}

// d.world_trade = world_totals[d.year].filter(function(z){ return d.item_id==z.product_id })[0]['world_trade']
})

data = []
Expand Down

0 comments on commit 10b697e

Please sign in to comment.