Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof of concept: Integrate httpgd #614

Closed
wants to merge 16 commits into from

Conversation

ManuelHentschel
Copy link
Member

@ManuelHentschel ManuelHentschel commented Apr 8, 2021

Update: To make styling easier, I've removed some hardcoded styles in a fork of httpgd.
The viewer now contains a very rudimentary plot history, which highlights a plot on hover but does not do anything else and lets the user select a plot

What problem did you solve?
This PR contains a very basic integration of httpgd to display plots.
A big advantage of the SVG format used here is that it can be styled using the CSS variables provided by vscode.
Between the two screenshots below, only the color theme and font family (in vscode's settings) were changed, the plot updated automatically.
The added typescript code is mostly just copied from here.

Screenshots:
httpgd1
httpgd2
image

How can I check this pull request?
Install httpgd from this branch, copy the following code to your .Rprofile and call plotTest() in an R terminal created by the extension.

options(vsc.plot = FALSE)
options(device = function(...) {
  httpgd::hgd(
    silent = TRUE
  )
  .vsc$request('httpgd', url=httpgd::hgd_url())
})

plotTest <- function(){
  plot(sin(1:30/10))
  plot(sin(1:90/10))
  plot(sin(1:300/10))
}

cc: @nx10, @renkun-ken

@BerriJ
Copy link

BerriJ commented Apr 8, 2021

I love this!

@ManuelHentschel ManuelHentschel changed the title WIP/Proof of concept: Integrate httpgd Proof of concept: Integrate httpgd Apr 11, 2021
@nx10 nx10 mentioned this pull request Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants