@@ -33,7 +33,6 @@ let plotView: string;
3333let plotFile : string ;
3434let plotLockFile : string ;
3535let plotTimeStamp : number ;
36- let plotDir : string ;
3736let globalEnvWatcher : FSWatcher ;
3837let plotWatcher : FSWatcher ;
3938let activeBrowserPanel : WebviewPanel ;
@@ -440,68 +439,6 @@ export async function getListHtml(webview: Webview, file: string): Promise<strin
440439` ;
441440}
442441
443- export async function showPlotHistory ( ) : Promise < void > {
444- if ( config ( ) . get < boolean > ( 'sessionWatcher' ) ) {
445- if ( plotDir === undefined ) {
446- void window . showErrorMessage ( 'No session is attached.' ) ;
447- } else {
448- const files = await fs . readdir ( plotDir ) ;
449- if ( files . length > 0 ) {
450- const panel = window . createWebviewPanel ( 'plotHistory' , 'Plot History' ,
451- {
452- preserveFocus : true ,
453- viewColumn : ViewColumn . Active ,
454- } ,
455- {
456- retainContextWhenHidden : true ,
457- enableScripts : true ,
458- localResourceRoots : [ Uri . file ( resDir ) , Uri . file ( plotDir ) ] ,
459- } ) ;
460- const html = getPlotHistoryHtml ( panel . webview , files ) ;
461- panel . webview . html = html ;
462- } else {
463- void window . showInformationMessage ( 'There is no plot to show yet.' ) ;
464- }
465- }
466- } else {
467- void window . showInformationMessage ( 'This command requires that r.sessionWatcher be enabled.' ) ;
468- }
469- }
470-
471- function getPlotHistoryHtml ( webview : Webview , files : string [ ] ) {
472- const imgs = files
473- . map ( ( file ) => `<img src="${ String ( webview . asWebviewUri ( Uri . file ( path . join ( plotDir , file ) ) ) ) } " />` )
474- . join ( '\n' ) ;
475-
476- return `
477- <!doctype HTML>
478- <html>
479- <head>
480- <meta charset="utf-8" />
481- <meta name="viewport" content="width=device-width, initial-scale=1">
482- <link href="${ String ( webview . asWebviewUri ( Uri . file ( path . join ( resDir , 'bootstrap.min.css' ) ) ) ) } " rel="stylesheet">
483- <link href="${ String ( webview . asWebviewUri ( Uri . file ( path . join ( resDir , 'fotorama.css' ) ) ) ) } " rel="stylesheet">
484- <style type="text/css">
485- body {
486- background-color: white;
487- }
488- </style>
489- </head>
490- <body>
491- <div class="container">
492- <div class="text-center">
493- <div class="fotorama" data-width="100%" data-maxheight="100%" data-nav="thumbs" data-keyboard="true">
494- ${ imgs }
495- </div>
496- </div>
497- </div>
498- <script src="${ String ( webview . asWebviewUri ( Uri . file ( path . join ( resDir , 'jquery.min.js' ) ) ) ) } "></script>
499- <script src="${ String ( webview . asWebviewUri ( Uri . file ( path . join ( resDir , 'fotorama.js' ) ) ) ) } "></script>
500- </body>
501- </html>
502- ` ;
503- }
504-
505442function isFromWorkspace ( dir : string ) {
506443 if ( workspace . workspaceFolders === undefined ) {
507444 const rel = path . relative ( os . homedir ( ) , dir ) ;
@@ -572,7 +509,6 @@ async function updateRequest(sessionStatusBarItem: StatusBarItem) {
572509 pid = String ( request . pid ) ;
573510 sessionDir = path . join ( request . tempdir , 'vscode-R' ) ;
574511 workingDir = request . wd ;
575- plotDir = path . join ( sessionDir , 'images' ) ;
576512 plotView = String ( request . plot ) ;
577513 console . info ( `[updateRequest] attach PID: ${ pid } ` ) ;
578514 sessionStatusBarItem . text = `R: ${ pid } ` ;
0 commit comments