API Docs for:
Show:

File: addon/mixins/graph-has-graph-parent.js

  1. import Ember from 'ember';
  2.  
  3. /**
  4. Adds initialization code to graph the `nf-graph` parent
  5. to a component that is to be contained in an `nf-graph`.
  6.  
  7. @namespace mixins
  8. @class graph-has-graph-parent
  9. */
  10. export default Ember.Mixin.create({
  11. /**
  12. The parent graph for a component.
  13. @property graph
  14. @type components.nf-graph
  15. @default null
  16. */
  17. graph: null,
  18.  
  19. /**
  20. Initalization method that gets the `nf-graph` parent
  21. and assigns it to `graph`
  22. NOTE: all object that mixin and have init, must call super.init()
  23. @method init
  24. */
  25.  
  26. init() {
  27. this._super(...arguments);
  28. var graph = this.nearestWithProperty('isGraph');
  29. this.set('graph', graph);
  30. }
  31. });