赞
踩
d3.js 搭建 d3-force-directed-graph 例子
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
- <script src="http://d3js.org/d3.v3.min.js"></script>
- <style>
- .node {
- stroke: #fff;
- stroke-width: 1.5px;
- }
- .link {
- stroke: #999;
- stroke-opacity: .6;
- }
- </style>
- <title>Hello World! Site Title</title>
- </head>
- <body>
- <script>
- var width = 600,
- height = 400;
-
- var svg = d3.select("body")
- .append("svg")
- .attr("width", width)
- .attr("height", height)
-
- var links = [
- {source: 0, target: 1},
- {source: 0, target: 2},
- {source: 1, targ
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。