posit-dev / positron

Positron, a next-generation data science IDE
Other
1.76k stars 48 forks source link

targets::tar_visnetwork() shows a blank screen only. #3783

Open CorradoLanera opened 2 weeks ago

CorradoLanera commented 2 weeks ago

Type: Bug

targets::tar_visnetwork open in plots and not in viewer, showing a blank screen only instead of the widget

image

reprex

tar_dir({ # tar_dir() runs code from a temp dir for CRAN.
     tar_script({
       tar_option_set()
       list(
         tar_target(y1, 1 + 1),
         tar_target(y2, 1 + 1),
         tar_target(z, y1 + y2, description = "sum of two other sums")
       )
     })
     tar_visnetwork()
     tar_visnetwork(allow = starts_with("y")) # see also any_of()
})

VS Code version: Positron 1.90.0 (a893e5b282612ccb2200102957ac38d3c14e5196, 2024-06-26T01:33:58.809Z) OS version: Windows_NT x64 10.0.26120 Modes:

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz (8 x 3302)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.84GB (16.29GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions: none
jthomasmock commented 2 weeks ago

At a lower level, I tried this, the underlying library for visnetwork functions:

library(visNetwork)
# minimal example
nodes <- data.frame(id = 1:3)
edges <- data.frame(from = c(1,2), to = c(1,3))
visNetwork(nodes, edges, width = "100%")

This also shows in the Plots pane but successfully displays.

image

Positron Info Positron Version: 2024.06.1 (Universal) build 27 Code - OSS Version: 1.90.0 Commit: a893e5b282612ccb2200102957ac38d3c14e5196 Date: 2024-06-26T02:08:06.673Z 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
jmcphers commented 2 weeks ago

See #2023; there's a known issue preventing some HTML widgets from showing up correctly in Positron. I think this is another instance of that problem.