@graphysdk/geom-mekko 0.1.0 → 0.1.1-beta.1792411689978

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 n=require("@graphysdk/react"),x=require("react"),f=require("react/jsx-runtime");var V=(e,t)=>{const a=t==="x"?(0,n.getXMin)(e):(0,n.getYMin)(e),o=t==="x"?(0,n.getXMax)(e):(0,n.getYMax)(e),r=t==="x"?(0,n.getYMin)(e):(0,n.getXMin)(e),s=t==="x"?(0,n.getYMax)(e):(0,n.getXMax)(e);return a===null||o===null||r===null||s===null?null:{observation:e,columnStart:a,columnEnd:o,low:r,high:s}},S=(e,t)=>{const a=[];for(const o of e){const r=V(o,t);r!==null&&a.push(r)}return a},w=e=>e===null||!Number.isFinite(e)||e<=0?null:e,B=(e,t,a,o="data")=>{const r=a.map(w),s=I(t),l=e.map((d,c)=>c).sort((d,c)=>(s.get(t[d])??0)-(s.get(t[c])??0)),u=new Map;for(const d of l){const c=e[d],m=r[d];c===null||m===null||m===void 0||u.set(c,(u.get(c)??0)+m)}const v=new Map;let h=0;for(const[d,c]of j([...u],o)){const m=h;h+=c,v.set(d,{start:m,end:h})}const i=h;if(i===0)return r.map(()=>null);const g=r.map(()=>null),p=new Map;for(const d of l){const c=e[d],m=r[d],k=u.get(c),b=v.get(c);if(m==null||k===void 0||k===0||b===void 0)continue;const M=p.get(c)??0;p.set(c,M+m),g[d]={columnStart:b.start/i,columnEnd:b.end/i,cellStart:M/k,cellEnd:(M+m)/k,shareOfColumn:m/k,columnShare:k/i}}return g},I=e=>{const t=new Map;for(const a of e)t.has(a)||t.set(a,t.size);return t},j=(e,t)=>{if(t==="data")return e;if(t==="ascending")return[...e].sort(([,r],[,s])=>r-s);if(t==="descending")return[...e].sort(([,r],[,s])=>s-r);const a=I(t),o=r=>a.get(r)??a.size;return[...e].sort(([r],[s])=>o(r)-o(s))},y={shareOfColumn:"mekkoShareOfColumn",columnShare:"mekkoColumnShare"},G=["data","ascending","descending"],P=e=>G.includes(e)||Array.isArray(e)&&e.every(t=>typeof t=="string"||typeof t=="number"),D=e=>{const t=e?.sort;return P(t)?t:"data"},E=new Set(["value","columnShare"]),O="mekkoAmount",K=class extends n.Stat{constructor(...e){super(...e),this.type="mekko",this.computedVariables=E}computeStat({data:e,mapping:t,params:a}){const o=(0,n.readVariableName)(t.x),r=(0,n.readVariableName)(t.y);if(o===null||r===null||!e.hasVariable(o)||!e.hasVariable(r))return{data:e,mapping:{}};if(e.size()>0&&e.getType(r)!=="numeric"){const u=e.getType(r);throw new n.UserInputError({code:"INCOMPATIBLE_TYPE",message:`'mekko' stat requires a numeric 'y' (got '${u}' for variable '${r}')`,context:{aesthetic:"y",variableName:r,variableType:u},suggestion:"Map each cell's amount to 'y'."})}const s=(0,n.getGroupVariables)(e,t).filter(u=>u!==o),l=H(e,o,r,s);return{data:R(l,o,r,s,D(a)),mapping:{y:y.shareOfColumn,value:r,columnShare:y.columnShare}}}},H=(e,t,a,o)=>{const r=e.getValues(a,{type:"numeric"}).map(w);return e.addVariable(O,"numeric",r,e.getValueFormat(a)).groupBy(t,...o).rollup({[a]:{variableName:O,aggregation:"sum"}})},R=(e,t,a,o,r)=>{const s=o.map(i=>e.getValues(i)),l=Array.from({length:e.size()},(i,g)=>JSON.stringify(s.map(p=>p[g]))),u=B(e.getValues(t).map(X),l,e.getValues(a,{type:"numeric"}),r),v={type:"percentage"},h=i=>u.map(g=>g===null?null:i(g));return e.addVariable(y.shareOfColumn,"numeric",h(i=>i.shareOfColumn),v).addVariable(y.columnShare,"numeric",h(i=>i.columnShare),v).addVariable(n.POSITION_VARIABLES.xMin,"numeric",h(i=>i.columnStart)).addVariable(n.POSITION_VARIABLES.xMax,"numeric",h(i=>i.columnEnd)).addVariable(n.POSITION_VARIABLES.yMin,"numeric",h(i=>i.cellStart)).addVariable(n.POSITION_VARIABLES.yMax,"numeric",h(i=>i.cellEnd))},X=e=>e instanceof Date?e.getTime():e,_=(e,t)=>{const a=(0,n.composePoint)(t,{main:e.columnStart,cross:e.low}),o=(0,n.composePoint)(t,{main:e.columnEnd,cross:e.high}),[r,s]=T((0,n.toViewBoxX)(a.x),(0,n.toViewBoxX)(o.x)),[l,u]=T((0,n.toViewBoxY)(a.y),(0,n.toViewBoxY)(o.y));return{x:r,y:l,width:s-r,height:u-l}},L=(e,t,a)=>{const o=_(e,t);return{x:o.x*a.width,y:o.y*a.height,width:o.width*a.width,height:o.height*a.height}},T=(e,t)=>e<=t?[e,t]:[t,e],$=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{position:a,justify:o,align:r,offset:s}=e.layer.dataLabels,l=a==="auto",u=l?"inside":a,v=(0,n.readMainAxis)(e.coordSystem),h=(0,n.buildPanelAnchorBox)(e.panelRect);let i=0;for(const g of S(e.layer.data,v)){const p=e.formatLabel(g.observation);if(p==="")continue;const{width:d,height:c}=e.measureDataLabel("observation",u,p),m=(0,n.resolveAnchoredLabelCenter)({box:L(g,v,e.panelRect),panel:h,orientation:v==="x"?{valueAxis:"y",valueDirectionSign:-1}:{valueAxis:"x",valueDirectionSign:1},placement:u,justify:l?"center":o,align:l?"center":r,offset:s,labelWidth:d,labelHeight:c});if(l&&m.position!=="inside"){i+=1;continue}t.push({layerId:e.layer.id,x:m.x,y:m.y,text:p,width:d,height:c,isRotated:!1,role:"observation",position:m.position,backdropColor:m.position==="inside"?(0,n.readBackdropColor)(e.styleReaders,g.observation):void 0})}return{labels:t,droppedCount:i}},W=1,Y={strokeWidth:"pixels"},N=class extends n.Geom{constructor(...e){super(...e),this.type="mekko",this.defaultParams={},this.defaultStat=new K,this.positionRoles=[{axis:"x",role:"min",valueKind:"value"},{axis:"x",role:"max",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value",aes:"y"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"alpha"},{kind:"data",name:"value"},{kind:"data",name:"columnShare"}],this.derivedVariables=[y.shareOfColumn,y.columnShare],this.supportedPositions=["identity"],this.supportedCoordTypes=["cartesian","flip"],this.categorySpanAxes=["x"],this.grid={cartesian:{hideGridX:!0},flip:{hideGridX:!0}},this.legend={suppressWhenSingleItem:!0},this.dataLabelCoordTypes=["cartesian","flip"],this.getDataLabelPlacements=$,this.spatialKind="rects",this.highlightStrategy="observation-rerender",this.styleTarget=(0,n.defineGeomStyleTarget)({observation:{vocabulary:Y,aesthetics:{fill:"color",alpha:"alpha"},rest:{fill:(0,n.token)("geom"),fillAlpha:1,stroke:(0,n.token)("graphBackground"),strokeWidth:W}}}),this.validateMapping=({mapping:t,computedVariables:a})=>a.has("columnShare")?[...E].filter(o=>t[o]!==void 0).map(o=>({code:"CONFLICTING_STAT_MAPPING",message:`mekko stat computes '${o}' from 'x' and 'y'; remove its mapping`})):[{code:"MISSING_STAT_OUTPUT",message:"mekko geom lays its cells out in the 'mekko' stat; remove the layer's stat"}],this.resolveAnchorPosition=(t,{coordSystem:a})=>{const o=(0,n.readMainAxis)(a),r=V(t,o);if(r===null)return null;const s=(r.columnStart+r.columnEnd)/2,l=(r.low+r.high)/2;return o==="x"?{x:s,y:l}:{x:l,y:s}}}resolveParams(e){const{sort:t,...a}=super.resolveParams(e);return t===void 0||P(t)?t===void 0?a:{...a,sort:t}:(e.diagnostics?.addWarning({code:"INVALID_GEOM_PARAM",message:`Mekko sort must be 'data', 'ascending', 'descending' or a list of columns, got ${JSON.stringify(t)}; falling back to 'data'.`,context:{geom:"mekko",param:"sort",expected:"'data' | 'ascending' | 'descending' | columns[]"},suggestion:"Set params.sort to 'descending' to run the columns largest first, or list them in order."}),a)}compile({data:e}){return{data:e,mapping:{}}}},F=({layer:e,coordSystem:t,panelRect:a})=>{const o=(0,n.readMainAxis)(t);return S(e.data,o).map(r=>{const s=L(r,o,a),l=s.x+s.width,u=s.y+s.height;return{kind:"region",pathData:`M${s.x},${s.y}H${l}V${u}H${s.x}Z`}})},C=e=>{const t=(0,n.createStableKeyGenerator)(e.data,e.mapping,e.id);return a=>t(a.observation)},A=({cells:e,mainAxis:t,styleReaders:a,getKey:o,isHovered:r=!1,shouldAnimateTransitions:s=!1})=>{const l=r?"hovered":void 0,u=(0,x.useMemo)(()=>e.map(i=>a.get("fill",i.observation,l)??"transparent"),[e,a,l]),{fillFor:v,defs:h}=(0,n.usePaintDefs)({paints:u});return(0,f.jsxs)(f.Fragment,{children:[h,e.map((i,g)=>{const p=_(i,t),d=u[g],c=a.get("stroke",i.observation,l);return(0,f.jsx)(n.GeomRect,{"data-testid":"mekko-cell",x:(0,n.toPercent)(p.x),y:(0,n.toPercent)(p.y),width:(0,n.toPercent)(p.width),height:(0,n.toPercent)(p.height),fill:d===void 0?void 0:v(d),opacity:a.get("alpha",i.observation,l),fillOpacity:a.get("fillAlpha",i.observation,l),stroke:c===void 0?void 0:(0,n.toPaintColor)(c),strokeWidth:a.get("strokeWidth",i.observation,l),shouldAnimateTransitions:s},o(i))})]})},U=({layer:e,sourceLayer:t,mainAxis:a,styleReaders:o})=>(0,f.jsx)(A,{cells:(0,x.useMemo)(()=>S(e.data,a),[e.data,a]),mainAxis:a,styleReaders:o,getKey:(0,x.useMemo)(()=>C(t),[t])}),q=({layer:e,primary:t,mainAxis:a,styleReaders:o})=>(0,f.jsx)("g",{"data-testid":"hovered-cells",children:(0,f.jsx)(A,{cells:S([t.observation],a),mainAxis:a,styleReaders:o,getKey:(0,x.useMemo)(()=>C(e),[e]),isHovered:!0})}),z=({layer:e,mainAxis:t,styleReaders:a,shouldAnimateTransitions:o,intro:r})=>{const s=(0,f.jsx)(A,{cells:(0,x.useMemo)(()=>S(e.data,t),[e.data,t]),mainAxis:t,styleReaders:a,getKey:(0,x.useMemo)(()=>C(e),[e]),shouldAnimateTransitions:o});return r==null?s:(0,f.jsx)(n.IntroFade,{intro:{type:"fade",layerId:r.layerId,durationSeconds:r.durationSeconds},children:s})},J=(0,n.defineGeomRenderer)(new N,{coord:"cartesian",swatchShape:"square",render:({layer:e,coordSystem:t,styleReaders:a,shouldAnimateTransitions:o,intro:r})=>(0,f.jsx)(z,{layer:e,mainAxis:(0,n.readMainAxis)(t),styleReaders:a,shouldAnimateTransitions:o,intro:r}),renderHighlight:({layer:e,sourceLayer:t,coordSystem:a,styleReaders:o})=>(0,f.jsx)(U,{layer:e,sourceLayer:t,mainAxis:(0,n.readMainAxis)(a),styleReaders:o}),renderHover:({layer:e,primary:t,coordSystem:a,styleReaders:o})=>(0,f.jsx)(q,{layer:e,primary:t,mainAxis:(0,n.readMainAxis)(a),styleReaders:o}),renderHoverCompanions:()=>null,getEditOutlineShapes:F});exports.MekkoGeom=N;exports.mekko=J;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let n=require("@graphysdk/react"),x=require("react"),f=require("react/jsx-runtime");var V=(e,t)=>{const a=t==="x"?(0,n.getXMin)(e):(0,n.getYMin)(e),o=t==="x"?(0,n.getXMax)(e):(0,n.getYMax)(e),r=t==="x"?(0,n.getYMin)(e):(0,n.getXMin)(e),s=t==="x"?(0,n.getYMax)(e):(0,n.getXMax)(e);return a===null||o===null||r===null||s===null?null:{observation:e,columnStart:a,columnEnd:o,low:r,high:s}},S=(e,t)=>{const a=[];for(const o of e){const r=V(o,t);r!==null&&a.push(r)}return a},w=e=>e===null||!Number.isFinite(e)||e<=0?null:e,B=(e,t,a,o="data")=>{const r=a.map(w),s=I(t),l=e.map((d,c)=>c).sort((d,c)=>(s.get(t[d])??0)-(s.get(t[c])??0)),u=new Map;for(const d of l){const c=e[d],m=r[d];c===null||m===null||m===void 0||u.set(c,(u.get(c)??0)+m)}const v=new Map;let h=0;for(const[d,c]of G([...u],o)){const m=h;h+=c,v.set(d,{start:m,end:h})}const i=h;if(i===0)return r.map(()=>null);const g=r.map(()=>null),p=new Map;for(const d of l){const c=e[d],m=r[d],k=u.get(c),b=v.get(c);if(m==null||k===void 0||k===0||b===void 0)continue;const M=p.get(c)??0;p.set(c,M+m),g[d]={columnStart:b.start/i,columnEnd:b.end/i,cellStart:M/k,cellEnd:(M+m)/k,shareOfColumn:m/k,columnShare:k/i}}return g},I=e=>{const t=new Map;for(const a of e)t.has(a)||t.set(a,t.size);return t},G=(e,t)=>{if(t==="data")return e;if(t==="ascending")return[...e].sort(([,r],[,s])=>r-s);if(t==="descending")return[...e].sort(([,r],[,s])=>s-r);const a=I(t),o=r=>a.get(r)??a.size;return[...e].sort(([r],[s])=>o(r)-o(s))},y={shareOfColumn:"mekkoShareOfColumn",columnShare:"mekkoColumnShare"},j=["data","ascending","descending"],P=e=>j.includes(e)||Array.isArray(e)&&e.every(t=>typeof t=="string"||typeof t=="number"),D=e=>{const t=e?.sort;return P(t)?t:"data"},E=new Set(["value","columnShare"]),O="mekkoAmount",K=class extends n.Stat{constructor(...e){super(...e),this.type="mekko",this.computedVariables=E}computeStat({data:e,mapping:t,params:a}){const o=(0,n.readVariableName)(t.x),r=(0,n.readVariableName)(t.y);if(o===null||r===null||!e.hasVariable(o)||!e.hasVariable(r))return{data:e,mapping:{}};if(e.size()>0&&e.getType(r)!=="numeric"){const u=e.getType(r);throw new n.UserInputError({code:"INCOMPATIBLE_TYPE",message:`'mekko' stat requires a numeric 'y' (got '${u}' for variable '${r}')`,context:{aesthetic:"y",variableName:r,variableType:u},suggestion:"Map each cell's amount to 'y'."})}const s=(0,n.getGroupVariables)(e,t).filter(u=>u!==o),l=H(e,o,r,s);return{data:R(l,o,r,s,D(a)),mapping:{y:y.shareOfColumn,value:r,columnShare:y.columnShare}}}},H=(e,t,a,o)=>{const r=e.getValues(a,{type:"numeric"}).map(w);return e.addVariable(O,"numeric",r,e.getValueFormat(a)).groupBy(t,...o).rollup({[a]:{variableName:O,aggregation:"sum"}})},R=(e,t,a,o,r)=>{const s=o.map(i=>e.getValues(i)),l=Array.from({length:e.size()},(i,g)=>JSON.stringify(s.map(p=>p[g]))),u=B(e.getValues(t).map(X),l,e.getValues(a,{type:"numeric"}),r),v={type:"percentage"},h=i=>u.map(g=>g===null?null:i(g));return e.addVariable(y.shareOfColumn,"numeric",h(i=>i.shareOfColumn),v).addVariable(y.columnShare,"numeric",h(i=>i.columnShare),v).addVariable(n.POSITION_VARIABLES.xMin,"numeric",h(i=>i.columnStart)).addVariable(n.POSITION_VARIABLES.xMax,"numeric",h(i=>i.columnEnd)).addVariable(n.POSITION_VARIABLES.yMin,"numeric",h(i=>i.cellStart)).addVariable(n.POSITION_VARIABLES.yMax,"numeric",h(i=>i.cellEnd))},X=e=>e instanceof Date?e.getTime():e,_=(e,t)=>{const a=(0,n.composePoint)(t,{main:e.columnStart,cross:e.low}),o=(0,n.composePoint)(t,{main:e.columnEnd,cross:e.high}),[r,s]=T((0,n.toViewBoxX)(a.x),(0,n.toViewBoxX)(o.x)),[l,u]=T((0,n.toViewBoxY)(a.y),(0,n.toViewBoxY)(o.y));return{x:r,y:l,width:s-r,height:u-l}},L=(e,t,a)=>{const o=_(e,t);return{x:o.x*a.width,y:o.y*a.height,width:o.width*a.width,height:o.height*a.height}},T=(e,t)=>e<=t?[e,t]:[t,e],$=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{position:a,justify:o,align:r,offset:s}=e.layer.dataLabels,l=a==="auto",u=l?"inside":a,v=(0,n.readMainAxis)(e.coordSystem),h=(0,n.buildPanelAnchorBox)(e.panelRect);let i=0;for(const g of S(e.layer.data,v)){const p=e.formatLabel(g.observation);if(p==="")continue;const{width:d,height:c}=e.measureDataLabel("observation",u,p),m=(0,n.resolveAnchoredLabelCenter)({box:L(g,v,e.panelRect),panel:h,orientation:v==="x"?{valueAxis:"y",valueDirectionSign:-1}:{valueAxis:"x",valueDirectionSign:1},placement:u,justify:l?"center":o,align:l?"center":r,offset:s,labelWidth:d,labelHeight:c});if(l&&m.position!=="inside"){i+=1;continue}t.push({layerId:e.layer.id,x:m.x,y:m.y,text:p,width:d,height:c,isRotated:!1,role:"observation",position:m.position,backdropColor:m.position==="inside"?(0,n.readBackdropColor)(e.styleReaders,g.observation):void 0})}return{labels:t,droppedCount:i}},W=1,Y={strokeWidth:"pixels"},N=class extends n.Geom{constructor(...e){super(...e),this.type="mekko",this.defaultParams={},this.defaultStat=new K,this.positionRoles=[{axis:"x",role:"min",valueKind:"value"},{axis:"x",role:"max",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value",aes:"y"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"alpha"},{kind:"data",name:"value"},{kind:"data",name:"columnShare"}],this.derivedVariables=[y.shareOfColumn,y.columnShare],this.supportedPositions=["identity"],this.supportedCoordTypes=["cartesian","flip"],this.categorySpanAxes=["x"],this.grid={cartesian:{hideGridX:!0},flip:{hideGridX:!0}},this.legend={suppressWhenSingleItem:!0},this.dataLabelCoordTypes=["cartesian","flip"],this.getDataLabelPlacements=$,this.spatialKind="rects",this.highlightStrategy="observation-rerender",this.styleTarget=(0,n.defineGeomStyleTarget)({observation:{vocabulary:Y,aesthetics:{fill:"color",alpha:"alpha"},rest:{fill:(0,n.token)("geom"),fillAlpha:1,stroke:(0,n.token)("graphBackground"),strokeWidth:W}}}),this.validateMapping=({mapping:t,computedVariables:a})=>a.has("columnShare")?[...E].filter(o=>t[o]!==void 0).map(o=>({code:"CONFLICTING_STAT_MAPPING",message:`mekko stat computes '${o}' from 'x' and 'y'; remove its mapping`})):[{code:"MISSING_STAT_OUTPUT",message:"mekko geom lays its cells out in the 'mekko' stat; remove the layer's stat"}],this.resolveAnchorPosition=(t,{coordSystem:a})=>{const o=(0,n.readMainAxis)(a),r=V(t,o);if(r===null)return null;const s=(r.columnStart+r.columnEnd)/2,l=(r.low+r.high)/2;return o==="x"?{x:s,y:l}:{x:l,y:s}}}resolveParams(e){const{sort:t,...a}=super.resolveParams(e);return t===void 0||P(t)?t===void 0?a:{...a,sort:t}:(e.diagnostics?.addWarning({code:"INVALID_GEOM_PARAM",message:`Mekko sort must be 'data', 'ascending', 'descending' or a list of columns, got ${JSON.stringify(t)}; falling back to 'data'.`,context:{geom:"mekko",param:"sort",expected:"'data' | 'ascending' | 'descending' | columns[]"},suggestion:"Set params.sort to 'descending' to run the columns largest first, or list them in order."}),a)}compile({data:e}){return{data:e,mapping:{}}}},F=({layer:e,coordSystem:t,panelRect:a})=>{const o=(0,n.readMainAxis)(t);return S(e.data,o).map(r=>{const s=L(r,o,a),l=s.x+s.width,u=s.y+s.height;return{kind:"region",pathData:`M${s.x},${s.y}H${l}V${u}H${s.x}Z`}})},C=e=>{const t=(0,n.createStableKeyGenerator)(e.data,e.mapping,e.id);return a=>t(a.observation)},A=({cells:e,mainAxis:t,styleReaders:a,getKey:o,isHovered:r=!1,shouldAnimateTransitions:s=!1})=>{const l=r?"hovered":void 0,u=(0,x.useMemo)(()=>e.map(i=>a.get("fill",i.observation,l)??"transparent"),[e,a,l]),{fillFor:v,defs:h}=(0,n.usePaintDefs)({paints:u});return(0,f.jsxs)(f.Fragment,{children:[h,e.map((i,g)=>{const p=_(i,t),d=u[g],c=a.get("stroke",i.observation,l);return(0,f.jsx)(n.GeomRect,{"data-testid":"mekko-cell",x:(0,n.toPercent)(p.x),y:(0,n.toPercent)(p.y),width:(0,n.toPercent)(p.width),height:(0,n.toPercent)(p.height),fill:d===void 0?void 0:v(d),opacity:a.get("alpha",i.observation,l),fillOpacity:a.get("fillAlpha",i.observation,l),stroke:c===void 0?void 0:(0,n.toPaintColor)(c),strokeWidth:a.get("strokeWidth",i.observation,l),cornerRadius:a.get("cornerRadius",i.observation,l),effects:(0,n.readGeomEffects)(a,i.observation,l),shouldAnimateTransitions:s},o(i))})]})},U=({layer:e,sourceLayer:t,mainAxis:a,styleReaders:o})=>(0,f.jsx)(A,{cells:(0,x.useMemo)(()=>S(e.data,a),[e.data,a]),mainAxis:a,styleReaders:o,getKey:(0,x.useMemo)(()=>C(t),[t])}),q=({layer:e,primary:t,mainAxis:a,styleReaders:o})=>(0,f.jsx)("g",{"data-testid":"hovered-cells",children:(0,f.jsx)(A,{cells:S([t.observation],a),mainAxis:a,styleReaders:o,getKey:(0,x.useMemo)(()=>C(e),[e]),isHovered:!0})}),z=({layer:e,mainAxis:t,styleReaders:a,shouldAnimateTransitions:o,intro:r})=>{const s=(0,f.jsx)(A,{cells:(0,x.useMemo)(()=>S(e.data,t),[e.data,t]),mainAxis:t,styleReaders:a,getKey:(0,x.useMemo)(()=>C(e),[e]),shouldAnimateTransitions:o});return r==null?s:(0,f.jsx)(n.IntroFade,{intro:{type:"fade",layerId:r.layerId,durationSeconds:r.durationSeconds},children:s})},J=(0,n.defineGeomRenderer)(new N,{coord:"cartesian",swatchShape:"square",render:({layer:e,coordSystem:t,styleReaders:a,shouldAnimateTransitions:o,intro:r})=>(0,f.jsx)(z,{layer:e,mainAxis:(0,n.readMainAxis)(t),styleReaders:a,shouldAnimateTransitions:o,intro:r}),renderHighlight:({layer:e,sourceLayer:t,coordSystem:a,styleReaders:o})=>(0,f.jsx)(U,{layer:e,sourceLayer:t,mainAxis:(0,n.readMainAxis)(a),styleReaders:o}),renderHover:({layer:e,primary:t,coordSystem:a,styleReaders:o})=>(0,f.jsx)(q,{layer:e,primary:t,mainAxis:(0,n.readMainAxis)(a),styleReaders:o}),renderHoverCompanions:()=>null,getEditOutlineShapes:F});exports.MekkoGeom=N;exports.mekko=J;
package/dist/index.mjs CHANGED
@@ -1,31 +1,31 @@
1
- import { Geom as X, GeomRect as Y, IntroFade as j, POSITION_VARIABLES as b, Stat as z, UserInputError as q, buildPanelAnchorBox as J, composePoint as O, createStableKeyGenerator as Z, defineGeomRenderer as Q, defineGeomStyleTarget as ee, getGroupVariables as te, getXMax as V, getXMin as E, getYMax as P, getYMin as I, readBackdropColor as re, readMainAxis as k, readVariableName as L, resolveAnchoredLabelCenter as ae, toPaintColor as oe, toPercent as C, toViewBoxX as _, toViewBoxY as N, token as B, usePaintDefs as ne } from "@graphysdk/react";
1
+ import { Geom as X, GeomRect as Y, IntroFade as j, POSITION_VARIABLES as x, Stat as z, UserInputError as q, buildPanelAnchorBox as J, composePoint as O, createStableKeyGenerator as Z, defineGeomRenderer as Q, defineGeomStyleTarget as ee, getGroupVariables as te, getXMax as V, getXMin as E, getYMax as P, getYMin as I, readBackdropColor as re, readGeomEffects as oe, readMainAxis as k, readVariableName as L, resolveAnchoredLabelCenter as ae, toPaintColor as ne, toPercent as C, toViewBoxX as _, toViewBoxY as N, token as G, usePaintDefs as se } from "@graphysdk/react";
2
2
  import { useMemo as y } from "react";
3
- import { Fragment as se, jsx as f, jsxs as ie } from "react/jsx-runtime";
3
+ import { Fragment as ie, jsx as f, jsxs as le } from "react/jsx-runtime";
4
4
  var K = (e, t) => {
5
- const r = t === "x" ? E(e) : I(e), o = t === "x" ? V(e) : P(e), a = t === "x" ? I(e) : E(e), n = t === "x" ? P(e) : V(e);
6
- return r === null || o === null || a === null || n === null ? null : {
5
+ const r = t === "x" ? E(e) : I(e), a = t === "x" ? V(e) : P(e), o = t === "x" ? I(e) : E(e), n = t === "x" ? P(e) : V(e);
6
+ return r === null || a === null || o === null || n === null ? null : {
7
7
  observation: e,
8
8
  columnStart: r,
9
- columnEnd: o,
10
- low: a,
9
+ columnEnd: a,
10
+ low: o,
11
11
  high: n
12
12
  };
13
- }, x = (e, t) => {
13
+ }, b = (e, t) => {
14
14
  const r = [];
15
- for (const o of e) {
16
- const a = K(o, t);
17
- a !== null && r.push(a);
15
+ for (const a of e) {
16
+ const o = K(a, t);
17
+ o !== null && r.push(o);
18
18
  }
19
19
  return r;
20
- }, H = (e) => e === null || !Number.isFinite(e) || e <= 0 ? null : e, le = (e, t, r, o = "data") => {
21
- const a = r.map(H), n = $(t), i = e.map((c, u) => u).sort((c, u) => (n.get(t[c]) ?? 0) - (n.get(t[u]) ?? 0)), l = /* @__PURE__ */ new Map();
20
+ }, H = (e) => e === null || !Number.isFinite(e) || e <= 0 ? null : e, ue = (e, t, r, a = "data") => {
21
+ const o = r.map(H), n = $(t), i = e.map((c, u) => u).sort((c, u) => (n.get(t[c]) ?? 0) - (n.get(t[u]) ?? 0)), l = /* @__PURE__ */ new Map();
22
22
  for (const c of i) {
23
- const u = e[c], d = a[c];
23
+ const u = e[c], d = o[c];
24
24
  u === null || d === null || d === void 0 || l.set(u, (l.get(u) ?? 0) + d);
25
25
  }
26
26
  const p = /* @__PURE__ */ new Map();
27
27
  let m = 0;
28
- for (const [c, u] of ue([...l], o)) {
28
+ for (const [c, u] of ce([...l], a)) {
29
29
  const d = m;
30
30
  m += u, p.set(c, {
31
31
  start: d,
@@ -33,10 +33,10 @@ var K = (e, t) => {
33
33
  });
34
34
  }
35
35
  const s = m;
36
- if (s === 0) return a.map(() => null);
37
- const h = a.map(() => null), g = /* @__PURE__ */ new Map();
36
+ if (s === 0) return o.map(() => null);
37
+ const h = o.map(() => null), g = /* @__PURE__ */ new Map();
38
38
  for (const c of i) {
39
- const u = e[c], d = a[c], v = l.get(u), M = p.get(u);
39
+ const u = e[c], d = o[c], v = l.get(u), M = p.get(u);
40
40
  if (d == null || v === void 0 || v === 0 || M === void 0) continue;
41
41
  const T = g.get(u) ?? 0;
42
42
  g.set(u, T + d), h[c] = {
@@ -53,95 +53,95 @@ var K = (e, t) => {
53
53
  const t = /* @__PURE__ */ new Map();
54
54
  for (const r of e) t.has(r) || t.set(r, t.size);
55
55
  return t;
56
- }, ue = (e, t) => {
56
+ }, ce = (e, t) => {
57
57
  if (t === "data") return e;
58
- if (t === "ascending") return [...e].sort(([, a], [, n]) => a - n);
59
- if (t === "descending") return [...e].sort(([, a], [, n]) => n - a);
60
- const r = $(t), o = (a) => r.get(a) ?? r.size;
61
- return [...e].sort(([a], [n]) => o(a) - o(n));
58
+ if (t === "ascending") return [...e].sort(([, o], [, n]) => o - n);
59
+ if (t === "descending") return [...e].sort(([, o], [, n]) => n - o);
60
+ const r = $(t), a = (o) => r.get(o) ?? r.size;
61
+ return [...e].sort(([o], [n]) => a(o) - a(n));
62
62
  }, S = {
63
63
  shareOfColumn: "mekkoShareOfColumn",
64
64
  columnShare: "mekkoColumnShare"
65
- }, ce = [
65
+ }, de = [
66
66
  "data",
67
67
  "ascending",
68
68
  "descending"
69
- ], W = (e) => ce.includes(e) || Array.isArray(e) && e.every((t) => typeof t == "string" || typeof t == "number"), de = (e) => {
69
+ ], W = (e) => de.includes(e) || Array.isArray(e) && e.every((t) => typeof t == "string" || typeof t == "number"), me = (e) => {
70
70
  const t = e?.sort;
71
71
  return W(t) ? t : "data";
72
- }, F = /* @__PURE__ */ new Set(["value", "columnShare"]), D = "mekkoAmount", me = class extends z {
72
+ }, F = /* @__PURE__ */ new Set(["value", "columnShare"]), B = "mekkoAmount", he = class extends z {
73
73
  constructor(...e) {
74
74
  super(...e), this.type = "mekko", this.computedVariables = F;
75
75
  }
76
76
  computeStat({ data: e, mapping: t, params: r }) {
77
- const o = L(t.x), a = L(t.y);
78
- if (o === null || a === null || !e.hasVariable(o) || !e.hasVariable(a)) return {
77
+ const a = L(t.x), o = L(t.y);
78
+ if (a === null || o === null || !e.hasVariable(a) || !e.hasVariable(o)) return {
79
79
  data: e,
80
80
  mapping: {}
81
81
  };
82
- if (e.size() > 0 && e.getType(a) !== "numeric") {
83
- const l = e.getType(a);
82
+ if (e.size() > 0 && e.getType(o) !== "numeric") {
83
+ const l = e.getType(o);
84
84
  throw new q({
85
85
  code: "INCOMPATIBLE_TYPE",
86
- message: `'mekko' stat requires a numeric 'y' (got '${l}' for variable '${a}')`,
86
+ message: `'mekko' stat requires a numeric 'y' (got '${l}' for variable '${o}')`,
87
87
  context: {
88
88
  aesthetic: "y",
89
- variableName: a,
89
+ variableName: o,
90
90
  variableType: l
91
91
  },
92
92
  suggestion: "Map each cell's amount to 'y'."
93
93
  });
94
94
  }
95
- const n = te(e, t).filter((l) => l !== o), i = he(e, o, a, n);
95
+ const n = te(e, t).filter((l) => l !== a), i = ge(e, a, o, n);
96
96
  return {
97
- data: ge(i, o, a, n, de(r)),
97
+ data: pe(i, a, o, n, me(r)),
98
98
  mapping: {
99
99
  y: S.shareOfColumn,
100
- value: a,
100
+ value: o,
101
101
  columnShare: S.columnShare
102
102
  }
103
103
  };
104
104
  }
105
- }, he = (e, t, r, o) => {
106
- const a = e.getValues(r, { type: "numeric" }).map(H);
107
- return e.addVariable(D, "numeric", a, e.getValueFormat(r)).groupBy(t, ...o).rollup({ [r]: {
108
- variableName: D,
105
+ }, ge = (e, t, r, a) => {
106
+ const o = e.getValues(r, { type: "numeric" }).map(H);
107
+ return e.addVariable(B, "numeric", o, e.getValueFormat(r)).groupBy(t, ...a).rollup({ [r]: {
108
+ variableName: B,
109
109
  aggregation: "sum"
110
110
  } });
111
- }, ge = (e, t, r, o, a) => {
112
- const n = o.map((s) => e.getValues(s)), i = Array.from({ length: e.size() }, (s, h) => JSON.stringify(n.map((g) => g[h]))), l = le(e.getValues(t).map(pe), i, e.getValues(r, { type: "numeric" }), a), p = { type: "percentage" }, m = (s) => l.map((h) => h === null ? null : s(h));
113
- return e.addVariable(S.shareOfColumn, "numeric", m((s) => s.shareOfColumn), p).addVariable(S.columnShare, "numeric", m((s) => s.columnShare), p).addVariable(b.xMin, "numeric", m((s) => s.columnStart)).addVariable(b.xMax, "numeric", m((s) => s.columnEnd)).addVariable(b.yMin, "numeric", m((s) => s.cellStart)).addVariable(b.yMax, "numeric", m((s) => s.cellEnd));
114
- }, pe = (e) => e instanceof Date ? e.getTime() : e, R = (e, t) => {
111
+ }, pe = (e, t, r, a, o) => {
112
+ const n = a.map((s) => e.getValues(s)), i = Array.from({ length: e.size() }, (s, h) => JSON.stringify(n.map((g) => g[h]))), l = ue(e.getValues(t).map(fe), i, e.getValues(r, { type: "numeric" }), o), p = { type: "percentage" }, m = (s) => l.map((h) => h === null ? null : s(h));
113
+ return e.addVariable(S.shareOfColumn, "numeric", m((s) => s.shareOfColumn), p).addVariable(S.columnShare, "numeric", m((s) => s.columnShare), p).addVariable(x.xMin, "numeric", m((s) => s.columnStart)).addVariable(x.xMax, "numeric", m((s) => s.columnEnd)).addVariable(x.yMin, "numeric", m((s) => s.cellStart)).addVariable(x.yMax, "numeric", m((s) => s.cellEnd));
114
+ }, fe = (e) => e instanceof Date ? e.getTime() : e, R = (e, t) => {
115
115
  const r = O(t, {
116
116
  main: e.columnStart,
117
117
  cross: e.low
118
- }), o = O(t, {
118
+ }), a = O(t, {
119
119
  main: e.columnEnd,
120
120
  cross: e.high
121
- }), [a, n] = G(_(r.x), _(o.x)), [i, l] = G(N(r.y), N(o.y));
121
+ }), [o, n] = D(_(r.x), _(a.x)), [i, l] = D(N(r.y), N(a.y));
122
122
  return {
123
- x: a,
123
+ x: o,
124
124
  y: i,
125
- width: n - a,
125
+ width: n - o,
126
126
  height: l - i
127
127
  };
128
128
  }, U = (e, t, r) => {
129
- const o = R(e, t);
129
+ const a = R(e, t);
130
130
  return {
131
- x: o.x * r.width,
132
- y: o.y * r.height,
133
- width: o.width * r.width,
134
- height: o.height * r.height
131
+ x: a.x * r.width,
132
+ y: a.y * r.height,
133
+ width: a.width * r.width,
134
+ height: a.height * r.height
135
135
  };
136
- }, G = (e, t) => e <= t ? [e, t] : [t, e], fe = (e) => {
136
+ }, D = (e, t) => e <= t ? [e, t] : [t, e], ve = (e) => {
137
137
  const t = [];
138
138
  if (!e.layer.dataLabels.showDataLabels) return {
139
139
  labels: t,
140
140
  droppedCount: 0
141
141
  };
142
- const { position: r, justify: o, align: a, offset: n } = e.layer.dataLabels, i = r === "auto", l = i ? "inside" : r, p = k(e.coordSystem), m = J(e.panelRect);
142
+ const { position: r, justify: a, align: o, offset: n } = e.layer.dataLabels, i = r === "auto", l = i ? "inside" : r, p = k(e.coordSystem), m = J(e.panelRect);
143
143
  let s = 0;
144
- for (const h of x(e.layer.data, p)) {
144
+ for (const h of b(e.layer.data, p)) {
145
145
  const g = e.formatLabel(h.observation);
146
146
  if (g === "") continue;
147
147
  const { width: c, height: u } = e.measureDataLabel("observation", l, g), d = ae({
@@ -155,8 +155,8 @@ var K = (e, t) => {
155
155
  valueDirectionSign: 1
156
156
  },
157
157
  placement: l,
158
- justify: i ? "center" : o,
159
- align: i ? "center" : a,
158
+ justify: i ? "center" : a,
159
+ align: i ? "center" : o,
160
160
  offset: n,
161
161
  labelWidth: c,
162
162
  labelHeight: u
@@ -182,9 +182,9 @@ var K = (e, t) => {
182
182
  labels: t,
183
183
  droppedCount: s
184
184
  };
185
- }, ve = 1, ke = { strokeWidth: "pixels" }, ye = class extends X {
185
+ }, ke = 1, ye = { strokeWidth: "pixels" }, Se = class extends X {
186
186
  constructor(...e) {
187
- super(...e), this.type = "mekko", this.defaultParams = {}, this.defaultStat = new me(), this.positionRoles = [
187
+ super(...e), this.type = "mekko", this.defaultParams = {}, this.defaultStat = new he(), this.positionRoles = [
188
188
  {
189
189
  axis: "x",
190
190
  role: "min",
@@ -226,29 +226,29 @@ var K = (e, t) => {
226
226
  ], this.derivedVariables = [S.shareOfColumn, S.columnShare], this.supportedPositions = ["identity"], this.supportedCoordTypes = ["cartesian", "flip"], this.categorySpanAxes = ["x"], this.grid = {
227
227
  cartesian: { hideGridX: !0 },
228
228
  flip: { hideGridX: !0 }
229
- }, this.legend = { suppressWhenSingleItem: !0 }, this.dataLabelCoordTypes = ["cartesian", "flip"], this.getDataLabelPlacements = fe, this.spatialKind = "rects", this.highlightStrategy = "observation-rerender", this.styleTarget = ee({ observation: {
230
- vocabulary: ke,
229
+ }, this.legend = { suppressWhenSingleItem: !0 }, this.dataLabelCoordTypes = ["cartesian", "flip"], this.getDataLabelPlacements = ve, this.spatialKind = "rects", this.highlightStrategy = "observation-rerender", this.styleTarget = ee({ observation: {
230
+ vocabulary: ye,
231
231
  aesthetics: {
232
232
  fill: "color",
233
233
  alpha: "alpha"
234
234
  },
235
235
  rest: {
236
- fill: B("geom"),
236
+ fill: G("geom"),
237
237
  fillAlpha: 1,
238
- stroke: B("graphBackground"),
239
- strokeWidth: ve
238
+ stroke: G("graphBackground"),
239
+ strokeWidth: ke
240
240
  }
241
- } }), this.validateMapping = ({ mapping: t, computedVariables: r }) => r.has("columnShare") ? [...F].filter((o) => t[o] !== void 0).map((o) => ({
241
+ } }), this.validateMapping = ({ mapping: t, computedVariables: r }) => r.has("columnShare") ? [...F].filter((a) => t[a] !== void 0).map((a) => ({
242
242
  code: "CONFLICTING_STAT_MAPPING",
243
- message: `mekko stat computes '${o}' from 'x' and 'y'; remove its mapping`
243
+ message: `mekko stat computes '${a}' from 'x' and 'y'; remove its mapping`
244
244
  })) : [{
245
245
  code: "MISSING_STAT_OUTPUT",
246
246
  message: "mekko geom lays its cells out in the 'mekko' stat; remove the layer's stat"
247
247
  }], this.resolveAnchorPosition = (t, { coordSystem: r }) => {
248
- const o = k(r), a = K(t, o);
249
- if (a === null) return null;
250
- const n = (a.columnStart + a.columnEnd) / 2, i = (a.low + a.high) / 2;
251
- return o === "x" ? {
248
+ const a = k(r), o = K(t, a);
249
+ if (o === null) return null;
250
+ const n = (o.columnStart + o.columnEnd) / 2, i = (o.low + o.high) / 2;
251
+ return a === "x" ? {
252
252
  x: n,
253
253
  y: i
254
254
  } : {
@@ -279,10 +279,10 @@ var K = (e, t) => {
279
279
  mapping: {}
280
280
  };
281
281
  }
282
- }, Se = ({ layer: e, coordSystem: t, panelRect: r }) => {
283
- const o = k(t);
284
- return x(e.data, o).map((a) => {
285
- const n = U(a, o, r), i = n.x + n.width, l = n.y + n.height;
282
+ }, be = ({ layer: e, coordSystem: t, panelRect: r }) => {
283
+ const a = k(t);
284
+ return b(e.data, a).map((o) => {
285
+ const n = U(o, a, r), i = n.x + n.width, l = n.y + n.height;
286
286
  return {
287
287
  kind: "region",
288
288
  pathData: `M${n.x},${n.y}H${i}V${l}H${n.x}Z`
@@ -291,13 +291,13 @@ var K = (e, t) => {
291
291
  }, w = (e) => {
292
292
  const t = Z(e.data, e.mapping, e.id);
293
293
  return (r) => t(r.observation);
294
- }, A = ({ cells: e, mainAxis: t, styleReaders: r, getKey: o, isHovered: a = !1, shouldAnimateTransitions: n = !1 }) => {
295
- const i = a ? "hovered" : void 0, l = y(() => e.map((s) => r.get("fill", s.observation, i) ?? "transparent"), [
294
+ }, A = ({ cells: e, mainAxis: t, styleReaders: r, getKey: a, isHovered: o = !1, shouldAnimateTransitions: n = !1 }) => {
295
+ const i = o ? "hovered" : void 0, l = y(() => e.map((s) => r.get("fill", s.observation, i) ?? "transparent"), [
296
296
  e,
297
297
  r,
298
298
  i
299
- ]), { fillFor: p, defs: m } = ne({ paints: l });
300
- return /* @__PURE__ */ ie(se, { children: [m, e.map((s, h) => {
299
+ ]), { fillFor: p, defs: m } = se({ paints: l });
300
+ return /* @__PURE__ */ le(ie, { children: [m, e.map((s, h) => {
301
301
  const g = R(s, t), c = l[h], u = r.get("stroke", s.observation, i);
302
302
  return /* @__PURE__ */ f(Y, {
303
303
  "data-testid": "mekko-cell",
@@ -308,67 +308,69 @@ var K = (e, t) => {
308
308
  fill: c === void 0 ? void 0 : p(c),
309
309
  opacity: r.get("alpha", s.observation, i),
310
310
  fillOpacity: r.get("fillAlpha", s.observation, i),
311
- stroke: u === void 0 ? void 0 : oe(u),
311
+ stroke: u === void 0 ? void 0 : ne(u),
312
312
  strokeWidth: r.get("strokeWidth", s.observation, i),
313
+ cornerRadius: r.get("cornerRadius", s.observation, i),
314
+ effects: oe(r, s.observation, i),
313
315
  shouldAnimateTransitions: n
314
- }, o(s));
316
+ }, a(s));
315
317
  })] });
316
- }, xe = ({ layer: e, sourceLayer: t, mainAxis: r, styleReaders: o }) => /* @__PURE__ */ f(A, {
317
- cells: y(() => x(e.data, r), [e.data, r]),
318
+ }, xe = ({ layer: e, sourceLayer: t, mainAxis: r, styleReaders: a }) => /* @__PURE__ */ f(A, {
319
+ cells: y(() => b(e.data, r), [e.data, r]),
318
320
  mainAxis: r,
319
- styleReaders: o,
321
+ styleReaders: a,
320
322
  getKey: y(() => w(t), [t])
321
- }), be = ({ layer: e, primary: t, mainAxis: r, styleReaders: o }) => /* @__PURE__ */ f("g", {
323
+ }), Ce = ({ layer: e, primary: t, mainAxis: r, styleReaders: a }) => /* @__PURE__ */ f("g", {
322
324
  "data-testid": "hovered-cells",
323
325
  children: /* @__PURE__ */ f(A, {
324
- cells: x([t.observation], r),
326
+ cells: b([t.observation], r),
325
327
  mainAxis: r,
326
- styleReaders: o,
328
+ styleReaders: a,
327
329
  getKey: y(() => w(e), [e]),
328
330
  isHovered: !0
329
331
  })
330
- }), Ce = ({ layer: e, mainAxis: t, styleReaders: r, shouldAnimateTransitions: o, intro: a }) => {
332
+ }), Me = ({ layer: e, mainAxis: t, styleReaders: r, shouldAnimateTransitions: a, intro: o }) => {
331
333
  const n = /* @__PURE__ */ f(A, {
332
- cells: y(() => x(e.data, t), [e.data, t]),
334
+ cells: y(() => b(e.data, t), [e.data, t]),
333
335
  mainAxis: t,
334
336
  styleReaders: r,
335
337
  getKey: y(() => w(e), [e]),
336
- shouldAnimateTransitions: o
338
+ shouldAnimateTransitions: a
337
339
  });
338
- return a == null ? n : /* @__PURE__ */ f(j, {
340
+ return o == null ? n : /* @__PURE__ */ f(j, {
339
341
  intro: {
340
342
  type: "fade",
341
- layerId: a.layerId,
342
- durationSeconds: a.durationSeconds
343
+ layerId: o.layerId,
344
+ durationSeconds: o.durationSeconds
343
345
  },
344
346
  children: n
345
347
  });
346
- }, Ae = Q(new ye(), {
348
+ }, Oe = Q(new Se(), {
347
349
  coord: "cartesian",
348
350
  swatchShape: "square",
349
- render: ({ layer: e, coordSystem: t, styleReaders: r, shouldAnimateTransitions: o, intro: a }) => /* @__PURE__ */ f(Ce, {
351
+ render: ({ layer: e, coordSystem: t, styleReaders: r, shouldAnimateTransitions: a, intro: o }) => /* @__PURE__ */ f(Me, {
350
352
  layer: e,
351
353
  mainAxis: k(t),
352
354
  styleReaders: r,
353
- shouldAnimateTransitions: o,
354
- intro: a
355
+ shouldAnimateTransitions: a,
356
+ intro: o
355
357
  }),
356
- renderHighlight: ({ layer: e, sourceLayer: t, coordSystem: r, styleReaders: o }) => /* @__PURE__ */ f(xe, {
358
+ renderHighlight: ({ layer: e, sourceLayer: t, coordSystem: r, styleReaders: a }) => /* @__PURE__ */ f(xe, {
357
359
  layer: e,
358
360
  sourceLayer: t,
359
361
  mainAxis: k(r),
360
- styleReaders: o
362
+ styleReaders: a
361
363
  }),
362
- renderHover: ({ layer: e, primary: t, coordSystem: r, styleReaders: o }) => /* @__PURE__ */ f(be, {
364
+ renderHover: ({ layer: e, primary: t, coordSystem: r, styleReaders: a }) => /* @__PURE__ */ f(Ce, {
363
365
  layer: e,
364
366
  primary: t,
365
367
  mainAxis: k(r),
366
- styleReaders: o
368
+ styleReaders: a
367
369
  }),
368
370
  renderHoverCompanions: () => null,
369
- getEditOutlineShapes: Se
371
+ getEditOutlineShapes: be
370
372
  });
371
373
  export {
372
- ye as MekkoGeom,
373
- Ae as mekko
374
+ Se as MekkoGeom,
375
+ Oe as mekko
374
376
  };
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "marimekko",
15
15
  "mosaic"
16
16
  ],
17
- "version": "0.1.0",
17
+ "version": "0.1.1-beta.1792411689978",
18
18
  "type": "module",
19
19
  "sideEffects": false,
20
20
  "types": "./dist/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^19.0.0",
36
- "@graphysdk/react": "^1.9.0-beta.1791968387850"
36
+ "@graphysdk/react": "^1.9.0-beta.1792411689978"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@testing-library/react": "^16.3.1",
@@ -45,11 +45,11 @@
45
45
  "vite": "^8.1.5",
46
46
  "vite-plugin-dts": "^4.5.4",
47
47
  "vitest": "^4.1.11",
48
- "@graphysdk/react": "1.9.0-beta.1791968387850",
49
- "@graphysdk/viz-engine": "1.8.0",
50
48
  "@graphytools/typescript-config": "0.0.1",
51
49
  "@graphytools/eslint-config": "0.0.1",
52
- "@graphytools/vitest-config": "1.0.0"
50
+ "@graphytools/vitest-config": "1.0.0",
51
+ "@graphysdk/viz-engine": "1.9.0-beta.1792411689978",
52
+ "@graphysdk/react": "1.9.0-beta.1792411689978"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"