semiotic 3.10.0 → 3.10.1
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/README.md +55 -59
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/componentMetadata.cjs +3 -1
- package/ai/dist/mcp-server.js +45 -45
- package/ai/examples.md +67 -0
- package/ai/reference.md +75 -1
- package/ai/schema.json +5199 -1
- package/ai/surface-manifest.json +24 -3
- package/ai/task-packets/compare-category-totals.json +6 -6
- package/ai/task-packets/compare-category-totals.md +3 -3
- package/ai/task-packets/correct-published-chart.json +6 -6
- package/ai/task-packets/correct-published-chart.md +3 -3
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +6 -6
- package/ai/task-packets/update-live-chart.md +3 -3
- package/dist/c-2RL2QPZJ.min.js +1 -0
- package/dist/c-45CQWZZ6.min.js +1 -0
- package/dist/{c-PP6VY3QU.min.js → c-4BRHKVKV.min.js} +1 -1
- package/dist/c-7DVPSB5C.min.js +1 -0
- package/dist/{c-XDQKXPX4.min.js → c-A7OGOFSL.min.js} +1 -1
- package/dist/{c-AZKPVBOC.min.js → c-AH5HWZWS.min.js} +1 -1
- package/dist/c-B7GW7IHJ.min.js +1 -0
- package/dist/{c-ROEHCIGV.min.js → c-C3TZLTZK.min.js} +1 -1
- package/dist/c-CGQAQWBV.min.js +1 -0
- package/dist/c-DIPEYUOW.min.js +1 -0
- package/dist/{c-WNGH47HF.min.js → c-E72OTUZU.min.js} +1 -1
- package/dist/{c-DY2676CR.min.js → c-EUMPMDCS.min.js} +1 -1
- package/dist/c-EZZT2WAE.min.js +1 -0
- package/dist/c-FHBVFCQB.min.js +1 -0
- package/dist/{c-E32M6XW5.min.js → c-G4HCO2IQ.min.js} +1 -1
- package/dist/{c-ZYPXQF7B.min.js → c-G5VIJEOK.min.js} +1 -1
- package/dist/c-GHVOXAYH.min.js +1 -0
- package/dist/{c-EBOQ7ER7.min.js → c-HP4ZFM47.min.js} +1 -1
- package/dist/{c-IDJV3CZK.min.js → c-HYDTS5OP.min.js} +1 -1
- package/dist/c-IK33LNZ6.min.js +1 -0
- package/dist/c-IK3PZHRY.min.js +1 -0
- package/dist/{c-JO2UGTCP.min.js → c-J6DVC236.min.js} +1 -1
- package/dist/{c-MXCP7GNZ.min.js → c-JIMJF6F6.min.js} +1 -1
- package/dist/{c-4FN7Q6VQ.min.js → c-KKPMHAZC.min.js} +1 -1
- package/dist/c-L6WNDBHV.min.js +1 -0
- package/dist/c-LDEX5OFW.min.js +1 -0
- package/dist/{c-CPSPZH6A.min.js → c-LESEUVC5.min.js} +1 -1
- package/dist/c-MB6CV5NC.min.js +1 -0
- package/dist/{c-OO5QLMJC.min.js → c-MOKJOIPE.min.js} +1 -1
- package/dist/{c-BNG5ECK5.min.js → c-N3FXLRNT.min.js} +1 -1
- package/dist/c-N5NPTJVJ.min.js +1 -0
- package/dist/{c-DE5Q3U2X.min.js → c-NHBL4J67.min.js} +1 -1
- package/dist/{c-LMGSSD2E.min.js → c-ODG6TFSY.min.js} +1 -1
- package/dist/{c-HXDKPIKR.min.js → c-PSKKFZNP.min.js} +1 -1
- package/dist/{c-NYZ2QNAM.min.js → c-R2P4RR7Q.min.js} +1 -1
- package/dist/{c-KCRJGUHP.min.js → c-RFC7UAG7.min.js} +1 -1
- package/dist/c-SGAURYHG.min.js +1 -0
- package/dist/{c-DK662R77.min.js → c-SJMWU6UX.min.js} +1 -1
- package/dist/c-STIIGQOD.min.js +1 -0
- package/dist/c-T2ASIJVZ.min.js +1 -0
- package/dist/c-TX3THUTO.min.js +1 -0
- package/dist/{c-55BAJ333.min.js → c-TX7XJM3Z.min.js} +1 -1
- package/dist/c-UMXSJIOV.min.js +1 -0
- package/dist/{c-JLGRHXGZ.min.js → c-VRSXMLYF.min.js} +1 -1
- package/dist/c-VSLWSAN2.min.js +1 -0
- package/dist/{c-33QOXEUG.min.js → c-WCBRPILW.min.js} +1 -1
- package/dist/{c-WH2O53VI.min.js → c-WGHT7OCY.min.js} +1 -1
- package/dist/c-WWCW3APR.min.js +1 -0
- package/dist/c-Y6PYUMFU.min.js +1 -0
- package/dist/c-ZIVPFTOC.min.js +1 -0
- package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
- package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
- package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
- package/dist/components/charts/shared/hooks.d.ts +3 -1
- package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
- package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
- package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
- package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
- package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
- package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
- package/dist/components/recipes/atlas/braid.d.ts +62 -0
- package/dist/components/recipes/atlas/capsules.d.ts +18 -0
- package/dist/components/recipes/atlas/compare.d.ts +4 -0
- package/dist/components/recipes/atlas/completeness.d.ts +2 -0
- package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
- package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
- package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
- package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
- package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
- package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
- package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
- package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
- package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
- package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
- package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
- package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
- package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
- package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
- package/dist/components/recipes/atlas/forests.d.ts +11 -0
- package/dist/components/recipes/atlas/ids.d.ts +6 -0
- package/dist/components/recipes/atlas/index.d.ts +26 -0
- package/dist/components/recipes/atlas/ledger.d.ts +7 -0
- package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
- package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
- package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
- package/dist/components/recipes/atlas/motifs.d.ts +3 -0
- package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
- package/dist/components/recipes/atlas/prepare.d.ts +14 -0
- package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
- package/dist/components/recipes/atlas/profile.d.ts +19 -0
- package/dist/components/recipes/atlas/publish.d.ts +10 -0
- package/dist/components/recipes/atlas/queries.d.ts +34 -0
- package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
- package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
- package/dist/components/recipes/atlas/sections.d.ts +3 -0
- package/dist/components/recipes/atlas/support.d.ts +7 -0
- package/dist/components/recipes/atlas/types.d.ts +278 -0
- package/dist/components/recipes/atlas/validate.d.ts +12 -0
- package/dist/components/semiotic-atlas-core.d.ts +20 -0
- package/dist/components/semiotic-atlas.d.ts +8 -0
- package/dist/components/semiotic-recipes-core.d.ts +9 -0
- package/dist/components/server/serverChartConfigs.d.ts +3 -0
- package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
- package/dist/components/stream/canvasSetup.d.ts +1 -2
- package/dist/components/stream/fontLoading.d.ts +4 -0
- package/dist/components/stream/networkCustomLayout.d.ts +8 -0
- package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
- package/dist/components/stream/physics/physicsSemanticUI.d.ts +2 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
- package/dist/components/stream/shallowEqual.d.ts +2 -0
- package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-access.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-artifact.min.js +1 -1
- package/dist/semiotic-artifact.module.min.js +1 -1
- package/dist/semiotic-atlas-core.d.ts +20 -0
- package/dist/semiotic-atlas-core.min.js +1 -0
- package/dist/semiotic-atlas-core.module.min.js +1 -0
- package/dist/semiotic-atlas-selection.module.min.js +2 -0
- package/dist/semiotic-atlas.d.ts +8 -0
- package/dist/semiotic-atlas.min.js +2 -0
- package/dist/semiotic-atlas.module.min.js +2 -0
- package/dist/semiotic-client-cjs-shared.min.js +1 -1
- package/dist/semiotic-evidence.min.js +1 -1
- package/dist/semiotic-evidence.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +9 -0
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-text.min.js +1 -1
- package/dist/semiotic-text.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +16 -1
- package/dist/c-447VIMRO.min.js +0 -1
- package/dist/c-553QUDKA.min.js +0 -1
- package/dist/c-7HP7MB2I.min.js +0 -1
- package/dist/c-7NBU5ZKS.min.js +0 -1
- package/dist/c-CCTGN5CK.min.js +0 -1
- package/dist/c-GSZRZRD6.min.js +0 -1
- package/dist/c-GWX7JGMF.min.js +0 -1
- package/dist/c-ITKX3RC5.min.js +0 -1
- package/dist/c-JG2JCQLP.min.js +0 -1
- package/dist/c-LYVKDBQJ.min.js +0 -1
- package/dist/c-NG7BLZTR.min.js +0 -1
- package/dist/c-PYNW54D2.min.js +0 -1
- package/dist/c-TIXX5CAU.min.js +0 -1
- /package/dist/{c-OOVX2JPQ.min.js → c-UC7SIU2W.min.js} +0 -0
package/dist/c-553QUDKA.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t,e){let[n,r]=t.viewBox??j,[i,l]=t.anchor??F,o=r>0?r:1,a=Math.max(0,e)/o,s=(n>0?n:o)*a,u=o*a;return{width:s,height:u,scale:a,offsetX:-i*s,offsetY:-l*u}}function e(e,n){let r=t(e,n),i=[[r.offsetX,r.offsetY],[r.offsetX+r.width,r.offsetY],[r.offsetX,r.offsetY+r.height],[r.offsetX+r.width,r.offsetY+r.height]],l=0;for(let[t,e]of i){let n=Math.sqrt(t*t+e*e);n>l&&(l=n)}return l}function n(t,e,n,r){if("none"!==t)return"color"===t||null==t?e??r:"accent"===t?n:t}function r(t){if(typeof Path2D>"u")return null;q||(q=new Map);let e=q.get(t);if(e)return e;let n=new Path2D(t);return q.size>1024&&q.clear(),q.set(t,n),n}function i(t,e,n=0,r="horizontal"){let[i,l]=t.viewBox??j,o=Math.min(1,Math.max(0,n)),a=Math.min(1,Math.max(0,e));return a>o?o>0||1>a?"vertical"===r?{x:0,y:l*(1-a),width:i,height:l*(a-o)}:{x:i*o,y:0,width:i*(a-o),height:l}:null:{x:0,y:0,width:0,height:0}}function l(e,n){let r=t(e,n);return{centerDx:r.offsetX+r.width/2,centerDy:r.offsetY+r.height/2,halfWidth:r.width/2,halfHeight:r.height/2,radius:Math.hypot(r.width,r.height)/2}}function o(t,e,i,l,o,a=t=>t){for(let s of e.parts){let e=r(s.d);if(!e)continue;let u=s.opacity??1,f=t.globalAlpha;1!==u&&(t.globalAlpha=f*u);let c=o?"none"===s.fill?void 0:o:n(s.fill,i,l);c&&(t.fillStyle=a(c),t.fill(e));let h=o?s.stroke&&"none"!==s.stroke?o:void 0:n(s.stroke??"none",i,l);h&&(t.strokeStyle=a(h),t.lineWidth=s.strokeWidth??1,t.lineCap=s.strokeLinecap??"butt",t.lineJoin=s.strokeLinejoin??"miter",t.stroke(e)),1!==u&&(t.globalAlpha=f)}}function a(t){return{type:"hatch",background:t.background,stroke:t.stroke,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle}}function s(t={},e){let n,{background:r="transparent",stroke:i="#000",lineWidth:l=1.5,spacing:o=6,angle:s=45}=t,u={background:r,stroke:i,lineWidth:l,spacing:o,angle:s},f=Math.max(8,Math.ceil(2*o));try{n=function(t){return"u">typeof OffscreenCanvas?new OffscreenCanvas(t,t):(N||(N=document.createElement("canvas")),N.width=t,N.height=t,N)}(f)}catch{return a(u)}let c=n.getContext("2d");if(!c)return a(u);r&&"transparent"!==r?(c.fillStyle=r,c.fillRect(0,0,f,f)):c.clearRect(0,0,f,f),c.strokeStyle=i,c.lineWidth=l,c.lineCap="square";let h=s*Math.PI/180;if(45===s||-45===s){let t=s>0?1:-1;for(let e=-f;2*f>=e;e+=o)c.beginPath(),c.moveTo(e,0),c.lineTo(e+t*f,f),c.stroke()}else{c.save(),c.translate(f/2,f/2),c.rotate(h);let t=2*f;for(let e=-t;t>=e;e+=o)c.beginPath(),c.moveTo(-t,e),c.lineTo(t,e),c.stroke();c.restore()}return(e||c).createPattern(n,"repeat")}function u(t,e){!function(){if(z||typeof window>"u"||typeof document>"u")return;z=!0;let t=t=>{if(!t?.includes("--"))return"";let e=document.createElement("span").style;return e.cssText=t,Array.from(e).filter(t=>t.startsWith("--")).sort().map(t=>`${t}:${e.getPropertyValue(t)}!${e.getPropertyPriority(t)}`).join(";")},e=(e,n)=>{let r=e.target;if(!(r instanceof Element))return!1;if(r===n||r.contains(n))return!0;if(!n.contains(r))return!1;let i="CANVAS"===r.tagName;return!(!i&&!r.querySelector("canvas")||i&&"style"===e.attributeName&&t(e.oldValue)===t(r.getAttribute("style")))},n=t=>{let n=[];for(let r of B){let i=r.getElement();i&&(!t||t.some(t=>e(t,i)))&&n.push(r)}if(!t||0!==n.length){Y++;for(let t of n)t.listener()}};if("u">typeof MutationObserver&&document.documentElement&&(T=new MutationObserver(t=>{n(t)})).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme","data-semiotic-theme-mode"],attributeOldValue:!0,subtree:!0}),"function"==typeof window.matchMedia)try{I=window.matchMedia("(prefers-color-scheme: dark)"),R=()=>n(),"function"==typeof I.addEventListener?I.addEventListener("change",R):"function"==typeof I.addListener&&I.addListener(R)}catch{}document.fonts&&"function"==typeof document.fonts.addEventListener&&(V=document.fonts).addEventListener("loadingdone",D=()=>n())}();let n={getElement:t,listener:e};return B.add(n),()=>{B.delete(n)&&0===B.size&&(T?.disconnect(),T=null,I&&R&&("function"==typeof I.removeEventListener?I.removeEventListener("change",R):"function"==typeof I.removeListener&&I.removeListener(R)),I=null,R=null,V&&D&&V.removeEventListener("loadingdone",D),V=null,D=null,z=!1)}}function f(t,e){if(!e)return e;let n=function(t){let e=t.trim();if(!e.startsWith("var(")||!e.endsWith(")"))return null;let n=e.slice(4,-1),r=n.indexOf(",");if(-1===r){let t=n.trim();return t.startsWith("--")?{name:t}:null}let i=n.slice(0,r).trim(),l=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:l||void 0}:null}(e);if(!n)return e;let r=()=>n.fallback?f(t,n.fallback):e,i=t.canvas;if(!i)return r();let l=X.get(i);(!l||l.version!==Y)&&(l={version:Y,map:new Map},X.set(i,l));let o=l.map.get(e);if(void 0!==o)return o;let a=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||e;return l.map.set(e,a),a}function c(t){Y++}function h(){return Y}function d(t){return"object"==typeof t&&null!==t&&"hatch"===t.type}function p(t){return["hatch",t.background??"transparent",t.stroke??"#000",t.lineWidth??1.5,t.spacing??6,t.angle??45,t.lineOpacity??1].join("|")}function m(t,e){let n=2166136261,r=p(e);for(let t=0;r.length>t;t++)n^=r.charCodeAt(t),n=Math.imul(n,16777619);return`${t}-hatch-${(n>>>0).toString(36)}`}function y(t,e){let{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:l=6,angle:o=45,lineOpacity:a=1}=t,s=Math.max(8,Math.ceil(2*l));return U("pattern",{id:e,width:s,height:s,patternUnits:"userSpaceOnUse",patternTransform:0!==o?`rotate(${o})`:void 0,children:[n&&"transparent"!==n&&G("rect",{width:s,height:s,fill:n}),G("line",{x1:0,y1:0,x2:0,y2:s,stroke:r,strokeWidth:i,strokeOpacity:a}),G("line",{x1:l,y1:0,x2:l,y2:s,stroke:r,strokeWidth:i,strokeOpacity:a})]},e)}function g(t,e,n="#4e79a7"){if(d(t)){let n=m(e,t);return{fill:`url(#${n})`,def:y(t,n)}}return t&&"string"==typeof t?{fill:t}:{fill:n}}function b(t,e,n,r){if(!t||"object"!=typeof t)return;let i=t;if(!Array.isArray(i.stops))return;let l=i.stops.flatMap(t=>{if(!t||"object"!=typeof t)return[];let{offset:e,color:n,opacity:i}=t;return"number"==typeof e&&Number.isFinite(e)?[{offset:Math.max(0,Math.min(1,e)),color:"string"==typeof n&&n?n:r,opacity:"number"==typeof i&&Number.isFinite(i)?Math.max(0,Math.min(1,i)):void 0}]:[]}).sort((t,e)=>t.offset-e.offset);if(!l.length)return;let o="horizontal"===i.direction?"horizontal":"vertical"===i.direction?"vertical":n,a=e+"-gradient";return{fill:`url(#${a})`,def:G("linearGradient",{id:a,x1:0,y1:0,x2:"horizontal"===o?"100%":0,y2:"vertical"===o?"100%":0,children:l.map((t,e)=>G("stop",{offset:100*t.offset+"%",stopColor:t.color,stopOpacity:t.opacity},`${t.offset}-${e}`))},a)}}function v(t,e,n){if(n)return n;let r=t??"circle";if("chevron"===r)return function(t){let e=1.5*k(t),n=.92*e;return`M0,${-e}L${n},${(.78*e).toFixed(3)}L0,${(.28*e).toFixed(3)}L${-n},${(.78*e).toFixed(3)}Z`}(e);let i=Object.prototype.hasOwnProperty.call(rt,r)?rt[r]:Z;return J(i,Math.max(1,e))()??""}function k(t){return Math.sqrt(Math.max(1,t)/Math.PI)}function w(t,e){let n=new Map,r=0;return i=>{let l=t(i)+"",o=e&&Object.prototype.hasOwnProperty.call(e,l)?e[l]:void 0;if(o&&it.has(o))return o;let a=n.get(l);return a||(a=lt[r%lt.length],r++,n.set(l,a)),a}}function M(t,e){let n=t.fillStyle,r="#010203";try{t.fillStyle=r,t.fillStyle=e}catch{return t.fillStyle=n,[78,121,167]}let i=t.fillStyle;if(t.fillStyle=n,"string"!=typeof i)return[78,121,167];if(i.toLowerCase()===r&&e.trim().toLowerCase()!==r)return[78,121,167];if(i.startsWith("#"))return[parseInt(i.slice(1,3),16),parseInt(i.slice(3,5),16),parseInt(i.slice(5,7),16)];let l=i.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return l?[+l[1],+l[2],+l[3]]:[78,121,167]}function x(t){switch(t){case"monotoneX":return ot;case"monotoneY":return at;case"cardinal":return st;case"catmullRom":return ut;case"step":return ft;case"stepBefore":return ct;case"stepAfter":return ht;case"basis":return dt;case"natural":return pt;default:return null}}function W(t,e,n){if(null==e)return n;if(d(e)){let r=function(t,e){let n=t.background??"transparent",r=t.stroke??"#000",i="transparent"===n||"none"===n?n:f(e,n)||n,l=f(e,r)||r||"#000",o="u">typeof window&&window.devicePixelRatio||1,a=`${p(t)}|${i}|${l}@${o}`,u=H.get(a);if(void 0!==u)return u;let c=s({background:i,stroke:l,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle},e),h=d(c)?null:c;return H.set(a,h),h}(e,t);return r||e.background&&f(t,e.background)||n}return"string"!=typeof e?e:f(t,e)||n}function $(t,e,n){let r=W(t,e,n);if("string"==typeof r&&r.trim().startsWith("var(")){let e=f(t,n);return e&&!e.trim().startsWith("var(")?e:n}return r}function S(t,e){if(null==e)return;let n=W(t,e,"");return""===n?void 0:n}function L(t,e,n,r,i,l,o){let a=e.stops.filter(t=>Number.isFinite(t.offset)&&(null==t.opacity||Number.isFinite(t.opacity)));if(2>a.length)return null;let s=t.createLinearGradient(r,i,l,o);for(let e of a)s.addColorStop(Math.max(0,Math.min(1,e.offset)),O(t,e,n));return s}function O(t,e,n){let r=e.color??n,i=f(t,r)||r;if(null==e.opacity)return i;let l=Math.max(0,Math.min(1,e.opacity)),[o,a,s]=M(t,i);return`rgba(${o},${a},${s},${l})`}function E(t,e,n,r){e.fill&&(t.fillStyle=W(t,e.fill,n),void 0!==e.fillOpacity&&(t.globalAlpha=(e.opacity??1)*e.fillOpacity),r())}function P(t,e,n){!e.stroke||"none"===e.stroke||(t.strokeStyle=f(t,e.stroke)||e.stroke,t.lineWidth=e.strokeWidth??1,t.globalAlpha=(e.opacity??1)*(e.strokeOpacity??1),n())}function A(t){return(t.tl??0)>0||(t.tr??0)>0||(t.br??0)>0||(t.bl??0)>0}function C(t){let e=t.cornerRadii;if(!e)return{tl:0,tr:0,br:0,bl:0};let n=Math.min(t.w,t.h)/2,r=t=>Math.max(0,Math.min(t??0,n));return{tl:r(e.tl),tr:r(e.tr),br:r(e.br),bl:r(e.bl)}}var j=[40,40],F=[.5,.5],q=null,N=null,X=new WeakMap,Y=0,z=!1,T=null,I=null,R=null,V=null,D=null,B=new Set;import{jsx as G,jsxs as U}from"react/jsx-runtime";var H=new Map;import{symbol as J,symbolCircle as Z,symbolCross as K,symbolDiamond as Q,symbolSquare as _,symbolStar as tt,symbolTriangle as et,symbolWye as nt}from"d3-shape";var rt={circle:Z,square:_,triangle:et,diamond:Q,star:tt,cross:K,wye:nt},it=new Set(["circle","square","triangle","diamond","star","cross","wye","chevron"]),lt=["circle","triangle","diamond","star","square","chevron","cross","wye"];import{curveMonotoneX as ot,curveMonotoneY as at,curveCardinal as st,curveCatmullRom as ut,curveStep as ft,curveStepBefore as ct,curveStepAfter as ht,curveBasis as dt,curveNatural as pt}from"d3-shape";export{v as symbolPathString,k as symbolRadius,w as makeSymbolResolver,t as glyphPlacement,e as glyphExtent,n as resolveGlyphPaint,r as getGlyphPath2D,i as glyphFractionClipRect,l as glyphHitGeometry,o as drawGlyphParts,u as subscribeToCSSColorInvalidation,f as resolveCSSColor,c as clearCSSColorCache,h as getCSSColorCacheVersion,M as parseCanvasColor,s as createHatchPattern,d as isHatchFill,m as hatchFillId,y as hatchPatternDef,g as resolveSvgFill,b as resolveAnnotationGradient,x as resolveCurveFactory,W as resolveCanvasFill,$ as resolveCanvasPaint,S as coerceCanvasFill,L as buildLinearFillGradient,E as paintNetworkFill,P as paintNetworkStroke,A as hasAnyCornerRadius,C as clampCornerRadii};
|
package/dist/c-7HP7MB2I.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{customXYPlugin as m}from"./c-WNGH47HF.min.js";import"./c-CPSPZH6A.min.js";import"./c-NYZ2QNAM.min.js";import"./c-DK662R77.min.js";import"./c-OO5QLMJC.min.js";import"./c-HXDKPIKR.min.js";import"./c-4FN7Q6VQ.min.js";import"./c-W4ZUKSEQ.min.js";import"./c-553QUDKA.min.js";export{m as customXYPlugin};
|
package/dist/c-7NBU5ZKS.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function m(){H(F),H(s),H(c),H(G),H(t),H(i),H(n),H(o),H(f),H(p),H(r),H(j)}import{barXYPlugin as o,bubbleXYPlugin as i,candlestickXYPlugin as r,heatmapXYPlugin as n,scatterXYPlugin as t,stackedAreaXYPlugin as c,swarmXYPlugin as f,waterfallXYPlugin as p}from"./c-33QOXEUG.min.js";import{customXYPlugin as j}from"./c-WNGH47HF.min.js";import{areaXYPlugin as s,lineXYPlugin as F,mixedXYPlugin as G,registerXYPlugin as H}from"./c-ZYPXQF7B.min.js";export{m as registerBuiltInXYPlugins};
|
package/dist/c-CCTGN5CK.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function t(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function i(e,t,i){return e?"function"==typeof e?{...i,...e(t)}:{...i,...e}:{...i}}function r(e,t){if(2>e.length)return[e];let i=.4*t,r=[],n=[e[0]];for(let t=1;e.length>t;t++){let o=e[t];Math.abs(o[0]-e[t-1][0])>i?(n.length>=2&&r.push(n),n=[o]):n.push(o)}return n.length>=2&&r.push(n),r}function n(e,t,i=24){let r=t[0]-e[0],n=t[1]-e[1],o=Math.sqrt(r*r+n*n);if(0===o)return[e,t];let a=-n/o,s=r/o,l=Math.min(.3*o,80),c=(e[0]+t[0])/2+a*l,u=(e[1]+t[1])/2+s*l,h=[];for(let r=0;i>=r;r++){let n=r/i,o=1-n;h.push([o*o*e[0]+2*o*n*c+n*n*t[0],o*o*e[1]+2*o*n*u+n*n*t[1]])}return h}function o(e,t){if(2>e.length)return e;let i=t/2+1,r=[];for(let t=0;e.length>t;t++){let n,o,a=e[t];0===t?(n=e[1][0]-a[0],o=e[1][1]-a[1]):t===e.length-1?(n=a[0]-e[t-1][0],o=a[1]-e[t-1][1]):(n=e[t+1][0]-e[t-1][0],o=e[t+1][1]-e[t-1][1]);let s=Math.sqrt(n*n+o*o)||1;r.push([a[0]+o/s*i,a[1]+-n/s*i])}return r}function a(e,t,i,r,n){let o=t[0]-e[0],a=t[1]-e[1],s=Math.sqrt(o*o+a*a);if(0===s)return[e,t];let l=a/s,c=-o/s,u=n/2+1;return[[e[0]+l*u,e[1]+c*u],[t[0]+l*u,t[1]+c*u]]}function s(e){if(null==e)return 0;if("number"==typeof e&&Number.isFinite(e)&&e>=0&&.5>e)return e;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${e+""}.`)}function l(e,t,i,r,n,o,a=0,s=r){if(o){let e=$(o,t,i,r,a);if(e&&!1!==e.node.interactive)return e}else{let n=null,o=1/0;for(let a of e){if("point"!==a.type||!1===a.interactive)continue;let e=a.x-t,s=a.y-i,l=Math.sqrt(e*e+s*s);X(a.r,r)>=l&&o>l&&(n=a,o=l)}if(n)return{node:n,distance:o}}let l=null,c=1/0;for(let n of e){if("glyph"!==n.type||null==n.datum)continue;let e=dt(n.glyph,n.size),o=n.x+e.centerDx-t,a=n.y+e.centerDy-i,s=Math.sqrt(o*o+a*a);X(e.radius,r)>=s&&c>s&&(l=n,c=s)}if(l)return{node:l,distance:c};for(let r=e.length-1;r>=0;r--){let o=e[r];if("geoarea"!==o.type)continue;let a=o;if(!1===a.interactive)continue;let[[s,l],[c,u]]=a.bounds;if(!(s>t||t>c||l>i||i>u)&&(a._cachedPath2D||(a._cachedPath2D=new Path2D(a.pathData)),n.isPointInPath(a._cachedPath2D,t,i)))return{node:a,distance:0}}let u=null,h=1/0;for(let r of e){if("line"!==r.type)continue;let e=r,{path:n}=e,o=Math.max((e.style.strokeWidth??2)+4,5,s),a=t-o,l=t+o,c=i-o,d=i+o;for(let r=0;n.length-1>r;r++){let s=n[r],p=n[r+1],f=s[0],m=s[1],g=p[0],y=p[1];if(a>f&&a>g||f>l&&g>l||c>m&&c>y||m>d&&y>d)continue;let v=te(t,i,f,m,g,y);o>=v&&h>v&&(u=e,h=v)}}return u?{node:u,distance:h}:null}function c(e){let{width:t,height:i,totalWidth:r,totalHeight:n,margin:o,showAxes:a,title:s,description:l,idPrefix:c,legend:u,legendHoverBehavior:h,legendClickBehavior:d,legendHighlightedCategory:p,legendIsolatedCategories:f,legendPosition:m,legendLayout:g,foregroundGraphics:y,annotations:v,onAnnotationActivate:b,onObservation:R,chartId:w,chartType:P,autoPlaceAnnotations:x,svgAnnotationRules:k,pointNodes:S,geoProjection:C}=e,L=et({onAnnotationActivate:b,onObservation:R,chartId:w,chartType:P}),A=ti([v?.length??0,new Map]),D=v?.length??0;A.current[0]!==D&&(A.current=[D,new Map]);let j=ei(()=>{if(!v||0===v.length)return null;let e=Q(v),r=C?e.map(e=>{if(!Array.isArray(e.coordinates)||2>e.coordinates.length)return e;let t=C(Number(e.coordinates[0]),Number(e.coordinates[1]));return t?{...e,x:t[0],y:t[1]}:e}):e,n={scales:{x:e=>Number(e),y:e=>Number(e)},timeAxis:"x",width:t,height:i,frameType:"xy",pointNodes:S,stickyPositionCache:A.current[1]},o=x?De({annotations:r,context:n,..."object"==typeof x?x:{}}):r;return $e(o,Be("xy",L),k,n)},[v,x,k,t,i,S,L,C]),M=a||s||l||u||y||j&&j.length>0,T=ii(),{titleId:B,descId:_,labelledBy:I}=K(c||w||T);return M?ni("svg",{role:"img","aria-labelledby":I,width:r,height:n,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[ri("title",{id:B,children:V(s,"Geographic chart")}),ri("desc",{id:_,children:Y(s,l,{familyPhrase:"geographic data visualization",fallback:"geographic data visualization"})}),ni("g",{transform:"translate("+o.left+","+o.top+")",children:[j,y]}),ri(xe,{title:s,totalWidth:r,marginTop:o.top}),Ue({legend:u,totalWidth:r,totalHeight:n,margin:o,legendPosition:m,title:s,legendLayout:g,legendHoverBehavior:h,legendClickBehavior:d,legendHighlightedCategory:p,legendIsolatedCategories:f})]}):null}function u([e,t,i]){let r=1<<i;return[e-Math.floor(e/r)*r,t,i]}function h(e,t,i,r,n){return"function"==typeof e?e(t,i,r,n):e.replace("{z}",t+"").replace("{x}",i+"").replace("{y}",r+"").replace("{r}",n>1?"@2x":"")}function d(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}function p(e){let t=0;for(let i=1;e.length>i;i++){let r=e[i][0]-e[i-1][0],n=e[i][1]-e[i-1][1];t+=Math.sqrt(r*r+n*n)}return t}function f(e,t){let i=0;for(let r=1;e.length>r;r++){let n=e[r][0]-e[r-1][0],o=e[r][1]-e[r-1][1],a=Math.sqrt(n*n+o*o);if(i+a>=t||r===e.length-1){let s=a>0?(t-i)/a:0,l=a>.001?a:1;return{x:e[r-1][0]+n*s,y:e[r-1][1]+o*s,nx:-o/l,ny:n/l}}i+=a}let r=e[e.length-1];return{x:r[0],y:r[1],nx:0,ny:0}}function m(e){if(!e)return;let t=[];for(let i of e)if("point"===i.type)t.push(i);else if("glyph"===i.type){let e=i,r=dt(e.glyph,e.size);t.push({pointId:e.pointId,x:e.x+r.centerDx,y:e.y+r.centerDy,r:r.radius})}return t}function g({data:e}){if(!e)return null;if(e.properties)return mi("div",{className:"semiotic-tooltip",style:_e,children:mi("div",{style:{fontWeight:600},children:e.properties.name||e.properties.NAME||e.properties.id||"Feature"})});let t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;let i=Ve(t),r=null!=i.title?i.title+"":null;return null==r&&0===i.entries.length?null:gi("div",{className:"semiotic-tooltip",style:_e,children:[null!=r&&mi("div",{style:{fontWeight:600,marginBottom:i.entries.length?2:0},children:r}),i.entries.map(e=>gi("div",{children:[gi("span",{style:{opacity:.7},children:[e.key,": "]}),mi("span",{style:{fontWeight:600},children:U(e.value)})]},e.key))]})}function y(){if(null!==vi)return vi;if(typeof window>"u")return!1;let e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t="u">typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&4>=navigator.hardwareConcurrency,i="u">typeof navigator&&"number"==typeof navigator.deviceMemory&&4>=navigator.deviceMemory;return vi=e||t||i}function v(){return y()?12:30}function b(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function R(e){return e?e.getContext("2d"):null}function w(e){let t=e.pointer.clientX-e.canvasRect.left-e.margin.left,i=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>i||i>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="u">typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));let r=R(e.hitCanvasRef.current);if(!r)return{kind:"unavailable"};let n=l(e.scene,t,i,Ne(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,Ne(6,e.pointer.pointerType));if(!n)return{kind:"miss"};let{node:o}=n,a=o.datum,s=Array.isArray(a)?null:a?.properties?a:a?.data||a,c="point"===o.type?o.x:"geoarea"===o.type?o.centroid[0]:t,u="point"===o.type?o.y:"geoarea"===o.type?o.centroid[1]:i;return{kind:"hit",node:o,hover:{...s,...s?.properties||{},data:s,properties:s?.properties,__semioticHoverData:!0,x:c,y:u}}}function P({graphics:e,size:t,margin:i,readScales:r,tracker:n}){return wi(n.subscribe,n.getSnapshot,n.getSnapshot),Ri.createElement(Ri.Fragment,null,re(e,t,i,r()))}import{useCustomChartScaffold as x}from"./c-55BAJ333.min.js";import{useChartSetup as k}from"./c-KCRJGUHP.min.js";import{resolveNodeColor as S}from"./c-ORLEBW72.min.js";import{lineCanvasRenderer as C}from"./c-NYZ2QNAM.min.js";import{RingBuffer as L,compactTimestampBufferForRemoval as A,computePulseIntensity as D,hasActivePulses as j,pushWithTimestamp as M,refreshIdlePulse as T,setPulseState as B,useGeoKeyboardNavigation as _,useSemanticFrameInteractions as I}from"./c-BNG5ECK5.min.js";import{pointCanvasRenderer as E}from"./c-OO5QLMJC.min.js";import{needsDataCanvasPaint as N,needsInteractionCanvasPaint as F}from"./c-V4XMSLC3.min.js";import{glyphCanvasRenderer as O}from"./c-4FN7Q6VQ.min.js";import{StalenessBadge as z,attachUpdateResultStore as W,buildBaseMetadataProps as H,buildCustomBehaviorProps as G,composeOverlays as q,computeDecayOpacity as Z,filterAnnotationsByStatus as Q,findHitPointInQuadtree as $,formatVal as U,getHitRadius as X,overlayAccessibleDescription as Y,overlayAccessibleIds as K,overlayAccessibleTitle as V,paintCanvasBackground as J,paintSceneWithBackend as ee,pointToSegmentDistance as te,renderSceneWithBackend as ie,resolveFrameGraphics as re,resolveFrameLayers as ne,runCustomLayoutAttempt as oe,shouldHandleFramePointer as ae,useConfigSync as se,useLayoutSelectionSync as le,useLegendCategoryEmission as ce,useStableShallow as ue,useStalenessCheck as he,warnCustomLayoutDiagnostics as de}from"./c-ITKX3RC5.min.js";import{wrapWithCustomLayoutSelection as pe}from"./c-YDECTEUW.min.js";import{renderPathPulse as fe}from"./c-W4ZUKSEQ.min.js";import{buildResolveColor as me,resolveCustomLayoutPalette as ge}from"./c-EUBTECGM.min.js";import{AccessibleDataTable as ye,AccessibleTablePortal as ve,AriaLiveTooltip as be,CanvasFrameBackground as Re,FlippingTooltip as we,FocusRing as Pe,SVGChartTitle as xe,SafeRender as ke,SceneRevisionDiagnosticsObserver as Se,ScreenReaderSummary as Ce,SkipToTableLink as Le,UpdateResultTracker as Ae,annotationLayout as De,computeCanvasAriaLabel as je,computeEasing as Me,computeRawProgress as Te,createDefaultAnnotationRules as Be,defaultTooltipStyle as _e,filterSparseArray as Ie,getDevicePixelRatio as Ee,getPointerHitRadius as Ne,glyphNodeToSVG as Fe,isAnnotationActivationTarget as Oe,isServerEnvironment as ze,lerp as We,normalizeTooltip as He,now as Ge,observationInputType as qe,prepareCanvas as Ze,rehitCanvasMarkCursor as Qe,renderAnnotationPass as $e,renderLegendFromConfig as Ue,sceneHasAuthoredCursor as Xe,sceneMarkCursor as Ye,setCanvasMarkCursor as Ke,smartTooltipEntries as Ve,svgFill as Je,useAnnotationActivationOptions as et,useCanvasMarkCursorCleanup as tt,useFrame as it,useFrameCanvasHost as rt,useHydration as nt,useSceneRevisionDiagnostics as ot,useWasHydratingFromSSR as at,withSceneMarkCursor as st}from"./c-LMGSSD2E.min.js";import{STREAMING_PALETTE as lt}from"./c-CPV4N35K.min.js";import{resolveThemeSemanticColors as ct}from"./c-JUKIWTBJ.min.js";import{getMax as ut}from"./c-QA3HMQJP.min.js";import{coerceCanvasFill as ht,glyphHitGeometry as dt,hatchPatternDef as pt,isHatchFill as ft,resolveCSSColor as mt}from"./c-553QUDKA.min.js";import{forwardRef as gt,memo as yt,useCallback as vt,useEffect as bt,useMemo as Rt,useRef as wt,useState as Pt}from"react";import{geoPath as xt}from"d3-geo";import{quadtree as kt}from"d3-quadtree";import{geoMercator as St,geoEqualEarth as Ct,geoAlbersUsa as Lt,geoOrthographic as At,geoNaturalEarth1 as Dt,geoEquirectangular as jt}from"d3-geo";var Mt={mercator:St,equalEarth:Ct,albersUsa:Lt,orthographic:At,naturalEarth:Dt,equirectangular:jt};import{scaleLinear as Tt}from"d3-scale";var Bt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],_t=["scene-style","data-paint","accessibility","evidence"],It=(e,t)=>({retainedData:e,invalidations:t}),Et=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Nt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ft=["scene-geometry","data-paint","accessibility","evidence"],Ot=["scene-style","data-paint","accessibility","evidence"],zt=["overlay","accessibility","evidence"],Wt=[],Ht={xAccessor:It("rebuild",Et),yAccessor:It("rebuild",Et),lineDataAccessor:It("rebuild",Et),pointIdAccessor:It("rebuild",Ft),lineIdAccessor:It("rebuild",Ft),windowSize:It("rebuild",Et),projection:It("preserve",Nt),projectionExtent:It("preserve",Nt),fitPadding:It("preserve",Nt),lineType:It("preserve",Nt),flowStyle:It("preserve",Nt),graticule:It("preserve",Nt),projectionTransform:It("preserve",Nt),customLayout:It("preserve",Nt),layoutConfig:It("preserve",Nt),layoutMargin:It("preserve",Nt),areaStyle:It("preserve",Ot),pointStyle:It("preserve",["scene-geometry","scene-style","data-paint","accessibility","evidence"]),lineStyle:It("preserve",Ot),colorScheme:It("preserve",Ot),themeCategorical:It("preserve",Ot),themeDiverging:It("preserve",Ot),themeSemantic:It("preserve",Ot),themeSequential:It("preserve",Ot),decay:It("preserve",Ot),pulse:It("preserve",Ot),layoutSelection:It("preserve",Ot),annotations:It("preserve",zt),autoPlaceAnnotations:It("preserve",zt),clock:It("preserve",Wt),transition:It("preserve",Wt),introAnimation:It("preserve",Wt),onLayoutError:It("preserve",Wt)},Gt=It("preserve",Nt),qt=class{constructor(){this.tracker=new Ae}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},Bt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},_t):this.recordNoop("restyle")}recordConfig(e,t={}){let i=function(e){let t="preserve",i=new Set;for(let r of e){let e=Ht[r]??Gt;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}(e),r=new Set(i.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}};import{geoDistance as Zt,geoGraticule as Qt,geoInterpolate as $t}from"d3-geo";var Ut=class l{constructor(e){this.updateResults=new qt,this.scene=[],this.scales=null,this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this._quadtree=null,this._maxPointRadius=0,this.projection=null,this.geoPath=null,this.baseScale=0,this.baseTranslate=[0,0],this.baseRotation=[0,0,0],this.currentZoom=1,this.cartogramLayout=null,this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.streaming=!1,this.lastIngestTime=0,this.timestampBuffer=null,this.activeTransition=null,this.prevPositions=null,this._hasRenderedOnce=!1,this.config=function(e){return{...e,fitPadding:s(e.fitPadding)}}(e)}currentTime(){return this.config.clock?.()??Ge()}getConfiguredWindowSize(){let e=this.config.windowSize??500;if(!Number.isInteger(e)||1>e)throw Error("GeoPipelineStore windowSize must be a positive integer");return e}retainNewestLines(e=this.getConfiguredWindowSize()){this.lineData.length>e&&(this.lineData=this.lineData.slice(-e))}resizeStreamingWindow(e){if(this.pointBuffer){let t=this.pointBuffer.toArray(),i=this.timestampBuffer?.toArray()??[],r=t.slice(-e),n=i.slice(-r.length),o=this.currentTime();this.pointBuffer=new L(e),this.timestampBuffer=new L(e),r.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(n[t]??o)})}this.retainNewestLines(e)}updateConfig(e){let t=function(e){return"fitPadding"in e?{...e,fitPadding:s(e.fitPadding)}:e}(e),i=this.config,r=this.getConfiguredWindowSize(),n=Object.keys(t).filter(e=>t[e]!==i[e]);this.config={...this.config,...t};let o=this.getConfiguredWindowSize(),a=this.streaming&&o!==r;a&&(this.resizeStreamingWindow(o),this.version++),"customLayout"in t&&!t.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(n,{retainedDataChanged:a})}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}setAreas(e){this.areas=e,this.updateResults.recordData("replace",e.length)}setAreasWithResult(e){return this.setAreas(e),this.updateResults.last}setPoints(e){this.pointData=e.slice(),this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.updateResults.recordData("replace",e.length)}setPointsWithResult(e){return this.setPoints(e),this.updateResults.last}setLines(e){this.lineData=e.slice(),this.streaming&&this.retainNewestLines(),this.updateResults.recordData("replace",e.length)}setLinesWithResult(e){return this.setLines(e),this.updateResults.last}initStreaming(e){void 0!==e&&e!==this.config.windowSize&&(this.config={...this.config,windowSize:e});let t=this.getConfiguredWindowSize(),i=this.pointBuffer?this.pointBuffer.toArray():this.pointData,r=this.timestampBuffer?.toArray()??[],n=i.slice(-t),o=r.slice(-n.length),a=this.currentTime();this.pointBuffer=new L(t),this.timestampBuffer=new L(t),n.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(o[t]??a)}),this.pointData=[],this.retainNewestLines(t),this.streaming=!0}pushPoint(e){this.pointBuffer||this.initStreaming();let t=this.currentTime();M(this.pointBuffer,e,this.timestampBuffer,t),this.lastIngestTime=t,this.updateResults.recordData("ingest",1)}pushPointWithResult(e){return this.pushPoint(e),this.updateResults.last}pushMany(e){this.pointBuffer||this.initStreaming();let t=this.currentTime();for(let i of e)M(this.pointBuffer,i,this.timestampBuffer,t);this.lastIngestTime=t,this.updateResults.recordData("ingest",e.length)}pushManyWithResult(e){return this.pushMany(e),this.updateResults.last}pushLine(e){null!=e&&"object"==typeof e?(this.streaming||this.initStreaming(),this.lineData.push(e),this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",1)):this.updateResults.recordNoop("ingest")}pushManyLines(e){if(!Array.isArray(e)||0===e.length)return void this.updateResults.recordNoop("ingest");let t=e.filter(e=>null!=e&&"object"==typeof e);if(0!==t.length){this.streaming||this.initStreaming();for(let e of t)this.lineData.push(e);this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",t.length)}else this.updateResults.recordNoop("ingest")}removeLine(e){let{lineIdAccessor:t}=this.config;if(!t)throw Error("removeLine() requires lineIdAccessor to be configured");let i="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]),n=[];return this.lineData=this.lineData.filter(e=>!r.has(i(e)+"")||(n.push(e),!1)),n.length>0?(this.version++,this.updateResults.recordData("remove",n.length)):this.updateResults.recordNoop("remove"),n}getLines(){return this.lineData.slice()}removePoint(e){let{pointIdAccessor:t}=this.config;if(!t)throw Error("removePoint() requires pointIdAccessor to be configured");let i="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]);if(this.streaming&&this.pointBuffer){let e=e=>r.has(i(e)+"");A(this.pointBuffer,this.timestampBuffer,e);let t=this.pointBuffer.remove(e);return t.length>0?(this.version++,this.updateResults.recordData("remove",t.length)):this.updateResults.recordNoop("remove"),t}{let e=[];return this.pointData=this.pointData.filter(t=>!r.has(i(t)+"")||(e.push(t),!1)),e.length>0?(this.version++,this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}}clear(){this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.scene=[],this.scales=null,this._hasRenderedOnce=!1,this.activeTransition=null,this.prevPositions=null,this._quadtree=null,this._maxPointRadius=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this.version++,this.updateResults.recordData("clear")}restyleScene(e){let t=this._customRestyle;if(t){for(let i of this.scene){let r=this._baseStyles.get(i)??i.style,n=t(i,e);i.style=n?{...r,...n}:r}this.markStylePaintPending(),this.updateResults.recordRestyle(!0)}else this.updateResults.recordRestyle(!1)}computeScene(e){let{config:t}=this,i=this.projection,r=this.geoPath,n=this.scales,o=this.baseScale,a=[...this.baseTranslate],s=[...this.baseRotation],l=this.scene;this.projection=function(e){if(!e)return Ct();if("string"==typeof e){let t=Mt[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),Ct())}if("object"==typeof e&&"type"in e){let t=Mt[e.type],i=t?t():Ct();return e.rotate&&"rotate"in i&&i.rotate(e.rotate),e.center&&"center"in i&&i.center(e.center),i}return e}(t.projection),this.geoPath=xt(this.projection),this.fitProjection(e),this.geoPath=xt(this.projection);let c=this.projection;this.scales={projection:c,geoPath:this.geoPath,projectedPoint:(e,t)=>c([e,t]),invertedPoint:(e,t)=>c.invert?c.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let u=this.buildSceneNodes(e);if(this._customLayoutFailedThisBuild)!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.projection=i,this.geoPath=r,this.scales=n,this.baseScale=o,this.baseTranslate=a,this.baseRotation=s):(this.scene=[],this.rebuildQuadtree());else{if(this.scene=u,this.rebuildQuadtree(),t.projectionTransform&&this.applyCartogramTransform(t.projectionTransform,e),t.decay&&this.streaming&&this.applyDecay(),t.pulse&&this.streaming&&this.applyPulse(),t.transition&&!this._hasRenderedOnce&&this.scene.length>0&&t.introAnimation){let t=e.width/2,i=e.height/2,r=this.scene.filter(e=>"point"===e.type).map(e=>({...e,x:t,y:i}));r.length>0&&this.startTransition(r)}this._hasRenderedOnce=!0,t.transition&&l.length>0&&this.startTransition(l),this.version++}}fitProjection(i){let r=this.projection,n=this.config,o=[...this.areas],a=e(n.xAccessor,"lon"),s=e(n.yAccessor,"lat"),l=this.getPoints();if(l.length>0){let e=l.map(e=>[a(e),s(e)]);o.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}let c=t(n.lineDataAccessor);for(let e of this.lineData){let t=c(e);if(t&&t.length>0){let e=t.map(e=>[a(e),s(e)]);o.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}})}}if(0!==o.length){if(n.projectionExtent){let[[e,t],[o,a]]=n.projectionExtent;r.fitExtent([[0,0],[i.width,i.height]],{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[e,t],[e,a],[o,a],[o,t],[e,t]]]}})}else if(r.clipAngle&&(r.clipAngle()??0)>0){let e=n.fitPadding??0,t=Math.min(i.width,i.height);r.scale(t/2-t*e),r.translate([i.width/2,i.height/2])}else{let e=n.fitPadding??0,t=i.width*e,a=i.height*e;r.fitExtent([[t,a],[i.width-t,i.height-a]],{type:"FeatureCollection",features:o})}this.baseScale=r.scale(),this.baseTranslate=r.translate(),this.baseRotation=r.rotate?.()??[0,0,0]}}applyZoomTransform(e,t){let i=this.projection;if(!i)return;let r=this.geoPath,n=this.scales,o=i.scale(),a=[...i.translate()],s=this.currentZoom;i.scale(this.baseScale*e.k),i.translate([this.baseTranslate[0]*e.k+e.x,this.baseTranslate[1]*e.k+e.y]),this.currentZoom=e.k,this.geoPath=xt(i),this.scales={projection:i,geoPath:this.geoPath,projectedPoint:(e,t)=>i([e,t]),invertedPoint:(e,t)=>i.invert?i.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(i.scale(o),i.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=n):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyZoomScale(e,t){let i=this.projection;if(!i)return;let r=this.geoPath,n=this.scales,o=i.scale(),a=[...i.translate()],s=this.currentZoom;i.scale(this.baseScale*e),i.translate(this.baseTranslate),this.currentZoom=e,this.geoPath=xt(i),this.scales={projection:i,geoPath:this.geoPath,projectedPoint:(e,t)=>i([e,t]),invertedPoint:(e,t)=>i.invert?i.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(i.scale(o),i.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=n):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyRotation(e,t){let i=this.projection;if(!i||!i.rotate)return;let r=this.geoPath,n=this.scales,o=[...i.rotate()];i.rotate(e),this.geoPath=xt(i),this.scales={projection:i,geoPath:this.geoPath,projectedPoint:(e,t)=>i([e,t]),invertedPoint:(e,t)=>i.invert?i.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;let a=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(i.rotate(o),this.geoPath=r,this.scales=n):(this.scene=[],this.rebuildQuadtree()):(this.scene=a,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}setRotation(e){let t=this.projection;!t||!t.rotate||t.rotate(e)}hasProjection(){return null!=this.projection}getRotation(){return this.projection?.rotate?.()??this.baseRotation}getBaseProjectionState(){return{scale:this.baseScale,translate:[...this.baseTranslate]}}getPoints(){return this.streaming&&this.pointBuffer?this.pointBuffer.toArray():this.pointData}rebuildQuadtree(){let e=0,t=0;for(let i of this.scene)"point"===i.type&&!1!==i.interactive&&(t++,i.r>e&&(e=i.r));if(this._maxPointRadius=e,l.QUADTREE_THRESHOLD>=t)return void(this._quadtree=null);let i=Array(t),r=0;for(let e of this.scene)"point"===e.type&&!1!==e.interactive&&(i[r++]=e);this._quadtree=kt().x(e=>e.x).y(e=>e.y).addAll(i)}get quadtree(){return this._quadtree}get maxPointRadius(){return this._maxPointRadius}buildSceneNodes(s){this._customLayoutFailedThisBuild=!1;let{config:l}=this,c=this.projection,u=this.geoPath;if(l.customLayout&&this.scales){let e=l.layoutMargin??{top:0,right:0,bottom:0,left:0},t=ge(l.colorScheme,l.themeCategorical,lt),i={areas:this.areas.slice(),points:this.getPoints().slice(),lines:this.lineData.slice(),scales:this.scales,dimensions:{width:s.width,height:s.height,margin:e,plot:{x:0,y:0,width:s.width,height:s.height}},theme:{semantic:l.themeSemantic??{},categorical:[...t]},resolveColor:me(t,l.colorScheme),config:l.layoutConfig??{},selection:l.layoutSelection??null},r=oe({family:"geo",logLabel:"geo customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:l.onLayoutError,run:()=>l.customLayout(i)});if("failure"===r.kind)return this.lastCustomLayoutFailure=r.diagnostic,this._customLayoutFailedThisBuild=!0,r.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);let n=r.result,o=n.nodes??[];if(this.customLayoutOverlays=n.overlays??null,this.lastCustomLayoutResult=n,this.lastCustomLayoutFailure=null,this._customRestyle=n.restyle,this.hasCustomRestyle=!!n.restyle,this._baseStyles=new WeakMap,this.hasCustomRestyle){for(let e of o)this._baseStyles.set(e,e.style);this.restyleScene(l.layoutSelection??null)}return de({label:"geo customLayout",nodes:o,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),o}return this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,function({config:s,projection:l,path:c,areas:u,points:h,lines:d,layout:p}){let f=e(s.xAccessor,"lon"),m=e(s.yAccessor,"lat"),g=[],y=function(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}(s),v=function(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}(s),b=function(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}(s);if(s.graticule){let e=!0===s.graticule?{}:s.graticule,t=Qt();e.step&&t.step(e.step);let i=c(t())||"";i&&g.push({type:"geoarea",pathData:i,centroid:[p.width/2,p.height/2],bounds:[[0,0],[p.width,p.height]],screenArea:0,style:{fill:"none",stroke:e.stroke||"#e0e0e0",strokeWidth:e.strokeWidth??.5,strokeDasharray:e.strokeDasharray||"2,2"},datum:null,interactive:!1})}for(let e of u){let t=c(e);if(!t)continue;let r=c.centroid(e),n=c.bounds(e),o=c.area(e);g.push({type:"geoarea",pathData:t,centroid:r,bounds:n,screenArea:o,style:i(s.areaStyle,e,y),datum:e,interactive:!0})}let R=t(s.lineDataAccessor);for(let e of d){let t=R(e);if(!t||2>t.length)continue;let c=[];if("geo"===s.lineType){let e=Array(t.length);for(let i=0;t.length>i;i++)e[i]=[f(t[i]),m(t[i])];for(let t=0;e.length-1>t;t++){let i=e[t],r=e[t+1],n=Zt(i,r)||0,o=Math.max(2,Math.ceil(n/(Math.PI/180))),a=$t(i,r);for(let e=0;o>=e;e++){if(t>0&&0===e)continue;let i=l(a(e/o));null!=i&&c.push(i)}}}else for(let e=0;t.length>e;e++){let i=t[e],r=l([f(i),m(i)]);null!=r&&c.push(r)}if(2>c.length)continue;let u=i(s.lineStyle,e,v),h="number"==typeof u.strokeWidth?u.strokeWidth:1;2!==t.length||2>c.length||"arc"!==s.flowStyle?2===t.length&&c.length>=2&&"offset"===s.flowStyle&&(c="geo"===s.lineType?o(c,h):a(c[0],c[c.length-1],0,0,h)):c=n(c[0],c[c.length-1]);let d=r(c,p.width);if(d.length>1)for(let t of d)2>t.length||g.push({type:"line",path:t,style:{...u,_edgeFade:!0},datum:e});else g.push({type:"line",path:2>c.length&&d[0]||c,style:u,datum:e})}let w=s.pointIdAccessor?"function"==typeof s.pointIdAccessor?s.pointIdAccessor:e=>e[s.pointIdAccessor]:null,P=l.clipAngle?l.clipAngle()??0:0,x=P>0?P*Math.PI/180:null,k=l.rotate?l.rotate():[0,0,0],S="function"==typeof l.center?l.center():[0,0],C=[(S[0]??0)-k[0],(S[1]??0)-k[1]];for(let e of h){let t=f(e),i=m(e);if(null!=x&&Zt([t,i],C)>x)continue;let r=l([t,i]);if(!r)continue;let n=s.pointStyle?s.pointStyle(e):{...b},o={type:"point",x:r[0],y:r[1],r:n.r||4,style:n,datum:e,pointId:w?w(e)+"":void 0};g.push(o)}return g}({config:l,projection:c,path:u,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:s})}applyCartogramTransform(e,t){let i=function(e,t,i,r){let n=e.filter(e=>"point"===e.type);if(2>n.length)return null;let o=t.strength??1,a=Number.isFinite(o)?Math.max(0,Math.min(1,o)):1,s="strip"===t.layout?"strip":"radial";if("radial"===s&&0===a)return null;let l=t.centerAccessor?"function"==typeof t.centerAccessor?t.centerAccessor:e=>e[t.centerAccessor]:e=>e.id,c="function"==typeof t.costAccessor?t.costAccessor:e=>e[t.costAccessor],u=n.find(e=>e.datum&&l(e.datum)+""==t.center+"");if(!u)return"production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Distance cartogram center "${t.center}" not found in point data`),null;let h=n.map(e=>e.datum?Number(c(e.datum)):NaN).filter(e=>isFinite(e)&&e>=0),d=ut(h,1);r>0&&"production"!==process.env.NODE_ENV&&console.warn("GeoFrame: Distance cartogram does not support area rendering. Areas will be ignored. Remove areas or set projectionTransform to null to render them.");for(let t=e.length-1;t>=0;t--){let i=e[t];"geoarea"===i.type&&i.interactive&&e.splice(t,1)}let p="strip"===s?function(e,t,i,r,n){let o=Math.max(3,Math.min(8,.35*n.height)),a=Math.max(1,n.width-2*o),s=n.height/2,l=Tt().domain([0,r]).range([0,a]);t.x=o,t.y=s;let c=[];for(let n of e){if(n===t)continue;if(!n.datum){n.x=o,n.y=s;continue}let e=Number(i(n.datum)),a=o+(isFinite(e)&&e>=0&&r>0?l(e):0);n.x=a,n.y=s,c.push({node:n,x:a})}c.sort((e,t)=>e.x-t.x);let u=Math.max(0,Math.min(n.height/2-1,6)),h=0;for(;c.length>h;){let e=h+1;for(;c.length>e&&3>Math.abs(c[e].x-c[h].x);)e++;let t=e-h;if(t>1&&u>0)for(let e=0;t>e;e++)c[h+e].node.y=s+(e-(t-1)/2)*Math.min(2.5,2*u/Math.max(1,t-1));h=e}return{cx:o,cy:s,maxCost:r,availableRadius:a,layout:"strip"}}(n,u,c,d,i):function(e,t,i,r,n,o){let a=t.x,s=t.y,l=o.width/2,c=o.height/2,u=Math.min(o.width,o.height)/2,h=Tt().domain([0,r]).range([0,u]);for(let o of e){if(o===t||!o.datum)continue;let e=o.x,u=o.y,d=Math.atan2(u-s,e-a),p=Math.hypot(e-a,u-s),f=Number(i(o.datum)),m=isFinite(f)&&f>=0?r>0?h(f):0:p,g=l+Math.cos(d)*m,y=c+Math.sin(d)*m;o.x=e+(g-e)*n,o.y=u+(y-u)*n}return t.x=a+(l-a)*n,t.y=s+(c-s)*n,{cx:t.x,cy:t.y,maxCost:r,availableRadius:u,layout:"radial"}}(n,u,c,d,a,i),f=e.filter(e=>"line"===e.type);if(f.length>0){let e=new Map;for(let t of n)null!=t.pointId&&e.set(t.pointId+"",[t.x,t.y]);for(let i of f){let r=i.datum?.source,n=i.datum?.target;if(null!=r&&null!=n){let o=e.get(r+""),a=e.get(n+"");if(o&&a)if("fractional"===t.lineMode&&i.path.length>2){let e=i.path[0],t=i.path[i.path.length-1],r=[o[0]-e[0],o[1]-e[1]],n=[a[0]-t[0],a[1]-t[1]],s=[0];for(let e=1;i.path.length>e;e++)s.push(s[e-1]+Math.hypot(i.path[e][0]-i.path[e-1][0],i.path[e][1]-i.path[e-1][1]));let l=s[s.length-1];i.path=i.path.map((e,t)=>{let o=l>0?s[t]/l:t/(i.path.length-1);return[e[0]+r[0]*(1-o)+n[0]*o,e[1]+r[1]*(1-o)+n[1]*o]})}else i.path=[o,a]}}}return p}(this.scene,e,t,this.areas.length);i&&(this.cartogramLayout=i)}applyDecay(){let e=this.config.decay;if(!e||!this.pointBuffer)return;let t=this.pointBuffer.size;if(0===t)return;let i=this.scene.filter(e=>"point"===e.type);for(let r=0;i.length>r;r++){let n=Z(e,r,t);i[r]._decayOpacity=n,i[r].style={...i[r].style,opacity:n}}}applyPulse(e=this.currentTime()){let t=this.config.pulse;if(!t||!this.timestampBuffer)return!1;let i=this.scene.filter(e=>"point"===e.type),r=this.timestampBuffer.toArray(),n=t.color||"rgba(255,255,255,0.6)",o=t.glowRadius??4,a=!1;for(let s=0;i.length>s&&r.length>s;s++){let l=D(t,r[s],e);a=B(i[s],l,n,o)||a}return a}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(e)}hasActivePulsesAt(e){return!!this.config.pulse&&j(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(e){let t=this.config.transition?.duration??300;if(0>=t)return;let i=new Map;for(let t of e)"point"===t.type&&t.pointId&&i.set(t.pointId,[t.x,t.y]);let r=this.scene.filter(e=>"point"===e.type),n=!1;for(let e of r)if(e.pointId){let t=i.get(e.pointId);t&&(e._targetX=e.x,e._targetY=e.y,e.x=t[0],e.y=t[1],(Math.abs(t[0]-e._targetX)>.5||Math.abs(t[1]-e._targetY)>.5)&&(n=!0))}for(let e of r)e.pointId&&!i.has(e.pointId)&&(e._targetOpacity=e.style?.opacity??e.style?.fillOpacity??1,e.style={...e.style,opacity:0},n=!0);n&&(this.activeTransition={startTime:this.currentTime(),duration:t})}cancelIntroAnimation(){this.activeTransition=null;for(let e of this.scene)"point"===e.type&&(null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0),null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0))}advanceTransition(e){if(!this.activeTransition)return!1;let t=Te(e,this.activeTransition),i=Me(t),r=this.scene.filter(e=>"point"===e.type);for(let e of r){if(null!=e._targetX&&null!=e._targetY){let t=e.y;e.x=We(e.x,e._targetX,i),e.y=We(t,e._targetY,i)}null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity*i})}if(t>=1){for(let e of r)null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0),null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0);return this.activeTransition=null,!1}return!0}};Ut.QUADTREE_THRESHOLD=500;var Xt=Ut;W(Xt);import{useCallback as Yt,useImperativeHandle as Kt}from"react";import{select as Vt}from"d3-selection";import{zoomIdentity as Jt}from"d3-zoom";import{useMemo as ei,useRef as ti,useId as ii}from"react";import{jsx as ri,jsxs as ni}from"react/jsx-runtime";import*as oi from"react";import{jsx as ai,jsxs as si}from"react/jsx-runtime";import{zoom as li,zoomIdentity as ci}from"d3-zoom";import{select as ui}from"d3-selection";var hi=new WeakMap,di=1,pi=class{constructor(e=256){this.cache=new Map,this.limit=d(e)}setLimit(e){this.limit=d(e),this.cache.size>this.limit&&this.evict()}get(e){let t=this.cache.get(e);return t&&(t.lastUsed=performance.now()),t}set(e,t){this.cache.set(e,t),this.cache.size>this.limit&&this.evict()}evict(){for(;this.cache.size>this.limit;){let e,t=1/0;for(let[i,r]of this.cache)t>r.lastUsed&&(t=r.lastUsed,e=i);if(!e)break;{let t=this.cache.get(e);t&&(t.img.onload=null,t.img.onerror=null,t.img.src=""),this.cache.delete(e)}}}clear(){for(let e of this.cache.values())e.img.onload=null,e.img.onerror=null,e.img.src="";this.cache.clear()}},fi=class{constructor(e){this.capacity=e,this.particles=Array(e);for(let t=0;e>t;t++)this.particles[t]={t:0,offset:0,lineIndex:0,active:!1,x:0,y:0}}spawn(e,t=Math.random){for(let i=0;this.capacity>i;i++){let r=this.particles[i];if(!r.active)return r.active=!0,r.t=0,r.offset=.6*(t()-.5),r.lineIndex=e,r.x=0,r.y=0,r}return null}step(e,t,i,r){for(let n=0;this.capacity>n;n++){let o=this.particles[n];if(!o.active)continue;let a=i[o.lineIndex];if(!a||2>a.length){o.active=!1;continue}if(o.t+=e*t,o.t>=1){o.active=!1;continue}let s=p(a),l=f(a,o.t*s),c=(r[o.lineIndex]||2)/2;o.x=l.x+l.nx*o.offset*c*2,o.y=l.y+l.ny*o.offset*c*2}}countForLine(e){let t=0;for(let i=0;this.capacity>i;i++)this.particles[i].active&&this.particles[i].lineIndex===e&&t++;return t}clear(){for(let e=0;this.capacity>e;e++)this.particles[e].active=!1}};import{jsx as mi,jsxs as gi}from"react/jsx-runtime";g.ownsChrome=!0;var yi={top:10,right:10,bottom:10,left:10},vi=null,bi={width:28,height:28,border:"1px solid rgba(0,0,0,0.2)",borderRadius:4,background:"rgba(255,255,255,0.9)",color:"#333",fontSize:16,fontWeight:600,lineHeight:1,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,boxShadow:"0 1px 3px rgba(0,0,0,0.1)"};import*as Ri from"react";import{useSyncExternalStore as wi}from"react";import{jsx as Pi,jsxs as xi}from"react/jsx-runtime";var ki=yt(gt(function(e,t){let{projection:i,projectionExtent:r,fitPadding:n,projectionTransform:o,areas:a,points:s,lines:d,customLayout:p,layoutConfig:f,layoutSelection:x,onLayoutError:k,xAccessor:L,yAccessor:A,lineDataAccessor:D,pointIdAccessor:j,lineIdAccessor:M,lineType:B="geo",flowStyle:W="basic",graticule:H,zoomable:G,zoomExtent:Z,onZoom:Q,dragRotate:$,showParticles:U,particleStyle:X,tileURL:Y,tileAttribution:K,tileCacheSize:V,size:te,width:re,height:oe,responsiveWidth:de,responsiveHeight:me,margin:ge,className:xe,background:ke,maxDevicePixelRatio:Ae,windowSize:De=500,renderMode:Me,areaStyle:Te,pointStyle:Be,lineStyle:_e,colorScheme:We,enableHover:He=!0,hoverAnnotation:Ge,tooltipContent:$e,allowTooltipOverflow:Ue=!1,customClickBehavior:Ve,customHoverBehavior:et,onObservation:lt,annotationObservationCallback:ut,chartId:dt,annotations:gt,onAnnotationActivate:yt,autoPlaceAnnotations:xt,svgAnnotationRules:kt,decay:St,pulse:Ct,transition:Lt,animate:At,staleness:Dt,frameScheduler:jt,clock:Mt,random:Tt,seed:Bt,paused:_t=!1,suspendWhenHidden:It=!0,backgroundGraphics:Et,foregroundGraphics:Nt,title:Ft,legend:Ot,legendPosition:zt,legendLayout:Wt,legendHoverBehavior:Ht,legendClickBehavior:Gt,legendHighlightedCategory:qt,legendIsolatedCategories:Zt,legendCategoryAccessor:Qt,onCategoriesChange:$t,showAxes:Ut,accessibleTable:ei=!0,description:ti,summary:ii}=e,{customHoverBehavior:ri,customClickBehavior:ni,hasClickBehavior:mi}=I({customHoverBehavior:et,customClickBehavior:Ve,onObservation:lt,chartId:dt,chartType:"StreamGeoFrame"}),gi=te||[re||600,oe||400],vi=wt(!0),wi=it({sizeProp:gi,responsiveWidth:de,responsiveHeight:me,userMargin:ge,marginDefault:yi,title:Ft,legend:Ot,legendPosition:zt,legendLayout:Wt,legendMarginReserved:e.__legendMarginReservedFor===Ot,animate:At,transitionProp:Lt,frameScheduler:jt,clock:Mt,random:Tt,seed:Bt,paused:_t,suspendWhenHidden:It,themeDirtyRef:vi}),{reducedMotionRef:ki,responsiveRef:Si,size:Ci,margin:Li,adjustedWidth:Ai,adjustedHeight:Di,transition:ji,introEnabled:Mi,tableId:Ti,frameRuntime:Bi,rafRef:_i,renderFnRef:Ii,scheduleRender:Ei,currentTheme:Ni}=wi,Fi=nt(),Oi=at(),zi=Rt(()=>Array.isArray(a)?Ie(a):a,[a]),Wi=Rt(()=>Ie(s),[s]),Hi=Rt(()=>Ie(d),[d]),Gi=$??"orthographic"===b(i),qi=Rt(()=>({projection:i,projectionExtent:r,fitPadding:n,xAccessor:L,yAccessor:A,lineDataAccessor:D,lineType:B,flowStyle:W,areaStyle:Te,pointStyle:Be,lineStyle:_e,colorScheme:We,themeSemantic:ct(Ni),themeSequential:Ni?.colors?.sequential,themeDiverging:Ni?.colors?.diverging,themeCategorical:Ni?.colors?.categorical,graticule:H,projectionTransform:o,windowSize:De,clock:Bi.now,decay:St,pulse:Ct,transition:ji,introAnimation:Mi,annotations:gt,pointIdAccessor:j,lineIdAccessor:M,customLayout:p,layoutConfig:f,onLayoutError:k,layoutMargin:Li}),[i,r,n,L,A,D,B,W,Te,Be,_e,We,Ni,H,o,De,Bi.now,St,Ct,ji,Mi,gt,j,M,p,f,k,Li]),Zi=ue(qi),Qi=wt(null);Qi.current||(Qi.current=new Xt(Zi));let $i=Qi.current,Ui=wt(null),Xi=Ui.current??(Ui.current=function(e){let t=new Set,i=0,r=e;return{subscribe:e=>(t.add(e),()=>t.delete(e)),getSnapshot:()=>i,sync(e){if(e!==r){r=e,i+=1;for(let e of t)e()}}}}($i.scales)),Yi=ze||!Fi&&Oi;Yi&&(zi||s||d)&&(zi&&$i.setAreas(zi),s&&$i.setPoints(Wi),d&&$i.setLines(Hi),$i.computeScene({width:Ai,height:Di}));let{resolvedForeground:Ki,resolvedBackground:Vi,themeBackground:Ji,surfaceBackground:er}=function({tracker:e,readScales:t,...i}){let r=r=>"function"==typeof r?Ri.createElement(P,{graphics:r,size:i.size,margin:i.margin,readScales:t,tracker:e}):r;return{...ne({...i,resolveScaleAwareGraphics:!1}),resolvedForeground:r(i.foregroundGraphics),resolvedBackground:r(i.backgroundGraphics)}}({foregroundGraphics:Nt,backgroundGraphics:Et,size:Ci,margin:Li,scales:$i.scales,background:ke,themeBackgroundColor:Ni.colors.background,tracker:Xi,readScales:()=>$i.scales}),tr=wt(null),ir=wt(null),rr=wt(null);Y&&!rr.current&&(rr.current=new pi(V??256)),rr.current?.setLimit(V??256);let nr=wt(gt),or=wt(null),ar=wt(ci),sr=wt(!1),lr=wt(null),cr=vt(e=>{lr.current=e,Si&&"object"==typeof Si&&(Si.current=e)},[Si]),ur=wt(null),hr=wt(null),dr=wt(null),pr=wt(0);if(U&&!dr.current){let e=X?.maxPerLine??v();dr.current=new fi(50*e)}let fr=wt(null),mr=wt(!1),gr=wt(null),yr=wt(!1),vr=wt(!1),br=ot("StreamGeoFrame"),Rr=wt(void 0),[wr,Pr]=Pt(null),[,xr]=Pt(0),kr=wt(0),[Sr,Cr]=Pt(!1),Lr=ce(Qi,Qt,$t,e=>e.getPoints());se(Qi,Zi,vi,Ei),le(Qi,x,vi,Ei),bt(()=>{let e=Qi.current;e&&(zi&&e.setAreas(zi),s&&e.setPoints(Wi),d&&e.setLines(Hi),vi.current=!0,Ei())},[zi,s,Wi,d,Hi,Ei]),function(e,{storeRef:t,dirtyRef:i,scheduleRender:r,zoomTransformRef:n,containerRef:o,zoomBehaviorRef:a}){let s=Yt(e=>{null==e||"object"!=typeof e||(t.current?.pushPoint(e),i.current=!0,r())},[t,i,r]),l=Yt(e=>{let n=Ie(e);0!==n.length&&(t.current?.pushMany(n),i.current=!0,r())},[t,i,r]),c=Yt(e=>{null==e||"object"!=typeof e||(t.current?.pushLine(e),i.current=!0,r())},[t,i,r]),u=Yt(e=>{let n=Ie(e);0!==n.length&&(t.current?.pushManyLines(n),i.current=!0,r())},[t,i,r]),h=Yt(()=>{t.current?.clear(),i.current=!0,r()},[t,i,r]);Kt(e,()=>({push:s,pushMany:l,removePoint:e=>{let n=t.current?.removePoint(e)??[];return n.length>0&&(i.current=!0,r()),n},pushLine:c,pushManyLines:u,removeLine:e=>{let n=t.current?.removeLine(e)??[];return n.length>0&&(i.current=!0,r()),n},getLines:()=>t.current?.getLines()??[],clear:h,getProjection:()=>t.current?.scales?.projection??null,getGeoPath:()=>t.current?.scales?.geoPath??null,getCartogramLayout:()=>t.current?.cartogramLayout??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null,getZoom:()=>n.current.k,resetZoom:()=>{let e=o.current;e&&a.current&&Vt(e).call(a.current.transform,Jt)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,h,r,t,i,n,o,a])}(t,{storeRef:Qi,dirtyRef:vi,scheduleRender:Ei,zoomTransformRef:ar,containerRef:lr,zoomBehaviorRef:or});let{hoverHandlerRef:Ar,onPointerMove:Dr,onPointerLeave:jr,pointerStateRef:Mr}=wi,{canvasRef:Tr,interactionCanvasRef:Br,resolutionDirtyRef:_r}=rt(wi,{hydrated:Fi,wasHydratingFromSSR:Oi,storeRef:Qi,dirtyRef:vi,cleanup:()=>rr.current?.clear(),maxDevicePixelRatio:Ae,canvasPaintDependencies:[Ai,Di,ke,Et,Me,Y,V,Ei]});bt(()=>{Ar.current=e=>{let t=Tr.current;if(!t)return;let i=Qi.current;if(!i||!i.scene.length)return void Ke(t);let r=w({pointer:e,canvasRect:t.getBoundingClientRect(),margin:Li,width:Ai,height:Di,scene:i.scene,pointQuadtree:i.quadtree,maxPointRadius:i.maxPointRadius,hitCanvasRef:ir});Ke(t,"hit"===r.kind?Ye(r.node):void 0),He&&!1!==Ge&&("hit"===r.kind?(fr.current=r.hover,gr.current=r.node,Pr(r.hover),ri?.(r.hover),Ei()):("outside"===r.kind||"miss"===r.kind&&fr.current)&&(fr.current=null,gr.current=null,Pr(null),ri?.(null),Ei()))}},[He,Ge,Ai,Di,Li,ri,Ei,Ar,Tr]),wi.hoverLeaveRef.current=()=>{Ke(Tr.current),He&&!1!==Ge&&(fr.current=null,gr.current=null,Pr(null),ri?.(null),Ei())},tt(Tr);let Ir=vt(e=>{if(Oe(e.target)||!ni)return;let t=Qi.current;if(!t||!t.scene.length)return void ni(null);let i=e.currentTarget.getBoundingClientRect(),r=e.clientX-i.left-Li.left,n=e.clientY-i.top-Li.top;if(0>r||r>Ai||0>n||n>Di)return void ni(null);ir.current||(ir.current="u">typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));let o=R(ir.current);if(!o)return void ni(null);let a=Ne(30,Rr.current),s=Ne(6,Rr.current),c=l(t.scene,r,n,a,o,t.quadtree,t.maxPointRadius,s);if(c){let e=c.node.datum,t=Array.isArray(e)?null:e?.properties?e:e?.data||e,i=t?.properties?{...t,...t.properties}:t;return void ni({...i,data:t,properties:t?.properties,__semioticHoverData:!0,x:r,y:n,time:r,value:n},{type:"activate",inputType:qe(Rr.current)})}ni(null)},[Di,Ai,ni,Li]),{kbFocusIndexRef:Er,focusedNavPointRef:Nr,onKeyDown:Fr}=_({storeRef:Qi,hoverRef:fr,hoveredNodeRef:gr,setHoverPoint:Pr,customHoverBehavior:ri,customClickBehavior:ni,scheduleRender:Ei}),Or=vt(e=>{ae(Mr,e,He&&!1!==Ge,mr.current,Tr.current)&&(Rr.current=e.pointerType,Er.current=-1,Nr.current=null,Dr(e))},[Tr,He,Ge,Nr,Er,Dr,Mr]),zr=vt(e=>{Rr.current=e.pointerType},[]);Ii.current=()=>{if(_i.current=null,Xi.sync(Qi.current?.scales??null),!Bi.isActive)return;let e=Tr.current,t=Qi.current;if(!e||!t)return;let i=Bi.now(),r=!1,n=hr.current,o=!1;n&&(hr.current=null,t.applyRotation(n,{width:Ai,height:Di}),o=!0);let a=null!=t.activeTransition,s=t.advanceTransition(ki.current?i+1e6:i),l=!ki.current&&s,c=br.current.beforeCompute(t.getLastUpdateResult(),l),d=!1;if(vi.current&&!s){let e={width:Ai,height:Di},i=t.hasProjection(),r=Gi&&i?t.getRotation():null;t.computeScene(e);let n=ar.current,o=1!==n.k||0!==n.x||0!==n.y;Gi&&r?o?(t.setRotation(r),t.applyZoomScale(n.k,e)):t.applyRotation(r,e):o&&t.applyZoomTransform(n,e),vi.current=!1,d=!0,Lr()}Xi.sync(t.scales),br.current.afterCompute(c,d,!1);let p=Ee(Ae,Ci),f=U&&!ki.current&&!!dr.current,m=t.consumeStylePaintPending();var g;(d||o||m)&&(mr.current=Xe(t.scene),mr.current||Ke(e)),mr.current&&(a||d||o||m)&&Qe((g={canvas:e,pointer:Mr.current,store:t,margin:Li,width:Ai,height:Di,hitCanvasRef:ir,geometryMoved:a||d||o}).canvas,g.pointer,e=>{let t=w({pointer:e,canvasRect:g.canvas.getBoundingClientRect(),margin:g.margin,width:g.width,height:g.height,scene:g.store.scene,pointQuadtree:g.geometryMoved?null:g.store.quadtree,maxPointRadius:g.store.maxPointRadius,hitCanvasRef:g.hitCanvasRef});return"hit"===t.kind?Ye(t.node):void 0});let b=T(t,i,d,vr),R=N({dirtyOrRebuilt:d,transitioning:a,continuous:f,liveEncoding:b.changed,forced:o||m||_r.current});if(_r.current=!1,Y&&rr.current){let e=tr.current;if(e&&t.scales?.projection){let i=Ze(e,Ci,Li,p);i&&(i.clearRect(-Li.left,-Li.top,Ci[0],Ci[1]),i.save(),i.beginPath(),i.rect(0,0,Ai,Di),i.clip(),function(e,t){let{tileURL:i,projection:r,width:n,height:o,tileCache:a,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),d=r.translate(),p=function(e){let{size:t,scale:i,translate:r,clampX:n=!0,clampY:o=!0}=e,a=Math.max(Math.log(i)/Math.LN2-8,0),s=Math.round(a),l=1<<s,c=Math.pow(2,a-s+8),u=r[0]-i/2,h=r[1]-i/2,d=Math.max(n?0:-1/0,Math.floor((0-u)/c)),p=Math.min(n?l:1/0,Math.ceil((t[0]-u)/c)),f=Math.max(o?0:-1/0,Math.floor((0-h)/c)),m=Math.min(o?l:1/0,Math.ceil((t[1]-h)/c)),g=[];for(let e=f;m>e;++e)for(let t=d;p>t;++t)g.push([t,e,s]);return{tiles:g,translate:[u/c,h/c],scale:c}}({size:[n,o],scale:2*c*Math.PI,translate:d}),f=Ee(l,[n,o]),m=function(e){if("string"==typeof e)return"template:"+e;let t=e,i=hi.get(t);return null==i&&(i=di++,hi.set(t,i)),"provider:"+i}(i),g=!0;for(let t of p.tiles){let[r,n,o]=u(t),l=h(i,o,r,n,f),c=`${m}|dpr:${f}|${o}/${r}/${n}|${l}`,d=a.get(c);if(!d){let e=new Image;e.crossOrigin="anonymous";let t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now()};a.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,s?.()},e.src=l,d=t}if(!d.loaded){g=!1;continue}if(d.failed)continue;let y=p.scale;e.drawImage(d.img,(t[0]+p.translate[0])*y-.5,(t[1]+p.translate[1])*y-.5,y+1,y+1)}}(i,{tileURL:Y,projection:t.scales.projection,width:Ai,height:Di,tileCache:rr.current,maxDevicePixelRatio:Ae,onTileLoad:()=>Ei()}),i.restore())}}if(R){let n=Ze(e,Ci,Li,p);if(!n)return;n.clearRect(-Li.left,-Li.top,Ci[0],Ci[1]),Y||J(n,{background:ke,themeBackground:Ji,hasBackgroundGraphics:!!Et,x:-Li.left,y:-Li.top,width:Ci[0],height:Ci[1]}),n.save(),n.beginPath(),n.rect(0,0,Ai,Di),n.clip();let o=t.scene,a=t.scales,s={width:Ai,height:Di};if(ee({context:n,nodes:o,renderMode:Me,pixelRatio:p,paintBuiltIn:e=>{(function(e,t){let i=t.filter(e=>"geoarea"===e.type);for(let t of i){if(!t.pathData)continue;t._cachedPath2D||(t._cachedPath2D=new Path2D(t.pathData));let i=t._cachedPath2D,r=ht(e,t.style.fill)||"#e0e0e0";"none"!==r&&(e.fillStyle=r,e.globalAlpha=(t._decayOpacity??1)*(t.style.fillOpacity??1),e.fill(i));let n=t.style.strokeWidth??.5;if(t.style.stroke&&"none"!==t.style.stroke&&n>0){if(e.strokeStyle=mt(e,t.style.stroke)||t.style.stroke,e.lineWidth=n,e.globalAlpha=t._decayOpacity??1,t.style.strokeDasharray){let i=t.style.strokeDasharray.split(",").map(Number);e.setLineDash(i)}else e.setLineDash([]);e.stroke(i)}fe(e,t,i),e.globalAlpha=1,e.setLineDash([])}})(n,e),C(n,e,a,s),E(n,e,a,s),O(n,e,a,s)}}),f&&dr.current){let e=dr.current,t=o.filter(e=>"line"===e.type);if(t.length>0){let o=X||{},a=.3*(o.speedMultiplier??1),s=o.maxPerLine??v(),l=o.spawnRate??(y()?.06:.15),c=o.radius??2,u=o.opacity??.7,h=i/1e3,d=pr.current>0?Math.min(h-pr.current,.1):.016;pr.current=h;let p=t.map(e=>e.path),f=t.map(e=>e.style.strokeWidth??2);for(let i=0;t.length>i;i++)Bi.random()<l&&e.countForLine(i)<s&&e.spawn(i,Bi.random);e.step(d,a,p,f),n.globalAlpha=u;for(let i=0;e.particles.length>i;i++){let r=e.particles[i];if(!r.active)continue;let a=t[r.lineIndex],s="function"==typeof o.color?o.color(a?.datum??{}):"source"!==o.color&&o.color?o.color:a?.style.stroke||"#fff";n.beginPath(),n.arc(r.x,r.y,c,0,2*Math.PI),n.fillStyle=s,n.fill()}n.globalAlpha=1,r=!0}}n.restore()}(d||a&&!s)&&e.setAttribute("aria-label",je(t.scene,"Geographic chart"));let P=gr.current,x=!(!P||"geoarea"!==P.type&&"point"!==P.type),k=F(x,yr.current),L=Br.current;if(L&&k){let e=Ze(L,Ci,Li,p);if(e){if(e.clearRect(-Li.left,-Li.top,Ci[0],Ci[1]),P&&"geoarea"===P.type){let t=new Path2D(P.pathData);e.fillStyle="rgba(255, 255, 255, 0.3)",e.fill(t),e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke(t)}if(P&&"point"===P.type){let t=P,i=("object"==typeof Ge?Ge:void 0)?.pointColor||S(P);e.beginPath(),e.arc(t.x,t.y,t.r+3,0,2*Math.PI),i?(e.save(),e.globalAlpha=.4,e.fillStyle=i,e.fill(),e.restore()):(e.fillStyle="rgba(255, 255, 255, 0.4)",e.fill()),e.strokeStyle=i||"rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke()}}yr.current=x}let A=gt!==nr.current;A&&(nr.current=gt),(d||A||a&>&>.length>0)&&(d||A||a&&!s||i-kr.current>=33)&&(xr(e=>e+1),kr.current=i),(l||null!=t.activeTransition||b.pending||r)&&Ei()},he(Dt,Qi,vi,Ei,Bi.now,Sr,Cr),bt(()=>{if("production"!==process.env.NODE_ENV&&Y){let e=b(i);e&&"mercator"!==e&&console.warn(`[StreamGeoFrame] tileURL is set but projection is "${e}". Raster tiles use Web Mercator and will not align with other projections.`)}},[Y,i]),bt(()=>{let e=lr.current;if(!G||!e)return or.current&&e&&(ui(e).on(".zoom",null),or.current=null),void(e&&ui(e).on("mousedown.rotate",null).on("touchstart.rotate",null));let[t,i]=Z||[1,8],r={width:Ai,height:Di};if(Gi){let n=ar.current.k,o=e=>{n=Math.max(t,Math.min(i,e)),ar.current=ci.scale(n);let o=Qi.current;o&&(o.applyZoomScale(n,r),vi.current=!1,Ei(),o.scales?.projection&&Q?.({projection:o.scales.projection,zoom:o.currentZoom}))};or.current={scaleBy:(e,t)=>o(n*t),transform:(e,t)=>o(t?.k??1)};let a=e=>{e.preventDefault(),o(n*(0>e.deltaY?1.1:1/1.1))},s=e=>{let t=e.target;t&&(t.closest("button")||t.closest(".stream-geo-zoom-controls"))||(e.preventDefault(),o(1.5*n))};e.addEventListener("wheel",a,{passive:!1}),e.addEventListener("dblclick",s);let l=.4,c=t=>{if(0!==t.button)return;let i=t.target;if(i.closest("button")||i.closest(".stream-geo-zoom-controls"))return;let r=Qi.current;if(!r)return;let n=r.getRotation();ur.current={x:t.clientX,y:t.clientY,rotation:[...n]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{let t=ur.current;t&&(hr.current=[t.rotation[0]+(e.clientX-t.x)*l,Math.max(-90,Math.min(90,t.rotation[1]-(e.clientY-t.y)*l)),t.rotation[2]],Ei())},h=t=>{if(!ur.current)return;ur.current=null,e.releasePointerCapture(t.pointerId);let i=hr.current;if(i){hr.current=null;let e=Qi.current;e&&(e.applyRotation(i,r),Ei())}let n=Qi.current;n?.scales?.projection&&Q?.({projection:n.scales.projection,zoom:n.currentZoom})};return e.addEventListener("pointerdown",c),e.addEventListener("pointermove",u),e.addEventListener("pointerup",h),e.addEventListener("pointercancel",h),()=>{e.removeEventListener("wheel",a),e.removeEventListener("dblclick",s),e.removeEventListener("pointerdown",c),e.removeEventListener("pointermove",u),e.removeEventListener("pointerup",h),e.removeEventListener("pointercancel",h),or.current=null}}let n=li().scaleExtent([t,i]).extent([[0,0],[Ci[0],Ci[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{let t=e.transform;ar.current=t,sr.current=!0;let i=Qi.current;i&&(i.applyZoomTransform(t,r),vi.current=!1,Ei())}).on("end",e=>{ar.current=e.transform,sr.current=!1;let t=Qi.current;t?.scales?.projection&&Q?.({projection:t.scales.projection,zoom:t.currentZoom})});return or.current=n,ui(e).call(n),()=>{ui(e).on(".zoom",null)}},[G,Z,Gi,Ci,Ai,Di,Li,Q,Ei]);let Wr=He&&!1!==Ge,Hr=Wr&&wr?$e?$e(wr):Pi(g,{data:wr}):null,Gr=Hr?Pi(we,{x:wr.x,y:wr.y,containerWidth:Ai,containerHeight:Di,margin:Li,className:"stream-frame-tooltip",zIndex:10,children:Hr}):null;if(Yi){let e=$i.scene;return xi("div",{ref:cr,className:"stream-geo-frame"+(xe?" "+xe:""),role:"img","aria-label":ti||("string"==typeof Ft?Ft:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:de?"100%":Ci[0],height:me?"100%":Ci[1]},children:[Pi(Ce,{summary:ii}),xi("svg",{xmlns:"http://www.w3.org/2000/svg",width:Ci[0],height:Ci[1],style:{position:"absolute",left:0,top:0},children:[er?Pi("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:Ci[0],height:Ci[1],fill:er}):null,Pi("g",{transform:`translate(${Li.left},${Li.top})`,children:Vi}),Pi("g",{transform:`translate(${Li.left},${Li.top})`,children:e.map((e,t)=>ie({node:e,index:t,renderMode:Me,fallback:()=>function(e,t){return st(function(e,t){switch(e.type){case"geoarea":{let i=e;if(!i.pathData)return null;let r=ft(i.style.fill)?pt(i.style.fill,`geoarea-${t}-hatch`):void 0;return si(oi.Fragment,{children:[r&&ai("defs",{children:r}),ai("path",{d:i.pathData,fill:r?`url(#geoarea-${t}-hatch)`:Je(i.style.fill,"#e0e0e0"),fillOpacity:i.style.fillOpacity??1,stroke:i.style.stroke||"none",strokeWidth:i.style.strokeWidth??.5,strokeDasharray:i.style.strokeDasharray,opacity:i._decayOpacity??1})]},"geoarea-"+t)}case"point":{let i=e,r=ft(i.style.fill)?pt(i.style.fill,`geopoint-${t}-hatch`):void 0;return si(oi.Fragment,{children:[r&&ai("defs",{children:r}),ai("circle",{cx:i.x,cy:i.y,r:i.r,fill:r?`url(#geopoint-${t}-hatch)`:Je(i.style.fill),fillOpacity:i.style.fillOpacity??.8,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,opacity:i._decayOpacity??i.style.opacity??1})]},"point-"+t)}case"line":{let i=e;if(2>i.path.length)return null;let r="M"+i.path.map(e=>`${e[0]},${e[1]}`).join("L");return ai("path",{d:r,fill:"none",stroke:i.style.stroke||"#4e79a7",strokeWidth:i.style.strokeWidth??1.5,strokeDasharray:i.style.strokeDasharray,opacity:i.style.opacity??1},"line-"+t)}case"glyph":return Fe(e,e.x,e.y,"geo-glyph-"+(e.pointId??t));default:return null}}(e,t),e,"geo-cursor-"+t)}(e,t)}))})]}),Pi(c,{width:Ai,height:Di,totalWidth:Ci[0],totalHeight:Ci[1],margin:Li,showAxes:!1,title:Ft,description:ti,legend:Ot,legendPosition:zt,legendLayout:Wt,legendHoverBehavior:Ht,legendClickBehavior:Gt,legendHighlightedCategory:qt,legendIsolatedCategories:Zt,foregroundGraphics:q(Ki,pe(Qi.current?.customLayoutOverlays,x??null)),annotations:gt,onAnnotationActivate:yt,onObservation:ut??lt,chartId:dt,chartType:"StreamGeoFrame",autoPlaceAnnotations:xt,svgAnnotationRules:kt,pointNodes:m(e),geoProjection:Qi.current?.scales?.projectedPoint})]})}return xi("div",{ref:cr,className:"stream-geo-frame"+(xe?" "+xe:""),role:"group","aria-label":ti||("string"==typeof Ft?Ft:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:de?"100%":Ci[0],height:me?"100%":Ci[1],overflow:Ue?"visible":"hidden",...G?{touchAction:"none"}:{}},onKeyDown:Fr,children:["production"!==process.env.NODE_ENV&&Qi.current&&Pi(Se,{store:Qi.current,diagnostics:br.current}),ei&&xi(ve,{accessibleTable:ei,children:[Pi(Le,{tableId:Ti}),Pi(ye,{scene:Qi.current?.scene??[],chartType:"Geographic chart",tableId:Ti,chartTitle:"string"==typeof Ft?Ft:void 0})]}),Pi(Ce,{summary:ii}),Pi(be,{hoverPoint:wr}),xi("div",{role:"img","aria-label":ti||("string"==typeof Ft?Ft:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Or,onPointerLeave:jr,onPointerDown:Wr||mi?zr:void 0,onClick:mi?Ir:void 0,children:[Pi(Re,{size:Ci,margin:Li,backdropFill:er??void 0,children:Vi}),Y&&Pi("canvas",{ref:tr,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Pi("canvas",{ref:Tr,"aria-label":je(Qi.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0}}),Pi("canvas",{ref:Br,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Pi(c,{width:Ai,height:Di,totalWidth:Ci[0],totalHeight:Ci[1],margin:Li,showAxes:Ut,title:Ft,description:ti,legend:Ot,legendPosition:zt,legendLayout:Wt,legendHoverBehavior:Ht,legendClickBehavior:Gt,legendHighlightedCategory:qt,legendIsolatedCategories:Zt,foregroundGraphics:q(Ki,pe(Qi.current?.customLayoutOverlays,x??null)),annotations:gt,onAnnotationActivate:yt,onObservation:ut??lt,chartId:dt,chartType:"StreamGeoFrame",autoPlaceAnnotations:xt,svgAnnotationRules:kt,pointNodes:m(Qi.current?.scene),geoProjection:Qi.current?.scales?.projectedPoint}),Dt?.showBadge&&Pi(z,{isStale:Sr,position:Dt.badgePosition}),G&&xi("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:Li.bottom+8,left:Li.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[Pi("button",{type:"button","aria-label":"Zoom in",onClick:e=>{e.stopPropagation();let t=lr.current,i=or.current;t&&i?.scaleBy&&i.scaleBy(ui(t),1.5)},style:bi,children:"+"}),Pi("button",{type:"button","aria-label":"Zoom out",onClick:e=>{e.stopPropagation();let t=lr.current,i=or.current;t&&i?.scaleBy&&i.scaleBy(ui(t),1/1.5)},style:bi,children:"−"})]}),K&&Pi("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:Li.bottom+2,right:Li.right+4,fontSize:10,color:"rgba(0,0,0,0.6)",background:"rgba(255,255,255,0.7)",padding:"1px 4px",borderRadius:2,pointerEvents:"none",zIndex:2},children:K}),Pi(Pe,{active:Er.current>=0,hoverPoint:wr,margin:Li,size:Ci,shape:Nr.current?.shape,width:Nr.current?.w,height:Nr.current?.h,pathData:Nr.current?.pathData}),Gr]})]})}));ki.displayName="StreamGeoFrame";var Si=ki;import{forwardRef as Ci,useMemo as Li}from"react";import{jsx as Ai}from"react/jsx-runtime";var Di=Ci(function(e,t){let{points:i,areas:r,lines:n,layout:o,layoutConfig:a,onLayoutError:s,projection:l="equirectangular",xAccessor:c="lon",yAccessor:u="lat",lineDataAccessor:h,colorBy:d,colorScheme:p,tooltip:f,annotations:m,margin:g,selection:y,linkedHover:v,onObservation:b,onClick:R,chartId:w,loading:P,loadingContent:S,emptyContent:C,className:L,frameProps:A={}}=e,{frameRef:D,resolved:j,normalizedMargin:M}=x({imperativeRef:t,imperativeVariant:"geo-points",margin:g,width:e.width,height:e.height,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),T=Li(()=>Ie(i),[i]),B=Li(()=>Ie(r),[r]),_=Li(()=>Ie(n),[n]),I=Li(()=>[...T,..._,...B],[T,_,B]),E=k({data:I,rawData:void 0!==i||void 0!==n||void 0!==r?I:void 0,colorBy:d,colorScheme:p,legendInteraction:void 0,selection:y,linkedHover:v,fallbackFields:"string"==typeof d?[d]:[],unwrapData:!1,onObservation:b,onClick:R,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:"GeoCustomChart",chartId:w,showLegend:!1,userMargin:M,marginDefaults:j.marginDefaults,loading:P,loadingContent:S,emptyContent:C,width:j.width,height:j.height,hasTitle:!!j.title}),N=E.effectiveSelectionHook,F=Li(()=>N?.isActive?{isActive:!0,predicate:N.predicate}:null,[N?.isActive,N?.predicate]);if(E.earlyReturn)return E.earlyReturn;let{width:O,height:z,enableHover:W,title:q,description:Z,summary:Q,accessibleTable:$}=j,U=He(f),X={projection:l,...null!=i&&{points:T},...null!=r&&{areas:B},...null!=n&&{lines:_},xAccessor:c,yAccessor:u,...null!=h&&{lineDataAccessor:h},customLayout:o,layoutConfig:a,onLayoutError:s,layoutSelection:F,colorBy:d,colorScheme:p,size:[O,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:E.margin,enableHover:W,...H({title:q,description:Z,summary:Q,accessibleTable:$,className:L,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===f?{tooltipContent:()=>null}:U?{tooltipContent:U}:{},...G({linkedHover:v,selection:y,onObservation:b,onClick:R,hoverHighlight:!1,mobileInteraction:E.mobileInteraction,customHoverBehavior:E.customHoverBehavior,customClickBehavior:E.customClickBehavior,linkedHoverInClickPredicate:!1}),...m&&m.length>0&&{annotations:m},...A};return Ai(ke,{componentName:"GeoCustomChart",width:O,height:z,children:Ai(Si,{ref:D,...X})})});Di.displayName="GeoCustomChart";export{Si as StreamGeoFrame_default,Di as GeoCustomChart};
|
package/dist/c-GSZRZRD6.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){y(f),y(u),y(p)}function t(e){let{colorBy:t,colorScale:o,color:r,pointRadius:n=5,radiusFn:i,fillOpacity:l=1,fallbackFill:a,baseStyleExtras:s,stroke:c,strokeWidth:u,opacity:f,effectiveSelectionHook:p,resolvedSelection:y,colorDatumAccessor:m,selectionDatumAccessor:d,styleRules:h,ruleContext:g}=e,v=M(()=>e=>{let c="function"==typeof s?s(e):s,u=c?{...c}:{};if(void 0===u.fillOpacity&&(u.fillOpacity=l),void 0===u.fill)if(t){if(o){let r=m?m(e):e;u.fill=O(r,t,o)}}else u.fill=a?a(e):r||_;return void 0===u.r&&(u.r=i?i(e):n),h&&h.length>0&&Object.assign(u,D(e,h,g?g(e):{value:void 0})),u},[t,o,r,n,i,l,a,s,m,h,g]),x=M(()=>b(v,{stroke:c,strokeWidth:u,opacity:f}),[v,c,u,f]);return M(()=>R(x,p??null,y,d),[x,p,y,d])}function o(e){let{lineWidth:t=2,colorBy:o,colorScale:r,color:n,resolveStroke:i,fillArea:l,areaOpacity:a=.3,stroke:s,strokeWidth:c,opacity:u,effectiveSelectionHook:f,resolvedSelection:p,styleRules:y,ruleContext:m}=e,d=E(()=>function(e){let{lineWidth:t=2,colorBy:o,colorScale:r,color:n,resolveStroke:i,fillArea:l,areaOpacity:a=.3,styleRules:s,ruleContext:c}=e;return(e,u)=>{let f,p={strokeWidth:t},y=!0===l||Array.isArray(l)&&null!=u&&l.includes(u);return i?f=i(e,u):o?r&&(f=O(e,o,r)):f=n||_,void 0!==f&&(p.stroke=f,y&&(p.fill=f,p.fillOpacity=a)),s?.length&&Object.assign(p,D(e,s,c?c(e,u):{value:void 0,category:u})),p}}({lineWidth:t,colorBy:o,colorScale:r,color:n,resolveStroke:i,fillArea:l,areaOpacity:a,styleRules:y,ruleContext:m}),[t,o,r,n,i,l,a,y,m]),h=E(()=>b(d,{stroke:s,strokeWidth:c,opacity:u}),[d,s,c,u]);return E(()=>R(h,f??null,p),[h,f,p])}async function r(){return X||(X=await(import("./c-BNFJMDHN.min.js"))),X}function n(e){let{data:t,xAccessor:o,yAccessor:n,forecast:i,anomaly:l,groupBy:a}=e,s="string"==typeof o?o:Q,c="string"==typeof n?n:Y,u=$(()=>{if(!i&&!l)return t;let e="function"==typeof o,r="function"==typeof n;return e||r?t.map(t=>{let i={...t};return e&&(i[Q]=o(t)),r&&(i[Y]=n(t)),i}):t},[t,i,l,o,n]),[f,p]=J(null),[y,m]=J([]),d=V(i),h=V(l);return z(()=>{if(!i&&!l)return void((d.current||h.current)&&(p(null),m([]),d.current=i,h.current=l));let e=!1,t=i!==d.current||l!==h.current;if(d.current=i,h.current=l,t&&(p(null),m([])),i){let t=a&&"string"==typeof a&&"object"==typeof i?{...i,_groupBy:a}:i;(async function(...e){return(await r()).buildForecast(...e)})(u,s,c,t,l).then(t=>{e||(p(t),m(t.annotations))}).catch(()=>{e||(p(null),m([]))})}else l&&async function(...e){return(await r()).buildAnomalyAnnotations(...e)}(l).then(t=>{e||(p(null),m(t))}).catch(()=>{e||m([])});return()=>{e=!0}},[u,i,l,s,c,a]),{effectiveData:f?f.processedData:t,statisticalAnnotations:y,hasForecast:!!f,xAccessorKey:s,yAccessorKey:c}}import{validateArrayData as i}from"./c-D6HAAPTX.min.js";import{useChartSetup as l,useFrameImperativeHandle as a}from"./c-KCRJGUHP.min.js";import{StreamXYFrame_default as s,useXYBrush as c}from"./c-MXCP7GNZ.min.js";import{areaXYPlugin as u,lineXYPlugin as f,mixedXYPlugin as p,registerXYPlugin as y}from"./c-ZYPXQF7B.min.js";import{normalizeColorGradient as m}from"./c-AVO3Q7T7.min.js";import{accessorName as d,bandTooltipFields as h,buildCustomBehaviorProps as g,buildDefaultTooltip as v,mergeShapeStyle as b}from"./c-ITKX3RC5.min.js";import{ChartError as x,MultiPointTooltip as A,SafeRender as S,composeLegendConfigs as k,filterSparseArray as L,makeXYRuleContext as w,resolveMultiCapableTooltip as C,resolveStyleRules as D,resolveXYFramePropsAxisChrome as B,useChartMode as P,warnMissingField as H,wrapStyleWithSelection as R}from"./c-LMGSSD2E.min.js";import{DEFAULT_COLOR as _,getColor as O}from"./c-CPV4N35K.min.js";import{selectionDatumWithParent as j}from"./c-T2V7O2LO.min.js";import{useMemo as F,useCallback as G,useState as N,useEffect as T,forwardRef as W,useRef as I}from"react";import{useMemo as M}from"react";import{useMemo as E}from"react";var K="__forecastSegment",X=null;import{useEffect as z,useMemo as $,useRef as V,useState as J}from"react";var Q="__semiotic_resolvedX",Y="__semiotic_resolvedY";import{jsx as Z}from"react/jsx-runtime";e();var U="__lineObjectSeries",q=e=>e.parentLine||e,ee=W(function(e,u){let f=I(null);a(u,{variant:"xy",frameRef:f});let p=P(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:y,margin:b,className:D,xFormat:R,yFormat:O,axisExtent:W,xAccessor:M="x",yAccessor:E="y",lineBy:X,lineDataAccessor:z="coordinates",colorBy:$,colorScheme:V,styleRules:J,curve:Q="linear",showPoints:Y=!1,pointRadius:ee=3,fillArea:te=!1,areaOpacity:oe=.3,lineWidth:re=2,lineGradient:ne,tooltip:ie,pointIdAccessor:le,annotations:ae,directLabel:se,gapStrategy:ce="break",anomaly:ue,forecast:fe,band:pe,xExtent:ye,yExtent:me,frameProps:de={},selection:he,linkedHover:ge,linkedBrush:ve,brush:be,onBrush:xe,onObservation:Ae,onClick:Se,hoverHighlight:ke,hoverRadius:Le,chartId:we,loading:Ce,loadingContent:De,emptyContent:Be,legendInteraction:Pe,legendPosition:He,legend:Re,xScaleType:_e,yScaleType:Oe,color:je,stroke:Fe,strokeWidth:Ge,opacity:Ne}=e,{legend:Te,...We}=de,Ie=F(()=>k(Te,Re),[Te,Re]),{width:Me,height:Ee,enableHover:Ke,showGrid:Xe,showLegend:ze,title:$e,description:Ve,summary:Je,accessibleTable:Qe,xLabel:Ye,yLabel:Ze}=p,Ue=F(()=>L(y),[y]),qe=Array.isArray(Ue[0]?.[z])?Ue[0][z]:Ue;H("LineChart",qe,"xAccessor",M),H("LineChart",qe,"yAccessor",E);let{effectiveData:et,statisticalAnnotations:tt}=n({data:Ue,xAccessor:M,yAccessor:E,forecast:fe,anomaly:ue,groupBy:X}),ot="__compoundGroup",rt=!(!fe||!X),nt=rt?ot:fe?K:X,it=F(()=>{if(!rt)return et;let e="function"==typeof X?X:e=>e[X];return et.map(t=>{let o={...t};return o[ot]=`${e(t)}__${t[K]||"observed"}`,o})},[et,rt,X]),lt=rt?it:et,at=$||X,st=F(()=>{if(!fe)return;let e=fe.upperBounds,t=fe.lowerBounds;if(!e&&!t)return;let o="function"==typeof e?e:"string"==typeof e?t=>t[e]:null,r="function"==typeof t?t:"string"==typeof t?e=>e[t]:null,n=1/0,i=-1/0,l=et;for(let e of l){let t="function"==typeof E?E(e):+e[E];if(isFinite(t)&&(n>t&&(n=t),t>i&&(i=t)),o){let t=o(e);null!=t&&isFinite(t)&&(t>i&&(i=t),n>t&&(n=t))}if(r){let t=r(e);null!=t&&isFinite(t)&&(n>t&&(n=t),t>i&&(i=t))}}return isFinite(n)&&isFinite(i)?[n,i]:void 0},[fe,et,E]),ct=G(e=>{let t="function"==typeof M?M(e):e[M],o="function"==typeof E?E(e):e[E];return null==t||null==o||Number.isNaN(t)||Number.isNaN(o)},[M,E]),ut=void 0!==lt[0]?.[z],ft=ut?U:nt,pt=F(()=>{if(ut)return lt.map((e,t)=>{let o="function"==typeof X?X(e):"string"==typeof X?e[X]:void 0,r=null==o?"line-"+t:o+"",n=Array.isArray(e[z])?e[z]:[];return{...e,[U]:r,[z]:n.map(t=>({...t,[U]:r,parentLine:e,..."string"==typeof X&&void 0!==e[X]?{[X]:e[X]}:{}}))}});if(nt){let e=lt.reduce((e,t)=>{let o="function"==typeof nt?nt(t):t[nt];if(!e[o]){let r={[z]:[]};"string"==typeof nt&&(r[nt]=o),rt&&(r[K]=t[K],"string"==typeof X&&(r[X]=t[X])),e[o]=r}return e[o][z].push(t),e},{});return Object.values(e)}return[{[z]:lt}]},[ut,nt,z,lt,X,rt]),{gapProcessedLineData:yt,hasGaps:mt}=F(()=>{if("interpolate"===ce){let e=!1,t=[];for(let o of pt){let r=(o[z]||[]).filter(t=>!ct(t)||(e=!0,!1));r.length>0&&t.push({...o,[z]:r})}return{gapProcessedLineData:t,hasGaps:e}}if("break"===ce){let e=!1,t=[];for(let o of pt){let r=o[z]||[],n=[],i=0,l=ft&&"string"==typeof ft?o[ft]:void 0;for(let a of r)if(ct(a))e=!0,n.length>0&&(t.push({...o,[z]:n}),n=[],i++);else{let e=null!=l?`${l}__seg${i}`:"__seg"+i;n.push({...a,_gapSegment:e})}n.length>0&&t.push({...o,[z]:n})}return{gapProcessedLineData:t,hasGaps:e}}if("zero"===ce){let e=!1,t="string"==typeof E?E:"y",o=[];for(let r of pt){let n=r[z]||[],i=[];for(let o of n)ct(o)?(e=!0,i.push({...o,[t]:0})):i.push(o);o.push({...r,[z]:i})}return{gapProcessedLineData:o,hasGaps:e}}return{gapProcessedLineData:pt,hasGaps:!1}},[pt,ce,z,ct,ft,E]),dt="object"==typeof se?se:{},ht=dt.position||"end",gt=dt.fontSize||11,vt=F(()=>{if(!se||!at)return[];let e="function"==typeof at?at:e=>e[at],t=new Set;for(let o of yt){let r=o[z]||[];if(0===r.length)continue;let n=e("end"===ht?r[r.length-1]:r[0])??e(o);if(null==n)continue;let i=n+"";""!==i&&t.add(i)}return Array.from(t)},[se,at,yt,z,ht]),bt=F(()=>{if(!se)return p.marginDefaults;let e=vt.reduce((e,t)=>Math.max(e,t.length*(.6*gt)),0)+10,t="end"===ht?"right":"left";return{...p.marginDefaults,[t]:Math.max(p.marginDefaults[t]||0,e)}},[se,vt,gt,ht,p.marginDefaults]),xt=l({data:et,rawData:y,colorBy:at,colorScheme:V,legendInteraction:Pe,legendPosition:He,frameLegend:We,selection:he,linkedHover:ge,fallbackFields:at?["string"==typeof at?at:""]:[],unwrapData:!1,onObservation:Ae,onClick:Se,hoverHighlight:ke,mobileInteraction:p.mobileInteraction,mobileSemantics:p.mobileSemantics,chartType:"LineChart",chartId:we,showLegend:(!se||void 0!==ze)&&ze,legend:Ie,userMargin:b,marginDefaults:bt,loading:Ce,loadingContent:De,emptyContent:Be,width:Me,height:Ee,hasTitle:!!$e,axisChrome:B(de,{showAxes:p.showAxes,xLabel:Ye,yLabel:Ze})}),At=xt.colorScale,St=xt.effectiveSelectionHook,kt=xt.resolvedSelection,Lt=xt.customHoverBehavior,wt=xt.customClickBehavior,Ct=xt.crosshairProps,Dt=F(()=>{if(at)return ut?e=>{let t=e.parentLine||e;return"function"==typeof at?at(t):t[at]}:at},[at,ut]),Bt=F(()=>w(M,E),[M,E]),Pt=o({lineWidth:re,colorBy:Dt,colorScale:At,color:je,fillArea:te,areaOpacity:oe,stroke:Fe,strokeWidth:Ge,opacity:Ne,effectiveSelectionHook:St,resolvedSelection:kt,styleRules:J,ruleContext:Bt}),[Ht,Rt]=N(null);T(()=>{if(!fe)return void Rt(null);let e=!1;return async function(...e){return(await r()).createSegmentLineStyle(...e)}(Pt,fe).then(t=>{e||Rt(()=>t)}).catch(()=>{e||Rt(null)}),()=>{e=!0}},[Pt,fe]);let _t=Ht||Pt,Ot=t({colorBy:at,colorScale:At,color:je,pointRadius:ee,colorDatumAccessor:q,selectionDatumAccessor:j,effectiveSelectionHook:St,resolvedSelection:kt}),jt=Array.isArray(te)?"mixed":te?"area":"line",Ft=F(()=>{if(!se||!at)return[];let e="function"==typeof M?M:e=>e[M],t="function"==typeof E?E:e=>e[E],o="function"==typeof at?at:e=>e[at],r=new Map;for(let e of yt){let t=e[z]||[];if(0===t.length)continue;let n="end"===ht?t[t.length-1]:t[0],i=o(n)??o(e);if(null==i)continue;let l=i+"";""!==l&&!r.has(l)&&r.set(l,n)}let n=Array.from(r.entries()).map(([o,r])=>({type:"text",label:o,["string"==typeof M?M:"x"]:e(r),["string"==typeof E?E:"y"]:t(r),dx:"end"===ht?6:-6,dy:0,color:At?At(o):_,fontSize:gt}));n.sort((e,t)=>{let o="string"==typeof E?E:"y";return e[o]-t[o]});for(let e=1;n.length>e;e++){let t="string"==typeof E?E:"y",o=n[e-1],r=n[e];gt+2>Math.abs(r[t]+r.dy-(o[t]+o.dy))&&(r.dy+=gt+2)}return n},[se,at,At,yt,z,M,E,ht,gt]),Gt=xt.margin,Nt=X||$,Tt=F(()=>v([{label:Ye||d(M),accessor:M,role:"x",format:R},{label:Ze||d(E),accessor:E,role:"y",format:O},...Nt?[{label:d(Nt),accessor:Nt,role:"group"}]:[],...h(pe,O)]),[M,E,Ye,Ze,Nt,R,O,pe]),Wt=i({componentName:"LineChart",data:ut?et[0]?.[z]||[]:y,accessors:{xAccessor:M,yAccessor:E}}),{brushStreamProps:It}=c({brush:be,onBrush:xe,linkedBrush:ve,xAccessor:M,yAccessor:E,defaultDimension:"x"}),Mt=F(()=>ut||ft||mt?yt.flatMap(e=>{let t=e[z]||[];return ft&&"string"==typeof ft?t.map(t=>({...t,[ft]:t[ft]??e[ft]})):t}):lt,[yt,z,ut,ft,lt,mt]),Et=m(ne),Kt={chartType:jt,...Array.isArray(te)&&{areaGroups:te},...Et&&{lineGradient:Et},...null!=y&&{data:Mt},xAccessor:M,yAccessor:E,xScaleType:_e,yScaleType:Oe,...ye&&{xExtent:ye},...!me||null==me[0]&&null==me[1]?st?{yExtent:st}:{}:{yExtent:me},groupAccessor:"break"===ce&&mt?"_gapSegment":ft||void 0,...pe&&{band:pe},curve:Q,lineStyle:_t,...Y&&{pointStyle:Ot},size:[Me,Ee],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:Gt,showAxes:p.showAxes,xLabel:Ye,yLabel:Ze,xFormat:R,yFormat:O,...void 0!==W&&{axisExtent:W},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},enableHover:Ke,showGrid:Xe,...xt.legendBehaviorProps,...$e&&{title:$e},...Ve&&{description:Ve},...Je&&{summary:Je},...void 0!==Qe&&{accessibleTable:Qe},...D&&{className:D},...null!=e.animate&&{animate:e.animate},...C({tooltip:ie,defaultTooltipContent:Tt,multiDefaultContent:A()}),...g({linkedHover:ge,selection:he,onObservation:Ae,onClick:Se,hoverRadius:Le,hoverHighlight:ke,mobileInteraction:xt.mobileInteraction,customHoverBehavior:Lt,customClickBehavior:wt}),...le&&{pointIdAccessor:le},...(ae?.length||tt.length||Ft.length)&&{annotations:[...ae||[],...tt,...Ft]},...Ct,...It,...We};return xt.earlyReturn?xt.earlyReturn:Wt?Z(x,{componentName:"LineChart",message:Wt,width:Me,height:Ee}):Z(S,{componentName:"LineChart",width:Me,height:Ee,children:Z(s,{ref:f,...Kt})})});ee.displayName="LineChart";export{t as useXYPointStyle,n as useSeriesFeatures,e as registerLineFamilyXYPlugins,o as useXYLineStyle,ee as LineChart};
|