positron icon indicating copy to clipboard operation
positron copied to clipboard

Python: Altair plots show unusable "save" menu

Open isabelizimm opened this issue 1 year ago • 3 comments

Positron Version:

dev

Steps to reproduce the issue:

Run:

import altair as alt
import pandas as pd

source = pd.DataFrame({
    'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
    'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]
})

alt.Chart(source).mark_bar().encode(
    x='a',
    y='b'
)

What did you expect to happen?

Altair has their own "save" menu on the interactive plots that are used to save the plots in notebook environments. I'd expect this menu to either work or be suppressed.

Screenshot 2024-04-22 at 10 07 07 AM

Were there any error messages in the output or Developer Tools console?

Nope!

isabelizimm avatar Apr 22 '24 14:04 isabelizimm

I consider this related to https://github.com/posit-dev/positron/issues/2559#issuecomment-2049254813 and maybe we should reconsider HTML like this going to the Plots pane at all (vs. the Viewer pane).

juliasilge avatar Apr 22 '24 17:04 juliasilge

Here's the source code for the "actions" in this menu: https://github.com/vega/vega-embed/blob/c3b6c19bad7054e6a5ec0f3ca2647a888b4aac00/src/embed.ts#L488.

We could also choose which actions to show via the actions option.

seeM avatar May 27 '24 13:05 seeM

This came up for a private beta user here: https://github.com/posit-dev/positron-beta/discussions/201

juliasilge avatar May 28 '24 15:05 juliasilge

Verified Fixed

Positron Version(s) : 2024.07.0-113
OS Version          : OSX

Test scenario(s)

I was able to save the sample plot shared in the original filing.

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

testlabauto avatar Jul 30 '24 16:07 testlabauto