Skip to content

Commit a9bf06d

Browse files
authored
Merge pull request #21 from cmudig/development
fix lingering bugs, prepare readme for release, bump to v1
2 parents 6929750 + 8ceb461 commit a9bf06d

9 files changed

+248
-184
lines changed

README.md

+58-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,60 @@
1-
# data-navigator
1+
# Data-Navigator
22

3-
A JavaScript library that allows for serial navigation of data structures using keyboard and touch inputs.
3+
![Data Navigator provides visualization toolkits with rich, accessible navigation structures, robust input handling, and flexible, semantic rendering.](assets/data_navigator.png)
44

5-
Simply open index.html or visit [our landing page](http://dig.cmu.edu/data-navigator/) to try our demo. You will need to run a local server in order to open vega-lite.html locally, but you can just [visit the vega-lite demo online](https://dig.cmu.edu/data-navigator/vega-lite.html).
5+
Data Navigator is a JavaScript library that allows for navigation of data structures. Data Navigator makes png, svg, canvas, and even webgl graphics accessible to a wide array of assistive technologies and input modalities.
6+
7+
Data Navigator has abstracted navigation into commands, which enables it to easily receive input from screen readers and keyboards to more interesting modalities like touch and mouse swiping, spoken commands, hand gestures, and even fabricated or totally novel interfaces, like bananas.
8+
9+
![Image in two parts. First part: Inputs: A. Hand swiping. B: Speaking "left." C. A hand gesture on camera. D. Bananas. Second part: Output: (focus moves left) A focus indicator has moved on a bar chart from one stacked bar to another on its left.](assets/inputs.png)
10+
11+
Data Navigator is expressive for builders and enables entire toolkits or ecosystems to become more accessible. The system provides low-level control over narratives, interaction paths, and journeys a user might want to take through an image or graphic.
12+
13+
Developers can build schemas that scale to work with any chart in a charting library or a single, bespoke implemetation for use in story-telling contexts like journalism, reports, presentations, and interactive infographics.
14+
15+
![Image in two parts. First part: A schema for navigation that works with any stacked bar chart. Great for libraries! A complex schema is shown over a stacked bar chart with up, down, left, and right directions. Second part: A bespoke, guided journey through a visual. Great for storytelling! A simple navigation path is shown going through the image.](assets/journey.png)
16+
17+
Not only are paths through an image customizeable but so are the visual indications that are rendered alongside those journeys. These visual indications use semantically rich, native HTML elements for maximized accessibility.
18+
19+
![Code used to render a path that looks like an outline and then place that outline over visual elements on a data visualization.](assets/path.png)
20+
21+
Visit [our landing page](http://dig.cmu.edu/data-navigator/) to try our demo, which shows a png image made into navigable experience. A variety of input modalities are enabled, including touch and mouse swiping, keyboard, screen reader, text input, voice control, and hand gesture recognition.
22+
23+
We also have [a vega-lite demo online](https://dig.cmu.edu/data-navigator/vega-lite.html), which (under the hood) shows how someone could write one schema that serves any chart in an ecosystem.
24+
25+
## Approach
26+
Data Navigator is organized into 3 separately composable modules: the first is a graph-based *structure* of nodes and edges, the second handles *input* and navigation logic, and the third *renders* the structure. These may be leveraged together or independently. Read our paper to learn more!
27+
28+
## Getting started
29+
You can install or use both esm and cjs modules in a variety of ways, in addition to importing all of data-navigator or just one part.
30+
```
31+
# to install into a project
32+
npm install data-navigator
33+
```
34+
```js
35+
// to use it in a .js or .ts file
36+
import { default as dataNavigator } from 'data-navigator'
37+
console.log(dataNavigator)
38+
```
39+
```html
40+
<!-- and even as a script tag module loaded from a cdn -->
41+
<script type="module">
42+
import dataNavigator from "https://cdn.jsdelivr.net/npm/[email protected]/dist/index.mjs"
43+
console.log(dataNavigator)
44+
</script>
45+
```
46+
47+
## Credit
48+
49+
Data-Navigator was developed at CMU's [Data Interaction Group](https://dig.cmu.edu/) (CMU DIG), primarily by [Frank Elavsky](https://frank.computer).
50+
51+
## Citing Data-Navigator
52+
53+
```bib
54+
@article{2023-data-navigator,
55+
year = {2023},
56+
author = {Frank Elavsky and Lucas Nadolskis and Dominik Moritz},
57+
title = {{Data Navigator:} An Accessibility-Centered Data Navigation Toolkit},
58+
journal = {{IEEE} {VIS}}
59+
}
60+
```

assets/data_navigator.png

306 KB
Loading

assets/inputs.png

1.18 MB
Loading

assets/journey.png

77.1 KB
Loading

assets/path.png

120 KB
Loading

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "data-navigator",
33
"author": "Frank Elavsky",
4-
"version": "0.10.0",
4+
"version": "1.0.0",
55
"main": "dist/index.jsm",
66
"module": "dist/index",
77
"types": "data-navigator.d.ts",
@@ -44,7 +44,7 @@
4444
"ts-loader": "^9.4.4",
4545
"tsup": "^7.2.0",
4646
"typescript": "^5.1.6",
47-
"webpack": "^5.72.0",
47+
"webpack": "^5.76.0",
4848
"webpack-cli": "^4.9.2"
4949
}
5050
}

src/rendering.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default (options: RenderingOptions) => {
7474

7575
renderer.root.appendChild(renderer.wrapper);
7676

77-
if (options.exitElement && options.exitElement.include) {
77+
if (options.exitElement?.include) {
7878
renderer.exitElement = document.createElement('div');
7979
renderer.exitElement.id = 'dn-exit-' + options.suffixId;
8080
renderer.exitElement.classList.add('dn-exit-position');
@@ -87,13 +87,13 @@ export default (options: RenderingOptions) => {
8787
// console.log("focused!",renderer.exitElement)
8888
renderer.exitElement.style.display = 'block';
8989
renderer.clearStructure();
90-
if (options.exitElement.callbacks && options.exitElement.callbacks.focus) {
90+
if (options.exitElement?.callbacks?.focus) {
9191
options.exitElement.callbacks.focus(e);
9292
}
9393
});
9494
renderer.exitElement.addEventListener('blur', e => {
9595
renderer.exitElement.style.display = 'none';
96-
if (options.exitElement.callbacks && options.exitElement.callbacks.blur) {
96+
if (options.exitElement?.callbacks?.blur) {
9797
options.exitElement.callbacks.blur(e);
9898
}
9999
});
@@ -104,7 +104,7 @@ export default (options: RenderingOptions) => {
104104
return renderer.root;
105105
};
106106
renderer.render = (nodeData: NodeObject) => {
107-
const id = nodeData.renderId;
107+
const id = nodeData.renderId + '';
108108
let d = options.elementData[id];
109109
if (!d) {
110110
console.warn(`Render data not found with renderId: ${id}. Failed to render.`);

src/structure.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const buildNodeStructureFromVegaLite = options => {
4444
const index = node.index;
4545
const level = node.level;
4646
const parent = node.parent;
47-
const edgeList = [];
47+
const edgeList = [] as EdgeList;
4848
// previous and next use parent.items[]
4949
const previous = parent.items[index - 1];
5050
if (previous) {

0 commit comments

Comments
 (0)