You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function d3.json doesn't deliver as explained in many tutorials. In every tutorials, they considered d3.json as d3.csv but for JSON format. So they explain this would work:
d3.json("./data/users.json", function(error, data) {
d3.select("body").selectAll("p").data(data).enter().append("p").text(function(d) {
return d.name + ", " + d.location;
});
});
It doesn't ! Viewing the code in d3.v7.js, the d3.json should work like so:
d3.json("./data/users.json").then ( data => {
d3.select("body").selectAll("p").data(data).enter().append("p").text(function(d) {
return d.name + ", " + d.location;
});
});
So if I'm not wrong, either d3 module should be readjusted making d3.json works in the same logic as d3.csv or all tutorials about d3.json in the web needs to be informed about the mistake...
Please if I'm wrong correct me.
The text was updated successfully, but these errors were encountered:
The function d3.json doesn't deliver as explained in many tutorials. In every tutorials, they considered d3.json as d3.csv but for JSON format. So they explain this would work:
d3.json("./data/users.json", function(error, data) {
d3.select("body").selectAll("p").data(data).enter().append("p").text(function(d) {
return d.name + ", " + d.location;
});
});
It doesn't ! Viewing the code in d3.v7.js, the d3.json should work like so:
d3.json("./data/users.json").then ( data => {
d3.select("body").selectAll("p").data(data).enter().append("p").text(function(d) {
return d.name + ", " + d.location;
});
});
So if I'm not wrong, either d3 module should be readjusted making d3.json works in the same logic as d3.csv or all tutorials about d3.json in the web needs to be informed about the mistake...
Please if I'm wrong correct me.
The text was updated successfully, but these errors were encountered: