File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change 249
249
}
250
250
251
251
function saveAsDgml ( ) {
252
- const nodeExport = { } ;
253
- nodes . forEach ( node => {
254
- nodeExport [ node . id ] = {
255
- id : node . id ,
256
- label : cleanLabel ( node . label ) ,
257
- position : network . getPosition ( node . id ) ,
258
- boundingBox : network . getBoundingBox ( node . id )
259
- } ;
260
- } ) ;
261
- const direction = hierarchicalOptionsDirectionSelect . value ? hierarchicalOptionsDirectionSelect . value : 'UD' ;
262
- vscode . postMessage ( {
263
- command : 'saveAsDgml' ,
264
- text : JSON . stringify ( {
265
- nodes : nodeExport ,
266
- direction : direction
267
- } )
268
- } ) ;
252
+ postSaveAsCommand ( 'saveAsDgml' ) ;
269
253
}
270
254
271
255
function saveAsDot ( ) {
256
+ postSaveAsCommand ( 'saveAsDot' ) ;
257
+ }
258
+
259
+ function postSaveAsCommand ( command ) {
272
260
const nodeExport = { } ;
273
261
nodes . forEach ( node => {
274
262
nodeExport [ node . id ] = {
280
268
} ) ;
281
269
const direction = hierarchicalOptionsDirectionSelect . value ? hierarchicalOptionsDirectionSelect . value : 'UD' ;
282
270
vscode . postMessage ( {
283
- command : 'saveAsDot' ,
271
+ command : command ,
284
272
text : JSON . stringify ( {
285
273
nodes : nodeExport ,
286
274
direction : direction
You can’t perform that action at this time.
0 commit comments