summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gnu/packages/statistics.scm83
1 files changed, 82 insertions, 1 deletions
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 48328a1201..616eded618 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -4317,8 +4317,47 @@ features present in other programming languages.")
4317 (uri (cran-uri "plotly" version)) 4317 (uri (cran-uri "plotly" version))
4318 (sha256 4318 (sha256
4319 (base32 4319 (base32
4320 "0yin1kid3a69fcwrrajwzqbhx4xc81x8p8m0yfh1fkm2rfhj22dc")))) 4320 "0yin1kid3a69fcwrrajwzqbhx4xc81x8p8m0yfh1fkm2rfhj22dc"))
4321 (modules '((guix build utils)))
4322 (snippet
4323 '(with-directory-excursion "inst/htmlwidgets/lib/"
4324 (for-each delete-file
4325 '("plotlyjs/plotly-latest.min.js"
4326 "colourpicker/colourpicker.min.js"
4327 "typedarray/typedarray.min.js"
4328 "selectize/selectize.min.js"))))))
4321 (build-system r-build-system) 4329 (build-system r-build-system)
4330 (arguments
4331 (list
4332 #:modules '((guix build utils)
4333 (guix build r-build-system)
4334 (srfi srfi-1))
4335 #:phases
4336 '(modify-phases %standard-phases
4337 (add-after 'unpack 'process-javascript
4338 (lambda* (#:key inputs #:allow-other-keys)
4339 (with-directory-excursion "inst/htmlwidgets/lib/"
4340 (symlink (string-append (assoc-ref inputs "js-selectize")
4341 "/share/javascript/selectize.min.js")
4342 "selectize/selectize.min.js")
4343 (call-with-values
4344 (lambda ()
4345 (unzip2
4346 `((,(assoc-ref inputs "js-plotly")
4347 "plotlyjs/plotly-latest.min.js")
4348 (,(string-append (assoc-ref inputs "js-colourpicker")
4349 "/js/colourpicker.js")
4350 "colourpicker/colourpicker.min.js")
4351 (,(string-append (assoc-ref inputs "js-typedarray")
4352 "/typedarray.js")
4353 "typedarray/typedarray.min.js"))))
4354 (lambda (sources targets)
4355 (for-each (lambda (source target)
4356 (format #t "Processing ~a --> ~a~%"
4357 source target)
4358 (invoke "esbuild" source "--minify"
4359 (string-append "--outfile=" target)))
4360 sources targets)))))))))
4322 (propagated-inputs 4361 (propagated-inputs
4323 (list r-base64enc 4362 (list r-base64enc
4324 r-crosstalk 4363 r-crosstalk
@@ -4341,6 +4380,48 @@ features present in other programming languages.")
4341 r-tidyr 4380 r-tidyr
4342 r-vctrs 4381 r-vctrs
4343 r-viridislite)) 4382 r-viridislite))
4383 (native-inputs
4384 `(("esbuild" ,esbuild)
4385 ("js-colourpicker"
4386 ,(let ((commit "27c2a266d51e18a9fe6d7542264152b27c7d34e0")
4387 (version "1.1")
4388 (revision "0"))
4389 (origin
4390 (method git-fetch)
4391 (uri (git-reference
4392 (url "https://github.com/daattali/jquery-colourpicker")
4393 (commit commit)))
4394 (file-name (git-file-name "jquery-colourpicker"
4395 (git-version version revision commit)))
4396 (sha256
4397 (base32
4398 "0lg8amh8xh6p246j38rqghrljd7v5z34i169ra6403z8ga33wiqb")))))
4399 ("js-plotly"
4400 ,(let ((version "2.11.1"))
4401 (origin
4402 (method url-fetch)
4403 (uri (string-append "https://raw.githubusercontent.com/plotly/plotly.js/v"
4404 version "/dist/plotly.js"))
4405 (sha256
4406 (base32
4407 "1mxd8s4v3i885w5i02cyzqsrvqfr9w0svdclvqxbd05dly4bdkbj")))))
4408 ("js-selectize" ,js-selectize)
4409 ;; This is not quite the same as the bundled minified script from 2016,
4410 ;; but it seems to be the original with fixes from late 2017.
4411 ("js-typedarray"
4412 ,(let ((commit "9f7d4168657e2c164d647a6959f402f2c33eb5b4")
4413 (version "0")
4414 (revision "0"))
4415 (origin
4416 (method git-fetch)
4417 (uri (git-reference
4418 (url "https://github.com/inexorabletash/polyfill/")
4419 (commit commit)))
4420 (file-name (git-file-name "typedarray-polyfill"
4421 (git-version version revision commit)))
4422 (sha256
4423 (base32
4424 "0f9np4mmyhny03n3xpwzs07rld30lnfqsnh97x1v7xm0qy0zjanf")))))))
4344 (home-page "https://plot.ly/r") 4425 (home-page "https://plot.ly/r")
4345 (synopsis "Create interactive web graphics") 4426 (synopsis "Create interactive web graphics")
4346 (description 4427 (description