ov-scope
src/ov-scope.js
A STILL OF demo/scope.html
Attributes
| attribute | |
|---|---|
source | |
sweeps | read-only as a property: pass it as an attribute, never as a prop |
window |
Properties
None that can be set. See the read-only properties below.
READ-ONLY PROPERTIES
cap, shaderName, sweeps
The names in bold are also attributes. Assigning one as a prop throws, so set them in markup.
Events
None.
Using it
import 'overscan'
import 'overscan/overscan.css'
<ov-scope
source="doc-square"
sweeps="16"
window="160"
style="block-size:140px;inline-size:100%"
>
</ov-scope>
<script type="module">
import '../src/ov-source.js';
/* The scope demo's square wave, held constant: a function of time only, so
every open draws the same trace. Named doc-, so it cannot collide with a
demo fixture. */
window.Overscan.source('doc-square', (t) => {
const phase = (t * 0.9) % 1;
return (phase
< 0.5 ? 74 : 26) + Math.sin(t * 11) * 1.4;
}, { hz: 60 });
</script>import { OvScope } from 'overscan/react'
<OvScope
source="doc-square"
sweeps="16"
window="160"
/>import { OvScope } from 'overscan/vue'
<OvScope
source="doc-square"
sweeps="16"
window="160"
/>import OvScope from 'overscan/svelte/OvScope.svelte'
<OvScope
source="doc-square"
sweeps="16"
window="160"
/>The CSS is a separate import in every framework. A single element can be imported on its own instead of the whole kit: import 'overscan/src/ov-chart.js'
A reading is set as a PROPERTY, never an attribute. An attribute is a string, so an array cannot survive one and a null arrives as the word "null", which the protocol would read as a value rather than a dropout.
Every ov: event is bound with addEventListener. The colon has no declarative spelling in Svelte 5, where the on: directive is gone and "onov:commit" is not an identifier, nor in JSX. Vue can bind it.
The wrapper applies attributes ITSELF and hands the framework nothing but a ref. All three frameworks set a prop as a property when the name exists on the element, and this kit has 77 getter-only properties across 43 elements. Assigning one throws, and in React it does not degrade: the whole tree fails to render. 13 elements have a getter-only name that is also a real attribute (at, bearing, digits, duration, floor, fov, fresh, hold, lat, lon, period, pitch, range, ring, rings, span, step, sweep, sweeps, traces, value), which are the ones a reader would naturally pass in markup.