guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/06: gnu: Add r-billboarder.


From: guix-commits
Subject: 05/06: gnu: Add r-billboarder.
Date: Wed, 9 Feb 2022 03:10:25 -0500 (EST)

rekado pushed a commit to branch master
in repository guix.

commit ce57df72fd7ce52bdd33bc6c9477b1ebac86ac1e
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Wed Feb 9 08:59:29 2022 +0100

    gnu: Add r-billboarder.
    
    * gnu/packages/cran.scm (r-billboarder): New variable.
---
 gnu/packages/cran.scm | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm
index af4d3c8f76..d468972aa1 100644
--- a/gnu/packages/cran.scm
+++ b/gnu/packages/cran.scm
@@ -8284,6 +8284,66 @@ Python to R they are converted back to R types.")
 file.")
     (license license:gpl2+)))
 
+(define-public r-billboarder
+  (package
+    (name "r-billboarder")
+    (version "0.3.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (cran-uri "billboarder" version))
+       (sha256
+        (base32 "189ngvg84rcwhrivxskmjv3srhadvzr4p1v8pf11axyv2qn01b0x"))
+       (snippet
+        '(delete-file 
"inst/htmlwidgets/lib/billboard/billboard.pkgd.min.js"))))
+    (properties `((upstream-name . "billboarder")))
+    (build-system r-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'process-javascript
+           (lambda* (#:key inputs #:allow-other-keys)
+             (with-directory-excursion "inst/htmlwidgets/lib/billboard/"
+               (let ((source (assoc-ref inputs "js-billboard"))
+                     (target "billboard.pkgd.min.js"))
+                 (format #true "Processing ~a --> ~a~%"
+                         source target)
+                 (invoke "esbuild" source "--minify"
+                         (string-append "--outfile=" target)))))))))
+    (propagated-inputs
+     (list r-ggplot2
+           r-htmltools
+           r-htmlwidgets
+           r-jsonlite
+           r-magrittr
+           r-rlang
+           r-scales
+           r-shiny))
+    (native-inputs
+     `(("r-knitr" ,r-knitr)
+       ("esbuild" ,esbuild)
+       ;; It is not ideal to use this concatenated (but not minified)
+       ;; JavaScript file, as the original source is written in TypeScript.
+       ;; However, this can still be considered source code as it is readable
+       ;; and can be modified.
+       ("js-billboard"
+        ,(origin
+           (method url-fetch)
+           (uri "https://unpkg.com/billboard.js@3.2.0/dist/billboard.js";)
+           (sha256
+            (base32
+             "1kx5rqmn87pgal2cwmcij2rrnwa0fgcsw6y99m4i0l2sdm0qffv2"))))))
+    (home-page "https://github.com/dreamRs/billboarder";)
+    (synopsis "Create interactive charts with the JavaScript Billboard 
library")
+    (description
+     "This package provides an @code{htmlwidgets} interface to billboard.js,
+a re-usable easy interface JavaScript chart library, based on D3 v4+.  Chart
+types include line charts, scatterplots, bar/lollipop charts,
+histogram/density plots, pie/donut charts and gauge charts.  All charts are
+interactive, and a proxy method is implemented to smoothly update a chart
+without rendering it again in shiny apps.")
+    (license license:expat)))
+
 (define-public r-ggseqlogo
   (package
     (name "r-ggseqlogo")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]