basant307/AI_Governance_Project
048
1import * as is from '../is.mjs';2import Style from '../style/index.mjs';3 4let corefn = ({5 6 style: function( newStyle ){7 if( newStyle ){8 let s = this.setStyle( newStyle );9 10 s.update();11 }12 13 return this._private.style;14 },15 16 setStyle: function( style ){17 let _p = this._private;18 19 if( is.stylesheet( style ) ){20 _p.style = style.generateStyle( this );21 22 } else if( is.array( style ) ){23 _p.style = Style.fromJson( this, style );24 25 } else if( is.string( style ) ){26 _p.style = Style.fromString( this, style );27 28 } else {29 _p.style = Style( this );30 }31 32 return _p.style;33 },34 35 // e.g. cy.data() changed => recalc ele mappers36 updateStyle: function(){37 this.mutableElements().updateStyle(); // just send to all eles38 }39});40 41export default corefn;42 