cytoscape
Version:
Graph theory (a.k.a. network) library for analysis and visualisation
49 lines (38 loc) • 747 B
JavaScript
export const labelHalign = halign => {
switch( halign ){
case 'left':
case 'right-inside':
return 'left';
case 'right':
case 'left-inside':
return 'right';
default:
return 'center';
}
};
export const labelValign = valign => {
switch( valign ){
case 'top':
case 'bottom-inside':
return 'top';
case 'bottom':
case 'top-inside':
return 'bottom';
default:
return 'center';
}
};
export const labelJustification = halign => {
switch( halign ){
case 'left':
return 'right';
case 'right':
return 'left';
case 'left-inside':
return 'left';
case 'right-inside':
return 'right';
default:
return 'center';
}
};