function addBrushFunction(args) {
if (args.xAxisType === 'categorical' || args.yAxisType === 'categorical') {
return console.warn(
'The option "brush" does not support axis type "categorical" currently.'
);
}
if (!args.zoom_target) args.zoom_target = args;
if (args.zoom_target !== args) args.zoom_target.processed.subplot = args;
let brushAxis;
switch (args.brush) {
case 'x':
brushAxis = { x: true, y: false };
break;
case 'y':
brushAxis = { x: false, y: true };
break;
case 'xy':
brushAxis = { x: true, y: true };
break;
default:
brushAxis = { x: true, y: true };
}
addEventHandlerForBrush(args, args.zoom_target, brushAxis);
}