@explorable-viz/fluid 0.8.1 → 0.8.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/README.md +4 -3
- package/dist/fluid/shared/fluid.mjs +77 -117
- package/dist/fluid/shared/load-figure.js +270 -223
- package/dist/fluid/shared/webtest-lib.js +1 -4
- package/package.json +2 -3
- package/website/article/fluid/1805.02474v1-10.fld +0 -33
- package/website/article/fluid/scigen.fld +0 -50
- package/website/article/transparent-text/index.html +0 -44
- package/website/article/transparent-text/spec.json +0 -8
package/README.md
CHANGED
@@ -62,11 +62,12 @@ After building, tests can be run from the command line via `yarn test-all`
|
|
62
62
|
a browser window.
|
63
63
|
- To observe the status of tests, click `Debug` in the browser window, and then open the JavaScript Console for your browser (e.g., via the Developer Tools).
|
64
64
|
|
65
|
-
### Run Puppeteer tests for
|
65
|
+
### Run Puppeteer tests for website X
|
66
66
|
|
67
|
-
Rebuild with `puppeteerTests.headless` set to `false` to run in browser. Then:
|
68
67
|
- `yarn bundle-website X`
|
69
|
-
-
|
68
|
+
- `yarn test-website X`
|
69
|
+
|
70
|
+
Rebuild with `puppeteerTests.headless` set to `false` to run in browser.
|
70
71
|
|
71
72
|
## Development via VS Code
|
72
73
|
|
@@ -1574,19 +1574,6 @@ var stripPrefix = (v) => (str) => {
|
|
1574
1574
|
return Nothing;
|
1575
1575
|
};
|
1576
1576
|
var indexOf = /* @__PURE__ */ _indexOf(Just)(Nothing);
|
1577
|
-
var contains = (pat) => {
|
1578
|
-
const $0 = indexOf(pat);
|
1579
|
-
return (x) => {
|
1580
|
-
const $1 = $0(x);
|
1581
|
-
if ($1.tag === "Nothing") {
|
1582
|
-
return false;
|
1583
|
-
}
|
1584
|
-
if ($1.tag === "Just") {
|
1585
|
-
return true;
|
1586
|
-
}
|
1587
|
-
fail();
|
1588
|
-
};
|
1589
|
-
};
|
1590
1577
|
var charAt2 = /* @__PURE__ */ _charAt(Just)(Nothing);
|
1591
1578
|
|
1592
1579
|
// output-es/Data.String.Common/foreign.js
|
@@ -16785,13 +16772,67 @@ var semigroupColumns = { append: (v) => (v1) => beside(v)(v1) };
|
|
16785
16772
|
var monoidColumns = { mempty: empty2, Semigroup0: () => semigroupColumns };
|
16786
16773
|
|
16787
16774
|
// output-es/Pretty/index.js
|
16788
|
-
var $ExprType = (tag) => tag;
|
16789
16775
|
var hcat = /* @__PURE__ */ (() => foldableList.foldMap(monoidColumns)(unsafeCoerce))();
|
16790
16776
|
var hcat1 = /* @__PURE__ */ (() => foldableArray.foldMap(monoidColumns)(unsafeCoerce))();
|
16791
16777
|
var toUnfoldable8 = /* @__PURE__ */ toUnfoldable4(unfoldableList);
|
16792
16778
|
var toUnfoldable13 = /* @__PURE__ */ toAscUnfoldable(unfoldableList);
|
16793
|
-
var
|
16794
|
-
|
16779
|
+
var isSimpleVal = {
|
16780
|
+
isSimple: (v) => {
|
16781
|
+
if (v._3.tag === "Constr") {
|
16782
|
+
return v._3._2.tag !== "Cons";
|
16783
|
+
}
|
16784
|
+
if (v._3.tag === "Fun" && v._3._1.tag === "PartialConstr") {
|
16785
|
+
return v._3._1._2.tag !== "Cons";
|
16786
|
+
}
|
16787
|
+
return true;
|
16788
|
+
}
|
16789
|
+
};
|
16790
|
+
var isSimpleExpr = {
|
16791
|
+
isSimple: (v) => {
|
16792
|
+
if (v.tag === "Var") {
|
16793
|
+
return true;
|
16794
|
+
}
|
16795
|
+
if (v.tag === "Op") {
|
16796
|
+
return true;
|
16797
|
+
}
|
16798
|
+
if (v.tag === "Int") {
|
16799
|
+
return true;
|
16800
|
+
}
|
16801
|
+
if (v.tag === "Float") {
|
16802
|
+
return true;
|
16803
|
+
}
|
16804
|
+
if (v.tag === "Str") {
|
16805
|
+
return true;
|
16806
|
+
}
|
16807
|
+
if (v.tag === "Constr") {
|
16808
|
+
return v._4.tag === "Nil";
|
16809
|
+
}
|
16810
|
+
return v.tag === "Dictionary" || v.tag === "Matrix" || v.tag === "Project" || v.tag === "DProject";
|
16811
|
+
}
|
16812
|
+
};
|
16813
|
+
var isSimpleExpr1 = {
|
16814
|
+
isSimple: (v) => {
|
16815
|
+
if (v.tag === "Var") {
|
16816
|
+
return true;
|
16817
|
+
}
|
16818
|
+
if (v.tag === "Op") {
|
16819
|
+
return true;
|
16820
|
+
}
|
16821
|
+
if (v.tag === "Int") {
|
16822
|
+
return true;
|
16823
|
+
}
|
16824
|
+
if (v.tag === "Float") {
|
16825
|
+
return true;
|
16826
|
+
}
|
16827
|
+
if (v.tag === "Str") {
|
16828
|
+
return true;
|
16829
|
+
}
|
16830
|
+
if (v.tag === "Constr") {
|
16831
|
+
return v._4.tag === "Nil";
|
16832
|
+
}
|
16833
|
+
return v.tag === "Dictionary" || v.tag === "Matrix" || v.tag === "Project" || v.tag === "DProject" || v.tag === "ListEmpty" || v.tag === "ListNonEmpty" || v.tag === "ListEnum" || v.tag === "ListComp";
|
16834
|
+
}
|
16835
|
+
};
|
16795
16836
|
var vert = (dictFoldable) => {
|
16796
16837
|
const fromFoldable26 = dictFoldable.foldr(Cons)(Nil);
|
16797
16838
|
return (delim) => {
|
@@ -16904,75 +16945,6 @@ var getPrec = (x) => {
|
|
16904
16945
|
}
|
16905
16946
|
fail();
|
16906
16947
|
};
|
16907
|
-
var exprType = (v) => {
|
16908
|
-
if (v.tag === "Var") {
|
16909
|
-
return Simple;
|
16910
|
-
}
|
16911
|
-
if (v.tag === "Op") {
|
16912
|
-
return Simple;
|
16913
|
-
}
|
16914
|
-
if (v.tag === "Int") {
|
16915
|
-
return Simple;
|
16916
|
-
}
|
16917
|
-
if (v.tag === "Float") {
|
16918
|
-
return Simple;
|
16919
|
-
}
|
16920
|
-
if (v.tag === "Str") {
|
16921
|
-
return Simple;
|
16922
|
-
}
|
16923
|
-
if (v.tag === "Constr") {
|
16924
|
-
if (v._4.tag === "Nil") {
|
16925
|
-
return Simple;
|
16926
|
-
}
|
16927
|
-
return Expression;
|
16928
|
-
}
|
16929
|
-
if (v.tag === "Dictionary") {
|
16930
|
-
return Simple;
|
16931
|
-
}
|
16932
|
-
if (v.tag === "Matrix") {
|
16933
|
-
return Simple;
|
16934
|
-
}
|
16935
|
-
if (v.tag === "Lambda") {
|
16936
|
-
return Simple;
|
16937
|
-
}
|
16938
|
-
if (v.tag === "Project") {
|
16939
|
-
return Simple;
|
16940
|
-
}
|
16941
|
-
if (v.tag === "DProject") {
|
16942
|
-
return Simple;
|
16943
|
-
}
|
16944
|
-
if (v.tag === "App") {
|
16945
|
-
return Expression;
|
16946
|
-
}
|
16947
|
-
if (v.tag === "BinaryApp") {
|
16948
|
-
return Expression;
|
16949
|
-
}
|
16950
|
-
if (v.tag === "MatchAs") {
|
16951
|
-
return Simple;
|
16952
|
-
}
|
16953
|
-
if (v.tag === "IfElse") {
|
16954
|
-
return Simple;
|
16955
|
-
}
|
16956
|
-
if (v.tag === "ListEmpty") {
|
16957
|
-
return Simple;
|
16958
|
-
}
|
16959
|
-
if (v.tag === "ListNonEmpty") {
|
16960
|
-
return Simple;
|
16961
|
-
}
|
16962
|
-
if (v.tag === "ListEnum") {
|
16963
|
-
return Simple;
|
16964
|
-
}
|
16965
|
-
if (v.tag === "ListComp") {
|
16966
|
-
return Simple;
|
16967
|
-
}
|
16968
|
-
if (v.tag === "Let") {
|
16969
|
-
return Expression;
|
16970
|
-
}
|
16971
|
-
if (v.tag === "LetRec") {
|
16972
|
-
return Expression;
|
16973
|
-
}
|
16974
|
-
fail();
|
16975
|
-
};
|
16976
16948
|
var comma = /* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" ,"));
|
16977
16949
|
var hcomma = (dictFoldable) => {
|
16978
16950
|
const $0 = dictFoldable.foldr(Cons)(Nil);
|
@@ -16989,30 +16961,29 @@ var between2 = (l) => (r) => (doc) => beside(beside(l)(doc))(r);
|
|
16989
16961
|
var brackets = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" [")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" ]")));
|
16990
16962
|
var curlyBraces = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" {")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" }")));
|
16991
16963
|
var keyBracks = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" [")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" ]")));
|
16992
|
-
var
|
16993
|
-
var
|
16994
|
-
|
16995
|
-
|
16996
|
-
return parens(doc);
|
16964
|
+
var parentheses = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" (")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" )")));
|
16965
|
+
var prettySimple = (dictIsSimple) => (dictPretty) => (s) => {
|
16966
|
+
if (dictIsSimple.isSimple(s)) {
|
16967
|
+
return dictPretty.pretty(s);
|
16997
16968
|
}
|
16998
|
-
return
|
16969
|
+
return parentheses(dictPretty.pretty(s));
|
16999
16970
|
};
|
17000
|
-
var prettyConstr = (dictPretty) => (v) => (v1) => {
|
16971
|
+
var prettyConstr = (dictIsSimple) => (dictPretty) => (v) => (v1) => {
|
17001
16972
|
const $0 = (c, xs) => hcat($List(
|
17002
16973
|
"Cons",
|
17003
16974
|
checkOneLine(split("\n")(" " + showCtr(c))),
|
17004
|
-
listMap(
|
16975
|
+
listMap(prettySimple(dictIsSimple)(dictPretty))(xs)
|
17005
16976
|
));
|
17006
16977
|
if (v1.tag === "Cons") {
|
17007
16978
|
if (v1._2.tag === "Cons") {
|
17008
16979
|
if (v === "Pair") {
|
17009
|
-
return assertWith("")(v1._2._2.tag === "Nil")(
|
16980
|
+
return assertWith("")(v1._2._2.tag === "Nil")(parentheses(hcomma2([dictPretty.pretty(v1._1), dictPretty.pretty(v1._2._1)])));
|
17010
16981
|
}
|
17011
16982
|
if (v === "Nil") {
|
17012
16983
|
return assertWith("")(v1.tag === "Nil")(nil2);
|
17013
16984
|
}
|
17014
16985
|
if (v === ":") {
|
17015
|
-
return assertWith("")(v1._2._2.tag === "Nil")(
|
16986
|
+
return assertWith("")(v1._2._2.tag === "Nil")(parentheses(hcat1([
|
17016
16987
|
dictPretty.pretty(v1._1),
|
17017
16988
|
checkOneLine(split("\n")(" :")),
|
17018
16989
|
dictPretty.pretty(v1._2._1)
|
@@ -17024,7 +16995,7 @@ var prettyConstr = (dictPretty) => (v) => (v1) => {
|
|
17024
16995
|
return assertWith("")(v1.tag === "Nil")(nil2);
|
17025
16996
|
}
|
17026
16997
|
if (v1._2.tag === "Nil") {
|
17027
|
-
return beside(checkOneLine(split("\n")(" " + showCtr(v))))(dictPretty
|
16998
|
+
return beside(checkOneLine(split("\n")(" " + showCtr(v))))(prettySimple(dictIsSimple)(dictPretty)(v1._1));
|
17028
16999
|
}
|
17029
17000
|
return $0(v, v1);
|
17030
17001
|
}
|
@@ -17033,7 +17004,6 @@ var prettyConstr = (dictPretty) => (v) => (v1) => {
|
|
17033
17004
|
}
|
17034
17005
|
return $0(v, v1);
|
17035
17006
|
};
|
17036
|
-
var parentheses = /* @__PURE__ */ between2(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" (")))(/* @__PURE__ */ checkOneLine(/* @__PURE__ */ split("\n")(" )")));
|
17037
17007
|
var prettyPattern = {
|
17038
17008
|
pretty: (v) => {
|
17039
17009
|
if (v.tag === "PVar") {
|
@@ -17138,7 +17108,7 @@ var prettyExpr = (dictHighlightable) => ({
|
|
17138
17108
|
return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyRecordOrDict(prettyExpr(dictHighlightable))(checkOneLine(split("\n")(" :")))(keyBracks)(curlyBraces)(prettyExpr(dictHighlightable).pretty)(listMap(toTuple)(v._3))));
|
17139
17109
|
}
|
17140
17110
|
if (v.tag === "Constr") {
|
17141
|
-
return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyConstr(prettyExpr(dictHighlightable))(v._3)(v._4)));
|
17111
|
+
return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyConstr(isSimpleExpr)(prettyExpr(dictHighlightable))(v._3)(v._4)));
|
17142
17112
|
}
|
17143
17113
|
if (v.tag === "Matrix") {
|
17144
17114
|
return beside(prettyDocOpt(prettyExpr(dictHighlightable)).pretty(v._2))(dictHighlightable.highlightIf(v._1)(prettyMatrix(dictHighlightable)(v._3)(v._4._1)(v._4._2)(v._5)));
|
@@ -17147,7 +17117,7 @@ var prettyExpr = (dictHighlightable) => ({
|
|
17147
17117
|
return hcat1([dictHighlightable.highlightIf(v._1)(checkOneLine(split("\n")(" fun"))), prettyElim(dictHighlightable).pretty(v._2)]);
|
17148
17118
|
}
|
17149
17119
|
if (v.tag === "Op") {
|
17150
|
-
return
|
17120
|
+
return parentheses(checkOneLine(split("\n")(" " + v._1)));
|
17151
17121
|
}
|
17152
17122
|
if (v.tag === "Let") {
|
17153
17123
|
return atop(hcat1([
|
@@ -17248,7 +17218,7 @@ var prettyFun = (dictHighlightable) => ({
|
|
17248
17218
|
return checkOneLine(split("\n")(" " + v._1._1));
|
17249
17219
|
}
|
17250
17220
|
if (v.tag === "PartialConstr") {
|
17251
|
-
return prettyConstr(prettyVal(dictHighlightable))(v._1)(v._2);
|
17221
|
+
return prettyConstr(isSimpleVal)(prettyVal(dictHighlightable))(v._1)(v._2);
|
17252
17222
|
}
|
17253
17223
|
fail();
|
17254
17224
|
}
|
@@ -17285,7 +17255,7 @@ var prettyBaseVal = (dictHighlightable) => ({
|
|
17285
17255
|
))(toUnfoldable13(v._1)));
|
17286
17256
|
}
|
17287
17257
|
if (v.tag === "Constr") {
|
17288
|
-
return prettyConstr(prettyVal(dictHighlightable))(v._1)(v._2);
|
17258
|
+
return prettyConstr(isSimpleVal)(prettyVal(dictHighlightable))(v._1)(v._2);
|
17289
17259
|
}
|
17290
17260
|
if (v.tag === "Matrix") {
|
17291
17261
|
return vert1(comma)(arrayMap((() => {
|
@@ -17387,7 +17357,7 @@ var prettyExpr1 = (dictAnn) => {
|
|
17387
17357
|
return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(checkOneLine(split("\n")(' "' + v._3 + '"'))));
|
17388
17358
|
}
|
17389
17359
|
if (v.tag === "Constr") {
|
17390
|
-
return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(prettyConstr(prettyExpr1(dictAnn))(v._3)(v._4)));
|
17360
|
+
return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(prettyConstr(isSimpleExpr1)(prettyExpr1(dictAnn))(v._3)(v._4)));
|
17391
17361
|
}
|
17392
17362
|
if (v.tag === "Dictionary") {
|
17393
17363
|
return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(curlyBraces(prettyDictEntries(dictAnn)(atop)(v._3))));
|
@@ -17396,13 +17366,13 @@ var prettyExpr1 = (dictAnn) => {
|
|
17396
17366
|
return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._2))($0.highlightIf(v._1)(arrayBrackets(beside(beside(beside(beside(prettyExpr1(dictAnn).pretty(v._3))(checkOneLine(split("\n")(" |"))))(parentheses(beside(beside(checkOneLine(split("\n")(" " + v._4._1)))(checkOneLine(split("\n")(" ,"))))(checkOneLine(split("\n")(" " + v._4._2))))))(checkOneLine(split("\n")(" in"))))(prettyExpr1(dictAnn).pretty(v._5)))));
|
17397
17367
|
}
|
17398
17368
|
if (v.tag === "Lambda") {
|
17399
|
-
return
|
17369
|
+
return beside(checkOneLine(split("\n")(" fun")))(prettyClauses(dictAnn).pretty(v._1));
|
17400
17370
|
}
|
17401
17371
|
if (v.tag === "Project") {
|
17402
|
-
return beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(dictAnn)(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" " + v._3)));
|
17372
|
+
return beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" " + v._3)));
|
17403
17373
|
}
|
17404
17374
|
if (v.tag === "DProject") {
|
17405
|
-
return beside(beside(beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(dictAnn)(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" ["))))(prettySimple(dictAnn)(v._3)))(checkOneLine(split("\n")(" ]")));
|
17375
|
+
return beside(beside(beside(beside(beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._2)))(checkOneLine(split("\n")(" ."))))(checkOneLine(split("\n")(" ["))))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._3)))(checkOneLine(split("\n")(" ]")));
|
17406
17376
|
}
|
17407
17377
|
if (v.tag === "App") {
|
17408
17378
|
return beside(prettyDocOpt(prettyExpr1(dictAnn)).pretty(v._1))(prettyAppChain(dictAnn)($Expr2("App", v._1, v._2, v._3)));
|
@@ -17464,16 +17434,6 @@ var prettyBranch = (dictAnn) => ({
|
|
17464
17434
|
v._2._2
|
17465
17435
|
)))
|
17466
17436
|
});
|
17467
|
-
var prettySimple = (dictAnn) => (s) => {
|
17468
|
-
const v = exprType(s);
|
17469
|
-
if (v === "Simple") {
|
17470
|
-
return prettyExpr1(dictAnn).pretty(s);
|
17471
|
-
}
|
17472
|
-
if (v === "Expression") {
|
17473
|
-
return parentheses(prettyExpr1(dictAnn).pretty(s));
|
17474
|
-
}
|
17475
|
-
fail();
|
17476
|
-
};
|
17477
17437
|
var prettyDictEntries = (dictAnn) => (v) => (v1) => {
|
17478
17438
|
if (v1.tag === "Nil") {
|
17479
17439
|
return empty2;
|
@@ -17502,9 +17462,9 @@ var prettyBinApp = (dictAnn) => (v) => (v1) => {
|
|
17502
17462
|
};
|
17503
17463
|
var prettyAppChain = (dictAnn) => (v) => {
|
17504
17464
|
if (v.tag === "App") {
|
17505
|
-
return beside(prettyAppChain(dictAnn)(v._2))(prettySimple(dictAnn)(v._3));
|
17465
|
+
return beside(prettyAppChain(dictAnn)(v._2))(prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v._3));
|
17506
17466
|
}
|
17507
|
-
return prettySimple(dictAnn)(v);
|
17467
|
+
return prettySimple(isSimpleExpr1)(prettyExpr1(dictAnn))(v);
|
17508
17468
|
};
|
17509
17469
|
|
17510
17470
|
// output-es/Val/index.js
|