posit-dev / positron

Positron, a next-generation data science IDE
Other
2.25k stars 67 forks source link

htmlwidgets do not work (leaflet) #3968

Closed JosiahParry closed 4 weeks ago

JosiahParry commented 1 month ago

Positron Version:

Positron Version: 2024.07.0 (Universal) build 21 Code - OSS Version: 1.90.0 Commit: 82b335e27545e804b7fd806db00477a6eb49951d Date: 2024-07-09T04:32:26.804Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin arm64 23.4.0

Steps to reproduce the issue:

library(leaflet)
leaflet() |> 
  setView(-117.16018863360692, 32.70568725886412, 15)

What did you expect to happen?

The map would be shown as it is in RStudio

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

seeM commented 1 month ago

It gets part of the way there on my side:

image

And encounters an error in proj4leaflet:

Uncaught Leaflet and proj4 must be loaded first

Might be related to https://github.com/posit-dev/positron/issues/3969 where dependencies are also not loaded correctly.

juliasilge commented 1 month ago

Related to #3756

juliasilge commented 1 month ago

After https://github.com/posit-dev/positron/pull/4126, this now behaves the same as RStudio (blank HTML pops up in Viewer).

JosiahParry commented 1 month ago

After #4126, this now behaves the same as RStudio (blank HTML pops up in Viewer).

Just came here to report another htmlwidgets related issue with mapgl. This PR will fix the blank html widget? 🙏🏼

image
juliasilge commented 1 month ago

We can check it out! By chance, do you have a small mapgl reprex to share?

JosiahParry commented 1 month ago

We can check it out! By chance, do you have a small mapgl reprex to share? This one is missing a library(dplyr); library(sf) but it works!

https://gist.github.com/ryanscharf/ad6c262f52770a1c2ddc70fa4e56dee4

You'll also need a mapbox api token—it's frightening to make one though b/c they require a credit card. Just a warning 😅

walkerke commented 4 weeks ago

@JosiahParry @juliasilge everything is working for me now with the latest Positron build, try it out!

testlabauto commented 4 weeks ago

Verified Fixed

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

Test scenario(s)

library(leaflet) leaflet() |> setView(-117.16018863360692, 32.70568725886412, 15)

Now behaves the same as RStudio

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