-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
23 lines (23 loc) · 7.49 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="./css/force.css"/>
<script src="./vendor/jquery/jquery-1.11.3.min.js"></script>
<script src="./vendor/d3/d3.v3.min.js"></script>
<script src="./js/force.js"></script>
</head>
<body style="background: #fff;">
<div id="main_wrapper" style="width: 1000px;height:1000px; position: relative;"></div>
</body>
</html>
<script>
$('#main_wrapper').css({height: $(window).height(), width: $(window).width()});
var graph ={"relationList":[{"relationType":"invest","amount":"143934.047800","sourceEntity":"1","targetEntity":"0","endDate":"","name":"invest","amountPercent":null,"label":"invest(143934.047800million)","startDate":"2015-10-30"},{"relationType":"invest","amount":"18724.356900","sourceEntity":"2","targetEntity":"0","endDate":"","name":"invest","amountPercent":null,"label":"invest(18724.356900million)","startDate":"2015-10-30"},{"relationType":"invest","amount":"3718.496300","sourceEntity":"3","targetEntity":"0","endDate":"","name":"invest","amountPercent":null,"label":"invest(3718.496300million)","startDate":"2015-10-30"},{"relationType":"invest","amount":"18623.099000","sourceEntity":"4","targetEntity":"0","endDate":"","name":"invest","amountPercent":null,"label":"invest(18623.099000million)","startDate":"2015-10-30"},{"relationType":"serve","amount":"","sourceEntity":"5","targetEntity":"0","endDate":"","name":"director","amountPercent":null,"label":"","startDate":""},{"relationType":"legal representative","amount":"","sourceEntity":"1","targetEntity":"0","endDate":"","name":"legal representative","amountPercent":null,"label":"","startDate":""},{"relationType":"serve","amount":"","sourceEntity":"1","targetEntity":"0","endDate":"","name":"manager","amountPercent":null,"label":"","startDate":""},{"relationType":"serve","amount":"","sourceEntity":"1","targetEntity":"0","endDate":"","name":"chairman","amountPercent":null,"label":"","startDate":""},{"relationType":"serve","amount":"","sourceEntity":"6","targetEntity":"0","endDate":"","name":"director","amountPercent":null,"label":"","startDate":""},{"relationType":"serve","amount":"","sourceEntity":"7","targetEntity":"0","endDate":"","name":"director","amountPercent":null,"label":"","startDate":""},{"relationType":"serve","amount":"","sourceEntity":"2","targetEntity":"0","endDate":"","name":"director","amountPercent":null,"label":"","startDate":""},{"relationType":"invest","amount":"100.000000","sourceEntity":"0","targetEntity":"8","endDate":"","name":"invest","amountPercent":null,"label":"invest(100.000000million)","startDate":"2012-10-22"},{"relationType":"invest","amount":"0.000000","sourceEntity":"0","targetEntity":"9","endDate":"","name":"invest","amountPercent":null,"label":"invest(0.000000million)","startDate":""},{"relationType":"invest","amount":"289.743800","sourceEntity":"0","targetEntity":"10","endDate":"","name":"invest","amountPercent":null,"label":"invest(289.743800million)","startDate":"1900-01-01"},{"relationType":"invest","amount":"200000.000000","sourceEntity":"0","targetEntity":"11","endDate":"","name":"invest","amountPercent":null,"label":"invest(200000.000000million)","startDate":"2005-10-26"},{"relationType":"invest","amount":"120000.000000","sourceEntity":"0","targetEntity":"12","endDate":"","name":"invest","amountPercent":null,"label":"invest(120000.000000million)","startDate":"2014-02-14"},{"relationType":"invest","amount":"136.370000","sourceEntity":"0","targetEntity":"13","endDate":"","name":"invest","amountPercent":null,"label":"invest(136.370000million)","startDate":"2013-12-09"},{"relationType":"invest","amount":"0.000000","sourceEntity":"0","targetEntity":"14","endDate":"","name":"invest","amountPercent":null,"label":"invest(0.000000million)","startDate":"2013-05-24"},{"relationType":"invest","amount":"0.000000","sourceEntity":"0","targetEntity":"15","endDate":"","name":"invest","amountPercent":null,"label":"invest(0.000000million)","startDate":"2013-11-05"},{"relationType":"invest","amount":"5000.000000","sourceEntity":"0","targetEntity":"16","endDate":"","name":"invest","amountPercent":null,"label":"invest(5000.000000million)","startDate":"2016-12-31"},{"relationType":"invest","amount":"5000.000000","sourceEntity":"0","targetEntity":"17","endDate":"","name":"invest","amountPercent":null,"label":"invest(5000.000000million)","startDate":"2013-12-10"},{"relationType":"invest","amount":"162.156400","sourceEntity":"0","targetEntity":"18","endDate":"","name":"invest","amountPercent":null,"label":"invest(162.156400million)","startDate":"2013-12-23"}],"nodeList":[{"regCapital":185000,"endDate":"","entityName":"SalesForce","entityType":"COMPANY","main":true,"id":"0","startDate":"2010-03-03","isController":null},{"regCapital":0,"endDate":"","entityName":"Marc Benioff","entityType":"PERSON","main":false,"id":"1","startDate":"","isController":null},{"regCapital":0,"endDate":"","entityName":"Robin Washington","entityType":"PERSON","main":false,"id":"2","startDate":"","isController":null},{"regCapital":0,"endDate":"","entityName":"Susan Wojcicki","entityType":"PERSON","main":false,"id":"3","startDate":"","isController":null},{"regCapital":0,"endDate":"","entityName":"Marc Benioff","entityType":"PERSON","main":false,"id":"4","startDate":"","isController":null},{"regCapital":0,"endDate":"","entityName":"Maynard Webb","entityType":"PERSON","main":false,"id":"5","startDate":"","isController":null},{"regCapital":0,"endDate":"","entityName":"Colin Powell","entityType":"PERSON","main":false,"id":"6","startDate":"","isController":null},{"regCapital":0,"endDate":"","entityName":"Keith Block","entityType":"PERSON","main":false,"id":"7","startDate":"","isController":null},{"regCapital":100,"endDate":"2015-07-09","entityName":"ExactTarget","entityType":"COMPANY","main":false,"id":"8","startDate":"2012-10-29","isController":null},{"regCapital":222.2222,"endDate":"","entityName":"Thinkfuse","entityType":"COMPANY","main":false,"id":"9","startDate":"2013-12-19","isController":null},{"regCapital":1200,"endDate":"","entityName":"ChoicePass","entityType":"COMPANY","main":false,"id":"10","startDate":"2011-06-13","isController":null},{"regCapital":200000,"endDate":"","entityName":"Buddy Media","entityType":"COMPANY","main":false,"id":"11","startDate":"2005-10-26","isController":null},{"regCapital":120000,"endDate":"","entityName":"Stypi","entityType":"COMPANY","main":false,"id":"12","startDate":"2013-12-26","isController":null},{"regCapital":705.88,"endDate":"","entityName":"Model Metrics","entityType":"COMPANY","main":false,"id":"13","startDate":"2012-02-23","isController":null},{"regCapital":200,"endDate":"","entityName":"HubSpot","entityType":"COMPANY","main":false,"id":"14","startDate":"2013-05-24","isController":null},{"regCapital":1000,"endDate":"","entityName":"Assistly ","entityType":"COMPANY","main":false,"id":"15","startDate":"2013-11-05","isController":null},{"regCapital":5000,"endDate":"","entityName":"Etacts","entityType":"COMPANY","main":false,"id":"16","startDate":"2015-04-01","isController":null},{"regCapital":10000,"endDate":"","entityName":"Dimdim","entityType":"COMPANY","main":false,"id":"17","startDate":"2013-12-26","isController":null},{"regCapital":1353.0194,"endDate":"","entityName":"Heroku","entityType":"COMPANY","main":false,"id":"18","startDate":"2008-01-30","isController":null}]};
var drawRelation = new DrawRelation(graph, 'main_wrapper');
drawRelation.init();
drawRelation.showNodeInfo = function (node) {
alert(node.name)
}
</script>