semiotic 3.8.3 → 3.8.4
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/CLAUDE.md +9 -9
- package/README.md +40 -39
- package/ai/examples.md +1 -1
- package/ai/schema.json +2726 -300
- package/ai/surface-manifest.json +1 -1
- package/ai/system-prompt.md +1 -1
- package/dist/chunk-chunk-2JGJ5GUG.module.min.js +0 -1
- package/dist/chunk-chunk-3ILKBVVQ.module.min.js +1 -0
- package/dist/{chunk-chunk-XQYVEKEJ.module.min.js → chunk-chunk-6TPGFL7M.module.min.js} +1 -1
- package/dist/{chunk-chunk-VVCA3DB7.module.min.js → chunk-chunk-7ALTGHK6.module.min.js} +1 -1
- package/dist/chunk-chunk-7KZJUTKP.module.min.js +2 -0
- package/dist/chunk-chunk-7RYBCTK5.module.min.js +1 -0
- package/dist/chunk-chunk-ACLDBMRH.module.min.js +2 -0
- package/dist/{chunk-chunk-AZJUDQRM.module.min.js → chunk-chunk-AQPQN2HH.module.min.js} +1 -1
- package/dist/chunk-chunk-ASKSE5F5.module.min.js +1 -0
- package/dist/chunk-chunk-AVBI6GDT.module.min.js +1 -0
- package/dist/chunk-chunk-B3DRZPBK.module.min.js +2 -0
- package/dist/chunk-chunk-BFHUYEOS.module.min.js +2 -0
- package/dist/chunk-chunk-C4YA6TDR.module.min.js +1 -0
- package/dist/chunk-chunk-C57LR3YG.module.min.js +1 -0
- package/dist/chunk-chunk-F5V4UIE6.module.min.js +2 -0
- package/dist/chunk-chunk-F7WFPD4O.module.min.js +2 -0
- package/dist/{chunk-chunk-SANERMIZ.module.min.js → chunk-chunk-FBGHXL72.module.min.js} +1 -1
- package/dist/chunk-chunk-FP44FHFO.module.min.js +2 -0
- package/dist/chunk-chunk-HKXUAEPJ.module.min.js +2 -0
- package/dist/chunk-chunk-ICEXPNDC.module.min.js +2 -0
- package/dist/chunk-chunk-IY7RYD4S.module.min.js +1 -0
- package/dist/{chunk-chunk-7FW6EGLP.module.min.js → chunk-chunk-JDXT6ORT.module.min.js} +1 -1
- package/dist/chunk-chunk-JMVEIZXP.module.min.js +1 -0
- package/dist/chunk-chunk-KHCOJMGK.module.min.js +1 -0
- package/dist/{chunk-chunk-OQTLSTGI.module.min.js → chunk-chunk-KQ546MKE.module.min.js} +1 -1
- package/dist/chunk-chunk-LQBSXO7K.module.min.js +2 -0
- package/dist/chunk-chunk-LRIFN2HK.module.min.js +1 -0
- package/dist/chunk-chunk-MFHF4J2Z.module.min.js +1 -0
- package/dist/{chunk-chunk-JNCHKRIR.module.min.js → chunk-chunk-N6VKKF3A.module.min.js} +1 -1
- package/dist/chunk-chunk-NEVE562N.module.min.js +1 -0
- package/dist/chunk-chunk-NKZ75IM5.module.min.js +2 -0
- package/dist/chunk-chunk-PLIDPQNG.module.min.js +2 -0
- package/dist/{chunk-chunk-FYY2ACNJ.module.min.js → chunk-chunk-PRDGLMJT.module.min.js} +1 -1
- package/dist/chunk-chunk-QGZGZI4X.module.min.js +1 -0
- package/dist/chunk-chunk-RP7WTID5.module.min.js +1 -0
- package/dist/chunk-chunk-S7KLNUO6.module.min.js +1 -0
- package/dist/chunk-chunk-SR4ZXOWR.module.min.js +2 -0
- package/dist/chunk-chunk-ZOAQDIJO.module.min.js +1 -0
- package/dist/chunk-minimapBrushOverlay-JU57U7NM.module.min.js +2 -0
- package/dist/chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js +2 -0
- package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +1 -0
- package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +1 -0
- package/dist/components/ChartContainer.d.ts +2 -2
- package/dist/components/ai/chartCapabilityTypes.d.ts +5 -0
- package/dist/components/charts/geo/ChoroplethMap.d.ts +2 -0
- package/dist/components/charts/geo/DistanceCartogram.d.ts +7 -3
- package/dist/components/charts/geo/FlowMap.d.ts +4 -0
- package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +3 -1
- package/dist/components/charts/physics/CollisionSwarmChart.d.ts +6 -1
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +6 -1
- package/dist/components/charts/physics/gauntletChartProps.d.ts +7 -1
- package/dist/components/charts/physics/gauntletChrome.d.ts +2 -1
- package/dist/components/charts/physics/gauntletPhysics.d.ts +19 -4
- package/dist/components/charts/physics/gauntletRuntime.d.ts +3 -0
- package/dist/components/charts/physics/physicsHocUtils.d.ts +12 -0
- package/dist/components/charts/shared/chartMode.d.ts +8 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +2 -2
- package/dist/components/charts/shared/hatchPattern.d.ts +8 -3
- package/dist/components/charts/shared/lineSeriesSsr.d.ts +55 -0
- package/dist/components/charts/shared/types.d.ts +2 -2
- package/dist/components/charts/shared/validateProps.d.ts +1 -1
- package/dist/components/charts/xy/AreaChart.d.ts +10 -0
- package/dist/components/charts/xy/minimapBrushOverlay.d.ts +17 -0
- package/dist/components/charts/xy/minimapBrushOverlayLazy.d.ts +4 -0
- package/dist/components/charts/xy/scatterplotMatrixBrushOverlay.d.ts +8 -0
- package/dist/components/charts/xy/scatterplotMatrixBrushOverlayLazy.d.ts +3 -0
- package/dist/components/realtime/types.d.ts +5 -0
- package/dist/components/recipes/gridObservatory.d.ts +176 -0
- package/dist/components/recipes/recipeChrome.d.ts +24 -0
- package/dist/components/recipes/sequenceLayout.d.ts +139 -0
- package/dist/components/semiotic-recipes-core.d.ts +6 -2
- package/dist/components/server/staticAnnotations.d.ts +3 -1
- package/dist/components/stream/SceneToSVG.d.ts +6 -6
- package/dist/components/stream/SceneToSVGOrdinal.d.ts +12 -0
- package/dist/components/stream/networkFramePaint.d.ts +2 -0
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +18 -2
- package/dist/components/stream/physics/physicsBodyCanvas.d.ts +7 -0
- package/dist/components/stream/physics/physicsPipelineEviction.d.ts +15 -0
- package/dist/components/stream/physics/physicsPipelineObservations.d.ts +1 -1
- package/dist/components/stream/physics/physicsPipelineQuiescence.d.ts +20 -0
- package/dist/components/stream/sceneToSVGShared.d.ts +30 -1
- package/dist/components/stream/types.d.ts +4 -0
- package/dist/components/stream/useHydration.d.ts +7 -1
- package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +1 -1
- package/dist/forceLayoutWorker.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.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.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-realtime-core.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +6 -2
- package/dist/semiotic-recipes-core.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.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-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.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.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +3 -2
- package/dist/chunk-chunk-255KDHW5.module.min.js +0 -1
- package/dist/chunk-chunk-2CCFBTQC.module.min.js +0 -2
- package/dist/chunk-chunk-2RXP3FS3.module.min.js +0 -1
- package/dist/chunk-chunk-2WVCH4PL.module.min.js +0 -1
- package/dist/chunk-chunk-4TMZXLCR.module.min.js +0 -1
- package/dist/chunk-chunk-5APBQXZA.module.min.js +0 -1
- package/dist/chunk-chunk-6HSGDMTA.module.min.js +0 -2
- package/dist/chunk-chunk-7OEOSCBP.module.min.js +0 -1
- package/dist/chunk-chunk-A63CTACR.module.min.js +0 -2
- package/dist/chunk-chunk-B6V35LMY.module.min.js +0 -2
- package/dist/chunk-chunk-BOSVL645.module.min.js +0 -2
- package/dist/chunk-chunk-CP3EN6KZ.module.min.js +0 -1
- package/dist/chunk-chunk-F25UA5HT.module.min.js +0 -1
- package/dist/chunk-chunk-FRIO6MCV.module.min.js +0 -1
- package/dist/chunk-chunk-GWSWSPXN.module.min.js +0 -1
- package/dist/chunk-chunk-I6C3KR5H.module.min.js +0 -2
- package/dist/chunk-chunk-IP2UE74X.module.min.js +0 -1
- package/dist/chunk-chunk-J3ELI22J.module.min.js +0 -1
- package/dist/chunk-chunk-J5RL6GXU.module.min.js +0 -2
- package/dist/chunk-chunk-L3H6DQCR.module.min.js +0 -2
- package/dist/chunk-chunk-M337NY6L.module.min.js +0 -1
- package/dist/chunk-chunk-M7VYYHCE.module.min.js +0 -2
- package/dist/chunk-chunk-MC35ILYP.module.min.js +0 -2
- package/dist/chunk-chunk-N72SWNBV.module.min.js +0 -1
- package/dist/chunk-chunk-OBQRFTIL.module.min.js +0 -2
- package/dist/chunk-chunk-QRIBHZYW.module.min.js +0 -1
- package/dist/chunk-chunk-SA3D43RA.module.min.js +0 -2
- package/dist/chunk-chunk-UHSZEB74.module.min.js +0 -1
- package/dist/chunk-chunk-Y6AXCRVO.module.min.js +0 -1
- package/dist/chunk-chunk-ZCNBUZPL.module.min.js +0 -2
package/dist/geo.module.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{DEFAULT_HIT_RADIUS as e,geoAreaHitTarget as t,geoHitTarget as o,hitTargetPoint as i}from"./chunk-chunk-J3XWETBJ.module.min.js";import{GeoCustomChart as n,StreamGeoFrame_default as r}from"./chunk-chunk-OBQRFTIL.module.min.js";import{mergeShapeStyle as a,normalizePartialMargin as l,useChartSetup as s,useFrameImperativeHandle as c,useResolvedSelection as m}from"./chunk-chunk-I6C3KR5H.module.min.js";import"./chunk-chunk-XQYVEKEJ.module.min.js";import"./chunk-chunk-M7VYYHCE.module.min.js";import"./chunk-chunk-OQTLSTGI.module.min.js";import{buildCustomBehaviorProps as d}from"./chunk-chunk-A63CTACR.module.min.js";import"./chunk-chunk-5UKL5W76.module.min.js";import{composeStyleRules as u,makeNodeRuleContext as h,makeRuleValueResolver as p,matchesThreshold as f,resolveStyleRules as g,ruleMatches as y}from"./chunk-chunk-EMO5NUGE.module.min.js";import"./chunk-chunk-SANERMIZ.module.min.js";import{DEFAULT_COLOR as b,EMPTY_ARRAY as v,filterSparseArray as k,getColor as w,getSequentialInterpolator as S,getSize as C,hatchFillId as A,hatchPatternDef as x,isHatchFill as j,normalizeLinkedHover as R,normalizeTooltip as I,resolveResponsiveRules as P,resolveSvgFill as M,responsiveRuleMatches as H,useChartMode as L,useChartSelection as N,useLinkedHover as z,useObservationSelector as T,useThemeSequential as B,wrapStyleWithSelection as E}from"./chunk-chunk-6HSGDMTA.module.min.js";import{getMinMax as W}from"./chunk-chunk-JJ2OOIET.module.min.js";import"./chunk-chunk-WCX6U47H.module.min.js";import{glyphExtent as O,glyphPlacement as F}from"./chunk-chunk-KTWEBFMX.module.min.js";import{ChartError as D,SafeRender as U,renderEmptyState as Z,renderLoadingState as G,warnMissingField as $}from"./chunk-chunk-ZCNBUZPL.module.min.js";import"./chunk-chunk-YHNZCPOZ.module.min.js";import{useMemo as J}from"react";import{scaleSequential as _}from"d3-scale";import{useState as K,useEffect as q,useMemo as X}from"react";import{feature as Y}from"topojson-client";var Q=new Map;function V(e){return"default"in e?e.default:e}async function ee(e){const t=Q.get(e);if(t)return t;const{topology:o,objectName:i}=await async function(e){try{switch(e){case"world-110m":return{topology:V(await import("world-atlas/countries-110m.json")),objectName:"countries"};case"world-50m":return{topology:V(await import("world-atlas/countries-50m.json")),objectName:"countries"};case"land-110m":return{topology:V(await import("world-atlas/land-110m.json")),objectName:"land"};case"land-50m":return{topology:V(await import("world-atlas/land-50m.json")),objectName:"land"};default:throw Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){if(/Cannot find module|Failed to resolve|world-atlas/i.test(t instanceof Error?t.message:t+""))throw Error(`resolveReferenceGeography("${e}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:t});throw t}}(e);if(!o||!o.objects)throw Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof o} with keys: ${o?Object.keys(o).join(", "):"none"}`);const n=Y(o,o.objects[i]),r="features"in n?n.features:[n];return Q.set(e,r),r}function te(e){const t=X(()=>Array.isArray(e)?e:void 0,[e]),[o,i]=K(null);return q(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return i(null),ee(e).then(e=>{t||i(e)}),()=>{t=!0}}var t;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),i(null)}else i(null)},[e]),void 0!==t?t:o}import{jsx as oe,jsxs as ie}from"react/jsx-runtime";function ne(e){const t=L(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),o=B(),{areas:i,valueAccessor:n,styleRules:s,colorScheme:c,projection:h="equalEarth",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:w,tileAttribution:C,tileCacheSize:A,tooltip:x,areaOpacity:j=1,annotations:R,margin:P,className:M,selection:H,linkedHover:z,onObservation:T,onClick:W,chartId:O,loading:F,loadingContent:$,emptyContent:K,frameProps:q={},stroke:X,strokeWidth:Y,opacity:Q}=e,V=g??!!w,ee=te(i),ne=J(()=>ee?k(ee):ee,[ee]),re=J(()=>"function"==typeof n?n:e=>e?.properties?.[n]??e?.[n],[n]),ae=c??o??"blues",le=J(()=>{if(!ne)return _(S(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(const o of ne){const i=re(o);null!=i&&isFinite(i)&&(e>i&&(e=i),i>t&&(t=i))}const o=S(ae);return _(o).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[ne,re,ae]),{activeSelectionHook:se,customHoverBehavior:ce,customClickBehavior:me}=N({selection:H,linkedHover:z,onObservation:T,onClick:W,chartType:"ChoroplethMap",chartId:O,mobileInteraction:t.mobileInteraction}),de=m(H),ue=J(()=>{const e=u(e=>{const t=re(e);return{fill:null!=t&&isFinite(t)?le(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:j}},s,e=>({value:re(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=a(e,{stroke:X,strokeWidth:Y,opacity:Q});return se?E(t,se,de):t},[re,le,se,de,j,X,Y,Q,s]),he=J(()=>e=>{const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",o=re(e);return ie("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[oe("div",{style:{fontWeight:600},children:t}),null!=o&&oe("div",{style:{opacity:.7},children:(i=o,"number"==typeof i&&isFinite(i)?Number.isInteger(i)?i.toLocaleString():i.toLocaleString(void 0,{maximumFractionDigits:2}):(i??"")+"")})]});var i},[re]),pe=J(()=>({top:10,right:10,bottom:10,left:10,...l(P)}),[P]),fe=G(F,t.width,t.height,$)||(ne?null:G(!0,t.width,t.height,$)),ge=fe?null:Z(ne,t.width,t.height,K);if(Array.isArray(ne)&&ne.length>0){const e=ne[0];if(!e||"object"!=typeof e||!e.geometry)return oe(D,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}const ye={projection:h,areas:ne,areaStyle:ue,size:[t.width,t.height],margin:pe,enableHover:!0,tooltipContent:!1===x?()=>null:!0===x?he:I(x)||he,...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...V&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...w&&{tileURL:w},...C&&{tileAttribution:C},...A&&{tileCacheSize:A},...d({linkedHover:z,selection:H,onObservation:T,onClick:W,mobileInteraction:t.mobileInteraction,customHoverBehavior:ce,customClickBehavior:me,linkedHoverInClickPredicate:!1}),...R&&R.length>0&&{annotations:R},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...M&&{className:M},...null!=e.animate&&{animate:e.animate},...q};return fe||ge||oe(U,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:oe(r,{...ye})})}ne.displayName="ChoroplethMap";import{useMemo as re,useRef as ae,forwardRef as le}from"react";var se={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5};import{jsx as ce,jsxs as me}from"react/jsx-runtime";var de=le(function(e,t){const o=ae(null);c(t,{variant:"geo-points",frameRef:o});const i=L(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:n,xAccessor:l="lon",yAccessor:m="lat",sizeBy:p,sizeRange:f=[3,30],colorBy:g,styleRules:y,colorScheme:k,projection:S="equalEarth",graticule:A,fitPadding:x,zoomable:j,zoomExtent:R,onZoom:P,dragRotate:M,tileURL:H,tileAttribution:N,tileCacheSize:z,areas:T,areaStyle:B=se,tooltip:O,annotations:F,margin:D,className:Z,selection:G,linkedHover:J,onObservation:_,onClick:K,chartId:q,loading:X,loadingContent:Y,emptyContent:Q,legendInteraction:V,legendPosition:ee,frameProps:oe={},stroke:ie,strokeWidth:ne,opacity:le}=e,de=j??!!H,ue=te(T),he=s({data:n??v,rawData:n,colorBy:g,colorScheme:k,legendInteraction:V,legendPosition:ee,selection:G,linkedHover:J,fallbackFields:g?["string"==typeof g?g:""]:[],unwrapData:!1,onObservation:_,onClick:K,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:q,showLegend:i.showLegend,userMargin:D,marginDefaults:{top:10,bottom:10,left:10,right:10},loading:X,loadingContent:Y,emptyContent:Q,width:i.width,height:i.height}),pe=he.data,fe=re(()=>{if(!p)return;const e="function"==typeof p?p:e=>e?.[p],t=pe.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?W(t):void 0},[pe,p]),ge=re(()=>{const e=u(e=>({fill:g?w(e,g,he.colorScale):b,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:p?C(e,p,f,fe):6}),y,h(g,p)),t=a(e,{stroke:ie,strokeWidth:ne,opacity:le});return he.effectiveSelectionHook?E(t,he.effectiveSelectionHook,he.resolvedSelection):t},[g,he.colorScale,he.effectiveSelectionHook,he.resolvedSelection,p,f,fe,ie,ne,le,y]),ye=re(()=>e=>{const t=e?.name||e?.label||e?.NAME||e?.id,o="string"==typeof p?p:null,i=("function"==typeof p?p:e=>e[p])(e),n=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",r="string"==typeof g?g:null,a=r?e?.[r]:null;return me("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&ce("div",{style:{fontWeight:600,marginBottom:2},children:t}),o&&null!=i&&me("div",{children:[me("span",{style:{opacity:.7},children:[o,": "]}),n(i)]}),r&&null!=a&&me("div",{children:[me("span",{style:{opacity:.7},children:[r,": "]}),a+""]}),!t&&!o&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>me("div",{children:[me("span",{style:{opacity:.7},children:[e,": "]}),n(t)]},e))]})},[p,g]);if(he.earlyReturn)return he.earlyReturn;$("ProportionalSymbolMap",pe,"xAccessor",l),$("ProportionalSymbolMap",pe,"yAccessor",m);const be={projection:S,...null!=n&&{points:pe},xAccessor:l,yAccessor:m,pointStyle:ge,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ue&&{areas:ue,areaStyle:B},...null!=A&&{graticule:A},...null!=x&&{fitPadding:x},...de&&{zoomable:!0},...R&&{zoomExtent:R},...P&&{onZoom:P},...null!=M&&{dragRotate:M},...H&&{tileURL:H},...N&&{tileAttribution:N},...z&&{tileCacheSize:z},size:[i.width,i.height],margin:he.margin,enableHover:!0,tooltipContent:!1===O?()=>null:I(O)||ye,...he.legendBehaviorProps,...d({linkedHover:J,selection:G,onObservation:_,onClick:K,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior,linkedHoverInClickPredicate:!1}),...F&&F.length>0&&{annotations:F},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...Z&&{className:Z},...null!=e.animate&&{animate:e.animate},...oe};return ce(U,{componentName:"ProportionalSymbolMap",width:i.width,height:i.height,children:ce(r,{ref:o,...be})})});de.displayName="ProportionalSymbolMap";import{useMemo as ue,useCallback as he,useRef as pe,forwardRef as fe}from"react";import{scaleLinear as ge}from"d3-scale";import{jsx as ye,jsxs as be}from"react/jsx-runtime";var ve="__semiotic_x",ke="__semiotic_y",we=fe(function(e,t){const o=L(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:i,nodes:n,nodeIdAccessor:l="id",xAccessor:m="lon",yAccessor:u="lat",valueAccessor:h="value",projection:p="equalEarth",graticule:f,fitPadding:g,zoomable:y,zoomExtent:S,onZoom:C,dragRotate:A,tileURL:x,tileAttribution:j,tileCacheSize:P,lineType:M="geo",flowStyle:H="basic",areas:N,areaStyle:B=se,edgeColorBy:O,edgeOpacity:F=.6,edgeWidthRange:D=[1,8],edgeLinecap:Z="round",colorScheme:G,showParticles:$,particleStyle:J,tooltip:_,annotations:K,margin:q,className:X,selection:Y,linkedHover:Q,onObservation:V,onClick:ee,chartId:oe,loading:ie,loadingContent:ne,emptyContent:re,frameProps:ae={},legendInteraction:le,legendPosition:ce,stroke:me,strokeWidth:de,opacity:fe,lineIdAccessor:we}=e,Se=y??!!x,Ce=te(N),Ae=ue(()=>k(n),[n]),xe=s({data:i??v,rawData:i,colorBy:O,colorScheme:G,legendInteraction:le,legendPosition:ce,selection:Y,linkedHover:Q,fallbackFields:O?["string"==typeof O?O:""]:[],unwrapData:!1,onObservation:V,onClick:ee,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FlowMap",chartId:oe,showLegend:o.showLegend,userMargin:q,marginDefaults:{top:10,bottom:10,left:10,right:10},loading:ie,loadingContent:ne,emptyContent:re,width:o.width,height:o.height}),je=xe.data,Re=R(Q),Ie=z({name:Re?.name||"hover",fields:Re?.fields||[]}),Pe=T(e=>e.pushObservation),Me=ue(()=>{const e=new Map;for(const t of Ae)e.set(t[l]+"",t);return e},[Ae,l]),He=pe(null),Le=pe(Me);Le.current=Me;const Ne=pe(m);Ne.current=m;const ze=pe(u);ze.current=u;const Te=he(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;const t=Le.current,o=t.get(e.source+""),i=t.get(e.target+"");if(!o||!i)return null;const n="function"==typeof Ne.current?Ne.current:e=>e[Ne.current],r="function"==typeof ze.current?ze.current:e=>e[ze.current];return{...e,coordinates:[{[ve]:n(o),[ke]:r(o)},{[ve]:n(i),[ke]:r(i)}]}},[]);c(t,{variant:"geo-lines",frameRef:He,overrides:{push:e=>{const t=Te(e);t&&He.current?.pushLine(t)},pushMany:e=>{const t=[];for(const o of e){const e=Te(o);e&&t.push(e)}t.length>0&&He.current?.pushManyLines(t)}}});const Be=ue(()=>{const e=new Map;for(const t of je)t&&"object"==typeof t&&(null==t.source||e.has(t.source)||e.set(t.source,t),null==t.target||e.has(t.target)||e.set(t.target,t));return e},[je]),Ee=he(e=>{if(Q)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){const e=Be.get(t[l]+"");e&&Ie.onHover(e)}else Ie.onHover(t)}else Ie.onHover(null);if(V||Pe){const t={timestamp:Date.now(),chartType:"FlowMap",chartId:oe};if(e){let o=e.data||e.datum||e;Array.isArray(o)&&(o=o[0]);const i={...t,type:"hover",datum:o||{},x:e.x??0,y:e.y??0};V&&V(i),Pe&&Pe(i)}else{const e={...t,type:"hover-end"};V&&V(e),Pe&&Pe(e)}}},[Q,Ie,l,Be,V,oe,Pe]),We=xe.customClickBehavior,Oe=ue(()=>{const e="function"==typeof m?m:e=>e[m],t="function"==typeof u?u:e=>e[u];return je.map(o=>{if(!o||"object"!=typeof o||null==o.source||null==o.target)return null;const i=Me.get(o.source+""),n=Me.get(o.target+"");return i&&n?{...o,coordinates:[{[ve]:e(i),[ke]:t(i)},{[ve]:e(n),[ke]:t(n)}]}:null}).filter(Boolean)},[je,Me,m,u]),Fe=ue(()=>{const e="function"==typeof m?m:e=>e[m];return t=>null!=t&&"object"==typeof t&&ve in t?t[ve]:e(t)},[m]),De=ue(()=>{const e="function"==typeof u?u:e=>e[u];return t=>null!=t&&"object"==typeof t&&ke in t?t[ke]:e(t)},[u]),Ue=ue(()=>{const e=je.filter(e=>e&&"object"==typeof e).map(e=>e[h]??0).filter(e=>isFinite(e));return 0===e.length?()=>D[0]:ge().domain(W(e)).range(D)},[je,h,D]),Ze=ue(()=>e=>({stroke:O?w(e,O,xe.colorScale):b,strokeWidth:Ue(e[h]??0),strokeLinecap:Z,opacity:F}),[O,xe.colorScale,Ue,h,F,Z]),Ge=ue(()=>{const e=a(Ze,{stroke:me,strokeWidth:de,opacity:fe});if(!xe.effectiveSelectionHook)return e;const t={...xe.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return E(e,xe.effectiveSelectionHook,{...xe.resolvedSelection||{},unselectedStyle:t})},[Ze,xe.effectiveSelectionHook,xe.resolvedSelection,me,de,fe]),$e=ue(()=>a(()=>({fill:"#333",r:5,fillOpacity:.8}),{stroke:me,strokeWidth:de,opacity:fe}),[me,de,fe]),Je=ue(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)return ye("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:ye("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){const t=e[h];return be("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[be("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&ye("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}const t=e?.name||e?.label||e?.[l];return null!=t?ye("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:ye("div",{style:{fontWeight:600},children:t})}):null},[h,l]);if(xe.earlyReturn)return xe.earlyReturn;const _e={projection:p,...null!=i&&{lines:Oe},points:Ae,xAccessor:Fe,yAccessor:De,lineDataAccessor:"coordinates",...null!=we&&{lineIdAccessor:we},lineType:M,flowStyle:H,lineStyle:Ge,pointStyle:$e,...Ce&&{areas:Ce,areaStyle:B},...null!=f&&{graticule:f},...null!=g&&{fitPadding:g},...Se&&{zoomable:!0},...S&&{zoomExtent:S},...C&&{onZoom:C},...null!=A&&{dragRotate:A},...$&&{showParticles:$},...J&&{particleStyle:J},...x&&{tileURL:x},...j&&{tileAttribution:j},...P&&{tileCacheSize:P},size:[o.width,o.height],margin:xe.margin,enableHover:!0,tooltipContent:!1===_?()=>null:I(_)||Je,...xe.legendBehaviorProps,...d({linkedHover:Q,selection:Y,onObservation:V,onClick:ee,mobileInteraction:xe.mobileInteraction,customHoverBehavior:Ee,customClickBehavior:We,linkedHoverInClickPredicate:!1}),...K&&K.length>0&&{annotations:K},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...X&&{className:X},...null!=e.animate&&{animate:e.animate},...ae};return ye(U,{componentName:"FlowMap",width:o.width,height:o.height,children:ye(r,{ref:He,..._e})})});we.displayName="FlowMap";import{useMemo as Se,useRef as Ce,useState as Ae,useEffect as xe,useCallback as je,forwardRef as Re}from"react";import{jsx as Ie,jsxs as Pe}from"react/jsx-runtime";var Me=Re(function(e,t){const o=L(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:i,lines:n,xAccessor:l="lon",yAccessor:m="lat",nodeIdAccessor:p="id",center:f,costAccessor:g,strength:y=1,lineMode:v="straight",projection:S="mercator",graticule:C,fitPadding:A,zoomable:x,zoomExtent:j,onZoom:R,dragRotate:P,tileURL:M,tileAttribution:H,tileCacheSize:N,transition:z,colorBy:T,styleRules:B,colorScheme:W,pointRadius:O=5,tooltip:F,showRings:D=!0,ringStyle:Z,showNorth:G=!0,costLabel:J,annotations:_,margin:K,className:q,selection:X,linkedHover:Y,onObservation:Q,onClick:V,chartId:ee,loading:te,loadingContent:oe,emptyContent:ie,legendPosition:ne,frameProps:re={},stroke:ae,strokeWidth:le,opacity:se}=e,ce=x??!!M,me=Se(()=>k(i),[i]),de=s({data:me,rawData:i,colorBy:T,colorScheme:W,legendInteraction:void 0,legendPosition:ne,selection:X,linkedHover:Y,fallbackFields:T?["string"==typeof T?T:""]:[],unwrapData:!1,onObservation:Q,onClick:V,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DistanceCartogram",chartId:ee,showLegend:o.showLegend,userMargin:K,marginDefaults:{top:10,bottom:10,left:10,right:10},loading:te,loadingContent:oe,emptyContent:ie,width:o.width,height:o.height}),ue=Se(()=>{const e=u(e=>({fill:T?w(e,T,de.colorScale):b,fillOpacity:.8,stroke:"#fff",strokeWidth:1,r:O}),B,h(T)),t=a(e,{stroke:ae,strokeWidth:le,opacity:se});return de.effectiveSelectionHook?E(t,de.effectiveSelectionHook,de.resolvedSelection):t},[T,de.colorScale,de.effectiveSelectionHook,de.resolvedSelection,O,ae,le,se,B]),he=Se(()=>({center:f,centerAccessor:p,costAccessor:g,strength:y,lineMode:v}),[f,p,g,y,v]),pe=Se(()=>{if(!n)return;const e="function"==typeof l?l:e=>e[l],t="function"==typeof m?m:e=>e[m],o=new Map;for(const e of me)o.set(e[p]+"",e);return n.map(i=>{if(i.coordinates)return i;const n=o.get(i.source+""),r=o.get(i.target+"");return n&&r?{...i,coordinates:[{[l]:e(n),[m]:t(n)},{[l]:e(r),[m]:t(r)}]}:null}).filter(Boolean)},[n,me,l,m,p]),fe=Se(()=>e=>{const t=("function"==typeof g?g:e=>e[g])(e);return Pe("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ie("div",{style:{fontWeight:600},children:e[p]||e.name||e.id||"Point"}),null!=t&&Pe("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[g,p]),ge=Ce(null);c(t,{variant:"geo-points",frameRef:ge});const[ye,be]=Ae(null),ve=je(()=>{const e=ge.current?.getCartogramLayout?.();e&&be(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius?t:e)},[]);xe(()=>{const e=requestAnimationFrame(ve);return()=>cancelAnimationFrame(e)},[ve,y,f,o.width,o.height,me]);const ke=Se(()=>{if(!D||!ye)return[];const{maxCost:e}=ye;if(0>=e)return[];if(Array.isArray(D))return D.filter(t=>t>0&&e>=t);const t="number"==typeof D?D:Math.min(5,Math.max(2,Math.ceil(e/5))),o=e/t,i=[];for(let e=1;t>=e;e++)i.push(Math.round(o*e*10)/10);return i},[D,ye]),we=Se(()=>{if(!ye)return re.foregroundGraphics||null;const{cx:e,cy:t,maxCost:o,availableRadius:i}=ye,n={stroke:"#999",strokeWidth:.8,strokeDasharray:"4,3",labelColor:"#777",labelSize:10,...Z},r=de.margin.left??10,a=de.margin.top??10;return Pe("g",{children:[ke.map(l=>{const s=l/o*i;return Pe("g",{children:[Ie("circle",{cx:e+r,cy:t+a,r:s,fill:"none",stroke:n.stroke,strokeWidth:n.strokeWidth,strokeDasharray:n.strokeDasharray,opacity:.5}),Pe("text",{x:e+r+s+3,y:t+a-2,fontSize:n.labelSize,fill:n.labelColor,fontFamily:"system-ui, sans-serif",children:[l,J?" "+J:""]})]},l)}),G&&Pe("g",{transform:`translate(${r+24}, ${a+24})`,children:[Ie("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),Ie("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),Ie("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"system-ui, sans-serif",children:"N"}),Ie("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),Ie("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),Ie("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]}),re.foregroundGraphics]})},[ye,ke,G,J,Z,de.margin,re.foregroundGraphics]);if(de.earlyReturn)return de.earlyReturn;$("DistanceCartogram",me,"xAccessor",l),$("DistanceCartogram",me,"yAccessor",m);const Re={projection:S,...null!=i&&{points:me},...pe&&{lines:pe,lineDataAccessor:"coordinates"},xAccessor:l,yAccessor:m,pointIdAccessor:p,pointStyle:ue,projectionTransform:he,...z&&{transition:{duration:z}},...null!=C&&{graticule:C},...null!=A&&{fitPadding:A},...ce&&{zoomable:!0},...j&&{zoomExtent:j},...R&&{onZoom:R},...null!=P&&{dragRotate:P},...M&&{tileURL:M},...H&&{tileAttribution:H},...N&&{tileCacheSize:N},size:[o.width,o.height],margin:de.margin,enableHover:!0,tooltipContent:!1===F?()=>null:I(F)||fe,...de.legendBehaviorProps,...d({linkedHover:Y,selection:X,onObservation:Q,onClick:V,mobileInteraction:de.mobileInteraction,customHoverBehavior:de.customHoverBehavior,customClickBehavior:de.customClickBehavior,linkedHoverInClickPredicate:!1}),..._&&_.length>0&&{annotations:_},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...q&&{className:q},...null!=e.animate&&{animate:e.animate},...re,foregroundGraphics:we};return Ie(U,{componentName:"DistanceCartogram",width:o.width,height:o.height,children:Ie(r,{ref:ge,...Re})})});function He(e,t,o){const{featureKey:i,dataKey:n}=o,r=new Map;for(const e of t)r.set(e[n]+"",e);return e.map(e=>{const t=(e=>{const t=i.split(".");let o=e;for(const e of t)o=null!==o&&"object"==typeof o?o[e]:void 0;return(o??"")+""})(e),o=r.get(t);return o?{...e,properties:{...e.properties,...o}}:e})}Me.displayName="DistanceCartogram";export{ne as ChoroplethMap,e as DEFAULT_HIT_RADIUS,Me as DistanceCartogram,we as FlowMap,n as GeoCustomChart,de as ProportionalSymbolMap,r as StreamGeoFrame,u as composeStyleRules,t as geoAreaHitTarget,o as geoHitTarget,O as glyphExtent,F as glyphPlacement,A as hatchFillId,x as hatchPatternDef,i as hitTargetPoint,j as isHatchFill,h as makeNodeRuleContext,p as makeRuleValueResolver,f as matchesThreshold,He as mergeData,ee as resolveReferenceGeography,P as resolveResponsiveRules,g as resolveStyleRules,M as resolveSvgFill,H as responsiveRuleMatches,y as ruleMatches};
|
|
2
|
+
import{DEFAULT_HIT_RADIUS as e,geoAreaHitTarget as t,geoHitTarget as o,hitTargetPoint as n}from"./chunk-chunk-J3XWETBJ.module.min.js";import{GeoCustomChart as i,StreamGeoFrame_default as r}from"./chunk-chunk-FP44FHFO.module.min.js";import{mergeShapeStyle as a,normalizePartialMargin as l,useChartSetup as s,useFrameImperativeHandle as c,useResolvedSelection as d}from"./chunk-chunk-PLIDPQNG.module.min.js";import"./chunk-chunk-6TPGFL7M.module.min.js";import"./chunk-chunk-F5V4UIE6.module.min.js";import"./chunk-chunk-KQ546MKE.module.min.js";import{buildCustomBehaviorProps as m}from"./chunk-chunk-F7WFPD4O.module.min.js";import"./chunk-chunk-5UKL5W76.module.min.js";import{composeStyleRules as u,makeNodeRuleContext as h,makeRuleValueResolver as p,matchesThreshold as f,resolveStyleRules as g,ruleMatches as y}from"./chunk-chunk-EMO5NUGE.module.min.js";import"./chunk-chunk-FBGHXL72.module.min.js";import{DEFAULT_COLOR as b,EMPTY_ARRAY as v,filterSparseArray as k,getColor as w,getSequentialInterpolator as S,getSize as C,hatchFillId as A,hatchPatternDef as H,isHatchFill as x,normalizeLinkedHover as j,normalizeTooltip as R,resolveAxisFreeMarginDefaults as I,resolveResponsiveRules as P,resolveSvgFill as M,responsiveRuleMatches as L,useChartMode as N,useChartSelection as z,useLinkedHover as F,useObservationSelector as B,useThemeSequential as W,wrapStyleWithSelection as O}from"./chunk-chunk-BFHUYEOS.module.min.js";import{getMinMax as E}from"./chunk-chunk-JJ2OOIET.module.min.js";import"./chunk-chunk-WCX6U47H.module.min.js";import{glyphExtent as T,glyphPlacement as D}from"./chunk-chunk-KTWEBFMX.module.min.js";import{ChartError as U,SafeRender as G,renderEmptyState as Z,renderLoadingState as $,warnMissingField as _}from"./chunk-chunk-ACLDBMRH.module.min.js";import"./chunk-chunk-YHNZCPOZ.module.min.js";import{useMemo as J}from"react";import{scaleSequential as K}from"d3-scale";import{useState as q,useEffect as X,useMemo as Q}from"react";import{feature as V}from"topojson-client";var Y=new Map;function ee(e){return"default"in e?e.default:e}async function te(e){const t=Y.get(e);if(t)return t;const{topology:o,objectName:n}=await async function(e){try{switch(e){case"world-110m":return{topology:ee(await import("world-atlas/countries-110m.json")),objectName:"countries"};case"world-50m":return{topology:ee(await import("world-atlas/countries-50m.json")),objectName:"countries"};case"land-110m":return{topology:ee(await import("world-atlas/land-110m.json")),objectName:"land"};case"land-50m":return{topology:ee(await import("world-atlas/land-50m.json")),objectName:"land"};default:throw Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){if(/Cannot find module|Failed to resolve|world-atlas/i.test(t instanceof Error?t.message:t+""))throw Error(`resolveReferenceGeography("${e}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:t});throw t}}(e);if(!o||!o.objects)throw Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof o} with keys: ${o?Object.keys(o).join(", "):"none"}`);const i=V(o,o.objects[n]),r="features"in i?i.features:[i];return Y.set(e,r),r}function oe(e){const t=Q(()=>Array.isArray(e)?e:void 0,[e]),[o,n]=q(null);return X(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return n(null),te(e).then(e=>{t||n(e)}),()=>{t=!0}}var t;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),n(null)}else n(null)},[e]),void 0!==t?t:o}import{jsx as ne,jsxs as ie}from"react/jsx-runtime";function re(e){const t=N(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),o=W(),{areas:n,valueAccessor:i,styleRules:s,colorScheme:c,projection:h="equalEarth",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:w,tileAttribution:C,tileCacheSize:A,tooltip:H,areaOpacity:x=1,annotations:j,margin:P,className:M,selection:L,linkedHover:F,onObservation:B,onClick:E,chartId:T,loading:D,loadingContent:_,emptyContent:q,frameProps:X={},stroke:Q,strokeWidth:V,opacity:Y}=e,ee=g??!!w,te=oe(n),re=J(()=>te?k(te):te,[te]),ae=J(()=>"function"==typeof i?i:e=>e?.properties?.[i]??e?.[i],[i]),le=c??o??"blues",se=J(()=>{if(!re)return K(S(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(const o of re){const n=ae(o);null!=n&&isFinite(n)&&(e>n&&(e=n),n>t&&(t=n))}const o=S(le);return K(o).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[re,ae,le]),{activeSelectionHook:ce,customHoverBehavior:de,customClickBehavior:me}=z({selection:L,linkedHover:F,onObservation:B,onClick:E,chartType:"ChoroplethMap",chartId:T,mobileInteraction:t.mobileInteraction}),ue=d(L),he=J(()=>{const e=u(e=>{const t=ae(e);return{fill:null!=t&&isFinite(t)?se(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},s,e=>({value:ae(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=a(e,{stroke:Q,strokeWidth:V,opacity:Y});return ce?O(t,ce,ue):t},[ae,se,ce,ue,x,Q,V,Y,s]),pe=J(()=>e=>{const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",o=ae(e);return ie("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[ne("div",{style:{fontWeight:600},children:t}),null!=o&&ne("div",{style:{opacity:.7},children:(n=o,"number"==typeof n&&isFinite(n)?Number.isInteger(n)?n.toLocaleString():n.toLocaleString(void 0,{maximumFractionDigits:2}):(n??"")+"")})]});var n},[ae]),fe=I(t),ge=J(()=>({...fe,...l(P)}),[fe,P]),ye=$(D,t.width,t.height,_)||(re?null:$(!0,t.width,t.height,_)),be=ye?null:Z(re,t.width,t.height,q);if(Array.isArray(re)&&re.length>0){const e=re[0];if(!e||"object"!=typeof e||!e.geometry)return ne(U,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}const ve={projection:h,areas:re,areaStyle:he,size:[t.width,t.height],margin:ge,enableHover:t.enableHover,tooltipContent:!1===H?()=>null:!0===H?pe:R(H)||pe,...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...ee&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...w&&{tileURL:w},...C&&{tileAttribution:C},...A&&{tileCacheSize:A},...m({linkedHover:F,selection:L,onObservation:B,onClick:E,mobileInteraction:t.mobileInteraction,customHoverBehavior:de,customClickBehavior:me,linkedHoverInClickPredicate:!1}),...j&&j.length>0&&{annotations:j},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...M&&{className:M},...null!=e.animate&&{animate:e.animate},...X};return ye||be||ne(G,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:ne(r,{...ve})})}re.displayName="ChoroplethMap";import{useMemo as ae,useRef as le,forwardRef as se}from"react";var ce={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5};import{jsx as de,jsxs as me}from"react/jsx-runtime";var ue=[3,30],he=[1,4],pe=se(function(e,t){const o=le(null);c(t,{variant:"geo-points",frameRef:o});const n=N(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:i,xAccessor:l="lon",yAccessor:d="lat",sizeBy:p,sizeRange:f,colorBy:g,styleRules:y,colorScheme:k,projection:S="equalEarth",graticule:A,fitPadding:H,zoomable:x,zoomExtent:j,onZoom:P,dragRotate:M,tileURL:L,tileAttribution:z,tileCacheSize:F,areas:B,areaStyle:W=ce,tooltip:T,annotations:D,margin:U,className:Z,selection:$,linkedHover:J,onObservation:K,onClick:q,chartId:X,loading:Q,loadingContent:V,emptyContent:Y,legendInteraction:ee,legendPosition:te,frameProps:ne={},stroke:ie,strokeWidth:re,opacity:se}=e,pe=f??("sparkline"===n.mode?he:ue),fe="sparkline"===n.mode?1.5:6,ge=x??!!L,ye=oe(B),be=s({data:i??v,rawData:i,colorBy:g,colorScheme:k,legendInteraction:ee,legendPosition:te,selection:$,linkedHover:J,fallbackFields:g?["string"==typeof g?g:""]:[],unwrapData:!1,onObservation:K,onClick:q,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:X,showLegend:n.showLegend,userMargin:U,marginDefaults:I(n),loading:Q,loadingContent:V,emptyContent:Y,width:n.width,height:n.height}),ve=be.data,ke=ae(()=>{if(!p)return;const e="function"==typeof p?p:e=>e?.[p],t=ve.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?E(t):void 0},[ve,p]),we=ae(()=>{const e=u(e=>({fill:g?w(e,g,be.colorScale):b,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:p?C(e,p,pe,ke):fe}),y,h(g,p)),t=a(e,{stroke:ie,strokeWidth:re,opacity:se});return be.effectiveSelectionHook?O(t,be.effectiveSelectionHook,be.resolvedSelection):t},[g,be.colorScale,be.effectiveSelectionHook,be.resolvedSelection,p,pe,ke,fe,ie,re,se,y]),Se=ae(()=>e=>{const t=e?.name||e?.label||e?.NAME||e?.id,o="string"==typeof p?p:null,n=("function"==typeof p?p:e=>e[p])(e),i=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",r="string"==typeof g?g:null,a=r?e?.[r]:null;return me("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&de("div",{style:{fontWeight:600,marginBottom:2},children:t}),o&&null!=n&&me("div",{children:[me("span",{style:{opacity:.7},children:[o,": "]}),i(n)]}),r&&null!=a&&me("div",{children:[me("span",{style:{opacity:.7},children:[r,": "]}),a+""]}),!t&&!o&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>me("div",{children:[me("span",{style:{opacity:.7},children:[e,": "]}),i(t)]},e))]})},[p,g]);if(be.earlyReturn)return be.earlyReturn;_("ProportionalSymbolMap",ve,"xAccessor",l),_("ProportionalSymbolMap",ve,"yAccessor",d);const Ce={projection:S,...null!=i&&{points:ve},xAccessor:l,yAccessor:d,pointStyle:we,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ye&&{areas:ye,areaStyle:W},...null!=A&&{graticule:A},...null!=H&&{fitPadding:H},...ge&&{zoomable:!0},...j&&{zoomExtent:j},...P&&{onZoom:P},...null!=M&&{dragRotate:M},...L&&{tileURL:L},...z&&{tileAttribution:z},...F&&{tileCacheSize:F},size:[n.width,n.height],margin:be.margin,enableHover:n.enableHover,tooltipContent:!1===T?()=>null:R(T)||Se,...be.legendBehaviorProps,...m({linkedHover:J,selection:$,onObservation:K,onClick:q,mobileInteraction:be.mobileInteraction,customHoverBehavior:be.customHoverBehavior,customClickBehavior:be.customClickBehavior,linkedHoverInClickPredicate:!1}),...D&&D.length>0&&{annotations:D},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...n.title&&{title:n.title},...n.description&&{description:n.description},...n.summary&&{summary:n.summary},...void 0!==n.accessibleTable&&{accessibleTable:n.accessibleTable},...Z&&{className:Z},...null!=e.animate&&{animate:e.animate},...ne};return de(G,{componentName:"ProportionalSymbolMap",width:n.width,height:n.height,children:de(r,{ref:o,...Ce})})});pe.displayName="ProportionalSymbolMap";import{useMemo as fe,useCallback as ge,useRef as ye,forwardRef as be}from"react";import{scaleLinear as ve}from"d3-scale";import{jsx as ke,jsxs as we}from"react/jsx-runtime";var Se="__semiotic_x",Ce="__semiotic_y",Ae=be(function(e,t){const o=N(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:n,nodes:i,nodeIdAccessor:l="id",xAccessor:d="lon",yAccessor:u="lat",valueAccessor:h="value",projection:p="equalEarth",graticule:f,fitPadding:g,zoomable:y,zoomExtent:S,onZoom:C,dragRotate:A,tileURL:H,tileAttribution:x,tileCacheSize:P,lineType:M="geo",flowStyle:L="basic",areas:z,areaStyle:W=ce,edgeColorBy:T,edgeOpacity:D=.6,edgeWidthRange:U=[1,8],pointRadius:Z,edgeLinecap:$="round",colorScheme:_,showParticles:J,particleStyle:K,tooltip:q,annotations:X,margin:Q,className:V,selection:Y,linkedHover:ee,onObservation:te,onClick:ne,chartId:ie,loading:re,loadingContent:ae,emptyContent:le,frameProps:se={},legendInteraction:de,legendPosition:me,stroke:ue,strokeWidth:he,opacity:pe,lineIdAccessor:be}=e,Ae=y??!!H,He=oe(z),xe=fe(()=>k(i),[i]),je=s({data:n??v,rawData:n,colorBy:T,colorScheme:_,legendInteraction:de,legendPosition:me,selection:Y,linkedHover:ee,fallbackFields:T?["string"==typeof T?T:""]:[],unwrapData:!1,onObservation:te,onClick:ne,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FlowMap",chartId:ie,showLegend:o.showLegend,userMargin:Q,marginDefaults:I(o),loading:re,loadingContent:ae,emptyContent:le,width:o.width,height:o.height}),Re=je.data,Ie=j(ee),Pe=F({name:Ie?.name||"hover",fields:Ie?.fields||[]}),Me=B(e=>e.pushObservation),Le=fe(()=>{const e=new Map;for(const t of xe)e.set(t[l]+"",t);return e},[xe,l]),Ne=ye(null),ze=ye(Le);ze.current=Le;const Fe=ye(d);Fe.current=d;const Be=ye(u);Be.current=u;const We=ge(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;const t=ze.current,o=t.get(e.source+""),n=t.get(e.target+"");if(!o||!n)return null;const i="function"==typeof Fe.current?Fe.current:e=>e[Fe.current],r="function"==typeof Be.current?Be.current:e=>e[Be.current];return{...e,coordinates:[{[Se]:i(o),[Ce]:r(o)},{[Se]:i(n),[Ce]:r(n)}]}},[]);c(t,{variant:"geo-lines",frameRef:Ne,overrides:{push:e=>{const t=We(e);t&&Ne.current?.pushLine(t)},pushMany:e=>{const t=[];for(const o of e){const e=We(o);e&&t.push(e)}t.length>0&&Ne.current?.pushManyLines(t)}}});const Oe=fe(()=>{const e=new Map;for(const t of Re)t&&"object"==typeof t&&(null==t.source||e.has(t.source)||e.set(t.source,t),null==t.target||e.has(t.target)||e.set(t.target,t));return e},[Re]),Ee=ge(e=>{if(ee)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){const e=Oe.get(t[l]+"");e&&Pe.onHover(e)}else Pe.onHover(t)}else Pe.onHover(null);if(te||Me){const t={timestamp:Date.now(),chartType:"FlowMap",chartId:ie};if(e){let o=e.data||e.datum||e;Array.isArray(o)&&(o=o[0]);const n={...t,type:"hover",datum:o||{},x:e.x??0,y:e.y??0};te&&te(n),Me&&Me(n)}else{const e={...t,type:"hover-end"};te&&te(e),Me&&Me(e)}}},[ee,Pe,l,Oe,te,ie,Me]),Te=je.customClickBehavior,De=fe(()=>{const e="function"==typeof d?d:e=>e[d],t="function"==typeof u?u:e=>e[u];return Re.map(o=>{if(!o||"object"!=typeof o||null==o.source||null==o.target)return null;const n=Le.get(o.source+""),i=Le.get(o.target+"");return n&&i?{...o,coordinates:[{[Se]:e(n),[Ce]:t(n)},{[Se]:e(i),[Ce]:t(i)}]}:null}).filter(Boolean)},[Re,Le,d,u]),Ue=fe(()=>{const e="function"==typeof d?d:e=>e[d];return t=>null!=t&&"object"==typeof t&&Se in t?t[Se]:e(t)},[d]),Ge=fe(()=>{const e="function"==typeof u?u:e=>e[u];return t=>null!=t&&"object"==typeof t&&Ce in t?t[Ce]:e(t)},[u]),Ze=fe(()=>{const e=Re.filter(e=>e&&"object"==typeof e).map(e=>e[h]??0).filter(e=>isFinite(e));return 0===e.length?()=>U[0]:ve().domain(E(e)).range(U)},[Re,h,U]),$e=fe(()=>e=>({stroke:T?w(e,T,je.colorScale):b,strokeWidth:Ze(e[h]??0),strokeLinecap:$,opacity:D}),[T,je.colorScale,Ze,h,D,$]),_e=fe(()=>{const e=a($e,{stroke:ue,strokeWidth:he,opacity:pe});if(!je.effectiveSelectionHook)return e;const t={...je.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return O(e,je.effectiveSelectionHook,{...je.resolvedSelection||{},unselectedStyle:t})},[$e,je.effectiveSelectionHook,je.resolvedSelection,ue,he,pe]),Je=Z??("sparkline"===o.mode?1.5:5),Ke=fe(()=>a(()=>({fill:"#333",r:Je,fillOpacity:.8}),{stroke:ue,strokeWidth:he,opacity:pe}),[Je,ue,he,pe]),qe=fe(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)return ke("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:ke("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){const t=e[h];return we("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[we("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&ke("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}const t=e?.name||e?.label||e?.[l];return null!=t?ke("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:ke("div",{style:{fontWeight:600},children:t})}):null},[h,l]);if(je.earlyReturn)return je.earlyReturn;const Xe={projection:p,...null!=n&&{lines:De},points:xe,xAccessor:Ue,yAccessor:Ge,lineDataAccessor:"coordinates",...null!=be&&{lineIdAccessor:be},lineType:M,flowStyle:L,lineStyle:_e,pointStyle:Ke,...He&&{areas:He,areaStyle:W},...null!=f&&{graticule:f},...null!=g&&{fitPadding:g},...Ae&&{zoomable:!0},...S&&{zoomExtent:S},...C&&{onZoom:C},...null!=A&&{dragRotate:A},...J&&{showParticles:J},...K&&{particleStyle:K},...H&&{tileURL:H},...x&&{tileAttribution:x},...P&&{tileCacheSize:P},size:[o.width,o.height],margin:je.margin,enableHover:o.enableHover,tooltipContent:!1===q?()=>null:R(q)||qe,...je.legendBehaviorProps,...m({linkedHover:ee,selection:Y,onObservation:te,onClick:ne,mobileInteraction:je.mobileInteraction,customHoverBehavior:Ee,customClickBehavior:Te,linkedHoverInClickPredicate:!1}),...X&&X.length>0&&{annotations:X},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...V&&{className:V},...null!=e.animate&&{animate:e.animate},...se};return ke(G,{componentName:"FlowMap",width:o.width,height:o.height,children:ke(r,{ref:Ne,...Xe})})});Ae.displayName="FlowMap";import{useMemo as He,useRef as xe,useState as je,useEffect as Re,useCallback as Ie,forwardRef as Pe}from"react";import{jsx as Me,jsxs as Le}from"react/jsx-runtime";var Ne=Pe(function(e,t){const o=N(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:n,lines:i,xAccessor:l="lon",yAccessor:d="lat",nodeIdAccessor:p="id",center:f,costAccessor:g,strength:y=1,lineMode:v="straight",projection:S="mercator",graticule:C,fitPadding:A,zoomable:H,zoomExtent:x,onZoom:j,dragRotate:P,tileURL:M,tileAttribution:L,tileCacheSize:z,transition:F,colorBy:B,styleRules:W,colorScheme:E,pointRadius:T,tooltip:D,showRings:U,showRingLabels:Z,ringStyle:$,showNorth:J,costLabel:K,annotations:q,margin:X,className:Q,selection:V,linkedHover:Y,onObservation:ee,onClick:te,chartId:oe,loading:ne,loadingContent:ie,emptyContent:re,legendPosition:ae,frameProps:le={},stroke:se,strokeWidth:ce,opacity:de}=e,me=T??("sparkline"===o.mode?1.5:5),ue=U??!0,he=Z??!o.compactMode,pe=J??"sparkline"!==o.mode,fe=H??!!M,ge=He(()=>k(n),[n]),ye=s({data:ge,rawData:n,colorBy:B,colorScheme:E,legendInteraction:void 0,legendPosition:ae,selection:V,linkedHover:Y,fallbackFields:B?["string"==typeof B?B:""]:[],unwrapData:!1,onObservation:ee,onClick:te,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DistanceCartogram",chartId:oe,showLegend:o.showLegend,userMargin:X,marginDefaults:I(o),loading:ne,loadingContent:ie,emptyContent:re,width:o.width,height:o.height}),be=He(()=>{const e=u(e=>({fill:B?w(e,B,ye.colorScale):b,fillOpacity:.8,stroke:"#fff",strokeWidth:1,r:me}),W,h(B)),t=a(e,{stroke:se,strokeWidth:ce,opacity:de});return ye.effectiveSelectionHook?O(t,ye.effectiveSelectionHook,ye.resolvedSelection):t},[B,ye.colorScale,ye.effectiveSelectionHook,ye.resolvedSelection,me,se,ce,de,W]),ve=He(()=>({center:f,centerAccessor:p,costAccessor:g,strength:y,lineMode:v}),[f,p,g,y,v]),ke=He(()=>{if(!i)return;const e="function"==typeof l?l:e=>e[l],t="function"==typeof d?d:e=>e[d],o=new Map;for(const e of ge)o.set(e[p]+"",e);return i.map(n=>{if(n.coordinates)return n;const i=o.get(n.source+""),r=o.get(n.target+"");return i&&r?{...n,coordinates:[{[l]:e(i),[d]:t(i)},{[l]:e(r),[d]:t(r)}]}:null}).filter(Boolean)},[i,ge,l,d,p]),we=He(()=>e=>{const t=("function"==typeof g?g:e=>e[g])(e);return Le("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Me("div",{style:{fontWeight:600},children:e[p]||e.name||e.id||"Point"}),null!=t&&Le("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[g,p]),Se=xe(null);c(t,{variant:"geo-points",frameRef:Se});const[Ce,Ae]=je(null),Pe=Ie(()=>{const e=Se.current?.getCartogramLayout?.();e&&Ae(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius?t:e)},[]);Re(()=>{const e=requestAnimationFrame(Pe);return()=>cancelAnimationFrame(e)},[Pe,y,f,o.width,o.height,ge]);const Ne=He(()=>{if(!ue||!Ce)return[];const{maxCost:e}=Ce;if(0>=e)return[];if(Array.isArray(ue))return ue.filter(t=>t>0&&e>=t);const t="number"==typeof ue?ue:Math.min(5,Math.max(2,Math.ceil(e/5))),o=e/t,n=[];for(let e=1;t>=e;e++)n.push(Math.round(o*e*10)/10);return n},[ue,Ce]),ze=He(()=>{if(!Ce)return le.foregroundGraphics||null;const{cx:e,cy:t,maxCost:o,availableRadius:n}=Ce,i={stroke:"#999",strokeWidth:.8,strokeDasharray:"4,3",labelColor:"#777",labelSize:10,...$},r=ye.margin.left??10,a=ye.margin.top??10;return Le("g",{children:[Ne.map(l=>{const s=l/o*n;return Le("g",{children:[Me("circle",{cx:e+r,cy:t+a,r:s,fill:"none",stroke:i.stroke,strokeWidth:i.strokeWidth,strokeDasharray:i.strokeDasharray,opacity:.5}),he&&Le("text",{x:e+r+s+3,y:t+a-2,fontSize:i.labelSize,fill:i.labelColor,fontFamily:"system-ui, sans-serif",children:[l,K?" "+K:""]})]},l)}),pe&&Le("g",{transform:`translate(${r+24}, ${a+24})`,children:[Me("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),Me("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),Me("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"system-ui, sans-serif",children:"N"}),Me("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),Me("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),Me("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]}),le.foregroundGraphics]})},[Ce,Ne,he,pe,K,$,ye.margin,le.foregroundGraphics]);if(ye.earlyReturn)return ye.earlyReturn;_("DistanceCartogram",ge,"xAccessor",l),_("DistanceCartogram",ge,"yAccessor",d);const Fe={projection:S,...null!=n&&{points:ge},...ke&&{lines:ke,lineDataAccessor:"coordinates"},xAccessor:l,yAccessor:d,pointIdAccessor:p,pointStyle:be,projectionTransform:ve,...F&&{transition:{duration:F}},...null!=C&&{graticule:C},...null!=A&&{fitPadding:A},...fe&&{zoomable:!0},...x&&{zoomExtent:x},...j&&{onZoom:j},...null!=P&&{dragRotate:P},...M&&{tileURL:M},...L&&{tileAttribution:L},...z&&{tileCacheSize:z},size:[o.width,o.height],margin:ye.margin,enableHover:o.enableHover,tooltipContent:!1===D?()=>null:R(D)||we,...ye.legendBehaviorProps,...m({linkedHover:Y,selection:V,onObservation:ee,onClick:te,mobileInteraction:ye.mobileInteraction,customHoverBehavior:ye.customHoverBehavior,customClickBehavior:ye.customClickBehavior,linkedHoverInClickPredicate:!1}),...q&&q.length>0&&{annotations:q},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...Q&&{className:Q},...null!=e.animate&&{animate:e.animate},...le,foregroundGraphics:ze};return Me(G,{componentName:"DistanceCartogram",width:o.width,height:o.height,children:Me(r,{ref:Se,...Fe})})});function ze(e,t,o){const{featureKey:n,dataKey:i}=o,r=new Map;for(const e of t)r.set(e[i]+"",e);return e.map(e=>{const t=(e=>{const t=n.split(".");let o=e;for(const e of t)o=null!==o&&"object"==typeof o?o[e]:void 0;return(o??"")+""})(e),o=r.get(t);return o?{...e,properties:{...e.properties,...o}}:e})}Ne.displayName="DistanceCartogram";export{re as ChoroplethMap,e as DEFAULT_HIT_RADIUS,Ne as DistanceCartogram,Ae as FlowMap,i as GeoCustomChart,pe as ProportionalSymbolMap,r as StreamGeoFrame,u as composeStyleRules,t as geoAreaHitTarget,o as geoHitTarget,T as glyphExtent,D as glyphPlacement,A as hatchFillId,H as hatchPatternDef,n as hitTargetPoint,x as isHatchFill,h as makeNodeRuleContext,p as makeRuleValueResolver,f as matchesThreshold,ze as mergeData,te as resolveReferenceGeography,P as resolveResponsiveRules,g as resolveStyleRules,M as resolveSvgFill,L as responsiveRuleMatches,y as ruleMatches};
|