Commit cdaa8541 authored by Michael's avatar Michael

Update README.md

improved readme
parent 868d9427
...@@ -11,8 +11,8 @@ Regards Michael ...@@ -11,8 +11,8 @@ Regards Michael
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. 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. 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 The approximation with local third-degree polynoms solves some existing issues. The problematic parameters curvePointFactor and fitPointDist are not longer needed
and I hope that the new nrSplinePoints needs less manual adjustment (basically only wiht zoom) and is easier to understand. and I hope that the new nrSplinePoints parameter needs less manual adjustment (basically only if you use zooming or large segments) 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). 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).
...@@ -21,13 +21,11 @@ The old fit option has been replaced with monotonicFit, which if set, enforces t ...@@ -21,13 +21,11 @@ The old fit option has been replaced with monotonicFit, which if set, enforces t
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
how to use it: how to use it:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
```
var d1 = [[5,5],[7,3],[9,12]]; 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); $.plot($("#placeholder"), [{data: d1, lines: { show: true}, curvedLines: {apply: true}}], options);
```
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
options: options:
...@@ -38,22 +36,32 @@ The old fit option has been replaced with monotonicFit, which if set, enforces t ...@@ -38,22 +36,32 @@ The old fit option has been replaced with monotonicFit, which if set, enforces t
| active | bool | true => plugin can be used | | active | bool | true => plugin can be used |
| apply | bool | true => series will be drawn as curved line | | apply | bool | true => series will be drawn as curved line |
| monotonicFit | bool | true => uses monotone cubic interpolation (preserve monotonicity) | | monotonicFit | bool | true => uses monotone cubic interpolation (preserve monotonicity) |
| tension | int | defines the tension parameter of the hermite spline interpolation (only if monotonicFit = false) | | tension | double | [0,1] defines the tension parameter of the hermite spline interpolation (only if monotonicFit = false) |
| nrSplinePoints | int | defines the number of sample points (of the spline) in between two consecutive points | | nrSplinePoints | int | defines the number of sample points (of the spline) in between two consecutive points |
deprecated options from curvedLines prior to 1.0.0: deprecated options from curvedLines prior to 1.0.0:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
to use the old curve computation algorithm with default parameters simply set legacyOverride to true
| parameter | type | effect | | parameter | type | effect |
|----------------|------|---------------------------------------------------------------------------------------------------------------------------------------------| |----------------|------|---------------------------------------------------------------------------------------------------------------------------------------------|
| legacyOverride | bool | true => use old default | | legacyOverride | bool | true => use old default |
or to get more control set a parameter object with the old parameters as members
or to get more control set the legacyOverride parameter as option array with:
| parameter | type | effect | | parameter | type | effect |
|----------------|------|---------------------------------------------------------------------------------------------------------------------------------------------| |----------------|------|---------------------------------------------------------------------------------------------------------------------------------------------|
| fit | bool | true => forces the max,mins of the curve to be on the datapoints | | fit | bool | true => forces the max,mins of the curve to be on the datapoints |
| curvePointFactor | int | defines how many "virtual" points are used per "real" data point to emulate the curvedLines (points total = real points * curvePointFactor) | | curvePointFactor | int | defines how many "virtual" points are used per "real" data point to 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. | | fitPointDist | int | defines the x axis distance of the additional two points that are used to enforce the min max condition. |
```
... lines: { show: true},
curvedLines: {
apply: true,
legacyOverride: {
fit: true
}
} ...
```
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