maidr 3.38.1 → 3.42.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +328 -194
- package/dist/maidr.css +1 -1
- package/dist/maidr.js +232 -232
- package/dist/maidr.js.map +1 -1
- package/package.json +12 -2
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="docs/logo
|
|
2
|
+
<img src="docs/logo.svg" width="350px" alt="A stylized MAIDR logo, with curved characters for M A, a hand pointing for an I, the D character, and R represented in braille."/>
|
|
3
3
|
<hr style="color:transparent" />
|
|
4
4
|
<br />
|
|
5
5
|
</div>
|
|
@@ -17,14 +17,15 @@ and encourages a multi-modal exploration on visualization.
|
|
|
17
17
|
## Table of Contents
|
|
18
18
|
|
|
19
19
|
1. [Usage](#usage)
|
|
20
|
-
2. [
|
|
21
|
-
3. [
|
|
22
|
-
4. [
|
|
23
|
-
5. [
|
|
24
|
-
6. [
|
|
25
|
-
7. [
|
|
26
|
-
8. [
|
|
27
|
-
9. [
|
|
20
|
+
2. [Examples](#examples)
|
|
21
|
+
3. [Controls](#controls)
|
|
22
|
+
4. [Braille Generation](#braille-generation)
|
|
23
|
+
5. [API](#api)
|
|
24
|
+
6. [Binders](#binders)
|
|
25
|
+
7. [Papers](#papers)
|
|
26
|
+
8. [License](#license)
|
|
27
|
+
9. [Contact](#contact)
|
|
28
|
+
10. [Acknowledgments](#acknowledgments)
|
|
28
29
|
|
|
29
30
|
## Usage
|
|
30
31
|
|
|
@@ -40,8 +41,8 @@ To use maidr, follow these steps:
|
|
|
40
41
|
<head>
|
|
41
42
|
<meta charset="UTF-8" />
|
|
42
43
|
<title>maidr Example</title>
|
|
43
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/maidr/dist/maidr_style.
|
|
44
|
-
<script src="https://cdn.jsdelivr.net/npm/maidr/dist/maidr.
|
|
44
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/maidr@latest/dist/maidr_style.css" />
|
|
45
|
+
<script src="https://cdn.jsdelivr.net/npm/maidr@latest/dist/maidr.js"></script>
|
|
45
46
|
</head>
|
|
46
47
|
<body>
|
|
47
48
|
<div>
|
|
@@ -53,218 +54,347 @@ To use maidr, follow these steps:
|
|
|
53
54
|
|
|
54
55
|
3. Add your data: Include your data as a JSON schema directly in the HTML file. There should be a single `maidr` object with the following properties, or an array of objects if multiple plots exist on the page. Your JSON schema may look like so: (values for demonstration purposes)
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
```javascript
|
|
57
58
|
// a single plot
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
x: { label: 'Highway Milage' },
|
|
101
|
-
},
|
|
102
|
-
selector: '#boxplot1 g[id^="panel"] > g[id^="geom_boxplot.gTree"]',
|
|
103
|
-
data: []
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
type: 'bar',
|
|
107
|
-
id: 'mybarplot',
|
|
108
|
-
// etc
|
|
109
|
-
}
|
|
110
|
-
];
|
|
111
|
-
```
|
|
59
|
+
<script>
|
|
60
|
+
var maidr = {
|
|
61
|
+
id: "barplot_1",
|
|
62
|
+
subplots: [
|
|
63
|
+
[
|
|
64
|
+
{
|
|
65
|
+
id: "barplot_1", //add the same id to the svg component
|
|
66
|
+
layers: [
|
|
67
|
+
{
|
|
68
|
+
id: "bar_layer1",
|
|
69
|
+
type: "bar",
|
|
70
|
+
title: "Sample Bar plot",
|
|
71
|
+
axes: {
|
|
72
|
+
x: "Category",
|
|
73
|
+
y: "Value"
|
|
74
|
+
},
|
|
75
|
+
data: [
|
|
76
|
+
{
|
|
77
|
+
"x": "A",
|
|
78
|
+
"y": 10
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"x": "B",
|
|
82
|
+
"y": 24
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"x": "C",
|
|
86
|
+
"y": 15
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"x": "D",
|
|
90
|
+
"y": 7
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
</script>
|
|
100
|
+
```
|
|
112
101
|
|
|
102
|
+
Or multiple plots:
|
|
103
|
+
```javascript
|
|
104
|
+
<script>
|
|
105
|
+
var maidr = {
|
|
106
|
+
"id": "multipanel_plot",
|
|
107
|
+
"subplots": [
|
|
108
|
+
[
|
|
109
|
+
{
|
|
110
|
+
"id": "line1",
|
|
111
|
+
"layers": [
|
|
112
|
+
{
|
|
113
|
+
"id": "line_layer",
|
|
114
|
+
"type": "line",
|
|
115
|
+
"title": "Line Plot: Random Data",
|
|
116
|
+
"axes": {
|
|
117
|
+
"x": "X-axis",
|
|
118
|
+
"y": "Values"
|
|
119
|
+
},
|
|
120
|
+
"data": [
|
|
121
|
+
[]
|
|
122
|
+
],
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
{
|
|
129
|
+
"id": "bar1",
|
|
130
|
+
"layers": [
|
|
131
|
+
{
|
|
132
|
+
"id": "bar1_layer",
|
|
133
|
+
"type": "bar",
|
|
134
|
+
"title": "Bar Plot: Random Values",
|
|
135
|
+
"axes": {
|
|
136
|
+
"x": "Categories",
|
|
137
|
+
"y": "Values"
|
|
138
|
+
},
|
|
139
|
+
"data": []
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
[
|
|
145
|
+
{
|
|
146
|
+
"id": "bar2",
|
|
147
|
+
"layers": [
|
|
148
|
+
{
|
|
149
|
+
"id": "bar2_layer",
|
|
150
|
+
"type": "bar",
|
|
151
|
+
"title": "Bar Plot 2: Random Values",
|
|
152
|
+
"axes": {
|
|
153
|
+
"x": "Categories",
|
|
154
|
+
"y": "Values"
|
|
155
|
+
},
|
|
156
|
+
"data": []
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
</script>
|
|
164
|
+
```
|
|
113
165
|
4. Use the following to define the object properties:
|
|
114
166
|
|
|
115
|
-
- `type`: the type of plot. Currently supported are 'bar,' '
|
|
167
|
+
- `type`: the type of plot. Currently supported are 'bar', 'box', 'candlestick', 'dodged_bar', 'heat', 'hist', 'line', 'stacked_normalized_bar', 'point', 'smooth', 'stacked_bar',
|
|
116
168
|
- `id`: the id that you added as an attribute of your main SVG.
|
|
117
169
|
- `title`: the title of the plot. (optional)
|
|
118
170
|
- `axes`: axes info for your plot. `maidr.axes.x.label` and `maidr.axes.y.label` will provide axes labels, and `maidr.axes.x.level` or `maidr.axes.y.level` (x or y, not both) will provide level or tick mark labels.
|
|
119
171
|
- `data`: the main data for your plot. See below.
|
|
120
172
|
|
|
121
173
|
5. Define your data set using the `maidr.data` property. This comes in different formats depending on a plot type:
|
|
174
|
+
The data property is defined as a list of objects where each object is a record with fields x and y.
|
|
175
|
+
|
|
176
|
+
```javascript
|
|
122
177
|
|
|
123
|
-
```javascript
|
|
124
178
|
let maidr;
|
|
125
179
|
|
|
126
180
|
// barplot maidr.data structure: a simple array of values
|
|
127
181
|
maidr = {
|
|
128
|
-
data: [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
182
|
+
"data": [
|
|
183
|
+
{
|
|
184
|
+
"x": "A",
|
|
185
|
+
"y": 5.982192824845484
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"x": "B",
|
|
189
|
+
"y": 9.309858198175455
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"x": "C",
|
|
193
|
+
"y": 7.3531284491571505
|
|
194
|
+
},
|
|
195
|
+
]
|
|
138
196
|
};
|
|
139
197
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
198
|
+
// boxplot maidr.data structure: an array of objects with properties lower_outlier, min, q1, q2, q3, max, and upper_outlier
|
|
199
|
+
maidr = {
|
|
200
|
+
"data": [
|
|
201
|
+
{
|
|
202
|
+
"lowerOutliers": [
|
|
203
|
+
40.0,
|
|
204
|
+
50.0
|
|
205
|
+
],
|
|
206
|
+
"min": 71.35451232573614,
|
|
207
|
+
"q1": 92.62315416457983,
|
|
208
|
+
"q2": 99.64912548800726,
|
|
209
|
+
"q3": 107.6684972253361,
|
|
210
|
+
"max": 118.19391634772752,
|
|
211
|
+
"upperOutliers": [
|
|
212
|
+
150.0,
|
|
213
|
+
160.0
|
|
214
|
+
],
|
|
215
|
+
"fill": "Group 1"
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
],
|
|
219
|
+
|
|
220
|
+
"orientation": "vert" //vert for vertical box plots, horz for horizontal bar plots
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
//candlestick
|
|
224
|
+
maidr = {
|
|
225
|
+
"data":[
|
|
226
|
+
{
|
|
227
|
+
'value': '2023-02-16',
|
|
228
|
+
'open': 151.61,
|
|
229
|
+
'high': 151.82,
|
|
230
|
+
'low': 151.59,
|
|
231
|
+
'close': 151.8,
|
|
232
|
+
'volume': 0
|
|
233
|
+
},
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
//dodged_bar
|
|
238
|
+
maidr = {
|
|
239
|
+
"data":[
|
|
240
|
+
[
|
|
241
|
+
{
|
|
242
|
+
"x":"Adelie",
|
|
243
|
+
"fill":"Below",
|
|
244
|
+
"y":70
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
[ {
|
|
248
|
+
"x":"Adelie",
|
|
249
|
+
"fill":"Above",
|
|
250
|
+
"y":90
|
|
251
|
+
}]
|
|
252
|
+
]
|
|
253
|
+
}
|
|
157
254
|
|
|
158
|
-
//
|
|
159
|
-
|
|
255
|
+
// heatmap maidr.data structure: a 2D array of values
|
|
256
|
+
maidr = {
|
|
257
|
+
"data": {
|
|
258
|
+
"points": [
|
|
259
|
+
[ 60.5, 86.7, 89.3 ],
|
|
260
|
+
[ 18.6, 67.6, 83.9 ],
|
|
261
|
+
[ 18.5, 65.4, 78.7 ],
|
|
262
|
+
],
|
|
263
|
+
"x": [
|
|
264
|
+
"CoLA",
|
|
265
|
+
"MNLI",
|
|
266
|
+
"MRPC",
|
|
267
|
+
],
|
|
268
|
+
"y": [
|
|
269
|
+
"BERT",
|
|
270
|
+
"BiLSTM",
|
|
271
|
+
"BiLSTM+Attn",
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
//histogram
|
|
277
|
+
maidr = {
|
|
278
|
+
"data":[
|
|
279
|
+
{
|
|
280
|
+
"y": 4.0,
|
|
281
|
+
"x": 1.1475,
|
|
282
|
+
"xMin": 1.0,
|
|
283
|
+
"xMax": 1.295,
|
|
284
|
+
"yMin": 0,
|
|
285
|
+
"yMax": 4.0
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
//line
|
|
291
|
+
maidr = {
|
|
292
|
+
"data":[
|
|
293
|
+
[
|
|
294
|
+
{
|
|
295
|
+
"x": 1.0,
|
|
296
|
+
"y": 2.0
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"x": 2.0,
|
|
300
|
+
"y": 4.0
|
|
301
|
+
},
|
|
302
|
+
]
|
|
303
|
+
//add multiple arrays for multiline plots
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// scatterplot
|
|
160
308
|
maidr = {
|
|
161
309
|
data: [
|
|
162
310
|
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
// line data could go here
|
|
311
|
+
"x": 1.0,
|
|
312
|
+
"y": 2.0
|
|
313
|
+
},
|
|
167
314
|
],
|
|
168
315
|
};
|
|
169
316
|
|
|
170
317
|
// smooth line maidr.data: an object containing x and y properties, each with an array of float values
|
|
171
318
|
// note that data is an array here as scatterplots are often combine with line plots
|
|
172
319
|
maidr = {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
320
|
+
"data":[
|
|
321
|
+
[
|
|
322
|
+
{
|
|
323
|
+
"x": 4.7,
|
|
324
|
+
"y": 3.12,
|
|
325
|
+
"svg_x": 404.51,
|
|
326
|
+
"svg_y": 390.012
|
|
327
|
+
},
|
|
328
|
+
]
|
|
329
|
+
]
|
|
330
|
+
}
|
|
182
331
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
31.9422,
|
|
248
|
-
31.3885,
|
|
249
|
-
30.8509,
|
|
250
|
-
30.33,
|
|
251
|
-
29.8239,
|
|
252
|
-
29.3334,
|
|
253
|
-
28.8584,
|
|
254
|
-
28.3981,
|
|
255
|
-
27.9519,
|
|
256
|
-
27.5189,
|
|
257
|
-
27.0988,
|
|
258
|
-
26.6958,
|
|
259
|
-
26.3091,
|
|
260
|
-
25.9356,
|
|
261
|
-
],
|
|
262
|
-
},
|
|
263
|
-
],
|
|
264
|
-
};
|
|
265
|
-
```
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
6. If multiple plots are overlaid on the same SVG, provide the data corresponding to every plot in the layers array.
|
|
335
|
+
|
|
336
|
+
```javascript
|
|
337
|
+
maidr = {
|
|
338
|
+
"id": "multilayer_plot",
|
|
339
|
+
"subplots": [
|
|
340
|
+
[
|
|
341
|
+
{
|
|
342
|
+
"id": "445f4f08-b8a5-4204-8c55-0851eda7daec",
|
|
343
|
+
"layers": [
|
|
344
|
+
{
|
|
345
|
+
"id": "f548e01f-ed13-469c-9e0a-cea420ec8b3f",
|
|
346
|
+
"type": "bar",
|
|
347
|
+
"title": "",
|
|
348
|
+
"axes": {
|
|
349
|
+
"x": "X values",
|
|
350
|
+
"y": "Bar values"
|
|
351
|
+
},
|
|
352
|
+
"data": [
|
|
353
|
+
{
|
|
354
|
+
"x": "0",
|
|
355
|
+
"y": 3.0
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"x": "1",
|
|
359
|
+
"y": 5.0
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"id": "f022d8e9-4aff-4ab0-9959-904fd07c9bd2",
|
|
365
|
+
"type": "line",
|
|
366
|
+
"title": "Multilayer Plot Example",
|
|
367
|
+
"axes": {
|
|
368
|
+
"x": "X values",
|
|
369
|
+
"y": "Line values"
|
|
370
|
+
},
|
|
371
|
+
"data": [
|
|
372
|
+
[
|
|
373
|
+
{
|
|
374
|
+
"x": 0.0,
|
|
375
|
+
"y": 10.0,
|
|
376
|
+
"fill": "Line Data"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"x": 1.0,
|
|
380
|
+
"y": 8.0,
|
|
381
|
+
"fill": "Line Data"
|
|
382
|
+
},
|
|
383
|
+
]
|
|
384
|
+
],
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
## Examples
|
|
395
|
+
Example plots are demonstrated [here](https://xabilitylab.ischool.illinois.edu/maidr/).
|
|
266
396
|
|
|
267
|
-
For more information
|
|
397
|
+
For more information, refer to the example HTML files provided in the directory docs/examples
|
|
268
398
|
|
|
269
399
|
## Controls
|
|
270
400
|
|
|
@@ -276,6 +406,7 @@ To interact with the plots using maidr, follow these steps:
|
|
|
276
406
|
4. Press **T** to toggle Text mode.
|
|
277
407
|
5. Press **S** to toggle Sonification (tones) mode.
|
|
278
408
|
6. Press **R** to toggle Review mode.
|
|
409
|
+
7. Hover on the datapoint to
|
|
279
410
|
|
|
280
411
|
Below is a detailed list of keyboard shortcuts for various functions:
|
|
281
412
|
|
|
@@ -294,6 +425,9 @@ Below is a detailed list of keyboard shortcuts for various functions:
|
|
|
294
425
|
| Stop Auto-play | Control | Command |
|
|
295
426
|
| Auto-play speed up | Period | Period |
|
|
296
427
|
| Auto-play speed down | Comma | Comma |
|
|
428
|
+
| Move to next navigation mode | Shift + Alt + Up/Down | Shift + Alt + Up/Down |
|
|
429
|
+
| Open Settings | Control + , | Command + , |
|
|
430
|
+
| Open Command Pallette | Control + Shift + p | Command + Shift + p |
|
|
297
431
|
|
|
298
432
|
### Segmented Bar Controls
|
|
299
433
|
|