@explorable-viz/fluid 0.12.1 → 0.12.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.
Files changed (236) hide show
  1. package/dist/fluid/shared/fluid.mjs +478 -438
  2. package/dist/fluid/shared/load-figure.js +3199 -2975
  3. package/package.json +12 -26
  4. package/script/install-website.sh +27 -9
  5. package/web/lib/CodeMirror.svelte +19 -0
  6. package/web/lib/DataPane.svelte +46 -0
  7. package/web/lib/Figure.svelte +38 -0
  8. package/web/lib/FigureSrc.svelte +35 -0
  9. package/web/lib/Grid.svelte +32 -0
  10. package/web/lib/index.js +5 -0
  11. package/web/lib/view-styles.css +262 -0
  12. package/website/article/eslint.config.js +45 -0
  13. package/website/article/package.json +46 -0
  14. package/website/article/src/app.d.ts +13 -0
  15. package/website/article/src/app.html +12 -0
  16. package/website/article/src/lib/assets/css/styles.css +245 -0
  17. package/website/article/src/lib/assets/image/bristol.png +0 -0
  18. package/website/article/src/lib/assets/image/fluid.png +0 -0
  19. package/website/article/src/lib/assets/image/iccs.png +0 -0
  20. package/website/article/src/lib/assets/image/schmidt.png +0 -0
  21. package/website/article/src/lib/assets/image/turing.jpg +0 -0
  22. package/website/article/src/lib/config/nav.ts +7 -0
  23. package/website/article/src/lib/config/supporters.ts +27 -0
  24. package/website/article/src/routes/+layout.svelte +15 -0
  25. package/website/article/src/routes/+layout.ts +1 -0
  26. package/website/article/{index.html → src/routes/+page.svelte} +8 -17
  27. package/website/article/src/routes/convolution/+page.svelte +62 -0
  28. package/website/article/src/routes/energy-scatter/+page.svelte +34 -0
  29. package/website/article/src/routes/methane/+page.svelte +35 -0
  30. package/website/article/src/routes/moving-average/+page.svelte +57 -0
  31. package/website/article/src/routes/non-renewables/+page.svelte +40 -0
  32. package/website/article/src/routes/renewables-linked/+page.svelte +34 -0
  33. package/website/article/src/routes/scigen-1805.02474v1-10/+page.svelte +40 -0
  34. package/website/article/static/fluid/lib/graphics.fld +274 -0
  35. package/website/article/static/fluid/lib/matrix.fld +40 -0
  36. package/website/article/static/fluid/lib/prelude.fld +348 -0
  37. package/website/article/static/fluid/lib/stats.fld +83 -0
  38. package/website/article/svelte.config.js +13 -0
  39. package/website/article/test.mjs +66 -11
  40. package/website/article/tsconfig.json +20 -0
  41. package/website/article/vite.config.ts +6 -0
  42. package/.spago/aff/v7.1.0/.editorconfig +0 -13
  43. package/.spago/aff/v7.1.0/.eslintrc.json +0 -28
  44. package/.spago/aff/v7.1.0/.gitignore +0 -14
  45. package/.spago/aff/v7.1.0/.tidyrc.json +0 -10
  46. package/.spago/affjax/v13.0.0/.editorconfig +0 -13
  47. package/.spago/affjax/v13.0.0/.eslintrc.json +0 -28
  48. package/.spago/affjax/v13.0.0/.gitignore +0 -14
  49. package/.spago/affjax/v13.0.0/.tidyrc.json +0 -10
  50. package/.spago/affjax-web/v1.0.0/.editorconfig +0 -13
  51. package/.spago/affjax-web/v1.0.0/.eslintrc.json +0 -30
  52. package/.spago/affjax-web/v1.0.0/.gitignore +0 -14
  53. package/.spago/affjax-web/v1.0.0/.tidyrc.json +0 -10
  54. package/.spago/argonaut-codecs/v9.1.0/.editorconfig +0 -13
  55. package/.spago/argonaut-codecs/v9.1.0/.gitignore +0 -9
  56. package/.spago/argonaut-codecs/v9.1.0/.tidyrc.json +0 -10
  57. package/.spago/argonaut-core/v7.0.0/.editorconfig +0 -13
  58. package/.spago/argonaut-core/v7.0.0/.eslintrc.json +0 -29
  59. package/.spago/argonaut-core/v7.0.0/.gitignore +0 -14
  60. package/.spago/argonaut-core/v7.0.0/.tidyrc.json +0 -10
  61. package/.spago/arraybuffer-types/v3.0.2/.editorconfig +0 -13
  62. package/.spago/arraybuffer-types/v3.0.2/.gitignore +0 -9
  63. package/.spago/arraybuffer-types/v3.0.2/.tidyrc.json +0 -10
  64. package/.spago/arrays/v7.2.1/.eslintrc.json +0 -26
  65. package/.spago/arrays/v7.2.1/.gitignore +0 -9
  66. package/.spago/assert/v6.0.0/.eslintrc.json +0 -26
  67. package/.spago/assert/v6.0.0/.gitignore +0 -8
  68. package/.spago/bifunctors/v6.0.0/.gitignore +0 -7
  69. package/.spago/catenable-lists/v7.0.0/.gitignore +0 -7
  70. package/.spago/console/v6.1.0/.eslintrc.json +0 -30
  71. package/.spago/console/v6.1.0/.gitignore +0 -9
  72. package/.spago/const/v6.0.0/.gitignore +0 -7
  73. package/.spago/contravariant/v6.0.0/.gitignore +0 -7
  74. package/.spago/control/v6.0.0/.gitignore +0 -7
  75. package/.spago/datetime/v6.1.0/.eslintrc.json +0 -26
  76. package/.spago/datetime/v6.1.0/.gitignore +0 -8
  77. package/.spago/debug/v6.0.2/.eslintrc.json +0 -36
  78. package/.spago/debug/v6.0.2/.gitignore +0 -8
  79. package/.spago/distributive/v6.0.0/.gitignore +0 -7
  80. package/.spago/effect/v4.0.0/.eslintrc.json +0 -26
  81. package/.spago/effect/v4.0.0/.gitignore +0 -8
  82. package/.spago/either/v6.1.0/.gitignore +0 -7
  83. package/.spago/enums/v6.0.1/.gitignore +0 -7
  84. package/.spago/exceptions/v6.0.0/.eslintrc.json +0 -26
  85. package/.spago/exceptions/v6.0.0/.gitignore +0 -8
  86. package/.spago/exists/v6.0.0/.gitignore +0 -7
  87. package/.spago/filterable/v5.0.0/.gitignore +0 -11
  88. package/.spago/foldable-traversable/v6.0.0/.eslintrc.json +0 -26
  89. package/.spago/foldable-traversable/v6.0.0/.gitignore +0 -8
  90. package/.spago/foreign/v7.0.0/.eslintrc.json +0 -26
  91. package/.spago/foreign/v7.0.0/.gitignore +0 -8
  92. package/.spago/foreign-object/v4.1.0/.eslintrc.json +0 -26
  93. package/.spago/foreign-object/v4.1.0/.gitignore +0 -8
  94. package/.spago/form-urlencoded/v7.0.0/.editorconfig +0 -13
  95. package/.spago/form-urlencoded/v7.0.0/.gitignore +0 -9
  96. package/.spago/form-urlencoded/v7.0.0/.tidyrc.json +0 -10
  97. package/.spago/free/v7.1.0/.gitignore +0 -8
  98. package/.spago/functions/v6.0.0/.eslintrc.json +0 -26
  99. package/.spago/functions/v6.0.0/.gitignore +0 -8
  100. package/.spago/functors/v5.0.0/.gitignore +0 -7
  101. package/.spago/gen/v4.0.0/.gitignore +0 -8
  102. package/.spago/graphs/v8.1.0/.gitignore +0 -7
  103. package/.spago/http-methods/v6.0.0/.editorconfig +0 -13
  104. package/.spago/http-methods/v6.0.0/.gitignore +0 -9
  105. package/.spago/http-methods/v6.0.0/.tidyrc.json +0 -10
  106. package/.spago/identity/v6.0.0/.gitignore +0 -7
  107. package/.spago/integers/v6.0.0/.eslintrc.json +0 -26
  108. package/.spago/integers/v6.0.0/.gitignore +0 -8
  109. package/.spago/invariant/v6.0.0/.gitignore +0 -7
  110. package/.spago/js-date/v8.0.0/.editorconfig +0 -13
  111. package/.spago/js-date/v8.0.0/.eslintrc.json +0 -29
  112. package/.spago/js-date/v8.0.0/.gitignore +0 -14
  113. package/.spago/js-date/v8.0.0/.tidyrc.json +0 -10
  114. package/.spago/js-uri/v3.1.0/.eslintrc.json +0 -30
  115. package/.spago/js-uri/v3.1.0/.gitignore +0 -14
  116. package/.spago/js-uri/v3.1.0/.tidyrc.json +0 -10
  117. package/.spago/lazy/v6.0.0/.eslintrc.json +0 -26
  118. package/.spago/lazy/v6.0.0/.gitignore +0 -8
  119. package/.spago/lcg/v4.0.0/.gitignore +0 -8
  120. package/.spago/lists/v7.0.0/.gitignore +0 -7
  121. package/.spago/maybe/v6.0.0/.gitignore +0 -7
  122. package/.spago/media-types/v6.0.0/.editorconfig +0 -13
  123. package/.spago/media-types/v6.0.0/.gitignore +0 -9
  124. package/.spago/media-types/v6.0.0/.tidyrc.json +0 -10
  125. package/.spago/newtype/v5.0.0/.gitignore +0 -7
  126. package/.spago/node-buffer/v9.0.0/.eslintrc.json +0 -26
  127. package/.spago/node-buffer/v9.0.0/.gitignore +0 -8
  128. package/.spago/node-fs/v9.1.0/.eslintrc.json +0 -29
  129. package/.spago/node-fs/v9.1.0/.gitignore +0 -9
  130. package/.spago/node-path/v5.0.0/.eslintrc.json +0 -26
  131. package/.spago/node-path/v5.0.0/.gitignore +0 -8
  132. package/.spago/node-process/v11.2.0/.eslintrc.json +0 -29
  133. package/.spago/node-process/v11.2.0/.gitignore +0 -8
  134. package/.spago/node-streams/v9.0.0/.eslintrc.json +0 -29
  135. package/.spago/node-streams/v9.0.0/.gitignore +0 -8
  136. package/.spago/nonempty/v7.0.0/.gitignore +0 -7
  137. package/.spago/now/v6.0.0/.editorconfig +0 -13
  138. package/.spago/now/v6.0.0/.eslintrc.json +0 -29
  139. package/.spago/now/v6.0.0/.gitignore +0 -14
  140. package/.spago/now/v6.0.0/.tidyrc.json +0 -10
  141. package/.spago/nullable/v6.0.0/.editorconfig +0 -13
  142. package/.spago/nullable/v6.0.0/.eslintrc.json +0 -29
  143. package/.spago/nullable/v6.0.0/.gitignore +0 -14
  144. package/.spago/nullable/v6.0.0/.tidyrc.json +0 -10
  145. package/.spago/optparse/v6.0.0/.gitignore +0 -8
  146. package/.spago/optparse/v6.0.0/.npmrc +0 -1
  147. package/.spago/ordered-collections/v3.1.1/.gitignore +0 -8
  148. package/.spago/orders/v6.0.0/.gitignore +0 -7
  149. package/.spago/parallel/v7.0.0/.gitignore +0 -7
  150. package/.spago/parsing/v10.3.1/.editorconfig +0 -13
  151. package/.spago/parsing/v10.3.1/.gitignore +0 -12
  152. package/.spago/parsing/v10.3.1/.tidyoperators +0 -231
  153. package/.spago/parsing/v10.3.1/.tidyrc.json +0 -10
  154. package/.spago/partial/v4.0.0/.eslintrc.json +0 -26
  155. package/.spago/partial/v4.0.0/.gitignore +0 -8
  156. package/.spago/posix-types/v6.0.0/.gitignore +0 -7
  157. package/.spago/prelude/v6.0.1/.eslintrc.json +0 -26
  158. package/.spago/prelude/v6.0.1/.gitignore +0 -8
  159. package/.spago/profunctor/v6.0.0/.gitignore +0 -7
  160. package/.spago/psci-support/v6.0.0/.eslintrc.json +0 -28
  161. package/.spago/psci-support/v6.0.0/.gitignore +0 -8
  162. package/.spago/quickcheck/v8.0.1/.eslintrc.json +0 -26
  163. package/.spago/quickcheck/v8.0.1/.gitignore +0 -8
  164. package/.spago/random/v6.0.0/.eslintrc.json +0 -26
  165. package/.spago/random/v6.0.0/.gitignore +0 -8
  166. package/.spago/record/v4.0.0/.eslintrc.json +0 -26
  167. package/.spago/record/v4.0.0/.gitignore +0 -8
  168. package/.spago/refs/v6.0.0/.eslintrc.json +0 -26
  169. package/.spago/refs/v6.0.0/.gitignore +0 -8
  170. package/.spago/st/v6.2.0/.eslintrc.json +0 -26
  171. package/.spago/st/v6.2.0/.gitignore +0 -8
  172. package/.spago/strings/v6.0.1/.eslintrc.json +0 -26
  173. package/.spago/strings/v6.0.1/.gitignore +0 -8
  174. package/.spago/tailrec/v6.1.0/.gitignore +0 -7
  175. package/.spago/transformers/v6.0.0/.gitignore +0 -7
  176. package/.spago/tuples/v7.0.0/.gitignore +0 -7
  177. package/.spago/type-equality/v4.0.1/.gitignore +0 -7
  178. package/.spago/typelevel-prelude/v7.0.0/.gitignore +0 -8
  179. package/.spago/unfoldable/v6.0.0/.eslintrc.json +0 -26
  180. package/.spago/unfoldable/v6.0.0/.gitignore +0 -8
  181. package/.spago/unicode/v6.0.0/.editorconfig +0 -13
  182. package/.spago/unicode/v6.0.0/.gitattributes +0 -2
  183. package/.spago/unicode/v6.0.0/.gitignore +0 -19
  184. package/.spago/unicode/v6.0.0/.tidyrc.json +0 -10
  185. package/.spago/unsafe-coerce/v6.0.0/.eslintrc.json +0 -26
  186. package/.spago/unsafe-coerce/v6.0.0/.gitignore +0 -8
  187. package/.spago/web-dom/v6.0.0/.eslintrc.json +0 -29
  188. package/.spago/web-dom/v6.0.0/.gitignore +0 -9
  189. package/.spago/web-events/v4.0.0/.eslintrc.json +0 -29
  190. package/.spago/web-events/v4.0.0/.gitignore +0 -8
  191. package/.spago/web-file/v4.0.0/.eslintrc.json +0 -29
  192. package/.spago/web-file/v4.0.0/.gitignore +0 -8
  193. package/.spago/web-html/v4.1.0/.eslintrc.json +0 -29
  194. package/.spago/web-html/v4.1.0/.gitignore +0 -8
  195. package/.spago/web-storage/v5.0.0/.eslintrc.json +0 -29
  196. package/.spago/web-storage/v5.0.0/.gitignore +0 -8
  197. package/.spago/web-xhr/v5.0.1/.eslintrc.json +0 -29
  198. package/.spago/web-xhr/v5.0.1/.gitignore +0 -8
  199. package/LICENSE +0 -21
  200. package/README.md +0 -95
  201. package/dist/fluid/shared/website-test.js +0 -41
  202. package/dist/fluid/shared/webtest-lib.js +0 -300023
  203. package/script/bundle-website.sh +0 -52
  204. package/script/util/clean.sh +0 -5
  205. package/script/util/lisp-case.sh +0 -10
  206. package/website/article/convolution/index.html +0 -97
  207. package/website/article/css/styles.css +0 -325
  208. package/website/article/css/view-styles.css +0 -205
  209. package/website/article/energy-scatter/index.html +0 -47
  210. package/website/article/methane/index.html +0 -46
  211. package/website/article/moving-average/index.html +0 -64
  212. package/website/article/non-renewables/index.html +0 -52
  213. package/website/article/renewables-linked/index.html +0 -46
  214. package/website/article/scigen-1805.02474v1-10/index.html +0 -54
  215. package/website/article/shared/util.js +0 -15
  216. /package/website/article/{favicon.ico → src/lib/assets/image/favicon.ico} +0 -0
  217. /package/website/article/{dataset → static/dataset}/SciGen/1805.02474v1-10.json +0 -0
  218. /package/website/article/{dataset → static/dataset}/methane-emissions.json +0 -0
  219. /package/website/article/{dataset → static/dataset}/non-renewables.json +0 -0
  220. /package/website/article/{dataset → static/dataset}/renewable-new.json +0 -0
  221. /package/website/article/{dataset → static/dataset}/renewable.json +0 -0
  222. /package/website/article/{fluid → static/fluid}/1805.02474v1-10.fld +0 -0
  223. /package/website/article/{fluid → static/fluid}/bar-chart-line-chart.fld +0 -0
  224. /package/website/article/{fluid → static/fluid}/convolution/emboss.fld +0 -0
  225. /package/website/article/{fluid → static/fluid}/convolution/testImage.fld +0 -0
  226. /package/website/article/{fluid → static/fluid}/convolution.fld +0 -0
  227. /package/website/article/{fluid → static/fluid}/dataset/scigen/_1805_02474v1_10.fld +0 -0
  228. /package/website/article/{fluid → static/fluid}/energyscatter.fld +0 -0
  229. /package/website/article/{fluid → static/fluid}/methane.fld +0 -0
  230. /package/website/article/{fluid → static/fluid}/methane_data.fld +0 -0
  231. /package/website/article/{fluid → static/fluid}/moving-average.fld +0 -0
  232. /package/website/article/{fluid → static/fluid}/non-renewables.fld +0 -0
  233. /package/website/article/{fluid → static/fluid}/nonRenewables.fld +0 -0
  234. /package/website/article/{fluid → static/fluid}/renewables.fld +0 -0
  235. /package/website/article/{fluid → static/fluid}/scigen.fld +0 -0
  236. /package/website/article/{fluid → static/fluid}/util.fld +0 -0
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@explorable-viz/fluid",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "description": "A functional programming language which integrates a bidirectional dynamic analysis, connecting outputs to data sources in a fine-grained way. Fluid is implemented in PureScript and runs in the browser.",
5
- "main": "index.js",
6
5
  "repository": {
7
6
  "type": "git",
8
7
  "url": "git+https://github.com/explorable-viz/fluid.git#release"
@@ -20,31 +19,19 @@
20
19
  "files": [
21
20
  "dist/fluid/shared",
22
21
  "dist/fluid/fluid/lib",
23
- "script/bundle-website.sh",
24
- "script/bundle-page.sh",
25
- "script/util/clean.sh",
26
- "script/util/lisp-case.sh",
27
- "website/article",
28
- "script/install-website.sh",
29
- "script/util/serve.sh"
22
+ "web/lib",
23
+ "website/article"
30
24
  ],
31
25
  "scripts": {
32
- "benchmark": "./script/benchmark.sh",
33
26
  "build": "./script/build.sh",
34
27
  "build-prod": "BUILD_ENV=prod ./script/build.sh",
35
- "build-publish": "yarn build-prod && yarn publish",
28
+ "build-publish": "yarn build-prod && ./script/stage-website.sh article && yarn npm publish --access public",
36
29
  "build-test": "./script/build-test.sh",
37
30
  "bundle-fluid": "./script/bundle-fluid.sh",
38
- "bundle-serve": "sh -c './script/bundle-website.sh \"$@\" && ./script/serve.sh \"$1\"' _",
39
- "bundle-website": "./script/bundle-website.sh",
40
- "bundle-website-all": "./script/bundle-website-all.sh",
41
31
  "fluid": "node ./dist/fluid/shared/fluid.mjs",
42
- "serve": "./script/serve.sh",
43
32
  "test": "./script/test.sh",
44
33
  "test-all": "./script/test-all.sh",
45
34
  "test-browser": "./script/test.sh --browsers=Chrome --singleRun=false",
46
- "test-website": "./script/test-website.sh",
47
- "test-website-all": "./script/test-website-all.sh",
48
35
  "tidy": "./script/tidy.sh"
49
36
  },
50
37
  "dependencies": {
@@ -58,11 +45,6 @@
58
45
  "commander": "^12.1.0",
59
46
  "d3": "^7.9.0",
60
47
  "datetime": "^0.0.3",
61
- "express": "^4.19.2",
62
- "express-static": "^1.2.6",
63
- "http-server": "^14.1.1",
64
- "http-shutdown": "^1.2.2",
65
- "node": "^22.11.0",
66
48
  "node-process": "^1.0.1",
67
49
  "os": "^0.1.2",
68
50
  "util": "^0.12.5"
@@ -84,11 +66,15 @@
84
66
  "spago": "^0.21.0",
85
67
  "typescript": "^5.5.3"
86
68
  },
69
+ "engines": {
70
+ "node": ">=22"
71
+ },
87
72
  "bin": {
88
73
  "fluid": "./dist/fluid/shared/fluid.mjs",
89
- "test-website": "./dist/fluid/shared/website-test.js",
90
- "install-website": "./script/install-website.sh",
91
- "bundle-website": "./script/bundle-website.sh"
74
+ "install-website": "./script/install-website.sh"
92
75
  },
93
- "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
76
+ "svelte": "./web/lib/index.js",
77
+ "exports": {
78
+ ".": "./web/lib/index.js"
79
+ }
94
80
  }
@@ -1,15 +1,33 @@
1
1
  #!/usr/bin/env bash
2
- set -xeu
2
+ set -e
3
3
 
4
- # Run from root of repo
4
+ WEBSITE="${1:-article}"
5
+ NPM_ROOT="node_modules/@explorable-viz/fluid"
6
+ SRC="$NPM_ROOT/website/$WEBSITE"
7
+ DEST="website/$WEBSITE"
5
8
 
6
- WEBSITE=$1
7
- NPM_ROOT=node_modules/@explorable-viz/fluid
9
+ if [ ! -d "$SRC" ]; then
10
+ echo "Error: website '$WEBSITE' not found in $NPM_ROOT" >&2
11
+ echo "Available websites:"
12
+ ls "$NPM_ROOT/website/" 2>/dev/null || echo " (none)"
13
+ exit 1
14
+ fi
8
15
 
9
- if [ -e "website/$WEBSITE" ]; then
10
- echo "Error: website/$WEBSITE already exists" >&2
11
- exit 1
16
+ if [ -e "$DEST" ]; then
17
+ echo "Error: $DEST already exists. Remove it first to reinstall." >&2
18
+ exit 1
12
19
  fi
13
20
 
14
- mkdir -p website/$WEBSITE
15
- cp -r $NPM_ROOT/website/$1 website
21
+ echo "Installing $WEBSITE from $SRC..."
22
+ mkdir -p "$(dirname "$DEST")"
23
+ cp -r "$SRC" "$DEST"
24
+
25
+ # Recreate symlinks pointing into node_modules
26
+ rm -rf "$DEST/static/fluid/lib"
27
+ ln -s "../../../../$NPM_ROOT/dist/fluid/fluid/lib" "$DEST/static/fluid/lib"
28
+
29
+ echo ""
30
+ echo "Installed to $DEST. To run:"
31
+ echo " cd $DEST"
32
+ echo " yarn install"
33
+ echo " yarn dev"
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { loadCode } from '../../output-es/App.LoadFigure';
3
+ import { onMount } from 'svelte';
4
+
5
+ let { name, src, details = true } = $props();
6
+
7
+ onMount(() => {
8
+ loadCode(src)();
9
+ });
10
+ </script>
11
+
12
+ {#if details}
13
+ <details>
14
+ <summary>{name}.fld</summary>
15
+ <div id="codemirror-{name}"></div>
16
+ </details>
17
+ {:else}
18
+ <div id="codemirror-{name}"></div>
19
+ {/if}
@@ -0,0 +1,46 @@
1
+ <script lang="ts">
2
+ let { children, showDataPane, toggle } = $props();
3
+ </script>
4
+
5
+ {@render children()}
6
+
7
+ <div>
8
+ <button style="all:unset" title="Show data pane" onclick={toggle}>
9
+ <div class="data-pane-button toggle-button">
10
+ {#if showDataPane}
11
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
12
+ <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" />
13
+ <path
14
+ fill-rule="evenodd"
15
+ d="M1.38 8.28a.87.87 0 0 1 0-.566 7.003 7.003 0 0 1 13.238.006.87.87 0 0 1 0 .566A7.003 7.003 0 0 1 1.379 8.28ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"
16
+ clip-rule="evenodd"
17
+ />
18
+ </svg>
19
+ {:else}
20
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
21
+ <path
22
+ fill-rule="evenodd"
23
+ d="M3.28 2.22a.75.75 0 0 0-1.06 1.06l10.5 10.5a.75.75 0 1 0 1.06-1.06l-1.322-1.323a7.012 7.012 0 0 0 2.16-3.11.87.87 0 0 0 0-.567A7.003 7.003 0 0 0 4.82 3.76l-1.54-1.54Zm3.196 3.195 1.135 1.136A1.502 1.502 0 0 1 9.45 8.389l1.136 1.135a3 3 0 0 0-4.109-4.109Z"
24
+ clip-rule="evenodd"
25
+ />
26
+ <path
27
+ d="m7.812 10.994 1.816 1.816A7.003 7.003 0 0 1 1.38 8.28a.87.87 0 0 1 0-.566 6.985 6.985 0 0 1 1.113-2.039l2.513 2.513a3 3 0 0 0 2.806 2.806Z"
28
+ />
29
+ </svg>
30
+ {/if}
31
+ </div>
32
+ </button>
33
+ </div>
34
+
35
+ <style>
36
+ .toggle-button {
37
+ height: 18px;
38
+ width: 18px;
39
+ color: #cccccc;
40
+ cursor: pointer;
41
+ }
42
+
43
+ .toggle-button:hover {
44
+ color: #999999;
45
+ }
46
+ </style>
@@ -0,0 +1,38 @@
1
+ <script lang="ts">
2
+ import { loadFigure } from '../../output-es/App.LoadFigure';
3
+ import { onMount } from 'svelte';
4
+ import './view-styles.css';
5
+
6
+ let { spec, fld } = $props();
7
+
8
+ onMount(() => {
9
+ loadFigure(spec)('fig')(fld)();
10
+ });
11
+ </script>
12
+
13
+ <div id="fig">
14
+ <div class="fig-loading">loading figure(s)</div>
15
+ </div>
16
+
17
+ <!-- CSS is scoped to the component and served only when
18
+ the component is rendered, i.e. not a single big .css file
19
+ for the whole site -->
20
+ <style>
21
+ @keyframes fadeIn {
22
+ from {
23
+ opacity: 0;
24
+ }
25
+ to {
26
+ opacity: 1;
27
+ }
28
+ }
29
+
30
+ .fig-loading:only-child {
31
+ color: fuchsia;
32
+ animation: fadeIn 2s ease-in-out infinite alternate;
33
+ }
34
+
35
+ .fig-loading:not(:only-child) {
36
+ display: none;
37
+ }
38
+ </style>
@@ -0,0 +1,35 @@
1
+ <script lang="ts">
2
+ import { loadFigureSrc } from '../../output-es/App.LoadFigure';
3
+ import { onMount } from 'svelte';
4
+ import './view-styles.css';
5
+
6
+ let { spec, src } = $props();
7
+
8
+ onMount(() => {
9
+ loadFigureSrc(spec)('fig')(src)();
10
+ });
11
+ </script>
12
+
13
+ <div id="fig">
14
+ <div class="fig-loading">loading figure(s)</div>
15
+ </div>
16
+
17
+ <style>
18
+ @keyframes fadeIn {
19
+ from {
20
+ opacity: 0;
21
+ }
22
+ to {
23
+ opacity: 1;
24
+ }
25
+ }
26
+
27
+ .fig-loading:only-child {
28
+ color: fuchsia;
29
+ animation: fadeIn 2s ease-in-out infinite alternate;
30
+ }
31
+
32
+ .fig-loading:not(:only-child) {
33
+ display: none;
34
+ }
35
+ </style>
@@ -0,0 +1,32 @@
1
+ <script lang="ts">
2
+ let {
3
+ children,
4
+ showDataPane,
5
+ doubleSize = false,
6
+ textPaneWidth = doubleSize ? `600px` : '800px'
7
+ } = $props();
8
+ </script>
9
+
10
+ <div
11
+ id="grid"
12
+ class={`grid-container
13
+ ${!showDataPane ? 'data-pane-hidden' : ''}
14
+ ${doubleSize ? 'double-size' : ''}`}
15
+ style={showDataPane
16
+ ? `grid-template-columns: auto var(--toggle-button-width) ${textPaneWidth};`
17
+ : `grid-template-columns: 0 var(--toggle-button-width) ${textPaneWidth};`
18
+ }
19
+ >
20
+ {@render children()}
21
+ </div>
22
+
23
+ <style>
24
+ .grid-container {
25
+ display: grid;
26
+ justify-content: center;
27
+ }
28
+
29
+ .grid-container.double-size {
30
+ max-width: 66.7vw; /* undo effect of transform: scale(1.5) for layout purposes */
31
+ }
32
+ </style>
@@ -0,0 +1,5 @@
1
+ export { default as CodeMirror } from './CodeMirror.svelte';
2
+ export { default as DataPane } from './DataPane.svelte';
3
+ export { default as Figure } from './Figure.svelte';
4
+ export { default as FigureSrc } from './FigureSrc.svelte';
5
+ export { default as Grid } from './Grid.svelte';
@@ -0,0 +1,262 @@
1
+ /* Styles for dynamically-generated content (PureScript/D3).
2
+ Imported by Figure and FigureSrc components.
3
+ These are global because PureScript renders into multiple containers
4
+ (#fig, #fig-input, #fig-intermediate) outside the Svelte component tree. */
5
+
6
+ .legend-box {
7
+ stroke: lightgray;
8
+ stroke-width: 0.5px;
9
+ fill: none;
10
+ }
11
+
12
+ .legend-text {
13
+ font-size: 8pt;
14
+ }
15
+
16
+ .title-text {
17
+ fill: Black;
18
+ font-size: 9pt;
19
+ }
20
+
21
+ .table-caption {
22
+ box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.25);
23
+ background: #fafafa;
24
+ padding: 0.1em 0.2em;
25
+ border-radius: 1px;
26
+ display: inline-block;
27
+ }
28
+
29
+ .table-view th {
30
+ font-size: 11px;
31
+ text-align: left;
32
+ border-bottom: 'thin solid';
33
+ }
34
+
35
+ .table-view td {
36
+ font-size: 11px;
37
+ }
38
+
39
+ .table-view td:nth-child(1) {
40
+ color: lightgray;
41
+ }
42
+
43
+ table {
44
+ border-collapse: collapse;
45
+ }
46
+
47
+ thead th {
48
+ vertical-align: top;
49
+ }
50
+
51
+ .table-cell {
52
+ border-radius: 0px;
53
+ }
54
+
55
+ td,
56
+ th {
57
+ white-space: nowrap;
58
+ overflow: hidden;
59
+ text-overflow: ellipsis;
60
+ max-width: 120px;
61
+ }
62
+
63
+ td.table-cell {
64
+ background-color: white;
65
+ }
66
+
67
+ .table-cell.inert {
68
+ color: lightgrey;
69
+ }
70
+
71
+ .table-cell.selected-primary-persistent {
72
+ background-color: #93e9be;
73
+ }
74
+
75
+ .table-cell.selected-secondary-persistent {
76
+ background-color: rgb(226, 226, 226);
77
+ }
78
+
79
+ .table-cell.selected-primary-transient {
80
+ color: blue;
81
+ }
82
+
83
+ .table-row {
84
+ display: table-row;
85
+ }
86
+
87
+ .table-row.hidden {
88
+ visibility: collapse;
89
+ }
90
+
91
+ /* To hide a column, add 'hidden' to every cell in the column. visibility: collapse doesn't work here. */
92
+ .table-cell.hidden {
93
+ display: none;
94
+ }
95
+
96
+ /* hack to match Safari-only */
97
+ @supports (hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none) {
98
+ .table-row.hidden {
99
+ display: none; /* suboptimal for table rows but Safari doesn't support visibility: collapse */
100
+ }
101
+ }
102
+
103
+ .linked-text {
104
+ border-radius: 0px;
105
+ background-color: White;
106
+ border-bottom-style: solid;
107
+ border-bottom-color: white;
108
+ border-bottom-width: 1px;
109
+ display: inline;
110
+ }
111
+
112
+ .linked-text.inert {
113
+ fill: lightgrey;
114
+ }
115
+
116
+ .linked-text.selected-primary-persistent {
117
+ background-color: #93e9be;
118
+ }
119
+
120
+ .linked-text.selected-primary-transient {
121
+ border-bottom-color: blue;
122
+ }
123
+
124
+ .linked-text.selected-secondary-persistent {
125
+ background-color: rgb(226, 226, 226);
126
+ }
127
+
128
+ .linked-text.selected-secondary-transient {
129
+ border-bottom-color: lightblue;
130
+ }
131
+
132
+ .matrix-cell {
133
+ stroke: DarkGray;
134
+ fill: White;
135
+ }
136
+
137
+ .matrix-cell.inert {
138
+ stroke: DarkGray;
139
+ fill: rgb(185, 185, 185);
140
+ }
141
+
142
+ .matrix-cell.selected-primary-persistent {
143
+ fill: rgb(214, 240, 214);
144
+ }
145
+
146
+ .matrix-cell.selected-secondary-persistent {
147
+ fill: rgb(214, 240, 214);
148
+ }
149
+
150
+ .matrix-cell-text {
151
+ font-size: 10pt;
152
+ font-family: 'Roboto', sans-serif;
153
+ color: rgb(205, 205, 205);
154
+ }
155
+
156
+ .matrix-cell-text.selected-primary-persistent {
157
+ font-weight: 400;
158
+ color: darkgreen;
159
+ }
160
+
161
+ .matrix-cell-text.selected-secondary-persistent {
162
+ color: green;
163
+ }
164
+
165
+ .matrix-cell-text.selected-primary-transient {
166
+ font-weight: 400;
167
+ color: blue;
168
+ }
169
+
170
+ .matrix-cell-text.selected-secondary-transient {
171
+ color: royalblue;
172
+ }
173
+
174
+ .scatterplot-point {
175
+ fill: white;
176
+ stroke: black;
177
+ }
178
+
179
+ .scatterplot-point.inert {
180
+ fill: rgb(185, 185, 185);
181
+ stroke: black;
182
+ }
183
+
184
+ .scatterplot-point.selected-primary-persistent {
185
+ fill: LightGreen;
186
+ stroke: teal;
187
+ }
188
+
189
+ .scatterplot-point.selected-secondary-transient {
190
+ stroke: blue;
191
+ stroke-width: 1;
192
+ }
193
+
194
+ .scatterplot-point.selected-primary-transient {
195
+ stroke: blue;
196
+ stroke-width: 1;
197
+ }
198
+
199
+ .scatterplot-point.selected-secondary-persistent {
200
+ fill: rgb(226, 226, 226);
201
+ }
202
+
203
+ .scatterplot-point.selected-secondary-transient {
204
+ stroke-width: 1;
205
+ }
206
+
207
+ .para-text + .para-text {
208
+ margin-top: 0.75em;
209
+ }
210
+
211
+ .para-text {
212
+ font-size: 10pt;
213
+ }
214
+
215
+ .bar {
216
+ stroke-width: 1;
217
+ }
218
+
219
+ .tree-node {
220
+ display: grid;
221
+ grid-template-columns: auto 1fr;
222
+ gap: 8px;
223
+ align-items: start;
224
+ }
225
+
226
+ .tree-children {
227
+ display: grid;
228
+ grid-auto-rows: min-content;
229
+ gap: 4px;
230
+ border-left: 2px solid #ccc;
231
+ padding-left: 8px;
232
+ }
233
+
234
+ .tree-label {
235
+ background: #f8f8f8;
236
+ border: 1px solid #ccc;
237
+ padding: 2px 6px;
238
+ border-radius: 4px;
239
+ }
240
+
241
+ .node {
242
+ display: grid;
243
+ grid-template-columns: auto 1fr;
244
+ gap: 6px;
245
+ align-items: start;
246
+ }
247
+
248
+ .tree-children.columnar {
249
+ display: grid;
250
+ grid-template-columns: max-content 1fr;
251
+ column-gap: 12px;
252
+ row-gap: 4px;
253
+ }
254
+
255
+ .tree-children.columnar > .tree-node {
256
+ display: contents;
257
+ }
258
+
259
+ .tree-children.columnar .tree-children {
260
+ border-left: none;
261
+ padding-left: 0;
262
+ }
@@ -0,0 +1,45 @@
1
+ import prettier from 'eslint-config-prettier';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { includeIgnoreFile } from '@eslint/compat';
4
+ import js from '@eslint/js';
5
+ import svelte from 'eslint-plugin-svelte';
6
+ import { defineConfig, globalIgnores } from 'eslint/config';
7
+ import globals from 'globals';
8
+ import ts from 'typescript-eslint';
9
+ import svelteConfig from './svelte.config.js';
10
+
11
+ const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
12
+
13
+ export default defineConfig(
14
+ globalIgnores(['static/**', 'src/lib/fluid/**']),
15
+ includeIgnoreFile(gitignorePath),
16
+ js.configs.recommended,
17
+ ...ts.configs.recommended,
18
+ ...svelte.configs.recommended,
19
+ prettier,
20
+ ...svelte.configs.prettier,
21
+ {
22
+ languageOptions: { globals: { ...globals.browser, ...globals.node } },
23
+
24
+ rules: {
25
+ // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
26
+ // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
27
+ 'no-undef': 'off'
28
+ }
29
+ },
30
+ {
31
+ files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
32
+
33
+ languageOptions: {
34
+ parserOptions: {
35
+ projectService: true,
36
+ extraFileExtensions: ['.svelte'],
37
+ parser: ts.parser,
38
+ svelteConfig
39
+ }
40
+ },
41
+ rules: {
42
+ 'svelte/no-navigation-without-resolve': 'off'
43
+ }
44
+ }
45
+ );
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "article",
3
+ "private": true,
4
+ "version": "0.0.1",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite dev",
8
+ "build": "vite build",
9
+ "preview": "vite preview",
10
+ "prepare": "svelte-kit sync || echo ''",
11
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
13
+ "format": "prettier --write .",
14
+ "lint": "prettier --check . && eslint .",
15
+ "test": "../../script/test-website.sh"
16
+ },
17
+ "dependencies": {
18
+ "@explorable-viz/fluid": "workspace:*"
19
+ },
20
+ "devDependencies": {
21
+ "@codemirror/commands": "^6.8.1",
22
+ "@codemirror/lang-python": "^6.2.1",
23
+ "@codemirror/state": "^6.5.2",
24
+ "@codemirror/theme-one-dark": "^6.1.3",
25
+ "@codemirror/view": "^6.38.3",
26
+ "@eslint/compat": "^1.4.0",
27
+ "@eslint/js": "^9.39.1",
28
+ "@fontsource/roboto": "^5.2.9",
29
+ "@sveltejs/adapter-static": "^3.0.10",
30
+ "@sveltejs/kit": "^2.49.1",
31
+ "@sveltejs/vite-plugin-svelte": "^6.2.1",
32
+ "@types/node": "^24",
33
+ "d3": "^7.9.0",
34
+ "eslint": "^9.39.1",
35
+ "eslint-config-prettier": "^10.1.8",
36
+ "eslint-plugin-svelte": "^3.13.1",
37
+ "globals": "^16.5.0",
38
+ "prettier": "^3.7.4",
39
+ "prettier-plugin-svelte": "^3.4.0",
40
+ "svelte": "^5.45.6",
41
+ "svelte-check": "^4.3.4",
42
+ "typescript": "^5.9.3",
43
+ "typescript-eslint": "^8.48.1",
44
+ "vite": "^7.2.6"
45
+ }
46
+ }
@@ -0,0 +1,13 @@
1
+ // See https://svelte.dev/docs/kit/types#app.d.ts
2
+ // for information about these interfaces
3
+ declare global {
4
+ namespace App {
5
+ // interface Error {}
6
+ // interface Locals {}
7
+ // interface PageData {}
8
+ // interface PageState {}
9
+ // interface Platform {}
10
+ }
11
+ }
12
+
13
+ export {};
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ %sveltekit.head%
7
+ <title>Fluid</title>
8
+ </head>
9
+ <body data-sveltekit-preload-data="hover">
10
+ <div style="display: contents">%sveltekit.body%</div>
11
+ </body>
12
+ </html>