Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
fix #1748
Browse files Browse the repository at this point in the history
d3-svg-legend throws an error in some no-data cases. We can catch those
and continue on our end, because an error really just means that the
legend won't render.
  • Loading branch information
Shawn Allen committed Sep 15, 2016
1 parent d0e2a5c commit 78de658
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/components/eiti-data-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@
.attr('class', 'legendScale');
}

legendScale.call(legend);
try {
legendScale.call(legend);
} catch (error) {
console.warn('legend error:', error);
}

} else {
console.warn('this <eiti-data-map> element does not have an associated svg legend.');
Expand Down

0 comments on commit 78de658

Please sign in to comment.