chrt-annotation
Version:
Annotation component for Chrt
23 lines (20 loc) • 639 B
JavaScript
// import { isNull } from '~/helpers';
export default function alignment(align) {
const currentAlignment = this.attr('alignment')();
if(typeof align === 'undefined') {
return currentAlignment;
}
return this.attr('alignment', Object.assign({}, currentAlignment, align));
}
export function valign(position) {
if(typeof position === 'undefined') {
return alignment.call(this).vertical;
}
return alignment.call(this, {vertical: position})
}
export function align(position) {
if(typeof position === 'undefined') {
return alignment.call(this).horizontal;
}
return alignment.call(this, {horizontal: position})
}