From 1f06a12fe4e980f5894cbdd874b855eeb1b0c1c1 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Fri, 24 Nov 2017 16:28:55 +0100 Subject: [PATCH] drop superfluous details --- public/ts/components/bucket.ts | 38 +++++++--------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/public/ts/components/bucket.ts b/public/ts/components/bucket.ts index 46249d9..e582b9c 100644 --- a/public/ts/components/bucket.ts +++ b/public/ts/components/bucket.ts @@ -72,27 +72,6 @@ ${response.data.values.map(function(transaction) { return format_transaction(tra ctrl.raw_data = _(response.data) .sortBy((account) => { return account.amount; }) .reverse(); - ctrl.raw_total = _(response.data).reduce((memo, account) => { return memo + account.amount; }, 0); - - ctrl.total_detailed = _.chain(ctrl.raw_data) - .groupBy((account) => { - return account.account.split(':')[0]; - }) - .each((category) => { - category.total = _(category).reduce((memo, account) => { - return memo + account.amount; - }, 0); - }) - .value(); - ctrl.total_detailed = _.chain(ctrl.total_detailed) - .keys() - .map((key) => { - return { - account: key, - amount: ctrl.total_detailed[key].total - }; - }) - .value(); ctrl.graph_options.chart.height = 60 + (25 * ctrl.raw_data.length); @@ -109,17 +88,14 @@ ${response.data.values.map(function(transaction) { return format_transaction(tra ], template: ` -
-
- {{account.account}} = {{account.amount | number:2}} € -
-
-
- - -
+
+
+
+ +
+
` });