@explorable-viz/fluid 0.7.94 → 0.7.96
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/dist/fluid/fluid/lib/matrix.fld +16 -18
- package/dist/fluid/shared/fluid.mjs +311 -474
- package/dist/fluid/shared/load-figure.js +700 -458
- package/package.json +4 -2
- package/script/bundle-website.sh +1 -2
- package/website/article/convolution/index.html +1 -1
- package/website/article/fluid/1805.02474v1-10.fld +33 -0
- package/website/article/fluid/convolution.fld +1 -0
- package/website/article/index.html +1 -1
- package/website/article/transparent-text/index.html +45 -0
- package/website/article/transparent-text/spec.json +9 -0
- package/website/article/image/fluid-logo.png +0 -0
- package/website/article/image/iccs-full-logo.png +0 -0
- package/website/article/image/schmidtsciences_primary_color.png +0 -0
@@ -1,14 +1,14 @@
|
|
1
1
|
let zero m n image =
|
2
2
|
let (m_max, n_max) = dims image
|
3
|
-
in if (m >= 1) `and` (m <= m_max) `and` (n >= 1) `and` (n <= n_max)
|
3
|
+
in if (m >= 1) `and` (m <= m_max) `and` (n >= 1) `and` (n <= n_max)
|
4
4
|
then image!(m, n)
|
5
5
|
else 0;
|
6
6
|
|
7
|
-
let wrap m n image =
|
7
|
+
let wrap m n image =
|
8
8
|
let (m_max, n_max) = dims image
|
9
9
|
in image!( ((m - 1) `mod` m_max) + 1, ((n - 1) `mod` n_max) + 1);
|
10
10
|
|
11
|
-
let extend m n image =
|
11
|
+
let extend m n image =
|
12
12
|
let (m_max, n_max) = dims image;
|
13
13
|
m' = min (max m 1) m_max;
|
14
14
|
n' = min (max n 1) n_max
|
@@ -22,20 +22,18 @@ let convolve image kernel lookup =
|
|
22
22
|
let ((m, n), (i, j)) = (dims image, dims kernel);
|
23
23
|
(half_i, half_j) = (i `quot` 2, j `quot` 2);
|
24
24
|
area = i * j
|
25
|
-
in [| let interMatrix =
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
| (m', n') in (m, n) |];
|
25
|
+
in [| let interMatrix =
|
26
|
+
"""Intermediate matrix for element (${m'}, ${n'})"""
|
27
|
+
[| let x = m' + i' - 1 - half_i;
|
28
|
+
y = n' + j' - 1 - half_j in
|
29
|
+
lookup x y image * kernel!(i', j')
|
30
|
+
| (i', j') in (i, j) |]
|
31
|
+
in matrixSum interMatrix `quot` area
|
32
|
+
| (m', n') in (m, n) |];
|
34
33
|
|
35
|
-
let matMul a b =
|
36
|
-
let ((m, n), (i, j)) = (dims a, dims b) in
|
34
|
+
let matMul a b =
|
35
|
+
let ((m, n), (i, j)) = (dims a, dims b) in
|
37
36
|
if not (n == i)
|
38
|
-
then error "
|
39
|
-
else
|
40
|
-
|
41
|
-
| (i', j') in (m, j) |];
|
37
|
+
then error "Dimension mismatch"
|
38
|
+
else [| sum [ a!(i', k) * b!(k, j') | k <- enumFromTo 1 n]
|
39
|
+
| (i', j') in (m, j) |];
|