I've been recently trying a develop a simple application, which would use user input, convert it to json and use that json in another function to draw graph. I managed to output correct json to console, but when I try to call it as a parameter in the function which uses it to draw graph, it fails to work. If I manually copy console output directly to the plotting function it works normally. So the question here is, how does one use Json as a function parameter.
graph obj:
var graph = {
"nodes": [],
"edges": []
}
..some code which fills graph (irrelevant here).. ending with a function call:
console.log(JSON.stringify(graph, null, '\t')); //works perfectly if manually copied
var inpt = JSON.stringify(graph, null, '\t');
execute(inpt); //doesn't work
And the execute() with the json line:
execute(input)
elements: input,
...some more code...