@explorable-viz/fluid 0.10.1 → 0.10.3
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/graphics.fld +246 -221
- package/dist/fluid/fluid/lib/matrix.fld +44 -41
- package/dist/fluid/fluid/lib/stats.fld +86 -75
- package/dist/fluid/shared/fluid.mjs +7830 -8585
- package/dist/fluid/shared/load-figure.js +7668 -7837
- package/dist/fluid/shared/webtest-lib.js +1479 -1479
- package/package.json +1 -1
- package/website/article/css/styles.css +3 -35
- package/website/article/css/view-styles.css +3 -3
- package/website/article/fluid/1805.02474v1-10.fld +2 -2
- package/website/article/fluid/bar-chart-line-chart.fld +17 -17
- package/website/article/fluid/convolution.fld +6 -7
- package/website/article/fluid/scigen.fld +8 -2
- package/website/article/renewables-linked/index.html +0 -14
- package/website/article/scigen-1805.02474v1-10/index.html +5 -1
- package/website/article/test.mjs +1 -4
- 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
@@ -1,75 +1,86 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
in
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
1
|
+
def split([]): ([], [])
|
2
|
+
def split(x :| xs):
|
3
|
+
def (ys, zs): split(xs);
|
4
|
+
|
5
|
+
(x :| zs, ys);
|
6
|
+
|
7
|
+
def merge(xs, ys):
|
8
|
+
match (xs, ys):
|
9
|
+
case ([], _): ys
|
10
|
+
case (x :| xs', []): xs
|
11
|
+
case (x :| xs', y :| ys'):
|
12
|
+
if x < y: x :| merge(xs', ys)
|
13
|
+
else: y :| merge(xs, ys');
|
14
|
+
|
15
|
+
def mergesort(xs):
|
16
|
+
if length(xs) < 2: xs
|
17
|
+
else:
|
18
|
+
def (ys, zs): split(xs);
|
19
|
+
|
20
|
+
merge(mergesort(ys), mergesort(zs));
|
21
|
+
|
22
|
+
def findQuantile(q, p, xs):
|
23
|
+
def rank:
|
24
|
+
(p / q) * (length(xs) - 1);
|
25
|
+
|
26
|
+
if rank == floor(rank): nth(rank, xs)
|
27
|
+
else:
|
28
|
+
def x1: floor(rank)
|
29
|
+
def x2: ceiling(rank)
|
30
|
+
def left: nth(x1, xs)
|
31
|
+
def right: nth(x2, xs);
|
32
|
+
|
33
|
+
left + (rank - x1) * (right - left);
|
34
|
+
|
35
|
+
def findPercentile: findQuantile(100);
|
36
|
+
|
37
|
+
def accumBins(data, Nil): []
|
38
|
+
def accumBins(data, [l]): []
|
39
|
+
def accumBins(data, l :| r :| es):
|
40
|
+
def (ge, le):
|
41
|
+
splitOn((lambda x: x <= r), data);
|
42
|
+
|
43
|
+
(le, r - l) :| accumBins(ge, r :| es);
|
44
|
+
|
45
|
+
def cut(xs, nbins):
|
46
|
+
def low: minimum(xs)
|
47
|
+
def binwidth:
|
48
|
+
(maximum(xs) - low) / nbins
|
49
|
+
def edges:
|
50
|
+
[low + x * binwidth for x in enumFromTo(0, nbins)];
|
51
|
+
|
52
|
+
accumBins(xs, edges);
|
53
|
+
|
54
|
+
def qcut(xs, qs):
|
55
|
+
def (low, high):
|
56
|
+
(minimum(xs), maximum(xs))
|
57
|
+
def edges:
|
58
|
+
append((low :| [findPercentile(x, xs) for x in qs], [high]));
|
59
|
+
|
60
|
+
accumBins(xs, edges);
|
61
|
+
|
62
|
+
def likelihoodLE(xs, target):
|
63
|
+
length(filter((lambda x: x <= target), xs)) / length(xs);
|
64
|
+
|
65
|
+
def likelihoodGE(xs, target):
|
66
|
+
length(filter((lambda x: x >= target), xs)) / length(xs);
|
67
|
+
|
68
|
+
def likelihoodMap(table, prob):
|
69
|
+
fromSome(find((lambda x: x.prob <= prob), table)).msg;
|
70
|
+
|
71
|
+
def mkPercent(num):
|
72
|
+
numToStr(num * 100) ++ "%";
|
73
|
+
|
74
|
+
def leqP(n, m):
|
75
|
+
if n <= m: "less"
|
76
|
+
else: "more";
|
77
|
+
|
78
|
+
def gradedLeqP(n, m):
|
79
|
+
def ratio: n / m;
|
80
|
+
|
81
|
+
if ratio <= 1.0:
|
82
|
+
if ratio <= 0.5: "much less"
|
83
|
+
else: "less"
|
84
|
+
else:
|
85
|
+
if ratio >= 2.0: "much more"
|
86
|
+
else: "more";
|