Skip to content
This repository was archived by the owner on Nov 12, 2020. It is now read-only.
This repository was archived by the owner on Nov 12, 2020. It is now read-only.

vegalite doesn't render in the "Viewer" pane in RStudio when using remote files #20

@cbailiss

Description

@cbailiss

This is perhaps an unusual item to report as an issue, but please bear with me.

vegalite often(**) fails to render anything in the "Viewer" pane in RStudio, it is completely blank - on Windows at least, with the problem seen on multiple different systems using different Windows OS versions, including my home PC, all using RStudio 1.0.136. (**it was "often" for me, until I identified the cause).

For example, the following (taken from the vegalite docn) renders nothing in RStudio. Interestingly, clicking the "Show In New Window" button in the "Viewer" pane opens the view in a new web browser window where the chart is rendered OK.

library(vegalite)
vegalite() %>%
cell_size(500, 300) %>%
add_data("https://vega.github.io/vega-editor/app/data/unemployment-across-industries.json") %>%
encode_x("date", "temporal") %>%
encode_y("count", "quantitative", aggregate="sum") %>%
encode_color("series", "nominal") %>%
scale_color_nominal(range="category20b") %>%
timeunit_x("yearmonth") %>%
scale_x_time(nice="month") %>%
axis_x(axisWidth=0, format="%Y", labelAngle=0) %>%
mark_area(interpolate="basis", stack="center")

Downloading the data file and changing the add_data() reference to the local copy of the file resolves the problem. This suggests quite strongly the problem is security permissions (likely in the embedded web browser control RStudio uses for the "Viewer" pane).

This is strictly speaking not an issue with vegalite but given the popularity of RStudio, I thought I'd report it here. A sensible way of dealing with this might be to add a few notes to the documentation to highlight the issue and the workarounds (i.e. click "Show In New Window" or avoid using remote files). This would avoid other people having similar frustration in RStudio with vegalite when the problem is not actually vegalite at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions