@explorable-viz/fluid 0.7.63 → 0.7.65
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/fluid/fluid/lib/graphics.fld +6 -6
- package/dist/fluid/shared/fluid.mjs +4 -3
- package/dist/fluid/shared/load-figure.js +338 -168
- package/package.json +3 -2
- package/script/bundle-website.sh +5 -2
- package/dist/fluid/fluid/dataset/methane-emissions.fld +0 -123
- package/dist/fluid/fluid/dataset/mini-non-renewables.fld +0 -3
- package/dist/fluid/fluid/dataset/mini-renewables.fld +0 -6
- package/dist/fluid/fluid/dataset/non-renewables.fld +0 -67
- package/dist/fluid/fluid/dataset/renewables-new.fld +0 -301
- package/dist/fluid/fluid/dataset/renewables-restricted.fld +0 -139
- package/dist/fluid/fluid/dataset/renewables.fld +0 -100
- package/dist/fluid/fluid/dataset/ssp126-2081-2100.fld +0 -194
- package/dist/fluid/fluid/example/arithmetic.fld +0 -1
- package/dist/fluid/fluid/example/array.fld +0 -2
- package/dist/fluid/fluid/example/compose.fld +0 -2
- package/dist/fluid/fluid/example/desugar/list-comp-1.fld +0 -1
- package/dist/fluid/fluid/example/desugar/list-comp-10.fld +0 -1
- package/dist/fluid/fluid/example/desugar/list-comp-2.fld +0 -1
- package/dist/fluid/fluid/example/desugar/list-comp-3.fld +0 -1
- package/dist/fluid/fluid/example/desugar/list-comp-4.fld +0 -1
- package/dist/fluid/fluid/example/desugar/list-comp-5.fld +0 -1
- package/dist/fluid/fluid/example/desugar/list-comp-6.fld +0 -1
- package/dist/fluid/fluid/example/desugar/list-comp-7.fld +0 -1
- package/dist/fluid/fluid/example/desugar/list-comp-8.fld +0 -1
- package/dist/fluid/fluid/example/desugar/list-comp-9.fld +0 -1
- package/dist/fluid/fluid/example/desugar/list-enum.fld +0 -1
- package/dist/fluid/fluid/example/dict-list-comp.fld +0 -1
- package/dist/fluid/fluid/example/dicts.fld +0 -10
- package/dist/fluid/fluid/example/div-mod-quot-rem.fld +0 -4
- package/dist/fluid/fluid/example/factorial.fld +0 -6
- package/dist/fluid/fluid/example/filter.fld +0 -1
- package/dist/fluid/fluid/example/first-class-constr.fld +0 -1
- package/dist/fluid/fluid/example/flatten.fld +0 -12
- package/dist/fluid/fluid/example/foldr-sumSquares.fld +0 -1
- package/dist/fluid/fluid/example/graphics/background.fld +0 -7
- package/dist/fluid/fluid/example/graphics/grouped-bar-chart.fld +0 -9
- package/dist/fluid/fluid/example/graphics/line-chart.fld +0 -13
- package/dist/fluid/fluid/example/graphics/stacked-bar-chart.fld +0 -3
- package/dist/fluid/fluid/example/include-input-into-output.fld +0 -1
- package/dist/fluid/fluid/example/length.fld +0 -1
- package/dist/fluid/fluid/example/lexicalScoping.fld +0 -3
- package/dist/fluid/fluid/example/lib/some-constants.fld +0 -1
- package/dist/fluid/fluid/example/linked-inputs/energyscatter.fld +0 -23
- package/dist/fluid/fluid/example/linked-inputs/mini-energyscatter.fld +0 -29
- package/dist/fluid/fluid/example/linked-outputs/convolution-data.fld +0 -5
- package/dist/fluid/fluid/example/linked-outputs/convolution.fld +0 -12
- package/dist/fluid/fluid/example/linked-outputs/line-chart.fld +0 -15
- package/dist/fluid/fluid/example/linked-outputs/moving-average.fld +0 -19
- package/dist/fluid/fluid/example/linked-outputs/pairs-data.fld +0 -1
- package/dist/fluid/fluid/example/lookup.fld +0 -15
- package/dist/fluid/fluid/example/map.fld +0 -1
- package/dist/fluid/fluid/example/mergeSort.fld +0 -22
- package/dist/fluid/fluid/example/normalise.fld +0 -3
- package/dist/fluid/fluid/example/nub.fld +0 -1
- package/dist/fluid/fluid/example/pattern-match.fld +0 -12
- package/dist/fluid/fluid/example/percent.fld +0 -1
- package/dist/fluid/fluid/example/plot/methane.fld +0 -14
- package/dist/fluid/fluid/example/plot/non-renewables.fld +0 -21
- package/dist/fluid/fluid/example/range.fld +0 -4
- package/dist/fluid/fluid/example/record-lookup.fld +0 -3
- package/dist/fluid/fluid/example/records.expect.fld +0 -0
- package/dist/fluid/fluid/example/records.fld +0 -11
- package/dist/fluid/fluid/example/reverse.fld +0 -1
- package/dist/fluid/fluid/example/scratchpad.fld +0 -6
- package/dist/fluid/fluid/example/slicing/add.expect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/add.fld +0 -1
- package/dist/fluid/fluid/example/slicing/array/array.expect.fld +0 -2
- package/dist/fluid/fluid/example/slicing/array/array.fld +0 -4
- package/dist/fluid/fluid/example/slicing/array/dims.expect.fld +0 -3
- package/dist/fluid/fluid/example/slicing/array/dims.fld +0 -3
- package/dist/fluid/fluid/example/slicing/array/lookup.expect.fld +0 -3
- package/dist/fluid/fluid/example/slicing/array/lookup.fld +0 -5
- package/dist/fluid/fluid/example/slicing/array/renewables.fld +0 -100
- package/dist/fluid/fluid/example/slicing/convolution/edgeDetect.expect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/convolution/edgeDetect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/convolution/emboss-wrap.fld +0 -1
- package/dist/fluid/fluid/example/slicing/convolution/emboss.expect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/convolution/emboss.fld +0 -1
- package/dist/fluid/fluid/example/slicing/convolution/filter/edge-detect.fld +0 -5
- package/dist/fluid/fluid/example/slicing/convolution/filter/emboss.fld +0 -5
- package/dist/fluid/fluid/example/slicing/convolution/filter/gaussian.fld +0 -5
- package/dist/fluid/fluid/example/slicing/convolution/gaussian.expect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/convolution/gaussian.fld +0 -1
- package/dist/fluid/fluid/example/slicing/convolution/test-image.fld +0 -7
- package/dist/fluid/fluid/example/slicing/dict/create.expect.fld +0 -2
- package/dist/fluid/fluid/example/slicing/dict/create.fld +0 -1
- package/dist/fluid/fluid/example/slicing/dict/difference.expect.fld +0 -4
- package/dist/fluid/fluid/example/slicing/dict/difference.fld +0 -3
- package/dist/fluid/fluid/example/slicing/dict/disjointUnion.expect.fld +0 -2
- package/dist/fluid/fluid/example/slicing/dict/disjointUnion.fld +0 -1
- package/dist/fluid/fluid/example/slicing/dict/foldl.expect.fld +0 -3
- package/dist/fluid/fluid/example/slicing/dict/foldl.fld +0 -1
- package/dist/fluid/fluid/example/slicing/dict/get.expect.fld +0 -5
- package/dist/fluid/fluid/example/slicing/dict/get.fld +0 -3
- package/dist/fluid/fluid/example/slicing/dict/intersectionWith.expect.fld +0 -5
- package/dist/fluid/fluid/example/slicing/dict/intersectionWith.fld +0 -4
- package/dist/fluid/fluid/example/slicing/dict/map.expect.fld +0 -8
- package/dist/fluid/fluid/example/slicing/dict/map.fld +0 -5
- package/dist/fluid/fluid/example/slicing/dict/match.expect.fld +0 -6
- package/dist/fluid/fluid/example/slicing/dict/match.fld +0 -5
- package/dist/fluid/fluid/example/slicing/divide.expect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/divide.fld +0 -1
- package/dist/fluid/fluid/example/slicing/dtw/average-series.expect.fld +0 -8
- package/dist/fluid/fluid/example/slicing/dtw/average-series.fld +0 -8
- package/dist/fluid/fluid/example/slicing/dtw/compute-dtw.expect.fld +0 -6
- package/dist/fluid/fluid/example/slicing/dtw/compute-dtw.fld +0 -6
- package/dist/fluid/fluid/example/slicing/explained.expect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/explained.fld +0 -1
- package/dist/fluid/fluid/example/slicing/filter.expect.fld +0 -4
- package/dist/fluid/fluid/example/slicing/filter.fld +0 -6
- package/dist/fluid/fluid/example/slicing/intersperse-1.expect.fld +0 -4
- package/dist/fluid/fluid/example/slicing/intersperse-2.expect.fld +0 -4
- package/dist/fluid/fluid/example/slicing/intersperse.fld +0 -5
- package/dist/fluid/fluid/example/slicing/length.expect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/length.fld +0 -1
- package/dist/fluid/fluid/example/slicing/linked-outputs/bar-chart-line-chart.expect.fld +0 -0
- package/dist/fluid/fluid/example/slicing/linked-outputs/bar-chart-line-chart.fld +0 -29
- package/dist/fluid/fluid/example/slicing/linked-outputs/stacked-bar-scatter-plot.expect.fld +0 -0
- package/dist/fluid/fluid/example/slicing/linked-outputs/stacked-bar-scatter-plot.fld +0 -38
- package/dist/fluid/fluid/example/slicing/list-comp-1.expect.fld +0 -6
- package/dist/fluid/fluid/example/slicing/list-comp-2.expect.fld +0 -6
- package/dist/fluid/fluid/example/slicing/list-comp.fld +0 -8
- package/dist/fluid/fluid/example/slicing/lookup.expect.fld +0 -6
- package/dist/fluid/fluid/example/slicing/lookup.fld +0 -14
- package/dist/fluid/fluid/example/slicing/map.expect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/map.fld +0 -1
- package/dist/fluid/fluid/example/slicing/matrix-update.expect.fld +0 -5
- package/dist/fluid/fluid/example/slicing/matrix-update.fld +0 -10
- package/dist/fluid/fluid/example/slicing/multiply.expect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/multiply.fld +0 -1
- package/dist/fluid/fluid/example/slicing/nth.expect.fld +0 -1
- package/dist/fluid/fluid/example/slicing/nth.fld +0 -1
- package/dist/fluid/fluid/example/slicing/output-not-source.expect.fld +0 -2
- package/dist/fluid/fluid/example/slicing/output-not-source.fld +0 -1
- package/dist/fluid/fluid/example/slicing/qcut.expect.fld +0 -0
- package/dist/fluid/fluid/example/slicing/qcut.fld +0 -2
- package/dist/fluid/fluid/example/slicing/section-5-example-1.expect.fld +0 -10
- package/dist/fluid/fluid/example/slicing/section-5-example-2.expect.fld +0 -10
- package/dist/fluid/fluid/example/slicing/section-5-example-3.expect.fld +0 -10
- package/dist/fluid/fluid/example/slicing/section-5-example.fld +0 -14
- package/dist/fluid/fluid/example/slicing/zeros-1.expect.fld +0 -3
- package/dist/fluid/fluid/example/slicing/zeros-2.expect.fld +0 -3
- package/dist/fluid/fluid/example/slicing/zeros.fld +0 -4
- package/dist/fluid/fluid/example/slicing/zipWith-1.expect.fld +0 -4
- package/dist/fluid/fluid/example/slicing/zipWith.fld +0 -4
- package/dist/fluid/fluid/example/text-viz/datasets/ssp126.fld +0 -898
- package/dist/fluid/fluid/example/text-viz/datasets/ssp245.fld +0 -954
- package/dist/fluid/fluid/example/text-viz/datasets/ssp370.fld +0 -842
- package/dist/fluid/fluid/example/text-viz/datasets/ssp585.fld +0 -954
- package/dist/fluid/fluid/example/text-viz/explainable-table.fld +0 -7
- package/dist/fluid/fluid/example/text-viz/fake-probabilities.fld +0 -3
- package/dist/fluid/fluid/example/text-viz/figure-spm-4.fld +0 -42
- package/dist/fluid/fluid/example/text-viz/left-barchart-table.fld +0 -5
- package/dist/fluid/fluid/example/text-viz/likelihoods.fld +0 -9
- package/dist/fluid/fluid/example/text-viz/right-barchart-table.fld +0 -5
- package/dist/fluid/fluid/example/text-viz/table-spm-1.fld +0 -30
@@ -1,38 +0,0 @@
|
|
1
|
-
MultiView {
|
2
|
-
stackedBarChart:
|
3
|
-
let totalFor year country rows =
|
4
|
-
let [ row ] = [ row | row <- rows, row.year == year, row.country == country ]
|
5
|
-
in row.nuclearOut + row.gasOut + row.coalOut + row.petrolOut;
|
6
|
-
let stack year = [ { y: country, z: totalFor year country nonRenewables }
|
7
|
-
| country <- ["BRA", "EGY", "IND", "JPN"] ]
|
8
|
-
in BarChart {
|
9
|
-
caption: "Non-renewables by country",
|
10
|
-
size: { width: 275, height: 185 },
|
11
|
-
stackedBars: [ { x: numToStr year, bars: stack year }
|
12
|
-
| year <- [2014..2018] ]
|
13
|
-
},
|
14
|
-
scatterPlot:
|
15
|
-
let isCountry name x = name == x.country;
|
16
|
-
isYear year x = year == x.year;
|
17
|
-
|
18
|
-
let plot year countries =
|
19
|
-
let rens = filter (isYear year) renewables;
|
20
|
-
nonRens = filter (isYear year) nonRenewables;
|
21
|
-
let plotCountry country =
|
22
|
-
let rens' = filter (isCountry country) rens;
|
23
|
-
rensOut = sum (map (fun x -> x.output) rens');
|
24
|
-
rensCap = sum (map (fun x -> x.capacity) rens');
|
25
|
-
x = head (filter (isCountry country) nonRens);
|
26
|
-
nonRensCap = x.nuclearCap + x.petrolCap + x.gasCap + x.coalCap
|
27
|
-
in {
|
28
|
-
x: rensCap / (rensCap + nonRensCap),
|
29
|
-
y: (rensOut + x.nuclearOut) / (rensCap + x.nuclearCap)
|
30
|
-
}
|
31
|
-
in map plotCountry countries
|
32
|
-
|
33
|
-
in ScatterPlot {
|
34
|
-
caption: "Clean energy efficiency vs proportion of renewable energy capacity",
|
35
|
-
points: plot 2018 [ "BRA", "CHN", "DEU", "FRA", "EGY", "IND", "JPN", "MEX", "NGA", "USA" ],
|
36
|
-
labels: { x: "Renewables/TotalEnergyCap", y: "Clean Capacity Factor" }
|
37
|
-
}
|
38
|
-
}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
let data = [{year : 2013, country : "China", energyType : "Bio", output : 6.2}
|
2
|
-
, {year : 2013, country : "China", energyType : ⸨"Hydro"⸩, output : 260}
|
3
|
-
, {year : 2013, country : "China", energyType : "Solar", output : 19.9}
|
4
|
-
, {year : 2013, country : "China", energyType : "Wind", output : 91}
|
5
|
-
] in
|
6
|
-
⸨[row.output|type <- ["Bio", ⸨"Hydro"⸩, "Solar", "Wind"], row <- data, row.energyType == type]⸩
|
@@ -1,6 +0,0 @@
|
|
1
|
-
let data = [{year : 2013, country : "China", energyType : "Bio", output : 6.2}
|
2
|
-
, {year : 2013, country : "China", energyType : "Hydro", output : 260}
|
3
|
-
, {year : 2013, country : "China", energyType : ⸨"Solar"⸩, output : 19.9}
|
4
|
-
, {year : 2013, country : "China", energyType : "Wind", output : 91}
|
5
|
-
] in
|
6
|
-
⸨[row.output|type <- ["Bio", "Hydro", ⸨"Solar"⸩, "Wind"], row <- data, row.energyType == type]⸩
|
@@ -1,8 +0,0 @@
|
|
1
|
-
let data = [
|
2
|
-
{ year: 2013, country: "China", energyType: "Bio", output: 6.2 },
|
3
|
-
{ year: 2013, country: "China", energyType: "Hydro", output: 260 },
|
4
|
-
{ year: 2013, country: "China", energyType: "Solar", output: 19.9 },
|
5
|
-
{ year: 2013, country: "China", energyType: "Wind", output: 91 }
|
6
|
-
] in
|
7
|
-
[ row.output | type <- ["Bio", "Hydro", "Solar", "Wind"],
|
8
|
-
row <- data, row.energyType == type ]
|
@@ -1,6 +0,0 @@
|
|
1
|
-
let lookup k (Empty) = None;
|
2
|
-
lookup k (NonEmpty t1 (key, val) t2) = match compare k key as
|
3
|
-
{(LT) -> lookup k t1;
|
4
|
-
(EQ) -> ⸨Some val⸩;
|
5
|
-
(GT) -> lookup k t2} in
|
6
|
-
lookup ⸨6⸩ (NonEmpty (NonEmpty (Empty) ((3, "USA")) (Empty)) ((4, "China")) (NonEmpty (⸨NonEmpty (Empty) (⸨(⸨6⸩, "Germany")⸩) (Empty)⸩) ((7, "UK")) (Empty)))
|
@@ -1,14 +0,0 @@
|
|
1
|
-
let lookup k Empty = None;
|
2
|
-
lookup k (NonEmpty t1 (key, val) t2) =
|
3
|
-
match compare k key as {
|
4
|
-
LT -> lookup k t1;
|
5
|
-
EQ -> Some val;
|
6
|
-
GT -> lookup k t2
|
7
|
-
}
|
8
|
-
in
|
9
|
-
lookup 6
|
10
|
-
(NonEmpty
|
11
|
-
(NonEmpty Empty (3, "USA") Empty)
|
12
|
-
(4, "China")
|
13
|
-
(NonEmpty (NonEmpty Empty (6, "Germany") Empty) (7, "UK") Empty)
|
14
|
-
)
|
@@ -1 +0,0 @@
|
|
1
|
-
map ((+) 2) ⸨[⸩ 3 ⸨,⸩ 4]
|
@@ -1 +0,0 @@
|
|
1
|
-
map ((+) 2) [3, 4]
|
@@ -1 +0,0 @@
|
|
1
|
-
5 * (⸨0⸩ * 3)
|
@@ -1 +0,0 @@
|
|
1
|
-
5 * (0 * 3)
|
@@ -1 +0,0 @@
|
|
1
|
-
nth 1 [3, ⸨4⸩, 5]
|
@@ -1 +0,0 @@
|
|
1
|
-
nth 1 [3, 4, 5]
|
@@ -1 +0,0 @@
|
|
1
|
-
let x = 3 in (x, x < 5)
|
File without changes
|
@@ -1,10 +0,0 @@
|
|
1
|
-
let map f [] = [];
|
2
|
-
map f (x : xs) = ⸨(f x : map f xs)⸩ in
|
3
|
-
let data = [{energyType : "Bio", output : 6.2}
|
4
|
-
, {energyType : ⸨"Hydro"⸩, output : 260}
|
5
|
-
, {energyType : "Solar", output : 19.9}
|
6
|
-
, {energyType : "Wind", output : 91}
|
7
|
-
, {energyType : "Geo", output : 14.4}
|
8
|
-
];
|
9
|
-
output = ⸨[row.output|type <- [⸨"Hydro"⸩, "Solar", "Geo"], row <- data, row.energyType == type]⸩ in
|
10
|
-
map (fun x = floor ((x / sum output) * 100)) output
|
@@ -1,10 +0,0 @@
|
|
1
|
-
let map f [] = [];
|
2
|
-
map f (x : xs) = (f x : map f xs) in
|
3
|
-
let data = [{energyType : "Bio", output : 6.2}
|
4
|
-
, {energyType : "Hydro", output : ⸨260⸩}
|
5
|
-
, {energyType : "Solar", output : ⸨19.9⸩}
|
6
|
-
, {energyType : "Wind", output : 91}
|
7
|
-
, {energyType : "Geo", output : ⸨14.4⸩}
|
8
|
-
];
|
9
|
-
output = [row.output|type <- ["Hydro", "Solar", "Geo"], row <- data, row.energyType == type] in
|
10
|
-
map (fun x = floor ((x / sum output) * ⸨100⸩)) output
|
@@ -1,10 +0,0 @@
|
|
1
|
-
let map f [] = [];
|
2
|
-
map f (x : xs) = ⸨(f x : map f xs)⸩ in
|
3
|
-
let data = [{energyType : "Bio", output : 6.2}
|
4
|
-
, {energyType : "Hydro", output : 260}
|
5
|
-
, {energyType : "Solar", output : 19.9}
|
6
|
-
, {energyType : "Wind", output : 91}
|
7
|
-
, {energyType : ⸨"Geo"⸩, output : 14.4}
|
8
|
-
];
|
9
|
-
output = ⸨[row.output|type <- ["Hydro", "Solar", ⸨"Geo"⸩], row <- data, row.energyType == type]⸩ in
|
10
|
-
map (fun x = floor ((x / sum output) * 100)) output
|
@@ -1,14 +0,0 @@
|
|
1
|
-
let map f [] = [];
|
2
|
-
map f (x : xs) = f x : map f xs;
|
3
|
-
let data = [
|
4
|
-
{ energyType: "Bio", output: 6.2 },
|
5
|
-
{ energyType: "Hydro", output: 260 },
|
6
|
-
{ energyType: "Solar", output: 19.9 },
|
7
|
-
{ energyType: "Wind", output: 91 },
|
8
|
-
{ energyType: "Geo", output: 14.4 }
|
9
|
-
];
|
10
|
-
output = [
|
11
|
-
row.output | type <- ["Hydro", "Solar", "Geo"],
|
12
|
-
row <- data, row.energyType == type
|
13
|
-
] in
|
14
|
-
map (fun x -> floor (x / sum output * 100)) output
|