3d-force-graph
3d-force-graph copied to clipboard
Importing datasets locally
I have an issue when trying to recreate the example files with .json datasets locally. I have downloaded the json files locally and stored it in the same folder. But when I change parameters in the scripts with, for instance, miserables.json .jsonUrl('miserables.json') ...I get only the data loading screen... Loading.... What I am doing wrong? Thank you for your time and answer. This is an amazing project :)
@bperak thanks for reaching out.
Do you see a (console) network error saying that the json
file cannot be found?
That can happen if you're not loading your files using a webserver, but opening the html
directly in the browser. Could that be the reason?
how do you see that i have the same error i can get the basic example to work but the large graph when i put in the full path to my data file just shows a loading page. thanks for your help the library looks wonderful
never mind i got it to work the problem was that local files couldnt be accessed so i disable the cors flag or enable it i dont know i download the chrome web server and run it from there works great nice package
but how do i expand the network more its too dense right now
@bperak thanks for reaching out. Do you see a (console) network error saying that the
json
file cannot be found? That can happen if you're not loading your files using a webserver, but opening thehtml
directly in the browser. Could that be the reason?
The same problem. The console says
3d-force-graph:5 Fetch API cannot load file:///Users/xxxx/Desktop/data.json. URL scheme must be "http" or "https" for CORS request.
Is that means local file is not supported?
@CorbinZhou that is not specific to this module. That's related to the security policies in your browser of what resources can be loaded. It's telling you that you have to load those resources over http, which basically means you need to use a web server, instead of opening the html file directly in your browser.