netjsongraph.js icon indicating copy to clipboard operation
netjsongraph.js copied to clipboard

Remove URL requirement and allow data to be passed as array or object

Open ghost opened this issue 7 years ago • 6 comments

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.

ghost avatar Aug 20 '16 23:08 ghost

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

nemesifier avatar Aug 23 '16 11:08 nemesifier

thanks!

ghost avatar Nov 07 '16 04:11 ghost

@geekplux this is also interesting, do you think we can do it?

nemesifier avatar May 31 '17 15:05 nemesifier

added a .load([data]) function.

geekplux avatar Aug 20 '17 16:08 geekplux

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

nemesifier avatar Aug 24 '17 15:08 nemesifier

@nemesisdesign I have updated README in dev branch. https://github.com/netjson/netjsongraph.js/commit/f8b49f15e99a1be2cee6813181f37bc2fa7a5fdf#diff-88b99bb28683bd5b7e3a204826ead112R212

geekplux avatar Aug 24 '17 16:08 geekplux