@graphysdk/viz-engine 1.9.0-beta.1794247167849 → 1.9.0-beta.1794301086730
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 +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Nl=Object.create,ua=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,Fl=Object.getOwnPropertyNames,Gl=Object.getPrototypeOf,Hl=Object.prototype.hasOwnProperty,$l=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=Fl(t),i=0,o=a.length,s;i<o;i++)s=a[i],!Hl.call(e,s)&&s!==r&&ua(e,s,{get:(c=>t[c]).bind(null,s),enumerable:!(n=Bl(t,s))||n.enumerable});return e},zl=(e,t,r)=>(r=e!=null?Nl(Gl(e)):{},$l(t||!e||!e.__esModule?ua(r,"default",{value:e,enumerable:!0}):r,e));const l=require("./spec-builder-CrOeFCZJ.cjs"),d=require("./compiler-GxysPEAo.cjs"),ne=require("./graph.constants-DGzvPldq.cjs");let Et=require("color2k"),I=require("lodash-es"),Rt=require("humanize-duration");Rt=zl(Rt,1);let P=require("d3-shape"),Kl=require("d3-delaunay");typeof window<"u"&&(window.__GRAPHY_SDK__??={},window.__GRAPHY_SDK__.vizEngine="1.9.0-beta.1794247167849");function q(e,t){return e.geom===t}var ht="…",da=(e,t,r)=>{if(t<=0||e.length===0)return"";if(r(e)<=t)return e;if(r(ht)>t)return"";let n=0,a=e.length-1,i=0;for(;n<=a;){const o=n+a>>>1;r(e.slice(0,o)+ht)<=t?(i=o,n=o+1):a=o-1}return e.slice(0,i)+ht};var C={timeZone:"UTC",calendar:"gregory"},R=e=>t=>{if(!l.isStrictTemporalDataValue(t))return"–";try{return e(t)}catch{return"n/a"}},K=e=>t=>l.isStrictNumericDataValue(t)?e(t):"–",Ut=e=>t=>l.isStrictCategoricalDataValue(t)?t:"–",Ae=new Map,Te=new Map,ma=256,Ul=new Set(["integer","group","decimal","fraction"]),ae=(e,t)=>{const r=pa(e,t),n=Ae.get(r);if(n!==void 0)return n;Ae.size>=ma&&Ae.clear();const a=new Intl.NumberFormat(Wt(e),t);return Ae.set(r,a),a},w=(e,t)=>{const r=pa(e,t),n=Te.get(r);if(n!==void 0)return n;Te.size>=ma&&Te.clear();const a=new Intl.DateTimeFormat(Wt(e),t);return Te.set(r,a),a},Yt=(e,t,r)=>{if(r==="")return e.format(t);const n=e.formatToParts(t),a=n.map(i=>Ul.has(i.type)).lastIndexOf(!0);return n.map((i,o)=>o===a?`${i.value}${r}`:i.value).join("")},ha=e=>{try{return Intl.NumberFormat.supportedLocalesOf(e.trim().replaceAll("_","-"))[0]}catch{return}},Wt=e=>ha(e)??"en-US",pa=(e,t)=>`${e}\0${JSON.stringify(t)}`,Yl=Rt.default.humanizer({language:"en",spacer:"",delimiter:" ",languages:{en:{y:()=>"y",mo:()=>"mo",w:()=>"w",d:()=>"d",h:()=>"h",m:()=>"m",s:()=>"s",ms:()=>"ms"}}}),Ke={signDisplay:"negative"},fa=({valueFormat:e,locale:t,numberFormat:r,intlOptions:n})=>K(a=>{const i=typeof r.decimals=="number"?r.decimals:2,o=Xt(a,i),{base:s,suffix:c}=Ue(a,r.abbreviation);return Yt(ae(t,{...o,...Ke,...l.isCurrencyValueFormat(e)?{style:"currency",currencyDisplay:"narrowSymbol",currency:e.iso}:{},...n}),s,c)}),va=({locale:e,numberFormat:t,intlOptions:r})=>K(n=>{const{base:a,suffix:i}=Ue(n,t.abbreviation);return Yt(ae(e,{...Xt(a,t.decimals),...Ke,...r}),a,i)}),qt=e=>K(t=>{const r=Yl(Math.abs(t));return t<0?`-${r}`:r}),ga=({locale:e,intlOptions:t})=>{const r=ae(e,{maximumFractionDigits:0,...Ke,...t});return K(n=>r.format(n))},ya=({locale:e,numberFormat:t,intlOptions:r})=>K(n=>ae(e,{...Xt(n,t.decimals),...Ke,...r,style:"percent"}).format(n)),Ue=(e,t="none")=>{switch(t){case"none":return{base:e,suffix:""};case"auto":{const r=Wl(e);return Ue(e,r)}default:return{base:e/l.SUFFIX_MULTIPLIERS[t],suffix:t}}},Xt=(e,t)=>{if(typeof t=="number")return{minimumFractionDigits:t,maximumFractionDigits:t};const r=Math.ceil(Math.log10(Math.abs(e))),n=r>=3?0:r===2?1:2;return{minimumFractionDigits:t==="auto"?0:n,maximumFractionDigits:n}},Wl=e=>{const t=Math.abs(e);return t>=l.SUFFIX_MULTIPLIERS.b?"b":t>=l.SUFFIX_MULTIPLIERS.m?"m":t>=l.SUFFIX_MULTIPLIERS.k?"k":"none"},ql=1440*60*1e3,Xl=({locale:e,intlOptions:t})=>{const r=w(e,{dateStyle:"medium",...C,...t});return R(n=>r.format(n))},jl=({locale:e,intlOptions:t})=>{const r=w(e,{dateStyle:"medium",timeStyle:"medium",...C,...t});return R(n=>Zl(r.formatToParts(n)))},Sa=({locale:e,intlOptions:t})=>{const r=w(e,{day:"numeric",month:"long",...C,...t});return R(n=>r.format(n))},ba=({locale:e,intlOptions:t})=>{const r=w(e,{month:"long",...C,...t});return R(n=>r.format(n))},jt=({locale:e,intlOptions:t})=>{const r=w(e,{month:"short",year:"numeric",...C,...t});return R(n=>r.format(n))},Zt=e=>R(t=>`Q${Math.floor(t.getUTCMonth()/3)+1} ${t.getUTCFullYear()}`),xa=({locale:e,intlOptions:t})=>{const r=w(e,{day:"numeric",month:"long",...C,...t,year:void 0});return R(n=>r.formatRange(n,Ia(n,6)))},Aa=({locale:e,intlOptions:t})=>{const r=w(e,{dateStyle:"medium",...C,...t});return R(n=>r.formatRange(n,Ia(n,6)))},Jt=({locale:e,intlOptions:t})=>{const r=w(e,{year:"numeric",...C,...t});return R(n=>r.format(n))},Ta=({locale:e,intlOptions:t})=>{const r=w(e,{timeStyle:"short",...C,...t});return R(n=>r.format(n))},Ia=(e,t)=>new Date(e.getTime()+t*ql),Zl=e=>{const t=e.findIndex(n=>n.type==="hour")-1,r=e[t];return e.map((n,a)=>a===t&&r?.type==="literal"&&r.value===", "?" • ":n.value).join("")},Gr=1e3,Jl=({valueFormat:e,locale:t,tickValues:r,intlOptions:n})=>K(a=>{const i={...er(a,r),...l.isCurrencyValueFormat(e)?{style:"currency",currencyDisplay:"narrowSymbol",currency:e.iso}:{},...n};return Qt(a,t,i)}),Ql=({locale:e,tickValues:t,intlOptions:r})=>K(n=>{const a={...er(n,t),...r};return Qt(n,e,a)}),ec=({locale:e,tickValues:t,intlOptions:r})=>K(n=>{const a={...er(n,t),...r,style:"percent"};return Qt(n,e,a)}),Qt=(e,t,r)=>{const{base:n,suffix:a}=Ue(e,tc(e,r));return Yt(ae(t,r),n,a)},tc=(e,t)=>{const r=ae("en-US",{...t,notation:"compact"}).formatToParts(e).find(n=>n.type==="compact")?.value.toLowerCase();return l.SUFFIXES.find(n=>n===r)??"none"},La=e=>Math.abs(e)>Gr?La(e/Gr):Number.isInteger(e),rc=e=>{if(e.length<2)return!1;const[t,r]=e;return typeof t!="number"||typeof r!="number"?!1:Math.abs(r-t)<1},er=(e,t)=>La(e)?{minimumFractionDigits:0,maximumFractionDigits:0}:rc(t)?{minimumFractionDigits:0,maximumFractionDigits:4}:{minimumFractionDigits:0,maximumFractionDigits:Math.max(1,nc(t))},nc=e=>{const t=e.filter(u=>typeof u=="number"&&Number.isFinite(u)),r=t[0],n=t[1];if(r===void 0||n===void 0)return 0;const a=Math.abs(n-r);if(a===0)return 0;let i=0;for(const u of t)i=Math.max(i,Math.abs(u));if(i===0)return 0;const o=Math.floor(Math.log10(i)/3),s=a/10**(Math.max(0,o)*3);if(s>=1)return 0;const c=Math.ceil(-Math.log10(s)-1e-9);return Math.min(4,Math.max(0,c))},ac=({locale:e,intlOptions:t})=>{const r=w(e,{day:"numeric",month:"short",...C,...t});return R(n=>r.format(n))},ic=({locale:e,intlOptions:t})=>{const r=w(e,{month:"short",...C,...t});return R(n=>r.format(n))},oc=({locale:e,intlOptions:t})=>{const r=w(e,{day:"numeric",month:"short",...C,...t});return R(n=>r.format(n))},sc=({locale:e,intlOptions:t,tickValues:r})=>{const n=w(e,{...cc(r),...C,...t});return R(a=>n.format(a))},lc=({locale:e,intlOptions:t})=>{const r=w(e,{timeStyle:"short",...C,...t});return R(n=>r.format(n))},cc=e=>{const t=e.filter(r=>r instanceof Date&&!Number.isNaN(r.getTime()));return t.length===0?{day:"numeric",month:"short"}:uc(t).size>1?{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}:{timeStyle:"short"}},uc=e=>{const t=new Set;for(const r of e)t.add(`${r.getUTCFullYear()}-${r.getUTCMonth()}-${r.getUTCDate()}`);return t},tr=e=>{const{valueFormat:t}=e;switch(t.type){case"currency":return Jl(e);case"date":return ac(e);case"datetime":return sc(e);case"dayMonth":case"weeklyDateRange":case"weeklyDateRangeWithYear":return oc(e);case"decimal":case"integer":return Ql(e);case"duration":return qt(e);case"month":return ic(e);case"monthYear":return jt(e);case"percentage":return ec(e);case"quarter":return Zt(e);case"text":return Ut(e);case"time":return lc(e);case"year":return Jt(e);case"lookup":return tr({...e,valueFormat:t.fallback});default:throw new l.InternalError({message:`Unhandled value format: ${t.type}`})}},dc=.9,mc=1/3,hc=1/4,pc=e=>e.formattedAxis.position==="top"||e.formattedAxis.position==="bottom"?fc(e):vc(e),fc=({formattedAxis:e,bandwidthPx:t,panelRect:r,measureLabel:n})=>{const{widths:a,maxWidth:i,maxHeight:o}=Ea(e.ticks,n),s=gc(e.ticks,r.width),c=s*dc;if(i<=c)return{...e,labelRotation:0,labelMaxWidthPx:null};if(s>=50){const m=wt(c);return{...e,ticks:Ct(e.ticks,a,m,n),labelRotation:0,labelMaxWidthPx:m}}if(o+8>t)return{...e,ticks:[],labelRotation:0,labelMaxWidthPx:null};const u=wt(r.height*mc);return{...e,ticks:Ct(e.ticks,a,u,n),labelRotation:-90,labelMaxWidthPx:u}},vc=({formattedAxis:e,bandwidthPx:t,panelRect:r,measureLabel:n})=>{const{widths:a,maxWidth:i,maxHeight:o}=Ea(e.ticks,n);if(o>t)return{...e,ticks:[],labelRotation:0,labelMaxWidthPx:null};const s=wt(r.width*hc);return i<=s?{...e,labelRotation:0,labelMaxWidthPx:null}:{...e,ticks:Ct(e.ticks,a,s,n),labelRotation:0,labelMaxWidthPx:s}},gc=(e,t)=>{const r=e[0],n=e[1];return r===void 0||n===void 0?t:Math.abs(n.position-r.position)*t},Ea=(e,t)=>{const r=[];let n=0,a=0;for(const i of e){const{width:o,height:s}=t(i.formattedLabel);r.push(o),o>n&&(n=o),s>a&&(a=s)}return{widths:r,maxWidth:n,maxHeight:a}},Ct=(e,t,r,n)=>{const a=i=>n(i).width;return e.map((i,o)=>(t[o]??0)<=r?i:{...i,formattedLabel:da(i.formattedLabel,r,a)})},wt=e=>Math.max(0,Math.floor(e)),yc=(e,t,r,n,a)=>{if(e===0)return!0;const i=r==="top"||r==="bottom",o=i?60:40;let s=n-(e-1)*o;for(let c=0;c<e;c+=1){const{width:u,height:m}=a(t(c));if(s-=i?u:m,s<0)return!1}return!0},Sc=(e,t,r,n,a)=>{if(e.length<2)return!0;const i=r==="top"||r==="bottom",o=c=>{const{width:u,height:m}=a(t(c));return(i?u:m)/2};let s=o(0);for(let c=1;c<e.length;c+=1){const u=e[c-1],m=e[c];if(u===void 0||m===void 0)continue;const h=o(c);if((m.position-u.position)*n<s+h+8)return!1;s=h}return!0},bc={ticks:[],labelAt:()=>""},xc=({axis:e,availableSpacePx:t,measureLabel:r,resolveFormatter:n})=>{const{tickCandidates:a,position:i}=e;if(a.length===0)return[];const o=new Map,s=f=>{const v=o.get(f);if(v)return v;const g=a[f],b=g?Tc(g.ticks,n(g)):bc;return o.set(f,b),b},c=f=>{const{ticks:v,labelAt:g}=s(f);return a[f]?.source==="generated"?yc(v.length,g,i,t,r):Sc(v,g,i,t,r)};let u=0,m=a.length-1,h=-1;for(;u<=m;){const f=u+m>>>1;c(f)?(h=f,u=f+1):m=f-1}const p=Ac(h,s);return Ic(s(p))},Ac=(e,t)=>{const r=e>=0?e:0;for(let n=r;n>=0;n-=1){const{ticks:a,labelAt:i}=t(n);if(Lc(a,i))return n}return 0},Tc=(e,t)=>{const r=new Array(e.length);return{ticks:e,labelAt:n=>{const a=r[n];if(a!==void 0)return a;const i=t(e[n]?.value??null);return r[n]=i,i}}},Ic=({ticks:e,labelAt:t})=>e.map((r,n)=>({...r,formattedLabel:t(n)})),Lc=(e,t)=>{const r=new Set;for(let n=0;n<e.length;n+=1){const a=t(n);if(r.has(a))return!1;r.add(a)}return!0};function rr(e,t){return e.axes.find(r=>r.scaledAesthetic===t)??null}function nr(e,t){return e.categorySpan?.layerIds.includes(t)?e.categorySpan.valueFormat:e.valueFormat}function Ec(e,t){return e.legends.drawn.find(r=>r.aesthetics.includes(t))??null}var Rc=e=>{const t=L({...e,valueFormat:e.valueFormat.fallback}),r={};for(const[a,i]of Object.entries(e.valueFormat.cases))r[a]=L({...e,valueFormat:i});const n=e.valueFormat.byVariable;return(a,i)=>{if(i===void 0||i[n]===void 0)return t(a);const o=l.getStableKey(i[n]),s=r[o];return s!==void 0?s(a,i):t(a)}},L=e=>{switch(e.valueFormat.type){case"currency":return fa(e);case"date":return Xl(e);case"datetime":return jl(e);case"dayMonth":return Sa(e);case"decimal":return va(e);case"duration":return qt(e);case"integer":return ga(e);case"month":return ba(e);case"monthYear":return jt(e);case"percentage":return ya(e);case"quarter":return Zt(e);case"text":return Ut(e);case"weeklyDateRange":return xa(e);case"weeklyDateRangeWithYear":return Aa(e);case"year":return Jt(e);case"time":return Ta(e);case"lookup":return Rc({...e,valueFormat:e.valueFormat});default:{const t=e.valueFormat;throw new l.InternalError({message:`Unhandled value format: ${t.type}`})}}};function ar({layer:e,numberFormat:t,locale:r}){return L({valueFormat:d.getLayerYValueFormat(e),locale:r,numberFormat:t})}var Cc=(e,t)=>{const r=l.readVariableName(t.x);return r!==null&&r!==l.CONSTANT_VARIABLES.x?{read:d.createXValueReader(e,t),variable:r}:{read:d.getGroup,variable:l.GROUP_VARIABLES.group}},Ra=({layer:e,coordSystem:t,axes:r,numberFormat:n,panelRect:a,measureDataLabel:i,readers:o,formattingLocale:s,percentageValueStrategy:c})=>{const u=ar({layer:e,numberFormat:n,locale:s}),m=t.type==="cartesian"&&t.mainAxis==="y";return{layer:e,coordSystem:t,panelRect:a,measureDataLabel:i,styleReaders:o.geom(e),formatLabel:Dc({layer:e,numberFormat:n,axes:r,locale:s,absoluteFormatter:u,percentageValueStrategy:c,flipped:m}),formatAbsolute:u,formatCategory:wc({layer:e,numberFormat:n,locale:s})}},wc=({layer:e,numberFormat:t,locale:r})=>{const{read:n,variable:a}=Cc(e.data,e.mapping),i=L({valueFormat:e.data.hasVariable(a)?e.data.getValueFormat(a):{type:"text"},locale:r,numberFormat:t});return o=>{const s=n(o);return s===null?null:i(s,o)}},Pc=(e,t,r)=>{switch(t){case"stack":return Mc(e);case"fill":return Oc(e,r);case"absoluteGrandTotal":return()=>e.summary.absoluteGrandTotal??null;case"none":return()=>null}},Mc=e=>{const t=l.readVariableName(e.mapping.x);let r=null,n=!1;return a=>{const i=e.summary.stackTotals;if(i===void 0||i.length===0||t===null)return null;if(!n){r=new Map;for(const c of i)r.set(c.xKey,c);n=!0}const o=a[t];if(o==null)return null;const s=r?.get(d.getObservationXKey(a,t));return s===void 0?null:s.total}},Oc=(e,t)=>{const r=t?l.getXMin:l.getYMin,n=t?l.getXMax:l.getYMax,a=d.createSegmentYReader(e);return i=>{const o=r(i),s=n(i);if(!l.isStrictNumericDataValue(o)||!l.isStrictNumericDataValue(s))return null;const c=s-o;if(c===0)return null;const u=a(i);return l.isStrictNumericDataValue(u)?u/c:null}},Dc=({layer:e,numberFormat:t,axes:r,locale:n,absoluteFormatter:a,percentageValueStrategy:i,flipped:o})=>{const s=d.createRawValueReader(e.data,e.dataLabels.labelSource),c=Pc(e,i,o),u=_c({layer:e,numberFormat:t,axes:r,locale:n,absoluteFormatter:a}),m=L({valueFormat:{type:"percentage"},locale:n,numberFormat:t}),h=e.dataLabels.format==="percentage"&&Ca(e);return p=>{const f=s(p);if(f===null)return"";if(!h||!l.isStrictNumericDataValue(f))return u(f,p);const v=c(p);return v===null||v===0?u(f,p):m(f/v)}},_c=({layer:e,numberFormat:t,axes:r,locale:n,absoluteFormatter:a})=>{const i=e.dataLabels.labelSource,o=l.readVariableName(i);if(o!==null){if(Ca(e))return a;const s=kc(e,r,t,n,o);if(s!==null)return s}return L({valueFormat:Vc(e.data,i),locale:n,numberFormat:t})},Ca=e=>{const t=l.readVariableName(e.dataLabels.labelSource);return t===null?!1:t===l.readVariableName(d.resolveSegmentYSource(e.position,e.mapping))},kc=(e,t,r,n,a)=>{const i=l.readVariableName(e.mapping.x);if(i===null||i!==a)return null;const o=t.find(s=>s.scaledAesthetic==="x");return o===void 0?null:L({valueFormat:nr(o,e.id),locale:n,numberFormat:r})},Vc=(e,t)=>{const r=l.readConstantValue(t);if(r!==void 0)return l.isNumericDataValue(r)?{type:"decimal"}:l.isTemporalDataValue(r)?{type:"date"}:{type:"text"};const n=l.readVariableName(t);return n===null||!e.hasVariable(n)?{type:"text"}:e.getValueFormat(n)},Nc={cartesian:["cartesian","flip"],polar:["polar"]},Bc=null;function wa(e=[]){const t=Fc(e),r=(n,a)=>{if(!t.has(n))return null;const i=t.get(n);return i.getDataLabelPlacements===void 0||!Nc[a].some(o=>i.dataLabelCoordTypes.includes(o))?null:{place:i.getDataLabelPlacements.bind(i),getPercentageValueStrategy:o=>i.resolvePercentageValueStrategy?.(o,a)??"none"}};return{resolve:r,hasCapability:(n,a)=>r(n,a)!==null,hasPercentageFormat:(n,a)=>(r(n.geom,a)?.getPercentageValueStrategy(n)??"none")!=="none"}}function ir(){return Bc??=wa()}function Fc(e){const t=new l.GeomRegistry;for(const r of e){const n=l.resolveDefinition(r);n instanceof l.Geom&&t.register(n.type,n)}return t}function*Gc({layers:e,coordSystem:t,axes:r,numberFormat:n,panelRect:a,measureDataLabel:i,readers:o,locale:s,resolvePlacement:c=ir()}){if(!(t.type!=="cartesian"||a.width<=0||a.height<=0))for(const u of e){if(!u.dataLabels.showDataLabels&&!u.dataLabels.showStackTotals)continue;const m=c.resolve(u.geom,"cartesian");if(m===null)continue;const h=Ra({layer:u,coordSystem:t,axes:r,numberFormat:n,panelRect:a,measureDataLabel:i,readers:o,formattingLocale:s,percentageValueStrategy:m.getPercentageValueStrategy(u)});for(const p of m.place(h).labels)yield{x:a.x+p.x-p.width/2,y:a.y+p.y-p.height/2,width:p.width,height:p.height}}}var pt={abbreviation:"none",decimals:"auto"},Pa=({locale:e,kind:t,startValue:r,endValue:n,valueFormat:a})=>{if(r===null||n===null)return"n/a";switch(t){case"absoluteDifference":{const i=n-r,o=L({valueFormat:a,locale:e,numberFormat:pt,intlOptions:{signDisplay:"always"}})(i);return Hr(o)?"0":o}case"relativeDifference":{const i=n-r;if(i===0)return"0%";const o=i/Math.abs(r);if(o===Number.POSITIVE_INFINITY)return"∞";if(o===Number.NEGATIVE_INFINITY)return"-∞";const s=L({valueFormat:{type:"percentage"},locale:e,numberFormat:pt,intlOptions:{signDisplay:"always"}})(o);return Hr(s)?"0%":s}case"proportion":{if(n-r===0)return"=";const i=n/r;return i===Number.POSITIVE_INFINITY?"∞":i===Number.NEGATIVE_INFINITY?"-∞":`${L({valueFormat:{type:"decimal"},locale:e,numberFormat:pt,intlOptions:{maximumFractionDigits:1}})(i)}x`}}},Hr=e=>{const t=e.replace(/[^\d.]/g,"");return t===""||t==="."?!1:Number(t)===0},Hc=2,$c=6,zc=6,Kc=15,Uc=15,Yc=2.5,Wc=.5,qc=.25,Ma=e=>{const t=e-Hc,r=1+Wc*t,n=1+qc*t;return{arrowStartGap:$c*r,arrowEndGap:zc*r,offsetFromHigherObservation:Kc*n,arrowheadSize:Yc*e,curveRadius:Uc*n,strokeWidth:e}},Xc=(e,t,r,n)=>{const a=n.offsetFromHigherObservation+n.arrowheadSize+n.arrowEndGap;return e?Math.max(t.x,r.x)+a:Math.min(t.y,r.y)-a},jc=(e,t,r,{arrowStartGap:n,arrowEndGap:a,curveRadius:i})=>{const o={x:e.x,y:e.y-n},s={x:e.x,y:r},c={x:t.x,y:r},u={x:t.x,y:t.y-a},m=t.x>e.x?1:-1;return`
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Nl=Object.create,ua=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,Fl=Object.getOwnPropertyNames,Gl=Object.getPrototypeOf,Hl=Object.prototype.hasOwnProperty,$l=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=Fl(t),i=0,o=a.length,s;i<o;i++)s=a[i],!Hl.call(e,s)&&s!==r&&ua(e,s,{get:(c=>t[c]).bind(null,s),enumerable:!(n=Bl(t,s))||n.enumerable});return e},zl=(e,t,r)=>(r=e!=null?Nl(Gl(e)):{},$l(t||!e||!e.__esModule?ua(r,"default",{value:e,enumerable:!0}):r,e));const l=require("./spec-builder-CrOeFCZJ.cjs"),d=require("./compiler-GxysPEAo.cjs"),ne=require("./graph.constants-DGzvPldq.cjs");let Et=require("color2k"),I=require("lodash-es"),Rt=require("humanize-duration");Rt=zl(Rt,1);let P=require("d3-shape"),Kl=require("d3-delaunay");typeof window<"u"&&(window.__GRAPHY_SDK__??={},window.__GRAPHY_SDK__.vizEngine="1.9.0-beta.1794301086730");function q(e,t){return e.geom===t}var ht="…",da=(e,t,r)=>{if(t<=0||e.length===0)return"";if(r(e)<=t)return e;if(r(ht)>t)return"";let n=0,a=e.length-1,i=0;for(;n<=a;){const o=n+a>>>1;r(e.slice(0,o)+ht)<=t?(i=o,n=o+1):a=o-1}return e.slice(0,i)+ht};var C={timeZone:"UTC",calendar:"gregory"},R=e=>t=>{if(!l.isStrictTemporalDataValue(t))return"–";try{return e(t)}catch{return"n/a"}},K=e=>t=>l.isStrictNumericDataValue(t)?e(t):"–",Ut=e=>t=>l.isStrictCategoricalDataValue(t)?t:"–",Ae=new Map,Te=new Map,ma=256,Ul=new Set(["integer","group","decimal","fraction"]),ae=(e,t)=>{const r=pa(e,t),n=Ae.get(r);if(n!==void 0)return n;Ae.size>=ma&&Ae.clear();const a=new Intl.NumberFormat(Wt(e),t);return Ae.set(r,a),a},w=(e,t)=>{const r=pa(e,t),n=Te.get(r);if(n!==void 0)return n;Te.size>=ma&&Te.clear();const a=new Intl.DateTimeFormat(Wt(e),t);return Te.set(r,a),a},Yt=(e,t,r)=>{if(r==="")return e.format(t);const n=e.formatToParts(t),a=n.map(i=>Ul.has(i.type)).lastIndexOf(!0);return n.map((i,o)=>o===a?`${i.value}${r}`:i.value).join("")},ha=e=>{try{return Intl.NumberFormat.supportedLocalesOf(e.trim().replaceAll("_","-"))[0]}catch{return}},Wt=e=>ha(e)??"en-US",pa=(e,t)=>`${e}\0${JSON.stringify(t)}`,Yl=Rt.default.humanizer({language:"en",spacer:"",delimiter:" ",languages:{en:{y:()=>"y",mo:()=>"mo",w:()=>"w",d:()=>"d",h:()=>"h",m:()=>"m",s:()=>"s",ms:()=>"ms"}}}),Ke={signDisplay:"negative"},fa=({valueFormat:e,locale:t,numberFormat:r,intlOptions:n})=>K(a=>{const i=typeof r.decimals=="number"?r.decimals:2,o=Xt(a,i),{base:s,suffix:c}=Ue(a,r.abbreviation);return Yt(ae(t,{...o,...Ke,...l.isCurrencyValueFormat(e)?{style:"currency",currencyDisplay:"narrowSymbol",currency:e.iso}:{},...n}),s,c)}),va=({locale:e,numberFormat:t,intlOptions:r})=>K(n=>{const{base:a,suffix:i}=Ue(n,t.abbreviation);return Yt(ae(e,{...Xt(a,t.decimals),...Ke,...r}),a,i)}),qt=e=>K(t=>{const r=Yl(Math.abs(t));return t<0?`-${r}`:r}),ga=({locale:e,intlOptions:t})=>{const r=ae(e,{maximumFractionDigits:0,...Ke,...t});return K(n=>r.format(n))},ya=({locale:e,numberFormat:t,intlOptions:r})=>K(n=>ae(e,{...Xt(n,t.decimals),...Ke,...r,style:"percent"}).format(n)),Ue=(e,t="none")=>{switch(t){case"none":return{base:e,suffix:""};case"auto":{const r=Wl(e);return Ue(e,r)}default:return{base:e/l.SUFFIX_MULTIPLIERS[t],suffix:t}}},Xt=(e,t)=>{if(typeof t=="number")return{minimumFractionDigits:t,maximumFractionDigits:t};const r=Math.ceil(Math.log10(Math.abs(e))),n=r>=3?0:r===2?1:2;return{minimumFractionDigits:t==="auto"?0:n,maximumFractionDigits:n}},Wl=e=>{const t=Math.abs(e);return t>=l.SUFFIX_MULTIPLIERS.b?"b":t>=l.SUFFIX_MULTIPLIERS.m?"m":t>=l.SUFFIX_MULTIPLIERS.k?"k":"none"},ql=1440*60*1e3,Xl=({locale:e,intlOptions:t})=>{const r=w(e,{dateStyle:"medium",...C,...t});return R(n=>r.format(n))},jl=({locale:e,intlOptions:t})=>{const r=w(e,{dateStyle:"medium",timeStyle:"medium",...C,...t});return R(n=>Zl(r.formatToParts(n)))},Sa=({locale:e,intlOptions:t})=>{const r=w(e,{day:"numeric",month:"long",...C,...t});return R(n=>r.format(n))},ba=({locale:e,intlOptions:t})=>{const r=w(e,{month:"long",...C,...t});return R(n=>r.format(n))},jt=({locale:e,intlOptions:t})=>{const r=w(e,{month:"short",year:"numeric",...C,...t});return R(n=>r.format(n))},Zt=e=>R(t=>`Q${Math.floor(t.getUTCMonth()/3)+1} ${t.getUTCFullYear()}`),xa=({locale:e,intlOptions:t})=>{const r=w(e,{day:"numeric",month:"long",...C,...t,year:void 0});return R(n=>r.formatRange(n,Ia(n,6)))},Aa=({locale:e,intlOptions:t})=>{const r=w(e,{dateStyle:"medium",...C,...t});return R(n=>r.formatRange(n,Ia(n,6)))},Jt=({locale:e,intlOptions:t})=>{const r=w(e,{year:"numeric",...C,...t});return R(n=>r.format(n))},Ta=({locale:e,intlOptions:t})=>{const r=w(e,{timeStyle:"short",...C,...t});return R(n=>r.format(n))},Ia=(e,t)=>new Date(e.getTime()+t*ql),Zl=e=>{const t=e.findIndex(n=>n.type==="hour")-1,r=e[t];return e.map((n,a)=>a===t&&r?.type==="literal"&&r.value===", "?" • ":n.value).join("")},Gr=1e3,Jl=({valueFormat:e,locale:t,tickValues:r,intlOptions:n})=>K(a=>{const i={...er(a,r),...l.isCurrencyValueFormat(e)?{style:"currency",currencyDisplay:"narrowSymbol",currency:e.iso}:{},...n};return Qt(a,t,i)}),Ql=({locale:e,tickValues:t,intlOptions:r})=>K(n=>{const a={...er(n,t),...r};return Qt(n,e,a)}),ec=({locale:e,tickValues:t,intlOptions:r})=>K(n=>{const a={...er(n,t),...r,style:"percent"};return Qt(n,e,a)}),Qt=(e,t,r)=>{const{base:n,suffix:a}=Ue(e,tc(e,r));return Yt(ae(t,r),n,a)},tc=(e,t)=>{const r=ae("en-US",{...t,notation:"compact"}).formatToParts(e).find(n=>n.type==="compact")?.value.toLowerCase();return l.SUFFIXES.find(n=>n===r)??"none"},La=e=>Math.abs(e)>Gr?La(e/Gr):Number.isInteger(e),rc=e=>{if(e.length<2)return!1;const[t,r]=e;return typeof t!="number"||typeof r!="number"?!1:Math.abs(r-t)<1},er=(e,t)=>La(e)?{minimumFractionDigits:0,maximumFractionDigits:0}:rc(t)?{minimumFractionDigits:0,maximumFractionDigits:4}:{minimumFractionDigits:0,maximumFractionDigits:Math.max(1,nc(t))},nc=e=>{const t=e.filter(u=>typeof u=="number"&&Number.isFinite(u)),r=t[0],n=t[1];if(r===void 0||n===void 0)return 0;const a=Math.abs(n-r);if(a===0)return 0;let i=0;for(const u of t)i=Math.max(i,Math.abs(u));if(i===0)return 0;const o=Math.floor(Math.log10(i)/3),s=a/10**(Math.max(0,o)*3);if(s>=1)return 0;const c=Math.ceil(-Math.log10(s)-1e-9);return Math.min(4,Math.max(0,c))},ac=({locale:e,intlOptions:t})=>{const r=w(e,{day:"numeric",month:"short",...C,...t});return R(n=>r.format(n))},ic=({locale:e,intlOptions:t})=>{const r=w(e,{month:"short",...C,...t});return R(n=>r.format(n))},oc=({locale:e,intlOptions:t})=>{const r=w(e,{day:"numeric",month:"short",...C,...t});return R(n=>r.format(n))},sc=({locale:e,intlOptions:t,tickValues:r})=>{const n=w(e,{...cc(r),...C,...t});return R(a=>n.format(a))},lc=({locale:e,intlOptions:t})=>{const r=w(e,{timeStyle:"short",...C,...t});return R(n=>r.format(n))},cc=e=>{const t=e.filter(r=>r instanceof Date&&!Number.isNaN(r.getTime()));return t.length===0?{day:"numeric",month:"short"}:uc(t).size>1?{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}:{timeStyle:"short"}},uc=e=>{const t=new Set;for(const r of e)t.add(`${r.getUTCFullYear()}-${r.getUTCMonth()}-${r.getUTCDate()}`);return t},tr=e=>{const{valueFormat:t}=e;switch(t.type){case"currency":return Jl(e);case"date":return ac(e);case"datetime":return sc(e);case"dayMonth":case"weeklyDateRange":case"weeklyDateRangeWithYear":return oc(e);case"decimal":case"integer":return Ql(e);case"duration":return qt(e);case"month":return ic(e);case"monthYear":return jt(e);case"percentage":return ec(e);case"quarter":return Zt(e);case"text":return Ut(e);case"time":return lc(e);case"year":return Jt(e);case"lookup":return tr({...e,valueFormat:t.fallback});default:throw new l.InternalError({message:`Unhandled value format: ${t.type}`})}},dc=.9,mc=1/3,hc=1/4,pc=e=>e.formattedAxis.position==="top"||e.formattedAxis.position==="bottom"?fc(e):vc(e),fc=({formattedAxis:e,bandwidthPx:t,panelRect:r,measureLabel:n})=>{const{widths:a,maxWidth:i,maxHeight:o}=Ea(e.ticks,n),s=gc(e.ticks,r.width),c=s*dc;if(i<=c)return{...e,labelRotation:0,labelMaxWidthPx:null};if(s>=50){const m=wt(c);return{...e,ticks:Ct(e.ticks,a,m,n),labelRotation:0,labelMaxWidthPx:m}}if(o+8>t)return{...e,ticks:[],labelRotation:0,labelMaxWidthPx:null};const u=wt(r.height*mc);return{...e,ticks:Ct(e.ticks,a,u,n),labelRotation:-90,labelMaxWidthPx:u}},vc=({formattedAxis:e,bandwidthPx:t,panelRect:r,measureLabel:n})=>{const{widths:a,maxWidth:i,maxHeight:o}=Ea(e.ticks,n);if(o>t)return{...e,ticks:[],labelRotation:0,labelMaxWidthPx:null};const s=wt(r.width*hc);return i<=s?{...e,labelRotation:0,labelMaxWidthPx:null}:{...e,ticks:Ct(e.ticks,a,s,n),labelRotation:0,labelMaxWidthPx:s}},gc=(e,t)=>{const r=e[0],n=e[1];return r===void 0||n===void 0?t:Math.abs(n.position-r.position)*t},Ea=(e,t)=>{const r=[];let n=0,a=0;for(const i of e){const{width:o,height:s}=t(i.formattedLabel);r.push(o),o>n&&(n=o),s>a&&(a=s)}return{widths:r,maxWidth:n,maxHeight:a}},Ct=(e,t,r,n)=>{const a=i=>n(i).width;return e.map((i,o)=>(t[o]??0)<=r?i:{...i,formattedLabel:da(i.formattedLabel,r,a)})},wt=e=>Math.max(0,Math.floor(e)),yc=(e,t,r,n,a)=>{if(e===0)return!0;const i=r==="top"||r==="bottom",o=i?60:40;let s=n-(e-1)*o;for(let c=0;c<e;c+=1){const{width:u,height:m}=a(t(c));if(s-=i?u:m,s<0)return!1}return!0},Sc=(e,t,r,n,a)=>{if(e.length<2)return!0;const i=r==="top"||r==="bottom",o=c=>{const{width:u,height:m}=a(t(c));return(i?u:m)/2};let s=o(0);for(let c=1;c<e.length;c+=1){const u=e[c-1],m=e[c];if(u===void 0||m===void 0)continue;const h=o(c);if((m.position-u.position)*n<s+h+8)return!1;s=h}return!0},bc={ticks:[],labelAt:()=>""},xc=({axis:e,availableSpacePx:t,measureLabel:r,resolveFormatter:n})=>{const{tickCandidates:a,position:i}=e;if(a.length===0)return[];const o=new Map,s=f=>{const v=o.get(f);if(v)return v;const g=a[f],b=g?Tc(g.ticks,n(g)):bc;return o.set(f,b),b},c=f=>{const{ticks:v,labelAt:g}=s(f);return a[f]?.source==="generated"?yc(v.length,g,i,t,r):Sc(v,g,i,t,r)};let u=0,m=a.length-1,h=-1;for(;u<=m;){const f=u+m>>>1;c(f)?(h=f,u=f+1):m=f-1}const p=Ac(h,s);return Ic(s(p))},Ac=(e,t)=>{const r=e>=0?e:0;for(let n=r;n>=0;n-=1){const{ticks:a,labelAt:i}=t(n);if(Lc(a,i))return n}return 0},Tc=(e,t)=>{const r=new Array(e.length);return{ticks:e,labelAt:n=>{const a=r[n];if(a!==void 0)return a;const i=t(e[n]?.value??null);return r[n]=i,i}}},Ic=({ticks:e,labelAt:t})=>e.map((r,n)=>({...r,formattedLabel:t(n)})),Lc=(e,t)=>{const r=new Set;for(let n=0;n<e.length;n+=1){const a=t(n);if(r.has(a))return!1;r.add(a)}return!0};function rr(e,t){return e.axes.find(r=>r.scaledAesthetic===t)??null}function nr(e,t){return e.categorySpan?.layerIds.includes(t)?e.categorySpan.valueFormat:e.valueFormat}function Ec(e,t){return e.legends.drawn.find(r=>r.aesthetics.includes(t))??null}var Rc=e=>{const t=L({...e,valueFormat:e.valueFormat.fallback}),r={};for(const[a,i]of Object.entries(e.valueFormat.cases))r[a]=L({...e,valueFormat:i});const n=e.valueFormat.byVariable;return(a,i)=>{if(i===void 0||i[n]===void 0)return t(a);const o=l.getStableKey(i[n]),s=r[o];return s!==void 0?s(a,i):t(a)}},L=e=>{switch(e.valueFormat.type){case"currency":return fa(e);case"date":return Xl(e);case"datetime":return jl(e);case"dayMonth":return Sa(e);case"decimal":return va(e);case"duration":return qt(e);case"integer":return ga(e);case"month":return ba(e);case"monthYear":return jt(e);case"percentage":return ya(e);case"quarter":return Zt(e);case"text":return Ut(e);case"weeklyDateRange":return xa(e);case"weeklyDateRangeWithYear":return Aa(e);case"year":return Jt(e);case"time":return Ta(e);case"lookup":return Rc({...e,valueFormat:e.valueFormat});default:{const t=e.valueFormat;throw new l.InternalError({message:`Unhandled value format: ${t.type}`})}}};function ar({layer:e,numberFormat:t,locale:r}){return L({valueFormat:d.getLayerYValueFormat(e),locale:r,numberFormat:t})}var Cc=(e,t)=>{const r=l.readVariableName(t.x);return r!==null&&r!==l.CONSTANT_VARIABLES.x?{read:d.createXValueReader(e,t),variable:r}:{read:d.getGroup,variable:l.GROUP_VARIABLES.group}},Ra=({layer:e,coordSystem:t,axes:r,numberFormat:n,panelRect:a,measureDataLabel:i,readers:o,formattingLocale:s,percentageValueStrategy:c})=>{const u=ar({layer:e,numberFormat:n,locale:s}),m=t.type==="cartesian"&&t.mainAxis==="y";return{layer:e,coordSystem:t,panelRect:a,measureDataLabel:i,styleReaders:o.geom(e),formatLabel:Dc({layer:e,numberFormat:n,axes:r,locale:s,absoluteFormatter:u,percentageValueStrategy:c,flipped:m}),formatAbsolute:u,formatCategory:wc({layer:e,numberFormat:n,locale:s})}},wc=({layer:e,numberFormat:t,locale:r})=>{const{read:n,variable:a}=Cc(e.data,e.mapping),i=L({valueFormat:e.data.hasVariable(a)?e.data.getValueFormat(a):{type:"text"},locale:r,numberFormat:t});return o=>{const s=n(o);return s===null?null:i(s,o)}},Pc=(e,t,r)=>{switch(t){case"stack":return Mc(e);case"fill":return Oc(e,r);case"absoluteGrandTotal":return()=>e.summary.absoluteGrandTotal??null;case"none":return()=>null}},Mc=e=>{const t=l.readVariableName(e.mapping.x);let r=null,n=!1;return a=>{const i=e.summary.stackTotals;if(i===void 0||i.length===0||t===null)return null;if(!n){r=new Map;for(const c of i)r.set(c.xKey,c);n=!0}const o=a[t];if(o==null)return null;const s=r?.get(d.getObservationXKey(a,t));return s===void 0?null:s.total}},Oc=(e,t)=>{const r=t?l.getXMin:l.getYMin,n=t?l.getXMax:l.getYMax,a=d.createSegmentYReader(e);return i=>{const o=r(i),s=n(i);if(!l.isStrictNumericDataValue(o)||!l.isStrictNumericDataValue(s))return null;const c=s-o;if(c===0)return null;const u=a(i);return l.isStrictNumericDataValue(u)?u/c:null}},Dc=({layer:e,numberFormat:t,axes:r,locale:n,absoluteFormatter:a,percentageValueStrategy:i,flipped:o})=>{const s=d.createRawValueReader(e.data,e.dataLabels.labelSource),c=Pc(e,i,o),u=_c({layer:e,numberFormat:t,axes:r,locale:n,absoluteFormatter:a}),m=L({valueFormat:{type:"percentage"},locale:n,numberFormat:t}),h=e.dataLabels.format==="percentage"&&Ca(e);return p=>{const f=s(p);if(f===null)return"";if(!h||!l.isStrictNumericDataValue(f))return u(f,p);const v=c(p);return v===null||v===0?u(f,p):m(f/v)}},_c=({layer:e,numberFormat:t,axes:r,locale:n,absoluteFormatter:a})=>{const i=e.dataLabels.labelSource,o=l.readVariableName(i);if(o!==null){if(Ca(e))return a;const s=kc(e,r,t,n,o);if(s!==null)return s}return L({valueFormat:Vc(e.data,i),locale:n,numberFormat:t})},Ca=e=>{const t=l.readVariableName(e.dataLabels.labelSource);return t===null?!1:t===l.readVariableName(d.resolveSegmentYSource(e.position,e.mapping))},kc=(e,t,r,n,a)=>{const i=l.readVariableName(e.mapping.x);if(i===null||i!==a)return null;const o=t.find(s=>s.scaledAesthetic==="x");return o===void 0?null:L({valueFormat:nr(o,e.id),locale:n,numberFormat:r})},Vc=(e,t)=>{const r=l.readConstantValue(t);if(r!==void 0)return l.isNumericDataValue(r)?{type:"decimal"}:l.isTemporalDataValue(r)?{type:"date"}:{type:"text"};const n=l.readVariableName(t);return n===null||!e.hasVariable(n)?{type:"text"}:e.getValueFormat(n)},Nc={cartesian:["cartesian","flip"],polar:["polar"]},Bc=null;function wa(e=[]){const t=Fc(e),r=(n,a)=>{if(!t.has(n))return null;const i=t.get(n);return i.getDataLabelPlacements===void 0||!Nc[a].some(o=>i.dataLabelCoordTypes.includes(o))?null:{place:i.getDataLabelPlacements.bind(i),getPercentageValueStrategy:o=>i.resolvePercentageValueStrategy?.(o,a)??"none"}};return{resolve:r,hasCapability:(n,a)=>r(n,a)!==null,hasPercentageFormat:(n,a)=>(r(n.geom,a)?.getPercentageValueStrategy(n)??"none")!=="none"}}function ir(){return Bc??=wa()}function Fc(e){const t=new l.GeomRegistry;for(const r of e){const n=l.resolveDefinition(r);n instanceof l.Geom&&t.register(n.type,n)}return t}function*Gc({layers:e,coordSystem:t,axes:r,numberFormat:n,panelRect:a,measureDataLabel:i,readers:o,locale:s,resolvePlacement:c=ir()}){if(!(t.type!=="cartesian"||a.width<=0||a.height<=0))for(const u of e){if(!u.dataLabels.showDataLabels&&!u.dataLabels.showStackTotals)continue;const m=c.resolve(u.geom,"cartesian");if(m===null)continue;const h=Ra({layer:u,coordSystem:t,axes:r,numberFormat:n,panelRect:a,measureDataLabel:i,readers:o,formattingLocale:s,percentageValueStrategy:m.getPercentageValueStrategy(u)});for(const p of m.place(h).labels)yield{x:a.x+p.x-p.width/2,y:a.y+p.y-p.height/2,width:p.width,height:p.height}}}var pt={abbreviation:"none",decimals:"auto"},Pa=({locale:e,kind:t,startValue:r,endValue:n,valueFormat:a})=>{if(r===null||n===null)return"n/a";switch(t){case"absoluteDifference":{const i=n-r,o=L({valueFormat:a,locale:e,numberFormat:pt,intlOptions:{signDisplay:"always"}})(i);return Hr(o)?"0":o}case"relativeDifference":{const i=n-r;if(i===0)return"0%";const o=i/Math.abs(r);if(o===Number.POSITIVE_INFINITY)return"∞";if(o===Number.NEGATIVE_INFINITY)return"-∞";const s=L({valueFormat:{type:"percentage"},locale:e,numberFormat:pt,intlOptions:{signDisplay:"always"}})(o);return Hr(s)?"0%":s}case"proportion":{if(n-r===0)return"=";const i=n/r;return i===Number.POSITIVE_INFINITY?"∞":i===Number.NEGATIVE_INFINITY?"-∞":`${L({valueFormat:{type:"decimal"},locale:e,numberFormat:pt,intlOptions:{maximumFractionDigits:1}})(i)}x`}}},Hr=e=>{const t=e.replace(/[^\d.]/g,"");return t===""||t==="."?!1:Number(t)===0},Hc=2,$c=6,zc=6,Kc=15,Uc=15,Yc=2.5,Wc=.5,qc=.25,Ma=e=>{const t=e-Hc,r=1+Wc*t,n=1+qc*t;return{arrowStartGap:$c*r,arrowEndGap:zc*r,offsetFromHigherObservation:Kc*n,arrowheadSize:Yc*e,curveRadius:Uc*n,strokeWidth:e}},Xc=(e,t,r,n)=>{const a=n.offsetFromHigherObservation+n.arrowheadSize+n.arrowEndGap;return e?Math.max(t.x,r.x)+a:Math.min(t.y,r.y)-a},jc=(e,t,r,{arrowStartGap:n,arrowEndGap:a,curveRadius:i})=>{const o={x:e.x,y:e.y-n},s={x:e.x,y:r},c={x:t.x,y:r},u={x:t.x,y:t.y-a},m=t.x>e.x?1:-1;return`
|
|
2
2
|
M ${o.x} ${o.y}
|
|
3
3
|
L ${s.x} ${s.y+i}
|
|
4
4
|
Q ${s.x} ${s.y} ${s.x+m*i} ${s.y}
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { clamp as tt, findLast as _u, isEqual as Y, isPlainObject as Fu, minBy a
|
|
|
6
6
|
import $u from "humanize-duration";
|
|
7
7
|
import { area as is, curveCatmullRom as Hu, curveLinear as zu, line as ss, symbol as os, symbolCircle as Ku, symbolCross as Wu, symbolDiamond as Yu, symbolSquare as Uu, symbolStar as ju, symbolTriangle as qu, symbolWye as Xu } from "d3-shape";
|
|
8
8
|
import { Delaunay as Zu } from "d3-delaunay";
|
|
9
|
-
typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.vizEngine = "1.9.0-beta.
|
|
9
|
+
typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.vizEngine = "1.9.0-beta.1794301086730");
|
|
10
10
|
function xe(e, t) {
|
|
11
11
|
return e.geom === t;
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"grammar-of-graphics",
|
|
12
12
|
"compiler"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.9.0-beta.
|
|
14
|
+
"version": "1.9.0-beta.1794301086730",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"sideEffects": [
|
|
17
17
|
"**/version.ts"
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"vitest": "^4.1.11",
|
|
67
67
|
"@graphytools/eslint-plugin-graphy": "1.0.0",
|
|
68
68
|
"@graphytools/typescript-config": "0.0.1",
|
|
69
|
-
"@graphytools/
|
|
70
|
-
"@graphytools/
|
|
69
|
+
"@graphytools/vitest-config": "1.0.0",
|
|
70
|
+
"@graphytools/eslint-config": "0.0.1"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|