Skip to content

Commit

Permalink
rerendered
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Mar 31, 2024
1 parent d3331a3 commit 6faa8ac
Show file tree
Hide file tree
Showing 12 changed files with 6,690 additions and 298 deletions.
144 changes: 21 additions & 123 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,19 @@ <h2 id="toc-title">Table of contents</h2>
</style>
<style>.clay-limit-image-width .clay-image {max-width: 100%}
</style>
<script src="index_files/md-default7.js" type="text/javascript"></script>
<script src="index_files/md-default8.js" type="text/javascript"></script>
<script src="index_files/portal9.js" type="text/javascript"></script>
<script src="index_files/md-default9.js" type="text/javascript"></script>
<script src="index_files/vega10.js" type="text/javascript"></script>
<script src="index_files/vega11.js" type="text/javascript"></script>
<script src="index_files/vega12.js" type="text/javascript"></script>
<script src="index_files/portal13.js" type="text/javascript"></script>
<a href="https://scicloj.github.io/clojure-data-scrapbook/"><img align="left" alt="SciCloj logo" src="https://scicloj.github.io/sci-cloj-logo-transparent.png" width="40"></a><table><tbody><tr><td>This is part of the Scicloj <a href="https://scicloj.github.io/clojure-data-scrapbook/">Clojure Data Scrapbook</a>.</td></tr></tbody></table>
<section id="noj---getting-started---from-raw-data-to-a-blog-post" class="level1">
<h1>Noj - getting started - from raw data to a blog post</h1>
<p>This is a getting-started tutorial for <a href="https://scicloj.github.io/noj/">Noj</a> (scinojure) - a recommended way to use the emerging Clojure data stack.</p>
<p>It is considered part of the <a href="https://scicloj.github.io/clojure-data-scrapbook/">Clojure Data Scrapbook</a>, but is maintained as a separate repo to serve as a self-contained small example of a data-analysis report.</p>
<p>Soon we will add an accompanying video tutorial.</p>
<p>Video tutorial:</p>
<iframe allowfullscreen="allowfullscreen" src="https://www.youtube.com/embed/5GluhUmMlpM"></iframe>
<section id="question" class="level2">
<h2 class="anchored" data-anchor-id="question">Question</h2>
<p>Can we distinguish weekends from weekdays in terms of the hours in which people tend to use their bikes?</p>
Expand Down Expand Up @@ -167,122 +168,19 @@ <h2 class="anchored" data-anchor-id="processing-data">Processing data</h2>
<section id="analysis" class="level2">
<h2 class="anchored" data-anchor-id="analysis">Analysis</h2>
<div class="sourceClojure">
<div class="sourceCode" id="cb4"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>(<span class="kw">-&gt;</span> processed-trips</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> (tc/group-by [<span class="at">:hour</span>])</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> (tc/aggregate {<span class="at">:n</span> tc/row-count})</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> (tc/order-by [<span class="at">:hour</span>]))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="clay-dataset">
<p>_unnamed [24 2]:</p>
<table class="table">
<thead>
<tr class="header">
<th style="text-align: right;">:hour</th>
<th style="text-align: right;">:n</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: right;">0</td>
<td style="text-align: right;">5111</td>
</tr>
<tr class="even">
<td style="text-align: right;">1</td>
<td style="text-align: right;">3235</td>
</tr>
<tr class="odd">
<td style="text-align: right;">2</td>
<td style="text-align: right;">1874</td>
</tr>
<tr class="even">
<td style="text-align: right;">3</td>
<td style="text-align: right;">1165</td>
</tr>
<tr class="odd">
<td style="text-align: right;">4</td>
<td style="text-align: right;">950</td>
</tr>
<tr class="even">
<td style="text-align: right;">5</td>
<td style="text-align: right;">2802</td>
</tr>
<tr class="odd">
<td style="text-align: right;">6</td>
<td style="text-align: right;">8863</td>
</tr>
<tr class="even">
<td style="text-align: right;">7</td>
<td style="text-align: right;">17065</td>
</tr>
<tr class="odd">
<td style="text-align: right;">8</td>
<td style="text-align: right;">22170</td>
</tr>
<tr class="even">
<td style="text-align: right;">9</td>
<td style="text-align: right;">17316</td>
</tr>
<tr class="odd">
<td style="text-align: right;"></td>
<td style="text-align: right;"></td>
</tr>
<tr class="even">
<td style="text-align: right;">13</td>
<td style="text-align: right;">24837</td>
</tr>
<tr class="odd">
<td style="text-align: right;">14</td>
<td style="text-align: right;">25900</td>
</tr>
<tr class="even">
<td style="text-align: right;">15</td>
<td style="text-align: right;">30730</td>
</tr>
<tr class="odd">
<td style="text-align: right;">16</td>
<td style="text-align: right;">40374</td>
</tr>
<tr class="even">
<td style="text-align: right;">17</td>
<td style="text-align: right;">46889</td>
</tr>
<tr class="odd">
<td style="text-align: right;">18</td>
<td style="text-align: right;">38281</td>
</tr>
<tr class="even">
<td style="text-align: right;">19</td>
<td style="text-align: right;">27107</td>
</tr>
<tr class="odd">
<td style="text-align: right;">20</td>
<td style="text-align: right;">17252</td>
</tr>
<tr class="even">
<td style="text-align: right;">21</td>
<td style="text-align: right;">14388</td>
</tr>
<tr class="odd">
<td style="text-align: right;">22</td>
<td style="text-align: right;">10822</td>
</tr>
<tr class="even">
<td style="text-align: right;">23</td>
<td style="text-align: right;">7327</td>
</tr>
</tbody>
</table>
<div class="sourceCode" id="cb4"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>(<span class="bu">def</span><span class="fu"> hours-plot</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> (<span class="kw">-&gt;</span> processed-trips</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> (tc/group-by [<span class="at">:hour</span>])</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> (tc/aggregate {<span class="at">:n</span> tc/row-count})</span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> (tc/order-by [<span class="at">:hour</span>])</span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a> (hanami/plot ht/bar-chart</span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> {<span class="at">:X</span> <span class="st">"hour"</span></span>
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> <span class="at">:Y</span> <span class="st">"n"</span>})))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="sourceClojure">
<div class="sourceCode" id="cb5"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>(<span class="bu">def</span><span class="fu"> hours-plot</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> (<span class="kw">-&gt;</span> processed-trips</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> (tc/group-by [<span class="at">:hour</span>])</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> (tc/aggregate {<span class="at">:n</span> tc/row-count})</span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a> (tc/order-by [<span class="at">:hour</span>])</span>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a> (hanami/plot ht/bar-chart</span>
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> {<span class="at">:X</span> <span class="st">"hour"</span></span>
<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a> <span class="at">:Y</span> <span class="st">"n"</span>})))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>hours-plot</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div><script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/0.csv","format":{"type":"csv"}}});</script></div>
<div class="sourceClojure">
<div class="sourceCode" id="cb6"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>(kind/pprint hours-plot)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
Expand Down Expand Up @@ -335,43 +233,43 @@ <h2 class="anchored" data-anchor-id="analysis">Analysis</h2>
<tr class="odd">
<td>1</td>
<td><div>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/0.csv","format":{"type":"csv"}}});</script>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/1.csv","format":{"type":"csv"}}});</script>
</div></td>
</tr>
<tr class="even">
<td>2</td>
<td><div>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/1.csv","format":{"type":"csv"}}});</script>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/2.csv","format":{"type":"csv"}}});</script>
</div></td>
</tr>
<tr class="odd">
<td>3</td>
<td><div>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/2.csv","format":{"type":"csv"}}});</script>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/3.csv","format":{"type":"csv"}}});</script>
</div></td>
</tr>
<tr class="even">
<td>4</td>
<td><div>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/3.csv","format":{"type":"csv"}}});</script>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/4.csv","format":{"type":"csv"}}});</script>
</div></td>
</tr>
<tr class="odd">
<td>5</td>
<td><div>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/4.csv","format":{"type":"csv"}}});</script>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/5.csv","format":{"type":"csv"}}});</script>
</div></td>
</tr>
<tr class="even">
<td>6</td>
<td><div>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/5.csv","format":{"type":"csv"}}});</script>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/6.csv","format":{"type":"csv"}}});</script>
</div></td>
</tr>
<tr class="odd">
<td>7</td>
<td><div>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/6.csv","format":{"type":"csv"}}});</script>
<script>vegaEmbed(document.currentScript.parentElement, {"encoding":{"y":{"field":"n","type":"quantitative"},"x":{"field":"hour","type":"quantitative"}},"usermeta":{"embedOptions":{"renderer":"svg"}},"mark":{"type":"bar","tooltip":true},"width":400,"background":"floralwhite","height":300,"data":{"url":"index_files\/7.csv","format":{"type":"csv"}}});</script>
</div></td>
</tr>
</tbody>
Expand Down
50 changes: 25 additions & 25 deletions docs/index_files/0.csv
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
day-of-week,hour,n
1,16,4573
1,17,5857
1,21,1397
1,8,3176
1,10,1570
1,9,2004
1,7,2372
1,18,4384
1,15,3000
1,13,2454
1,19,2829
1,20,1755
1,12,2407
1,11,1978
1,14,2481
1,22,905
1,23,510
1,4,110
1,0,246
1,1,160
1,6,1321
1,3,70
1,2,80
1,5,404
hour,n
0,5111
1,3235
2,1874
3,1165
4,950
5,2802
6,8863
7,17065
8,22170
9,17316
10,17489
11,20593
12,24050
13,24837
14,25900
15,30730
16,40374
17,46889
18,38281
19,27107
20,17252
21,14388
22,10822
23,7327
48 changes: 24 additions & 24 deletions docs/index_files/1.csv
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
day-of-week,hour,n
2,16,5864
2,15,3617
2,7,2911
2,21,2183
2,14,2625
2,18,6011
2,11,1996
2,17,7407
2,23,646
2,8,3685
2,13,2529
2,22,1355
2,12,2538
2,10,1693
2,19,3982
2,20,2499
2,3,88
2,9,2124
2,6,1506
2,0,254
2,2,85
2,4,100
2,5,488
2,1,132
1,16,4573
1,17,5857
1,21,1397
1,8,3176
1,10,1570
1,9,2004
1,7,2372
1,18,4384
1,15,3000
1,13,2454
1,19,2829
1,20,1755
1,12,2407
1,11,1978
1,14,2481
1,22,905
1,23,510
1,4,110
1,0,246
1,1,160
1,6,1321
1,3,70
1,2,80
1,5,404
48 changes: 24 additions & 24 deletions docs/index_files/2.csv
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
day-of-week,hour,n
3,11,2460
3,8,3984
3,13,3196
3,12,3088
3,9,2342
3,17,7792
3,15,4104
3,19,3907
3,7,3443
3,22,1415
3,21,2182
3,0,361
3,20,2579
3,18,5589
3,16,6326
3,14,3177
3,10,1976
3,6,1750
3,23,765
3,2,113
3,3,76
3,4,110
3,5,526
3,1,185
2,16,5864
2,15,3617
2,7,2911
2,21,2183
2,14,2625
2,18,6011
2,11,1996
2,17,7407
2,23,646
2,8,3685
2,13,2529
2,22,1355
2,12,2538
2,10,1693
2,19,3982
2,20,2499
2,3,88
2,9,2124
2,6,1506
2,0,254
2,2,85
2,4,100
2,5,488
2,1,132
Loading

0 comments on commit 6faa8ac

Please sign in to comment.