File tree Expand file tree Collapse file tree 3 files changed +34
-14
lines changed
js/apps/system/_admin/aardvark/APP/frontend/js/views Expand file tree Collapse file tree 3 files changed +34
-14
lines changed Original file line number Diff line number Diff line change 1
1
devel
2
2
-----
3
3
4
+
5
+ * fixes some graph data parsing issues in the ui, e.g. cleaning up duplicate
6
+ edges inside the graph viewer.
7
+
4
8
* in a cluster environment, the arangod process now exits if wrong credentials
5
9
are used during the startup process
6
10
Original file line number Diff line number Diff line change 149
149
self . renderGraph ( data ) ;
150
150
} ,
151
151
error : function ( e ) {
152
- console . log ( e ) ;
153
152
arangoHelper . arangoError ( 'Graph' , 'Could not load full graph.' ) ;
154
153
}
155
154
} ) ;
534
533
*/
535
534
} ) ;
536
535
} else if ( type === 'array' ) {
536
+ var edgeObj = { } ;
537
+
537
538
_ . each ( data , function ( edge ) {
538
- vertices [ edge . _from ] = null ;
539
- vertices [ edge . _to ] = null ;
540
-
541
- returnObj . edges . push ( {
542
- id : edge . _id ,
543
- source : edge . _from ,
544
- // label: edge._key,
545
- color : '#cccccc' ,
546
- target : edge . _to
547
- } ) ;
539
+ if ( edge ) {
540
+ vertices [ edge . _from ] = null ;
541
+ vertices [ edge . _to ] = null ;
542
+
543
+ if ( edge . _id ) {
544
+ edgeObj [ edge . _id ] = {
545
+ id : edge . _id ,
546
+ source : edge . _from ,
547
+ color : '#cccccc' ,
548
+ target : edge . _to
549
+ } ;
550
+ }
551
+ }
548
552
} ) ;
549
553
550
554
_ . each ( vertices , function ( val , key ) {
557
561
y : Math . random ( )
558
562
} ) ;
559
563
} ) ;
564
+ _ . each ( edgeObj , function ( edge ) {
565
+ returnObj . edges . push ( edge ) ;
566
+ } ) ;
560
567
}
561
568
562
569
return returnObj ;
Original file line number Diff line number Diff line change 2495
2495
2496
2496
// check if result could be displayed as graph
2497
2497
// case a) result has keys named vertices and edges
2498
- if ( result [ 0 ] ) {
2499
- if ( result [ 0 ] . vertices && result [ 0 ] . edges ) {
2498
+
2499
+ var index = 0 ;
2500
+ for ( var i = 0 ; i < result . length ; i ++ ) {
2501
+ if ( result [ i ] ) {
2502
+ index = i ;
2503
+ break ;
2504
+ }
2505
+ }
2506
+
2507
+ if ( result [ index ] ) {
2508
+ if ( result [ index ] . vertices && result [ index ] . edges ) {
2500
2509
var hitsa = 0 ;
2501
2510
var totala = 0 ;
2502
2511
2739
2748
var headers = { } ; // quick lookup cache
2740
2749
var pos = 0 ;
2741
2750
_ . each ( data . original , function ( obj ) {
2742
- if ( first === true ) {
2751
+ if ( first === true && obj ) {
2743
2752
tableDescription . titles = Object . keys ( obj ) ;
2744
2753
tableDescription . titles . forEach ( function ( t ) {
2745
2754
headers [ String ( t ) ] = pos ++ ;
You can’t perform that action at this time.
0 commit comments