@@ -7,10 +7,8 @@ import {maybeIdentityX, maybeIdentityY} from "../transforms/identity.js";
77import { maybeIntervalX , maybeIntervalY } from "../transforms/interval.js" ;
88import { maybeStackX , maybeStackY } from "../transforms/stack.js" ;
99
10- const defaults = { } ;
11-
1210export class AbstractBar extends Mark {
13- constructor ( data , channels , options = { } ) {
11+ constructor ( data , channels , options = { } , defaults ) {
1412 super ( data , channels , options , defaults ) ;
1513 const { inset = 0 , insetTop = inset , insetRight = inset , insetBottom = inset , insetLeft = inset , rx, ry} = options ;
1614 this . insetTop = number ( insetTop ) ;
@@ -58,6 +56,10 @@ export class AbstractBar extends Mark {
5856 }
5957}
6058
59+ const defaults = {
60+ ariaLabel : "bar"
61+ } ;
62+
6163export class BarX extends AbstractBar {
6264 constructor ( data , options = { } ) {
6365 const { x1, x2, y} = options ;
@@ -68,7 +70,8 @@ export class BarX extends AbstractBar {
6870 { name : "x2" , value : x2 , scale : "x" } ,
6971 { name : "y" , value : y , scale : "y" , type : "band" , optional : true }
7072 ] ,
71- options
73+ options ,
74+ defaults
7275 ) ;
7376 }
7477 _transform ( selection , { x} , dx , dy ) {
@@ -94,7 +97,8 @@ export class BarY extends AbstractBar {
9497 { name : "y2" , value : y2 , scale : "y" } ,
9598 { name : "x" , value : x , scale : "x" , type : "band" , optional : true }
9699 ] ,
97- options
100+ options ,
101+ defaults
98102 ) ;
99103 }
100104 _transform ( selection , { y} , dx , dy ) {
0 commit comments