The package was developed as a standalone file with a couple of test drivers. The tests themselves run in the browser and require no back end server to drive them. The source code is at BREC/Js and a browser executable demo is here. An image of one of the unit tests is below.
|Example of HTML Canvas used to graph signals. Browser demo available here.|
The example has several buttons along the bottom. The "run" button causes internal updates to the XY sequence displayed. In the default case this is just a sinusoid with a up and down chirping frequency.
The "marker" button displays 10 markers. These start out as predefined values on a sinusoid. If you click anywhere on the canvas, marker 9 moves to that position.
The "peaks" button toggles peak picking. When peak picking is on, markers 0 - 8 are taken over and assigned automatically to peaks found. Marker 9 still follows the last canvas clicked location.
The "memshow" button toggles the display of a XY sequence in memory. This is shown in light blue. The "mem" button captures the currently displayed sequence into the memory.
The "envelope" button toggles an envelope history. When enabled the envelope is initialized and displayed. When toggled off the envelope is hidden and not active.
The "function" button toggles between two internally generated XY series. The first is the chirped sinusoid, the second is a spectrum like signal with two peaks and some random noise.