@not_implemented_for('multigraph')
def jit_data(G, indent=None):
 json_graph = []
 for node in G.nodes():
  json_node = {'id': node, 'name': node}
  json_node['data'] = G.node[node]
  if G[node]:
   json_node['adjacencies'] = []
   for neighbour in G[node]:
    adjacency = {'nodeTo': neighbour}
    adjacency['data'] = G.edge[node][neighbour]
    json_node['adjacencies'].append(adjacency)
  json_graph.append(json_node)
 return json.dumps(json_graph, indent=indent)

@ not_implemented_for ( 'multigraph' ) def jit_data ( G , indent = None ) : json_graph = [ ] for node in G . nodes ( ) : json_node = { 'id' : node , 'name' : node } json_node [ 'data' ] = G . node [ node ] if G [ node ] : json_node [ 'adjacencies' ] = [ ] for neighbour in G [ node ] : adjacency = { 'nodeTo' : neighbour } adjacency [ 'data' ] = G . edge [ node ] [ neighbour ] json_node [ 'adjacencies' ] . append ( adjacency ) json_graph . append ( json_node ) return json . dumps ( json_graph , indent = indent )
return data in jit json format .