Skip to content

Commit

Permalink
Merge pull request #4 from btupper/main
Browse files Browse the repository at this point in the history
Add 2024-11-05_fvcom post
  • Loading branch information
btupper authored Nov 5, 2024
2 parents 81c7b18 + e3efe0e commit a271300
Show file tree
Hide file tree
Showing 15 changed files with 1,112 additions and 51 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/.quarto/
.Rproj.user
265 changes: 243 additions & 22 deletions docs/index.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/listings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"listing": "/index.html",
"items": [
"/posts/2024-11-05_fvcom/index.html",
"/posts/2024-09-30_factor_foo/index.html",
"/posts/2024-09-27_cefi_intro/index.html",
"/posts/2024-09-25_usdot_roads/index.html"
Expand Down
234 changes: 214 additions & 20 deletions docs/posts/2024-09-30_factor_foo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.3.450">
<meta name="generator" content="quarto-1.4.543">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand All @@ -25,7 +25,7 @@
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
Expand Down Expand Up @@ -76,13 +76,22 @@
<script src="../../site_libs/bootstrap/bootstrap.min.js"></script>
<link href="../../site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="../../site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script src="../../site_libs/quarto-contrib/glightbox/glightbox.min.js"></script>
<link href="../../site_libs/quarto-contrib/glightbox/glightbox.min.css" rel="stylesheet">
<link href="../../site_libs/quarto-contrib/glightbox/lightbox.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
"location": "navbar",
"copy-button": false,
"collapse-after": 3,
"panel-placement": "end",
"type": "overlay",
"limit": 20,
"limit": 50,
"keyboard-shortcut": [
"f",
"/",
"s"
],
"show-item-context": false,
"language": {
"search-no-results-text": "No results",
"search-matching-documents-text": "matching documents",
Expand All @@ -91,6 +100,7 @@
"search-more-match-text": "more match in this document",
"search-more-matches-text": "more matches in this document",
"search-clear-button-title": "Clear",
"search-text-placeholder": "",
"search-detached-cancel-button-title": "Cancel",
"search-submit-button-title": "Submit",
"search-label": "Search"
Expand All @@ -103,10 +113,10 @@
<body class="nav-fixed fullcontent">

<div id="quarto-search-results"></div>
<header id="quarto-header" class="headroom fixed-top">
<nav class="navbar navbar-expand-lg navbar-dark ">
<header id="quarto-header" class="headroom fixed-top quarto-banner">
<nav class="navbar navbar-expand-lg " data-bs-theme="dark">
<div class="navbar-container container-fluid">
<div class="navbar-brand-container">
<div class="navbar-brand-container mx-auto">
<a class="navbar-brand" href="../../index.html">
<span class="navbar-title">Tandy Center for Ocean Forecasting</span>
</a>
Expand All @@ -118,23 +128,23 @@
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item">
<a class="nav-link" href="../../about.html" rel="" target="">
<span class="menu-text">About</span></a>
<a class="nav-link" href="../../about.html">
<span class="menu-text">About</span></a>
</li>
<li class="nav-item compact">
<a class="nav-link" href="https://github.com/bigelowlab/tandy-blog" rel="" target=""><i class="bi bi-github" role="img">
<a class="nav-link" href="https://github.com/bigelowlab/tandy-blog"> <i class="bi bi-github" role="img">
</i>
<span class="menu-text"></span></a>
<span class="menu-text"></span></a>
</li>
<li class="nav-item compact">
<a class="nav-link" href="../../sitemap.xml" rel="" target=""><i class="bi bi-rss" role="img">
<a class="nav-link" href="../../sitemap.xml"> <i class="bi bi-rss" role="img">
</i>
<span class="menu-text"></span></a>
<span class="menu-text"></span></a>
</li>
</ul>
<div class="quarto-navbar-tools">
</div>
</div> <!-- /navcollapse -->
<div class="quarto-navbar-tools">
</div>
</div> <!-- /container-fluid -->
</nav>
</header>
Expand Down Expand Up @@ -186,10 +196,11 @@ <h1 class="title">Factor foo</h1>




<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="6cr5qM4oi.jpg" class="lightbox img-fluid figure-img"></p>
<figcaption class="figure-caption">From https://clipart-library.com/clipart/6cr5qM4oi.htm</figcaption>
<p><a href="6cr5qM4oi.jpg" class="lightbox" data-glightbox="description: .lightbox-desc-1" data-gallery="quarto-lightbox-gallery-1" title="From https://clipart-library.com/clipart/6cr5qM4oi.htm"><img src="6cr5qM4oi.jpg" class="img-fluid figure-img" alt="From https://clipart-library.com/clipart/6cr5qM4oi.htm"></a></p>
<figcaption>From https://clipart-library.com/clipart/6cr5qM4oi.htm</figcaption>
</figure>
</div>
<section id="fooey" class="level2">
Expand Down Expand Up @@ -253,7 +264,7 @@ <h3 class="anchored" data-anchor-id="specify-you-own-order">Specify you own orde
<h2 class="anchored" data-anchor-id="factoring-integer-vectors">Factoring integer vectors</h2>
<p>Equally intuitive is the idea behind factoring integer vectors. Note that we indicate to R that we are specifying integers with the trailing “L” after each number. The “L” comes from “long integer” which has it’s own [history](https://www.techopedia.com/definition/24004/long-integer.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>x <span class="ot">=</span> <span class="fu">c</span>(3L, 0L, 0L, 3L, 9L, 9L, 0L)</span>
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>x <span class="ot">=</span> <span class="fu">c</span>(<span class="dv">3</span>L, <span class="dv">0</span>L, <span class="dv">0</span>L, <span class="dv">3</span>L, <span class="dv">9</span>L, <span class="dv">9</span>L, <span class="dv">0</span>L)</span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a>fx <span class="ot">=</span> <span class="fu">factor</span>(x)</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a>fx</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
Expand Down Expand Up @@ -340,6 +351,9 @@ <h3 class="anchored" data-anchor-id="summary">Summary</h3>
<p><code>factor()</code> provides a means for grouping elements in a vector - they work most intuitively with character and integer vectors. Use <code>cut()</code> to do similar groupings using real numbers.</p>


<div class="hidden" aria-hidden="true">
<span class="glightbox-desc lightbox-desc-1">From https://clipart-library.com/clipart/6cr5qM4oi.htm</span>
</div>
</section>
</section>

Expand Down Expand Up @@ -434,10 +448,9 @@ <h3> Contact us </h3>
// clear code selection
e.clearSelection();
});
function tippyHover(el, contentFn) {
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
const config = {
allowHTML: true,
content: contentFn,
maxWidth: 500,
delay: 100,
arrow: false,
Expand All @@ -447,8 +460,17 @@ <h3> Contact us </h3>
interactive: true,
interactiveBorder: 10,
theme: 'quarto',
placement: 'bottom-start'
placement: 'bottom-start',
};
if (contentFn) {
config.content = contentFn;
}
if (onTriggerFn) {
config.onTrigger = onTriggerFn;
}
if (onUntriggerFn) {
config.onUntrigger = onUntriggerFn;
}
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
Expand All @@ -462,6 +484,125 @@ <h3> Contact us </h3>
const note = window.document.getElementById(id);
return note.innerHTML;
});
}
const xrefs = window.document.querySelectorAll('a.quarto-xref');
const processXRef = (id, note) => {
// Strip column container classes
const stripColumnClz = (el) => {
el.classList.remove("page-full", "page-columns");
if (el.children) {
for (const child of el.children) {
stripColumnClz(child);
}
}
}
stripColumnClz(note)
if (id === null || id.startsWith('sec-')) {
// Special case sections, only their first couple elements
const container = document.createElement("div");
if (note.children && note.children.length > 2) {
container.appendChild(note.children[0].cloneNode(true));
for (let i = 1; i < note.children.length; i++) {
const child = note.children[i];
if (child.tagName === "P" && child.innerText === "") {
continue;
} else {
container.appendChild(child.cloneNode(true));
break;
}
}
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(container);
}
return container.innerHTML
} else {
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
return note.innerHTML;
}
} else {
// Remove any anchor links if they are present
const anchorLink = note.querySelector('a.anchorjs-link');
if (anchorLink) {
anchorLink.remove();
}
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
// TODO in 1.5, we should make sure this works without a callout special case
if (note.classList.contains("callout")) {
return note.outerHTML;
} else {
return note.innerHTML;
}
}
}
for (var i=0; i<xrefs.length; i++) {
const xref = xrefs[i];
tippyHover(xref, undefined, function(instance) {
instance.disable();
let url = xref.getAttribute('href');
let hash = undefined;
if (url.startsWith('#')) {
hash = url;
} else {
try { hash = new URL(url).hash; } catch {}
}
if (hash) {
const id = hash.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
if (note !== null) {
try {
const html = processXRef(id, note.cloneNode(true));
instance.setContent(html);
} finally {
instance.enable();
instance.show();
}
} else {
// See if we can fetch this
fetch(url.split('#')[0])
.then(res => res.text())
.then(html => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(html, "text/html");
const note = htmlDoc.getElementById(id);
if (note !== null) {
const html = processXRef(id, note);
instance.setContent(html);
}
}).finally(() => {
instance.enable();
instance.show();
});
}
} else {
// See if we can fetch a full url (with no hash to target)
// This is a special case and we should probably do some content thinning / targeting
fetch(url)
.then(res => res.text())
.then(html => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(html, "text/html");
const note = htmlDoc.querySelector('main.content');
if (note !== null) {
// This should only happen for chapter cross references
// (since there is no id in the URL)
// remove the first header
if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
note.children[0].remove();
}
const html = processXRef(null, note);
instance.setContent(html);
}
}).finally(() => {
instance.enable();
instance.show();
});
}
}, function(instance) {
});
}
let selectedAnnoteEl;
const selectorForAnnotation = ( cell, annotation) => {
Expand Down Expand Up @@ -504,6 +645,7 @@ <h3> Contact us </h3>
}
div.style.top = top - 2 + "px";
div.style.height = height + 4 + "px";
div.style.left = 0;
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
if (gutterDiv === null) {
gutterDiv = window.document.createElement("div");
Expand All @@ -529,6 +671,32 @@ <h3> Contact us </h3>
});
selectedAnnoteEl = undefined;
};
// Handle positioning of the toggle
window.addEventListener(
"resize",
throttle(() => {
elRect = undefined;
if (selectedAnnoteEl) {
selectCodeLines(selectedAnnoteEl);
}
}, 10)
);
function throttle(fn, ms) {
let throttle = false;
let timer;
return (...args) => {
if(!throttle) { // first call gets through
fn.apply(this, args);
throttle = true;
} else { // all the others get throttled
if(timer) clearTimeout(timer); // cancel #2
timer = setTimeout(() => {
fn.apply(this, args);
timer = throttle = false;
}, ms);
}
};
}
// Attach click handler to the DT
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
for (const annoteDlNode of annoteDls) {
Expand Down Expand Up @@ -589,6 +757,32 @@ <h3> Contact us </h3>
});
</script>
</div> <!-- /content -->
<script>var lightboxQuarto = GLightbox({"loop":false,"openEffect":"zoom","descPosition":"bottom","selector":".lightbox","closeEffect":"zoom"});
window.onload = () => {
lightboxQuarto.on('slide_before_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
const href = trigger.getAttribute('href');
if (href !== null) {
const imgEl = window.document.querySelector(`a[href="${href}"] img`);
if (imgEl !== null) {
const srcAttr = imgEl.getAttribute("src");
if (srcAttr && srcAttr.startsWith("data:")) {
slideConfig.href = srcAttr;
}
}
}
});

lightboxQuarto.on('slide_after_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(slideNode);
}
});

};
</script>




Expand Down
Binary file added docs/posts/2024-11-05_fvcom/fvcom-mesh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a271300

Please sign in to comment.