posit-dev / positron

Positron, a next-generation data science IDE
Other
2.48k stars 75 forks source link

Positron Web: Various R plot packages don't work (similar issue between packages) #4804

Open testlabauto opened 6 days ago

testlabauto commented 6 days ago

System details:

Positron and OS details:

Dev build on Sep 24, 24

Interpreter details:

R 4.3.3

Describe the issue:

Highcharter, leaflet and plotly plots not working in web version. Plot view shows:

Cannot GET /

Steps to reproduce the issue:

Highcharter

library(highcharter)

data("mpg", "diamonds", "economics_long", package = "ggplot2")

hchart(mpg, "point", hcaes(x = displ, y = cty, group = year))

Leaflet

library(leaflet)
m = leaflet() %>% addTiles()
m = m %>% setView(-93.65, 42.0285, zoom = 17)
m %>% addPopups(-93.65, 42.0285, 'Here is the <b>Department of Statistics</b>, ISU')

Plotly

library(plotly)
fig <- plot_ly(midwest, x = ~percollege, color = ~state, type = "box")
fig

Expected or desired behavior:

Plots generated

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

image

from VSCode

Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'postMessage')
    at <anonymous> (<eval>/VM46947592:36:21)
    --- setTimeout ---
    at <anonymous> (<eval>/VM46947592:35:6)
    at <anonymous> (/Users/christophermead/posit/positron/out/vs/workbench/contrib/webview/browser/pre/index.html:1070:23)
    --- setTimeout ---
    at onFrameLoaded (/Users/christophermead/posit/positron/out/vs/workbench/contrib/webview/browser/pre/index.html:1068:6)
    at <anonymous> (/Users/christophermead/posit/positron/out/vs/workbench/contrib/webview/browser/pre/index.html:1099:7)
VM46947592:36
<anonymous> @ <eval>/VM46947592:36:21
sharon-wang commented 3 days ago

➕1️⃣ I was trying out the following in Positron on Workbench and I saw the same issue and console errors:

library(plotly)
fig <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length)
fig

image

sharon-wang commented 1 hour ago

I'm fixing this while working on #4274