-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfixedexampleBezPath.html
44 lines (40 loc) · 1.74 KB
/
fixedexampleBezPath.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Smooth Example</title>
<!--[if IE]><script language="javascript" type="text/javascript" src="http://server.noblemail.ca/flot/excanvas.pack.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="http://server.noblemail.ca/flot/jquery.js"></script>
<script language="javascript" type="text/javascript" src="http://server.noblemail.ca/~steven/raphael.js"></script>
<script language="javascript" type="text/javascript" src="smoothcurves.js"></script>
</head>
<body>
<h1>Smooth Curves</h1>
<div id="placeholder" style="width:400px;height:400px;"></div>
<div id="data"></div>
<script id="source" language="javascript" type="text/javascript">
$(function () {
var rawdata = [[0,100], [50,100], [100,100], [150,300], [200,200], [250,150], [300,150], [400, 150]];
/*var lastx = 0; var lasty=3*Math.random() - 1.5;
for (var j = 0; j<15; j += 1){
rawdata.push([lastx, lasty]);
lastx += 1+Math.random()*5;
lasty += 5*Math.random() - 2.5;
}*/
var smoother1 = new PlotSmoother(1,1);
var d1 = smoother1.smoothBezPath(rawdata);
var smoother2 = new PlotSmoother(2,1);
var d2 = smoother2.smoothBezPath(rawdata);
var smoother3 = new PlotSmoother(3,1);
smoother3.setSane(true);
var d3 = smoother3.smoothBezPath(rawdata);
var smoother4 = new PlotSmoother(3,1);
var d4 = smoother4.smoothBezPath(rawdata);
r = Raphael("placeholder");
r.path(d1).attr({stroke: "red"});
r.path(d3).attr({stroke: "blue"});
r.path(d4).attr({stroke: "green"});
});
</script>
</body>
</html>