@explorable-viz/fluid 0.7.63 → 0.7.65

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.
Files changed (157) hide show
  1. package/dist/fluid/fluid/lib/graphics.fld +6 -6
  2. package/dist/fluid/shared/fluid.mjs +4 -3
  3. package/dist/fluid/shared/load-figure.js +338 -168
  4. package/package.json +3 -2
  5. package/script/bundle-website.sh +5 -2
  6. package/dist/fluid/fluid/dataset/methane-emissions.fld +0 -123
  7. package/dist/fluid/fluid/dataset/mini-non-renewables.fld +0 -3
  8. package/dist/fluid/fluid/dataset/mini-renewables.fld +0 -6
  9. package/dist/fluid/fluid/dataset/non-renewables.fld +0 -67
  10. package/dist/fluid/fluid/dataset/renewables-new.fld +0 -301
  11. package/dist/fluid/fluid/dataset/renewables-restricted.fld +0 -139
  12. package/dist/fluid/fluid/dataset/renewables.fld +0 -100
  13. package/dist/fluid/fluid/dataset/ssp126-2081-2100.fld +0 -194
  14. package/dist/fluid/fluid/example/arithmetic.fld +0 -1
  15. package/dist/fluid/fluid/example/array.fld +0 -2
  16. package/dist/fluid/fluid/example/compose.fld +0 -2
  17. package/dist/fluid/fluid/example/desugar/list-comp-1.fld +0 -1
  18. package/dist/fluid/fluid/example/desugar/list-comp-10.fld +0 -1
  19. package/dist/fluid/fluid/example/desugar/list-comp-2.fld +0 -1
  20. package/dist/fluid/fluid/example/desugar/list-comp-3.fld +0 -1
  21. package/dist/fluid/fluid/example/desugar/list-comp-4.fld +0 -1
  22. package/dist/fluid/fluid/example/desugar/list-comp-5.fld +0 -1
  23. package/dist/fluid/fluid/example/desugar/list-comp-6.fld +0 -1
  24. package/dist/fluid/fluid/example/desugar/list-comp-7.fld +0 -1
  25. package/dist/fluid/fluid/example/desugar/list-comp-8.fld +0 -1
  26. package/dist/fluid/fluid/example/desugar/list-comp-9.fld +0 -1
  27. package/dist/fluid/fluid/example/desugar/list-enum.fld +0 -1
  28. package/dist/fluid/fluid/example/dict-list-comp.fld +0 -1
  29. package/dist/fluid/fluid/example/dicts.fld +0 -10
  30. package/dist/fluid/fluid/example/div-mod-quot-rem.fld +0 -4
  31. package/dist/fluid/fluid/example/factorial.fld +0 -6
  32. package/dist/fluid/fluid/example/filter.fld +0 -1
  33. package/dist/fluid/fluid/example/first-class-constr.fld +0 -1
  34. package/dist/fluid/fluid/example/flatten.fld +0 -12
  35. package/dist/fluid/fluid/example/foldr-sumSquares.fld +0 -1
  36. package/dist/fluid/fluid/example/graphics/background.fld +0 -7
  37. package/dist/fluid/fluid/example/graphics/grouped-bar-chart.fld +0 -9
  38. package/dist/fluid/fluid/example/graphics/line-chart.fld +0 -13
  39. package/dist/fluid/fluid/example/graphics/stacked-bar-chart.fld +0 -3
  40. package/dist/fluid/fluid/example/include-input-into-output.fld +0 -1
  41. package/dist/fluid/fluid/example/length.fld +0 -1
  42. package/dist/fluid/fluid/example/lexicalScoping.fld +0 -3
  43. package/dist/fluid/fluid/example/lib/some-constants.fld +0 -1
  44. package/dist/fluid/fluid/example/linked-inputs/energyscatter.fld +0 -23
  45. package/dist/fluid/fluid/example/linked-inputs/mini-energyscatter.fld +0 -29
  46. package/dist/fluid/fluid/example/linked-outputs/convolution-data.fld +0 -5
  47. package/dist/fluid/fluid/example/linked-outputs/convolution.fld +0 -12
  48. package/dist/fluid/fluid/example/linked-outputs/line-chart.fld +0 -15
  49. package/dist/fluid/fluid/example/linked-outputs/moving-average.fld +0 -19
  50. package/dist/fluid/fluid/example/linked-outputs/pairs-data.fld +0 -1
  51. package/dist/fluid/fluid/example/lookup.fld +0 -15
  52. package/dist/fluid/fluid/example/map.fld +0 -1
  53. package/dist/fluid/fluid/example/mergeSort.fld +0 -22
  54. package/dist/fluid/fluid/example/normalise.fld +0 -3
  55. package/dist/fluid/fluid/example/nub.fld +0 -1
  56. package/dist/fluid/fluid/example/pattern-match.fld +0 -12
  57. package/dist/fluid/fluid/example/percent.fld +0 -1
  58. package/dist/fluid/fluid/example/plot/methane.fld +0 -14
  59. package/dist/fluid/fluid/example/plot/non-renewables.fld +0 -21
  60. package/dist/fluid/fluid/example/range.fld +0 -4
  61. package/dist/fluid/fluid/example/record-lookup.fld +0 -3
  62. package/dist/fluid/fluid/example/records.expect.fld +0 -0
  63. package/dist/fluid/fluid/example/records.fld +0 -11
  64. package/dist/fluid/fluid/example/reverse.fld +0 -1
  65. package/dist/fluid/fluid/example/scratchpad.fld +0 -6
  66. package/dist/fluid/fluid/example/slicing/add.expect.fld +0 -1
  67. package/dist/fluid/fluid/example/slicing/add.fld +0 -1
  68. package/dist/fluid/fluid/example/slicing/array/array.expect.fld +0 -2
  69. package/dist/fluid/fluid/example/slicing/array/array.fld +0 -4
  70. package/dist/fluid/fluid/example/slicing/array/dims.expect.fld +0 -3
  71. package/dist/fluid/fluid/example/slicing/array/dims.fld +0 -3
  72. package/dist/fluid/fluid/example/slicing/array/lookup.expect.fld +0 -3
  73. package/dist/fluid/fluid/example/slicing/array/lookup.fld +0 -5
  74. package/dist/fluid/fluid/example/slicing/array/renewables.fld +0 -100
  75. package/dist/fluid/fluid/example/slicing/convolution/edgeDetect.expect.fld +0 -1
  76. package/dist/fluid/fluid/example/slicing/convolution/edgeDetect.fld +0 -1
  77. package/dist/fluid/fluid/example/slicing/convolution/emboss-wrap.fld +0 -1
  78. package/dist/fluid/fluid/example/slicing/convolution/emboss.expect.fld +0 -1
  79. package/dist/fluid/fluid/example/slicing/convolution/emboss.fld +0 -1
  80. package/dist/fluid/fluid/example/slicing/convolution/filter/edge-detect.fld +0 -5
  81. package/dist/fluid/fluid/example/slicing/convolution/filter/emboss.fld +0 -5
  82. package/dist/fluid/fluid/example/slicing/convolution/filter/gaussian.fld +0 -5
  83. package/dist/fluid/fluid/example/slicing/convolution/gaussian.expect.fld +0 -1
  84. package/dist/fluid/fluid/example/slicing/convolution/gaussian.fld +0 -1
  85. package/dist/fluid/fluid/example/slicing/convolution/test-image.fld +0 -7
  86. package/dist/fluid/fluid/example/slicing/dict/create.expect.fld +0 -2
  87. package/dist/fluid/fluid/example/slicing/dict/create.fld +0 -1
  88. package/dist/fluid/fluid/example/slicing/dict/difference.expect.fld +0 -4
  89. package/dist/fluid/fluid/example/slicing/dict/difference.fld +0 -3
  90. package/dist/fluid/fluid/example/slicing/dict/disjointUnion.expect.fld +0 -2
  91. package/dist/fluid/fluid/example/slicing/dict/disjointUnion.fld +0 -1
  92. package/dist/fluid/fluid/example/slicing/dict/foldl.expect.fld +0 -3
  93. package/dist/fluid/fluid/example/slicing/dict/foldl.fld +0 -1
  94. package/dist/fluid/fluid/example/slicing/dict/get.expect.fld +0 -5
  95. package/dist/fluid/fluid/example/slicing/dict/get.fld +0 -3
  96. package/dist/fluid/fluid/example/slicing/dict/intersectionWith.expect.fld +0 -5
  97. package/dist/fluid/fluid/example/slicing/dict/intersectionWith.fld +0 -4
  98. package/dist/fluid/fluid/example/slicing/dict/map.expect.fld +0 -8
  99. package/dist/fluid/fluid/example/slicing/dict/map.fld +0 -5
  100. package/dist/fluid/fluid/example/slicing/dict/match.expect.fld +0 -6
  101. package/dist/fluid/fluid/example/slicing/dict/match.fld +0 -5
  102. package/dist/fluid/fluid/example/slicing/divide.expect.fld +0 -1
  103. package/dist/fluid/fluid/example/slicing/divide.fld +0 -1
  104. package/dist/fluid/fluid/example/slicing/dtw/average-series.expect.fld +0 -8
  105. package/dist/fluid/fluid/example/slicing/dtw/average-series.fld +0 -8
  106. package/dist/fluid/fluid/example/slicing/dtw/compute-dtw.expect.fld +0 -6
  107. package/dist/fluid/fluid/example/slicing/dtw/compute-dtw.fld +0 -6
  108. package/dist/fluid/fluid/example/slicing/explained.expect.fld +0 -1
  109. package/dist/fluid/fluid/example/slicing/explained.fld +0 -1
  110. package/dist/fluid/fluid/example/slicing/filter.expect.fld +0 -4
  111. package/dist/fluid/fluid/example/slicing/filter.fld +0 -6
  112. package/dist/fluid/fluid/example/slicing/intersperse-1.expect.fld +0 -4
  113. package/dist/fluid/fluid/example/slicing/intersperse-2.expect.fld +0 -4
  114. package/dist/fluid/fluid/example/slicing/intersperse.fld +0 -5
  115. package/dist/fluid/fluid/example/slicing/length.expect.fld +0 -1
  116. package/dist/fluid/fluid/example/slicing/length.fld +0 -1
  117. package/dist/fluid/fluid/example/slicing/linked-outputs/bar-chart-line-chart.expect.fld +0 -0
  118. package/dist/fluid/fluid/example/slicing/linked-outputs/bar-chart-line-chart.fld +0 -29
  119. package/dist/fluid/fluid/example/slicing/linked-outputs/stacked-bar-scatter-plot.expect.fld +0 -0
  120. package/dist/fluid/fluid/example/slicing/linked-outputs/stacked-bar-scatter-plot.fld +0 -38
  121. package/dist/fluid/fluid/example/slicing/list-comp-1.expect.fld +0 -6
  122. package/dist/fluid/fluid/example/slicing/list-comp-2.expect.fld +0 -6
  123. package/dist/fluid/fluid/example/slicing/list-comp.fld +0 -8
  124. package/dist/fluid/fluid/example/slicing/lookup.expect.fld +0 -6
  125. package/dist/fluid/fluid/example/slicing/lookup.fld +0 -14
  126. package/dist/fluid/fluid/example/slicing/map.expect.fld +0 -1
  127. package/dist/fluid/fluid/example/slicing/map.fld +0 -1
  128. package/dist/fluid/fluid/example/slicing/matrix-update.expect.fld +0 -5
  129. package/dist/fluid/fluid/example/slicing/matrix-update.fld +0 -10
  130. package/dist/fluid/fluid/example/slicing/multiply.expect.fld +0 -1
  131. package/dist/fluid/fluid/example/slicing/multiply.fld +0 -1
  132. package/dist/fluid/fluid/example/slicing/nth.expect.fld +0 -1
  133. package/dist/fluid/fluid/example/slicing/nth.fld +0 -1
  134. package/dist/fluid/fluid/example/slicing/output-not-source.expect.fld +0 -2
  135. package/dist/fluid/fluid/example/slicing/output-not-source.fld +0 -1
  136. package/dist/fluid/fluid/example/slicing/qcut.expect.fld +0 -0
  137. package/dist/fluid/fluid/example/slicing/qcut.fld +0 -2
  138. package/dist/fluid/fluid/example/slicing/section-5-example-1.expect.fld +0 -10
  139. package/dist/fluid/fluid/example/slicing/section-5-example-2.expect.fld +0 -10
  140. package/dist/fluid/fluid/example/slicing/section-5-example-3.expect.fld +0 -10
  141. package/dist/fluid/fluid/example/slicing/section-5-example.fld +0 -14
  142. package/dist/fluid/fluid/example/slicing/zeros-1.expect.fld +0 -3
  143. package/dist/fluid/fluid/example/slicing/zeros-2.expect.fld +0 -3
  144. package/dist/fluid/fluid/example/slicing/zeros.fld +0 -4
  145. package/dist/fluid/fluid/example/slicing/zipWith-1.expect.fld +0 -4
  146. package/dist/fluid/fluid/example/slicing/zipWith.fld +0 -4
  147. package/dist/fluid/fluid/example/text-viz/datasets/ssp126.fld +0 -898
  148. package/dist/fluid/fluid/example/text-viz/datasets/ssp245.fld +0 -954
  149. package/dist/fluid/fluid/example/text-viz/datasets/ssp370.fld +0 -842
  150. package/dist/fluid/fluid/example/text-viz/datasets/ssp585.fld +0 -954
  151. package/dist/fluid/fluid/example/text-viz/explainable-table.fld +0 -7
  152. package/dist/fluid/fluid/example/text-viz/fake-probabilities.fld +0 -3
  153. package/dist/fluid/fluid/example/text-viz/figure-spm-4.fld +0 -42
  154. package/dist/fluid/fluid/example/text-viz/left-barchart-table.fld +0 -5
  155. package/dist/fluid/fluid/example/text-viz/likelihoods.fld +0 -9
  156. package/dist/fluid/fluid/example/text-viz/right-barchart-table.fld +0 -5
  157. package/dist/fluid/fluid/example/text-viz/table-spm-1.fld +0 -30
@@ -6,7 +6,7 @@
6
6
  -- GraphicsElement -> Point
7
7
  let coords (Group gs) = Point 0 0;
8
8
  coords (Rect x y _ _ _) = Point x y;
9
- coords (Text x y _ _ _) = Point x y;
9
+ coords (String x y _ _ _) = Point x y;
10
10
  coords (Viewport x y _ _ _ _ _ _ _) = Point x y;
11
11
 
12
12
  -- GraphicsElement -> Float
@@ -19,7 +19,7 @@ let get_y g = let Point _ y = coords g in x;
19
19
  -- Float -> GraphicsElement -> GraphicsElement
20
20
  let set_x x (Group gs) = error "Group has immutable coordinates";
21
21
  set_x x (Rect _ y w h fill) = Rect x y w h fill;
22
- set_x x (Text _ y str anchor baseline) = Text x y str anchor baseline;
22
+ set_x x (String _ y str anchor baseline) = String x y str anchor baseline;
23
23
  set_x x (Viewport _ y w h fill margin scale translate g) = Viewport x y w h fill margin scale translate g;
24
24
 
25
25
  -- (Point, Point) -> Point
@@ -33,7 +33,7 @@ let
33
33
  dimensions (Group gs) = foldl (curry dimensions2) (Point 0 0) (map (coords_op) gs);
34
34
  dimensions (Polyline ps _ _) = foldl (curry dimensions2) (Point 0 0) ps;
35
35
  dimensions (Rect _ _ w h _) = Point w h;
36
- dimensions (Text _ _ _ _ _) = Point 0 0; -- treat text like markers; scale-invariant
36
+ dimensions (String _ _ _ _ _) = Point 0 0; -- treat text like markers; scale-invariant
37
37
  dimensions (Viewport _ _ w h _ _ _ _ _) = Point w h;
38
38
 
39
39
  coords_op g =
@@ -94,8 +94,8 @@ let tick Horiz colour len = Line (Point 0 0) (Point 0 (0 - len)) colour axisStro
94
94
  tick Vert colour len = Line (Point 0 0) (Point (0 - len) 0) colour axisStrokeWidth;
95
95
 
96
96
  -- Orient -> Float -> Float -> Str -> GraphicsElement
97
- let label Horiz x distance str = Text x (0 - distance - 4) str "middle" "hanging";
98
- label Vert x distance str = Text (0 - distance) x str "end" "central";
97
+ let label Horiz x distance str = String x (0 - distance - 4) str "middle" "hanging";
98
+ label Vert x distance str = String (0 - distance) x str "end" "central";
99
99
 
100
100
  -- Orient -> Colour -> Float -> Str -> GraphicsElement
101
101
  let labelledTick orient colour len str =
@@ -215,7 +215,7 @@ let stackedBarChart = categoricalChart (compose map stackedBar);
215
215
  -- Str -> GraphicsElement -> GraphicsElement
216
216
  let caption str (Viewport x y w h fill margin scale translate g) =
217
217
  let g' = Group [
218
- Text (x + w / 2) -2 str "middle" "hanging",
218
+ String (x + w / 2) -2 str "middle" "hanging",
219
219
  Viewport 0 0 w h fill margin scale translate g
220
220
  ]
221
221
  in Viewport x y w h backgroundColour (defaultMargin / 2 + 4) (Scale 1 1) (Translate 0 0) g';
@@ -10162,7 +10162,7 @@ var dataTypes = /* @__PURE__ */ foldrArray(Cons)(Nil)([
10162
10162
  /* @__PURE__ */ dataType("View")([
10163
10163
  /* @__PURE__ */ $Tuple("BarChart", 1),
10164
10164
  /* @__PURE__ */ $Tuple("LineChart", 1),
10165
- /* @__PURE__ */ $Tuple("LinkedText", 1),
10165
+ /* @__PURE__ */ $Tuple("Paragraph", 1),
10166
10166
  /* @__PURE__ */ $Tuple("MultiView", 1),
10167
10167
  /* @__PURE__ */ $Tuple("ScatterPlot", 1)
10168
10168
  ]),
@@ -10175,11 +10175,12 @@ var dataTypes = /* @__PURE__ */ foldrArray(Cons)(Nil)([
10175
10175
  /* @__PURE__ */ $Tuple("Polyline", 3),
10176
10176
  /* @__PURE__ */ $Tuple("Polymarkers", 2),
10177
10177
  /* @__PURE__ */ $Tuple("Rect", 5),
10178
- /* @__PURE__ */ $Tuple("Text", 5),
10178
+ /* @__PURE__ */ $Tuple("String", 5),
10179
10179
  /* @__PURE__ */ $Tuple("Viewport", 9)
10180
10180
  ]),
10181
10181
  /* @__PURE__ */ dataType("Transform")([/* @__PURE__ */ $Tuple("Scale", 2), /* @__PURE__ */ $Tuple("Translate", 2)]),
10182
- /* @__PURE__ */ dataType("Marker")([/* @__PURE__ */ $Tuple("Arrowhead", 0)])
10182
+ /* @__PURE__ */ dataType("Marker")([/* @__PURE__ */ $Tuple("Arrowhead", 0)]),
10183
+ /* @__PURE__ */ dataType("TextFragment")([/* @__PURE__ */ $Tuple("Text", 1), /* @__PURE__ */ $Tuple("Link", 2)])
10183
10184
  ]);
10184
10185
  var ctrToDataType = /* @__PURE__ */ (() => fromFoldable2(foldableList)(bindList.bind(listMap((d) => listMap((v) => $Tuple(
10185
10186
  v,