@explorable-viz/fluid 0.7.61 → 0.7.63

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
+ }
@@ -19,6 +19,5 @@ let plot year countries =
19
19
  in ScatterPlot {
20
20
  caption: "Clean energy efficiency vs. proportion of renewable energy capacity",
21
21
  points: plot 2018 [ "BRA", "CHN", "DEU", "FRA", "EGY", "IND", "JPN", "MEX", "NGA", "USA" ],
22
- xlabel: "Renewables/TotalEnergyCap",
23
- ylabel: "Clean Capacity Factor"
22
+ labels: { x: "Renewables/TotalEnergyCap", y: "Clean Capacity Factor" }
24
23
  }
@@ -25,6 +25,5 @@ in ScatterPlot {
25
25
  x: country.nonRenewables / country.totalCap,
26
26
  y: country.renCapFactor
27
27
  }| country <- energy 2018 ["USA"]],
28
- xlabel: "Renewables/TotalEnergyCap",
29
- ylabel: "Clean Capacity Factor"
28
+ labels: { x: "Renewables/TotalEnergyCap", y: "Clean Capacity Factor" }
30
29
  }
@@ -2,8 +2,8 @@ let countries = ["BRA", "EGY", "IND", "JPN"];
2
2
  let totalFor year country =
3
3
  let [ row ] = [ row | row <- nonRenewables, row.year == year, row.country == country ]
4
4
  in row.nuclearOut + row.gasOut + row.coalOut + row.petrolOut;
5
- stack year = [ { y: country, z: totalFor year country } | country <- countries ];
6
- yearData year = [ row | row <- nonRenewables, row.year == year, row.country `elem` countries ]
5
+ let stack year = [ { y: country, z: totalFor year country } | country <- countries ];
6
+ let yearData year = [ row | row <- nonRenewables, row.year == year, row.country `elem` countries ]
7
7
  in MultiView {
8
8
  barChart: BarChart {
9
9
  caption: "Non-renewables output",
@@ -16,7 +16,6 @@ in MultiView {
16
16
  x: sum [ row.nuclearOut | row <- yearData year ],
17
17
  y: sum [ row.nuclearCap | row <- yearData year ]
18
18
  } | year <- [2014..2018] ],
19
- xlabel: "Nuclear capacity",
20
- ylabel: "Nuclear output"
19
+ labels: { x: "Nuclear capacity", y: "Nuclear output" }
21
20
  }
22
21
  }
@@ -33,7 +33,6 @@ MultiView {
33
33
  in ScatterPlot {
34
34
  caption: "Clean energy efficiency vs proportion of renewable energy capacity",
35
35
  points: plot 2018 [ "BRA", "CHN", "DEU", "FRA", "EGY", "IND", "JPN", "MEX", "NGA", "USA" ],
36
- xlabel: "Renewables/TotalEnergyCap",
37
- ylabel: "Clean Capacity Factor"
36
+ labels: { x: "Renewables/TotalEnergyCap", y: "Clean Capacity Factor" }
38
37
  }
39
38
  }
@@ -2,15 +2,15 @@ let zero n = const n;
2
2
  wrap n n_max = ((n - 1) `mod` n_max) + 1;
3
3
  extend n = min (max n 1);
4
4
 
5
- let convolve image kernel method =
5
+ let convolve image kernel boundary =
6
6
  let ((m, n), (i, j)) = (dims image, dims kernel);
7
7
  (half_i, half_j) = (i `quot` 2, j `quot` 2);
8
8
  area = i * j
9
9
  in [| let weightedSum = sum [
10
10
  image!(x, y) * kernel!(i' + 1, j' + 1)
11
11
  | (i', j') <- range (0, 0) (i - 1, j - 1),
12
- let x = method (m' + i' - half_i) m,
13
- let y = method (n' + j' - half_j) n,
12
+ let x = boundary (m' + i' - half_i) m,
13
+ let y = boundary (n' + j' - half_j) n,
14
14
  x >= 1, x <= m, y >= 1, y <= n
15
15
  ] in weightedSum `quot` area
16
16
  | (m', n') in (m, n) |];
@@ -222,6 +222,15 @@ var applyMaybe = {
222
222
  },
223
223
  Functor0: () => functorMaybe
224
224
  };
225
+ var altMaybe = {
226
+ alt: (v) => (v1) => {
227
+ if (v.tag === "Nothing") {
228
+ return v1;
229
+ }
230
+ return v;
231
+ },
232
+ Functor0: () => functorMaybe
233
+ };
225
234
 
226
235
  // output-es/Data.Either/index.js
227
236
  var $Either = (tag, _1) => ({ tag, _1 });
@@ -10170,8 +10179,7 @@ var dataTypes = /* @__PURE__ */ foldrArray(Cons)(Nil)([
10170
10179
  /* @__PURE__ */ $Tuple("Viewport", 9)
10171
10180
  ]),
10172
10181
  /* @__PURE__ */ dataType("Transform")([/* @__PURE__ */ $Tuple("Scale", 2), /* @__PURE__ */ $Tuple("Translate", 2)]),
10173
- /* @__PURE__ */ dataType("Marker")([/* @__PURE__ */ $Tuple("Arrowhead", 0)]),
10174
- /* @__PURE__ */ dataType("Explanation")([/* @__PURE__ */ $Tuple("Explained", 2)])
10182
+ /* @__PURE__ */ dataType("Marker")([/* @__PURE__ */ $Tuple("Arrowhead", 0)])
10175
10183
  ]);
10176
10184
  var ctrToDataType = /* @__PURE__ */ (() => fromFoldable2(foldableList)(bindList.bind(listMap((d) => listMap((v) => $Tuple(
10177
10185
  v,
@@ -24822,7 +24830,7 @@ var parse = (dictMonadError) => {
24822
24830
  };
24823
24831
  };
24824
24832
  };
24825
- var parseProgram = (loadFile2) => (folder) => (file) => (dictMonadAff) => (dictMonadError) => dictMonadAff.MonadEffect0().Monad0().Bind1().bind(loadFile2(folder)(file)(dictMonadAff)(dictMonadError))((() => {
24833
+ var parseProgram = (loadFile2) => (folders) => (file) => (dictMonadAff) => (dictMonadError) => dictMonadAff.MonadEffect0().Monad0().Bind1().bind(loadFile2(folders)(file)(dictMonadAff)(dictMonadError))((() => {
24826
24834
  const $0 = parse(dictMonadError);
24827
24835
  return (a) => $0(a)(topLevel(expr_));
24828
24836
  })());
@@ -24833,9 +24841,9 @@ var module_2 = (dictMonadAff) => {
24833
24841
  return (dictMonadError) => {
24834
24842
  const parse1 = parse(dictMonadError);
24835
24843
  const desugarModuleFwd = moduleFwd(dictMonadError)(boundedLattice2);
24836
- return (loadFile2) => (folder) => (file) => (v) => {
24844
+ return (loadFile2) => (folders) => (file) => (v) => {
24837
24845
  const $0 = v.mods;
24838
- return Bind1.bind(Applicative0.pure())(() => Bind1.bind(loadFile2(folder)(file)(dictMonadAff)(dictMonadError))((src) => Bind1.bind(Bind1.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Applicative0.pure({
24846
+ return Bind1.bind(Applicative0.pure())(() => Bind1.bind(loadFile2(folders)(file)(dictMonadAff)(dictMonadError))((src) => Bind1.bind(Bind1.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Applicative0.pure({
24839
24847
  primitives: v.primitives,
24840
24848
  mods: $List("Cons", mod, $0),
24841
24849
  datasets: v.datasets
@@ -24873,7 +24881,7 @@ var prepConfig = (dictMonadAff) => {
24873
24881
  return (dictMonadError) => {
24874
24882
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
24875
24883
  const initialConfig1 = initialConfig(dictMonadError)(fVExpr);
24876
- return (v) => (file) => (progCxt) => $0.bind(parseProgram(v.loadFile)(v.fluidSrcPath)(file)(dictMonadAff)(dictMonadError))((s) => $0.bind(desug1(s))((e) => $0.bind(initialConfig1(e)(progCxt))((gconfig) => Monad0.Applicative0().pure({
24884
+ return (v) => (file) => (progCxt) => $0.bind(parseProgram(v.loadFile)(v.fluidSrcPaths)(file)(dictMonadAff)(dictMonadError))((s) => $0.bind(desug1(s))((e) => $0.bind(initialConfig1(e)(progCxt))((gconfig) => Monad0.Applicative0().pure({
24877
24885
  s,
24878
24886
  e,
24879
24887
  gconfig
@@ -24885,10 +24893,10 @@ var datasetAs = (dictMonadAff) => {
24885
24893
  const $0 = Monad0.Bind1();
24886
24894
  return (dictMonadError) => {
24887
24895
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
24888
- return (loadFile2) => (folder) => (v) => (v1) => {
24896
+ return (loadFile2) => (folders) => (v) => (v1) => {
24889
24897
  const $1 = v1.datasets;
24890
24898
  const $2 = v._1;
24891
- return $0.bind($0.bind(parseProgram(loadFile2)(folder)(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
24899
+ return $0.bind($0.bind(parseProgram(loadFile2)(folders)(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
24892
24900
  primitives: v1.primitives,
24893
24901
  mods: v1.mods,
24894
24902
  datasets: $List("Cons", $Tuple($2, e\u03B1), $1)
@@ -24909,8 +24917,8 @@ var loadProgCxt = (dictMonadAff) => {
24909
24917
  primitives,
24910
24918
  mods: Nil,
24911
24919
  datasets: Nil
24912
- }))(concatM1(arrayMap(module_22(v.loadFile)(v.fluidSrcPath))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
24913
- const $1 = datasetAs2(v.loadFile)(v.fluidSrcPath);
24920
+ }))(concatM1(arrayMap(module_22(v.loadFile)(v.fluidSrcPaths))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
24921
+ const $1 = datasetAs2(v.loadFile)(v.fluidSrcPaths);
24914
24922
  return (x) => $1($Tuple(x._1, x._2));
24915
24923
  })())(datasets)));
24916
24924
  };
@@ -25051,8 +25059,19 @@ var readTextFile = (encoding) => (file) => (cb) => {
25051
25059
  };
25052
25060
  return () => readFile(file, $0, handleCallback(cb));
25053
25061
  };
25062
+ var stat2 = (file) => (cb) => () => stat(file, handleCallback(cb));
25054
25063
 
25055
25064
  // output-es/Node.FS.Aff/index.js
25065
+ var toAff1 = (f) => (a) => {
25066
+ const $0 = f(a);
25067
+ return makeAff((k) => {
25068
+ const $1 = $0(k);
25069
+ return () => {
25070
+ $1();
25071
+ return nonCanceler;
25072
+ };
25073
+ });
25074
+ };
25056
25075
  var toAff2 = (f) => (a) => (b) => {
25057
25076
  const $0 = f(a)(b);
25058
25077
  return makeAff((k) => {
@@ -25064,23 +25083,48 @@ var toAff2 = (f) => (a) => (b) => {
25064
25083
  });
25065
25084
  };
25066
25085
 
25086
+ // output-es/Foreign/foreign.js
25087
+ var isArray = Array.isArray || function(value) {
25088
+ return Object.prototype.toString.call(value) === "[object Array]";
25089
+ };
25090
+
25091
+ // output-es/Node.FS.Stats/foreign.js
25092
+ var isFileImpl = (s) => s.isFile();
25093
+
25067
25094
  // output-es/Module.Node/index.js
25068
- var loadFile = (v) => (v1) => (dictMonadAff) => {
25095
+ var findM = (dictMonad) => {
25096
+ const $0 = dictMonad.Bind1().Apply0();
25097
+ return (dictFoldable) => (xs) => (f) => (base) => dictFoldable.foldr((x) => (acc) => $0.apply($0.Functor0().map(altMaybe.alt)(acc))(f(x)))(dictMonad.Applicative0().pure(base))(xs);
25098
+ };
25099
+ var loadFile = (folders) => (v) => (dictMonadAff) => {
25069
25100
  const Monad0 = dictMonadAff.MonadEffect0().Monad0();
25070
- return (dictMonadError) => Monad0.Bind1().bind(dictMonadAff.liftAff(toAff2(readTextFile)(UTF8)(v + "/" + v1 + ".fld")))((buffer) => Monad0.Applicative0().pure(buffer));
25101
+ const $0 = Monad0.Bind1();
25102
+ const findM1 = findM(Monad0)(foldableArray);
25103
+ return (dictMonadError) => $0.bind(findM1(arrayMap((() => {
25104
+ const $1 = v + ".fld";
25105
+ return (a) => a + "/" + $1;
25106
+ })())(folders))((v1) => $0.bind(dictMonadAff.liftAff(toAff1(stat2)(v1)))((stats) => Monad0.Applicative0().pure(isFileImpl(stats) ? $Maybe("Just", v1) : Nothing)))(Nothing))((url) => {
25107
+ if (url.tag === "Nothing") {
25108
+ return throwException(error("File " + v + " not found."))();
25109
+ }
25110
+ if (url.tag === "Just") {
25111
+ return dictMonadAff.liftAff(toAff2(readTextFile)(ASCII)(url._1));
25112
+ }
25113
+ fail();
25114
+ });
25071
25115
  };
25072
25116
  var loadProgCxt2 = (dictMonadAff) => {
25073
25117
  const loadProgCxt1 = loadProgCxt(dictMonadAff);
25074
25118
  return (dictMonadError) => {
25075
25119
  const loadProgCxt22 = loadProgCxt1(dictMonadError);
25076
- return (fluidSrcPath) => loadProgCxt22({ loadFile, fluidSrcPath });
25120
+ return (fluidSrcPaths) => loadProgCxt22({ loadFile, fluidSrcPaths });
25077
25121
  };
25078
25122
  };
25079
25123
  var prepConfig2 = (dictMonadAff) => {
25080
25124
  const prepConfig1 = prepConfig(dictMonadAff);
25081
25125
  return (dictMonadError) => {
25082
25126
  const prepConfig22 = prepConfig1(dictMonadError);
25083
- return (fluidSrcPath) => prepConfig22({ loadFile, fluidSrcPath });
25127
+ return (fluidSrcPaths) => prepConfig22({ loadFile, fluidSrcPaths });
25084
25128
  };
25085
25129
  };
25086
25130
 
@@ -28399,7 +28443,8 @@ var parseImports = /* @__PURE__ */ $Parser(
28399
28443
  );
28400
28444
  var evaluate = (v) => {
28401
28445
  const $0 = v._1.fileName;
28402
- return _bind(loadProgCxt3("fluid")(v._1.imports)(v._1.datasets))((progCxt) => _bind(prepConfig3("fluid")($0)(progCxt))((v1) => _bind(graphEval2(v1.gconfig)(v1.e))((v2) => _pure($Val(
28446
+ const fluidSrcPaths = ["fluid"];
28447
+ return _bind(loadProgCxt3(fluidSrcPaths)(v._1.imports)(v._1.datasets))((progCxt) => _bind(prepConfig3(fluidSrcPaths)($0)(progCxt))((v1) => _bind(graphEval2(v1.gconfig)(v1.e))((v2) => _pure($Val(
28403
28448
  void 0,
28404
28449
  functorBaseVal.map((v$1) => {
28405
28450
  })(v2["out\u03B1"]._2)
@@ -28437,8 +28482,8 @@ var dispatchCommand = (v) => {
28437
28482
  return _bind(evaluate(v._1))((v1) => _liftEffect(log(intercalate4("\n")(removeDocWS(prettyVal(highlightableUnit).pretty(v1)).lines))));
28438
28483
  }
28439
28484
  if (v.tag === "Publish") {
28440
- return _bind(_map((v$1) => {
28441
- })(_liftEffect(publish(v._1)(v._2))))(() => _liftEffect(log("Published")));
28485
+ return _map((v$1) => {
28486
+ })(_liftEffect(publish(v._1)(v._2)));
28442
28487
  }
28443
28488
  fail();
28444
28489
  };
@@ -28447,7 +28492,8 @@ var callback = (v) => {
28447
28492
  return log(showErrorImpl(v._1));
28448
28493
  }
28449
28494
  if (v.tag === "Right") {
28450
- return log("Success");
28495
+ return () => {
28496
+ };
28451
28497
  }
28452
28498
  fail();
28453
28499
  };
@@ -290,6 +290,15 @@ var applyEither = {
290
290
  Functor0: () => functorEither
291
291
  };
292
292
  var applicativeEither = { pure: Right, Apply0: () => applyEither };
293
+ var altEither = {
294
+ alt: (v) => (v1) => {
295
+ if (v.tag === "Left") {
296
+ return v1;
297
+ }
298
+ return v;
299
+ },
300
+ Functor0: () => functorEither
301
+ };
293
302
 
294
303
  // output-es/Effect/foreign.js
295
304
  var pureE = function(a) {
@@ -1551,6 +1560,7 @@ var encode2 = /* @__PURE__ */ (() => {
1551
1560
  // output-es/Data.HTTP.Method/index.js
1552
1561
  var $Method = (tag) => tag;
1553
1562
  var GET = /* @__PURE__ */ $Method("GET");
1563
+ var HEAD = /* @__PURE__ */ $Method("HEAD");
1554
1564
  var print = (v2) => {
1555
1565
  if (v2.tag === "Left") {
1556
1566
  if (v2._1 === "OPTIONS") {
@@ -27787,8 +27797,7 @@ var dataTypes = /* @__PURE__ */ foldrArray(Cons)(Nil)([
27787
27797
  /* @__PURE__ */ $Tuple("Viewport", 9)
27788
27798
  ]),
27789
27799
  /* @__PURE__ */ dataType("Transform")([/* @__PURE__ */ $Tuple("Scale", 2), /* @__PURE__ */ $Tuple("Translate", 2)]),
27790
- /* @__PURE__ */ dataType("Marker")([/* @__PURE__ */ $Tuple("Arrowhead", 0)]),
27791
- /* @__PURE__ */ dataType("Explanation")([/* @__PURE__ */ $Tuple("Explained", 2)])
27800
+ /* @__PURE__ */ dataType("Marker")([/* @__PURE__ */ $Tuple("Arrowhead", 0)])
27792
27801
  ]);
27793
27802
  var ctrToDataType = /* @__PURE__ */ (() => fromFoldable(foldableList)(bindList.bind(listMap((d) => listMap((v) => $Tuple(
27794
27803
  v,
@@ -34840,7 +34849,6 @@ var forDefs = (\u03C1) => (\u03C3) => {
34840
34849
  };
34841
34850
 
34842
34851
  // output-es/Primitive/index.js
34843
- var $Explanation = (_1, _2, _3) => ({ tag: "Explanation", _1, _2, _3 });
34844
34852
  var fanin2 = /* @__PURE__ */ fanin(categoryFn)(choiceFn);
34845
34853
  var isZeroNumber = { isZero: ($0) => 0 === $0 };
34846
34854
  var isZeroInt = { isZero: ($0) => 0 === $0 };
@@ -34916,30 +34924,6 @@ var number5 = {
34916
34924
  return typeError(v)("Float");
34917
34925
  }
34918
34926
  };
34919
- var linkedTextEntry = {
34920
- pack: (v) => {
34921
- if (v.tag === "Left") {
34922
- return $BaseVal("Str", v._1);
34923
- }
34924
- if (v.tag === "Right") {
34925
- return $BaseVal(
34926
- "Constr",
34927
- "Explained",
34928
- $List("Cons", $Val(v._1._1, $BaseVal("Str", v._1._2)), $List("Cons", $Val(v._1._3._1, v._1._3._2), Nil))
34929
- );
34930
- }
34931
- fail();
34932
- },
34933
- unpack: (v) => {
34934
- if (v.tag === "Str") {
34935
- return $Either("Left", v._1);
34936
- }
34937
- if (v.tag === "Constr" && v._2.tag === "Cons" && v._2._1._2.tag === "Str" && v._2._2.tag === "Cons" && v._2._2._2.tag === "Nil" && v._1 === "Explained") {
34938
- return $Either("Right", $Explanation(v._2._2._1._1, v._2._1._2._1, v._2._2._1));
34939
- }
34940
- return typeError(v)("String or Explanation");
34941
- }
34942
- };
34943
34927
  var intOrNumberOrString = {
34944
34928
  pack: (v) => {
34945
34929
  if (v.tag === "Left") {
@@ -36593,7 +36577,19 @@ var reflectDictSelState\u{1D54A}$x215ValS3 = {
36593
36577
  })()
36594
36578
  })
36595
36579
  };
36596
- var reflectDictSelState\u{1D54A}$x215ValS12 = { from: () => (r) => ({ x: get_intOrNumber("x")(r), y: get_intOrNumber("y")(r) }) };
36580
+ var reflectDictSelState\u{1D54A}$x215ValS12 = {
36581
+ from: () => (r) => ({
36582
+ x: (() => {
36583
+ const $0 = $$get2(showString)(mapDictString)("x")(r);
36584
+ return $Tuple($0._2._2.tag === "Str" ? $0._2._2._1 : typeError($0._2._2)("Str"), $0._2._1);
36585
+ })(),
36586
+ y: (() => {
36587
+ const $0 = $$get2(showString)(mapDictString)("y")(r);
36588
+ return $Tuple($0._2._2.tag === "Str" ? $0._2._2._1 : typeError($0._2._2)("Str"), $0._2._1);
36589
+ })()
36590
+ })
36591
+ };
36592
+ var reflectDictSelState\u{1D54A}$x215ValS23 = { from: () => (r) => ({ x: get_intOrNumber("x")(r), y: get_intOrNumber("y")(r) }) };
36597
36593
 
36598
36594
  // output-es/App.View.LineChart/index.js
36599
36595
  var identity27 = (x2) => x2;
@@ -36622,7 +36618,7 @@ var reflectDictSelState\u{1D54A}$x215ValS4 = {
36622
36618
  const $0 = $$get2(showString)(mapDictString)("name")(r);
36623
36619
  return $Tuple($0._2._2.tag === "Str" ? $0._2._2._1 : typeError($0._2._2)("Str"), $0._2._1);
36624
36620
  })(),
36625
- points: arrayMap(dict(reflectDictSelState\u{1D54A}$x215ValS12.from()))(reflectValSelState\u{1D54A}ArrayV.from()($$get2(showString)(mapDictString)("points")(r)._2))
36621
+ points: arrayMap(dict(reflectDictSelState\u{1D54A}$x215ValS23.from()))(reflectValSelState\u{1D54A}ArrayV.from()($$get2(showString)(mapDictString)("points")(r)._2))
36626
36622
  })
36627
36623
  };
36628
36624
  var reflectValSelState\u{1D54A}LinePl = {
@@ -36897,114 +36893,84 @@ var drawableLineChart = {
36897
36893
  }
36898
36894
  };
36899
36895
 
36900
- // output-es/App.View.LinkedText/foreign.js
36901
- selection_default.prototype.attrs = function(m) {
36902
- for (const k in m) {
36903
- this.attr(k, m[k]);
36904
- }
36905
- return this;
36896
+ // output-es/App.View.LinkedText/index.js
36897
+ var for_4 = /* @__PURE__ */ for_(applicativeEffect)(foldableArray);
36898
+ var forWithIndex_2 = /* @__PURE__ */ forWithIndex_(applicativeEffect)(foldableWithIndexArray);
36899
+ var reflectValSelState\u{1D54A}Linked = {
36900
+ from: () => (r) => arrayMap((v) => $Tuple(v._2.tag === "Str" ? v._2._1 : typeError(v._2)("Str"), v._1))(reflectValSelState\u{1D54A}ArrayV.from()(r))
36906
36901
  };
36907
- function setSelState3({ accessAnn }, {
36908
- selState: selState2,
36909
- selClasses: selClasses2,
36910
- selClassesFor: selClassesFor2,
36911
- join: join3
36912
- }, div, view2, selListener2) {
36913
- div.selectAll("span").each(function(textElem) {
36914
- var sel;
36915
- if (textElem.conts.tag == "Left") {
36916
- sel = accessAnn(view2[textElem.i]);
36917
- } else {
36918
- sel = accessAnn(view2[textElem.i]);
36919
- }
36920
- select_default2(this).classed(selClasses2, false).classed(selClassesFor2(sel), true).on("mousedown", (e) => {
36921
- selListener2(e);
36922
- }).on("mouseenter", (e) => {
36923
- selListener2(e);
36924
- }).on("mouseleave", (e) => {
36925
- selListener2(e);
36926
- });
36927
- });
36928
- }
36929
- function drawLinkedText_({
36930
- explanation,
36931
- contents,
36932
- accessAnn
36933
- }, uiHelpers2, {
36934
- divId,
36935
- suffix,
36936
- view: view2
36937
- }, selListener2) {
36902
+ var setSelState3 = (v) => (redraw) => (rootElement) => {
36903
+ const $0 = selectAll2(".linked-text")(rootElement);
36938
36904
  return () => {
36939
- const div = select_default2("#" + divId);
36940
- const childId = divId + "-" + suffix;
36941
- let rootElement = div.selectAll("#" + childId);
36942
- if (rootElement.empty()) {
36943
- rootElement = div.append("div").attr("id", childId).text(view2._1).attr("class", "linked-text-parent");
36944
- rootElement.selectAll("span").data([...view2.entries()].map(([i, conts]) => {
36945
- return { i, conts };
36946
- })).enter().append("span").attr("id", childId).text((d) => contents(d.conts)).attr("class", "linked-text");
36947
- }
36948
- setSelState3({ accessAnn }, uiHelpers2, rootElement, view2, selListener2);
36905
+ const elems$p = $0();
36906
+ return for_4(elems$p)((elem2) => {
36907
+ const $1 = datum2(elem2);
36908
+ return () => {
36909
+ const v1 = $1();
36910
+ const $2 = definitely("index within bounds")(index(v)(v1.i));
36911
+ const $3 = styles(elem2)(fromFoldable10([
36912
+ $Tuple("border-bottom", isTransient($2._2) ? "1px solid blue" : "none"),
36913
+ $Tuple(
36914
+ "background",
36915
+ (() => {
36916
+ if (isPrimary($2._2) && isPersistent($2._2)) {
36917
+ return "#93E9BE";
36918
+ }
36919
+ if (isSecondary($2._2) && isPersistent($2._2)) {
36920
+ return "rgb(226, 226, 226)";
36921
+ }
36922
+ return "white";
36923
+ })()
36924
+ ),
36925
+ $Tuple(
36926
+ "color",
36927
+ (() => {
36928
+ if (isPrimary($2._2) && isTransient($2._2)) {
36929
+ return "blue";
36930
+ }
36931
+ if (isSecondary($2._2) && isTransient($2._2)) {
36932
+ return "royalblue";
36933
+ }
36934
+ return "black";
36935
+ })()
36936
+ )
36937
+ ]))();
36938
+ return for_2(["mousedown", "mouseenter", "mouseleave"])((ev) => on(ev)(redraw)($3))();
36939
+ };
36940
+ })();
36949
36941
  };
36950
- }
36951
- var drawLinkedText = (x1) => (x2) => (x3) => (x4) => drawLinkedText_(x1, x2, x3, x4);
36952
-
36953
- // output-es/App.View.LinkedText/index.js
36954
- var linkedTextHelpers = {
36955
- explanation: (v) => {
36956
- if (v.tag === "Left") {
36957
- return v._1._1;
36958
- }
36959
- if (v.tag === "Right") {
36960
- return v._1._1._2;
36961
- }
36962
- fail();
36963
- },
36964
- contents: (v) => {
36965
- if (v.tag === "Left") {
36966
- return v._1._1;
36967
- }
36968
- if (v.tag === "Right") {
36969
- if (v._1._1._3._2.tag === "Str") {
36970
- return v._1._1._3._2._1;
36971
- }
36972
- return typeError(v._1._1._3._2)("Str");
36973
- }
36974
- fail();
36975
- },
36976
- accessAnn: (v) => {
36977
- if (v.tag === "Left") {
36978
- return v._1._2;
36979
- }
36980
- if (v.tag === "Right") {
36981
- return v._1._1._1;
36982
- }
36983
- fail();
36984
- }
36985
36942
  };
36943
+ var createRootElement2 = (v) => (div) => (childId) => {
36944
+ const $0 = createChild(div)(showElementType.show(Text2))(fromFoldable10([
36945
+ classes(["linked-text-parent"]),
36946
+ $Tuple("id", childId)
36947
+ ]));
36948
+ return () => {
36949
+ const rootElement = $0();
36950
+ forWithIndex_2(v)((i) => (elem2) => {
36951
+ const $1 = createChild(rootElement)(showElementType.show(Text2))(fromFoldable10([
36952
+ classes(["linked-text"]),
36953
+ $Tuple("id", childId)
36954
+ ]));
36955
+ return () => {
36956
+ const elem$p = $1();
36957
+ const $2 = setText(elem2._1)(elem$p)();
36958
+ return setDatum({ i })($2)();
36959
+ };
36960
+ })();
36961
+ return rootElement;
36962
+ };
36963
+ };
36964
+ var drawable2LinkedText = { createRootElement: createRootElement2, setSelState: setSelState3 };
36986
36965
  var drawableLinkedText = {
36987
36966
  draw: (rSpec) => (figVal) => (v) => (redraw) => {
36988
- const $0 = drawLinkedText(linkedTextHelpers)(uiHelpers)(rSpec);
36989
- const $1 = selListener(figVal)(redraw)((v1) => (x2) => constrArg("LinkedText")(0)(listElement(v1.i)(x2)));
36967
+ const $0 = selListener(figVal)(redraw)((v1) => (x2) => constrArg("LinkedText")(0)(listElement(v1.i)(x2)));
36990
36968
  return () => {
36991
- const $2 = $1();
36992
- return $0($2)();
36969
+ const $1 = $0();
36970
+ return draw$p(drawable2LinkedText)(uiHelpers)(rSpec)($1)();
36993
36971
  };
36994
36972
  }
36995
36973
  };
36996
- var reflectValSelState\u{1D54A}Linked = {
36997
- from: () => (r) => arrayMap((x2) => {
36998
- const $0 = linkedTextEntry.unpack(x2._2);
36999
- if ($0.tag === "Left") {
37000
- return $Either("Left", $Tuple($0._1, x2._1));
37001
- }
37002
- if ($0.tag === "Right") {
37003
- return $Either("Right", $Tuple($0._1, x2._1));
37004
- }
37005
- fail();
37006
- })(reflectValSelState\u{1D54A}ArrayV.from()(r))
37007
- };
37008
36974
 
37009
36975
  // output-es/App.View.MatrixView/foreign.js
37010
36976
  function setSelState4({
@@ -37188,8 +37154,7 @@ function drawScatterPlot_(scatterPlotHelpers2, uiHelpers2, {
37188
37154
  view: {
37189
37155
  caption,
37190
37156
  points,
37191
- xlabel,
37192
- ylabel
37157
+ labels
37193
37158
  }
37194
37159
  }, listener) {
37195
37160
  return () => {
@@ -37215,8 +37180,8 @@ function drawScatterPlot_(scatterPlotHelpers2, uiHelpers2, {
37215
37180
  rootElement.append("g").attr("transform", "translate(0," + height + ")").call(axisBottom(x2).tickSizeOuter(0)).selectAll("text").style("text-anchor", "middle");
37216
37181
  const y2 = linear2().domain([Math.min(0, y_min), y_max]).range([height, 0]);
37217
37182
  rootElement.append("g").call(axisLeft(y2).tickSizeOuter(0));
37218
- rootElement.append("text").attr("x", width).attr("y", height + 25).style("text-anchor", "end").style("font-size", "10px").text(val(xlabel));
37219
- rootElement.append("text").attr("transform", "rotate(-90)").attr("x", -margin.top).attr("y", -margin.left + 20).style("text-anchor", "end").style("font-size", "10px").text(val(ylabel));
37183
+ rootElement.append("text").attr("x", width).attr("y", height + 25).style("text-anchor", "end").style("font-size", "10px").text(val(labels.x));
37184
+ rootElement.append("text").attr("transform", "rotate(-90)").attr("x", -margin.top).attr("y", -margin.left + 20).style("text-anchor", "end").style("font-size", "10px").text(val(labels.y));
37220
37185
  rootElement.append("g").selectAll("circle").data([...points.entries()].map(([i, point2]) => {
37221
37186
  return { i, point: point2 };
37222
37187
  })).enter().append("circle").classed("scatterplot-point", true).attr("cx", ({ point: point2 }) => x2(val(point2.x))).attr("cy", ({ point: point2 }) => y2(val(point2.y))).attr("stroke-width", 0.5);
@@ -37236,15 +37201,8 @@ var reflectDictSelState\u{1D54A}$x215ValS5 = {
37236
37201
  const $0 = $$get2(showString)(mapDictString)("caption")(r);
37237
37202
  return $Tuple($0._2._2.tag === "Str" ? $0._2._2._1 : typeError($0._2._2)("Str"), $0._2._1);
37238
37203
  })(),
37239
- points: arrayMap(dict(reflectDictSelState\u{1D54A}$x215ValS12.from()))(reflectValSelState\u{1D54A}ArrayV.from()($$get2(showString)(mapDictString)("points")(r)._2)),
37240
- xlabel: (() => {
37241
- const $0 = $$get2(showString)(mapDictString)("xlabel")(r);
37242
- return $Tuple($0._2._2.tag === "Str" ? $0._2._2._1 : typeError($0._2._2)("Str"), $0._2._1);
37243
- })(),
37244
- ylabel: (() => {
37245
- const $0 = $$get2(showString)(mapDictString)("ylabel")(r);
37246
- return $Tuple($0._2._2.tag === "Str" ? $0._2._2._1 : typeError($0._2._2)("Str"), $0._2._1);
37247
- })()
37204
+ points: arrayMap(dict(reflectDictSelState\u{1D54A}$x215ValS23.from()))(reflectValSelState\u{1D54A}ArrayV.from()($$get2(showString)(mapDictString)("points")(r)._2)),
37205
+ labels: dict(reflectDictSelState\u{1D54A}$x215ValS12.from())($$get2(showString)(mapDictString)("labels")(r)._2)
37248
37206
  })
37249
37207
  };
37250
37208
  var scatterPlotHelpers = {
@@ -37334,12 +37292,12 @@ var toStringWith = (v) => {
37334
37292
  // output-es/App.View.TableView/index.js
37335
37293
  var $Filter = (tag) => tag;
37336
37294
  var toUnfoldable9 = /* @__PURE__ */ toUnfoldable4(unfoldableArray);
37337
- var forWithIndex_2 = /* @__PURE__ */ forWithIndex_(applicativeEffect)(foldableWithIndexArray);
37295
+ var forWithIndex_3 = /* @__PURE__ */ forWithIndex_(applicativeEffect)(foldableWithIndexArray);
37338
37296
  var $$for = /* @__PURE__ */ (() => {
37339
37297
  const traverse2 = traversableArray.traverse(applicativeEffect);
37340
37298
  return (x2) => (f) => traverse2(f)(x2);
37341
37299
  })();
37342
- var for_4 = /* @__PURE__ */ for_(applicativeEffect)(foldableArray);
37300
+ var for_5 = /* @__PURE__ */ for_(applicativeEffect)(foldableArray);
37343
37301
  var Interactive = /* @__PURE__ */ $Filter("Interactive");
37344
37302
  var prim = (v) => {
37345
37303
  if (v._2.tag === "Int") {
@@ -37363,7 +37321,7 @@ var record_isVisible = (r) => filter((v) => {
37363
37321
  }
37364
37322
  fail();
37365
37323
  })(r).length !== 0;
37366
- var createRootElement2 = (v) => (div) => (childId) => {
37324
+ var createRootElement3 = (v) => (div) => (childId) => {
37367
37325
  const $0 = v.colNames;
37368
37326
  const $1 = v.filter;
37369
37327
  const $2 = v.rows;
@@ -37381,7 +37339,7 @@ var createRootElement2 = (v) => (div) => (childId) => {
37381
37339
  const colNames$p = ["__n", ...$0];
37382
37340
  const $4 = createChild(rootElement)(showElementType.show(THead))(fromFoldable10([]))();
37383
37341
  const row = createChild($4)(showElementType.show(TR))(fromFoldable10([]))();
37384
- forWithIndex_2(colNames$p)((j) => (colName) => {
37342
+ forWithIndex_3(colNames$p)((j) => (colName) => {
37385
37343
  const value = (() => {
37386
37344
  if (colName === "__n") {
37387
37345
  if ($1 === "Relevant") {
@@ -37403,7 +37361,7 @@ var createRootElement2 = (v) => (div) => (childId) => {
37403
37361
  };
37404
37362
  })();
37405
37363
  const body = createChild(rootElement)(showElementType.show(TBody))(fromFoldable10([]))();
37406
- forWithIndex_2($2)((i) => (row$1) => {
37364
+ forWithIndex_3($2)((i) => (row$1) => {
37407
37365
  const $5 = createChild(body)(showElementType.show(TR))(fromFoldable10([
37408
37366
  classes(["table-row"])
37409
37367
  ]));
@@ -37411,7 +37369,7 @@ var createRootElement2 = (v) => (div) => (childId) => {
37411
37369
  return () => {
37412
37370
  const $7 = $5();
37413
37371
  const row$p = $6($7)();
37414
- return forWithIndex_2([showIntImpl(i + 1 | 0), ...arrayMap(prim)(row$1)])((j) => (value) => {
37372
+ return forWithIndex_3([showIntImpl(i + 1 | 0), ...arrayMap(prim)(row$1)])((j) => (value) => {
37415
37373
  const $8 = createChild(row$p)(showElementType.show(TD))(fromFoldable10([
37416
37374
  classes(j >= 0 ? ["table-cell"] : [])
37417
37375
  ]));
@@ -37487,7 +37445,7 @@ var setSelState6 = (v) => (redraw) => (rootElement) => {
37487
37445
  const $3 = selectAll2(".table-cell")(rootElement);
37488
37446
  return () => {
37489
37447
  const cells = $3();
37490
- for_4(cells)((cell) => {
37448
+ for_5(cells)((cell) => {
37491
37449
  const $42 = datum2(cell);
37492
37450
  return () => {
37493
37451
  const v12 = $42();
@@ -37545,11 +37503,11 @@ var setSelState6 = (v) => (redraw) => (rootElement) => {
37545
37503
  };
37546
37504
  })();
37547
37505
  const v1 = partition(snd)(a$p);
37548
- for_4(v1.no)((() => {
37506
+ for_5(v1.no)((() => {
37549
37507
  const $42 = classed("hidden")(true);
37550
37508
  return (x2) => $42(x2._1);
37551
37509
  })())();
37552
- for_4(v1.yes)((() => {
37510
+ for_5(v1.yes)((() => {
37553
37511
  const $42 = classed("hidden")(false);
37554
37512
  return (x2) => $42(x2._1);
37555
37513
  })())();
@@ -37557,7 +37515,7 @@ var setSelState6 = (v) => (redraw) => (rootElement) => {
37557
37515
  setText($1 + " (" + showIntImpl($0.length - v1.no.length | 0) + " of " + showIntImpl($0.length) + ")")($4)();
37558
37516
  };
37559
37517
  };
37560
- var drawable2TableView = { createRootElement: createRootElement2, setSelState: setSelState6 };
37518
+ var drawable2TableView = { createRootElement: createRootElement3, setSelState: setSelState6 };
37561
37519
  var drawableTableView = {
37562
37520
  draw: (rSpec) => (figVal) => (v) => (redraw) => {
37563
37521
  const $0 = selListener(figVal)(redraw)((v1) => (x2) => listElement(v1.i)(dictVal(v1.colName)(x2)));
@@ -43650,6 +43608,7 @@ var concatM2 = (dictMonad) => foldrArray((() => {
43650
43608
  const $0 = dictMonad.Bind1();
43651
43609
  return (f) => (g) => (a) => $0.bind(f(a))(g);
43652
43610
  })())(dictMonad.Applicative0().pure);
43611
+ var Folder = (x2) => x2;
43653
43612
  var parse = (dictMonadError) => {
43654
43613
  const $0 = dictMonadError.MonadThrow0();
43655
43614
  const $1 = $0.Monad0().Applicative0().pure;
@@ -43667,7 +43626,7 @@ var parse = (dictMonadError) => {
43667
43626
  };
43668
43627
  };
43669
43628
  };
43670
- var parseProgram = (loadFile2) => (folder) => (file) => (dictMonadAff) => (dictMonadError) => dictMonadAff.MonadEffect0().Monad0().Bind1().bind(loadFile2(folder)(file)(dictMonadAff)(dictMonadError))((() => {
43629
+ var parseProgram = (loadFile2) => (folders) => (file) => (dictMonadAff) => (dictMonadError) => dictMonadAff.MonadEffect0().Monad0().Bind1().bind(loadFile2(folders)(file)(dictMonadAff)(dictMonadError))((() => {
43671
43630
  const $0 = parse(dictMonadError);
43672
43631
  return (a) => $0(a)(topLevel(expr_));
43673
43632
  })());
@@ -43678,9 +43637,9 @@ var module_2 = (dictMonadAff) => {
43678
43637
  return (dictMonadError) => {
43679
43638
  const parse1 = parse(dictMonadError);
43680
43639
  const desugarModuleFwd = moduleFwd(dictMonadError)(boundedLattice2);
43681
- return (loadFile2) => (folder) => (file) => (v) => {
43640
+ return (loadFile2) => (folders) => (file) => (v) => {
43682
43641
  const $0 = v.mods;
43683
- return Bind1.bind(Applicative0.pure())(() => Bind1.bind(loadFile2(folder)(file)(dictMonadAff)(dictMonadError))((src) => Bind1.bind(Bind1.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Applicative0.pure({
43642
+ return Bind1.bind(Applicative0.pure())(() => Bind1.bind(loadFile2(folders)(file)(dictMonadAff)(dictMonadError))((src) => Bind1.bind(Bind1.bind(parse1(src)(module_))(desugarModuleFwd))((mod) => Applicative0.pure({
43684
43643
  primitives: v.primitives,
43685
43644
  mods: $List("Cons", mod, $0),
43686
43645
  datasets: v.datasets
@@ -43718,7 +43677,7 @@ var prepConfig = (dictMonadAff) => {
43718
43677
  return (dictMonadError) => {
43719
43678
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
43720
43679
  const initialConfig1 = initialConfig(dictMonadError)(fVExpr);
43721
- return (v) => (file) => (progCxt) => $0.bind(parseProgram(v.loadFile)(v.fluidSrcPath)(file)(dictMonadAff)(dictMonadError))((s) => $0.bind(desug1(s))((e) => $0.bind(initialConfig1(e)(progCxt))((gconfig) => Monad0.Applicative0().pure({
43680
+ return (v) => (file) => (progCxt) => $0.bind(parseProgram(v.loadFile)(v.fluidSrcPaths)(file)(dictMonadAff)(dictMonadError))((s) => $0.bind(desug1(s))((e) => $0.bind(initialConfig1(e)(progCxt))((gconfig) => Monad0.Applicative0().pure({
43722
43681
  s,
43723
43682
  e,
43724
43683
  gconfig
@@ -43730,10 +43689,10 @@ var datasetAs = (dictMonadAff) => {
43730
43689
  const $0 = Monad0.Bind1();
43731
43690
  return (dictMonadError) => {
43732
43691
  const desug1 = exprFwd(boundedLattice2)(dictMonadError)(joinSemilatticeUnit);
43733
- return (loadFile2) => (folder) => (v) => (v1) => {
43692
+ return (loadFile2) => (folders) => (v) => (v1) => {
43734
43693
  const $1 = v1.datasets;
43735
43694
  const $2 = v._1;
43736
- return $0.bind($0.bind(parseProgram(loadFile2)(folder)(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
43695
+ return $0.bind($0.bind(parseProgram(loadFile2)(folders)(v._2)(dictMonadAff)(dictMonadError))(desug1))((e\u03B1) => Monad0.Applicative0().pure({
43737
43696
  primitives: v1.primitives,
43738
43697
  mods: v1.mods,
43739
43698
  datasets: $List("Cons", $Tuple($2, e\u03B1), $1)
@@ -43754,22 +43713,26 @@ var loadProgCxt = (dictMonadAff) => {
43754
43713
  primitives,
43755
43714
  mods: Nil,
43756
43715
  datasets: Nil
43757
- }))(concatM1(arrayMap(module_22(v.loadFile)(v.fluidSrcPath))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
43758
- const $1 = datasetAs2(v.loadFile)(v.fluidSrcPath);
43716
+ }))(concatM1(arrayMap(module_22(v.loadFile)(v.fluidSrcPaths))(["lib/prelude", ...mods]))))(concatM1(arrayMap((() => {
43717
+ const $1 = datasetAs2(v.loadFile)(v.fluidSrcPaths);
43759
43718
  return (x2) => $1($Tuple(x2._1, x2._2));
43760
43719
  })())(datasets)));
43761
43720
  };
43762
43721
  };
43763
43722
 
43764
43723
  // output-es/Module.Web/index.js
43765
- var loadFile = (v) => (v1) => (dictMonadAff) => {
43766
- const MonadEffect0 = dictMonadAff.MonadEffect0();
43767
- const Monad0 = MonadEffect0.Monad0();
43768
- const Bind1 = Monad0.Bind1();
43769
- const Applicative0 = Monad0.Applicative0();
43770
- return (dictMonadError) => Bind1.bind(dictMonadAff.liftAff(request(driver)({
43771
- method: $Either("Left", GET),
43772
- url: v + "/" + v1 + ".fld",
43724
+ var findM = (xs) => (f) => (base2) => foldrArray((x2) => (acc) => applyAff.apply(_map(altEither.alt)(acc))(f(x2)))(_pure(base2))(xs);
43725
+ var loadFile = (folders) => (v) => (dictMonadAff) => {
43726
+ const Monad0 = dictMonadAff.MonadEffect0().Monad0();
43727
+ const bindExceptT2 = bindExceptT(Monad0);
43728
+ const applicativeExceptT2 = applicativeExceptT(Monad0);
43729
+ const pure22 = Monad0.Applicative0().pure;
43730
+ return (dictMonadError) => Monad0.Bind1().bind(bindExceptT2.bind(dictMonadAff.liftAff(findM(arrayMap((() => {
43731
+ const $0 = v + ".fld";
43732
+ return (a) => a + "/" + $0;
43733
+ })())(folders))((v1) => _bind(request(driver)({
43734
+ method: $Either("Left", HEAD),
43735
+ url: v1,
43773
43736
  headers: [],
43774
43737
  content: Nothing,
43775
43738
  username: Nothing,
@@ -43777,31 +43740,53 @@ var loadFile = (v) => (v1) => (dictMonadAff) => {
43777
43740
  withCredentials: false,
43778
43741
  responseFormat: $ResponseFormat("String", identity),
43779
43742
  timeout: Nothing
43780
- })))((result) => {
43743
+ }))((resp) => _pure((() => {
43744
+ if (resp.tag === "Right") {
43745
+ if (resp._1.status === 200) {
43746
+ return $Either("Right", $Tuple(resp._1, v1));
43747
+ }
43748
+ return $Either("Left", RequestFailedError);
43749
+ }
43750
+ if (resp.tag === "Left") {
43751
+ return $Either("Left", resp._1);
43752
+ }
43753
+ fail();
43754
+ })())))($Either("Left", RequestFailedError))))((v1) => {
43755
+ const $0 = v1._2;
43756
+ return bindExceptT2.bind(applicativeExceptT2.pure())(() => bindExceptT2.bind(dictMonadAff.liftAff(request(driver)({
43757
+ method: $Either("Left", GET),
43758
+ url: $0,
43759
+ headers: [],
43760
+ content: Nothing,
43761
+ username: Nothing,
43762
+ password: Nothing,
43763
+ withCredentials: false,
43764
+ responseFormat: $ResponseFormat("String", identity),
43765
+ timeout: Nothing
43766
+ })))((contents) => applicativeExceptT2.pure(contents.body)));
43767
+ }))((result) => {
43781
43768
  if (result.tag === "Left") {
43782
- const $0 = result._1;
43783
- return Bind1.bind(MonadEffect0.liftEffect(log2("Failed with " + printError($0))))(() => dictMonadError.MonadThrow0().throwError(error(printError($0))));
43769
+ return dictMonadError.MonadThrow0().throwError(error(printError(result._1)));
43784
43770
  }
43785
43771
  if (result.tag === "Right") {
43786
- const $0 = result._1;
43787
- return Bind1.bind(Applicative0.pure())(() => Applicative0.pure($0.body));
43772
+ return pure22(result._1);
43788
43773
  }
43789
43774
  fail();
43790
43775
  });
43791
43776
  };
43792
- var loadFile$p = (folder) => (file) => (dictMonadAff) => (dictMonadError) => dictMonadAff.MonadEffect0().Monad0().Bind1().Apply0().Functor0().map((v) => $Tuple(file, v))(loadFile(folder)(file)(dictMonadAff)(dictMonadError));
43777
+ var loadFile$p = (folders) => (file) => (dictMonadAff) => (dictMonadError) => dictMonadAff.MonadEffect0().Monad0().Bind1().Apply0().Functor0().map((v) => $Tuple(file, v))(loadFile(folders)(file)(dictMonadAff)(dictMonadError));
43793
43778
  var loadProgCxt2 = (dictMonadAff) => {
43794
43779
  const loadProgCxt1 = loadProgCxt(dictMonadAff);
43795
43780
  return (dictMonadError) => {
43796
43781
  const loadProgCxt22 = loadProgCxt1(dictMonadError);
43797
- return (fluidSrcPath) => loadProgCxt22({ loadFile, fluidSrcPath });
43782
+ return (fluidSrcPaths) => loadProgCxt22({ loadFile, fluidSrcPaths });
43798
43783
  };
43799
43784
  };
43800
43785
  var prepConfig2 = (dictMonadAff) => {
43801
43786
  const prepConfig1 = prepConfig(dictMonadAff);
43802
43787
  return (dictMonadError) => {
43803
43788
  const prepConfig22 = prepConfig1(dictMonadError);
43804
- return (fluidSrcPath) => prepConfig22({ loadFile, fluidSrcPath });
43789
+ return (fluidSrcPaths) => prepConfig22({ loadFile, fluidSrcPaths });
43805
43790
  };
43806
43791
  };
43807
43792
 
@@ -43995,7 +43980,7 @@ var loadFig = (v) => (dictMonadAff) => {
43995
43980
  const prepConfig1 = prepConfig3(dictMonadError);
43996
43981
  const graphEval2 = graphEval(dictMonadError);
43997
43982
  const $1 = v.file;
43998
- const $2 = v.fluidSrcPath;
43983
+ const $2 = v.fluidSrcPaths;
43999
43984
  const $3 = v.inputs;
44000
43985
  return $0.bind(loadProgCxt3(dictMonadError)($2)(v.imports)(v.datasets))((progCxt) => $0.bind(prepConfig1($2)($1)(progCxt))((v1) => {
44001
43986
  const $4 = v1.s;
@@ -44268,26 +44253,7 @@ var gDecodeJsonCons = (dictDecodeJsonField) => (dictGDecodeJson) => (dictIsSymbo
44268
44253
  var monadAffAff = { liftAff: (x2) => x2, MonadEffect0: () => monadEffectAff };
44269
44254
 
44270
44255
  // output-es/App.LoadFigure/index.js
44271
- var gDecodeJsonCons2 = /* @__PURE__ */ gDecodeJsonCons({
44272
- decodeJsonField: (j) => {
44273
- if (j.tag === "Just") {
44274
- return $Maybe(
44275
- "Just",
44276
- _caseJson(
44277
- (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44278
- (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44279
- (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44280
- Right,
44281
- (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44282
- (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44283
- j._1
44284
- )
44285
- );
44286
- }
44287
- return Nothing;
44288
- }
44289
- });
44290
- var gDecodeJsonCons1 = /* @__PURE__ */ gDecodeJsonCons(/* @__PURE__ */ (() => {
44256
+ var gDecodeJsonCons2 = /* @__PURE__ */ gDecodeJsonCons(/* @__PURE__ */ (() => {
44291
44257
  const $0 = decodeArray(caseJsonString($Either(
44292
44258
  "Left",
44293
44259
  $JsonDecodeError("TypeMismatch", "String")
@@ -44314,10 +44280,28 @@ var decodeJson = /* @__PURE__ */ (() => decodeRecord(gDecodeJsonCons((() => {
44314
44280
  return Nothing;
44315
44281
  }
44316
44282
  };
44317
- })())(gDecodeJsonCons2(gDecodeJsonCons2(gDecodeJsonCons1(gDecodeJsonCons1(gDecodeJsonNil)({ reflectSymbol: () => "inputs" })()())({
44318
- reflectSymbol: () => "imports"
44319
- })()())({ reflectSymbol: () => "fluidSrcPath" })()())({ reflectSymbol: () => "file" })()())({ reflectSymbol: () => "datasets" })()())().decodeJson)();
44320
- var figSpecFromJson = (spec) => ({ fluidSrcPath: spec.fluidSrcPath, datasets: spec.datasets, imports: spec.imports, file: spec.file, inputs: spec.inputs });
44283
+ })())(gDecodeJsonCons({
44284
+ decodeJsonField: (j) => {
44285
+ if (j.tag === "Just") {
44286
+ return $Maybe(
44287
+ "Just",
44288
+ _caseJson(
44289
+ (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44290
+ (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44291
+ (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44292
+ Right,
44293
+ (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44294
+ (v) => $Either("Left", $JsonDecodeError("TypeMismatch", "String")),
44295
+ j._1
44296
+ )
44297
+ );
44298
+ }
44299
+ return Nothing;
44300
+ }
44301
+ })(gDecodeJsonCons2(gDecodeJsonCons2(gDecodeJsonCons2(gDecodeJsonNil)({ reflectSymbol: () => "inputs" })()())({ reflectSymbol: () => "imports" })()())({
44302
+ reflectSymbol: () => "fluidSrcPath"
44303
+ })()())({ reflectSymbol: () => "file" })()())({ reflectSymbol: () => "datasets" })()())().decodeJson)();
44304
+ var figSpecFromJson = (spec) => ({ fluidSrcPaths: arrayMap(Folder)(spec.fluidSrcPath), datasets: spec.datasets, imports: spec.imports, file: spec.file, inputs: spec.inputs });
44321
44305
  var loadFigure = (fileName) => runAffs_((v) => drawFig(v._1)(v._2))([
44322
44306
  _bind($$get(driver)($ResponseFormat("Json", identity))(fileName))((result) => {
44323
44307
  if (result.tag === "Left") {
@@ -44329,24 +44313,17 @@ var loadFigure = (fileName) => runAffs_((v) => drawFig(v._1)(v._2))([
44329
44313
  return throwException(error("JSON decoding failed with " + showJsonDecodeError.show(v._1)))();
44330
44314
  }
44331
44315
  if (v.tag === "Right") {
44332
- return _map((v1) => $Tuple("fig", v1))(loadFig({
44333
- fluidSrcPath: v._1.fluidSrcPath,
44334
- datasets: v._1.datasets,
44335
- imports: v._1.imports,
44336
- file: v._1.file,
44337
- inputs: v._1.inputs
44338
- })(monadAffAff)(monadErrorAff));
44316
+ return _map((v1) => $Tuple("fig", v1))(loadFig(figSpecFromJson(v._1))(monadAffAff)(monadErrorAff));
44339
44317
  }
44340
44318
  }
44341
44319
  fail();
44342
44320
  })
44343
44321
  ]);
44344
- var drawCode2 = (folder) => (file) => runAffs_(drawFile)([loadFile$p(folder)(file)(monadAffAff)(monadErrorAff)]);
44322
+ var drawCode2 = (folder) => (file) => runAffs_(drawFile)([loadFile$p([folder])(file)(monadAffAff)(monadErrorAff)]);
44345
44323
  export {
44346
44324
  decodeJson,
44347
44325
  drawCode2 as drawCode,
44348
44326
  figSpecFromJson,
44349
44327
  gDecodeJsonCons2 as gDecodeJsonCons,
44350
- gDecodeJsonCons1,
44351
44328
  loadFigure
44352
44329
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorable-viz/fluid",
3
- "version": "0.7.61",
3
+ "version": "0.7.63",
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": {
@@ -12,25 +12,24 @@ done
12
12
 
13
13
  WEBSITE_LISP_CASE=$(./$PREFIX/script/util/lisp-case.sh "$WEBSITE")
14
14
  echo "$WEBSITE -> $WEBSITE_LISP_CASE"
15
- mkdir -p "dist/$WEBSITE_LISP_CASE"
15
+ echo "Cleaning dist/$WEBSITE_LISP_CASE"
16
+ . "${PREFIX:+$PREFIX}script/util/clean.sh" $WEBSITE_LISP_CASE
16
17
 
17
18
  . "${PREFIX:+$PREFIX/}script/bundle-page.sh" $WEBSITE ${PREFIX:+$PREFIX}
18
19
 
19
20
  shopt -s nullglob
20
21
 
21
22
  # Only support one level of nesting for now
22
- set +x
23
23
  PAGES=($(for FILE in website/$WEBSITE/*.html; do
24
24
  basename "$FILE" | sed 's/\.[^.]*$//'
25
25
  done | sort -u))
26
- set -x
27
26
 
28
27
  for PAGE in "${PAGES[@]}"; do
29
28
  . "${PREFIX:+$PREFIX/}script/bundle-page.sh" $WEBSITE.$PAGE ${PREFIX:+$PREFIX}
30
29
  done
31
30
 
32
31
  echo "Processing other static files:"
33
- set +xu # try to remove +u
32
+ set +u # try to remove +u
34
33
  TO_COPY=()
35
34
  shopt -s extglob
36
35
  for CHILD in website/$WEBSITE/!(.|..); do
@@ -40,15 +39,16 @@ for CHILD in website/$WEBSITE/!(.|..); do
40
39
  fi
41
40
  done
42
41
  shopt -u extglob
43
- set -xu
42
+ set -u
44
43
 
45
44
  for CHILD in "${TO_COPY[@]}"; do
46
45
  cp -rL "$CHILD" dist/$WEBSITE_LISP_CASE
47
46
  done
48
47
 
49
48
  echo "Processing shared js files:"
50
- cp -r "${PREFIX:+$PREFIX/}dist/fluid/shared" dist/$WEBSITE_LISP_CASE
51
49
  cp -r fluid dist/$WEBSITE_LISP_CASE
50
+ cp -r "${PREFIX:+$PREFIX/}dist/fluid/shared" dist/$WEBSITE_LISP_CASE
51
+
52
52
 
53
53
  if [[ -e "website/$SRC_PATH/test.mjs" ]]; then
54
54
  cp website/$SRC_PATH/test.mjs dist/SRC_PATH_LISP_CASE/test.mjs
@@ -1,29 +0,0 @@
1
- {
2
- "parserOptions": {
3
- "ecmaVersion": 6,
4
- "sourceType": "module"
5
- },
6
- "extends": "eslint:recommended",
7
- "env": {
8
- "node": true
9
- },
10
- "rules": {
11
- "strict": [2, "global"],
12
- "block-scoped-var": 2,
13
- "consistent-return": 2,
14
- "eqeqeq": [2, "smart"],
15
- "guard-for-in": 2,
16
- "no-caller": 2,
17
- "no-extend-native": 2,
18
- "no-loop-func": 2,
19
- "no-new": 2,
20
- "no-param-reassign": 2,
21
- "no-return-assign": 2,
22
- "no-unused-expressions": 2,
23
- "no-use-before-define": 2,
24
- "radix": [2, "always"],
25
- "indent": [2, 2],
26
- "quotes": [2, "double"],
27
- "semi": [2, "always"]
28
- }
29
- }
@@ -1,8 +0,0 @@
1
- /.*
2
- !/.gitignore
3
- !/.eslintrc.json
4
- !/.github/
5
- /bower_components/
6
- /node_modules/
7
- /output/
8
- package-lock.json
@@ -1,29 +0,0 @@
1
- {
2
- "parserOptions": {
3
- "ecmaVersion": 6,
4
- "sourceType": "module"
5
- },
6
- "extends": "eslint:recommended",
7
- "env": {
8
- "node": true
9
- },
10
- "rules": {
11
- "strict": [2, "global"],
12
- "block-scoped-var": 2,
13
- "consistent-return": 2,
14
- "eqeqeq": [2, "smart"],
15
- "guard-for-in": 2,
16
- "no-caller": 2,
17
- "no-extend-native": 2,
18
- "no-loop-func": 2,
19
- "no-new": 2,
20
- "no-param-reassign": 2,
21
- "no-return-assign": 2,
22
- "no-unused-expressions": 2,
23
- "no-use-before-define": 2,
24
- "radix": [2, "always"],
25
- "indent": [2, 2],
26
- "quotes": [2, "double"],
27
- "semi": [2, "always"]
28
- }
29
- }
@@ -1,8 +0,0 @@
1
- /.*
2
- !/.gitignore
3
- !/.eslintrc.json
4
- !/.github/
5
- /bower_components/
6
- /node_modules/
7
- /output/
8
- package-lock.json
@@ -1,29 +0,0 @@
1
- {
2
- "parserOptions": {
3
- "ecmaVersion": 6,
4
- "sourceType": "module"
5
- },
6
- "extends": "eslint:recommended",
7
- "env": {
8
- "node": true
9
- },
10
- "rules": {
11
- "strict": [2, "global"],
12
- "block-scoped-var": 2,
13
- "consistent-return": 2,
14
- "eqeqeq": [2, "smart"],
15
- "guard-for-in": 2,
16
- "no-caller": 2,
17
- "no-extend-native": 2,
18
- "no-loop-func": 2,
19
- "no-new": 2,
20
- "no-param-reassign": 2,
21
- "no-return-assign": 2,
22
- "no-unused-expressions": 2,
23
- "no-use-before-define": 2,
24
- "radix": [2, "always"],
25
- "indent": [2, 2],
26
- "quotes": [2, "double"],
27
- "semi": [2, "always"]
28
- }
29
- }
@@ -1,8 +0,0 @@
1
- /.*
2
- !/.gitignore
3
- !/.eslintrc.json
4
- !/.github/
5
- /bower_components/
6
- /node_modules/
7
- /output/
8
- package-lock.json
@@ -1,8 +0,0 @@
1
- /.*
2
- !/.github
3
- !/.gitignore
4
- !/.npmrc
5
- !/.travis.yml
6
- /bower_components/
7
- /node_modules/
8
- /output/
@@ -1 +0,0 @@
1
- package-lock=false
Binary file
@@ -1,2 +0,0 @@
1
- let q = 1 in
2
- ((fun (w, x) -> (w, (w, x))) data)