I have seen many examples with d3.csv() callback mappings such as:
var data = raw_data.map(function(d) { return
variable1 : +d.variable1,
variable2 : +d.variable2
});
However I'm trying to figure out how to use map.() for a JSON callback. The reason being is I have a attribute d: expected number, "MaNn", "NaNz" error. This error if I'm not mistaken, is often associated with data being parsed as a string. The JSON looks to be in numbers/floats, but just in case D3 is parsing my data as strings, I want to map it as numbers so I can rule out the parsed as a string culprit from my console log error. So, what I tried was roughly the same as the csv case above, using the unary +:
var json = raw_json.map(function(d) { return
xs: +d.xs,
ys: +d.ys,
id: +d.id
});
At this point, the error was still there. However I'm not sure if I fully rejected my null hypothesis of string parse error because I'm not totally confident that my JSON data .map() is of the right syntax. I'm kind of in limbo at the moment.
Question: Is my .map() totally wrong? Is there something more I can do to troubleshoot the expected number error?
I realize that JSON files have a wide range of data structures. Here is a screen shot of what my console.log(raw_json) looks like in the console log:
