@@ -13,6 +13,7 @@ import { GroupingOptionTypes } from '../../../visuall/user-preference';
13
13
import { GroupCustomizationService } from 'src/app/custom/group-customization.service' ;
14
14
import { GENERIC_TYPE , LONG_MAX , LONG_MIN } from 'src/app/visuall/constants' ;
15
15
import { TimebarGraphInclusionTypes } from 'src/app/visuall/user-preference' ;
16
+ import { TheoreticPropertiesCustomService } from 'src/app/custom/theoretic-properties-custom.service'
16
17
export interface DeveloperData {
17
18
name : string ;
18
19
score : number ;
@@ -57,7 +58,7 @@ export class Query4Component implements OnInit {
57
58
currNodeSize = this . NODE_SIZE ;
58
59
algorithm = null ;
59
60
60
- constructor ( private http : HttpClient , private _dbService : Neo4jDb , private _cyService : CytoscapeService , private _g : GlobalVariableService , private _group : GroupCustomizationService ) {
61
+ constructor ( private http : HttpClient , private _dbService : Neo4jDb , private _cyService : CytoscapeService , private _g : GlobalVariableService , private _group : GroupCustomizationService , private _gt : TheoreticPropertiesCustomService ) {
61
62
this . files = [ ] ;
62
63
this . developers = [ ] ;
63
64
this . scores = [ ] ;
@@ -143,7 +144,7 @@ export class Query4Component implements OnInit {
143
144
const f2 = this . dateFilterFromUserPref ( 'b' , true ) ;
144
145
let f = '' ;
145
146
if ( f1 . length > 0 ) {
146
- f += ' WHERE ' + f1 . substr ( 5 ) ;
147
+ f += ' AND ' + f1 . substr ( 5 ) ;
147
148
}
148
149
if ( f2 . length > 0 ) {
149
150
f += f2 ;
@@ -154,10 +155,10 @@ export class Query4Component implements OnInit {
154
155
}
155
156
const r = `[${ skip } ..${ skip + dataCnt } ]` ;
156
157
157
- const cql = `MATCH path=(b:File {name : '${ this . file } '})-[r*0..3]-(a:Developer) ${ f }
158
- WHERE NONE(rel in relationships(path) WHERE type(rel) = 'COMMENTED')
158
+ const cql = `MATCH path=(b:File {name : '${ this . file } '})-[r*0..3]-(a:Developer)
159
+ WHERE NONE(rel in relationships(path) WHERE type(rel) = 'COMMENTED') ${ f }
159
160
WITH reduce(prod = 1, edge IN relationships(path) | prod * edge.recency) AS multipliedRecency, a,r,b
160
- WITH DISTINCT ID(a) As id, a.name AS name,round(toFloat(SUM(multipliedRecency / size(r)^2 )) * 100) / 100 AS score
161
+ WITH DISTINCT ID(a) As id, a.name AS name,round(toFloat(SUM(multipliedRecency / size(r))) * 100) / 100 AS score
161
162
RETURN id, name, score ORDER BY ${ orderExpr } LIMIT ${ this . number } ` ;
162
163
this . _dbService . runQuery ( cql , cb , DbResponseType . table ) ;
163
164
@@ -191,6 +192,7 @@ export class Query4Component implements OnInit {
191
192
this . graphResponse = x ;
192
193
}
193
194
this . clusterByDeveloper ( ) ;
195
+ this . devSize ( ) ;
194
196
} ;
195
197
196
198
@@ -376,6 +378,24 @@ export class Query4Component implements OnInit {
376
378
377
379
}
378
380
devSize ( ) {
381
+ if ( this . size ) {
382
+ let elements = this . _g . cy . nodes ( this . developers . map ( x => '#n' + x ) . join ( ) ) ;
383
+ let devs = elements . filter ( ( element ) => element . _private . classes . values ( ) . next ( ) . value == 'Developer' ) ;
384
+ this . _gt . knowAboutScore ( devs , this . scores )
385
+ this . _gt . showHideBadges ( true )
386
+ }
387
+ else {
388
+ for ( let i = 0 ; i < this . developers . length - 1 ; i ++ ) {
389
+ let element = this . _g . cy . nodes ( '#n' + this . developers [ i ] ) [ 0 ] ;
390
+ if ( element . _private . classes . values ( ) . next ( ) . value == 'Developer' ) {
391
+ element . removeClass ( 'graphTheoreticDisplay' )
392
+ }
393
+
394
+ }
395
+ this . _gt . showHideBadges ( false )
396
+
397
+ }
398
+ /*
379
399
if (this.size) {
380
400
for (let i = 0; i < this.developers.length - 1; i++) {
381
401
let element = this._g.cy.nodes('#n' + this.developers[i])[0]
@@ -436,7 +456,7 @@ export class Query4Component implements OnInit {
436
456
}
437
457
438
458
}
439
-
459
+ */
440
460
}
441
461
442
462
private dateFilterFromUserPref ( varName : string , isNode : boolean ) : string {
0 commit comments