@@ -89,6 +89,7 @@ function axisKy(
89
89
labelAnchor,
90
90
labelArrow,
91
91
labelOffset,
92
+ ariaLabel = `${ k } -axis` ,
92
93
...options
93
94
}
94
95
) {
@@ -107,6 +108,7 @@ function axisKy(
107
108
tickPadding,
108
109
tickRotate,
109
110
x,
111
+ ariaLabel,
110
112
...options
111
113
} )
112
114
: null ,
@@ -126,6 +128,7 @@ function axisKy(
126
128
marginRight,
127
129
marginBottom,
128
130
marginLeft,
131
+ ariaLabel,
129
132
...options
130
133
} )
131
134
: null ,
@@ -150,7 +153,7 @@ function axisKy(
150
153
}
151
154
this . dy = cla === "top" ? 3 - marginTop : cla === "bottom" ? marginBottom - 3 : 0 ;
152
155
this . dx = anchor === "right" ? clo : - clo ;
153
- this . ariaLabel = `${ k } -axis label` ;
156
+ this . ariaLabel = `${ ariaLabel } label` ;
154
157
return {
155
158
facets : [ [ 0 ] ] ,
156
159
channels : { text : { value : [ formatAxisLabel ( k , scale , { anchor, label, labelAnchor : cla , labelArrow} ) ] } }
@@ -190,6 +193,7 @@ function axisKx(
190
193
labelAnchor,
191
194
labelArrow,
192
195
labelOffset,
196
+ ariaLabel = `${ k } -axis` ,
193
197
...options
194
198
}
195
199
) {
@@ -208,6 +212,7 @@ function axisKx(
208
212
tickPadding,
209
213
tickRotate,
210
214
y,
215
+ ariaLabel,
211
216
...options
212
217
} )
213
218
: null ,
@@ -227,6 +232,7 @@ function axisKx(
227
232
marginRight,
228
233
marginBottom,
229
234
marginLeft,
235
+ ariaLabel,
230
236
...options
231
237
} )
232
238
: null ,
@@ -248,7 +254,7 @@ function axisKx(
248
254
this . lineAnchor = anchor ;
249
255
this . dy = anchor === "top" ? - clo : clo ;
250
256
this . dx = cla === "right" ? marginRight - 3 : cla === "left" ? 3 - marginLeft : 0 ;
251
- this . ariaLabel = `${ k } -axis label` ;
257
+ this . ariaLabel = `${ ariaLabel } label` ;
252
258
return {
253
259
facets : [ [ 0 ] ] ,
254
260
channels : { text : { value : [ formatAxisLabel ( k , scale , { anchor, label, labelAnchor : cla , labelArrow} ) ] } }
@@ -275,6 +281,7 @@ function axisTickKy(
275
281
insetRight = inset ,
276
282
dx = 0 ,
277
283
y = k === "y" ? undefined : null ,
284
+ ariaLabel,
278
285
...options
279
286
}
280
287
) {
@@ -283,7 +290,7 @@ function axisTickKy(
283
290
k ,
284
291
data ,
285
292
{
286
- ariaLabel : `${ k } -axis tick` ,
293
+ ariaLabel : `${ ariaLabel } tick` ,
287
294
ariaHidden : true
288
295
} ,
289
296
{
@@ -318,6 +325,7 @@ function axisTickKx(
318
325
insetBottom = inset ,
319
326
dy = 0 ,
320
327
x = k === "x" ? undefined : null ,
328
+ ariaLabel,
321
329
...options
322
330
}
323
331
) {
@@ -326,7 +334,7 @@ function axisTickKx(
326
334
k ,
327
335
data ,
328
336
{
329
- ariaLabel : `${ k } -axis tick` ,
337
+ ariaLabel : `${ ariaLabel } tick` ,
330
338
ariaHidden : true
331
339
} ,
332
340
{
@@ -363,6 +371,7 @@ function axisTextKy(
363
371
insetLeft = inset ,
364
372
insetRight = inset ,
365
373
dx = 0 ,
374
+ ariaLabel,
366
375
y = k === "y" ? undefined : null ,
367
376
...options
368
377
}
@@ -371,7 +380,7 @@ function axisTextKy(
371
380
textY ,
372
381
k ,
373
382
data ,
374
- { ariaLabel : `${ k } -axis tick label` } ,
383
+ { ariaLabel : `${ ariaLabel } tick label` } ,
375
384
{
376
385
facetAnchor,
377
386
frameAnchor,
@@ -410,14 +419,15 @@ function axisTextKx(
410
419
insetBottom = inset ,
411
420
dy = 0 ,
412
421
x = k === "x" ? undefined : null ,
422
+ ariaLabel,
413
423
...options
414
424
}
415
425
) {
416
426
return axisMark (
417
427
textX ,
418
428
k ,
419
429
data ,
420
- { ariaLabel : `${ k } -axis tick label` } ,
430
+ { ariaLabel : `${ ariaLabel } tick label` } ,
421
431
{
422
432
facetAnchor,
423
433
frameAnchor,
@@ -466,10 +476,12 @@ function gridKy(
466
476
x = null ,
467
477
x1 = anchor === "left" ? x : null ,
468
478
x2 = anchor === "right" ? x : null ,
479
+ ariaLabel = `${ k } -grid` ,
480
+ ariaHidden = true ,
469
481
...options
470
482
}
471
483
) {
472
- return axisMark ( ruleY , k , data , { ariaLabel : ` ${ k } -grid` , ariaHidden : true } , { y, x1, x2, ...gridDefaults ( options ) } ) ;
484
+ return axisMark ( ruleY , k , data , { ariaLabel, ariaHidden} , { y, x1, x2, ...gridDefaults ( options ) } ) ;
473
485
}
474
486
475
487
function gridKx (
@@ -481,10 +493,12 @@ function gridKx(
481
493
y = null ,
482
494
y1 = anchor === "top" ? y : null ,
483
495
y2 = anchor === "bottom" ? y : null ,
496
+ ariaLabel = `${ k } -grid` ,
497
+ ariaHidden = true ,
484
498
...options
485
499
}
486
500
) {
487
- return axisMark ( ruleX , k , data , { ariaLabel : ` ${ k } -grid` , ariaHidden : true } , { x, y1, y2, ...gridDefaults ( options ) } ) ;
501
+ return axisMark ( ruleX , k , data , { ariaLabel, ariaHidden} , { x, y1, y2, ...gridDefaults ( options ) } ) ;
488
502
}
489
503
490
504
function gridDefaults ( {
0 commit comments