flextable icon indicating copy to clipboard operation
flextable copied to clipboard

flextable not available for webR due to its gdtools/curl dependency

Open maek-ies opened this issue 1 year ago • 3 comments

More a question than a bug.

WebR allows to run R code in the browser without the need for an R server to execute the code. For packages to work in webR they need to be compiled to WebAssembly format, but due to technical limitations this is not possible for some packages (the issue is that opening raw network sockets is not permitted from the WebAssembly sandbox so prominently curl package is affected). I'd love to use flextable for shinylive apps built on webR.

My question is whether it would be possible (and not time consuming) to create a lightweight version of flextable that would not be dependent on gdtools/curl? If yes, it should be then easy to compile it to wasm and use in webR. If gdtools package is so essential that it is not so easy to do so and it would take a lot work, then feel free to close the issue. While flextable would be my preference, there are alternative table packages that are compiled for webR already (e.g. gt), and they could be used instead.

2024-06-06_09-51-01

maek-ies avatar Jun 06 '24 08:06 maek-ies

hello,

I know. I don't think it's hard. gdtools has to be updated with a suggest instead of import instructions for curl and maybe gfonts

davidgohel avatar Jun 06 '24 16:06 davidgohel

Update to gdtools made here: https://github.com/davidgohel/gdtools/commit/c4205ae42d6f39bb6ca3f6d06c3eb88e6463740f Once this update is on the CRAN flextable should work with WebR.

eli-daniels avatar Sep 02 '24 12:09 eli-daniels

Thanks a lot! This is so useful! I checked now and when using "https://davidgohel.r-universe.dev" as repo during flextable installation in webR it works already now.

maek-ies avatar Sep 11 '24 09:09 maek-ies

it now also works without using r-universe

davidgohel avatar Oct 27 '24 15:10 davidgohel

Thank you, David!

maek-ies avatar Oct 30 '24 15:10 maek-ies

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

github-actions[bot] avatar May 01 '25 05:05 github-actions[bot]