@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.
@@ -0,0 +1,13 @@
1
+ # https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
@@ -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
+ }
@@ -0,0 +1,13 @@
1
+ .*
2
+ !.gitignore
3
+ !.github
4
+ !.editorconfig
5
+ !.eslintrc.json
6
+
7
+ output
8
+ generated-docs
9
+ bower_components
10
+
11
+ node_modules
12
+ package-lock.json
13
+ *.lock
@@ -0,0 +1,13 @@
1
+ # https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
@@ -0,0 +1,9 @@
1
+ .*
2
+ !.gitignore
3
+ !.github
4
+ !.editorconfig
5
+ !.tidyrc.json
6
+
7
+ output
8
+ generated-docs
9
+ bower_components
@@ -0,0 +1,10 @@
1
+ {
2
+ "importSort": "source",
3
+ "importWrap": "source",
4
+ "indent": 2,
5
+ "operatorsFile": null,
6
+ "ribbon": 1,
7
+ "typeArrowPlacement": "first",
8
+ "unicode": "never",
9
+ "width": null
10
+ }
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019-2024 Open Source Contributors
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 = const n;
2
- wrap n n_max = ((n - 1) `mod` n_max) + 1;
3
- extend n = min (max n 1);
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 convolve image kernel boundary =
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 [| let weightedSum = sum [
10
- image!(x, y) * kernel!(i' + 1, j' + 1)
11
- | (i', j') <- range (0, 0) (i - 1, j - 1),
12
- let x = boundary (m' + i' - half_i) m,
13
- let y = boundary (n' + j' - half_j) n,
14
- x >= 1, x <= m, y >= 1, y <= n
15
- ] in weightedSum `quot` area
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) |];