I use the function exampleData() to generate a flat, 1-dimensional array that is used to generate SVG elements with d3.js (vesion 3.5.5). That works perfectly.
But when I use the below mentioned function load() [like dataset = load();], this leads to the error TypeError: groupData is undefined d3.v3.js:1688:31 .
Can anyone help? The file data.csv has a column header called x and 20 additional rows with one integer in each row . The arrays seems to be okay when querying at he console of the webbrowser.
Best , Frank
function exampleData() {
return [ 11, 12, 15, 20, 18, 17, 16, 18, 23, 25,5, 10, 13, 19, 21, 25, 22, 18, 15, 13];
}
function load() {
d3.csv("data.csv", function(data) {
dataset2 = data.map(function(d) {
return [ +d["x"] ];
});
//console.log(dataset2);
dataset2= d3.merge(dataset2);
//console.log(data);
return dataset2;
});
}
groupDatain your example and you have not indicated which line throws the error. Without that it is impossible to answer your question.