Skip to content

Provide better vsc.dev.args defaults #1657

@ThomasSoeiro

Description

@ThomasSoeiro

Describe the bug

Plots are barely readable with default dimensions and resolution (whatever the layout).

getOption("vsc.dev.args")
# $width
# [1] 800
# 
# $height
# [1] 1200
# 

To Reproduce

Create any plot, e.g.:

plot(1)

Can you fix this issue by yourself? (We appreciate the help)

Maybe.

vsc.dev.args is documented in the wiki.

I guess we need to edit:

vscode-R/package.json

Lines 1822 to 1828 in 6108825

"r.plot.devArgs": {
"type": "object",
"markdownDescription": "The arguments for the png device to replay user graphics to show in VSCode. Requires `#r.plot.useHttpgd#` to be set to `false`. \n\nChanges the option `vsc.dev.args` in R.",
"default": {
"width": 800,
"height": 1200
},

Which is applied by:

vsc.dev.args = plot$devArgs,

Expected behavior

Provide better default (especially 1:1 aspect ratio and higher resolution), e.g.:

  • width: 1200,
  • height: 1200,
  • res: 200

This is more in line with e.g. png() et al., ggsave() defaults, or RStudio plot viewer.

Screenshots

Default:

Image

With suggested change applied in settings.json:

    "r.plot.devArgs": {
        "width": 1200,
        "height": 1200,
        "res": 200
    }

or in .Rprofile:

options(vsc.dev.args = list(width = 1200, height = 1200, res = 200))

we get:

Image

Environment (please complete the following information):

  • OS: all
  • VSCode Version: VSCodium 1.106.37943
  • R Version: all
  • vscode-R version: 2.8.6

Additional context

I am aware of httpgd; I am suggested better defaults for the default viewer.

Thanks for this excellent extension!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions