basant307/AI_Governance_Project
048
1let styfn = {};2 3// gets what an em size corresponds to in pixels relative to a dom element4styfn.getEmSizeInPixels = function(){5 let px = this.containerCss( 'font-size' );6 7 if( px != null ){8 return parseFloat( px );9 } else {10 return 1; // for headless11 }12};13 14// gets css property from the core container15styfn.containerCss = function( propName ){16 let cy = this._private.cy;17 let domElement = cy.container();18 let containerWindow = cy.window();19 20 if( containerWindow && domElement && containerWindow.getComputedStyle ){21 return containerWindow.getComputedStyle( domElement ).getPropertyValue( propName );22 }23};24 25export default styfn;26 