| 1 | <!doctype html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | <style type="text/css"> |
| 7 | @import url("observable:styles/index.css"); |
| 8 | @import url("@fontsource/spline-sans-mono/400.css"); |
| 9 | @import url("@fontsource/spline-sans-mono/600.css"); |
| 10 | @import url("@fontsource/spline-sans-mono/700.css"); |
| 11 | @import url("@fontsource/spline-sans-mono/400-italic.css"); |
| 12 | @import url("@fontsource/spline-sans-mono/600-italic.css"); |
| 13 | @import url("@fontsource/spline-sans-mono/700-italic.css"); |
| 14 | @import url("@fontsource/source-serif-4/400.css"); |
| 15 | @import url("@fontsource/source-serif-4/700.css"); |
| 16 | @import url("@fontsource/source-serif-4/400-italic.css"); |
| 17 | @import url("@fontsource/source-serif-4/700-italic.css"); |
| 18 | @import url("@fontsource/inter/400.css"); |
| 19 | @import url("@fontsource/inter/500.css"); |
| 20 | @import url("@fontsource/inter/600.css"); |
| 21 | @import url("@fontsource/inter/700.css"); |
| 22 | @import url("@fontsource/inter/400-italic.css"); |
| 23 | @import url("@fontsource/inter/500-italic.css"); |
| 24 | @import url("@fontsource/inter/600-italic.css"); |
| 25 | @import url("@fontsource/inter/700-italic.css"); |
| 26 | </style> |
| 27 | <style> |
| 28 | body { |
| 29 | display: grid; |
| 30 | grid-template-columns: 1fr; |
| 31 | column-gap: 2rem; |
| 32 | align-items: start; |
| 33 | } |
| 34 | |
| 35 | header.repo-header { |
| 36 | grid-column: 1 / -1; |
| 37 | padding: 0.75rem 1.5rem 0; |
| 38 | } |
| 39 | |
| 40 | header.repo-header a { |
| 41 | display: inline-flex; |
| 42 | align-items: center; |
| 43 | gap: 0.35rem; |
| 44 | font: 12px/1 var(--sans-serif); |
| 45 | color: var(--theme-foreground-muted); |
| 46 | text-decoration: none; |
| 47 | } |
| 48 | |
| 49 | header.repo-header a:hover { |
| 50 | color: var(--theme-foreground); |
| 51 | } |
| 52 | |
| 53 | header.repo-header svg { |
| 54 | flex-shrink: 0; |
| 55 | } |
| 56 | |
| 57 | main { |
| 58 | min-width: 0; |
| 59 | padding-left: 1.5rem; |
| 60 | } |
| 61 | |
| 62 | aside.toc { |
| 63 | display: none; |
| 64 | } |
| 65 | |
| 66 | @media (min-width: 1080px) { |
| 67 | body { |
| 68 | max-width: calc(var(--max-width, 1100px) + 220px + 2rem); |
| 69 | grid-template-columns: minmax(0, 1fr) 220px; |
| 70 | } |
| 71 | |
| 72 | aside.toc { |
| 73 | display: block; |
| 74 | position: sticky; |
| 75 | top: 1.25rem; |
| 76 | align-self: start; |
| 77 | max-height: calc(100vh - 2.5rem); |
| 78 | overflow-y: auto; |
| 79 | font: 14px/1.45 var(--sans-serif); |
| 80 | color: var(--theme-foreground-muted); |
| 81 | padding-right: 0.25rem; |
| 82 | } |
| 83 | |
| 84 | aside.toc .toc-title { |
| 85 | font-weight: 600; |
| 86 | font-size: 12px; |
| 87 | letter-spacing: 0.04em; |
| 88 | text-transform: uppercase; |
| 89 | color: var(--theme-foreground-muted); |
| 90 | margin-bottom: 0.5rem; |
| 91 | } |
| 92 | |
| 93 | aside.toc ol { |
| 94 | list-style: none; |
| 95 | padding: 0; |
| 96 | margin: 0; |
| 97 | border-left: 1px solid var(--theme-foreground-faintest); |
| 98 | } |
| 99 | |
| 100 | aside.toc li { margin: 0; } |
| 101 | aside.toc li.toc-h3 { padding-left: 1rem; } |
| 102 | |
| 103 | aside.toc a { |
| 104 | display: block; |
| 105 | padding: 0.2rem 0.75rem; |
| 106 | margin-left: -1px; |
| 107 | border-left: 1px solid transparent; |
| 108 | color: var(--theme-foreground-muted); |
| 109 | text-decoration: none; |
| 110 | line-height: 1.35; |
| 111 | } |
| 112 | |
| 113 | aside.toc a:hover { |
| 114 | color: var(--theme-foreground); |
| 115 | } |
| 116 | |
| 117 | aside.toc a.active { |
| 118 | color: var(--theme-foreground); |
| 119 | border-left-color: var(--theme-foreground-focus); |
| 120 | } |
| 121 | } |
| 122 | </style> |
| 123 | </head> |
| 124 | <body> |
| 125 | <header class="repo-header"> |
| 126 | <a href="https://github.com/iopsystems/histogram" target="_blank" rel="noopener noreferrer"> |
| 127 | <svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"> |
| 128 | <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/> |
| 129 | </svg> |
| 130 | iopsystems/histogram |
| 131 | </a> |
| 132 | </header> |
| 133 | <main></main> |
| 134 | <aside class="toc" aria-label="On this page"> |
| 135 | <nav> |
| 136 | <div class="toc-title">On this page</div> |
| 137 | <ol id="toc-list"></ol> |
| 138 | </nav> |
| 139 | </aside> |
| 140 | <script type="module"> |
| 141 | const main = document.querySelector("main"); |
| 142 | const list = document.getElementById("toc-list"); |
| 143 | let observer = null; |
| 144 | let signature = ""; |
| 145 | |
| 146 | function build() { |
| 147 | const headings = main.querySelectorAll("h2[id], h3[id]"); |
| 148 | const sig = Array.from(headings, (h) => h.tagName + h.id + h.textContent).join("|"); |
| 149 | if (sig === signature) return; |
| 150 | signature = sig; |
| 151 | |
| 152 | list.replaceChildren(); |
| 153 | const targets = []; |
| 154 | for (const h of headings) { |
| 155 | const li = document.createElement("li"); |
| 156 | li.className = "toc-" + h.tagName.toLowerCase(); |
| 157 | const a = document.createElement("a"); |
| 158 | a.href = "#" + h.id; |
| 159 | a.textContent = h.textContent; |
| 160 | li.appendChild(a); |
| 161 | list.appendChild(li); |
| 162 | targets.push({ el: h, link: a }); |
| 163 | } |
| 164 | |
| 165 | if (observer) observer.disconnect(); |
| 166 | if (!targets.length) return; |
| 167 | |
| 168 | const linkOf = new Map(targets.map((t) => [t.el, t.link])); |
| 169 | const visible = new Set(); |
| 170 | observer = new IntersectionObserver( |
| 171 | (entries) => { |
| 172 | for (const e of entries) { |
| 173 | if (e.isIntersecting) visible.add(e.target); |
| 174 | else visible.delete(e.target); |
| 175 | } |
| 176 | const ordered = targets.filter((t) => visible.has(t.el)); |
| 177 | const active = ordered[0]?.link ?? null; |
| 178 | for (const { link } of targets) link.classList.toggle("active", link === active); |
| 179 | }, |
| 180 | { rootMargin: "0px 0px -65% 0px", threshold: 0 } |
| 181 | ); |
| 182 | for (const { el } of targets) observer.observe(el); |
| 183 | } |
| 184 | |
| 185 | const mo = new MutationObserver(() => build()); |
| 186 | mo.observe(main, { childList: true, subtree: true }); |
| 187 | build(); |
| 188 | </script> |
| 189 | </body> |
| 190 | </html> |