[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Mathieu Othacehe |
Date: |
Wed, 7 Apr 2021 05:55:01 -0400 (EDT) |
branch: master
commit 63ce1c940b68b88a686f8e42cddb281092f6596f
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Tue Apr 6 15:27:58 2021 +0200
Add d3.js support.
* src/static/js/d3.v6.min.js: New file.
* Makefile.am (dist_js_DATA): Add it.
* src/cuirass/http.scm (%file-white-list): Add it.
* src/cuirass/templates.scm (html-page): Add it.
---
Makefile.am | 1 +
src/cuirass/http.scm | 1 +
src/cuirass/templates.scm | 1 +
src/static/js/d3.v6.min.js | 2 ++
4 files changed, 5 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index d9c87e2..fd62500 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -109,6 +109,7 @@ dist_images_DATA = \
dist_js_DATA = \
src/static/js/chart.js \
src/static/js/choices.min.js \
+ src/static/js/d3.v6.min.js \
src/static/js/datatables.min.js \
src/static/js/jquery-3.6.0.min.js
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index dd5c352..84f5490 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -86,6 +86,7 @@
"images/icon.png"
"images/guix.png"
"js/chart.js"
+ "js/d3.v6.min.js"
"js/datatables.min.js"
"js/jquery-3.6.0.min.js"
"js/choices.min.js"))
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index 933c829..b172c40 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -130,6 +130,7 @@ system whose names start with " (code "guile-") ":" (br)
(href "/static/images/icon.png")))
(script (@ (src "/static/js/jquery-3.6.0.min.js")))
(script (@ (src "/static/js/datatables.min.js")))
+ (script (@ (src "/static/js/d3.v6.min.js")))
(script "
$(document).ready(function() {
var default_opts = {
diff --git a/src/static/js/d3.v6.min.js b/src/static/js/d3.v6.min.js
new file mode 100644
index 0000000..e08f3b1
--- /dev/null
+++ b/src/static/js/d3.v6.min.js
@@ -0,0 +1,2 @@
+// https://d3js.org v6.6.2 Copyright 2021 Mike Bostock
+!function(t,n){"object"==typeof exports&&"undefined"!=typeof
module?n(exports):"function"==typeof
define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof
globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use
strict";function n(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function e(t){let
e=t,r=t;function
i(t,n,e,i){for(null==e&&(e=0),null==i&&(i=t.length);e<i;){const
o=e+i>>>1;r(t[o],n)<0?e=o+1:i=o}return e}return
1===t.length&&(e=(n,e)=>t(n)-e,r=function(t){return(e,r)=> [...]