@@ -31,7 +31,7 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
31
31
var margin = parseInt ( attrs . margin ) || 20 ;
32
32
var height = parseInt ( attrs . height ) || $window . innerHeight ;
33
33
34
- var colorRange = [ d3 . rgb ( " #3366CC" ) , d3 . rgb ( '#EE2867' ) ] ;
34
+ var colorRange = [ d3 . rgb ( ' #3366CC' ) , d3 . rgb ( '#EE2867' ) ] ;
35
35
36
36
var defaultRadius = 20 ;
37
37
@@ -41,7 +41,7 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
41
41
. append ( 'svg' )
42
42
. style ( 'width' , '100%' ) ;
43
43
44
- var root = svg . append ( "g" ) ;
44
+ var root = svg . append ( 'g' ) ;
45
45
46
46
var lastUpdate = null ;
47
47
@@ -77,7 +77,7 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
77
77
'prefixes' : Prefixes . getPrefixes ( ) ,
78
78
'showTypes' : Filters . getIncludeLiterals ( ) ,
79
79
'showLoops' : Filters . getIncludeLoops ( ) ,
80
- " showDisjointNode" : Filters . getIncludeDisjointNode ( )
80
+ ' showDisjointNode' : Filters . getIncludeDisjointNode ( )
81
81
} ;
82
82
83
83
scope . $watch ( function ( ) {
@@ -87,7 +87,7 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
87
87
} ) ;
88
88
89
89
scope . $watch ( 'data.nodes.size' , function ( ) {
90
- $log . debug ( " [Graph] Number of nodes has changed!" ) ;
90
+ $log . debug ( ' [Graph] Number of nodes has changed!' ) ;
91
91
return scope . render ( scope . data ) ;
92
92
} ) ;
93
93
@@ -181,7 +181,7 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
181
181
182
182
scope . getMarkerEnd = function ( type , value ) {
183
183
var size = parseInt ( Math . min ( Math . log2 ( value + 2 ) , 5 ) ) ;
184
- return " url(#" + type + 'Arrow' + size + ")" ;
184
+ return ' url(#' + type + 'Arrow' + size + ')' ;
185
185
} ;
186
186
187
187
scope . calcRadius = function ( element ) {
@@ -279,33 +279,33 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
279
279
* @param linkContainer
280
280
*/
281
281
scope . createArrowHeads = function ( linkContainer ) {
282
- linkContainer . append ( " defs" ) . selectAll ( " marker" )
282
+ linkContainer . append ( ' defs' ) . selectAll ( ' marker' )
283
283
. data ( scope . getArrowHeads ( ) )
284
- . enter ( ) . append ( " marker" )
285
- . attr ( "id" , function ( d ) {
284
+ . enter ( ) . append ( ' marker' )
285
+ . attr ( 'id' , function ( d ) {
286
286
return d . id ;
287
287
} )
288
- . attr ( " class" , function ( d ) {
288
+ . attr ( ' class' , function ( d ) {
289
289
return d . class ;
290
290
} )
291
- . attr ( " viewBox" , function ( d ) {
292
- return " -1 " + ( ( d . size + 1 ) * ( - 1 ) ) + " " + ( ( d . size + 1 ) * 2 ) + " " + ( ( d . size + 1 ) * 2 ) ;
291
+ . attr ( ' viewBox' , function ( d ) {
292
+ return ' -1 ' + ( ( d . size + 1 ) * ( - 1 ) ) + ' ' + ( ( d . size + 1 ) * 2 ) + ' ' + ( ( d . size + 1 ) * 2 ) ;
293
293
} )
294
- . attr ( " refX" , function ( d ) {
294
+ . attr ( ' refX' , function ( d ) {
295
295
return d . size * 2 ;
296
296
} )
297
- . attr ( " refY" , 0 )
298
- . attr ( " markerWidth" , function ( d ) {
297
+ . attr ( ' refY' , 0 )
298
+ . attr ( ' markerWidth' , function ( d ) {
299
299
return d . size ;
300
300
} )
301
- . attr ( " markerHeight" , function ( d ) {
301
+ . attr ( ' markerHeight' , function ( d ) {
302
302
return d . size ;
303
303
} )
304
- . attr ( " orient" , " auto" )
305
- . style ( " stroke" , function ( d ) {
304
+ . attr ( ' orient' , ' auto' )
305
+ . style ( ' stroke' , function ( d ) {
306
306
return ( d . class === 'hovered' ) ? 'red' : scope . arrowColor ( d . size ) ;
307
307
} )
308
- . style ( " fill" , function ( d ) {
308
+ . style ( ' fill' , function ( d ) {
309
309
if ( d . class === 'hovered' ) {
310
310
return 'red' ;
311
311
} else if ( d . class === 'subclass' ) {
@@ -314,9 +314,9 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
314
314
return scope . arrowColor ( d . size ) ;
315
315
}
316
316
} )
317
- . append ( " path" )
318
- . attr ( "d" , function ( d ) {
319
- return " M0," + ( d . size * - 1 ) + "L" + ( d . size * 2 ) + " ,0L0," + d . size + "Z" ;
317
+ . append ( ' path' )
318
+ . attr ( 'd' , function ( d ) {
319
+ return ' M0,' + ( d . size * - 1 ) + 'L' + ( d . size * 2 ) + ' ,0L0,' + d . size + 'Z' ;
320
320
} ) ;
321
321
} ;
322
322
@@ -349,18 +349,18 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
349
349
scope . cardinalSpline = d3 . svg . line ( )
350
350
. x ( function ( d ) { return ( d !== undefined ) ? d . x : 0 ; } )
351
351
. y ( function ( d ) { return ( d !== undefined ) ? d . y : 0 ; } )
352
- . interpolate ( " cardinal" ) ;
352
+ . interpolate ( ' cardinal' ) ;
353
353
354
354
scope . loopSpline = d3 . svg . line ( )
355
355
. x ( function ( d ) { return d . x ; } )
356
356
. y ( function ( d ) { return d . y ; } )
357
- . interpolate ( " cardinal" )
357
+ . interpolate ( ' cardinal' )
358
358
. tension ( 0 ) ;
359
359
360
360
scope . linearLine = d3 . svg . line ( )
361
361
. x ( function ( d ) { return d . x ; } )
362
362
. y ( function ( d ) { return d . y ; } )
363
- . interpolate ( " linear" ) ;
363
+ . interpolate ( ' linear' ) ;
364
364
365
365
// draw a ring for equivalent classes
366
366
nodeContainer . selectAll ( '.equivalent' )
@@ -371,12 +371,12 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
371
371
nodeContainer . selectAll ( '.class' )
372
372
. append ( 'circle' )
373
373
. classed ( 'clazz' , true )
374
- . attr ( 'r' , function ( d ) { return d . radius + "px" ; } )
374
+ . attr ( 'r' , function ( d ) { return d . radius + 'px' ; } )
375
375
. on ( 'click' , scope . updateActive )
376
376
. on ( 'mouseover' , function ( ) {
377
377
d3 . select ( this ) . style ( 'fill' , 'red' ) ;
378
378
} )
379
- . on ( 'mouseout' , function ( d ) {
379
+ . on ( 'mouseout' , function ( ) {
380
380
d3 . select ( this ) . style ( 'fill' , '#acf' ) ;
381
381
} )
382
382
. append ( 'title' )
@@ -487,39 +487,39 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
487
487
488
488
scope . createArrowHeads ( linkContainer ) ;
489
489
490
- var links1 = scope . link = linkContainer . selectAll ( " g.link" )
490
+ var links1 = scope . link = linkContainer . selectAll ( ' g.link' )
491
491
. data ( bilinks ) ;
492
492
493
493
var linksG = links1 . enter ( )
494
- . append ( "g" )
495
- . attr ( " class" , " link" )
496
- . style ( " stroke" , function ( d ) { return scope . lineColor ( d . value ) ; } ) ;
494
+ . append ( 'g' )
495
+ . attr ( ' class' , ' link' )
496
+ . style ( ' stroke' , function ( d ) { return scope . lineColor ( d . value ) ; } ) ;
497
497
498
- scope . link = linksG . append ( " path" )
499
- . attr ( " class" , " link-line" )
498
+ scope . link = linksG . append ( ' path' )
499
+ . attr ( ' class' , ' link-line' )
500
500
. classed ( 'subClassProperty' , function ( d ) { return d . type === 'subClassProperty' ; } ) ;
501
501
502
502
links1 . exit ( ) . remove ( ) ;
503
503
504
504
linkContainer . selectAll ( '.link-line' )
505
- . attr ( " marker-end" , function ( d ) { return scope . getMarkerEnd ( '' , d . value ) ; } )
506
- . style ( " stroke-width" , function ( d ) {
505
+ . attr ( ' marker-end' , function ( d ) { return scope . getMarkerEnd ( '' , d . value ) ; } )
506
+ . style ( ' stroke-width' , function ( d ) {
507
507
return Math . min ( Math . log2 ( d . value + 2 ) , 5 ) ;
508
508
} )
509
509
. on ( 'mouseover' , function ( ) {
510
- d3 . select ( this ) . attr ( " stroke" , " red" ) ;
511
- d3 . select ( this ) . attr ( " marker-end" , function ( d ) { return scope . getMarkerEnd ( 'hovered' , d . value ) ; } ) ;
510
+ d3 . select ( this ) . attr ( ' stroke' , ' red' ) ;
511
+ d3 . select ( this ) . attr ( ' marker-end' , function ( d ) { return scope . getMarkerEnd ( 'hovered' , d . value ) ; } ) ;
512
512
} )
513
- . on ( " mouseout" , function ( ) {
514
- d3 . select ( this ) . attr ( " stroke" , function ( d ) { return scope . lineColor ( d . value ) ; } ) ;
515
- d3 . select ( this ) . attr ( " marker-end" , function ( d ) { return scope . getMarkerEnd ( '' , d . value ) ; } ) ;
513
+ . on ( ' mouseout' , function ( ) {
514
+ d3 . select ( this ) . attr ( ' stroke' , function ( d ) { return scope . lineColor ( d . value ) ; } ) ;
515
+ d3 . select ( this ) . attr ( ' marker-end' , function ( d ) { return scope . getMarkerEnd ( '' , d . value ) ; } ) ;
516
516
} ) ;
517
517
518
518
linkContainer . selectAll ( '.subClassProperty' )
519
- . attr ( " marker-end" , function ( d ) { return scope . getMarkerEnd ( 'subclass' , d . value ) ; } )
520
- . on ( " mouseout" , function ( ) {
521
- d3 . select ( this ) . attr ( " stroke" , function ( d ) { return scope . lineColor ( d . value ) ; } ) ;
522
- d3 . select ( this ) . attr ( " marker-end" , function ( d ) { return scope . getMarkerEnd ( 'subclass' , d . value ) ; } ) ;
519
+ . attr ( ' marker-end' , function ( d ) { return scope . getMarkerEnd ( 'subclass' , d . value ) ; } )
520
+ . on ( ' mouseout' , function ( ) {
521
+ d3 . select ( this ) . attr ( ' stroke' , function ( d ) { return scope . lineColor ( d . value ) ; } ) ;
522
+ d3 . select ( this ) . attr ( ' marker-end' , function ( d ) { return scope . getMarkerEnd ( 'subclass' , d . value ) ; } ) ;
523
523
} )
524
524
. style ( 'stroke-dasharray' , '5, 5' ) ;
525
525
} ;
@@ -530,14 +530,14 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
530
530
scope . directLink = linkContainer . selectAll ( '.direct-link' )
531
531
. data ( directLinks )
532
532
. enter ( )
533
- . append ( "g" )
533
+ . append ( 'g' )
534
534
. style ( 'stroke' , '#000' )
535
- . append ( " path" )
535
+ . append ( ' path' )
536
536
. style ( 'stroke-width' , 1 )
537
537
. classed ( 'disjointProperty' , function ( d ) { return d . type === 'disjointProperty' ; } ) ;
538
538
539
539
linkContainer . selectAll ( '.disjointProperty' )
540
- . attr ( " marker-end" , 'none' )
540
+ . attr ( ' marker-end' , 'none' )
541
541
. style ( 'stroke-dasharray' , '5, 5' ) ;
542
542
} ;
543
543
@@ -628,7 +628,7 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
628
628
var zoom = d3 . behavior . zoom ( )
629
629
. duration ( 150 )
630
630
. scaleExtent ( [ 0.1 , 2.0 ] )
631
- . on ( " zoom" , scope . redraw ) ;
631
+ . on ( ' zoom' , scope . redraw ) ;
632
632
svg . call ( zoom ) ;
633
633
634
634
scope . maxValue = 0 ;
@@ -773,7 +773,7 @@ function NodeLinkGraph($window, $log, Properties, Nodes, Prefixes, Filters, Geom
773
773
scope . force . on ( 'tick' , function ( ) {
774
774
scope . link . attr ( 'd' , scope . recalculateLines ) ;
775
775
scope . directLink . attr ( 'd' , scope . recalculateDirectLines ) ;
776
- scope . node . attr ( " transform" , function ( d ) { return " translate(" + d . x + "," + d . y + ")" ; } ) ;
776
+ scope . node . attr ( ' transform' , function ( d ) { return ' translate(' + d . x + ',' + d . y + ')' ; } ) ;
777
777
} ) ;
778
778
} ; // end of scope.render()
779
779
} // end of link()
0 commit comments