I want to load json data from JSONField, I load the file inside js and I got an uncaught and a 404 not found error, it seems it read the value as an object but in the console I can see the data loaded as a json
var jjson = {{proyecto.ifc_json|safe}};
console.log(typeof(jjson)) // = object
var jsoo = JSON.stringify(jjson);
console.log(typeof(jsoo)) // = string
var jsonn = JSON.parse(jsoo);
console.log(typeof(jsonn))// = object
I got an error loading any of those in the d3.json method
d3.json(jjson, function(error, flare) {
if (error) throw error;
root = d3.hierarchy(flare);
root.x0 = 0;
root.y0 = 0;
update(root);
});
cant figure whats the problem, thanks