@@ -10,15 +10,15 @@ function generate_cy_stylesheet(cy) {
1010 {
1111 selector : 'node' ,
1212 style : {
13- label : " data(id)" ,
14- shape : " round-rectangle" ,
15- " background-color" : html_style . getPropertyValue ( '--vscode-button-background' ) ,
16- " background-width" : " 90%" ,
17- " background-height" : " 90%" ,
18- width : " 228" ,
19- height : " 128" ,
20- " border-width" : "0" ,
21- }
13+ label : ' data(id)' ,
14+ shape : ' round-rectangle' ,
15+ ' background-color' : html_style . getPropertyValue ( '--vscode-button-background' ) ,
16+ ' background-width' : ' 90%' ,
17+ ' background-height' : ' 90%' ,
18+ width : ' 228' ,
19+ height : ' 128' ,
20+ ' border-width' : '0' ,
21+ } ,
2222 } ,
2323 {
2424 selector : 'label' ,
@@ -27,8 +27,8 @@ function generate_cy_stylesheet(cy) {
2727 'font-family' : '"Segoe UI", Arial, Helvetica, sans-serif' ,
2828 'font-size' : '28vh' ,
2929 'text-valign' : 'center' ,
30- 'text-halign' : 'center'
31- }
30+ 'text-halign' : 'center' ,
31+ } ,
3232 } ,
3333 {
3434 selector : ':selected' ,
@@ -38,18 +38,18 @@ function generate_cy_stylesheet(cy) {
3838 'background-color' : html_style . getPropertyValue ( '--vscode-button-hoverBackground' ) ,
3939 'line-color' : html_style . getPropertyValue ( '--vscode-minimap-errorHighlight' ) ,
4040 'target-arrow-color' : html_style . getPropertyValue ( '--vscode-minimap-errorHighlight' ) ,
41- 'source-arrow-color' : html_style . getPropertyValue ( '--vscode-minimap-errorHighlight' )
42- }
41+ 'source-arrow-color' : html_style . getPropertyValue ( '--vscode-minimap-errorHighlight' ) ,
42+ } ,
4343 } ,
4444 {
4545 selector : 'edge' ,
4646 style : {
4747 'target-arrow-shape' : 'triangle' ,
4848 'curve-style' : 'bezier' ,
4949 'control-point-step-size' : 40 ,
50- width : 10
51- }
52- }
50+ width : 10 ,
51+ } ,
52+ } ,
5353 ] )
5454 . update ( ) ; // indicate the end of your new stylesheet so that it can be updated on elements
5555}
@@ -62,42 +62,42 @@ function init() {
6262 wheelSensitivity : 0.15 ,
6363 maxZoom : 5 ,
6464 minZoom : 0.2 ,
65- selectionType : 'single'
65+ selectionType : 'single' ,
6666 } ) ;
6767
6868 generate_cy_stylesheet ( cy ) ;
6969
7070 vscode . postMessage ( { command : 'initialized' } ) ;
7171}
7272
73- window . addEventListener ( 'message' , event => {
73+ window . addEventListener ( 'message' , ( event ) => {
7474 const message = event . data ;
75- if ( message . redraw == true ) {
75+ if ( message . redraw == true ) {
7676 cy . remove ( '*' ) ;
7777 }
7878
7979 nodeGraph = message . content ;
8080
81- try {
82- nodeGraph . vertices . forEach ( element => {
81+ try {
82+ nodeGraph . vertices . forEach ( ( element ) => {
8383 cy . add ( {
84- data : { id : element . label }
84+ data : { id : element . label } ,
8585 } ) ;
8686 } ) ;
8787
88- nodeGraph . edges . forEach ( element => {
88+ nodeGraph . edges . forEach ( ( element ) => {
8989 cy . add ( {
9090 data : {
9191 id : element . source + element . target ,
9292 source : element . source ,
93- target : element . target
94- }
93+ target : element . target ,
94+ } ,
9595 } ) ;
9696 } ) ;
9797 } catch ( error ) {
9898 vscode . postMessage ( {
9999 command : 'error' ,
100- errorMsg : `Error building node graph from json graph data: ${ error } `
100+ errorMsg : `Error building node graph from json graph data: ${ error } ` ,
101101 } ) ;
102102 }
103103
@@ -107,6 +107,6 @@ window.addEventListener('message', event => {
107107 circle : false ,
108108 nodeDimensionsIncludeLabels : true ,
109109 spacingFactor : 1.5 ,
110- animate : true
110+ animate : true ,
111111 } ) . run ( ) ;
112112} ) ;
0 commit comments