@explorable-viz/fluid 0.10.1 → 0.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorable-viz/fluid",
3
- "version": "0.10.1",
3
+ "version": "0.10.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
5
  "main": "index.js",
6
6
  "repository": {
@@ -1,41 +1,9 @@
1
1
  @charset "UTF-8";
2
2
  @import url("https://fonts.googleapis.com/css2?family=Fira+Code&display=swap");
3
3
  @import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono&display=swap');
4
+ @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;1,300&display=swap');
4
5
 
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
- }
6
+ /* Dropped use of Graphik as seems to have a bug at font-weight 300 */
39
7
 
40
8
  .fluid-logo {
41
9
  margin-bottom: 0;
@@ -78,7 +46,7 @@ code {
78
46
 
79
47
  body {
80
48
  font-size: 12pt;
81
- font-family: "GraphikLight", sans-serif;
49
+ font-family: "Roboto", sans-serif;
82
50
  font-weight: 300;
83
51
  line-height: 1.25;
84
52
  padding: 0;
@@ -134,7 +134,7 @@ td.table-cell {
134
134
 
135
135
  .matrix-cell-text {
136
136
  font-size: 10pt;
137
- font-family: "GraphikLight", sans-serif;
137
+ font-family: "Roboto", sans-serif;
138
138
  color: rgb(205, 205, 205)
139
139
  }
140
140
 
@@ -193,6 +193,6 @@ td.table-cell {
193
193
  font-size: 10pt;
194
194
  }
195
195
 
196
- .para-text span::after {
197
- content: " ";
196
+ .bar {
197
+ stroke-width: 1.5;
198
198
  }
@@ -17,7 +17,7 @@ def mostEfficient:
17
17
  accuracies compared to uni-directional LSTM2, with the training time per epoch
18
18
  ${trendWord(model_BiLSTM.time_s, model_LSTM.time_s, growShrink)} from
19
19
  ${model_LSTM.time_s} seconds to ${model_BiLSTM.time_s} seconds.
20
- Stacking 2 layers of BiLSTM gives ${trendWord(model_2_stacked_BiLSTM.acc, model_BiLSTM.acc, improve)}
20
+ Stacking 2 layers of BiLSTM gives ${trendWord(model_2_stacked_BiLSTM.acc, model_BiLSTM.acc, improvements)}
21
21
  to development results, with a ${trendWord(model_2_stacked_BiLSTM.time_s, model_BiLSTM.time_s, smallerHigher)}
22
22
  time of ${model_2_stacked_BiLSTM.time_s} seconds. 3 layers of stacked BiLSTM
23
23
  ${trendWord(model_3_stacked_BiLSTM.acc, model_BiLSTM.acc, improve)} the results.
@@ -34,7 +34,7 @@ def mostEfficient:
34
34
  among all models compared, with the
35
35
  ${rankLabel("smallest", findIndex("model", "CNN", insertionSort(lambda a, b: a.param < b.param, tableData)))}
36
36
  model size. On the other hand, a 3-layer stacked CNN gives an accuracy of
37
- ${model_3_stacked_CNN.acc}%, which is also the
37
+ ${numToStr(model_3_stacked_CNN.acc)}%, which is also the
38
38
  ${rankLabel("lowest", findIndex("model", "CNN", insertionSort(lambda a, b: a.time_s < b.time_s, tableData)))}
39
39
  compared with BiLSTM, hierarchical attention and S-LSTM. The
40
40
  ${rankLabel("best", findIndex("model", "S-LSTM+Attention", insertionSort(lambda a, b: b.acc < a.acc, tableData)))}
@@ -3,35 +3,35 @@ import renewables
3
3
  def totalFor(c, rows): sum([row.output for row in rows if row.country == c])
4
4
 
5
5
  def data2015: [row for row in renewables if row.year == 2015]
6
-
7
6
  def countryData: [{
8
7
  x: c,
9
8
  segments: [{ y: "output", z: totalFor(c, data2015) }]
10
9
  } for c in ["China", "USA", "Germany"]]
11
10
 
12
- def series(type, country):
11
+ def series(energyType, country):
13
12
  [
14
13
  { x: row.year, y: row.output }
15
14
  for year in [2013 .. 2018] for row in renewables
16
- if row.year == year if row.energyType == type if row.country == country
15
+ if row.year == year if row.energyType == energyType if row.country == country
17
16
  ]
18
17
 
19
18
  MultiView({
20
- barChart: BarChart({
21
- caption: "Total output by country",
22
- size: { width: 275, height: 185 },
23
- stackedBars: countryData
24
- }),
19
+ # barChart: BarChart({
20
+ # caption: "Total renewables output by country",
21
+ # size: { width: 275, height: 185 },
22
+ # stackedBars: countryData
23
+ # }),
25
24
  lineChart: LineChart({
26
- tickLabels: { x: Rotated, y: Default },
25
+ tickLabels: { x: Default, y: Default },
27
26
  size: { width: 330, height: 285 },
28
- caption: "Output of USA relative to China",
27
+ caption: "Renewables output of USA relative to China",
29
28
  plots: [
30
- LinePlot({ name: energyType, points: plot })
31
- for energyType in ["Bio", "Hydro", "Solar", "Wind"]
32
- for plot in [
33
- zipWith((lambda p1, p2: { x: p1.x, y: p1.y / p2.y }), series(energyType, "USA"), series(energyType, "China"))
34
- ]
35
- ]
36
- })
29
+ LinePlot({
30
+ name: energyType,
31
+ points: zipWith(lambda p1, p2: { x: p1.x, y: p1.y / p2.y }, usa, china)
32
+ })
33
+ for energyType in ["Bio", "Hydro", "Solar", "Wind"]
34
+ for (usa, china) in [(series(energyType, "USA"), series(energyType, "China"))]
35
+ ]
36
+ })
37
37
  })
@@ -6,23 +6,22 @@ def lookup(m, n, image):
6
6
  if m >= 1 |and| m <= m_max |and| n >= 1 |and| n <= n_max:
7
7
  image!(m, n)
8
8
  else: 0
9
- # image!((m - 1 |mod| m_max) + 1, (n - 1 |mod| n_max) + 1)
9
+ # image!((m - 1 |mod| m_max) + 1, (n - 1 |mod| n_max) + 1)
10
10
 
11
11
  def matrixSum(matr):
12
12
  def (m, n): dims(matr)
13
13
  foldl((+), 0, [matr!(i, j) for (i, j) in range((1, 1), (m, n))])
14
14
 
15
15
  def convolve(image, kernel):
16
- def ((m, n), (i, j)):
17
- (dims(image), dims(kernel))
18
- def (half_i, half_j):
19
- (i |quot| 2, j |quot| 2)
16
+ def (m, n): dims(image)
17
+ def (i, j): dims(kernel)
18
+ def (half_i, half_j): (i |quot| 2, j |quot| 2)
20
19
  def area: i * j
21
20
 
22
21
  def interMatrix(m_, n_):
23
- # @doc("""average these values to compute element (${m_},${n_})""")
22
+ # @doc("""average these values to compute element""")
24
23
  [| kernel!(i_, j_) *
25
- lookup(((m_ + i_) - 1) - half_i, ((n_ + j_) - 1) - half_j, image)
24
+ lookup(m_ + i_ - 1 - half_i, n_ + j_ - 1 - half_j, image)
26
25
  for (i_, j_) in (i, j) |]
27
26
 
28
27
  [| matrixSum(interMatrix(m_, n_)) |quot| area for (m_, n_) in (m, n) |]
@@ -17,8 +17,10 @@ def ordinal(n):
17
17
  error("n > 20 not supported")
18
18
 
19
19
  def rankLabel(word, n):
20
- if n == 1: ""
21
- else: ordinal(n) ++ "-" ++ word
20
+ def prefix:
21
+ if n == 1: ""
22
+ else: ordinal(n) ++ "-"
23
+ prefix ++ word
22
24
 
23
25
  def trendWord(n1, n2, compareWord):
24
26
  compareWord(compare(n1, n2))
@@ -35,6 +37,10 @@ def improve(EQ): "does not further improve"
35
37
  def improve(LT): "does not further improve"
36
38
  def improve(GT): "further improves"
37
39
 
40
+ def improvements(EQ): "no further improvements"
41
+ def improvements(LT): "no further improvements"
42
+ def improvements(GT): "further improvements"
43
+
38
44
  def shorterLonger(EQ): "equal"
39
45
  def shorterLonger(LT): "shorter"
40
46
  def shorterLonger(GT): "longer"
@@ -17,9 +17,6 @@
17
17
  <div></div>
18
18
  <div>
19
19
  <h3>Non-renewables energy output</h3>
20
- <p>Click the grey toggle and mouse over the bars.
21
- <br>
22
- <b>Clicking</b> makes a selection “persistent”.</p>
23
20
  </div>
24
21
 
25
22
  <div id="fig-data-pane" class="flex-right-align data-pane">
@@ -32,15 +29,6 @@
32
29
  <div id="fig">
33
30
  <div class="fig-loading">loading figure(s)</div>
34
31
  </div>
35
- <p>Source code:</p>
36
- <details>
37
- <summary>bar-chart-line-chart.fld</summary>
38
- <div id="codemirror-bar-chart-line-chart"></div>
39
- </details>
40
- <details>
41
- <summary>renewables.fld</summary>
42
- <div id="codemirror-renewables"></div>
43
- </details>
44
32
  </div>
45
33
  </div>
46
34
 
@@ -52,8 +40,6 @@
52
40
  "query": false,
53
41
  "linking": true
54
42
  }
55
-
56
- drawCode("../fluid/bar-chart-line-chart.fld")()
57
43
  loadFigureSpec(jsonSpec)("../fluid/bar-chart-line-chart.fld")()
58
44
  </script>
59
45
  </body>
@@ -14,6 +14,10 @@
14
14
  .data-pane {
15
15
  max-width: 400px;
16
16
  }
17
+
18
+ :root {
19
+ --text-pane-width: 530px;
20
+ }
17
21
  </style>
18
22
  </head>
19
23
  <body>
@@ -41,7 +45,7 @@
41
45
  "fluidSrcPath": ["../fluid"],
42
46
  "inputs": [ "tableData" ],
43
47
  "query": true,
44
- "linking": false
48
+ "linking": true
45
49
  }
46
50
 
47
51
  loadFigureSpec(jsonSpec)("../fluid/1805.02474v1-10.fld")()
@@ -7,9 +7,6 @@ export const main = async () => {
7
7
  page => waitFor("#fig-output > svg:nth-child(1)")(page),
8
8
  page => waitFor("#fig-output > svg:nth-child(2)")(page),
9
9
  ]))()
10
- await runTests(testURL("renewables-linked")([
11
- page => waitFor("#fig-output > svg:nth-child(1)")(page),
12
- page => waitFor("#fig-output > svg:nth-child(2)")(page),
13
- ]))()
10
+ await runTests(testURL("renewables-linked")([page => waitFor("#fig-output > svg:nth-child(1)")(page)]))()
14
11
  await runTests(testURL("scigen-1805.02474v1-10")([ page => waitFor("div#fig-output")(page) ]))()
15
12
  }