Home Wiki Blog Forum GEXF.net

Gephi forums

Community support

Export d3.js javascript network in GEXF

Graphs inside the browser

Export d3.js javascript network in GEXF

Postby mikima » 09 Apr 2014 08:23

Hi to all,
i've created an online app to explore networks. Everything is made in js. The network is rendered using d3.js.

I'd like to add the ability to download the network in GEXF format, or something edible by gephi.

The networks are now described as js objects, containing two array of objects.

Any suggestion?

Below an example of network.

Code: Select all
var graph =  {
  "nodes": [
    {
      "name": "Climate change",
      "size": 68578,
      "depthlevel": 0,
      "status": "visited",
      "id": 0,
      "index": 0,
      "weight": 0,
      "x": 479.8230417570266,
      "y": 245.88634526613947,
      "px": 479.8031565954434,
      "py": 245.4240854261562
    },
    {
      "name": "Thermohaline circulation",
      "size": 0,
      "depthlevel": 1,
      "status": "new",
      "id": 1
    },
    {
      "name": "Milankovitch cycles",
      "size": 0,
      "depthlevel": 1,
      "status": "new",
      "id": 2
    },
    {
      "name": "Solar variation",
      "size": 0,
      "depthlevel": 1,
      "status": "new",
      "id": 3
    },
    {
      "name": "Global warming",
      "size": 0,
      "depthlevel": 1,
      "status": "new",
      "id": 4
    },
    {
      "name": "Historical impacts of climate change",
      "size": 0,
      "depthlevel": 1,
      "status": "new",
      "id": 5
    },
    {
      "name": "Polar ice packs|Climate change in the Arctic",
      "size": 0,
      "depthlevel": 1,
      "status": "new",
      "id": 6
    },
    {
      "name": "Sea level|Current sea level rise",
      "size": 0,
      "depthlevel": 1,
      "status": "new",
      "id": 7
    }
  ],
  "edges": [
    {
      "source": 0,
      "target": 1
    },
    {
      "source": 0,
      "target": 2
    },
    {
      "source": 0,
      "target": 3
    },
    {
      "source": 0,
      "target": 4
    },
    {
      "source": 0,
      "target": 5
    },
    {
      "source": 0,
      "target": 6
    },
    {
      "source": 0,
      "target": 7
    }
  ]
}
mikima
 
Posts: 3
Joined: 12 Apr 2011 13:00

Return to Visualization on the Web

Who is online

Users browsing this forum: No registered users and 1 guest

sports medicine portsmouth nh where to buy metronidazole