@graphysdk/theme-typewriter 0.1.1-beta.1792505847409 → 0.1.1-beta.1792510459918

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let A=require("react"),i=require("@graphysdk/react"),s=require("react/jsx-runtime");var g={paper:"#EBD9A9",card:"#F8F0D8",text:"#1F1B16",secondary:"#4A443A",grid:"rgba(31, 27, 22, 0.4)",edge:"#C4AE74"},le="'Special Elite', 'Courier New', ui-monospace, monospace",y={black:"#1F1B16",red:"#B3271E",carbonBlue:"#2F4F8F",pencilGrey:"#6E6A62",stampGreen:"#2E6B4B",duplicatorViolet:"#7B5A9C"},de=[y.black,y.red,y.carbonBlue,y.pencilGrey,y.stampGreen,y.duplicatorViolet],he=["#D6C18B",y.black],ce=[y.carbonBlue,"#DECEA4",y.red],R={fontWeight:400,textColor:g.text},_={...R,fontSize:13,fill:g.paper,stroke:"transparent",strokeWidth:0,cornerRadius:0,paddingInline:3,paddingBlock:1,shadow:"none"},v={fontWeight:400,textColor:g.secondary},H={fill:g.card,stroke:g.text,strokeWidth:1,cornerRadius:0,shadow:"none"},ue={tokens:{graphBackground:g.paper,graphBorder:g.edge,geomBorder:g.text,textPrimary:g.text,textSecondary:g.secondary,ruleLine:g.text,gridLine:g.grid,hoverAffordance:g.paper,hoverGuideFill:"rgba(31, 27, 22, 0.07)",hoverGuideLine:g.secondary,tooltipBackground:g.card,tooltipBorder:g.text,tooltipPrimaryRow:"rgba(31, 27, 22, 0.08)",annotationShape:y.red,annotationArrow:g.text,differenceLabelBackground:g.card,trendPositive:y.black,trendNegative:y.red,trendNeutral:y.pencilGrey},defaults:[i.style.graph({strokeWidth:1,cornerRadius:0,fontFamily:le,fontWeight:400,padding:24}),i.style.geom({shadow:"none"}),i.style.geom({shadow:"none"},{state:"hovered"}),i.style.geom.bar({stroke:g.text,strokeWidth:1,cornerRadius:"none"}),i.style.geom.line({strokeWidth:2,dashArray:[],lineCap:"butt",lineJoin:"miter"}),i.style.geom.area({fillAlpha:.6,strokeWidth:1.5,dashArray:[],lineCap:"butt",lineJoin:"miter"}),i.style.geom.point({size:9,stroke:g.paper,strokeWidth:1.5}),i.style.geom.tile({cornerRadius:0,stroke:g.paper,strokeWidth:2}),i.style.geom.rule({stroke:y.red,strokeWidth:1.5,dashArray:[5,4]}),i.style.geom.rule.label({...R,fontSize:13}),i.style.gridLine({dashArray:[5,4]}),i.style.panelBorder({strokeWidth:0,cornerRadius:0}),i.style.panelBorder.left({stroke:g.text,strokeWidth:1,dashArray:[]}),i.style.panelBorder.bottom({stroke:g.text,strokeWidth:1,dashArray:[]}),i.style.tickLine({strokeWidth:0}),i.style.tickLabel({...v,fontSize:13,lineHeight:1}),i.style.axisLabel({...v,fontSize:12,lineHeight:1,letterSpacing:1,textTransform:"uppercase"}),i.style.axisLabel.top({margin:{bottom:14}}),i.style.heading({...R}),i.style.heading.h1({fontSize:19,lineHeight:1.15,letterSpacing:1.5,textTransform:"uppercase",textDecoration:"underline"}),i.style.heading.h2({...v,fontSize:15,lineHeight:1.2}),i.style.header({margin:{bottom:18}}),i.style.caption({...v,fontSize:12.5}),i.style.source({...v,fontSize:12.5}),i.style.source.link({...v,fontSize:12.5}),i.style.dataLabel({...R,fontSize:13,fill:"transparent",cornerRadius:0}),i.style.legendItem({...v,fontSize:13,fill:"transparent",stroke:"transparent"}),i.style.legend.popover({...H}),i.style.directLabel({fontWeight:400,fontSize:13}),i.style.headlineItem.number({...R}),i.style.headlineItem.caption({...v}),i.style.headlineItem.label({...v}),i.style.headlineItem.trend({fontWeight:400}),i.style.tooltip({...H,paddingInline:12,paddingBlock:9}),i.style.tooltip.heading({...R,fontSize:13,lineHeight:1.3,letterSpacing:1,textTransform:"uppercase"}),i.style.tooltip.label({...v,fontSize:13,lineHeight:1.4}),i.style.tooltip.value({...R,fontSize:13,lineHeight:1.4}),i.style.annotation.text({..._,paddingInline:4,paddingBlock:2,lineHeight:1.3}),i.style.annotation.pinnedNumber({fill:y.red,stroke:g.paper,shadow:"none"}),i.style.annotation.pinnedNumber.label({..._}),i.style.annotation.comment({fill:y.red,stroke:g.paper,shadow:"none"}),i.style.annotation.comment.label({..._}),i.style.annotation.differenceArrow({stroke:g.text,strokeWidth:1.5}),i.style.annotation.differenceArrow.label({..._}),i.style.annotation.arrow({stroke:g.text,strokeWidth:1.5,dashArray:[]}),i.style.annotation.shape({fill:g.text,fillAlpha:.06,stroke:g.secondary,strokeWidth:.75}),i.style.geom.area({fillAlpha:.45},{coord:"polar"}),i.style.panelBorder.left({strokeWidth:0},{coord:"polar"}),i.style.panelBorder.bottom({strokeWidth:0},{coord:"polar"}),i.style.tickLabel({textColor:g.text,fontSize:14,fontWeight:700,textOutlineColor:g.paper,textOutlineWidth:8},{coord:"polar"})]},pe=/[a-df-zA-DF-Z]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/gu,ge=/^[a-zA-Z]$/u,fe=(e,t)=>e==="H"?"x":e==="V"?"y":t%2===0?"x":"y",G=(e,t)=>{let r="",n=0;return(e.match(pe)??[]).map(a=>{if(ge.test(a))return r=a.toUpperCase(),n=0,a;const o=fe(r,n);return n+=1,String(Number(a)*(o==="x"?t.width:t.height))}).join(" ")},T=(e,t)=>{const r=(0,i.getX)(e),n=(0,i.getY)(e)??(0,i.getYMax)(e);return r===null||n===null?null:{x:(0,i.toViewBoxX)(r)*t.width,y:(0,i.toViewBoxY)(n)*t.height}},j=(e,t)=>{const r=(0,i.getX)(e),n=(0,i.getY)(e)??(0,i.getRadiusExtent)(e).outerRadius;if(r===null||n===null)return null;const a=(0,i.polarToUnit)(r,n),o=Math.min(t.width,t.height)/2;return{x:t.width/2+a.x*o,y:t.height/2-a.y*o}},ye=e=>`${e.map((t,r)=>`${r===0?"M":"L"}${t.x},${t.y}`).join(" ")} Z`,w=e=>{const t=(0,i.useGeomStyleReader)(e);return(r,n)=>({color:(0,i.toPaintColor)(t.get("fill",r,n)),opacity:t.get("alpha",r,n),fillOpacity:t.get("fillAlpha",r,n),edge:t.get("stroke",r,n),edgeWidth:t.get("strokeWidth",r,n)})},U=e=>{const t=(0,i.useGeomStyleReader)(e);return(r,n)=>{const a=t.get("strokeWidth",r,n);return{color:t.get("stroke",r,n),opacity:t.get("alpha",r,n)*t.get("strokeAlpha",r,n),width:a,dashArray:(0,i.toStrokeDasharray)(t.get("dashArray",r,n),a)}}},xe=1.3,E=[.72,.87,1],C=.35,me=.7,B=100,D=.7,ve=4,Ae=e=>{let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return t>>>0},b=(e,t,r,n)=>{let a=Math.imul(e^Math.imul(t,374761393)^Math.imul(r,668265263)^n,1274126177);return a=Math.imul(a^a>>>13,1103515245),((a^a>>>16)>>>0)/4294967296},x=e=>Math.round(e*B)/B,Z=(e,t,r,n,a)=>{const o=x(t-n/2),d=x(t+n/2),l=x(r-a/2),c=x(r+a/2),h=`M${o},${l}L${d},${c}M${d},${l}L${o},${c}`;if(e==="x"||e==="X"&&n<ve)return h;if(e==="X"){const f=(m,P)=>`M${x(m-D)},${P}L${x(m+D)},${P}`;return`${h}${f(o,l)}${f(d,l)}${f(o,c)}${f(d,c)}`}if(e==="/")return`M${o},${c}L${d},${l}`;if(e==="_")return`M${o},${x(r)}L${d},${x(r)}`;if(e==="|")return`M${x(t)},${l}L${x(t)},${c}`;const p=x(n/2),u=x(a/2);return`M${o},${x(r)}a${p},${u} 0 1,0 ${x(n)},0a${p},${u} 0 1,0 ${-x(n)},0`},L=e=>{const t=Ae(e);return(r,n,a,o,d,l,c)=>{const h=(b(t,l,c,1)*2-1)*C,p=(b(t,l,c,2)*2-1)*C,u=Math.floor(b(t,l,c,3)*E.length);return{path:Z(r,n+h,a+p,o,d),weight:u}}},M=(e,t,r,n,a)=>({path:Z(e,t,r,n,a),weight:E.length-1}),S=e=>`${e}-${(0,A.useId)().replace(/[^a-zA-Z0-9]/gu,"")}`,k=({strikes:e,color:t,opacity:r=1,width:n=xe,isOverstruck:a=!1})=>e.length===0?null:(0,s.jsxs)("g",{fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",opacity:r,children:[E.map((o,d)=>e.filter(l=>l.weight===d).map(l=>l.path).join("")).map((o,d)=>o===""?null:(0,s.jsx)("path",{d:o,strokeOpacity:E[d]},E[d])),a&&(0,s.jsx)("path",{d:e.map(o=>o.path).join(""),transform:`translate(${me},0)`})]}),z=6,ke=14,Re=1.5,N=10,Me=1.8,W=(e,t,r,n)=>{const a=(0,i.createStableKeyGenerator)(e.data,e.mapping,e.id),o=[];return e.data.groupBy(i.GROUP_VARIABLES.group).forEach(d=>{const l=[...d],[c]=l,h=t(l);if(c===void 0||h===null)return;const p=l.flatMap(u=>r(u,n)??[]);o.push({key:a(c),observation:c,path:h,readings:p})}),o},q=(e,t)=>{const r=e.flatMap(n=>{const a=(0,i.getX)(n),o=j(n,t);return a===null||o===null?[]:[{angle:a,point:o}]}).sort((n,a)=>n.angle-a.angle).map(({point:n})=>n);return r.length===0?null:ye(r)},je=e=>e.every((t,r)=>{const n=e[r+1];return n===void 0||Math.hypot(n.x-t.x,n.y-t.y)>=ke}),we=({readings:e,color:t,opacity:r})=>je(e)?(0,s.jsx)(k,{strikes:e.map(({x:n,y:a})=>M("x",n,a,z,z)),color:t,opacity:r,width:Re}):null,J=({geom:e,observation:t,panel:r,project:n,color:a,opacity:o})=>{const d=n(t,r);return d===null?null:(0,s.jsx)("g",{"data-geom":e,children:(0,s.jsx)(k,{strikes:[M("X",d.x,d.y,N,N)],color:a,opacity:o,width:Me,isOverstruck:!0})})},Q=.55,Se=1.5,ee=(e,t,r={x:0,y:0,...e})=>{const n=L(t),a=[],o=Math.max(0,Math.floor((e.height-r.y-r.height)/12-.5)),d=Math.min(Math.ceil(e.height/12),Math.ceil((e.height-r.y)/12)),l=Math.max(0,Math.floor(r.x/8)),c=Math.min(Math.ceil(e.width/8),Math.ceil((r.x+r.width)/8));for(let h=o;h<d;h+=1){const p=e.height-(h+.5)*12;for(let u=l;u<c;u+=1)a.push(n("/",(u+.5)*8,p,5,8,u,h))}return a},te=({layer:e,coordSystem:t,panel:r})=>{const n=w(e),a=S("typewriter-area"),o=(0,A.useMemo)(()=>{if(t===void 0)return W(e,h=>q(h,r),j,r).map(h=>({...h,fill:h.path,edge:h.path}));const{areaGenerator:d,lineGenerator:l}=(0,i.createAreaPathGenerators)(t,e.params),c=new Map;return W(e,h=>{const p=(0,i.prepareAreaObservations)(h,e.params.missingValues),u=d(p),f=l(p);if(!u)return null;const m=G(u,r);return f&&c.set(m,G(f,r)),m},T,r).map(h=>({...h,fill:h.path,edge:c.get(h.path)??""}))},[e,t,r]);return r.width<=0||r.height<=0?null:(0,s.jsx)("g",{"data-geom":"area",children:o.map(({key:d,observation:l,fill:c,edge:h},p)=>{const u=n(l);return(0,s.jsxs)("g",{opacity:u.opacity,children:[(0,s.jsx)("clipPath",{id:`${a}-${p}`,children:(0,s.jsx)("path",{d:c})}),(0,s.jsx)("path",{d:c,fill:g.paper}),(0,s.jsx)("path",{d:c,fill:u.color,fillOpacity:u.fillOpacity*Q}),(0,s.jsx)("g",{clipPath:`url(#${a}-${p})`,children:(0,s.jsx)(k,{strikes:ee(r,d),color:u.color,opacity:u.fillOpacity})}),(0,s.jsx)("path",{d:h,fill:"none",stroke:u.color,strokeWidth:Se,strokeLinejoin:"round",strokeLinecap:"round"})]},d)})})},re=({layer:e,observation:t,panel:r,project:n})=>{const a=w(e)(t,"hovered");return(0,s.jsx)(J,{geom:"area",observation:t,panel:r,project:n,color:a.color,opacity:a.opacity})},Ee=(0,i.defineGeomRenderer)("area",{coord:"cartesian",guideMode:"crosshair",swatchShape:"area",render:({layer:e,coordSystem:t,panelRect:r})=>t.type!=="cartesian"?null:(0,s.jsx)(te,{layer:e,coordSystem:t,panel:r}),renderHover:({layer:e,primary:t,panelRect:r})=>(0,s.jsx)(re,{layer:e,observation:t.observation,panel:r,project:T}),renderHoverCompanions:()=>null}),Te=(0,i.defineGeomRenderer)("area",{coord:"polar",guideMode:"crosshair",swatchShape:"area",render:({layer:e,panelRect:t})=>(0,s.jsx)(te,{layer:e,panel:t}),renderHover:({layer:e,primary:t,panelRect:r})=>(0,s.jsx)(re,{layer:e,observation:t.observation,panel:r,project:j}),renderHoverCompanions:()=>null}),Pe=2,ne=1.8,_e=1,$e=3.3,Ie={solo:{base:!0,value:!0},floor:{base:!0,value:!1},ceiling:{base:!1,value:!0},middle:{base:!1,value:!1}},We={top:"bottom",bottom:"top",left:"right",right:"left"},Le=(e,t)=>t==="x"?((0,i.getYMax)(e)??(0,i.getY)(e)??0)>=((0,i.getYMin)(e)??0)?"top":"bottom":((0,i.getXMax)(e)??0)>=((0,i.getXMin)(e)??0)?"right":"left",be=(e,t,r)=>{const n=Math.max(0,e.width-r),a=Math.max(0,e.height-r);return t==="top"?{...e,y:e.y+e.height-a,height:a}:t==="bottom"?{...e,height:a}:t==="left"?{...e,x:e.x+e.width-n,width:n}:{...e,width:n}},O=(e,t)=>{const r=Math.max(1,Math.round(e/t));return{count:r,size:e/r}},X=(e,t,r)=>{const n=[];for(let a=$e+r/2;a-r/2<e;a+=t)n.push(a);return n},Ge=(e,t,r)=>{const n=L(r),a=t==="top"||t==="bottom",o=a?O(e.width,8):O(e.height,12),d=a?Math.min(5,o.size-2):5,l=a?8:Math.max(1,Math.min(8,o.size-4));return(a?X(e.height,12,8):X(e.width,8,5)).flatMap((c,h)=>Array.from({length:o.count},(p,u)=>{const f=(u+.5)*o.size;if(t==="top")return n("X",e.x+f,e.y+c,d,l,u,h);if(t==="bottom")return n("X",e.x+f,e.y+e.height-c,d,l,u,h);const m=t==="right"?e.x+e.width-c:e.x+c;return n("X",m,e.y+f,d,l,h,u)}))},Oe=(e,t)=>{const r=t==="top"||t==="bottom",n=O(r?e.width:e.height,r?8:12),a=Math.max(1,n.size-_e),o=ne/2;return Array.from({length:n.count},(d,l)=>{const c=(l+.5)*n.size;return t==="top"?M("_",e.x+c,e.y+o,a,0):t==="bottom"?M("_",e.x+c,e.y+e.height-o,a,0):M("|",t==="right"?e.x+e.width-o:e.x+o,e.y+c,0,a)})},He=({layer:e,observation:t,bounds:r,seed:n,mainAxis:a,panel:o,clipId:d,state:l})=>{const c=w(e);if(!r||r.width<=0||r.height<=0)return null;const h=c(t,l),p=Ie[(0,i.getStackRole)(t)],u=Le(t,a),f={x:r.x*o.width,y:r.y*o.height,width:r.width*o.width,height:r.height*o.height},m=[p.value?[]:[u],p.base?[]:[We[u]]].flat().reduce((P,se)=>be(P,se,Pe/2),f);return m.width<=0||m.height<=0?null:(0,s.jsx)(ae,{rect:m,edge:u,seed:n,clipId:d,color:h.color,opacity:h.opacity,pressure:h.fillOpacity,isOverstruck:l==="hovered"})},ae=({rect:e,edge:t,seed:r,clipId:n,color:a,opacity:o,pressure:d,isOverstruck:l})=>(0,s.jsxs)("g",{opacity:o,children:[(0,s.jsx)("clipPath",{id:n,children:(0,s.jsx)("rect",{...e})}),(0,s.jsx)("rect",{...e,fill:g.paper}),(0,s.jsx)("g",{clipPath:`url(#${n})`,children:(0,s.jsx)(k,{strikes:Ge(e,t,r),color:a,opacity:d,isOverstruck:l})}),(0,s.jsx)(k,{strikes:Oe(e,t),color:a,width:ne,isOverstruck:l})]}),K=({layer:e,observations:t,mainAxis:r,panel:n,state:a})=>{const o=S("typewriter-bar"),d=(0,i.useGeomStyleReader)(e),l=(0,A.useMemo)(()=>(0,i.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]),c=(0,A.useMemo)(()=>(0,i.createBarBoundsReader)(e,r,d,n),[e,r,d,n]);return n.width<=0||n.height<=0?null:(0,s.jsx)("g",{"data-geom":"bar",children:Array.from(t,(h,p)=>{const u=l(h);return(0,s.jsx)(He,{layer:e,observation:h,bounds:c(h),seed:u,mainAxis:r,panel:n,clipId:`${o}-${p}`,state:a},u)})})},Ce=(0,i.defineGeomRenderer)("bar",{coord:"cartesian",guideMode:"band",swatchShape:"square",render:({layer:e,coordSystem:t,panelRect:r})=>(0,s.jsx)(K,{layer:e,observations:e.data,mainAxis:(0,i.readMainAxis)(t),panel:r}),renderHover:({layer:e,coordSystem:t,primary:r,panelRect:n})=>(0,s.jsx)(K,{layer:e,observations:[r.observation],mainAxis:(0,i.readMainAxis)(t),panel:n,state:"hovered"}),renderHoverCompanions:()=>null}),Be=({layer:e,panel:t,coord:r})=>{const n=U(e),a=(0,A.useMemo)(()=>{if(r==="polar")return W(e,d=>q(d,t),j,t);const o=(0,i.createLinePathGenerator)(e.params);return W(e,d=>{const l=o((0,i.prepareLineObservations)(d,e.params.missingValues));return l?G(l,t):null},T,t)},[e,t,r]);return t.width<=0||t.height<=0?null:(0,s.jsx)("g",{"data-geom":"line",children:a.map(({key:o,path:d,observation:l,readings:c})=>{const h=n(l);return(0,s.jsxs)("g",{children:[(0,s.jsx)("path",{d,fill:"none",stroke:h.color,strokeOpacity:h.opacity,strokeWidth:h.width,strokeDasharray:h.dashArray,strokeLinejoin:"round",strokeLinecap:"round"}),(0,s.jsx)(we,{readings:c,color:h.color,opacity:h.opacity})]},o)})})},De=({layer:e,observation:t,panel:r,project:n})=>{const a=U(e)(t,"hovered");return(0,s.jsx)(J,{geom:"line",observation:t,panel:r,project:n,color:a.color,opacity:a.opacity})},ie=(e,t)=>(0,i.defineGeomRenderer)("line",{coord:e,guideMode:"crosshair",swatchShape:"line",render:({layer:r,panelRect:n})=>(0,s.jsx)(Be,{layer:r,panel:n,coord:e}),renderHover:({layer:r,primary:n,panelRect:a})=>(0,s.jsx)(De,{layer:r,observation:n.observation,panel:a,project:t}),renderHoverCompanions:()=>null,getOverlayAnchor:({observation:r})=>{const n=(0,i.getX)(r),a=(0,i.getY)(r);return n===null||a===null?null:{x:n,y:a}}}),ze=ie("cartesian",T),Ne=ie("polar",j),Xe=.85,Ke=1.6,Ye=4,Y=({layer:e,observations:t,panel:r,project:n,state:a})=>{const o=(0,i.useGeomStyleReader)(e),d=w(e),l=(0,A.useMemo)(()=>(0,i.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]),c=a==="hovered",h=c?Ye:0;return(0,s.jsx)("g",{"data-geom":"point",children:Array.from(t,p=>{const u=n(p,r);if(u===null)return null;const f=d(p,a),m=o.get("size",p,a)+h;return(0,s.jsx)(k,{strikes:[M("o",u.x,u.y,m*Xe,m)],color:f.color,opacity:f.opacity,width:Ke,isOverstruck:c},l(p))})})},oe=(e,t)=>(0,i.defineGeomRenderer)("point",{coord:e,swatchShape:"circle",render:({layer:r,panelRect:n})=>(0,s.jsx)(Y,{layer:r,observations:r.data,panel:n,project:t}),renderHover:({layer:r,primary:n,panelRect:a})=>(0,s.jsx)(Y,{layer:r,observations:[n.observation],panel:a,project:t,state:"hovered"}),renderHoverCompanions:()=>null}),Fe=oe("cartesian",T),Ve=oe("polar",j),Ue=4,Ze=1.2,qe=3,I=Math.PI*2,Je=.3,Qe=(e,t)=>{const{startAngle:r,endAngle:n}=(0,i.getAngleExtent)(e),{innerRadius:a,outerRadius:o}=(0,i.getRadiusExtent)(e);if(r===null||n===null||a===null||o===null)return null;const d=Math.min(t.width,t.height)/2;if(d<=0||o<=0)return null;const l=Math.max(0,n-r),c=Ue/2/(o*d),h=l>=I-1e-6?0:Math.min(c,l/4),p=r+h,u=n-h,f=(0,i.buildPolarBarArcPath)({startAngle:p,endAngle:u,innerRadius:a,outerRadius:o},{centerX:t.width/2,centerY:t.height/2,radius:d,digits:qe});return f===void 0?null:{path:f,startAngle:p,endAngle:u,inner:a*d,outer:o*d}},et=(e,t,r,n)=>{const a=Math.hypot(t,r);if(a>e.outer-n||a<e.inner+n)return!1;const o=((Math.atan2(t,-r)-e.startAngle)%I+I)%I,d=n/Math.max(a,1);return o>=d&&o<=e.endAngle-e.startAngle-d},tt=(e,t,r)=>{const n=L(r),a=Math.ceil(e.outer/8)+1,o=Math.ceil(e.outer/12)+1,d=-Math.hypot(8,12)/2,l=[];for(let c=-o;c<=o;c+=1)for(let h=-a;h<=a;h+=1){const p=h*8,u=c*12;et(e,p,u,d)&&l.push(n("/",t.width/2+p,t.height/2+u,5,8,h,c))}return l},F=({layer:e,observations:t,panel:r,state:n})=>{const a=w(e),o=S("slice-shading"),d=(0,A.useMemo)(()=>(0,i.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]);return r.width<=0||r.height<=0?null:(0,s.jsx)("g",{"data-geom":"bar",children:Array.from(t,l=>{const c=Qe(l,r);if(c===null)return null;const h=d(l),p=a(l,n),u=`${o}-${h.replace(/[^a-zA-Z0-9]/gu,"")}`;return(0,s.jsxs)("g",{opacity:p.opacity,children:[(0,s.jsx)("path",{d:c.path,fill:g.paper}),(0,s.jsxs)("g",{children:[(0,s.jsx)("clipPath",{id:u,children:(0,s.jsx)("path",{d:c.path})}),(0,s.jsx)("path",{d:c.path,fill:p.color,fillOpacity:p.fillOpacity*Je}),(0,s.jsx)("g",{clipPath:`url(#${u})`,children:(0,s.jsx)(k,{strikes:tt(c,r,h),color:p.color,opacity:p.fillOpacity,isOverstruck:n==="hovered"})})]}),(0,s.jsx)("path",{d:c.path,fill:"none",stroke:p.color,strokeWidth:Ze,strokeLinejoin:"round"})]},h)})})},rt=(0,i.defineGeomRenderer)("bar",{coord:"polar",guideMode:"band",swatchShape:"slice",render:({layer:e,panelRect:t})=>(0,s.jsx)(F,{layer:e,observations:e.data,panel:t}),renderHover:({layer:e,primary:t,panelRect:r})=>(0,s.jsx)(F,{layer:e,observations:[t.observation],panel:r,state:"hovered"}),renderHoverCompanions:()=>null}),$=2,nt=.2,at=(e,t)=>{const r=L(t),n=[],a=Math.floor(e.y/12),o=Math.floor(e.x/8);for(let d=a;d*12<e.y+e.height;d+=1)for(let l=o;l*8<e.x+e.width;l+=1){const c=(l+.5)*8,h=(d+.5)*12;n.push(r("X",c,h,5,8,l,d))}return n},it=({layer:e,observation:t,seed:r,panel:n,clipId:a,state:o})=>{const d=w(e),l=(0,i.getPaintedTileRect)(t);if(l===null)return null;const c=d(t,o),h={x:l.x*n.width+$/2,y:l.y*n.height+$/2,width:Math.max(0,l.width*n.width-$),height:Math.max(0,l.height*n.height-$)};return h.width<=0||h.height<=0?null:(0,s.jsxs)("g",{opacity:c.opacity,children:[(0,s.jsx)("clipPath",{id:a,children:(0,s.jsx)("rect",{...h})}),(0,s.jsx)("rect",{...h,fill:c.color,fillOpacity:c.fillOpacity}),(0,s.jsx)("g",{clipPath:`url(#${a})`,children:(0,s.jsx)(k,{strikes:at(h,r),color:g.paper,opacity:nt,isOverstruck:o==="hovered"})}),o==="hovered"&&(0,s.jsx)("rect",{...h,fill:"none",stroke:g.text,strokeWidth:c.edgeWidth})]})},V=({layer:e,observations:t,panel:r,state:n})=>{const a=S("typewriter-tile"),o=(0,A.useMemo)(()=>(0,i.createStableCellKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]);return r.width<=0||r.height<=0?null:(0,s.jsx)("g",{"data-geom":"tile",children:Array.from(t,(d,l)=>{const c=o(d);return(0,s.jsx)(it,{layer:e,observation:d,seed:c,panel:r,clipId:`${a}-${l}`,state:n},c)})})},ot=(0,i.defineGeomRenderer)("tile",{coord:"cartesian",guideMode:null,swatchShape:"square",render:({layer:e,panelRect:t})=>(0,s.jsx)(V,{layer:e,observations:e.data,panel:t}),renderHover:({layer:e,primary:t,panelRect:r})=>(0,s.jsx)(V,{layer:e,observations:[t.observation],panel:r,state:"hovered"}),renderHoverCompanions:()=>null}),st=[Ce,rt,ot,ze,Ne,Ee,Te,Fe,Ve],lt=e=>{const t=S("typewriter-rect"),r=(0,i.useGeomPanelSize)(),n=r===null?null:(0,i.readRectPixels)(e,r);return n===null||e.fill===void 0?(0,s.jsx)(i.DefaultGeomRect,{...e}):n.width<=0||n.height<=0?null:(0,s.jsx)("g",{"data-testid":e["data-testid"],children:(0,s.jsx)(ae,{rect:n,edge:"top",seed:`${n.x},${n.y}`,clipId:t,color:e.fill,opacity:e.opacity??1,pressure:e.fillOpacity??1,isOverstruck:!1})})},dt=e=>{const t=(e.match(/-?\d*\.?\d+(?:e-?\d+)?/giu)??[]).map(Number),r=t.filter((d,l)=>l%2===0),n=t.filter((d,l)=>l%2===1);if(r.length===0||n.length===0)return null;const a=Math.min(...r),o=Math.min(...n);return{x:a,y:o,width:Math.max(...r)-a,height:Math.max(...n)-o}},ht=e=>{const t=S("typewriter-path"),r=(0,i.useGeomPanelSize)(),n=(0,A.useMemo)(()=>{const o=dt(e.d);return r===null||o===null?null:ee(r,e.d,o)},[r,e.d]);if(n===null||e.fill===void 0||e.fill.startsWith("url("))return(0,s.jsx)(i.DefaultGeomPath,{...e});const a=e.fillOpacity??1;return(0,s.jsxs)("g",{"data-testid":e["data-testid"],opacity:e.opacity??1,children:[(0,s.jsx)("clipPath",{id:t,children:(0,s.jsx)("path",{d:e.d})}),(0,s.jsx)("path",{d:e.d,fill:g.paper}),(0,s.jsx)("path",{d:e.d,fill:e.fill,fillOpacity:a*Q}),(0,s.jsx)("g",{clipPath:`url(#${t})`,children:(0,s.jsx)(k,{strikes:n,color:e.fill,opacity:a})})]})},ct={Rect:lt,Path:ht},ut={name:"typewriter",styles:ue,palettes:{categorical:de,sequential:he,diverging:ce},config:{axes:{y:{position:"left"}}},colorScheme:"light",plugins:st,shapes:ct};exports.typewriter=ut;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let A=require("react"),i=require("@graphysdk/react"),s=require("react/jsx-runtime");var g={paper:"#EBD9A9",card:"#F8F0D8",text:"#1F1B16",secondary:"#4A443A",grid:"rgba(31, 27, 22, 0.4)",edge:"#C4AE74"},le="'Special Elite', 'Courier New', ui-monospace, monospace",y={black:"#1F1B16",red:"#B3271E",carbonBlue:"#2F4F8F",pencilGrey:"#6E6A62",stampGreen:"#2E6B4B",duplicatorViolet:"#7B5A9C"},de=[y.black,y.red,y.carbonBlue,y.pencilGrey,y.stampGreen,y.duplicatorViolet],he=["#D6C18B",y.black],ce=[y.carbonBlue,"#DECEA4",y.red],R={fontWeight:400,textColor:g.text},_={...R,fontSize:13,fill:g.paper,stroke:"transparent",strokeWidth:0,cornerRadius:0,paddingInline:3,paddingBlock:1,shadow:"none"},v={fontWeight:400,textColor:g.secondary},C={fill:g.card,stroke:g.text,strokeWidth:1,cornerRadius:0,shadow:"none"},ue={tokens:{graphBackground:g.paper,graphBorder:g.edge,geomBorder:g.text,textPrimary:g.text,textSecondary:g.secondary,ruleLine:g.text,gridLine:g.grid,hoverAffordance:g.paper,hoverGuideFill:"rgba(31, 27, 22, 0.07)",hoverGuideLine:g.secondary,tooltipBackground:g.card,tooltipBorder:g.text,tooltipPrimaryRow:"rgba(31, 27, 22, 0.08)",annotationShape:y.red,annotationArrow:g.text,differenceLabelBackground:g.card,trendPositive:y.black,trendNegative:y.red,trendNeutral:y.pencilGrey},defaults:[i.style.graph({strokeWidth:1,cornerRadius:0,fontFamily:le,fontWeight:400,padding:24}),i.style.geom({shadow:"none"}),i.style.geom({shadow:"none"},{state:"hovered"}),i.style.geom.bar({stroke:g.text,strokeWidth:1,cornerRadius:"none"}),i.style.geom.line({strokeWidth:2,dashArray:[],lineCap:"butt",lineJoin:"miter"}),i.style.geom.area({fillAlpha:.6,strokeWidth:1.5,dashArray:[],lineCap:"butt",lineJoin:"miter"}),i.style.geom.point({size:9,stroke:g.paper,strokeWidth:1.5}),i.style.geom.tile({cornerRadius:0,stroke:g.paper,strokeWidth:2}),i.style.geom.rule({stroke:y.red,strokeWidth:1.5,dashArray:[5,4]}),i.style.geom.rule.label({...R,fontSize:13}),i.style.gridLine({dashArray:[5,4]}),i.style.panelBorder({strokeWidth:0,cornerRadius:0}),i.style.panelBorder.left({stroke:g.text,strokeWidth:1,dashArray:[]}),i.style.panelBorder.bottom({stroke:g.text,strokeWidth:1,dashArray:[]}),i.style.tickLine({strokeWidth:0}),i.style.tickLabel({...v,fontSize:13,lineHeight:1}),i.style.axisLabel({...v,fontSize:12,lineHeight:1,letterSpacing:1,textTransform:"uppercase"}),i.style.axisLabel.top({margin:{bottom:14}}),i.style.heading({...R}),i.style.heading.h1({fontSize:19,lineHeight:1.15,letterSpacing:1.5,textTransform:"uppercase",textDecoration:"underline"}),i.style.heading.h2({...v,fontSize:15,lineHeight:1.2}),i.style.header({margin:{bottom:18}}),i.style.caption({...v,fontSize:12.5}),i.style.source({...v,fontSize:12.5}),i.style.source.link({...v,fontSize:12.5}),i.style.dataLabel({...R,fontSize:13,fill:"transparent",cornerRadius:0}),i.style.legendItem({...v,fontSize:13,fill:"transparent",stroke:"transparent"}),i.style.legend.popover({...C}),i.style.directLabel({fontWeight:400,fontSize:13}),i.style.headlineItem.number({...R}),i.style.headlineItem.caption({...v}),i.style.headlineItem.label({...v}),i.style.headlineItem.trend({fontWeight:400}),i.style.tooltip({...C,paddingInline:12,paddingBlock:9}),i.style.tooltip.heading({...R,fontSize:13,lineHeight:1.3,letterSpacing:1,textTransform:"uppercase"}),i.style.tooltip.label({...v,fontSize:13,lineHeight:1.4}),i.style.tooltip.value({...R,fontSize:13,lineHeight:1.4}),i.style.annotation.text({..._,paddingInline:4,paddingBlock:2,lineHeight:1.3}),i.style.annotation.pinnedNumber({fill:y.red,stroke:g.paper,shadow:"none"}),i.style.annotation.pinnedNumber.label({..._}),i.style.annotation.comment({fill:y.red,stroke:g.paper,shadow:"none"}),i.style.annotation.comment.label({..._}),i.style.annotation.differenceArrow({stroke:g.text,strokeWidth:1.5}),i.style.annotation.differenceArrow.label({..._}),i.style.annotation.arrow({stroke:g.text,strokeWidth:1.5,dashArray:[]}),i.style.annotation.shape({fill:g.text,fillAlpha:.06,stroke:g.secondary,strokeWidth:.75}),i.style.geom.area({fillAlpha:.45},{coord:"polar"}),i.style.panelBorder.left({strokeWidth:0},{coord:"polar"}),i.style.panelBorder.bottom({strokeWidth:0},{coord:"polar"}),i.style.tickLabel({textColor:g.text,fontSize:14,fontWeight:700,textOutlineColor:g.paper,textOutlineWidth:8},{coord:"polar"})]},pe=/[a-df-zA-DF-Z]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/gu,ge=/^[a-zA-Z]$/u,fe=(e,t)=>e==="H"?"x":e==="V"?"y":t%2===0?"x":"y",G=(e,t)=>{let r="",n=0;return(e.match(pe)??[]).map(a=>{if(ge.test(a))return r=a.toUpperCase(),n=0,a;const o=fe(r,n);return n+=1,String(Number(a)*(o==="x"?t.width:t.height))}).join(" ")},T=(e,t)=>{const r=(0,i.getX)(e),n=(0,i.getY)(e)??(0,i.getYMax)(e);return r===null||n===null?null:{x:(0,i.toViewBoxX)(r)*t.width,y:(0,i.toViewBoxY)(n)*t.height}},j=(e,t)=>{const r=(0,i.getX)(e),n=(0,i.getY)(e)??(0,i.getRadiusExtent)(e).outerRadius;if(r===null||n===null)return null;const a=(0,i.polarToUnit)(r,n),o=Math.min(t.width,t.height)/2;return{x:t.width/2+a.x*o,y:t.height/2-a.y*o}},ye=e=>`${e.map((t,r)=>`${r===0?"M":"L"}${t.x},${t.y}`).join(" ")} Z`,w=e=>{const t=(0,i.useGeomStyleReader)(e);return(r,n)=>({color:(0,i.toPaintColor)(t.get("fill",r,n)),opacity:t.get("alpha",r,n),fillOpacity:t.get("fillAlpha",r,n),edge:t.get("stroke",r,n),edgeWidth:t.get("strokeWidth",r,n)})},U=e=>{const t=(0,i.useGeomStyleReader)(e);return(r,n)=>{const a=t.get("strokeWidth",r,n);return{color:t.get("stroke",r,n),opacity:t.get("alpha",r,n)*t.get("strokeAlpha",r,n),width:a,dashArray:(0,i.toStrokeDasharray)(t.get("dashArray",r,n),a)}}},xe=1.3,E=[.72,.87,1],O=.35,me=.7,B=100,D=.7,ve=4,Ae=e=>{let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return t>>>0},b=(e,t,r,n)=>{let a=Math.imul(e^Math.imul(t,374761393)^Math.imul(r,668265263)^n,1274126177);return a=Math.imul(a^a>>>13,1103515245),((a^a>>>16)>>>0)/4294967296},x=e=>Math.round(e*B)/B,Z=(e,t,r,n,a)=>{const o=x(t-n/2),d=x(t+n/2),l=x(r-a/2),c=x(r+a/2),h=`M${o},${l}L${d},${c}M${d},${l}L${o},${c}`;if(e==="x"||e==="X"&&n<ve)return h;if(e==="X"){const f=(m,P)=>`M${x(m-D)},${P}L${x(m+D)},${P}`;return`${h}${f(o,l)}${f(d,l)}${f(o,c)}${f(d,c)}`}if(e==="/")return`M${o},${c}L${d},${l}`;if(e==="_")return`M${o},${x(r)}L${d},${x(r)}`;if(e==="|")return`M${x(t)},${l}L${x(t)},${c}`;const p=x(n/2),u=x(a/2);return`M${o},${x(r)}a${p},${u} 0 1,0 ${x(n)},0a${p},${u} 0 1,0 ${-x(n)},0`},L=e=>{const t=Ae(e);return(r,n,a,o,d,l,c)=>{const h=(b(t,l,c,1)*2-1)*O,p=(b(t,l,c,2)*2-1)*O,u=Math.floor(b(t,l,c,3)*E.length);return{path:Z(r,n+h,a+p,o,d),weight:u}}},M=(e,t,r,n,a)=>({path:Z(e,t,r,n,a),weight:E.length-1}),S=e=>`${e}-${(0,A.useId)().replace(/[^a-zA-Z0-9]/gu,"")}`,k=({strikes:e,color:t,opacity:r=1,width:n=xe,overstruck:a=!1})=>e.length===0?null:(0,s.jsxs)("g",{fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",opacity:r,children:[E.map((o,d)=>e.filter(l=>l.weight===d).map(l=>l.path).join("")).map((o,d)=>o===""?null:(0,s.jsx)("path",{d:o,strokeOpacity:E[d]},E[d])),a&&(0,s.jsx)("path",{d:e.map(o=>o.path).join(""),transform:`translate(${me},0)`})]}),z=6,ke=14,Re=1.5,N=10,Me=1.8,W=(e,t,r,n)=>{const a=(0,i.createStableKeyGenerator)(e.data,e.mapping,e.id),o=[];return e.data.groupBy(i.GROUP_VARIABLES.group).forEach(d=>{const l=[...d],[c]=l,h=t(l);if(c===void 0||h===null)return;const p=l.flatMap(u=>r(u,n)??[]);o.push({key:a(c),observation:c,path:h,readings:p})}),o},q=(e,t)=>{const r=e.flatMap(n=>{const a=(0,i.getX)(n),o=j(n,t);return a===null||o===null?[]:[{angle:a,point:o}]}).sort((n,a)=>n.angle-a.angle).map(({point:n})=>n);return r.length===0?null:ye(r)},je=e=>e.every((t,r)=>{const n=e[r+1];return n===void 0||Math.hypot(n.x-t.x,n.y-t.y)>=ke}),we=({readings:e,color:t,opacity:r})=>je(e)?(0,s.jsx)(k,{strikes:e.map(({x:n,y:a})=>M("x",n,a,z,z)),color:t,opacity:r,width:Re}):null,J=({geom:e,observation:t,panel:r,project:n,color:a,opacity:o})=>{const d=n(t,r);return d===null?null:(0,s.jsx)("g",{"data-geom":e,children:(0,s.jsx)(k,{strikes:[M("X",d.x,d.y,N,N)],color:a,opacity:o,width:Me,overstruck:!0})})},Q=.55,Se=1.5,ee=(e,t,r={x:0,y:0,...e})=>{const n=L(t),a=[],o=Math.max(0,Math.floor((e.height-r.y-r.height)/12-.5)),d=Math.min(Math.ceil(e.height/12),Math.ceil((e.height-r.y)/12)),l=Math.max(0,Math.floor(r.x/8)),c=Math.min(Math.ceil(e.width/8),Math.ceil((r.x+r.width)/8));for(let h=o;h<d;h+=1){const p=e.height-(h+.5)*12;for(let u=l;u<c;u+=1)a.push(n("/",(u+.5)*8,p,5,8,u,h))}return a},te=({layer:e,coordSystem:t,panel:r})=>{const n=w(e),a=S("typewriter-area"),o=(0,A.useMemo)(()=>{if(t===void 0)return W(e,h=>q(h,r),j,r).map(h=>({...h,fill:h.path,edge:h.path}));const{areaGenerator:d,lineGenerator:l}=(0,i.createAreaPathGenerators)(t,e.params),c=new Map;return W(e,h=>{const p=(0,i.prepareAreaObservations)(h,e.params.missingValues),u=d(p),f=l(p);if(!u)return null;const m=G(u,r);return f&&c.set(m,G(f,r)),m},T,r).map(h=>({...h,fill:h.path,edge:c.get(h.path)??""}))},[e,t,r]);return r.width<=0||r.height<=0?null:(0,s.jsx)("g",{"data-geom":"area",children:o.map(({key:d,observation:l,fill:c,edge:h},p)=>{const u=n(l);return(0,s.jsxs)("g",{opacity:u.opacity,children:[(0,s.jsx)("clipPath",{id:`${a}-${p}`,children:(0,s.jsx)("path",{d:c})}),(0,s.jsx)("path",{d:c,fill:g.paper}),(0,s.jsx)("path",{d:c,fill:u.color,fillOpacity:u.fillOpacity*Q}),(0,s.jsx)("g",{clipPath:`url(#${a}-${p})`,children:(0,s.jsx)(k,{strikes:ee(r,d),color:u.color,opacity:u.fillOpacity})}),(0,s.jsx)("path",{d:h,fill:"none",stroke:u.color,strokeWidth:Se,strokeLinejoin:"round",strokeLinecap:"round"})]},d)})})},re=({layer:e,observation:t,panel:r,project:n})=>{const a=w(e)(t,"hovered");return(0,s.jsx)(J,{geom:"area",observation:t,panel:r,project:n,color:a.color,opacity:a.opacity})},Ee=(0,i.defineGeomRenderer)("area",{coord:"cartesian",guideMode:"crosshair",swatchShape:"area",render:({layer:e,coordSystem:t,panelRect:r})=>t.type!=="cartesian"?null:(0,s.jsx)(te,{layer:e,coordSystem:t,panel:r}),renderHover:({layer:e,primary:t,panelRect:r})=>(0,s.jsx)(re,{layer:e,observation:t.observation,panel:r,project:T}),renderHoverCompanions:()=>null}),Te=(0,i.defineGeomRenderer)("area",{coord:"polar",guideMode:"crosshair",swatchShape:"area",render:({layer:e,panelRect:t})=>(0,s.jsx)(te,{layer:e,panel:t}),renderHover:({layer:e,primary:t,panelRect:r})=>(0,s.jsx)(re,{layer:e,observation:t.observation,panel:r,project:j}),renderHoverCompanions:()=>null}),Pe=2,ne=1.8,_e=1,$e=3.3,Ie={solo:{base:!0,value:!0},floor:{base:!0,value:!1},ceiling:{base:!1,value:!0},middle:{base:!1,value:!1}},We={top:"bottom",bottom:"top",left:"right",right:"left"},Le=(e,t)=>t==="x"?((0,i.getYMax)(e)??(0,i.getY)(e)??0)>=((0,i.getYMin)(e)??0)?"top":"bottom":((0,i.getXMax)(e)??0)>=((0,i.getXMin)(e)??0)?"right":"left",be=(e,t,r)=>{const n=Math.max(0,e.width-r),a=Math.max(0,e.height-r);return t==="top"?{...e,y:e.y+e.height-a,height:a}:t==="bottom"?{...e,height:a}:t==="left"?{...e,x:e.x+e.width-n,width:n}:{...e,width:n}},H=(e,t)=>{const r=Math.max(1,Math.round(e/t));return{count:r,size:e/r}},X=(e,t,r)=>{const n=[];for(let a=$e+r/2;a-r/2<e;a+=t)n.push(a);return n},Ge=(e,t,r)=>{const n=L(r),a=t==="top"||t==="bottom",o=a?H(e.width,8):H(e.height,12),d=a?Math.min(5,o.size-2):5,l=a?8:Math.max(1,Math.min(8,o.size-4));return(a?X(e.height,12,8):X(e.width,8,5)).flatMap((c,h)=>Array.from({length:o.count},(p,u)=>{const f=(u+.5)*o.size;if(t==="top")return n("X",e.x+f,e.y+c,d,l,u,h);if(t==="bottom")return n("X",e.x+f,e.y+e.height-c,d,l,u,h);const m=t==="right"?e.x+e.width-c:e.x+c;return n("X",m,e.y+f,d,l,h,u)}))},He=(e,t)=>{const r=t==="top"||t==="bottom",n=H(r?e.width:e.height,r?8:12),a=Math.max(1,n.size-_e),o=ne/2;return Array.from({length:n.count},(d,l)=>{const c=(l+.5)*n.size;return t==="top"?M("_",e.x+c,e.y+o,a,0):t==="bottom"?M("_",e.x+c,e.y+e.height-o,a,0):M("|",t==="right"?e.x+e.width-o:e.x+o,e.y+c,0,a)})},Ce=({layer:e,observation:t,bounds:r,seed:n,mainAxis:a,panel:o,clipId:d,state:l})=>{const c=w(e);if(!r||r.width<=0||r.height<=0)return null;const h=c(t,l),p=Ie[(0,i.getStackRole)(t)],u=Le(t,a),f={x:r.x*o.width,y:r.y*o.height,width:r.width*o.width,height:r.height*o.height},m=[p.value?[]:[u],p.base?[]:[We[u]]].flat().reduce((P,se)=>be(P,se,Pe/2),f);return m.width<=0||m.height<=0?null:(0,s.jsx)(ae,{rect:m,edge:u,seed:n,clipId:d,color:h.color,opacity:h.opacity,pressure:h.fillOpacity,overstruck:l==="hovered"})},ae=({rect:e,edge:t,seed:r,clipId:n,color:a,opacity:o,pressure:d,overstruck:l})=>(0,s.jsxs)("g",{opacity:o,children:[(0,s.jsx)("clipPath",{id:n,children:(0,s.jsx)("rect",{...e})}),(0,s.jsx)("rect",{...e,fill:g.paper}),(0,s.jsx)("g",{clipPath:`url(#${n})`,children:(0,s.jsx)(k,{strikes:Ge(e,t,r),color:a,opacity:d,overstruck:l})}),(0,s.jsx)(k,{strikes:He(e,t),color:a,width:ne,overstruck:l})]}),K=({layer:e,observations:t,mainAxis:r,panel:n,state:a})=>{const o=S("typewriter-bar"),d=(0,i.useGeomStyleReader)(e),l=(0,A.useMemo)(()=>(0,i.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]),c=(0,A.useMemo)(()=>(0,i.createBarBoundsReader)(e,r,d,n),[e,r,d,n]);return n.width<=0||n.height<=0?null:(0,s.jsx)("g",{"data-geom":"bar",children:Array.from(t,(h,p)=>{const u=l(h);return(0,s.jsx)(Ce,{layer:e,observation:h,bounds:c(h),seed:u,mainAxis:r,panel:n,clipId:`${o}-${p}`,state:a},u)})})},Oe=(0,i.defineGeomRenderer)("bar",{coord:"cartesian",guideMode:"band",swatchShape:"square",render:({layer:e,coordSystem:t,panelRect:r})=>(0,s.jsx)(K,{layer:e,observations:e.data,mainAxis:(0,i.readMainAxis)(t),panel:r}),renderHover:({layer:e,coordSystem:t,primary:r,panelRect:n})=>(0,s.jsx)(K,{layer:e,observations:[r.observation],mainAxis:(0,i.readMainAxis)(t),panel:n,state:"hovered"}),renderHoverCompanions:()=>null}),Be=({layer:e,panel:t,coord:r})=>{const n=U(e),a=(0,A.useMemo)(()=>{if(r==="polar")return W(e,d=>q(d,t),j,t);const o=(0,i.createLinePathGenerator)(e.params);return W(e,d=>{const l=o((0,i.prepareLineObservations)(d,e.params.missingValues));return l?G(l,t):null},T,t)},[e,t,r]);return t.width<=0||t.height<=0?null:(0,s.jsx)("g",{"data-geom":"line",children:a.map(({key:o,path:d,observation:l,readings:c})=>{const h=n(l);return(0,s.jsxs)("g",{children:[(0,s.jsx)("path",{d,fill:"none",stroke:h.color,strokeOpacity:h.opacity,strokeWidth:h.width,strokeDasharray:h.dashArray,strokeLinejoin:"round",strokeLinecap:"round"}),(0,s.jsx)(we,{readings:c,color:h.color,opacity:h.opacity})]},o)})})},De=({layer:e,observation:t,panel:r,project:n})=>{const a=U(e)(t,"hovered");return(0,s.jsx)(J,{geom:"line",observation:t,panel:r,project:n,color:a.color,opacity:a.opacity})},ie=(e,t)=>(0,i.defineGeomRenderer)("line",{coord:e,guideMode:"crosshair",swatchShape:"line",render:({layer:r,panelRect:n})=>(0,s.jsx)(Be,{layer:r,panel:n,coord:e}),renderHover:({layer:r,primary:n,panelRect:a})=>(0,s.jsx)(De,{layer:r,observation:n.observation,panel:a,project:t}),renderHoverCompanions:()=>null,getOverlayAnchor:({observation:r})=>{const n=(0,i.getX)(r),a=(0,i.getY)(r);return n===null||a===null?null:{x:n,y:a}}}),ze=ie("cartesian",T),Ne=ie("polar",j),Xe=.85,Ke=1.6,Ye=4,Y=({layer:e,observations:t,panel:r,project:n,state:a})=>{const o=(0,i.useGeomStyleReader)(e),d=w(e),l=(0,A.useMemo)(()=>(0,i.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]),c=a==="hovered",h=c?Ye:0;return(0,s.jsx)("g",{"data-geom":"point",children:Array.from(t,p=>{const u=n(p,r);if(u===null)return null;const f=d(p,a),m=o.get("size",p,a)+h;return(0,s.jsx)(k,{strikes:[M("o",u.x,u.y,m*Xe,m)],color:f.color,opacity:f.opacity,width:Ke,overstruck:c},l(p))})})},oe=(e,t)=>(0,i.defineGeomRenderer)("point",{coord:e,swatchShape:"circle",render:({layer:r,panelRect:n})=>(0,s.jsx)(Y,{layer:r,observations:r.data,panel:n,project:t}),renderHover:({layer:r,primary:n,panelRect:a})=>(0,s.jsx)(Y,{layer:r,observations:[n.observation],panel:a,project:t,state:"hovered"}),renderHoverCompanions:()=>null}),Fe=oe("cartesian",T),Ve=oe("polar",j),Ue=4,Ze=1.2,qe=3,I=Math.PI*2,Je=.3,Qe=(e,t)=>{const{startAngle:r,endAngle:n}=(0,i.getAngleExtent)(e),{innerRadius:a,outerRadius:o}=(0,i.getRadiusExtent)(e);if(r===null||n===null||a===null||o===null)return null;const d=Math.min(t.width,t.height)/2;if(d<=0||o<=0)return null;const l=Math.max(0,n-r),c=Ue/2/(o*d),h=l>=I-1e-6?0:Math.min(c,l/4),p=r+h,u=n-h,f=(0,i.buildPolarBarArcPath)({startAngle:p,endAngle:u,innerRadius:a,outerRadius:o},{centerX:t.width/2,centerY:t.height/2,radius:d,digits:qe});return f===void 0?null:{path:f,startAngle:p,endAngle:u,inner:a*d,outer:o*d}},et=(e,t,r,n)=>{const a=Math.hypot(t,r);if(a>e.outer-n||a<e.inner+n)return!1;const o=((Math.atan2(t,-r)-e.startAngle)%I+I)%I,d=n/Math.max(a,1);return o>=d&&o<=e.endAngle-e.startAngle-d},tt=(e,t,r)=>{const n=L(r),a=Math.ceil(e.outer/8)+1,o=Math.ceil(e.outer/12)+1,d=-Math.hypot(8,12)/2,l=[];for(let c=-o;c<=o;c+=1)for(let h=-a;h<=a;h+=1){const p=h*8,u=c*12;et(e,p,u,d)&&l.push(n("/",t.width/2+p,t.height/2+u,5,8,h,c))}return l},F=({layer:e,observations:t,panel:r,state:n})=>{const a=w(e),o=S("slice-shading"),d=(0,A.useMemo)(()=>(0,i.createStableKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]);return r.width<=0||r.height<=0?null:(0,s.jsx)("g",{"data-geom":"bar",children:Array.from(t,l=>{const c=Qe(l,r);if(c===null)return null;const h=d(l),p=a(l,n),u=`${o}-${h.replace(/[^a-zA-Z0-9]/gu,"")}`;return(0,s.jsxs)("g",{opacity:p.opacity,children:[(0,s.jsx)("path",{d:c.path,fill:g.paper}),(0,s.jsxs)("g",{children:[(0,s.jsx)("clipPath",{id:u,children:(0,s.jsx)("path",{d:c.path})}),(0,s.jsx)("path",{d:c.path,fill:p.color,fillOpacity:p.fillOpacity*Je}),(0,s.jsx)("g",{clipPath:`url(#${u})`,children:(0,s.jsx)(k,{strikes:tt(c,r,h),color:p.color,opacity:p.fillOpacity,overstruck:n==="hovered"})})]}),(0,s.jsx)("path",{d:c.path,fill:"none",stroke:p.color,strokeWidth:Ze,strokeLinejoin:"round"})]},h)})})},rt=(0,i.defineGeomRenderer)("bar",{coord:"polar",guideMode:"band",swatchShape:"slice",render:({layer:e,panelRect:t})=>(0,s.jsx)(F,{layer:e,observations:e.data,panel:t}),renderHover:({layer:e,primary:t,panelRect:r})=>(0,s.jsx)(F,{layer:e,observations:[t.observation],panel:r,state:"hovered"}),renderHoverCompanions:()=>null}),$=2,nt=.2,at=(e,t)=>{const r=L(t),n=[],a=Math.floor(e.y/12),o=Math.floor(e.x/8);for(let d=a;d*12<e.y+e.height;d+=1)for(let l=o;l*8<e.x+e.width;l+=1){const c=(l+.5)*8,h=(d+.5)*12;n.push(r("X",c,h,5,8,l,d))}return n},it=({layer:e,observation:t,seed:r,panel:n,clipId:a,state:o})=>{const d=w(e),l=(0,i.getPaintedTileRect)(t);if(l===null)return null;const c=d(t,o),h={x:l.x*n.width+$/2,y:l.y*n.height+$/2,width:Math.max(0,l.width*n.width-$),height:Math.max(0,l.height*n.height-$)};return h.width<=0||h.height<=0?null:(0,s.jsxs)("g",{opacity:c.opacity,children:[(0,s.jsx)("clipPath",{id:a,children:(0,s.jsx)("rect",{...h})}),(0,s.jsx)("rect",{...h,fill:c.color,fillOpacity:c.fillOpacity}),(0,s.jsx)("g",{clipPath:`url(#${a})`,children:(0,s.jsx)(k,{strikes:at(h,r),color:g.paper,opacity:nt,overstruck:o==="hovered"})}),o==="hovered"&&(0,s.jsx)("rect",{...h,fill:"none",stroke:g.text,strokeWidth:c.edgeWidth})]})},V=({layer:e,observations:t,panel:r,state:n})=>{const a=S("typewriter-tile"),o=(0,A.useMemo)(()=>(0,i.createStableCellKeyGenerator)(e.data,e.mapping,e.id),[e.data,e.mapping,e.id]);return r.width<=0||r.height<=0?null:(0,s.jsx)("g",{"data-geom":"tile",children:Array.from(t,(d,l)=>{const c=o(d);return(0,s.jsx)(it,{layer:e,observation:d,seed:c,panel:r,clipId:`${a}-${l}`,state:n},c)})})},ot=(0,i.defineGeomRenderer)("tile",{coord:"cartesian",guideMode:null,swatchShape:"square",render:({layer:e,panelRect:t})=>(0,s.jsx)(V,{layer:e,observations:e.data,panel:t}),renderHover:({layer:e,primary:t,panelRect:r})=>(0,s.jsx)(V,{layer:e,observations:[t.observation],panel:r,state:"hovered"}),renderHoverCompanions:()=>null}),st=[Oe,rt,ot,ze,Ne,Ee,Te,Fe,Ve],lt=e=>{const t=S("typewriter-rect"),r=(0,i.useGeomPanelSize)(),n=r===null?null:(0,i.readRectPixels)(e,r);return n===null||e.fill===void 0?(0,s.jsx)(i.DefaultGeomRect,{...e}):n.width<=0||n.height<=0?null:(0,s.jsx)("g",{"data-testid":e["data-testid"],children:(0,s.jsx)(ae,{rect:n,edge:"top",seed:`${n.x},${n.y}`,clipId:t,color:e.fill,opacity:e.opacity??1,pressure:e.fillOpacity??1,overstruck:!1})})},dt=e=>{const t=(e.match(/-?\d*\.?\d+(?:e-?\d+)?/giu)??[]).map(Number),r=t.filter((d,l)=>l%2===0),n=t.filter((d,l)=>l%2===1);if(r.length===0||n.length===0)return null;const a=Math.min(...r),o=Math.min(...n);return{x:a,y:o,width:Math.max(...r)-a,height:Math.max(...n)-o}},ht=e=>{const t=S("typewriter-path"),r=(0,i.useGeomPanelSize)(),n=(0,A.useMemo)(()=>{const o=dt(e.d);return r===null||o===null?null:ee(r,e.d,o)},[r,e.d]);if(n===null||e.fill===void 0||e.fill.startsWith("url("))return(0,s.jsx)(i.DefaultGeomPath,{...e});const a=e.fillOpacity??1;return(0,s.jsxs)("g",{"data-testid":e["data-testid"],opacity:e.opacity??1,children:[(0,s.jsx)("clipPath",{id:t,children:(0,s.jsx)("path",{d:e.d})}),(0,s.jsx)("path",{d:e.d,fill:g.paper}),(0,s.jsx)("path",{d:e.d,fill:e.fill,fillOpacity:a*Q}),(0,s.jsx)("g",{clipPath:`url(#${t})`,children:(0,s.jsx)(k,{strikes:n,color:e.fill,opacity:a})})]})},ct={Rect:lt,Path:ht},ut={name:"typewriter",styles:ue,palettes:{categorical:de,sequential:he,diverging:ce},config:{axes:{y:{position:"left"}}},colorScheme:"light",plugins:st,shapes:ct};exports.typewriter=ut;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useId as yt, useMemo as x } from "react";
2
- import { DefaultGeomPath as At, DefaultGeomRect as kt, GROUP_VARIABLES as xt, buildPolarBarArcPath as Rt, createAreaPathGenerators as wt, createBarBoundsReader as Mt, createLinePathGenerator as Et, createStableCellKeyGenerator as Tt, createStableKeyGenerator as b, defineGeomRenderer as M, getAngleExtent as St, getPaintedTileRect as Pt, getRadiusExtent as rt, getStackRole as $t, getX as C, getXMax as It, getXMin as _t, getY as B, getYMax as nt, getYMin as Wt, polarToUnit as Lt, prepareAreaObservations as Ht, prepareLineObservations as Ot, readMainAxis as F, readRectPixels as bt, style as c, toPaintColor as Ct, toStrokeDasharray as Bt, toViewBoxX as Gt, toViewBoxY as Dt, useGeomPanelSize as at, useGeomStyleReader as G } from "@graphysdk/react";
2
+ import { DefaultGeomPath as At, DefaultGeomRect as kt, GROUP_VARIABLES as xt, buildPolarBarArcPath as Rt, createAreaPathGenerators as wt, createBarBoundsReader as Mt, createLinePathGenerator as Et, createStableCellKeyGenerator as Tt, createStableKeyGenerator as C, defineGeomRenderer as M, getAngleExtent as St, getPaintedTileRect as Pt, getRadiusExtent as rt, getStackRole as $t, getX as O, getXMax as It, getXMin as _t, getY as B, getYMax as nt, getYMin as Wt, polarToUnit as Lt, prepareAreaObservations as Ht, prepareLineObservations as bt, readMainAxis as F, readRectPixels as Ct, style as c, toPaintColor as Ot, toStrokeDasharray as Bt, toViewBoxX as Gt, toViewBoxY as Dt, useGeomPanelSize as at, useGeomStyleReader as G } from "@graphysdk/react";
3
3
  import { jsx as s, jsxs as R } from "react/jsx-runtime";
4
4
  var g = {
5
5
  paper: "#EBD9A9",
@@ -269,13 +269,13 @@ var g = {
269
269
  return n += 1, String(Number(a) * (i === "x" ? e.width : e.height));
270
270
  }).join(" ");
271
271
  }, I = (t, e) => {
272
- const r = C(t), n = B(t) ?? nt(t);
272
+ const r = O(t), n = B(t) ?? nt(t);
273
273
  return r === null || n === null ? null : {
274
274
  x: Gt(r) * e.width,
275
275
  y: Dt(n) * e.height
276
276
  };
277
277
  }, T = (t, e) => {
278
- const r = C(t), n = B(t) ?? rt(t).outerRadius;
278
+ const r = O(t), n = B(t) ?? rt(t).outerRadius;
279
279
  if (r === null || n === null) return null;
280
280
  const a = Lt(r, n), i = Math.min(e.width, e.height) / 2;
281
281
  return {
@@ -285,7 +285,7 @@ var g = {
285
285
  }, Ut = (t) => `${t.map((e, r) => `${r === 0 ? "M" : "L"}${e.x},${e.y}`).join(" ")} Z`, S = (t) => {
286
286
  const e = G(t);
287
287
  return (r, n) => ({
288
- color: Ct(e.get("fill", r, n)),
288
+ color: Ot(e.get("fill", r, n)),
289
289
  opacity: e.get("alpha", r, n),
290
290
  fillOpacity: e.get("fillAlpha", r, n),
291
291
  edge: e.get("stroke", r, n),
@@ -338,7 +338,7 @@ var g = {
338
338
  }, E = (t, e, r, n, a) => ({
339
339
  path: ot(t, e, r, n, a),
340
340
  weight: $.length - 1
341
- }), P = (t) => `${t}-${yt().replace(/[^a-zA-Z0-9]/gu, "")}`, k = ({ strikes: t, color: e, opacity: r = 1, width: n = Zt, isOverstruck: a = !1 }) => t.length === 0 ? null : /* @__PURE__ */ R("g", {
341
+ }), P = (t) => `${t}-${yt().replace(/[^a-zA-Z0-9]/gu, "")}`, k = ({ strikes: t, color: e, opacity: r = 1, width: n = Zt, overstruck: a = !1 }) => t.length === 0 ? null : /* @__PURE__ */ R("g", {
342
342
  fill: "none",
343
343
  stroke: e,
344
344
  strokeWidth: n,
@@ -351,8 +351,8 @@ var g = {
351
351
  d: t.map((i) => i.path).join(""),
352
352
  transform: `translate(${qt},0)`
353
353
  })]
354
- }), U = 6, te = 14, ee = 1.5, Z = 10, re = 1.8, O = (t, e, r, n) => {
355
- const a = b(t.data, t.mapping, t.id), i = [];
354
+ }), U = 6, te = 14, ee = 1.5, Z = 10, re = 1.8, b = (t, e, r, n) => {
355
+ const a = C(t.data, t.mapping, t.id), i = [];
356
356
  return t.data.groupBy(xt.group).forEach((l) => {
357
357
  const o = [...l], [h] = o, d = e(o);
358
358
  if (h === void 0 || d === null) return;
@@ -366,7 +366,7 @@ var g = {
366
366
  }), i;
367
367
  }, lt = (t, e) => {
368
368
  const r = t.flatMap((n) => {
369
- const a = C(n), i = T(n, e);
369
+ const a = O(n), i = T(n, e);
370
370
  return a === null || i === null ? [] : [{
371
371
  angle: a,
372
372
  point: i
@@ -390,7 +390,7 @@ var g = {
390
390
  color: a,
391
391
  opacity: i,
392
392
  width: re,
393
- isOverstruck: !0
393
+ overstruck: !0
394
394
  })
395
395
  });
396
396
  }, dt = 0.55, ie = 1.5, ht = (t, e, r = {
@@ -406,13 +406,13 @@ var g = {
406
406
  return a;
407
407
  }, ct = ({ layer: t, coordSystem: e, panel: r }) => {
408
408
  const n = S(t), a = P("typewriter-area"), i = x(() => {
409
- if (e === void 0) return O(t, (d) => lt(d, r), T, r).map((d) => ({
409
+ if (e === void 0) return b(t, (d) => lt(d, r), T, r).map((d) => ({
410
410
  ...d,
411
411
  fill: d.path,
412
412
  edge: d.path
413
413
  }));
414
414
  const { areaGenerator: l, lineGenerator: o } = wt(e, t.params), h = /* @__PURE__ */ new Map();
415
- return O(t, (d) => {
415
+ return b(t, (d) => {
416
416
  const p = Ht(d, t.params.missingValues), u = l(p), f = o(p);
417
417
  if (!u) return null;
418
418
  const y = N(u, r);
@@ -589,9 +589,9 @@ var g = {
589
589
  color: d.color,
590
590
  opacity: d.opacity,
591
591
  pressure: d.fillOpacity,
592
- isOverstruck: o === "hovered"
592
+ overstruck: o === "hovered"
593
593
  });
594
- }, gt = ({ rect: t, edge: e, seed: r, clipId: n, color: a, opacity: i, pressure: l, isOverstruck: o }) => /* @__PURE__ */ R("g", {
594
+ }, gt = ({ rect: t, edge: e, seed: r, clipId: n, color: a, opacity: i, pressure: l, overstruck: o }) => /* @__PURE__ */ R("g", {
595
595
  opacity: i,
596
596
  children: [
597
597
  /* @__PURE__ */ s("clipPath", {
@@ -608,18 +608,18 @@ var g = {
608
608
  strikes: fe(t, e, r),
609
609
  color: a,
610
610
  opacity: l,
611
- isOverstruck: o
611
+ overstruck: o
612
612
  })
613
613
  }),
614
614
  /* @__PURE__ */ s(k, {
615
615
  strikes: me(t, e),
616
616
  color: a,
617
617
  width: pt,
618
- isOverstruck: o
618
+ overstruck: o
619
619
  })
620
620
  ]
621
621
  }), J = ({ layer: t, observations: e, mainAxis: r, panel: n, state: a }) => {
622
- const i = P("typewriter-bar"), l = G(t), o = x(() => b(t.data, t.mapping, t.id), [
622
+ const i = P("typewriter-bar"), l = G(t), o = x(() => C(t.data, t.mapping, t.id), [
623
623
  t.data,
624
624
  t.mapping,
625
625
  t.id
@@ -665,10 +665,10 @@ var g = {
665
665
  renderHoverCompanions: () => null
666
666
  }), Ae = ({ layer: t, panel: e, coord: r }) => {
667
667
  const n = it(t), a = x(() => {
668
- if (r === "polar") return O(t, (l) => lt(l, e), T, e);
668
+ if (r === "polar") return b(t, (l) => lt(l, e), T, e);
669
669
  const i = Et(t.params);
670
- return O(t, (l) => {
671
- const o = i(Ot(l, t.params.missingValues));
670
+ return b(t, (l) => {
671
+ const o = i(bt(l, t.params.missingValues));
672
672
  return o ? N(o, e) : null;
673
673
  }, I, e);
674
674
  }, [
@@ -723,14 +723,14 @@ var g = {
723
723
  }),
724
724
  renderHoverCompanions: () => null,
725
725
  getOverlayAnchor: ({ observation: r }) => {
726
- const n = C(r), a = B(r);
726
+ const n = O(r), a = B(r);
727
727
  return n === null || a === null ? null : {
728
728
  x: n,
729
729
  y: a
730
730
  };
731
731
  }
732
732
  }), xe = ft("cartesian", I), Re = ft("polar", T), we = 0.85, Me = 1.6, Ee = 4, Q = ({ layer: t, observations: e, panel: r, project: n, state: a }) => {
733
- const i = G(t), l = S(t), o = x(() => b(t.data, t.mapping, t.id), [
733
+ const i = G(t), l = S(t), o = x(() => C(t.data, t.mapping, t.id), [
734
734
  t.data,
735
735
  t.mapping,
736
736
  t.id
@@ -746,7 +746,7 @@ var g = {
746
746
  color: f.color,
747
747
  opacity: f.opacity,
748
748
  width: Me,
749
- isOverstruck: h
749
+ overstruck: h
750
750
  }, o(p));
751
751
  })
752
752
  });
@@ -803,7 +803,7 @@ var g = {
803
803
  }
804
804
  return o;
805
805
  }, tt = ({ layer: t, observations: e, panel: r, state: n }) => {
806
- const a = S(t), i = P("slice-shading"), l = x(() => b(t.data, t.mapping, t.id), [
806
+ const a = S(t), i = P("slice-shading"), l = x(() => C(t.data, t.mapping, t.id), [
807
807
  t.data,
808
808
  t.mapping,
809
809
  t.id
@@ -837,7 +837,7 @@ var g = {
837
837
  strikes: He(h, r, d),
838
838
  color: p.color,
839
839
  opacity: p.fillOpacity,
840
- isOverstruck: n === "hovered"
840
+ overstruck: n === "hovered"
841
841
  })
842
842
  })
843
843
  ] }),
@@ -852,7 +852,7 @@ var g = {
852
852
  }, d);
853
853
  })
854
854
  });
855
- }, Oe = M("bar", {
855
+ }, be = M("bar", {
856
856
  coord: "polar",
857
857
  guideMode: "band",
858
858
  swatchShape: "slice",
@@ -868,7 +868,7 @@ var g = {
868
868
  state: "hovered"
869
869
  }),
870
870
  renderHoverCompanions: () => null
871
- }), L = 2, be = 0.2, Ce = (t, e) => {
871
+ }), L = 2, Ce = 0.2, Oe = (t, e) => {
872
872
  const r = D(e), n = [], a = Math.floor(t.y / 12), i = Math.floor(t.x / 8);
873
873
  for (let l = a; l * 12 < t.y + t.height; l += 1) for (let o = i; o * 8 < t.x + t.width; o += 1) {
874
874
  const h = (o + 0.5) * 8, d = (l + 0.5) * 12;
@@ -899,10 +899,10 @@ var g = {
899
899
  /* @__PURE__ */ s("g", {
900
900
  clipPath: `url(#${a})`,
901
901
  children: /* @__PURE__ */ s(k, {
902
- strikes: Ce(d, r),
902
+ strikes: Oe(d, r),
903
903
  color: g.paper,
904
- opacity: be,
905
- isOverstruck: i === "hovered"
904
+ opacity: Ce,
905
+ overstruck: i === "hovered"
906
906
  })
907
907
  }),
908
908
  i === "hovered" && /* @__PURE__ */ s("rect", {
@@ -951,7 +951,7 @@ var g = {
951
951
  renderHoverCompanions: () => null
952
952
  }), De = [
953
953
  ye,
954
- Oe,
954
+ be,
955
955
  Ge,
956
956
  xe,
957
957
  Re,
@@ -960,7 +960,7 @@ var g = {
960
960
  Te,
961
961
  Se
962
962
  ], ze = (t) => {
963
- const e = P("typewriter-rect"), r = at(), n = r === null ? null : bt(t, r);
963
+ const e = P("typewriter-rect"), r = at(), n = r === null ? null : Ct(t, r);
964
964
  return n === null || t.fill === void 0 ? /* @__PURE__ */ s(kt, { ...t }) : n.width <= 0 || n.height <= 0 ? null : /* @__PURE__ */ s("g", {
965
965
  "data-testid": t["data-testid"],
966
966
  children: /* @__PURE__ */ s(gt, {
@@ -971,7 +971,7 @@ var g = {
971
971
  color: t.fill,
972
972
  opacity: t.opacity ?? 1,
973
973
  pressure: t.fillOpacity ?? 1,
974
- isOverstruck: !1
974
+ overstruck: !1
975
975
  })
976
976
  });
977
977
  }, Ne = (t) => {
@@ -14,13 +14,13 @@ interface TypedBoxProps {
14
14
  /** The stylesheet's `fillAlpha`: how hard the X's are struck. */
15
15
  pressure: number;
16
16
  /** Whether the box is typed over a second time, a hair to the right, as a hovered bar is. */
17
- isOverstruck: boolean;
17
+ overstruck: boolean;
18
18
  }
19
19
  /**
20
20
  * A box typed as a typist types a bar, shared by the bars and every rect a package geom draws: paper under it,
21
21
  * a block of X's clipped to it, and a row of underscores along `edge`.
22
22
  */
23
- export declare const TypedBox: ({ rect, edge, seed, clipId, color, opacity, pressure, isOverstruck, }: TypedBoxProps) => ReactNode;
23
+ export declare const TypedBox: ({ rect, edge, seed, clipId, color, opacity, pressure, overstruck, }: TypedBoxProps) => ReactNode;
24
24
  /**
25
25
  * Each bar typed as a typist types a bar chart: a row of underscores whose outer edge is the value,
26
26
  * then a block of X's in the ribbon's colour typed down from directly under it, the last row cut off
@@ -33,8 +33,8 @@ interface TypedProps {
33
33
  opacity?: number;
34
34
  width?: number;
35
35
  /** Struck twice, a hair apart, as a typist does to make a character stand out. */
36
- isOverstruck?: boolean;
36
+ overstruck?: boolean;
37
37
  }
38
38
  /** Strikes in a ribbon's colour, one path for each weight of ink so a block of them stays light to draw. */
39
- export declare const Typed: ({ strikes, color, opacity, width, isOverstruck, }: TypedProps) => ReactNode;
39
+ export declare const Typed: ({ strikes, color, opacity, width, overstruck, }: TypedProps) => ReactNode;
40
40
  export {};
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "theme",
14
14
  "typewriter"
15
15
  ],
16
- "version": "0.1.1-beta.1792505847409",
16
+ "version": "0.1.1-beta.1792510459918",
17
17
  "type": "module",
18
18
  "sideEffects": [
19
19
  "*.css"
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": "^19.0.0",
43
- "@graphysdk/react": "^1.9.0-beta.1792505847409"
43
+ "@graphysdk/react": "^1.9.0-beta.1792510459918"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@testing-library/react": "^16.3.1",
@@ -52,8 +52,8 @@
52
52
  "vite": "^8.1.5",
53
53
  "vite-plugin-dts": "^4.5.4",
54
54
  "vitest": "^4.1.11",
55
- "@graphysdk/react": "1.9.0-beta.1792505847409",
56
- "@graphysdk/viz-engine": "1.9.0-beta.1792505847409",
55
+ "@graphysdk/react": "1.9.0-beta.1792510459918",
56
+ "@graphysdk/viz-engine": "1.9.0-beta.1792510459918",
57
57
  "@graphytools/eslint-config": "0.0.1",
58
58
  "@graphytools/typescript-config": "0.0.1",
59
59
  "@graphytools/vitest-config": "1.0.0"