Clickable plot example using Js_of_ocaml, Brr, and Vg

I made a small, clickable canvas chart example for the browser using Js_of_ocaml, Brr, and Vg. The code is on GitHub, and you can check out a live demo as well. Perhaps the code may prove useful as another example for anyone wanting to try out the Brr or Vg packages.

It was actually fairly quick to make as Vg provides some pretty powerful drawing primitives, and Brr really simplifies interacting with the DOM and JavaScript values.

Here a screenshot of the demo:

13 Likes

The pin in your lock file is a local file:/// url. But then I should rather make a new release of Vg so that you don’t have to pin. Will try to push a release in the upcoming days.

Also speaking of clickable/tapable stuff with Vg that reminds me of this example (src) which I should port to more recent infrastructure.

5 Likes

Good catch with the pin, thanks. I had forgotten to update it to the git repository rather than my local pin. It’s pointing there now.

I remember reading through that example and the write-up, very cool and informative. I will just drop this link here to your other examples for everyone’s reference.

By the way, just wanted to say your vg documentation is great. It made it nice and simple to get started with it. Thanks!

3 Likes

This great for beginners like me getting started with Vg on browser.
just curious are there any examples of using Vg for 2D animations on html5 canvas

I think the only public instances of that that I have are those we made for the 2048 tutorial. See here, these shaping functions and there.

1 Like

hey just wondering if there is a new release of Vg i want to avoid pinning the deps on github version

1 Like

Famous last words. Now there really is [ANN] Vg 9.5.0 – Declarative 2D vector graphics there was a bit more to cleanup than I expected.

4 Likes