CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
container.mjs26 linesDownload Raw Back to style
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 
basant307/AI_Governance_Project · CoolFace