Skip to content

Commit

Permalink
Fix min/max breaking the viz.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Charlot committed Oct 30, 2018
1 parent 000968a commit f591e83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "datasweet_formula",
"version": "1.1.2",
"version": "1.1.3",
"description": "This Kibana plugin allows calculated metrics on any standard kibana visualizations.",
"main": "index.js",
"kibana": {
Expand Down
5 changes: 3 additions & 2 deletions public/decorators/lib/apply_formula_total.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ export function TableTotalFormulaProvider(Private) {
const sum = tableRows => tableRows.reduce((prev, curr) => {
// some metrics return undefined for some of the values
// derivative is an example of this as it returns undefined in the first row
if (curr[i].value === undefined) return prev;
return prev + curr[i].value;
const v = get(curr[i], 'value');
if (v === undefined) return prev;
return prev + v;
}, 0);

arr[i] = {
Expand Down

0 comments on commit f591e83

Please sign in to comment.