From 914ae94d48bd8a7619102263eb654a764877dbc6 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 4 Apr 2024 11:14:18 -0500 Subject: Add recent javascript-d3 library --- gn/packages/genenetwork.scm | 3 ++- gn/packages/javascript.scm | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/gn/packages/genenetwork.scm b/gn/packages/genenetwork.scm index e3ec17f..21de18a 100644 --- a/gn/packages/genenetwork.scm +++ b/gn/packages/genenetwork.scm @@ -219,7 +219,8 @@ javascript-cytoscape-panzoom javascript-cytoscape-qtip javascript-d3-tip - javascript-d3js + javascript-d3js ;; very old + javascript-d3js-7 javascript-d3panels javascript-datatables javascript-datatables-buttons diff --git a/gn/packages/javascript.scm b/gn/packages/javascript.scm index f92ada9..d8c9af9 100644 --- a/gn/packages/javascript.scm +++ b/gn/packages/javascript.scm @@ -894,6 +894,46 @@ visualization components and a data-driven approach to DOM manipulation.") (install-file "d3.min.js" targetdir) (install-file "LICENSE" (string-append out "/share/doc/d3js-" ,version)))))))) +(define-public javascript-d3js-7 + (package + (name "javascript-d3js-7") + (version "7.9.0") + (source + (origin + (method url-fetch) + ;; note that D3 no longer provides a prebuilt JS file - except through CDS + (uri (string-append "https://files.genenetwork.org/software/d3.v" version ".min.js.gz")) + (sha256 + (base32 "0k7g40zb65s12z1zchvimj5xibkrqff5sylbrhcwmwpcplpigid7")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((out (assoc-ref %outputs "out")) + (module-name "d3js-7") + (gzip (string-append (assoc-ref %build-inputs "gzip") + "/bin/gzip")) + (targetdir (string-append out "/share/genenetwork2/javascript/" module-name)) + (jsname (string-append "d3.v" "7.9.0" ".min.js")) + (gzname (string-append jsname ".gz")) + (source (assoc-ref %build-inputs "source"))) + (mkdir-p targetdir) + (copy-file (pk source) (pk (string-append targetdir "/" gzname))) + (invoke gzip "-fd" (string-append targetdir "/" gzname)))))) + (native-inputs + `(("source" ,source) + ("gzip" ,gzip))) + (home-page "https://d3js.org/") + (synopsis "JavaScript library for visualizing data") + (description "D3.js is a JavaScript library for manipulating documents based +on data. D3 helps you bring data to life using HTML, SVG, and CSS. D3's +emphasis on web standards gives you the full capabilities of modern browsers +without tying yourself to a proprietary framework, combining powerful +visualization components and a data-driven approach to DOM manipulation.") + (license license:bsd-3))) + (define-public javascript-d3js-multi (package (name "javascript-d3js-multi") -- cgit v1.2.3