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

httpgd 1.4 #92

Closed
4 tasks
nx10 opened this issue Oct 25, 2021 · 7 comments
Closed
4 tasks

httpgd 1.4 #92

nx10 opened this issue Oct 25, 2021 · 7 comments

Comments

@nx10
Copy link
Owner

nx10 commented Oct 25, 2021

Server:

Client:

  • Improve UI/UX (e.g. Loading spinner on long plot wait, show plot size, switch to server side rendering, ...)

Docs:

@nx10 nx10 pinned this issue Oct 25, 2021
@nx10 nx10 changed the title httpgd 1.3 httpgd 1.4 Dec 20, 2021
@nx10
Copy link
Owner Author

nx10 commented Dec 20, 2021

Updates:

  • We need to make 1.3 a patch release for Windows UCRT support for the upcoming R 4.2 which changes the Windows build system quite a bit. I will publish the current development version in a couple of days after some minor client fixes for the RStudio webview.
  • It also turns out that Plots are not displayed in realtime in a loop #83 is a blocker for many new features. As the later devs seem to be unresponsive I will write a custom wrapper that allows for more fine grained communication between the main (R) thread and the webserver threads. This will also make debugging problems like Not responding if the device is left open for too long #67 much easier. If a C/C++ dev wants to help with this but is unsure about implementation details of httpgd I would be happy to explain details.
  • I also made some PRs to https://github.com/CrowCpp/Crow recently with necessary features to (maybe) replace Boost/Beast and the abandoned Belle library in the future.
  • I also experimented with modern OpenGL for the GPU renderer, and the most difficult part so far was getting it to work with the R build system. It seems like statically linking with GLFW will be the easiest way. Here is a little demo triangle that was rendered from within R with OpenGL 3.3.

Edit: It seems like packages can not be submitted until January 3rd as the CRAN submission team is on vacation. The code is ready now and I will upload as soon as its possible again.

@nx10
Copy link
Owner Author

nx10 commented Feb 3, 2022

After some technical difficulties with the new windows server 1.3 is now on CRAN.

@nx10
Copy link
Owner Author

nx10 commented Mar 1, 2022

I think its time to consider breaking httpgd up into smaller packages. I have a few reasons for this:

  • The codebase has grown significantly and so have compile times.
  • I find it difficult to choose sensible defaults for both webserver and offline use.
  • Personally I have been using httpgd in "offline mode" to render graphics for my articles/manuscripts and think it is easer to use to than the base R graphics devices, but I understand that many people don't want to install the web-related overhead or don't realize that httpgd can be used for this.
  • Packages like knitr could benefit from the speed, in memory graphics access and abstraction httpgd provides.

My proposal is breaking httpgd in 2 seperate packages:

  • unigd : Universal/unified graphics device: All graphics rendering functionality. Easy R API to access plots in any format. C++ API to create interactive devices. Primary focus on rendering speed.
  • httpgd : All web (client, server) and async functionality. Primary focus on UX and security.

Let me know what you think.

@BerriJ
Copy link

BerriJ commented Mar 2, 2022

Thank you very much @nx10 I really love httpgd and I use it every day,
However, I sometimes hit performance limits when plotting ggplot graphics with a lot of points. Those issues do not occur with the default R graphics device. I do not know If GPU utilization is the difference here but if this would be solved, httpgd would be just perfect.
Ahh and splitting up the package is a great Idea in my opinion. I really do not need the webserver.

@nx10
Copy link
Owner Author

nx10 commented Mar 3, 2022

@BerriJ Thank you very much, I am glad you like it. How are you using httpgd when the performance issues appear? Do you use VScode / RStudio and are you using the plot viewer or saving files with R instructions?

@BerriJ
Copy link

BerriJ commented Mar 3, 2022

I'm using httpgd inside of VS-Code together with the R extension. I can easily kill httpgd with

plot(rnorm(1000000), rnorm(1000000))

Which, admittedly, are a lot of points. I have some more complicated ggplots with fewer points that also fail. However, creating a reprex here wouldn't be that easy. However, if you think a reprex of those plots would be beneficial, I'll create one for you.

I usually save my plots using ggsave or using tikzdevice. So this does not rely on httpgd right? Saving is never a problem.

@nx10 nx10 mentioned this issue Jun 15, 2022
7 tasks
@nx10
Copy link
Owner Author

nx10 commented Jul 3, 2022

Closed in favor of #111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants