mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-07 05:24:40 +08:00
1 line
695 B
JavaScript
1 line
695 B
JavaScript
import{O as x,h as n,ia as a,j as h}from"./chunk-KRX7QNR4.js";var b=n((t,e)=>{let o;return e==="sandbox"&&(o=a("#i"+t)),(e==="sandbox"?a(o.nodes()[0].contentDocument.body):a("body")).select(`[id="${t}"]`)},"getDiagramElement"),B=n((t,e,o,i)=>{t.attr("class",o);let{width:r,height:s,x:m,y:d}=g(t,e);x(t,s,r,i);let c=w(m,d,r,s,e);t.attr("viewBox",c),h.debug(`viewBox configured: ${c} with padding: ${e}`)},"setupViewPortForSVG"),g=n((t,e)=>{var i;let o=((i=t.node())==null?void 0:i.getBBox())||{width:0,height:0,x:0,y:0};return{width:o.width+e*2,height:o.height+e*2,x:o.x,y:o.y}},"calculateDimensionsWithPadding"),w=n((t,e,o,i,r)=>`${t-r} ${e-r} ${o} ${i}`,"createViewBox");export{b as a,B as b};
|