@explorable-viz/fluid 0.7.29 → 0.7.31

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 (39) hide show
  1. package/README.md +31 -16
  2. package/dist/fluid/fluid/dataset/ssp126-2081-2100.fld +194 -0
  3. package/dist/fluid/fluid/example/dict-list-comp.fld +1 -1
  4. package/dist/fluid/fluid/example/slicing/qcut.expect.fld +0 -0
  5. package/dist/fluid/fluid/example/slicing/qcut.fld +2 -0
  6. package/dist/fluid/fluid/lib/prelude.fld +10 -0
  7. package/dist/fluid/fluid/lib/stats.fld +57 -0
  8. package/dist/fluid/fluid.mjs +48 -45
  9. package/dist/fluid/{load-fig.js → load-figure.js} +4 -4
  10. package/dist/fluid/puppeteer-lib.js +278712 -0
  11. package/package.json +3 -2
  12. package/script/bundle-website.sh +23 -64
  13. package/dist/fluid/css/css/styles.css +0 -343
  14. package/dist/fluid/css/css/view-styles.css +0 -182
  15. package/dist/fluid/css/styles.css +0 -343
  16. package/dist/fluid/css/view-styles.css +0 -182
  17. package/dist/fluid/favicon.ico +0 -0
  18. package/dist/fluid/font/GraphikLight.woff2 +0 -0
  19. package/dist/fluid/font/GraphikLightItalic.woff2 +0 -0
  20. package/dist/fluid/font/GraphikMedium.woff2 +0 -0
  21. package/dist/fluid/font/GraphikMediumItalic.woff2 +0 -0
  22. package/dist/fluid/font/OdiseanTech.woff2 +0 -0
  23. package/dist/fluid/font/font/GraphikLight.woff2 +0 -0
  24. package/dist/fluid/font/font/GraphikLightItalic.woff2 +0 -0
  25. package/dist/fluid/font/font/GraphikMedium.woff2 +0 -0
  26. package/dist/fluid/font/font/GraphikMediumItalic.woff2 +0 -0
  27. package/dist/fluid/font/font/OdiseanTech.woff2 +0 -0
  28. package/dist/fluid/image/fluid-logo.png +0 -0
  29. package/dist/fluid/image/iccs-full-logo.png +0 -0
  30. package/dist/fluid/image/schmidtsciences_primary_color.png +0 -0
  31. package/dist/fluid/shared/footer.html +0 -6
  32. package/dist/fluid/shared/header.html +0 -26
  33. package/dist/fluid/shared/shared/footer.html +0 -6
  34. package/dist/fluid/shared/shared/header.html +0 -26
  35. package/dist/fluid/shared/shared/sub-header.html +0 -12
  36. package/dist/fluid/shared/shared/util.js +0 -72
  37. package/dist/fluid/shared/sub-header.html +0 -12
  38. package/dist/fluid/shared/util.js +0 -72
  39. package/index.js +0 -44294
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorable-viz/fluid",
3
- "version": "0.7.29",
3
+ "version": "0.7.31",
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": {
@@ -39,7 +39,8 @@
39
39
  "test-website-all": "./script/test-website-all.sh",
40
40
  "test-all": "./script/test-all.sh",
41
41
  "npm-publish": "./script/npm-publish.sh",
42
- "fluid": "./script/fluid.sh"
42
+ "fluid": "./script/fluid.sh",
43
+ "benchmark": "./script/benchmark.sh"
43
44
  },
44
45
  "dependencies": {
45
46
  "@codemirror/commands": "6.2.2",
@@ -1,94 +1,53 @@
1
1
  #!/usr/bin/env bash
2
- set -xe
3
-
4
- WEBSITE="Misc"
5
- SCRIPT_ROOT=false
2
+ set -xeu
6
3
 
4
+ PREFIX=""
7
5
 
8
6
  while getopts "w:r:" opt; do
9
7
  case $opt in
10
8
  w) WEBSITE="$OPTARG";;
11
- r) SCRIPT_ROOT="$OPTARG";;
9
+ r) PREFIX=node_modules/@explorable-viz/fluid;;
12
10
  esac
13
11
  done
14
12
 
15
- if [[ "$SCRIPT_ROOT" = true ]]; then
16
- CLEAN=./node_modules/@explorable-viz/fluid/script/util/clean.sh
17
- LISP_CASE=./node_modules/@explorable-viz/fluid/script/util/lisp-case.sh
18
- DIST="node_modules/@explorable-viz/fluid/dist"
19
- else
20
- CLEAN=./script/util/clean.sh
21
- LISP_CASE=./script/util/lisp-case.sh
22
- DIST="dist"
23
- fi
24
-
13
+ WEBSITE_LISP_CASE=$(./$PREFIX/script/util/lisp-case.sh "$WEBSITE")
14
+ echo "$WEBSITE -> $WEBSITE_LISP_CASE"
15
+ mkdir -p "dist/$WEBSITE_LISP_CASE"
25
16
 
26
- SRC_PATH=${WEBSITE//./\/}
27
- SRC_PATH_LISP_CASE=$($LISP_CASE "$SRC_PATH")
28
- echo "$SRC_PATH -> $SRC_PATH_LISP_CASE"
29
-
30
- if [[ -e "website/$SRC_PATH.html" ]]; then
31
- $CLEAN $SRC_PATH_LISP_CASE
32
- cp website/$SRC_PATH.html dist/$SRC_PATH_LISP_CASE/index.html
33
- fi
17
+ . script/bundle-page.sh $WEBSITE
34
18
 
35
19
  shopt -s nullglob
36
20
 
21
+ # Only support one level of nesting for now
37
22
  set +x
38
23
  PAGES=($(for FILE in website/$WEBSITE/*.html; do
39
- basename "$FILE" | sed 's/\.[^.]*$//'
24
+ basename "$FILE" | sed 's/\.[^.]*$//'
40
25
  done | sort -u))
41
26
  set -x
42
- for PAGE in "${PAGES[@]}"; do
43
- MODULE=$WEBSITE.$PAGE
44
- SRC_PATH=${MODULE//./\/}
45
- SRC_PATH_LISP_CASE=$($LISP_CASE "$SRC_PATH")
46
- echo "$SRC_PATH -> $SRC_PATH_LISP_CASE"
47
27
 
48
- if [[ -e "website/$SRC_PATH.purs" ]]; then
49
- . script/bundle-page.sh $WEBSITE.$PAGE
50
- else
51
- if [[ -e "website/$SRC_PATH.html" ]]; then
52
- $CLEAN $SRC_PATH_LISP_CASE
53
-
54
- cp website/$SRC_PATH.html dist/$SRC_PATH_LISP_CASE/index.html
55
- fi
56
- fi
57
-
58
- if [[ -e "website/$SRC_PATH.json" ]]; then
59
- cp website/$SRC_PATH.json dist/$SRC_PATH_LISP_CASE/spec.json
60
- fi
28
+ for PAGE in "${PAGES[@]}"; do
29
+ . script/bundle-page.sh $WEBSITE.$PAGE
61
30
  done
62
31
 
63
-
64
- WEBSITE_LISP_CASE=$($LISP_CASE "$WEBSITE")
65
-
66
- set +x
32
+ echo "Processing other static files:"
33
+ set +xu # try to remove +u
67
34
  TO_COPY=()
68
- for CHILD in website/$WEBSITE/*; do
35
+ shopt -s extglob
36
+ for CHILD in website/$WEBSITE/!(.|..); do
69
37
  BASENAME="$(basename "$CHILD")"
70
- if [[ "$BASENAME" =~ ^[a-z] ]]; then
38
+ if [[ "$BASENAME" =~ ^[a-z.] ]]; then
71
39
  TO_COPY+=("$CHILD")
72
40
  fi
73
41
  done
74
- set -x
75
-
76
- echo "Processing shared files:"
77
- cp -r $DIST/fluid/shared dist/$WEBSITE_LISP_CASE/shared
78
- cp $DIST/fluid/load-fig.js dist/$WEBSITE_LISP_CASE/shared/load-fig.js
79
-
80
- cp -r $DIST/fluid/font dist/$WEBSITE_LISP_CASE/font
81
- cp -r $DIST/fluid/css dist/$WEBSITE_LISP_CASE/css
82
- cp $DIST/fluid/favicon.ico dist/$WEBSITE_LISP_CASE/favicon.ico
83
- cp -r $DIST/fluid/image dist/$WEBSITE_LISP_CASE/image
84
-
85
- echo "Processing static files:"
42
+ shopt -u extglob
43
+ set -xu
86
44
 
87
45
  for CHILD in "${TO_COPY[@]}"; do
88
- BASENAME="$(basename "$CHILD")"
89
- cp -r "$CHILD" "dist/$WEBSITE_LISP_CASE/$BASENAME"
90
- done
46
+ cp -rL "$CHILD" dist/$WEBSITE_LISP_CASE
47
+ done
48
+
49
+ echo "Processing load-figure.js:"
50
+ cp ${PREFIX}dist/fluid/load-figure.js dist/$WEBSITE_LISP_CASE/shared
91
51
 
92
- shopt -u nullglob
93
52
  cp -r fluid dist/$WEBSITE_LISP_CASE
94
53
  echo "Bundled website $WEBSITE"
@@ -1,343 +0,0 @@
1
- @charset "UTF-8";
2
- @import url("https://fonts.googleapis.com/css2?family=Fira+Code&display=swap");
3
- @import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono&display=swap');
4
-
5
- @font-face {
6
- font-family: 'OdiseanTech';
7
- src: url('/font/OdiseanTech.woff2') format('woff2');
8
- font-weight: normal;
9
- font-style: normal;
10
- }
11
-
12
- @font-face {
13
- font-family: 'GraphikLight';
14
- src: url('/font/GraphikLight.woff2') format('woff2');
15
- font-weight: 300;
16
- font-style: normal;
17
- }
18
-
19
- @font-face {
20
- font-family: 'GraphikLightItalic';
21
- src: url('/font/GraphikLightItalic.woff2') format('woff2');
22
- font-weight: 300;
23
- font-style: italic;
24
- }
25
-
26
- @font-face {
27
- font-family: 'GraphikMedium';
28
- src: url('/font/GraphikMedium.woff2') format('woff2');
29
- font-weight: 500;
30
- font-style: normal;
31
- }
32
-
33
- @font-face {
34
- font-family: 'GraphikMediumItalic';
35
- src: url('/font/GraphikMediumItalic.woff2') format('woff2');
36
- font-weight: 500;
37
- font-style: italic;
38
- }
39
-
40
- .fluid-logo {
41
- margin-bottom: 0;
42
- }
43
-
44
- .fluid-subtitle {
45
- margin-bottom: 0;
46
- margin-top: 0;
47
- font-size: 12pt;
48
- }
49
-
50
- a:link {
51
- color: darkslategray;
52
- }
53
-
54
- a:visited {
55
- color: #004d40;
56
- }
57
-
58
- a:hover {
59
- color: #009688;
60
- }
61
-
62
- a:active {
63
- color: #003d33;
64
- }
65
-
66
- .right-justified {
67
- margin-left: auto;
68
- width: fit-content;
69
- }
70
-
71
- .nowrap {
72
- white-space: nowrap;
73
- }
74
-
75
- code {
76
- font-family: 'Ubuntu Mono', monospace;
77
- }
78
-
79
- body {
80
- font-size: 12pt;
81
- font-family: "GraphikLight", sans-serif;
82
- font-weight: 300;
83
- line-height: 1.25;
84
- padding: 0;
85
- margin: 0;
86
- background-color: #FFFFFF;
87
- color: #404040;
88
- margin-bottom: 10em;
89
- }
90
-
91
- p {
92
- margin-top: 1em;
93
- margin-bottom: 1em;
94
- }
95
-
96
- p + p {
97
- margin-top: 0;
98
- }
99
-
100
- .faq-question {
101
- font-family: 'GraphikMedium';
102
- color: darkslategrey;
103
- }
104
-
105
- .highlight {
106
- font-family: 'GraphikMedium';
107
- }
108
-
109
- .align-right {
110
- text-align: right;
111
- }
112
-
113
- h2 {
114
- font-size: 18pt;
115
- }
116
-
117
- h3 {
118
- width: 100%;
119
- font-size: 16pt;
120
- font-weight: bold;
121
- margin-top: 10pt;
122
- margin-bottom: 4pt;
123
- border-bottom: 0.5px solid lightgray;
124
- }
125
-
126
- h4 {
127
- font-size: 16pt;
128
- font-weight: bold;
129
- margin-top: 0.4em;
130
- margin-bottom: 0;
131
- }
132
-
133
- .sub-header * {
134
- font-size: 16pt;
135
- margin-bottom: 4px;
136
- }
137
-
138
- ul {
139
- padding-left: 20px;
140
- margin-top: 0;
141
- margin-bottom: 0;
142
- }
143
-
144
- li {
145
- margin-bottom: 1ex;
146
- }
147
-
148
- li:last-child {
149
- margin-bottom: 0;
150
- }
151
-
152
- .table-caption {
153
- text-align: left;
154
- }
155
-
156
- nav ul {
157
- padding-left: 0;
158
- list-style: none;
159
- }
160
-
161
- nav ul li {
162
- float: left;
163
- overflow: hidden;
164
- margin-bottom: 0;
165
- }
166
-
167
- nav ul li:not(:last-child)::after {
168
- content: "•";
169
- margin-right: 5px;
170
- margin-left: 5px;
171
- }
172
-
173
- nav ul li.active-page a {
174
- pointer-events: none;
175
- color: inherit;
176
- text-decoration: none;
177
- cursor: default;
178
- font-weight: bold;
179
- color: rgb(135, 129, 255);
180
- }
181
-
182
- .cm-editor {
183
- background: #2D2D2D;
184
- color: #F0F0F0;
185
- }
186
-
187
- .cm-line {
188
- font-family: 'Ubuntu Mono';
189
- font-size: 10pt;
190
- }
191
-
192
- .cm-gutter {
193
- background-color: #232323;
194
- }
195
-
196
- .cm-gutterElement {
197
- font-family: 'Ubuntu Mono';
198
- font-size: 10pt;
199
- color: #88C0D0;
200
- }
201
-
202
- .right-border {
203
- border-right: 0.5px solid lightgray;
204
- padding-right: 6px;
205
- }
206
-
207
- .right-border + div {
208
- padding-left: 4px
209
- }
210
-
211
- .header-grid-container {
212
- display: grid;
213
- background-color: #f0f0f0;
214
- width: 100%;
215
- grid-template-columns: 35% 1fr;
216
- padding-top: 7px;
217
- padding-bottom: 7px;
218
- }
219
-
220
- .footer-grid-container {
221
- display: grid;
222
- background-color: #f0f0f0;
223
- width: 100%;
224
- grid-template-columns: 35% 1fr;
225
- margin-top: 10px;
226
- }
227
-
228
- :root {
229
- --toggle-button-width: 24px;
230
- --text-pane-width: 800px;
231
- }
232
-
233
- .grid-container {
234
- display: grid;
235
- grid-template-columns: auto var(--toggle-button-width) var(--text-pane-width);
236
- justify-content: center;
237
- }
238
-
239
- .grid-container.data-pane-hidden {
240
- grid-template-columns: 0 var(--toggle-button-width) var(--text-pane-width);
241
- }
242
-
243
- .grid-container.double-size {
244
- max-width: 66.7vw; /* undo effect of transform: scale(1.5) for layout purposes */
245
- }
246
-
247
- .grid-container > :last-child {
248
- padding-right: 10px;
249
- }
250
-
251
- .flex-bottom-align {
252
- display: flex;
253
- flex-direction: row;
254
- }
255
-
256
- .flex-bottom-align:first-child {
257
- margin-top: auto;
258
- }
259
-
260
- .flex-left-align {
261
- display: flex;
262
- flex-direction: column;
263
- align-items: start;
264
- }
265
-
266
- .flex-right-align {
267
- display: flex;
268
- flex-direction: column;
269
- align-items: flex-end;
270
- }
271
-
272
- .flex-bottom-align {
273
- display: flex;
274
- flex-direction: row;
275
- align-items: flex-end;
276
- }
277
-
278
- .data-pane-button {
279
- font-size: 10pt;
280
- }
281
-
282
- .toggle-button {
283
- color: #CCCCCC;
284
- user-select: none;
285
- }
286
-
287
- .toggle-button:hover {
288
- color: #999999;
289
- cursor: pointer;
290
- }
291
-
292
- .data-pane {
293
- border-right: 1px dotted #CCCCCC;
294
- }
295
-
296
- .data-pane-hidden .data-pane {
297
- visibility: hidden;
298
- }
299
-
300
- .data-pane-hidden .data-pane * {
301
- display: none;
302
- }
303
-
304
- .data-pane * {
305
- font-size: 10pt;
306
- }
307
-
308
- .data-pane p {
309
- margin-right: 3px;
310
- }
311
-
312
- /* Not actually double-size any more.. */
313
- .double-size {
314
- transform: scale(1.5);
315
- transform-origin: top;
316
- --text-pane-width: 600px;
317
- }
318
-
319
- body.standalone {
320
- height: 100%;
321
- display: grid;
322
- justify-items: center;
323
- align-items: start;
324
- }
325
-
326
- /* Needed for contained height specifications to work */
327
- html {
328
- height: 100%;
329
- }
330
-
331
- @keyframes fadeIn {
332
- from { opacity: 0; }
333
- to { opacity: 1; }
334
- }
335
-
336
- .fig-loading:only-child {
337
- color: fuchsia;
338
- animation: fadeIn 2s ease-in-out infinite alternate;
339
- }
340
-
341
- .fig-loading:not(:only-child) {
342
- display: none;
343
- }
@@ -1,182 +0,0 @@
1
- .legend-box {
2
- stroke: lightgray;
3
- stroke-width: 0.5px;
4
- fill: none;
5
- }
6
-
7
- .legend-text {
8
- font-size: 9pt;
9
- }
10
-
11
- .title-text {
12
- fill: Black;
13
- font-size: 9pt;
14
- }
15
-
16
- .table-view th {
17
- font-size: 11px;
18
- text-align: left;
19
- border-bottom: 'thin solid';
20
- }
21
-
22
- .table-view td {
23
- font-size: 11px;
24
- }
25
-
26
- .table-view td:nth-child(1) {
27
- color: lightgray;
28
- }
29
-
30
- table {
31
- border-collapse: collapse;
32
- }
33
-
34
- thead {
35
- border-top: 0.5px solid lightgray;
36
- }
37
-
38
- .table-cell {
39
- border-radius: 0px;
40
- }
41
-
42
- td.table-cell {
43
- background-color: white;
44
- }
45
-
46
- .table-cell.inert {
47
- color: lightgrey;
48
- }
49
-
50
- .table-cell.selected-primary-persistent {
51
- background-color: #93E9BE;
52
- }
53
-
54
- .table-cell.selected-secondary-persistent {
55
- background-color: rgb(226, 226, 226);
56
- }
57
-
58
- .table-cell.selected-primary-transient {
59
- color: blue;
60
- }
61
-
62
- .table-cell.selected-secondary-transient {
63
- color: royalblue;
64
- }
65
-
66
- .table-row {
67
- display: table-row;
68
- }
69
-
70
- .table-row.hidden {
71
- visibility: collapse;
72
- }
73
-
74
- .linked-text {
75
- border-radius: 0px;
76
- background-color: White;
77
- border-bottom-style: solid;
78
- border-bottom-color: white;
79
- border-bottom-width: 1px;
80
- display: inline;
81
- }
82
-
83
- .linked-text.inert {
84
- fill: lightgrey;
85
- }
86
-
87
- .linked-text.selected-primary-persistent {
88
- background-color: #93E9BE;
89
- }
90
-
91
- .linked-text.selected-primary-transient {
92
- border-bottom-color: blue;
93
- }
94
-
95
- .linked-text.selected-secondary-persistent {
96
- background-color: rgb(226, 226, 226);
97
- }
98
-
99
- .linked-text.selected-secondary-transient {
100
- border-bottom-color: lightblue;
101
- }
102
-
103
- .matrix-cell {
104
- stroke: DarkGray;
105
- fill: White;
106
- }
107
-
108
- .matrix-cell.inert {
109
- stroke: DarkGray;
110
- fill: rgb(185, 185, 185);
111
- }
112
-
113
- .matrix-cell.selected-primary-persistent {
114
- fill: LightGreen;
115
- }
116
-
117
- .matrix-cell.selected-secondary-persistent {
118
- fill: rgb(214, 240, 214)
119
- }
120
-
121
- .matrix-cell.selected-primary-transient {
122
- }
123
-
124
- .matrix-cell.selected-secondary-transient {
125
- }
126
-
127
- .matrix-cell-text {
128
- font-size: 10pt;
129
- font-family: "GraphikLight", sans-serif;
130
- color: rgb(205, 205, 205)
131
- }
132
-
133
- .matrix-cell-text.selected-primary-persistent {
134
- font-weight: 400;
135
- color: darkgreen
136
- }
137
-
138
- .matrix-cell-text.selected-secondary-persistent {
139
- color: green
140
- }
141
-
142
- .matrix-cell-text.selected-primary-transient {
143
- font-weight: 400;
144
- color: blue
145
- }
146
-
147
- .matrix-cell-text.selected-secondary-transient {
148
- color: royalblue
149
- }
150
-
151
- .scatterplot-point {
152
- fill: white;
153
- stroke: black;
154
- }
155
-
156
- .scatterplot-point.inert {
157
- fill: rgb(185,185,185);
158
- stroke: black;
159
- }
160
-
161
- .scatterplot-point.selected-primary-persistent {
162
- fill: LightGreen;
163
- stroke: teal;
164
- }
165
-
166
- .scatterplot-point.selected-secondary-transient {
167
- stroke: blue;
168
- stroke-width: 1;
169
- }
170
-
171
- .scatterplot-point.selected-primary-transient {
172
- stroke: blue;
173
- stroke-width: 1;
174
- }
175
-
176
- .scatterplot-point.selected-secondary-persistent {
177
- fill: rgb(226, 226, 226);
178
- }
179
-
180
- .scatterplot-point.selected-secondary-transient {
181
- stroke-width: 1;
182
- }