Skip to content

Commit 9313b73

Browse files
committed
adding initial files for flot plugin
1 parent f013d07 commit 9313b73

File tree

5 files changed

+81
-0
lines changed

5 files changed

+81
-0
lines changed

src/plugin/flot.jstat.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(function( jStat, jQuery ) {
2+
3+
jStat.plot = function( selector, opts ) {
4+
5+
};
6+
7+
})( this.jStat, this.jQuery );

test/css/flot.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.graph-example{
2+
width: 600px;
3+
height: 400px;
4+
}

test/flot.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<title>Flot Tests</title>
6+
<link rel="stylesheet" href="css/flot.css" />
7+
<script src="js/jquery.min.js"></script>
8+
<script src="js/jquery.flot.min.js"></script>
9+
<script src="../src/core.js"></script>
10+
<script src="../src/special.js"></script>
11+
<script src="../src/distribution.js"></script>
12+
<script src="../src/plugin/flot.jstat.js"></script>
13+
<script src="js/tests/flot-tests.js"></script>
14+
</head>
15+
<body>
16+
<h1>Basic Examples</h1>
17+
<h2>Beta Distriubtion</h2>
18+
<div class="graph-example" id="betadiv"></div>
19+
<h2>Cauchy Distriubtion</h2>
20+
<div class="graph-example" id="cauchydiv"></div>
21+
<h2>Student T Distriubtion</h2>
22+
<div class="graph-example" id="studenttdiv"></div>
23+
</body>
24+
</html>

test/js/jquery.flot.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/js/tests/flot-tests.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
$(function() {
2+
var betaInst = jStat.beta( 3, 4 );
3+
$.plot( '#betadiv', [
4+
{
5+
data : jStat.seq( 0, 1, 101, function( x ) { return [ x, betaInst.pdf( x )];}),
6+
label : 'PDF'
7+
},{
8+
data : jStat.seq( 0, 1, 101, function( x ) { return [ x, betaInst.cdf( x )];}),
9+
label : 'CDF',
10+
yaxis : 2
11+
}],{
12+
yaxes : [{}, { position : 'right' }]
13+
});
14+
15+
var cauchyInst = jStat.cauchy( 3, 4 );
16+
$.plot( '#cauchydiv', [
17+
{
18+
data : jStat.seq( -20, 20, 101, function( x ) { return [ x, cauchyInst.pdf( x )];}),
19+
label : 'PDF'
20+
},{
21+
data : jStat.seq( -20, 20, 101, function( x ) { return [ x, cauchyInst.cdf( x )];}),
22+
label : 'CDF',
23+
yaxis : 2
24+
}],{
25+
yaxes : [{}, { position : 'right' }]
26+
});
27+
28+
var stInst = jStat.studentt( 4 );
29+
$.plot( '#studenttdiv', [
30+
{
31+
data : jStat.seq( -6, 6, 101, function( x ) { return [ x, stInst.pdf( x, 4 )];}),
32+
label : 'PDF'
33+
},{
34+
data : jStat.seq( -6, 6, 101, function( x ) { return [ x, stInst.cdf( x, 4 )];}),
35+
label : 'CDF',
36+
yaxis : 2
37+
}],{
38+
yaxes : [{}, { position : 'right' }]
39+
});
40+
});

0 commit comments

Comments
 (0)