@explorable-viz/fluid 0.7.75 → 0.7.77
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/.spago/affjax-node/v1.0.0/.editorconfig +13 -0
- package/.spago/affjax-node/v1.0.0/.eslintrc.json +30 -0
- package/.spago/affjax-node/v1.0.0/.gitignore +13 -0
- package/.spago/pathy/v9.0.0/.editorconfig +13 -0
- package/.spago/pathy/v9.0.0/.gitignore +9 -0
- package/.spago/pathy/v9.0.0/.tidyrc.json +10 -0
- package/LICENSE +1 -1
- package/dist/fluid/fluid/lib/convolution.fld +27 -12
- package/dist/fluid/shared/fluid.mjs +267 -161
- package/dist/fluid/shared/load-figure.js +265 -167
- package/package.json +2 -1
- package/script/bundle-website.sh +3 -5
- package/.spago/node-process/v11.0.0/.eslintrc.json +0 -29
- package/.spago/node-process/v11.0.0/.gitignore +0 -8
- package/.spago/node-process/v11.1.0/.eslintrc.json +0 -29
- package/.spago/node-process/v11.1.0/.gitignore +0 -8
- package/.spago/node-process/v11.2.0/.eslintrc.json +0 -29
- package/.spago/node-process/v11.2.0/.gitignore +0 -8
- package/.spago/optparse/v6.0.0/.gitignore +0 -8
- package/.spago/optparse/v6.0.0/.npmrc +0 -1
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"env": { "browser": true },
|
3
|
+
"extends": "eslint:recommended",
|
4
|
+
"parserOptions": { "ecmaVersion": 6, "sourceType": "module" },
|
5
|
+
"rules": {
|
6
|
+
"block-scoped-var": "error",
|
7
|
+
"consistent-return": "error",
|
8
|
+
"eqeqeq": "error",
|
9
|
+
"guard-for-in": "error",
|
10
|
+
"no-bitwise": "error",
|
11
|
+
"no-caller": "error",
|
12
|
+
"no-constant-condition": ["error", { "checkLoops": false }],
|
13
|
+
"no-extra-parens": "off",
|
14
|
+
"no-extend-native": "error",
|
15
|
+
"no-loop-func": "error",
|
16
|
+
"no-new": "error",
|
17
|
+
"no-param-reassign": "error",
|
18
|
+
"no-return-assign": "error",
|
19
|
+
"no-sequences": "error",
|
20
|
+
"no-unused-expressions": "error",
|
21
|
+
"no-use-before-define": "error",
|
22
|
+
"no-undef": "error",
|
23
|
+
"no-eq-null": "error",
|
24
|
+
"radix": ["error", "always"],
|
25
|
+
"indent": ["error", 2, { "SwitchCase": 0 }],
|
26
|
+
"quotes": ["error", "double"],
|
27
|
+
"semi": ["error", "always"],
|
28
|
+
"strict": ["error", "global"]
|
29
|
+
}
|
30
|
+
}
|
package/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2019-
|
3
|
+
Copyright (c) 2019-2025 Open Source Contributors
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -1,16 +1,31 @@
|
|
1
|
-
let zero n =
|
2
|
-
|
3
|
-
|
1
|
+
let zero m n image =
|
2
|
+
let (m_max, n_max) = dims image
|
3
|
+
in if (m >= 1) `and` (m <= m_max) `and` (n >= 1) `and` (n <= n_max)
|
4
|
+
then image!(m, n)
|
5
|
+
else 0;
|
4
6
|
|
5
|
-
let
|
7
|
+
let wrap m n image =
|
8
|
+
let (m_max, n_max) = dims image
|
9
|
+
in image!( ((m - 1) `mod` m_max) + 1, ((n - 1) `mod` n_max) + 1);
|
10
|
+
|
11
|
+
let extend m n image =
|
12
|
+
let (m_max, n_max) = dims image;
|
13
|
+
m' = min (max m 1) m_max;
|
14
|
+
n' = min (max n 1) n_max
|
15
|
+
in image!(m', n');
|
16
|
+
|
17
|
+
let matrixSum matr =
|
18
|
+
let (m, n) = dims matr
|
19
|
+
in sum [ matr!(i, j) | (i, j) <- range (1, 1) (m, n)];
|
20
|
+
|
21
|
+
let convolve image kernel lookup =
|
6
22
|
let ((m, n), (i, j)) = (dims image, dims kernel);
|
7
23
|
(half_i, half_j) = (i `quot` 2, j `quot` 2);
|
8
24
|
area = i * j
|
9
|
-
in
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
| (m', n') in (m, n) |];
|
25
|
+
in [|let interMatrix = [|
|
26
|
+
let x = m' + i' - 1 - half_i;
|
27
|
+
y = n' + j' - 1 - half_j
|
28
|
+
in lookup x y image * kernel!(i', j')
|
29
|
+
| (i', j') in (i, j) |]
|
30
|
+
in matrixSum interMatrix `quot` area
|
31
|
+
| (m', n') in (m, n) |];
|