如何增加力图的链接长度.我的代码写在下面.我应该改变什么?
此外,我想在鼠标悬停时标记"仅子节点",父节点具有其标签.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Force</title>
<style type="text/css">
circle.node {
cursor: pointer;
stroke: #3182bd;
stroke-width: 1.5px;
}
line.link {
fill: none;
stroke: #9ecae1;
stroke-width: 1.5px;
}
</style>
</head>
<body>
<div id="chart"></div>
<script src="../d3/d3.v3.min.js"></script>
<script type="text/javascript">
var w = 960,
h = 500,
node,
link,
root;
var force = d3.layout.force()
.on("tick", tick)
.size([w*2, h*2]);
var vis = d3.select("#chart").append("svg:svg")
.attr("width", w*2)
.attr("height", h*2);
var diagonal = d3.svg.diagonal.radial()
.projection(function(d) { return [d.y, d.x / (180) * Math.PI]; });
d3.json("try.json", …Run Code Online (Sandbox Code Playgroud)