From 50f0cdcaaf3ea2a0e3d4837e861004f041ea8c8e Mon Sep 17 00:00:00 2001 From: Mael Thomas Date: Wed, 29 Jun 2016 18:18:28 +0200 Subject: [PATCH] Fusionner les variables et analyser leur tags --- containers/Explorer.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/containers/Explorer.js b/containers/Explorer.js index 69309ac38..f0dd7ad76 100644 --- a/containers/Explorer.js +++ b/containers/Explorer.js @@ -40,8 +40,24 @@ let }, [items[0]]) return [...variableList, ...list] - }, []) - console.log('groupedMergedVariables', groupedMergedVariables) + }, []), + + tagFrequency = + groupedMergedVariables + .reduce((stats, variable) => { + Object.keys(variable.tags).map( + k => { + stats[k] = stats[k] || {number: 0, choices: new Set()} + stats[k].number = stats[k].number + 1 + stats[k].choices.add(variable.tags[k]) + } + ) + return stats + } + , {}) + + + console.log('YOUYOU', tagFrequency)