UNPKG

@zklogic/draw.io

Version:

Draw.IO - Graph Editor integration in Angular-cli

1 lines 2 kB
MathJax.Hub.Register.StartupHook("SVG Jax Ready",(function(){var t=MathJax.ElementJax.mml,a=MathJax.OutputJax.SVG,i=a.BBOX,e=MathJax.Localization,h="http://www.w3.org/1999/xlink";i.MGLYPH=i.Subclass({type:"image",removeable:!1,Init:function(t,i,e,s,l,r,n){null==n&&(n={});var o=1e3*t.width/a.em,g=1e3*t.height/a.em,m=o,d=g,S=0;""!==i&&(o=a.length2em(i,l,m)*r,g=m?o/m*d:0),""!==e&&(g=a.length2em(e,l,d)*r,""===i&&(o=d?g/d*m:0)),""!==s&&s.match(/\d/)&&(S=a.length2em(s,l)*r,n.y=-S),n.height=Math.floor(g),n.width=Math.floor(o),n.transform="translate(0,"+g+") matrix(1 0 0 -1 0 0)",n.preserveAspectRatio="none",this.SUPER(arguments).Init.call(this,n),this.element.setAttributeNS(h,"href",t.SRC),this.w=this.r=o,this.h=this.H=g+S,this.d=this.D=-S,this.l=0}}),t.mglyph.Augment({toSVG:function(a,h){this.SVGgetStyles();var s,l,r=this.SVG();this.SVGhandleSpace(r);var n=this.getValues("src","width","height","valign","alt");if(""===n.src){if((n=this.getValues("index","fontfamily")).index){h||(h=this.SVGgetScale());var o={};n.fontfamily&&(o["font-family"]=n.fontfamily),r.Add(i.TEXT(h,String.fromCharCode(n.index),o))}}else if(this.img||(this.img=t.mglyph.GLYPH[n.src]),this.img||(this.img=t.mglyph.GLYPH[n.src]={img:new Image,status:"pending"},(s=this.img.img).onload=MathJax.Callback(["SVGimgLoaded",this]),s.onerror=MathJax.Callback(["SVGimgError",this]),s.src=s.SRC=n.src,MathJax.Hub.RestartAfter(s.onload)),"OK"!==this.img.status)l=t.Error(e._(["MathML","BadMglyph"],"Bad mglyph: %1",n.src),{mathsize:"75%"}),this.Append(l),r=l.toSVG(),this.data.pop();else{var g=this.SVGgetMu(r),m=this.SVGgetScale();r.Add(i.MGLYPH(this.img.img,n.width,n.height,n.valign,g,m,{"aria-label":n.alt}))}return r.Clean(),this.SVGhandleColor(r),this.SVGsaveData(r),r},SVGimgLoaded:function(t,a){"string"==typeof t&&(a=t),this.img.status=a||"OK"},SVGimgError:function(){this.img.img.onload("error")}},{GLYPH:{}}),MathJax.Hub.Startup.signal.Post("SVG mglyph Ready"),MathJax.Ajax.loadComplete(a.autoloadDir+"/mglyph.js")}));