Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amplitude-viewer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amplitude-viewer

render amplitudes like an oscilloscope in the browser given arrays of data

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

amplitude-viewer

render amplitudes like an oscilloscope in the browser given arrays of data

example

var ascope = require('amplitude-viewer')(fn);
ascope.appendTo('#scope');

setInterval(function () {
    ascope.setTime(Date.now() / 1000);
    ascope.draw(fn);
}, 50);

function fn (t) {
    return sin(440) * 0.25 + sin(441) * 0.25 + sin(880) * 0.5;
    function sin (x) { return Math.sin(2 * Math.PI * t * x) }
}

methods

var viewer = require('amplitude-viewer')

var ascope = viewer()

Create a new viewer.

ascope.appendTo(target)

Append the ascope element to target, a query selector string or container element.

ascope.setTime(t)

Set the drawing time in seconds.

ascope.setOffset(t)

Set an offset to the drawing time in seconds.

ascope.setDuration(d)

Set the width of the time window.

ascope.draw(fn)

Draw a wave according to fn(t), which should return an amplitude from -1 to 1 give a time t in seconds.

install

With npm do:

npm install amplitude-viewer

license

MIT

Keywords

FAQs

Package last updated on 25 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc