<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
#svgWrap{
width: 80%;
height: 80vh;
margin: 0 auto;
}
.tag rect{
fill: #fff;
stroke: #3377ff;
}
.goodsActive rect{
fill: #222222!important;
}
</style>
<script src="https://cdn.bootcss.com/d3/3.2.7/d3.min.js"></script>
</head>
<body>
<div class="container">
<div id="svgWrap"></div>
</div>
</body>
<script type="text/javascript">
window.onload = function () {
getData();
}
let getData = function () {
let rootData = {
"downward": {
"direction": "downward",
"name": "集成电路",
"children": [
{
"name": "异方性导电胶膜",
"amount": "100",
"ratio": "55%",
"hasHumanholding": true,
"hasChildren": true,
"isExpand": false,
"children": [
{
"name": "异方性导电胶",
"hasHumanholding": false,
"hasChildren": true,
"amount": "100",
"ratio": "55%",
"children": []
},
{
"name": "异方性导电",
"hasHumanholding": false,
"hasChildren": true,
"amount": "100",
"ratio": "55%",
"children": []
}
]
},
{
"name": "异方性导电1",
"amount": "100",
"ratio": "55%",
"hasHumanholding": true,
"hasChildren": true,
"isExpand": false,
"children": [
{
"name": "异方性导电2",
"hasHumanholding": false,
"hasChildren": true,
"amount": "100",
"ratio": "55%",
"children": [
{
"name": "异方性导电4",
"hasHumanholding": false,
"hasChildren": true,
"amount": "100",
"ratio": "55%",
"children": []
}
]
},
{
"name": "异方性导电3",
"hasHumanholding": false,
"hasChildren": true,
"amount": "100",
"ratio": "55%",
"children": [
{
"name": "异方性导电4",
"hasHumanholding": false,
"hasChildren": true,
"amount": "100",
"ratio": "55%",
"children": []
}
]
}
]
},
{
"name": "异方性导电胶膜1",
"amount": "100",
"ratio": "55%",
"hasHumanholding": true,
"hasChildren": true,
"isExpand": false,
"children": [
{
"name": "异方性导电12",
"hasHumanholding": false,
"hasChildren": true,
"amount": "100",
"ratio": "55%",
"children": []
},
{
"name": "异方性导电13",
"hasHumanholding": false,
"hasChildren": true,
"amount": "100",
"ratio": "55%",
"children": []
}
]
},
{
"name": "异方性导电胶16",
"hasHumanholding": false,
"hasChildren": true,
"amount": "100",
"ratio": "55%",
"children": []
},
{
"name": "异方性导电19",
"hasHumanholding": false,
"hasChildren": true,
"isExpand": false,
"amount": "100",
"ratio": "55%",
"children": [
{
"name": "异方性导电20",
"hasHumanholding": false,
"amount": "100",
"ratio": "55%",
"children": []
},
{
"name": "异方性1",
"hasHumanholding": false,
"amount": "100",
"ratio": "55%",
"children": []
},
{
"name": "异方性导电5",
"hasHumanholding": false,
"amount": "100",
"ratio": "55%",
"children": []
},
{
"name": "sdafad",
"hasHumanholding": false,
"amount": "100",
"ratio": "55%",
"children": []
}
]
}
]
},
"upward": {
"direction": "upward",
"name": "origin",
"children": [
{
"name": "上海唯猎创",
"hasHumanholding": false,
"amount": "100",
"posotion": 'down',
"ratio": "55%",
"children": [
{
评论0