Reading the documentation, it implies that a specific domain is optional for d3.scale.ordinal().
However given this scale:
var y = d3.scale.ordinal().rangeBands([0, h], .2);
y("anything") = undefined:
however when I do this:
function pullIdArray(data) {
var s = {};
data.forEach(function(d) { s[d._id] = true; });
var ret = [];
for (var k in s) {console.log(k); ret.push(k);}
return ret;
}
var y = d3.scale.ordinal().domain(pullIdArray(data)).rangeBands([0, h], .2);
I get actual numerical values.
Can anyone tell me why this is?