Skip to content

Instantly share code, notes, and snippets.

@codepreneur
Forked from mrosenberg/gist:11403130
Last active August 29, 2015 14:08
Show Gist options
  • Save codepreneur/78acb94f656d58c3dc67 to your computer and use it in GitHub Desktop.
Save codepreneur/78acb94f656d58c3dc67 to your computer and use it in GitHub Desktop.
App.Chart = Ember.View.extend({
tagName: 'svg',
reScale: function() {
d3.selectAll( this.svg[0][0].childNodes ).remove();
Ember.run.scheduleOnce( 'afterRender', this, 'build' );
},
didInsertElement: function() {
var that = this;
$( window ).on( 'resize', function() {
Ember.run.debounce( that, that.reScale, 1000 );
});
Ember.run.scheduleOnce( 'afterRender', this, 'build' );
},
build: function() {
// D3 magic
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment