cytoscape.js json jstree ajax not formatting -


i can't json data proper hierarchy when use jstree.

here ajax call along function call tree:

$(function(){  var layoutpadding = 10; var layoutduration = 500;  var graphp = $.ajax({   url: '/api/element/list',   type: 'get',   datatype: 'json',   success: loadtree, });  function loadtree(data){  $('#cy').jstree({      "format_version" : "1.0",     "generated_by" : "cytoscape-3.2.0",     "target_cytoscapejs_version" : "~2.1",        "data" : {          "selected" : true,         "__annotations" : [ ],         "shared_name" : "network",         "suid" : "1",         "name" : "network"        },        "elements" : {            "nodes" : [ {              "data" : {               "id" : "string", //should same suid               "selected" : false,               "cytoscape_alias_list" : "string",               "canonicalname" : "string",               "description" : "string",               "quality" : "number",               "type" : "string",               "suid" : "string",               "nodetype" : "string",               "name" : "string",               "shared_name" : "string"               },               "position" : {                 "x" : "number",                 "y" : "number"               },               "selected" : false           } ],            "edges" : [ {              "data" : {               "id" : "string",               "source" : "string",               "target" : "string",               "selected" : false,               "canonicalname" : "string",               "suid" : "string",               "name" : "string",               "interaction" : "string",               "shared_interaction" : "string",               "shared_name" : "string"               },               "selected" : false           }],         }        })  } 

and here get:

{elements: [{_id: "5824a83b1c2b91974cee8682", updatedby: "5821aaa2045b47581fd37594",…}]} elements : [{_id: "5824a83b1c2b91974cee8682", updatedby: "5821aaa2045b47581fd37594",…}] 0 : {_id: "5824a83b1c2b91974cee8682", updatedby: "5821aaa2045b47581fd37594",…}

i need this:

{format_version: "1.0", generated_by: "cytoscape-3.2.0", target_cytoscapejs_version: "~2.1",…} data : {selected: true, __annotations: [], shared_name: "network", suid: 1, name: "network"} elements : {nodes: [{,…},…], edges: [,…]} format_version : "1.0" generated_by : "cytoscape-3.2.0" target_cytoscapejs_version : "~2.1"

i loose this:

  "format_version" : "1.0",     "generated_by" : "cytoscape-3.2.0",     "target_cytoscapejs_version" : "~2.1",        "data" : {          "selected" : true,         "__annotations" : [ ],         "shared_name" : "network",         "suid" : "1",         "name" : "network"        }, 

along hierchy together.


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -