From f6c9dc1b1c100194553ed594db0501d0c65c2a8c Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Tue, 29 Jan 2013 13:38:57 -0800 Subject: [PATCH] append svg element --- .../editor-stats/src/editor-stats-view.coffee | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/packages/editor-stats/src/editor-stats-view.coffee b/src/packages/editor-stats/src/editor-stats-view.coffee index 16c12bc6f..a35de475e 100644 --- a/src/packages/editor-stats/src/editor-stats-view.coffee +++ b/src/packages/editor-stats/src/editor-stats-view.coffee @@ -39,6 +39,17 @@ class EditorStatsView extends ScrollView @rootView.on 'keyup', @track @rootView.on 'mousedown', @track + append: -> + w = @.width() + h = @.height() + [pt, pl, pb, pr] = [0,0,0,0] + + d3.select(@.get(0)).append('svg') + .attr('width', w) + .attr('height', h) + .append('g') + .attr('transform', "translate(#{pl},#{pt})") + track: => date = new Date times = time date @@ -57,6 +68,7 @@ class EditorStatsView extends ScrollView attach: -> @rootView.append @ @focus() + @append() detach: => super()