Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Server side image creation , load datajson dynamically

$
0
0

@shameer.sheik wrote:

Hi,

I went through your link - http://gojs.net/latest/intro/serverSideImages.html . I am using phantom js and the image is rendering for me on the server side.

I am not able to give nodedataarray , linkdataarray as arguments to the createImage.js

In your example you have given inline as

var nodeDataArray = [
{ key: "Alpha", color: "lightblue" },
{ key: "Beta", color: "orange" },
{ key: "Gamma", color: "lightgreen" },
{ key: "Delta", color: "pink" }
];
var linkDataArray = [
{ from: "Alpha", to: "Beta" },
{ from: "Alpha", to: "Gamma" },
{ from: "Beta", to: "Beta" },
{ from: "Gamma", to: "Delta" },
{ from: "Delta", to: "Alpha" }
];

i want to replace this with

nodeDataArray = JSON.parse(system.args[1]);
linkDataArray = JSON.parse(system.args[2]);

This will let me call the createImage.js as

phantomjs createImage.js nodedataarrayjson linkdataarrayjson

it seems the function page.evaluate is sandboxed and doesnt let me use system arguments inside the function. Could you point me on the right direction to do this ?

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles