npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

noisycharts

v1.0.4

Published

A tool for turning data into audio to make it more accessible

Downloads

281

Readme

Noisycharts chart sonification plugin

This is the standalone javascript version of the noisycharts module. This has been released as an open source package so others can integrate it into their chart software to provide an audio alternative to visual charts that is accessible to people with a vision impairment.

See a live demo of noisycharts here, or check out the demo implementations in the /test folder.

Installation

npm install noisycharts

Usage

Create a new noisychart instance using the constructor:

let noisychart = new NoisyChart(settings)

Where settings is an object specifying your noisychart settings, eg:

let noisychart = new NoisyChart({settings:settings, data:data})

The default arguments for the NoisyChart object are:

{data, dataKeys=[], chartID=null, controlsID=controlsID, settings=default_settings, animationID=null, x=null, y=null, colors=default_colors}

data (required)

The data object you want to turn into audio, usually 'wide' rather than 'long'.

dataKeys (optional)

Optionally specify an array of data keys to be used when turning the data into audio, analagous to column headings in a wide dataset. This can be used to exclude columns or data series from the sonification

chartID (optional)

The ID of the html element containing your chart

controlsID (optional)

The ID of the element where you want the controls to be added to

animationID (optional)

The ID of the SVG element you want to target for the noisycharts cursor animations, if you're using a tag to reposition your chart elements with the d3 margin convention, then it should be the ID of the tag. If you're not using a tag for this, then use the ID of your SVG.

x (optional)

The d3 x axis object for your chart, required if you want animations to work.

y (optional)

The d3 y axis object for your chart, required if you want animations to work.

colors (optional)

A d3 color scale to use with the cursor animation. Defaults to red otherwise.

settings (optional)

Optionally specify settings for the sonification.

const default_settings = {
  "xColumn": null,
  "audioRendering": null,
  "invertY":null,
  "type":null,
  "interval":null,
  "xFormat": {
      "date": null,
      "string": null,
      "number": null,
      "status": "",
      "type": null
  }
}

Load in your data so noisycharts can analyse it and set everything up:

noisychart.setupSonicData(data)

Add noisychart control buttons or hotkey interaction to specific elements on your page:

noisychart.addInteraction('audioControls')

Development and testing

You can run the test/demos from the /tests folder by running npm install then npm start.