11import Ember from 'ember' ;
22
3- // Import the D3 packages we want to use
4- import { select , event } from 'd3-selection' ;
5- import { cluster , hierarchy } from 'd3-hierarchy' ;
6- import { zoom , zoomIdentity } from 'd3-zoom' ;
7-
8- const { run, get, inject } = Ember ;
3+ const {
4+ select,
5+ hierarchy,
6+ cluster,
7+ zoom,
8+ zoomIdentity
9+ } = self . d3 ;
10+
11+ const { inject } = Ember ;
12+ import { run } from '@ember/runloop' ;
13+ import { get } from '@ember/object' ;
14+ import Component from '@ember/component' ;
915
1016const DURATION = 500 ;
1117
1218// The offset amount (in px) from the left or right side of a node
1319// box to offset lines between nodes, so the lines don't come right
1420// up to the edge of the box.
15- const NODE_OFFSET_SIZE = 50 ;
21+ const NODE_OFFSET_SIZE = 50 ;
1622
1723// copied these functions temporarily from `broccoli-viz` here:
1824// https://github.com/ember-cli/broccoli-viz/blob/master/lib/node-by-id.js
1925
20- export default Ember . Component . extend ( {
26+ export default Component . extend ( {
2127 classNames : [ 'basic-tree' ] ,
2228
2329 graph : inject . service ( ) ,
@@ -120,7 +126,7 @@ export default Ember.Component.extend({
120126 // for debugging
121127 self . root = root ;
122128
123- // Create the graph. The nodeSize() is [8,280] (width, height) because we
129+ // Create the graph. The nodeSize() is [8,280] (width, height) because we
124130 // want to change the orientation of the graph from top-down to left-right.
125131 // To do that we reverse X and Y for calculations and translations.
126132 let graph = cluster ( )
@@ -177,7 +183,7 @@ export default Ember.Component.extend({
177183 . style ( 'fill' , "#fff" ) ;
178184
179185 // Draw a box in a separate color for the first line as
180- // a 'title'.
186+ // a 'title'.
181187 nodeEnter . append ( "rect" )
182188 . attr ( 'x' , 0 )
183189 . attr ( 'y' , '-2em' )
@@ -258,7 +264,7 @@ export default Ember.Component.extend({
258264 . attr ( "d" , function ( d ) {
259265 let sourceExitY = d . source . y + d . source . computedWidth + NODE_OFFSET_SIZE ;
260266 let targetEntranceY = d . target . y - NODE_OFFSET_SIZE ;
261-
267+
262268 return "M" + d . target . y + "," + d . target . x
263269 + "L" + targetEntranceY + "," + d . target . x
264270 + " " + sourceExitY + "," + d . target . x
@@ -272,7 +278,7 @@ export default Ember.Component.extend({
272278 . attr ( "d" , function ( d ) {
273279 let sourceExitY = d . source . y + d . source . computedWidth + NODE_OFFSET_SIZE ;
274280 let targetEntranceY = d . target . y - NODE_OFFSET_SIZE ;
275-
281+
276282 return "M" + d . target . y + "," + d . target . x
277283 + "L" + targetEntranceY + "," + d . target . x
278284 + " " + sourceExitY + "," + d . target . x
0 commit comments