import React from "react"; const size = 1/6; /** @type {Array} */ export const ColumnMapping = [ [ 125, size*0.0, true ], [ 250, size*1.0, true ], [ 500, size*2.0, true ], [1000, size*3.0, true ], [2000, size*4.0, true ], [3000, size*4.5, false], [4000, size*5.0, true ], [6000, size*5.5, false], [8000, size*6.0, true ] ]; /** Looks up a frequency in ColumnMapping * @type {(inFrequency:number)=>Store.ColumnMapping|false} */ export const ColumnLookup =(inFrequency)=> { for(let i=0; iStore.Context} */ const Reselect =(inState, inTest)=> { /** @type {Store.Context} */ const output = { Test:inTest??inState.Live.Test }; const column = ColumnMapping[inState.Freq.Value]; if(column && output.Test) { const hz = column[0]; for(let i=0; iStore.DrawGroup} */ const Redraw =(inTest, inChan, inStim, inIsUser)=> { /** @type {Store.DrawGroup} */ const output = {Points:[], Paths:[]}; if(inTest) { let plot; for(let i=0; i} */ export const Context = React.createContext([Initial, (_a)=>{}]); /** @type {(props:{children:preact.ComponentChildren})=>preact.VNode} */ export const Provider =(props)=> { /** @type {Store.Binding} */ const reducer = React.useReducer(Reducer, Initial, ()=>Reducer(Initial, {Name:"Test", Data:0})); return React.createElement(Context.Provider, {value:reducer, children:props.children}); }; /** @type {()=>Store.Binding} */ export const Consumer =()=> React.useContext(Context);