netjsongraph.js
netjsongraph.js copied to clipboard
Remove URL requirement and allow data to be passed as array or object
Right now, you have your code written to require a URL, assuming that it's pulling a json file. Not everything is in a file, nor is it advantageous to have to write data out of a database into a file on every page load, so a front-end system can pick it up. It's feasible that the data has already been passed to the front end and ready for use by this. If I can pass a json object in instead of a URL then I'm happy. If I have to go through file IO, that kills performance, page load times, and UX experience.
Pretty legitimate request, it shouldn't be hard to implement. I'm not working on this project actively right now, so I will implement this feature if I need it in the near future, or you can try to send a patch yourself. Federico
thanks!
@geekplux this is also interesting, do you think we can do it?
added a .load([data])
function.
I just noticed that it is already possible to pass a javascript object instead of a URL, is just not clear from the code and documentation
@nemesisdesign I have updated README in dev
branch. https://github.com/netjson/netjsongraph.js/commit/f8b49f15e99a1be2cee6813181f37bc2fa7a5fdf#diff-88b99bb28683bd5b7e3a204826ead112R212