diff -r 2fef8007c2b2 -r b1f9bcfda379 cms/app-client/app/components/discourses-component.js --- a/cms/app-client/app/components/discourses-component.js Tue Sep 27 01:50:53 2016 +0200 +++ b/cms/app-client/app/components/discourses-component.js Sun Oct 02 14:57:37 2016 +0200 @@ -38,7 +38,7 @@ .value(function(d){ return Math.floor((((d.value - oldMin) * (newMax - newMin)) / (oldMax - oldMin)) + newMin); }) - .padding(25); + .padding(10); var element = d3.select('#' + self.get('elementId')); @@ -75,18 +75,13 @@ createNodes: function(json) { var self = this; - var nodes = {}; - var children = {}; + var children = []; Object.keys(json).forEach(function(key) { var discourse = json[key]; var category_key = self.get('constants').DISCOURSE_CATEGORY_KEYS[key]; var category_value = self.get('constants').DISCOURSE_CATEGORY_VALUES[category_key]; - - children[category_key] = children[category_key] || {}; - children[category_key]['name'] = category_key; - children[category_key]['children'] = children[category_key]['children'] || []; - children[category_key]['children'].push({ + children.push({ 'id': key, 'name': discourse.label, 'value': discourse.count, @@ -95,12 +90,7 @@ }); }); - nodes.children = []; - Object.keys(children).forEach(function(key) { - nodes.children.push(children[key]); - }); - - return nodes; + return { 'children': children }; } });