@@ -29,6 +29,11 @@ export class Node {
2929 public maxWidth : number | undefined ;
3030 public nodeRadius : number | undefined ;
3131 // CodeSchemaAttributes - Not included
32+ // Visual Studio generated properties
33+ public boundsX : number | undefined ;
34+ public boundsY : number | undefined ;
35+ public boundsWidth : number | undefined ;
36+ public boundsHeight : number | undefined ;
3237
3338 private categoryRef : ICategory | undefined ;
3439 public setCategoryRef ( categoryRef : ICategory | undefined ) {
@@ -39,7 +44,11 @@ export class Node {
3944 const jsStringProperties : string [ ] = [ ] ;
4045 if ( this . id !== undefined ) { jsStringProperties . push ( `id: "${ this . id } "` ) ; }
4146 const label = this . convertNewlines ( this . label ) ;
42- if ( this . label !== undefined ) { jsStringProperties . push ( `label: "${ label } "` ) ; }
47+ if ( this . label !== undefined ) {
48+ jsStringProperties . push ( `label: "${ label } "` ) ;
49+ } else {
50+ jsStringProperties . push ( `label: "${ this . id } "` ) ;
51+ }
4352 const description = this . convertNewlines ( this . description ) ;
4453 if ( this . description !== undefined ) { jsStringProperties . push ( `title: "${ description } "` ) ; }
4554 if ( this . strokeThickness !== undefined ) { jsStringProperties . push ( `borderWidth: "${ this . strokeThickness } "` ) ; }
@@ -49,11 +58,12 @@ export class Node {
4958 if ( this . categoryRef !== undefined && this . background === undefined && this . categoryRef . background !== undefined ) { jsStringColorProperties . push ( `background: "${ this . categoryRef . background } "` ) ; }
5059 if ( this . categoryRef !== undefined && this . stroke === undefined && this . categoryRef . stroke !== undefined ) { jsStringColorProperties . push ( `border: "${ this . categoryRef . stroke } "` ) ; }
5160 if ( jsStringColorProperties . length > 0 ) { jsStringProperties . push ( `color: { ${ jsStringColorProperties . join ( ', ' ) } }` ) ; }
61+ if ( this . boundsX !== undefined && this . boundsY !== undefined ) { jsStringProperties . push ( `x: ${ this . boundsX } , y: ${ this . boundsY } , fixed: { x: true, y: true}` ) ; }
5262 return `{${ jsStringProperties . join ( ', ' ) } }` ;
5363 }
5464
5565 private convertNewlines ( text : string | undefined ) : string {
56- if ( text === undefined ) {
66+ if ( text === undefined || text . length === 0 ) {
5767 return '' ;
5868 }
5969 text = text . replace ( '
' , '\\n' ) ;
0 commit comments