positron icon indicating copy to clipboard operation
positron copied to clipboard

Positron Web: cannot save plots

Open testlabauto opened this issue 1 year ago • 1 comments

System details:

Positron and OS details:

Dev build on Sep 24, 24 at noon MST.

Interpreter details:

All Python and R as far as I can tell.

Describe the issue:

Unable to save plots for R and Python with the web version of Positron.

Steps to reproduce the issue:

Attempt to save any plot.

Expected or desired behavior:

Possible to save plot.

Were there any error messages in the UI, Output panel, or Developer Tools console?

image

testlabauto avatar Sep 24 '24 17:09 testlabauto

This and #4840 need some special handling for picking files and folders. We should be using vscode-remote URIs. Any of the file service code will treat these URIs as server-side.

The actual switch to using the vscode-remote schema is simple. The special handling requires a file picker that works with our modal dialog implementation. The file picker that we inherit from upstream knows to show a native dialog for local files and a SimpleFileDialog for remote files. Unfortunately, this dialog is anchored to the active window, which means it is layered underneath our modal div overlay and is always displayed at the top center of the workbench.

It would be best to reuse as much code as possible to avoid re-writing a new file picker.

timtmok avatar Oct 10 '24 19:10 timtmok

Verified Fixed

Positron Version(s) : Main on 10/22/24 at noon MST
OS Version          : OSX

Test scenario(s)

Tested with plot:

import pandas as pd
import matplotlib.pyplot as plt
data_dict = {'name': ['p1', 'p2', 'p3', 'p4', 'p5', 'p6'],
				'age': [20, 20, 21, 20, 21, 20],
				'math_marks': [100, 90, 91, 98, 92, 95],
				'physics_marks': [90, 100, 91, 92, 98, 95],
				'chem_marks': [93, 89, 99, 92, 94, 92]
				}

df = pd.DataFrame(data_dict)

df.plot(kind='scatter',
		x='math_marks',
		y='physics_marks',
		color='red')

plt.title('ScatterPlot')
plt.show()

Link(s) to TestRail test cases run or created:

testlabauto avatar Oct 22 '24 17:10 testlabauto