Last active
January 19, 2018 15:03
-
-
Save 0000marcell/d0d16b0b9e13fa847effb9012228de92 to your computer and use it in GitHub Desktop.
New Twiddle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
data: [55, 44, 30, 23, 17, 14, 16, 25, 41, 61, 85, | |
101, 95, 105, 114, 150, 180, 210, 125, 100, 71, | |
75, 72, 67], | |
barWidth: 20, | |
barPadding: 3, | |
graphWidth: Ember.computed('data', 'barWidth', | |
'barPadding', () => { | |
let data = this.get('data'), | |
barWidth = this.get('barWidth'), | |
barPadding = this.get('barPaading'); | |
return data.length * (barWidth + barPadding) - barPadding; | |
}), | |
margin: { | |
top: 10, | |
right: 10, | |
bottom: 10, | |
left: 50 | |
}, | |
totalWidth: Ember.computed('graphWidth', 'margin', () => { | |
let graphWidth = this.get('graphWidth'), | |
margin = this.get('margin'); | |
return graphWidth + margin.left + margin.right; | |
}), | |
totalHeight: Ember.computed('maxValue', 'margin', () => { | |
let maxValue = this.get('maxValue'), | |
margin = this.get('margin'); | |
return maxValue + margin.top + margin.bottom; | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.13.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.16.2", | |
"ember-template-compiler": "2.16.2", | |
"ember-testing": "2.16.2" | |
}, | |
"addons": { | |
"ember-data": "2.16.3", | |
"ember-d3-helpers": "0.5.16", | |
"ember-composable-helpers": "2.1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment