www.leivein.com/Resource/Images/3rd/qrcode_jun-v-qing_430x430.jpg
<!DOCTYPE html>
<html lang="zh" class="">
<head>
<meta charset="utf-8" />
<style>
.link {
stroke: #ccc;
}
.node text {
pointer-events: none;
font: 10px sans-serif;
}
</style>
</head>
<body>
<div>
<span>文件名:</span>
<input id="file" name="file" type="text"></input>
<button onclick="process();">PROCESS</button>
</div>
<div id="graph"></div>
<script src="./lib/jquery-1.8.2.js"></script>
<!-- <script src="./lib/collections.js"></script> -->
<script src="./lib/linq.js"></script>
<script src="./lib/d3/d3.v3.js"></script>
<script src="./lib/d3/d3-tip.js"></script>
<script src="./lib/lore-graph.js"></script>
<script>
var params = {
svgContainer: "graph",
width: 960,
height: 600,
};
LoreGraph = $.extend(LoreGraph, params);
LoreGraph.init();
function process() {
//file:///D:/lore-graph-master%20(2)/lore-graph-master/test1.html
//var url = "file:///D:/lore-graph-master%20(2)/lore-graph-master/example-data/graph1.json";// + document.getElementById("file").value;
//LoreGraph.process(url);
var json = '{'+
'"object_uri": "http://a.com/object/1234",'+
'"nodes": ['+
' { "id": 0, "type": "", "value": "", "icon": "http://img3.douban.com/pics/douban-icons/favicon_24x24.png" },'+
' { "id": 1, "type": "number", "value": "2013", "icon": "http://img3.douban.com/pics/douban-icons/favicon_24x24.png" },'+
' { "id": 2, "type": "number", "value": "2014", "icon": "http://img3.douban.com/pics/douban-icons/favicon_24x24.png" },'+
' { "id": 3, "type": "string", "value": "Hello", "icon": "http://mat1.gtimg.com/app/opent/images/wiki/resource/weiboicon24.png" },'+
' { "id": 4, "type": "string", "value": "World", "icon": "http://mat1.gtimg.com/app/opent/images/wiki/resource/weiboicon24.png" },'+
' { "id": 5, "type": "string", "value": "你好", "icon": "http://mat1.gtimg.com/app/opent/images/wiki/resource/weiboicon24.png" },'+
' { "id": 6, "type": "string", "value": "世界", "icon": "http://mat1.gtimg.com/app/opent/images/wiki/resource/weiboicon24.png" },'+
' { "id": 7, "type": "string", "value": "楚辞。。", "icon": "http://mat1.gtimg.com/app/opent/images/wiki/resource/weiboicon24.png" },'+
' { "id": 8, "type": "object_uri", "value": "http://", "icon": "http://mat1.gtimg.com/app/opent/images/wiki/resource/weiboicon24.png" },'+
' { "id": 9, "type": "object_uri", "value": "http:/", "icon": "http://www.sinaimg.cn/blog/developer/wiki/LOGO_24x24.png" },'+
' { "id": 10, "type": "uri", "value": "http:/", "icon": "http://img3.douban.com/pics/douban-icons/favicon_24x24.png" },'+
' { "id": 11, "type": "image_uri", "value": "http://w", "icon": "http://mat1.gtimg.com/app/opent/images/wiki/resource/weiboicon24.png" },'+
' { "id": 12, "type": "image_uri", "value": "http://", "icon": "http://mat1.gtimg.com/app/opent/images/wiki/resource/weiboicon24.png" }'+
'],'+
'"relations": ['+
' { "uri": "http://a.com/schema/hasChild", "title": "子节点", "description": "子……节……点……898a0sd8f0-a8d90f80asf08a8df90a0sdf09ikv90zix90v8-=awiofkjpokzx90viojkofjklzxc89" },'+
' { "uri": "http://a.com/schema/hasFather", "title": "父节点", "description": "父……节……点……14513451451345134514513451345143514514351515414543513451541351435145134513451345" },'+
' { "uri": "http://a.com/schema/ref", "title": "引用", "description": "参考……参考……fasfasdfafdasdfadssssssssssfdadfasfadf;kljaksjdfa;lsdfjkljasdlfjljadfjl;asdjfklasd;fjlfj" },'+
' { "uri": "http://a.com/schema/name", "title": "名称", "description": "" },'+
' { "uri": "http://a.com/schema/title", "title": "头衔", "description": "" },'+
' { "uri": "http://a.com/schema/age", "title": "年龄", "description": "" },'+
' { "uri": "http://a.com/schema/image", "title": "图像", "description": "" },'+
'{ "uri": "http://a.com/schema/description", "title": "描述", "description": "" }'+
'],'+
'"edges": [' +
' { "source":0, "relation": "http://a.com/schema/age", "target": 1 },'+
' { "source":0, "relation": "http://a.com/schema/age", "target": 2 },'+
' { "source":0, "relation": "http://a.com/schema/name", "target": 3 },'+
' { "source":0, "relation": "http://a.com/schema/title", "target": 4 },'+
' { "source":0, "relation": "http://a.com/schema/name", "target": 5 },'+
' { "source":0, "relation": "http://a.com/schema/title", "target": 6 },'+
' { "source":0, "relation": "http://a.com/schema/description", "target": 7 },'+
' { "source":0, "relation": "http://a.com/schema/hasChild", "target": 8 },'+
' { "source":0, "relation": "http://a.com/schema/hasFather", "target": 9 },'+
' { "source":0, "relation": "http://a.com/schema/ref", "target": 10 },'+
' { "source":0, "relation": "http://a.com/schema/image", "target": 11 },'+
' { "source":0, "relation": "http://a.com/schema/image", "target": 12 }'+
']}';
var jsn=JSON.parse(json)
LoreGraph.processJsonData(jsn);
}
document.getElementById("file").value = "graph1.json";
</script>
</body>
</html>```