Deploying to gh-pages from @ tmelliott/ts@1907e35fdf 🚀

This commit is contained in:
tmelliott 2025-01-28 23:03:54 +00:00
parent 6d069e95c5
commit 1392f7ff7a
3 changed files with 7 additions and 9 deletions

View File

@ -88,14 +88,14 @@ we can preview the results by calling the functions:</p>
<span><span class="co">#&gt; h &lt;- hist(faithful$waiting, breaks = bins, plot = FALSE)</span></span> <span><span class="co">#&gt; h &lt;- hist(faithful$waiting, breaks = bins, plot = FALSE)</span></span>
<span><span class="co">#&gt; data.frame(x = h$mids, y = h$density)</span></span> <span><span class="co">#&gt; data.frame(x = h$mids, y = h$density)</span></span>
<span><span class="co">#&gt; },</span></span> <span><span class="co">#&gt; },</span></span>
<span><span class="co">#&gt; result = ts_dataframe(eruptions = ts_numeric(), waiting = ts_numeric())</span></span> <span><span class="co">#&gt; result = ts_dataframe(x = ts_numeric(0), y = ts_numeric(0))</span></span>
<span><span class="co">#&gt; )</span></span> <span><span class="co">#&gt; )</span></span>
<span><span class="co">#&gt; get_smoother &lt;- ts_function(</span></span> <span><span class="co">#&gt; get_smoother &lt;- ts_function(</span></span>
<span><span class="co">#&gt; function(bandwidth = ts_numeric(1)) {</span></span> <span><span class="co">#&gt; function(bandwidth = ts_numeric(1)) {</span></span>
<span><span class="co">#&gt; d &lt;- density(faithful$waiting, bw = bandwidth)</span></span> <span><span class="co">#&gt; d &lt;- density(faithful$waiting, bw = bandwidth)</span></span>
<span><span class="co">#&gt; data.frame(x = d$x, y = d$y)</span></span> <span><span class="co">#&gt; data.frame(x = d$x, y = d$y)</span></span>
<span><span class="co">#&gt; },</span></span> <span><span class="co">#&gt; },</span></span>
<span><span class="co">#&gt; result = ts_dataframe(x = ts_numeric(), y = ts_numeric())</span></span> <span><span class="co">#&gt; result = ts_dataframe(x = ts_numeric(0), y = ts_numeric(0))</span></span>
<span><span class="co">#&gt; )</span></span> <span><span class="co">#&gt; )</span></span>
<span></span> <span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/source.html" class="external-link">source</a></span><span class="op">(</span><span class="st">'faithful-app.R'</span><span class="op">)</span></span> <span><span class="kw"><a href="https://rdrr.io/r/base/source.html" class="external-link">source</a></span><span class="op">(</span><span class="st">'faithful-app.R'</span><span class="op">)</span></span>
@ -114,9 +114,8 @@ we can preview the results by calling the functions:</p>
<span><span class="co">#&gt; 10 87.5 0.0169117647</span></span> <span><span class="co">#&gt; 10 87.5 0.0169117647</span></span>
<span><span class="co">#&gt; 11 92.5 0.0036764706</span></span> <span><span class="co">#&gt; 11 92.5 0.0036764706</span></span>
<span><span class="co">#&gt; 12 97.5 0.0007352941</span></span></code></pre></div> <span><span class="co">#&gt; 12 97.5 0.0007352941</span></span></code></pre></div>
<p>Thats it! Well use <code><a href="../reference/ts_deploy.html">ts_deploy()</a></code> later to create the <p>Thats it! Well use <code><a href="../reference/ts_compile.html">ts_compile()</a></code> later to create the
server code and Typescript schema for the app.</p> server code and Typescript schema for the app.</p>
<p>TODO: call ts_compile() from ts_deploy()?</p>
</div> </div>
<div class="section level2"> <div class="section level2">
<h2 id="create-the-react-app">Create the React app<a class="anchor" aria-label="anchor" href="#create-the-react-app"></a> <h2 id="create-the-react-app">Create the React app<a class="anchor" aria-label="anchor" href="#create-the-react-app"></a>
@ -134,7 +133,7 @@ packages:</p>
<div class="section level3"> <div class="section level3">
<h3 id="create-the-server-code">Create the server code<a class="anchor" aria-label="anchor" href="#create-the-server-code"></a> <h3 id="create-the-server-code">Create the server code<a class="anchor" aria-label="anchor" href="#create-the-server-code"></a>
</h3> </h3>
<p>We now use the <code><a href="../reference/ts_deploy.html">ts_deploy()</a></code> function to create two <p>We now use the <code><a href="../reference/ts_compile.html">ts_compile()</a></code> function to create two
files:</p> files:</p>
<ul> <ul>
<li> <li>
@ -148,8 +147,7 @@ functions directly in the app like any other typescript function!</li>
<p>Well send these straight to the <code>faithful-demo/src</code> <p>Well send these straight to the <code>faithful-demo/src</code>
directory.</p> directory.</p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r"> <div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/ts_compile.html">ts_compile</a></span><span class="op">(</span><span class="st">'faithful-app.R'</span>, file <span class="op">=</span> <span class="st">'faithful-demo/src/faithful-app.rserve.ts'</span><span class="op">)</span></span> <code class="sourceCode R"><span><span class="fu"><a href="../reference/ts_compile.html">ts_compile</a></span><span class="op">(</span><span class="st">'faithful-app.R'</span>, filename <span class="op">=</span> <span class="st">'faithful-demo/src/faithful-app.rserve'</span><span class="op">)</span></span></code></pre></div>
<span><span class="fu"><a href="../reference/ts_deploy.html">ts_deploy</a></span><span class="op">(</span><span class="st">'faithful-app.R'</span>, file <span class="op">=</span> <span class="st">'faithful-demo/src/faithful-app.rserve.R'</span><span class="op">)</span></span></code></pre></div>
</div> </div>
<div class="section level3"> <div class="section level3">
<h3 id="write-the-app">Write the app<a class="anchor" aria-label="anchor" href="#write-the-app"></a> <h3 id="write-the-app">Write the app<a class="anchor" aria-label="anchor" href="#write-the-app"></a>

View File

@ -3,7 +3,7 @@ pkgdown: 2.1.1
pkgdown_sha: ~ pkgdown_sha: ~
articles: articles:
simple-react-app: simple-react-app.html simple-react-app: simple-react-app.html
last_built: 2025-01-28T20:31Z last_built: 2025-01-28T23:03Z
urls: urls:
reference: http://tomelliott.co.nz/ts/reference reference: http://tomelliott.co.nz/ts/reference
article: http://tomelliott.co.nz/ts/articles article: http://tomelliott.co.nz/ts/articles

File diff suppressed because one or more lines are too long