小编len*_*nny的帖子

在d3中制作动画弧响应?

我在d3看这个动画,

http://bl.ocks.org/mbostock/5100636

我想知道有没有办法让这个响应,所以大小随着浏览器窗口的大小调整而改变?或者如果使用raphael.js会更容易?

这是代码:

<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>

var width = 960,
height = 500,
? = 2 * Math.PI; // http://tauday.com/tau-manifesto

// An arc function with all values bound except the endAngle. So, to compute an
// SVG path string for a given angle, we pass an object with an endAngle
// property to the `arc` function, and it will return the corresponding string.
var arc = d3.svg.arc()
.innerRadius(180)
.outerRadius(240)
.startAngle(0);

// Create the SVG …
Run Code Online (Sandbox Code Playgroud)

javascript raphael responsive-design d3.js

4
推荐指数
1
解决办法
1721
查看次数

标签 统计

d3.js ×1

javascript ×1

raphael ×1

responsive-design ×1