# HG changeset patch # User Chloe Laisne # Date 1475413057 -7200 # Node ID b1f9bcfda379a76e904c6b9892762894d0fa7be9 # Parent 2fef8007c2b24fa07ffef8dbb8a244801ddd8d8f Change discourse layout to spread bubbles accross 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 }; } }); diff -r 2fef8007c2b2 -r b1f9bcfda379 cms/app-client/app/styles/components/discourses-component.scss --- a/cms/app-client/app/styles/components/discourses-component.scss Tue Sep 27 01:50:53 2016 +0200 +++ b/cms/app-client/app/styles/components/discourses-component.scss Sun Oct 02 14:57:37 2016 +0200 @@ -1,5 +1,7 @@ .discourses-component { position: relative; + width: inherit; + height: inherit; } .discourses-component .item {