jStat with Flot integration

Today I pushed Flot integration into jStat’s master branch. The entire thing is only a couple dozen lines of code. The syntax follows fairly close to Flot’s API. Here’s a snippet from the Flot test page:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var betaInst = jStat.beta( 3, 4 );
j$.flot( '#betadiv', [{
    data : betaInst.pdf,
    label : 'PDF'
},{
    data : betaInst.cdf,
    label : 'CDF',
    yaxis : 2
}],{
    flotopts : {
        yaxes : [{}, { position : 'right' }]
    },
    start : 0,
    stop : 1,
    step : 1001
});

The big thing is that you can pass the instantiated object itself for the data, which will be used to calculate the data points on the fly. Here’s an image of what the above example would look like:

Beta Dist Flot Example

  • guest

    Is there any documentation for jstat? I’d love to create an application around it but don’t have a list of the commands that jstat can accept…