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

voxlens

v3.1.1

Published

JavaScript Library to Make Online Data Visualizations Accessible to Screen-Reader Users

Downloads

9

Readme

VoxLens

VoxLens is a JavaScript library that improves the accessibility of online data visualizations for screen-reader users.

This library is part of an ongoing research project being conducted at the University of Washington, led by Ather Sharif. Citations and links to our published work can be found at the end of this document.

GitHub license npm version CircleCI

Installation

npm i voxlens --save

Integration

Limitations

Currently, VoxLens supports:

  • Visualization Libraries: D3, Google Charts, and ChartJS.
  • Data Types: 2-D single-series and geosptial data. Sample data sets are provided under examples/src/data.
  • Browser: Chrome

Configuration Options

|Option|Required/Optional|Description| |--- |--- |--- | |x|Required|The key name(s) of the indepedent variable(s) in the dataset. Can be an array for multi-series data.| |y|Required|The key name of the depedent variable in the dataset.| |title|Required|The title of the visualization. Should be kept concise.| |chartType|Required|The chart type of the visualization. Must be one of bar, scatter, line, map, multiseries. Defaults to bar.| |dataModule|Required|Data module for geospatial data. Only required when chartType is map. Must be one of state, country.| |xLabel|Optional|The label for x. Defaults to the value of x. Used to contruct sentences for the screen-reader users. If your dataset has key names that are not well named or reflect the data column appropriately, please consider setting this value.| |yLabel|Optional|The label for y. Defaults to the value of y. Used to contruct sentences for the screen-reader users. If your dataset has key names that are not well named or reflect the data column appropriately, please consider setting this value.| |vx_metadata|Optional|Metadata for relaying uncertainty in the data to the user. Possible values are specified below.| |vx_metadata.min|Optional|The minimum value in the data series, if the data is an average value| |vx_metadata.max|Optional|The maximum value in the data series, if the data is an average value| |vx_metadata.stdev|Optional|The standard deviation of the data series, if the data is an average value| |vx_metadata.isAverage|Optional|The boolean flag true or false if the data is an average value|

Sample Implementation

import voxlens from 'voxlens';

const container = document.getElementById('chart');

const data = [
  { key: 'key1', value: 'value1' },
  { key: 'key2', value: 'value2' },
  { key: 'key3', value: 'value3' }    
];

const voxlensOptions = {
  x: 'key',
  y: 'value',
  title: 'This is the title of my visualization',
  xLabel: 'My-X-Label',
  yLabel: 'My-Y-Label',
};

For D3:

Add this line to the appropriate nested element (see this for example):

.call((d) => voxlens('d3', d, data, voxlensOptions));

For Google Charts:

(see this for example)

voxlens('googlecharts', chart, data, voxlensOptions);

For ChartJS:

(see this for example)

voxlens('chartjs', container, data, voxlensOptions);

Examples

Examples are provided under the example folder. Run npm start from within the example folder. A sample React app will run on localhost:3000. URLs for each library are as follows:

  • ChartJS: localhost:3000/voxlens/playground/chartjs
  • D3: localhost:3000/voxlens/playground/d3
  • Google Charts: localhost:3000/voxlens/playground/googlecharts

Additionally, you can interact with the examples at: https://athersharif.github.io/voxlens/playground/#/

Interaction Modes

Modifier Keys: Ctrl + Shift (Windows) and Option (MacOS)

|Mode|Activation Key|Description| |--- |--- |--- | |Question-and-Answer|Modifier Keys + A or Modifier Keys + 1|Enables users to interact with the visualization through voice commands using their microphone| |Summary|Modifier Keys + S or Modifier Keys + 2|Provides a holistic summary of the data contained in the visualization |Sonification|Modifier Keys + M or Modifier Keys + 3|Plays a sonified version of the data using the sonifier library| |Instructions|Modifier Keys + I or Modifier Keys + 4|Provides the user with instructions on how to interact with VoxLens| |Pause|Modifier Keys + P or Modifier Keys + 5|Pauses the output from VoxLens. Also works with sonification|

Testing VoxLens

In order to interact with the VoxLens, basic knowledge of screen reader usage is required, as well as a microphone. We understand that most people are not familiar with the screen readers, so we've also enabled console logs to show the output. When the screen reader reads the visualization, it also speaks out the instructions to interact with the graph, which is not presented visually to non-screen-reader users. For example, activating the question-and-answer mode will make a beep sound, after which a command such as "what is the maximum" or "tell me the average" can be said. The response for non-screen-reader users will appear in the console log (can be accessed via Chrome Developer Tools).

Dev Tools

Lint

ESLint is used for linting.

Command: make lint / npm run lint

Tests

Mocha and Enzyme are used as testing frameworks and for coverage. Adding/modifying tests for the proposed changes and ensuring that the coverage is at 100% is crucial. To run tests in watch mode:

npm run test

To generate coverage report:

npm run test:coverage

Docs

JSDoc is used for documentation. It's important to follow the guidelines for JSDoc to add informative and descriptive comments and documentation to the code. Documentation can be found here.

Command: make docs / npm run docs

Code formatter

Prettier is used for code formatting.

Command: make prettier / npm run prettier

Build

Babel is used for build purposes. Runs lint, tests, code formatter and docs as well.

Command: make build / npm run prepublish

Contributing

Pull requests are welcome and appreciated. Contributing guidelines can be found here.

License

Licensed under BSD. Can be found here.

Citations

Ather Sharif, Ruican Zhong, and Yadi Wang. 2023. Conveying Uncertainty in Data Visualizations to Screen-Reader Users Through Non-Visual Means. In The 25th International ACM SIGACCESS Conference on Computers and Accessibility (ASSETS '23). Association for Computing Machinery, New York, NY, USA. To Appear. https://doi.org/10.1145/3597638.3614502 (PDF | Presentation)

Ather Sharif, Andrew M. Zhang, Katharina Reinecke, and Jacob O. Wobbrock. 2023. Understanding and Improving Drilled-Down Information Extraction from Online Data Visualizations for Screen-Reader Users. In 20th International Web for All Conference (W4A23). Association for Computing Machinery, New York, NY, USA, 18–31. https://doi.org/10.1145/3587281.3587284 (PDF | Presentation | Best Paper Award)

Ather Sharif, Olivia H. Wang, Alida T. Muongchan, Katharina Reinecke, and Jacob O. Wobbrock. 2022. VoxLens: Making Online Data Visualizations Accessible with an Interactive JavaScript Plug-In. In Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems (CHI '22). Association for Computing Machinery, New York, NY, USA, Article 478, 1–19. https://doi.org/10.1145/3517428.3550360 (PDF | Presentation)

Ather Sharif, Sanjana S. Chintalapati, Jacob O. Wobbrock, and Katharina Reinecke. 2021. Understanding Screen-Reader Users’ Experiences with Online Data Visualizations. In The 23rd International ACM SIGACCESS Conference on Computers and Accessibility (ASSETS '21). Association for Computing Machinery, New York, NY, USA, Article 14, 1–16. https://doi.org/10.1145/3441852.3471202 (PDF | Presentation)

Read more about our work on accessibility of online data visualizations here.