File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -116,19 +116,21 @@ export class DgmlViewer {
116
116
}
117
117
118
118
private convertGraphDirectionToVisLayoutValues ( directedGraph : IDirectedGraph ) : string {
119
- let direction : string = 'LR' ;
120
- switch ( directedGraph . graphDirection . toLowerCase ( ) ) {
121
- case 'lefttoright' : direction = 'LR' ; break ;
122
- case 'righttoleft' : direction = 'RL' ; break ;
123
- case 'toptobottom' : direction = 'UD' ; break ;
124
- case 'bottomtotop' : direction = 'DU' ; break ;
125
- default : direction = 'LR' ; break ;
119
+ let direction : string = '' ;
120
+ if ( directedGraph . graphDirection !== undefined ) {
121
+ switch ( directedGraph . graphDirection . toLowerCase ( ) ) {
122
+ case 'lefttoright' : direction = 'LR' ; break ;
123
+ case 'righttoleft' : direction = 'RL' ; break ;
124
+ case 'toptobottom' : direction = 'UD' ; break ;
125
+ case 'bottomtotop' : direction = 'DU' ; break ;
126
+ default : direction = 'LR' ; break ;
127
+ }
126
128
}
127
129
return direction ;
128
- }
130
+ }
129
131
130
132
private getDirectedGraphLayoutJs ( directedGraph : IDirectedGraph ) : string {
131
- if ( directedGraph . graphDirection !== undefined ) {
133
+ if ( directedGraph . graphDirection !== undefined ) {
132
134
let direction : string = this . convertGraphDirectionToVisLayoutValues ( directedGraph ) ;
133
135
return `hierarchical: {enabled: true, direction: '${ direction } ', sortMethod: 'hubsize' }` ;
134
136
}
You can’t perform that action at this time.
0 commit comments