Commit 370e208f authored by Michael Zinsmaier's avatar Michael Zinsmaier

changed the readme text

parent 76f769a2
CurvedLines is a plugin for flot, which displays lines in a smooth curved way. This is achieved by adding additional points in between the "real" data points. See the test files for examples. ## What it is ##
The plugin is based on nergal.dev's work and gives you an option to display curved lines. I further extended the code with a 2nd mode, which forces the lines to have their minima/maxima on the original data points.
CurvedLines is a plugin for flot, which displays lines in a smooth curved way. This is achieved by adding additional points in between the "real" data points. See the test files for examples.
Feel free to add additional features and correct errors. Feel free to add additional features and correct errors.
Regards Michael Regards Michael
Update ## Hermite Splines v1.x.y ##
added tests/Issue18.htm with a better explanation of the curvePointFactor
and fitPointDist parameter! With the new version 1.x.y the original curve computation (nergal.dev's code) has been replaced by a new algorithm which computes hermite splines.
In general the result should be closer to the data however the old implementation is still accessible through the legacyOverride option.
The approximation with local third-degree polynoms solves some existing issues. The problematic parameters curvePointFactor and fitPointDist are both gone
and I hope that the new nrSplinePoints needs less manual adjustment (basically only wiht zoom) and is easier to understand.
The old fit option has been replaced with monotonicFit, which if set, enforces the use of the Fritsch-Carlson method (anti wiggle no overshooting / undershooting).
## Hands on ##
how to use it:
____________________________________________________
var d1 = [[5,5],[7,3],[9,12]];
how to use it:
____________________________________________________
var d1 = [[5,5],[7,3],[9,12]]; var options = { series: { curvedLines: { active: true }}};
var options = { series: { curvedLines: { active: true }}}; $.plot($("#placeholder"), [{data: d1, lines: { show: true}, curvedLines: {apply: true}}], options);
//you might want to adjust curvePointFactor _____________________________________________________
$.plot($("#placeholder"), [{data = d1, lines: { show: true},
curvedLines: {apply: true}}], options);
_____________________________________________________ options:
_____________________________________________________
options: active: bool true => plugin can be used
_____________________________________________________ apply: bool true => series will be drawn as curved line
monotonicFit: bool true => uses monotone cubic interpolation (preserve monotonicity)
tension: int defines the tension parameter of the hermite spline interpolation (no effect if monotonicFit is set)
nrSplinePoints: int defines the number of sample points (of the spline) in between two consecutive points
active: bool true => plugin can be used deprecated options from flot prior to 1.0.0:
apply: bool true => series will be drawn as curved line ------------------------------------------------
fit: bool true => forces the max,mins of the curve to legacyOverride bool true => use old default
be on the datapoints OR
curvePointFactor int defines how many "virtual" points are used per "real" data legacyOverride optionArray
point to emulate the curvedLines (points total = real {
points * curvePointFactor) fit: bool true => forces the max,mins of the curve to be on the datapoints
fitPointDist: int defines the x axis distance of the additional two points curvePointFactor int defines how many "virtual" points are used per "real" data point to
that are used to enforce the min max condition. emulate the curvedLines (points total = real points * curvePointFactor)
fitPointDist: int defines the x axis distance of the additional two points that are used
} to enforce the min max condition.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment