Skip to content

Commit

Permalink
bug cartogram NA
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Aug 3, 2018
1 parent 11d9256 commit bb7a846
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inst/js/r2d3cartogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,11 @@ r2d3.onRender(function(json, div, width, height, options) {
//d3.format(field.format || ","),
value = function(d) {
//console.log(JSON.stringify(d)); // null here
return +d.properties[key];
var val = d.properties[key];
if (isNaN(val)) {
val = 0;
}
return +val;
},
values = states.data()
.map(value)
Expand Down

0 comments on commit bb7a846

Please sign in to comment.