Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import Ember from 'ember';
  2. import HasChartParent from '../has-chart-parent';
  3.  
  4. const {
  5. Component,
  6. computed
  7. } = Ember;
  8.  
  9. export default Component.extend(HasChartParent, {
  10. tagName: 'g',
  11. classNames: ['graph-content'],
  12. attributeBindings: ['transform', 'clip-path'],
  13.  
  14. 'clip-path': computed('graph.contentClipPathId', function() {
  15. var clipPathId = this.get('graph.contentClipPathId');
  16. return `url('#${clipPathId}')`;
  17. }),
  18.  
  19. transform: computed('x', 'y', function() {
  20. var x = this.get('x');
  21. var y = this.get('y');
  22. return `translate(${x} ${y})`;
  23. }),
  24.  
  25. x: computed.alias('graph.graphX'),
  26. y: computed.alias('graph.graphY'),
  27.  
  28. width: computed.alias('graph.graphWidth'),
  29. height: computed.alias('graph.graphHeight'),
  30.  
  31. init() {
  32. this._super(...arguments);
  33. this.set('graph.content', this);
  34. },
  35. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement