@explorable-viz/fluid 0.7.77 → 0.7.79

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorable-viz/fluid",
3
- "version": "0.7.77",
3
+ "version": "0.7.79",
4
4
  "description": "Fluid is an experimental programming language which integrates a bidirectional dynamic analysis to connect outputs to data sources in a fine-grained way. Fluid is implemented in PureScript and runs in the browser.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -1,47 +0,0 @@
1
- let nextIndices n m window =
2
- [(i, j) | i <- [1 .. n],
3
- j <- [max 1 (i - window) .. min m (i + window)]];
4
-
5
- let costMatrixInit rows cols window =
6
- [| let initV = if ((n == 1) `and` (m == 1)) `or` ((abs n m <= window) `and` not ((n == 1) `or` (m == 1)))
7
- then FNum 0
8
- else Infty
9
- in initV | (n, m) in (rows, cols) |];
10
-
11
- let minAndPrev (i, j) im1 jm1 ijm1 =
12
- let minim = minimal [im1, jm1, ijm1] in
13
- if minim `eq` im1 then
14
- ((i, j + 1), minim)
15
- else
16
- if minim `eq` jm1 then
17
- ((i + 1, j ), minim)
18
- else ((i, j), minim);
19
-
20
- let extractPath indmatrix (n, m) accum =
21
- if (n == 1) `and` (m == 1)
22
- then accum
23
- else
24
- extractPath indmatrix (indmatrix!(n, m)) ((n - 1, m - 1) : accum);
25
-
26
- let localMinUpdate seq1 seq2 cost (costmatrix, indmatrix) (i, j) =
27
- let iEntr = nth (i - 1) seq1;
28
- jEntr = nth (j - 1) seq2;
29
- dist = cost iEntr jEntr;
30
- ip = i + 1;
31
- jp = j + 1;
32
- im1 = costmatrix!(i , jp);
33
- jm1 = costmatrix!(ip, j);
34
- im1jm1 = costmatrix!(i, j);
35
- (prev, FNum minim) = minAndPrev (i, j) im1 jm1 im1jm1;
36
- newVal = FNum (dist + minim)
37
- in (matrixUpdate costmatrix (ip, jp) newVal, matrixUpdate indmatrix (ip, jp) prev);
38
-
39
- let computeDTW seq1 seq2 cost window =
40
- let n = length seq1;
41
- m = length seq2;
42
- initD = costMatrixInit (n + 1) (m + 1) window;
43
- initI = [| 0 | (i,j) in (n + 1, m + 1)|];
44
- indexing = nextIndices n m window;
45
- (finished, indices) = foldl (localMinUpdate seq1 seq2 cost) (initD, initI) indexing
46
- in
47
- (finished, extractPath indices (n + 1, m + 1) Nil);
@@ -1,22 +0,0 @@
1
- let comp Infty Infty = EQ;
2
- comp Infty (FNum y) = GT;
3
- comp (FNum x) Infty = LT;
4
- comp (FNum x) (FNum y) = compare x y;
5
-
6
- let fmin x y =
7
- match comp x y as {
8
- LT -> x;
9
- EQ -> x;
10
- GT -> y
11
- };
12
-
13
- let minimal = foldl1 fmin;
14
-
15
- let add Infty _ = Infty;
16
- add (FNum x) Infty = Infty;
17
- add (FNum x) (FNum y) = FNum (x + y);
18
-
19
- let eq Infty Infty = True;
20
- eq Infty (FNum x) = False;
21
- eq (FNum x) Infty = False;
22
- eq (FNum x) (FNum y) = x == y;
@@ -1 +0,0 @@
1
- let x = 1;
@@ -1,18 +0,0 @@
1
- let likelihoodMap table prob = (fromSome (find (fun x -> x.prob <= prob) table)).msg;
2
-
3
- let mkPercent num = (numToStr (num * 100)) ++ "%";
4
-
5
- let leqP n m =
6
- if n <= m
7
- then "less"
8
- else "more";
9
-
10
- let gradedLeqP n m =
11
- let ratio = n / m
12
- in if ratio <= 1.0
13
- then if ratio <=0.5
14
- then "much less"
15
- else "less"
16
- else if ratio >= 2.0
17
- then "much more"
18
- else "more";