Permalink
Browse files

Fix precision in worldbank api

  • Loading branch information...
1 parent 660e197 commit 457c2884fc52e56f2985b31e2669451106ab2fd6 @rashidkpc rashidkpc committed Sep 2, 2016
Showing with 16 additions and 15 deletions.
  1. +13 −12 FUNCTIONS.md
  2. +1 −1 package.json
  3. +2 −2 server/series_functions/worldbank.js
View
@@ -75,13 +75,6 @@ Return the absolute value of each value in the series list
*This function does not accept any arguments.*
-#### .log()
-Return the base 10 logarithm value of each value in the series list
-
-Argument | Accepts | Description
---- | --- | ---
-base | *number* | Set logarithmic base, 10 by default
-
#### .bars()
Show the seriesList as bars
@@ -172,6 +165,13 @@ stack | *boolean* | Stack lines, often misleading. At least use some fill if you
show | *number/boolean* | Show or hide lines
steps | *number/boolean* | Show line as step, eg, do not interpolate between points
+#### .log()
+Return the logarithm value of each value in the series list (default base: 10)
+
+Argument | Accepts | Description
+--- | --- | ---
+base | *number* | Set logarithmic base, 10 by default
+
#### .max()
Maximum values of one or more series in a seriesList to each position, in each series, of the input seriesList
@@ -299,21 +299,21 @@ color | *string* | Color of axis label
Argument | Accepts | Description
--- | --- | ---
-alpha | *number* |
+alpha | *number* |
Smoothing weight from 0 to 1.
Increasing alpha will make the new series more closely follow the original.
Lowering it will make the series smoother
-beta | *number* |
+beta | *number* |
Trending weight from 0 to 1.
Increasing beta will make rising/falling lines continue to rise/fall longer.
Lowering it will make the function learn the new trend faster
-gamma | *number* |
+gamma | *number* |
Seasonal weight from 0 to 1. Does your data look like a wave?
Increasing this will give recent seasons more importance, thus changing the wave form faster.
Lowering it will reduce the importance of new seasons, making history more important.
-
+
season | *string* | How long is the season, eg, 1w if you pattern repeats weekly. (Only useful with gamma)
-sample | *number* |
+sample | *number* |
The number of seasons to sample before starting to "predict" in a seasonal series.
(Only useful with gamma, Default: all)
@@ -325,3 +325,4 @@ Argument | Accepts | Description
mode | *string* | The algorithm to use for generating the trend line. One of: linear, log
start | *number* | Where to start calculating from the beginning or end. For example -10 would start calculating 10 points from the end, +15 would start 15 points from the beginning. Default: 0
end | *number* | Where to stop calculating from the beginning or end. For example -10 would stop calculating 10 points from the end, +15 would stop 15 points from the beginning. Default: 0
+
View
@@ -1,6 +1,6 @@
{
"name": "timelion",
- "version": "0.1.403",
+ "version": "0.1.404",
"kibanas": [
"5.0.0-alpha4",
"5.0.0-alpha5",
@@ -51,7 +51,7 @@ module.exports = new Datasource ('worldbank', {
var data = _.compact(_.map(deduped, function (val, date) {
// Discard nulls
if (val == null) return;
- return [moment(date, 'YYYY').valueOf(), parseInt(val, 10)];
+ return [moment(date, 'YYYY').valueOf(), Number(val)];
}));
if (!hasData) throw new Error('Worldbank request succeeded, but there was no data for ' + config.code);
@@ -71,4 +71,4 @@ module.exports = new Datasource ('worldbank', {
throw e;
});
}
-});
+});

0 comments on commit 457c288

Please sign in to comment.