react-force-graph
react-force-graph copied to clipboard
How can I connect to 'flask'?
Describe the bug A clear and concise description of what the bug is.
Hi, I'm trying to connect the html code to flask(python). When I load html only by IDE(Pycharm), it makes a proper result. But, when I load it by flask, the result says 'Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data'
Is there any possible way to connect it to flask? I need it because I have to 'execute' the html file with arguments.
Thank you
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS] Ubuntu 18.04
- Browser [e.g. chrome, safari] FireFox
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
@Lee-daeho it's difficult to say without more context, but it appears the URL you're trying to load for the graph data may be returning something else other than a JSON response, causing the parser to choke.
I would look in the network tab to see if the data is being fetched correctly.
Thanks for fast reply.
This is my fetch result. Fetch fail to load json.
I think url can't match the storage in local.
Is there any possible solution?
@Lee-daeho this goes beyond the scope of this module and it's instead related to how your app is setup, but it looks like you don't have any resource behind that URL. See 404 status (not found).
@vasturiano You are right. I think localhost:5000 is not connected to my local storage(somewhere /virtual is defined).
But, when I load the HTML file only, URL is connected well.