@explorable-viz/fluid 0.7.98 → 0.7.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/script/bundle-website.sh +1 -7
- package/website/article/css/styles.css +357 -0
- package/website/article/css/view-styles.css +190 -0
- package/website/article/font/GraphikLight.woff2 +0 -0
- package/website/article/font/GraphikLightItalic.woff2 +0 -0
- package/website/article/font/GraphikMedium.woff2 +0 -0
- package/website/article/font/GraphikMediumItalic.woff2 +0 -0
- package/website/article/font/OdiseanTech.woff2 +0 -0
- package/website/article/shared/fluid.mjs +27078 -0
- package/website/article/shared/footer.html +6 -0
- package/website/article/shared/header.html +27 -0
- package/website/article/shared/load-figure.js +45292 -0
- package/website/article/shared/sub-header.html +12 -0
- package/website/article/shared/util.js +72 -0
- package/website/article/shared/website-test.js +41 -0
- package/website/article/shared/webtest-lib.js +278837 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
<div></div>
|
2
|
+
<div></div>
|
3
|
+
<div>
|
4
|
+
<h3 class="title">Overview</h3>
|
5
|
+
<nav class="sub-header">
|
6
|
+
<ul>
|
7
|
+
<li><a href="/">Transparent research outputs</a></li>
|
8
|
+
<li><a href="/convolution">Matrix convolution</a></li>
|
9
|
+
<li><a href="/moving-average">Moving average</a></li>
|
10
|
+
</ul>
|
11
|
+
</nav>
|
12
|
+
</div>
|
@@ -0,0 +1,72 @@
|
|
1
|
+
function loadHeader () {
|
2
|
+
fetch('/shared/header.html')
|
3
|
+
.then(response => response.text())
|
4
|
+
.then(data => {
|
5
|
+
const header = document.createElement('div')
|
6
|
+
header.innerHTML = data
|
7
|
+
activateCurrentLink(header)
|
8
|
+
const divElement = header.children[0]
|
9
|
+
const grid = document.getElementById('grid')
|
10
|
+
grid.parentNode.insertBefore(divElement, grid)
|
11
|
+
})
|
12
|
+
.catch(error => console.error('Error loading shared HTML:', error))
|
13
|
+
|
14
|
+
fetch('/shared/footer.html')
|
15
|
+
.then(response => response.text())
|
16
|
+
.then(data => {
|
17
|
+
const footer = document.createElement('div')
|
18
|
+
footer.innerHTML = data
|
19
|
+
const divElement = footer.children[0]
|
20
|
+
const grid = document.getElementById('grid')
|
21
|
+
grid.parentNode.appendChild(divElement)
|
22
|
+
})
|
23
|
+
.catch(error => console.error('Error loading shared HTML:', error))
|
24
|
+
}
|
25
|
+
|
26
|
+
function eqPaths (path1, path2) {
|
27
|
+
const trailingSlashes = /\/+$/
|
28
|
+
return path1.replace(trailingSlashes, '') === path2.replace(trailingSlashes, '')
|
29
|
+
}
|
30
|
+
|
31
|
+
function activateCurrentLink (el) {
|
32
|
+
const listItems = el.querySelectorAll('li')
|
33
|
+
const n_ = Array.from(listItems).findIndex(li => {
|
34
|
+
const link = li.querySelector('a')
|
35
|
+
return link && eqPaths(link.getAttribute('href'), window.location.pathname)
|
36
|
+
})
|
37
|
+
if (n_ !== -1) {
|
38
|
+
listItems[n_].classList.add('active-page')
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
function loadSubHeader () {
|
43
|
+
fetch('/shared/sub-header.html')
|
44
|
+
.then(response => response.text())
|
45
|
+
.then(data => {
|
46
|
+
const header = document.createElement('div')
|
47
|
+
header.innerHTML = data
|
48
|
+
activateCurrentLink(header)
|
49
|
+
const divElements = header.children
|
50
|
+
const grid = document.getElementById('grid')
|
51
|
+
for (let i = Math.min(4, divElements.length - 1); i >= 0; --i) {
|
52
|
+
grid.insertBefore(divElements[i], grid.firstChild)
|
53
|
+
}
|
54
|
+
})
|
55
|
+
.catch(error => console.error('Error loading shared HTML:', error))
|
56
|
+
}
|
57
|
+
|
58
|
+
function toggleDataPane(gridId) {
|
59
|
+
const grid = document.getElementById(gridId)
|
60
|
+
const hidden = grid.classList.contains('data-pane-hidden')
|
61
|
+
const dataPaneButton = document.querySelector('.data-pane-button')
|
62
|
+
|
63
|
+
if (hidden) {
|
64
|
+
grid.classList.remove('data-pane-hidden')
|
65
|
+
dataPaneButton.classList.remove('fa-eye-slash')
|
66
|
+
dataPaneButton.classList.add('fa-eye')
|
67
|
+
} else {
|
68
|
+
grid.classList.add('data-pane-hidden')
|
69
|
+
dataPaneButton.classList.remove('fa-eye')
|
70
|
+
dataPaneButton.classList.add('fa-eye-slash')
|
71
|
+
}
|
72
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
const express = require('express');
|
3
|
+
const serve = require('express-static');
|
4
|
+
require('http-shutdown').extend();
|
5
|
+
|
6
|
+
const app = express();
|
7
|
+
|
8
|
+
const root = process.cwd() + '/dist/' + process.argv[2];
|
9
|
+
app.use(serve(root));
|
10
|
+
|
11
|
+
const server = app.listen(8080, function() {
|
12
|
+
console.log("Serving content from " + root);
|
13
|
+
}).withShutdown();
|
14
|
+
|
15
|
+
(async () => {
|
16
|
+
try {
|
17
|
+
if (process.argv.length == 4) {
|
18
|
+
module = process.cwd() + process.argv[3];
|
19
|
+
} else {
|
20
|
+
module = root + '/test.mjs';
|
21
|
+
}
|
22
|
+
console.log('Loading Puppeteer test module:', module);
|
23
|
+
import(module).then(({ main }) => {
|
24
|
+
main().then(serverDown);
|
25
|
+
}).catch(err => {
|
26
|
+
console.error("Failed to load PureScript output:", err);
|
27
|
+
});
|
28
|
+
} catch (error) {
|
29
|
+
console.error('Error:', error);
|
30
|
+
}
|
31
|
+
})();
|
32
|
+
|
33
|
+
function serverDown() {
|
34
|
+
console.log('Shutting down server')
|
35
|
+
server.shutdown(function(err) {
|
36
|
+
if (err) {
|
37
|
+
return console.log('shutdown failed', err.message);
|
38
|
+
}
|
39
|
+
console.log('Everything is cleanly shut down.');
|
40
|
+
});
|
41
|
+
}
|