libRmath.js icon indicating copy to clipboard operation
libRmath.js copied to clipboard

require in Observable

Open neocarto opened this issue 2 years ago • 5 comments

require("lib-r-math.js") dosen't work within Observable

neocarto avatar Jun 23 '22 12:06 neocarto

Hi @neocarto

I am not familiar with ObservableHQ, but I found this link

https://observablehq.com/@observablehq/module-require-debugger

After entering lib-r-math.js in the input field it showed me this screenshot (below) on how to use it

I guess "Observable"s run in a browser in that case you can access all functions from window.libR prefix or libR prefix

Note: I am not sure how Observable execute javascript (sandboxed?),

In any case the new version of lib-r-math.js (2.0) will use the standardized JS module system.

image

jacobbogers avatar Jun 24 '22 09:06 jacobbogers

Unfortunately, the require does not work in observable for the moment. Anyway, I can't wait to try lib-r-math.js (2.0). Do you know when this version will be available?

neocarto avatar Jun 27 '22 08:06 neocarto

@neocarto, sorry for getting back at you so late, it will be available on 01.nov.2022

jacobbogers avatar Sep 10 '22 13:09 jacobbogers

2023 ?

neocarto avatar Sep 10 '22 14:09 neocarto

Corrected))

jacobbogers avatar Sep 10 '22 14:09 jacobbogers

Hi @neocarto , I got it working on observablehq.com (see screenshot below made from the website using the lib)

It is version 2.0.0 release candidate rc1, there are a number of breaking changes, but you can browse the exported functions in observable and infer their usage,

I still have to re-write the document (README.md) , some distributions have a wasm backend (useHyperGeomBackend and useSignRankBackend)

Let me know if this is working for you

Cheers,

image

jacobbogers avatar Dec 08 '22 17:12 jacobbogers

@neocarto,

Version 2.0.0 officially released, note the "breaking changes" and wasm backends https://www.npmjs.com/package/lib-r-math.js?activeTab=readme

jacobbogers avatar Jan 17 '23 15:01 jacobbogers