                 if not @json_repartition[key]? or @json_repartition[key] != json[key]
                     need_update = true
                     break
- 
-            if need_update or force_render is true or @.$('.data-repartition-diagram').children().length is 1
-                @json_repartition = json
+
+            if need_update or force_render is true or @.$('.data_repartition-diagram').children().length is 1
+
                 @.$('.data_repartition-container').html @data_repartition_template @json_repartition
+
+                if $('.data_repartition-diagram').length>0 #We need the dom tree to be fully available for d3
+                    #TODO Replace this hack with a proper callback/listener
+                    @.$('.loading_text-diagram').css 'display', 'none'
+                    @json_repartition = json
+                else
+                    setTimeout(@render_data_repartition, 1000)
+
 
                 # Draw histogram
                 if json.max_keys? and not _.isNaN json.max_keys and shards.length isnt 0
-
-                    @.$('.loading_text-diagram').css 'display', 'none'
                     
                     if json.numerous_shards? and json.numerous_shards
                         svg_width = 700

        rebalance_shards: (event) =>
            event.preventDefault()
            confirmation_modal = new UIComponents.ConfirmationDialogModal
            confirmation_modal.render("Are you sure you want to rebalance the shards for the namespace "+@model.get('name')+"? This operation might take some time",
                "",
                {},
                undefined)

                        .attr('width', width)
                        .attr( 'height', (d) -> return y(d.num_keys))
                        .attr( 'title', (d) -> return 'Shard:'+d.boundaries+'<br />'+d.num_keys+' keys')
                

                    arrow_width = 4
                    arrow_length = 7
