Skip to content

Instantly share code, notes, and snippets.

@AmilKey
Last active September 6, 2015 09:30
Show Gist options
  • Select an option

  • Save AmilKey/9a965d656a3a5959440a to your computer and use it in GitHub Desktop.

Select an option

Save AmilKey/9a965d656a3a5959440a to your computer and use it in GitHub Desktop.
// from https://www.youtube.com/watch?v=vvZEddrClAQ&feature=youtu.be
export default Ember.Component.extend({
draw(){
if (this._state !== 'inDOM') return;
let data = this.get('data');
// do d3 stuff
},
updateD3: on('didInsertElement', observer('data', function() {
Ember.run.scheduleOnce('render', this, this.draw);
}))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment