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 {
116116 }
117117
118118 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+ }
126128 }
127129 return direction ;
128- }
130+ }
129131
130132 private getDirectedGraphLayoutJs ( directedGraph : IDirectedGraph ) : string {
131- if ( directedGraph . graphDirection !== undefined ) {
133+ if ( directedGraph . graphDirection !== undefined ) {
132134 let direction : string = this . convertGraphDirectionToVisLayoutValues ( directedGraph ) ;
133135 return `hierarchical: {enabled: true, direction: '${ direction } ', sortMethod: 'hubsize' }` ;
134136 }
You can’t perform that action at this time.
0 commit comments