react獲取noe4j 資料 用d3js展示

2021-10-09 11:43:41 字數 2181 閱讀 1971

"neo4j-driver": "^4.1.2",
import neo4j from 'neo4j-driver'
async getknowmap(cypher, user) 

},relationships:

},initial_cypher: cypher

}var viz = new window.neovis.default(config);

viz.render();

// neo4j獲取資料轉d3js展示

var driver = neo4j.driver('bolt:', neo4j.auth.basic("neo4j", "123456"))

var session = driver.session()

try

}// console.log(list);

// 獲取所有節點資料

var nodes =

for (let i = 0; i < list.length; i++)

// 資料去重

var nn = deteleobject(nodes)

// console.log(nn);

// 獲取所有連線資料

var links =

for (let i = 0; i < list.length; i++)

link.source = relation.start.low

link.target = relation.end.low

link.type = relation.type

if (link.source != null && link.target != null)

links.push(link)

}// 資料去重

var ll = deteleobject(links)

// console.log(ll);

//關係資料index轉換

for (var i = 0; i < nn.length; i++)

if (n === t) }}

// console.log(ll);

this.setstate()

} finally

}

// 資料去重

function deteleobject(obj) ;

for (var i = 0; i < obj.length; i++) );

var str = '';

for (var j = 0; j < keys.length; j++)

if (!stringify.hasownproperty(str))

}return uniques;

}// 獲取資料型別

function getnode(pro, user) ;

node.id = pro.identity.low

node.label = label;

if (label === "caller") else

node.group = 0;

}node.type = "案件類別"

node.name = pro.properties.name;

node.group = 1;

}node.type = "承辦單位";

node.name = pro.properties.name;

node.group = 2;

}node.type = "案件主題";

node.name = pro.properties.name;

node.group = 3;

}node.type = "案件詳情";

node.name = pro.properties.desc;

node.group = 4;

if (node.name == null)

}node.type = "結案意見";

node.name = pro.properties.desc;

node.group = 5;

if (node.name == null)

}return node

}

componentwillmount()

snmp4j獲取資料例項

執行結果 request udp get requestid 0,errorstatus success 0 errorindex 0,vbs 1.3.6.1.2.1.1.1.0 null 1.3.6.1.2.1.1.2.0 null no error.1.3.6.1.2.1.1.1.0 respo...

react資料的獲取

fetch,es6最新提供全域性方法,用來ajax非同步請求資料。fetch 位址 then function res then function res 這裡返回的即是服務端返回的資料 1.想要獲取表單資料,那麼就是用ref繫結相對應的元素。然後通過元件直接獲取。ref監聽一般的表單 h1ref ...

dom4j獲取指定節點資料

現在我有乙個xml,如下 string xml 9do8t1 requestmenu 在網上搜尋的時候,發現dom4j,可以使用如下方法 document doc documenthelper.parsetext xml listlist doc.selectnodes nodename 按照網上的...