Skip to content

Commit

Permalink
Fix labeling
Browse files Browse the repository at this point in the history
  • Loading branch information
danfowler committed Oct 13, 2015
1 parent e144a0a commit 47294a0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/utils/openspending.csvloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,17 @@ OpenSpending.CSVloader = function() {
// Constructor for making new nodes with the required
// attributes in the tree.
function Node(level,id,name,amount,currency) {
var node_label;
if (typeof(labels) !== "undefined" && (typeof(labels[name]) !== "undefined")) {
node_label = labels[name];
} else {
node_label = name;
}

this.id = String(id);
this.name = String(name);
this.amount = amount;
this.label = typeof(labels) !== "undefined" ? labels[name] : name;
this.label = node_label;
this.level = level;
this.children = [];
this.currency = currency;
Expand Down

0 comments on commit 47294a0

Please sign in to comment.