As for the question of getting rid of this kind of jquery DOM access, take a look at http://docs.angularjs.org/guide/directive, section "Creating a Directive that Manipulates the DOM". It seems we should probably make our graph and frame directives return a `link` function, which receives the widget's main DOM element as an argument. From that element, it should be possible to derive the needed dimensions too? See my `graphChart` directive, which already uses a `link` function: https://github.com/prometheus/promdash/blob/master/app/assets/javascripts/angular/directives/graph_chart.js