---------- Forwarded message ----------
From:
Swathi Panchala <span...@gmail.com>Date: Thu, Aug 11, 2016 at 10:02 AM
Subject: [Cytoscape-discuss] Re: Importing cyjs (json) file into cytoscape.js
To: cytoscape-discuss <
cytoscap...@googlegroups.com>
On Sunday, February 28, 2016 at 7:41:01 AM UTC-5, Dolunay wrote:
> Hello all,
>
>
> I'm new to cytoscape.js, so forgive me if this is a very basic question. I found this q&a in stackoverflow but I could not quite understand how it solved the problem.
>
>
> I have a cysj file that I exported from Cytoscape 3.1.1, and I want to open this file in cytoscape.js.
>
>
> I have the following example script in my html page and instead of embedding elements into this code, I want to read them from the cysj json file.
>
>
> $(function(){
> var cy =
window.cy = cytoscape({
> container: document.getElementById('cy'),
> layout: {
> name: 'cose',
> idealEdgeLength: 100,
> nodeOverlap: 20
> },
> style: [{..........}}],
>
> elements: {
> nodes: [
> { data: { id: 'n0' } },
> { data: { id: 'n1' } },
> { data: { id: 'n2' } },
> { data: { id: 'n3' } },
> { data: { id: 'n4' } },
> { data: { id: 'n5' } },
> { data: { id: 'n6' } },
> { data: { id: 'n7' } },
> { data: { id: 'n8' } },
> { data: { id: 'n9' } },
> { data: { id: 'n10' } },
>
> ],
> edges: [
> { data: { source: 'n0', target: 'n1' } },
> { data: { source: 'n1', target: 'n2' } },
> { data: { source: 'n1', target: 'n3' } },
> { data: { source: 'n4', target: 'n5' } },
> { data: { source: 'n4', target: 'n6' } },
> { data: { source: 'n6', target: 'n7' } },
> { data: { source: 'n6', target: 'n8' } },
> { data: { source: 'n8', target: 'n9' } },
> { data: { source: 'n8', target: 'n10' } },
>
> ]
> },
> });
> });
>
>
>
>
> Thanks in advance,
> Dolunay
>
Hi Dolunay,
I am new to cytoscape.js too and I am also actually looking for the solution to same question. Did you found how to get elements data from Local Json file instead of putting the data in the HTML ?
Thanks,
Swathi
--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to cytoscape-discuss@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-discuss.
For more options, visit https://groups.google.com/d/optout.