semiotic 3.12.0 → 3.12.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 +50 -46
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/behaviorContracts.cjs +1 -1
- package/ai/dist/diagnose-operation.js +3 -3
- package/ai/dist/mcp-server.js +1 -1
- package/ai/reference.md +15 -3
- package/ai/schema.json +908 -96
- package/ai/surface-manifest.json +1 -1
- package/ai/task-packets/compare-category-totals.json +5 -5
- package/ai/task-packets/compare-category-totals.md +2 -2
- package/ai/task-packets/correct-published-chart.json +5 -5
- package/ai/task-packets/correct-published-chart.md +2 -2
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +5 -5
- package/ai/task-packets/update-live-chart.md +2 -2
- package/dist/c-27DCB5T6.min.js +7 -7
- package/dist/c-2CKIGFD2.min.js +1 -1
- package/dist/c-3FATLOH4.min.js +1 -0
- package/dist/{c-STVM6CBI.min.js → c-4SCJKAWZ.min.js} +200 -200
- package/dist/c-5FUOKMH6.min.js +7 -0
- package/dist/c-AAIPWVQ5.min.js +6 -6
- package/dist/{c-2RG4WOVX.min.js → c-ALLF3Y77.min.js} +1 -1
- package/dist/{c-QMKQVCCZ.min.js → c-C5GXUHUO.min.js} +6 -6
- package/dist/c-C67QDKTU.min.js +34 -0
- package/dist/c-F76M77YC.min.js +1 -0
- package/dist/c-FEVXPKQH.min.js +1 -1
- package/dist/c-G42WVQO2.min.js +1 -0
- package/dist/c-G5A3YWTN.min.js +66 -0
- package/dist/c-H4HVKBU3.min.js +1 -0
- package/dist/c-HU3ASFKT.min.js +1 -0
- package/dist/c-I4FYCVJB.min.js +391 -0
- package/dist/{c-5L7JGWQW.min.js → c-IATPZOL7.min.js} +28 -28
- package/dist/c-IE5EBBP6.min.js +110 -0
- package/dist/c-IGONIKZL.min.js +1 -0
- package/dist/c-IKPM53JH.min.js +1 -0
- package/dist/c-IU4QZ7Y5.min.js +1 -1
- package/dist/{c-2ACLVPKF.min.js → c-K5VE57OI.min.js} +1 -1
- package/dist/c-KWJIBJ4R.min.js +1 -0
- package/dist/c-LIMFU6RD.min.js +1 -0
- package/dist/c-M4T43G76.min.js +1 -0
- package/dist/c-M7QUZZCE.min.js +1 -1
- package/dist/c-NVSINXE5.min.js +1 -0
- package/dist/{c-FAF6EV4E.min.js → c-NWRYV6ZF.min.js} +1 -1
- package/dist/c-O5GU2R5W.min.js +1 -0
- package/dist/c-OC7GNXGZ.min.js +1 -0
- package/dist/c-OV5F3DQP.min.js +1 -0
- package/dist/{c-5TAXHW7I.min.js → c-PJ5CAYAW.min.js} +1 -1
- package/dist/c-Q5LZRQGD.min.js +1 -0
- package/dist/c-QP3PXK3N.min.js +1 -0
- package/dist/c-SGZ7ZD2I.min.js +51 -0
- package/dist/c-SSKV5JPW.min.js +1 -1
- package/dist/c-THWTHWXU.min.js +37 -0
- package/dist/c-TRMNDRC4.min.js +41 -0
- package/dist/c-UP656CST.min.js +1 -1
- package/dist/c-USYOK5OX.min.js +1 -0
- package/dist/c-VI753KBO.min.js +1 -0
- package/dist/{c-TT4CTEBR.min.js → c-VLAAAFST.min.js} +1 -1
- package/dist/c-VSOQPII4.min.js +5 -5
- package/dist/c-WGDM4ZRP.min.js +26 -0
- package/dist/c-XCV7VUU3.min.js +87 -0
- package/dist/c-XGDZPYBI.min.js +1 -0
- package/dist/c-XI6CLZII.min.js +1 -0
- package/dist/{c-L4Q2YMXO.min.js → c-XLC7PKM7.min.js} +1 -1
- package/dist/{c-3YAGKCPU.min.js → c-YEB6Z35F.min.js} +1 -1
- package/dist/c-YWZBFG63.min.js +1 -0
- package/dist/c-ZMYO3NZU.min.js +2 -0
- package/dist/c-ZO36H5VH.min.js +48 -0
- package/dist/components/LinkedCharts.d.ts +6 -1
- package/dist/components/Tooltip/Tooltip.d.ts +11 -1
- package/dist/components/Tooltip/tooltipChrome.d.ts +8 -2
- package/dist/components/bundling/semioticVite.d.ts +24 -0
- package/dist/components/charts/physics/cruciblePhysics.d.ts +2 -2
- package/dist/components/charts/physics/gauntletPhysics.d.ts +2 -6
- package/dist/components/charts/physics/physicsHocUtils.d.ts +8 -1
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
- package/dist/components/charts/shared/chartSize.d.ts +58 -0
- package/dist/components/charts/shared/chartSizeDefaults.d.ts +189 -0
- package/dist/components/charts/shared/chartSizeDefaultsAtlas.d.ts +9 -0
- package/dist/components/charts/shared/chartSizeDefaultsNetwork.d.ts +29 -0
- package/dist/components/charts/shared/chartSizeDefaultsOrdinal.d.ts +13 -0
- package/dist/components/charts/shared/chartSizeDefaultsPhysics.d.ts +41 -0
- package/dist/components/charts/shared/chartSizeDefaultsValue.d.ts +19 -0
- package/dist/components/charts/shared/chartSizeDefaultsXY.d.ts +10 -0
- package/dist/components/charts/shared/networkPerspectiveWireSchema.d.ts +3 -0
- package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +4 -0
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +2 -0
- package/dist/components/charts/shared/withChartWrapper.d.ts +6 -2
- package/dist/components/charts/value/BigNumber.d.ts +0 -8
- package/dist/components/charts/xy/minimapLayout.d.ts +10 -0
- package/dist/components/realtime/BinAccumulator.d.ts +5 -2
- package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +4 -4
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +177 -1
- package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +3 -0
- package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +2 -0
- package/dist/components/recipes/atlas/resolution/BoundaryLoomChart.d.ts +3 -0
- package/dist/components/recipes/atlas/resolution/ComponentCutaway.d.ts +16 -0
- package/dist/components/recipes/atlas/resolution/ResolutionAtlasChart.d.ts +3 -0
- package/dist/components/recipes/atlas/resolution/ResolutionGlyphs.d.ts +15 -0
- package/dist/components/recipes/atlas/resolution/ResolutionReader.d.ts +5 -0
- package/dist/components/recipes/atlas/resolution/appearance.d.ts +58 -0
- package/dist/components/recipes/atlas/resolution/boundaryLoomLayout.d.ts +4 -0
- package/dist/components/recipes/atlas/resolution/chartProps.d.ts +75 -0
- package/dist/components/recipes/atlas/resolution/componentCutawayLayout.d.ts +12 -0
- package/dist/components/recipes/atlas/resolution/cutawayContext.d.ts +23 -0
- package/dist/components/recipes/atlas/resolution/cutawayGraph.d.ts +4 -0
- package/dist/components/recipes/atlas/resolution/cycles.d.ts +7 -0
- package/dist/components/recipes/atlas/resolution/evidence.d.ts +43 -0
- package/dist/components/recipes/atlas/resolution/glyphs.d.ts +40 -0
- package/dist/components/recipes/atlas/resolution/identity.d.ts +4 -0
- package/dist/components/recipes/atlas/resolution/indexGraph.d.ts +32 -0
- package/dist/components/recipes/atlas/resolution/ownership.d.ts +25 -0
- package/dist/components/recipes/atlas/resolution/plan.d.ts +12 -0
- package/dist/components/recipes/atlas/resolution/ports.d.ts +44 -0
- package/dist/components/recipes/atlas/resolution/prepare.d.ts +4 -0
- package/dist/components/recipes/atlas/resolution/project.d.ts +70 -0
- package/dist/components/recipes/atlas/resolution/queries.d.ts +23 -0
- package/dist/components/recipes/atlas/resolution/resolutionAtlasLayout.d.ts +9 -0
- package/dist/components/recipes/atlas/resolution/rules.d.ts +14 -0
- package/dist/components/recipes/atlas/resolution/scene.d.ts +52 -0
- package/dist/components/recipes/atlas/resolution/selection.d.ts +3 -0
- package/dist/components/recipes/atlas/resolution/sets.d.ts +10 -0
- package/dist/components/recipes/atlas/resolution/types.d.ts +401 -0
- package/dist/components/recipes/atlas/resolution/validate.d.ts +4 -0
- package/dist/components/recipes/atlas/resolution/witnesses.d.ts +18 -0
- package/dist/components/recipes/atlas/resolution/worker.d.ts +34 -0
- package/dist/components/recipes/lineageDag.d.ts +4 -0
- package/dist/components/recipes/recipeUtils.d.ts +2 -0
- package/dist/components/recipes/transitDiagram.d.ts +2 -61
- package/dist/components/recipes/transitDiagramTypes.d.ts +65 -0
- package/dist/components/semiotic-ai.d.ts +2 -0
- package/dist/components/semiotic-experimental-network-resolution-react.d.ts +12 -0
- package/dist/components/semiotic-experimental-network-resolution.d.ts +13 -0
- package/dist/components/semiotic-geo.d.ts +1 -1
- package/dist/components/semiotic-network-perspective-core.d.ts +6 -0
- package/dist/components/semiotic-network.d.ts +1 -1
- package/dist/components/semiotic-ordinal.d.ts +1 -1
- package/dist/components/semiotic-physics.d.ts +1 -1
- package/dist/components/semiotic-realtime-core.d.ts +1 -1
- package/dist/components/semiotic-realtime-react.d.ts +2 -0
- package/dist/components/semiotic-utils-core.d.ts +3 -1
- package/dist/components/semiotic-vite.d.ts +2 -0
- package/dist/components/semiotic-xy.d.ts +3 -1
- package/dist/components/semiotic.d.ts +3 -1
- package/dist/components/server/renderToStaticSVG.d.ts +2 -1
- package/dist/components/server/serverChartConfigShared.d.ts +2 -0
- package/dist/components/store/LinkedCrosshairStore.d.ts +43 -11
- package/dist/components/store/themeCore.d.ts +2 -0
- package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -1
- package/dist/components/stream/hoverUtils.d.ts +5 -0
- package/dist/components/stream/networkCustomLayout.d.ts +3 -0
- package/dist/components/stream/networkPerspective.d.ts +2 -0
- package/dist/components/stream/networkPerspectiveFit.d.ts +12 -1
- package/dist/components/stream/networkPerspectiveSolid.d.ts +1 -1
- package/dist/components/stream/networkSceneTypes.d.ts +4 -0
- package/dist/components/stream/networkTypes.d.ts +2 -0
- package/dist/components/stream/pipelineConfig.d.ts +2 -0
- package/dist/components/stream/pipelineDomainResolution.d.ts +4 -1
- package/dist/components/stream/types.d.ts +2 -0
- package/dist/components/stream/useFrame.d.ts +2 -0
- package/dist/components/stream/xySceneBuilders/types.d.ts +2 -0
- package/dist/controls.module.min.js +31 -31
- package/dist/geo.min.js +150 -150
- package/dist/geo.module.min.js +31 -31
- 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-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +2 -0
- package/dist/semiotic-ai.module.min.js +13 -13
- package/dist/semiotic-artifact-react.module.min.js +4 -4
- package/dist/semiotic-artifact.min.js +1 -1
- package/dist/semiotic-artifact.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-atlas.module.min.js +10 -12
- package/dist/semiotic-client-cjs-shared.min.js +1078 -925
- package/dist/semiotic-client-glyph.module.min.js +2 -2
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +8 -9
- package/dist/semiotic-experimental-network-resolution-react.d.ts +12 -0
- package/dist/semiotic-experimental-network-resolution-react.min.js +2 -0
- package/dist/semiotic-experimental-network-resolution-react.module.min.js +89 -0
- package/dist/semiotic-experimental-network-resolution.d.ts +13 -0
- package/dist/semiotic-experimental-network-resolution.min.js +2 -0
- package/dist/semiotic-experimental-network-resolution.module.min.js +2 -0
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +9 -10
- package/dist/semiotic-geo.d.ts +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-network-perspective-core.d.ts +6 -0
- package/dist/semiotic-network-perspective-core.min.js +1 -0
- package/dist/semiotic-network-perspective-core.module.min.js +1 -0
- package/dist/semiotic-network-perspective.module.min.js +1 -1
- package/dist/semiotic-network-placement.min.js +4 -0
- package/dist/semiotic-network-placement.module.min.js +4 -0
- package/dist/semiotic-network-zoom.module.min.js +1 -1
- package/dist/semiotic-network.d.ts +1 -1
- package/dist/semiotic-ordinal.d.ts +1 -1
- package/dist/semiotic-physics.d.ts +1 -1
- package/dist/semiotic-realtime-core.d.ts +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.d.ts +2 -0
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +101 -106
- package/dist/semiotic-recipes-core.module.min.js +75 -76
- package/dist/semiotic-server-edge-node.module.min.js +391 -392
- package/dist/semiotic-server-edge.min.js +387 -388
- package/dist/semiotic-server-edge.module.min.js +371 -371
- package/dist/semiotic-server-node.min.js +387 -388
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +3 -1
- package/dist/semiotic-utils-core.min.js +12 -11
- package/dist/semiotic-utils-core.module.min.js +12 -11
- package/dist/semiotic-value.module.min.js +4 -4
- package/dist/semiotic-vite.d.ts +2 -0
- package/dist/semiotic-vite.min.js +1 -0
- package/dist/semiotic-vite.module.min.js +1 -0
- package/dist/semiotic-xy.d.ts +3 -1
- package/dist/semiotic.d.ts +3 -1
- package/dist/semiotic.module.min.js +12 -12
- package/dist/server.min.js +387 -388
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +42 -13
- package/dist/c-2AB65V3L.min.js +0 -1
- package/dist/c-2U5JMOPN.min.js +0 -88
- package/dist/c-3DCTIRW4.min.js +0 -1
- package/dist/c-3OKFRTYM.min.js +0 -1
- package/dist/c-3VZHOPFW.min.js +0 -1
- package/dist/c-4ZSQIBC7.min.js +0 -1
- package/dist/c-5M4RUS7V.min.js +0 -34
- package/dist/c-6O5WWP7F.min.js +0 -1
- package/dist/c-73TOIYIW.min.js +0 -48
- package/dist/c-AE4M7BWH.min.js +0 -1
- package/dist/c-AEIK2NFW.min.js +0 -30
- package/dist/c-AFQSEIZ4.min.js +0 -4
- package/dist/c-BBX7DVVB.min.js +0 -51
- package/dist/c-CNYFCSG4.min.js +0 -5
- package/dist/c-E6QH2WYE.min.js +0 -1
- package/dist/c-GOMQWQJR.min.js +0 -1
- package/dist/c-GTYG4PDT.min.js +0 -1
- package/dist/c-H23GIKTK.min.js +0 -1
- package/dist/c-HQLUUSRJ.min.js +0 -1
- package/dist/c-HXUOFDSD.min.js +0 -64
- package/dist/c-L3LKYOLK.min.js +0 -1
- package/dist/c-MIKDFGKH.min.js +0 -1
- package/dist/c-OYSPTIAG.min.js +0 -1
- package/dist/c-PWPJNYQP.min.js +0 -1
- package/dist/c-QZ5SWKHC.min.js +0 -392
- package/dist/c-RXJH4IRX.min.js +0 -41
- package/dist/c-SN2D6QMH.min.js +0 -1
- package/dist/c-U5YGK6HL.min.js +0 -1
- package/dist/c-VIN5ASK2.min.js +0 -37
- package/dist/c-XZ3GASUJ.min.js +0 -1
- package/dist/c-ZLZZTH4I.min.js +0 -118
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){A(x),A(S),A(k)}function t(e){let{colorBy:t,colorScale:o,color:r,pointRadius:a=5,radiusFn:i,fillOpacity:n=1,fallbackFill:s,baseStyleExtras:l,stroke:c,strokeWidth:u,opacity:f,effectiveSelectionHook:m,resolvedSelection:p,colorDatumAccessor:y,selectionDatumAccessor:d,styleRules:h,ruleContext:g}=e,v=te(()=>e=>{let c="function"==typeof l?l(e):l,u=c?{...c}:{};if(void 0===u.fillOpacity&&(u.fillOpacity=n),void 0===u.fill)if(t){if(o){let r=y?y(e):e;u.fill=Z(r,t,o)}}else u.fill=s?s(e):r||K;return void 0===u.r&&(u.r=i?i(e):a),h&&h.length>0&&Object.assign(u,G(e,h,g?g(e):{value:void 0})),u},[t,o,r,a,i,n,s,l,y,h,g]),b=te(()=>B(v,{stroke:c,strokeWidth:u,opacity:f}),[v,c,u,f]);return te(()=>U(b,m??null,p,d),[b,m,p,d])}function o(e){let{lineWidth:t=2,colorBy:o,colorScale:r,color:a,resolveStroke:i,fillArea:n,areaOpacity:s=.3,styleRules:l,ruleContext:c}=e;return(e,u)=>{let f,m={strokeWidth:t},p=!0===n||Array.isArray(n)&&null!=u&&n.includes(u);return i?f=i(e,u):o?r&&(f=Z(e,o,r)):f=a||K,void 0!==f&&(m.stroke=f,p&&(m.fill=f,m.fillOpacity=s)),l?.length&&Object.assign(m,G(e,l,c?c(e,u):{value:void 0,category:u})),m}}function r(e){let{lineWidth:t=2,colorBy:r,colorScale:a,color:i,resolveStroke:n,fillArea:s,areaOpacity:l=.3,stroke:c,strokeWidth:u,opacity:f,effectiveSelectionHook:m,resolvedSelection:p,styleRules:y,ruleContext:d}=e,h=oe(()=>o({lineWidth:t,colorBy:r,colorScale:a,color:i,resolveStroke:n,fillArea:s,areaOpacity:l,styleRules:y,ruleContext:d}),[t,r,a,i,n,s,l,y,d]),g=oe(()=>B(h,{stroke:c,strokeWidth:u,opacity:f}),[h,c,u,f]);return oe(()=>U(g,m??null,p),[g,m,p])}async function a(){return ae||(ae=await(import("./c-DHNELGP4.min.js"))),ae}async function i(...e){return(await a()).buildForecast(...e)}async function n(...e){return(await a()).buildAnomalyAnnotations(...e)}async function s(...e){return(await a()).createSegmentLineStyle(...e)}function l(e){let{data:t,xAccessor:o,yAccessor:r,groupBy:a}=e,s=T(e.forecast),l=T(e.anomaly),c="string"==typeof o?o:ce,u="string"==typeof r?r:ue,f=ne(()=>{if(!s&&!l)return t;let e="function"==typeof o,a="function"==typeof r;return e||a?t.map(t=>{let i={...t};return e&&(i[ce]=o(t)),a&&(i[ue]=r(t)),i}):t},[t,s,l,o,r]),m=ne(()=>({overlayData:f,forecast:s,anomaly:l,xAccessorKey:c,yAccessorKey:u,groupBy:a}),[f,s,l,c,u,a]),[p,y]=se(null);ie(()=>{if(!s&&!l)return void y(null);let e=!1;return(s?i(f,c,u,a?{...s,_groupBy:a}:s,l):n(l).then(e=>({processedData:f,annotations:e}))).then(t=>{e||y({request:m,result:t,hasForecast:!!s})}).catch(t=>{e||("production"!==process.env.NODE_ENV&&console.warn("[Semiotic] Unable to compute statistical overlays:",t),y(null))}),()=>{e=!0}},[m,f,s,l,c,u,a]);let d=p?.request===m?p:null;return{effectiveData:d?.result.processedData??t,statisticalAnnotations:d?.result.annotations??le,hasForecast:d?.hasForecast??!1,xAccessorKey:c,yAccessorKey:u}}function c(e,t,o){if(!o)return;let r=[t,o.upperBounds??"__forecastUpper",o.lowerBounds??"__forecastLower"].map(e=>"function"==typeof e?e:t=>t[e]),a=!(!o.upperBounds&&!o.lowerBounds),i=1/0,n=-1/0;for(let t of e){let e=r[1](t),o=r[2](t);(null!=e||null!=o)&&(a=!0);for(let a of[Number(r[0](t)),e,o])"number"==typeof a&&Number.isFinite(a)&&(i=Math.min(i,a),n=Math.max(n,a))}return a&&i<=n?[i,n]:void 0}function u({lineData:e,strategy:t,lineDataAccessor:o,isGap:r,yField:a,seriesOfLine:i}){let n=e=>e[o]||[];if("interpolate"===t){let t=!1,a=[];for(let i of e){let e=n(i).filter(e=>!r(e)||(t=!0,!1));e.length>0&&a.push({...i,[o]:e})}return{lines:a,hasGaps:t}}if("zero"===t){let t=!1;return{lines:e.map(e=>({...e,[o]:n(e).map(e=>r(e)?(t=!0,{...e,[a]:0}):e)})),hasGaps:t}}if(!e.some(e=>n(e).some(r)))return{lines:e,hasGaps:!1};let s=[],l=/* @__PURE__ */new WeakMap,c=/* @__PURE__ */new Map;return e.forEach((e,t)=>{let a=i(e),u=[],f=0,m=()=>{if(0===u.length)return;let r={...e,[o]:u},i=`seg:${t}:${f}`;l.set(r,i),c.set(i,a),s.push(r),u=[],f++};for(let t of n(e))r(t)?m():u.push(t);m()}),{lines:s,hasGaps:!0,segments:{keyOf:l,seriesOf:c}}}function f(e,t){if(!t)return e;let o=new Set(e),r=[];for(let[e,a]of t.seriesOf)o.has(a)&&r.push(e);return r}function m(e,t){return t?(o,r)=>e(o,void 0===r?r:t.seriesOf.get(r)??r):e}function p(e,t){if(!t)return e;let o=e.tooltipContent,r=e=>{let r=e?.allSeries;return Array.isArray(r)?o({...e,allSeries:r.map(e=>({...e,group:t.seriesOf.get(e.group)??e.group}))}):o(e)};return{...e,tooltipContent:$(o)?X(r):r}}import{c as y}from"./c-CZI7G7G2.min.js";import{b as d,c as h}from"./c-XI6CLZII.min.js";import{a as g,f as v,g as b}from"./c-G5A3YWTN.min.js";import{a as A,i as x,k as S,l as k}from"./c-VLAAAFST.min.js";import{k as L}from"./c-BSLJZUTD.min.js";import{F as w,H as C,I as D,W as O,Y as B}from"./c-C5GXUHUO.min.js";import{Hb as H,Jb as R,Nb as G,Pa as _,Ra as F,Xa as j,Ya as N,_a as W,b as I,bb as M,ma as T,r as E,v as P}from"./c-XCV7VUU3.min.js";import{f as U}from"./c-2OZMC2MZ.min.js";import{n as K,r as Z}from"./c-ZOE7TAR3.min.js";import{p as X,q as $}from"./c-5FUOKMH6.min.js";import{d as q}from"./c-ODSUDNB4.min.js";import{useMemo as z,useCallback as V,useState as Y,useEffect as J,forwardRef as Q,useRef as ee}from"react";import{useMemo as te}from"react";import{useMemo as oe}from"react";var re="__forecastSegment",ae=null;import{useEffect as ie,useMemo as ne,useState as se}from"react";var le=[],ce="__semiotic_resolvedX",ue="__semiotic_resolvedY";import{jsx as fe}from"react/jsx-runtime";var me="__lineObjectSeries",pe=e=>e.parentLine||e,ye=/* @__PURE__ */j(/* @__PURE__ */Q(function(o,a){e();let i=ee(null);h(a,{variant:"xy",frameRef:i});let n=H(o.mode,{width:o.width,height:o.height,showAxes:o.showAxes,showGrid:o.showGrid,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,description:o.description,summary:o.summary,accessibleTable:o.accessibleTable,xLabel:o.xLabel,yLabel:o.yLabel,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),{data:A,margin:x,className:S,xFormat:k,yFormat:B,axisExtent:G,xAccessor:j="x",yAccessor:T="y",lineBy:U,lineDataAccessor:Z="coordinates",colorBy:X,colorScheme:$,styleRules:Q,curve:te="linear",showPoints:oe=!1,pointRadius:ae=3,fillArea:ie=!1,areaOpacity:ne=.3,lineWidth:se=2,lineGradient:le,tooltip:ce,pointIdAccessor:ue,annotations:ye,directLabel:de,gapStrategy:he="break",anomaly:ge,forecast:ve,band:be,xExtent:Ae,yExtent:xe,frameProps:Se={},selection:ke,linkedHover:Le,linkedBrush:we,brush:Ce,onBrush:De,onObservation:Oe,onClick:Be,hoverHighlight:He,hoverRadius:Re,chartId:Ge,loading:_e,loadingContent:Fe,emptyContent:je,legendInteraction:Ne,legendPosition:We,legend:Ie,xScaleType:Me,yScaleType:Te,color:Ee,stroke:Pe,strokeWidth:Ue,opacity:Ke}=o,{legend:Ze,...Xe}=Se,$e=z(()=>E(Ze,Ie),[Ze,Ie]),{width:qe,height:ze,enableHover:Ve,showGrid:Ye,showLegend:Je,title:Qe,description:et,summary:tt,accessibleTable:ot,xLabel:rt,yLabel:at}=n,it=z(()=>I(A),[A]),nt=Array.isArray(it[0]?.[Z])?it[0][Z]:it;M("LineChart",nt,"xAccessor",j),M("LineChart",nt,"yAccessor",T);let{effectiveData:st,statisticalAnnotations:lt,hasForecast:ct,xAccessorKey:ut,yAccessorKey:ft}=l({data:it,xAccessor:j,yAccessor:T,forecast:ve,anomaly:ge,groupBy:U}),mt=ct?ut:j,pt=ct?ft:T,yt="__compoundGroup",dt=!(!ve||!U),ht=dt?yt:ve?re:U,gt=z(()=>{if(!dt)return st;let e="function"==typeof U?U:e=>e[U];return st.map(t=>{let o={...t};return o[yt]=`${e(t)}__${t[re]||"observed"}`,o})},[st,dt,U]),vt=dt?gt:st,bt=X||U,At=z(()=>c(st,pt,ve),[ve,st,pt]),xt=V(e=>{let t="function"==typeof mt?mt(e):e[mt],o="function"==typeof pt?pt(e):e[pt];return null==t||null==o||Number.isNaN(t)||Number.isNaN(o)},[mt,pt]),St=void 0!==vt[0]?.[Z],kt=St?me:ht,Lt=z(()=>{if(St)return vt.map((e,t)=>{let o="function"==typeof U?U(e):"string"==typeof U?e[U]:void 0,r=null==o?`line-${t}`:String(o),a=Array.isArray(e[Z])?e[Z]:[];return{...e,[me]:r,[Z]:a.map(t=>({...t,[me]:r,parentLine:e,..."string"==typeof U&&void 0!==e[U]?{[U]:e[U]}:{}}))}});if(ht){let e=vt.reduce((e,t)=>{let o="function"==typeof ht?ht(t):t[ht];if(!e[o]){let r={[Z]:[]};"string"==typeof ht&&(r[ht]=o),dt&&(r[re]=t[re],"string"==typeof U&&(r[U]=t[U])),e[o]=r}return e[o][Z].push(t),e},{});return Object.values(e)}return[{[Z]:vt}]},[St,ht,Z,vt,U,dt]),{lines:wt,hasGaps:Ct,segments:Dt}=z(()=>u({lineData:Lt,strategy:he,lineDataAccessor:Z,isGap:xt,yField:"string"==typeof pt?pt:"y",seriesOfLine:e=>{if(!kt)return"";if("string"==typeof kt){let t=e[kt];return null==t?"":String(t)}let t=e[Z]?.[0],o=t?kt(t):void 0;return null==o?"":String(o)}}),[Lt,he,Z,xt,kt,pt]),Ot="object"==typeof de?de:{},Bt=Ot.position||"end",Ht=Ot.fontSize||11,Rt=(!de||void 0!==Je)&&Je,Gt=d({responsive:o,data:st,rawData:A,colorBy:bt,colorScheme:$,legendInteraction:Ne,legendPosition:We,frameLegend:Xe,selection:ke,linkedHover:Le,fallbackFields:bt?["string"==typeof bt?bt:""]:[],unwrapData:!1,onObservation:Oe,onClick:Be,hoverHighlight:He,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"LineChart",chartId:Ge,showLegend:Rt,legend:$e,userMargin:x,marginDefaults:n.marginDefaults,loading:_e,loadingContent:Fe,emptyContent:je,width:qe,height:ze,hasTitle:!!Qe,axisChrome:P(Se,{showAxes:n.showAxes,xLabel:rt,yLabel:at})}),_t=Gt.categoryColorScale,Ft=Gt.effectiveSelectionHook,jt=Gt.resolvedSelection,Nt=Gt.customHoverBehavior,Wt=Gt.customClickBehavior,It=Gt.crosshairProps,Mt=z(()=>{if(bt)return St?e=>{let t=e.parentLine||e;return"function"==typeof bt?bt(t):t[bt]}:bt},[bt,St]),Tt=z(()=>R(mt,pt),[mt,pt]),Et=r({lineWidth:se,colorBy:Mt,colorScale:_t,color:Ee,fillArea:ie,areaOpacity:ne,stroke:Pe,strokeWidth:Ue,opacity:Ke,effectiveSelectionHook:Ft,resolvedSelection:jt,styleRules:Q,ruleContext:Tt}),[Pt,Ut]=Y(null);J(()=>{if(!ve)return void Ut(null);let e=!1;return s(Et,ve).then(t=>{e||Ut(()=>t)}).catch(()=>{e||Ut(null)}),()=>{e=!0}},[Et,ve]);let Kt=Pt||Et,Zt=t({colorBy:bt,colorScale:_t,color:Ee,pointRadius:ae,colorDatumAccessor:pe,selectionDatumAccessor:q,effectiveSelectionHook:Ft,resolvedSelection:jt}),Xt=Array.isArray(ie)?"mixed":ie?"area":"line",$t=z(()=>{if(!de||!bt)return[];let e={position:Bt,fontSize:Ht,colorBy:bt,color:e=>_t?.(e)??K};return void 0===A?[{type:"text",_directLabelRequest:e}]:g(wt.flatMap(e=>(e[Z]||[]).map(t=>({...t,parentLine:t.parentLine||e}))),e,mt,pt)},[A,de,bt,_t,wt,Z,mt,pt,Bt,Ht]),qt=z(()=>{if(!de)return Gt.margin;let e="end"===Bt?"right":"left";if("number"==typeof x||"number"==typeof x?.[e])return Gt.margin;let t=(void 0===A?Gt.allCategories:$t.map(e=>String(e.label))).reduce((e,t)=>Math.max(e,Array.from(t).length*Ht*.65),0);return{...Gt.margin,[e]:Math.max(Gt.margin[e],t+10)}},[A,de,$t,Bt,Ht,x,Gt.margin,Gt.allCategories]),zt=U||X,Vt=z(()=>D([{label:rt||w(j),accessor:mt,role:"x",format:k},{label:at||w(T),accessor:pt,role:"y",format:B},...zt?[{label:w(zt),accessor:zt,role:"group"}]:[],...C(be,B)]),[mt,pt,j,T,rt,at,zt,k,B,be]),Yt=St?st[0]?.[Z]||[]:A,Jt=y({componentName:"LineChart",data:Yt,accessors:{xAccessor:j,yAccessor:T}}),{brushStreamProps:Qt}=b({brush:Ce,onBrush:De,linkedBrush:we,xAccessor:mt,yAccessor:pt,defaultDimension:"x"}),{flattenedData:eo,segmentGroupAccessor:to}=z(()=>{if(!(St||kt||Ct))return{flattenedData:vt,segmentGroupAccessor:void 0};let e=Dt?/* @__PURE__ */new WeakMap:void 0;return{flattenedData:wt.flatMap(t=>{let o=t[Z]||[],r=kt&&"string"==typeof kt?o.map(e=>({...e,[kt]:e[kt]??t[kt]})):o,a=Dt?.keyOf.get(t);if(e&&void 0!==a)for(let t of r)e.set(t,a);return r}),segmentGroupAccessor:e?t=>e.get(t)??"":void 0}},[wt,Z,St,kt,vt,Ct,Dt]),oo=z(()=>m(Kt,Dt),[Kt,Dt]),ro=L(le),ao={chartType:Xt,...Array.isArray(ie)&&{areaGroups:f(ie,Dt)},...ro&&{lineGradient:ro},...null!=A&&{data:eo},xAccessor:mt,yAccessor:pt,xScaleType:Me,yScaleType:Te,...Ae&&{xExtent:Ae},...!xe||null==xe[0]&&null==xe[1]?At?{yExtent:At}:{}:{yExtent:xe},groupAccessor:to??(kt||void 0),...be&&{band:be},curve:te,lineStyle:oo,...oe&&{pointStyle:Zt},size:[qe,ze],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,...void 0!==o.maxDevicePixelRatio&&{maxDevicePixelRatio:o.maxDevicePixelRatio},margin:qt,showAxes:n.showAxes,xLabel:rt,yLabel:at,xFormat:k,yFormat:B,...void 0!==G&&{axisExtent:G},...void 0!==o.autoPlaceAnnotations&&{autoPlaceAnnotations:o.autoPlaceAnnotations},enableHover:Ve,showGrid:Ye,...Gt.legendBehaviorProps,...Qe&&{title:Qe},...et&&{description:et},...tt&&{summary:tt},...void 0!==ot&&{accessibleTable:ot},...S&&{className:S},...null!=o.animate&&{animate:o.animate},...p(_({tooltip:ce,defaultTooltipContent:Vt,multiDefaultContent:F({xFormat:k,yFormat:B})}),Dt),...O({linkedHover:Le,selection:ke,onObservation:Oe,onClick:Be,hoverRadius:Re,hoverHighlight:He,mobileInteraction:Gt.mobileInteraction,customHoverBehavior:Nt,customClickBehavior:Wt}),...ue&&{pointIdAccessor:ue},...(ye?.length||lt.length||$t.length)&&{annotations:[...ye||[],...lt,...$t]},...It,...Qt,...Xe};return Gt.earlyReturn?Gt.earlyReturn:Jt?/* @__PURE__ */fe(N,{componentName:"LineChart",message:Jt,width:qe,height:ze}):/* @__PURE__ */fe(W,{componentName:"LineChart",width:qe,height:ze,children:/* @__PURE__ */fe(v,{ref:i,...ao})})}),"LineChart");export{t as a,l as b,e as c,r as d,ye as e};
|
package/dist/c-IU4QZ7Y5.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import{jsx as r}from"react/jsx-runtime";var t,n={isActive:!1,predicate:()=>!0};function u(){return t??(t=e.createContext(null)),t}function a({value:e,children:t}){let n=u();/*
|
|
1
|
+
import*as e from"react";import{jsx as r}from"react/jsx-runtime";var t,n={isActive:!1,predicate:()=>!0};function u(){return t??(t=e.createContext(null)),t}function a({value:e,children:t}){let n=u();/* */
|
|
2
2
|
return r(n.Provider,{value:e,children:t})}function i(){let r=u();return e.useContext(r)??n}function c(e,t){return null!=e?/* @__PURE__ */r(a,{value:t,children:e}):e}export{a,i as b,c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){let t=e?.config.transition;if(!t)return 0;let r="object"==typeof t?t.duration:void 0;return"number"==typeof r&&Number.isFinite(r)?Math.max(0,r):600}function t(){o(m)}import{a as r}from"./c-SBP7KEMI.min.js";import{h as n,i as a,j as i,r as l,t as o,v as s,w as u,x as f}from"./c-
|
|
1
|
+
function e(e){let t=e?.config.transition;if(!t)return 0;let r="object"==typeof t?t.duration:void 0;return"number"==typeof r&&Number.isFinite(r)?Math.max(0,r):600}function t(){o(m)}import{a as r}from"./c-SBP7KEMI.min.js";import{h as n,i as a,j as i,r as l,t as o,v as s,w as u,x as f}from"./c-Q5LZRQGD.min.js";var c=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,m={project:function(t,o,c,m,d){let p=t.internal,v=r(o.perspective),y=p;if(!p||p.key!==v){let r=n(o.perspective),i=d?0:e(r)||e(p?.resolved??null);y={key:v,resolved:r,tween:i>0&&(r||p?.resolved)?{from:t.frame??a,modes:r??p.resolved,toFlat:!r,start:null,duration:i,progress:0}:null},t.internal=y}let g=y.tween,h=g?g.modes:y.resolved;if(!h)return t.frame=null,t.underlay=[],t.edgeLift=0,t.projectParticle=void 0,t.internal=null,null;u(h.config)&&!s()&&f().then(()=>t.extrasReady(),()=>{});let j=l({...m,size:c,perspective:h,chartType:o.chartType,theme:o.themeSemantic}),w=g?.toFlat?a:j.frame,P=g?i(g.from,w,g.progress):w,x=j.emit(P);return t.frame=x.frame,t.underlay=x.underlay,t.edgeLift=x.edgeLift,t.projectParticle=x.projectParticle,x},advance:function(e,t,r){let n=e.internal,a=n?.tween;if(!n||!a)return!1;if(r)return n.tween=null,!0;null==a.start&&(a.start=t);let i=a.duration>0?Math.min(1,(t-a.start)/a.duration):1;return a.progress=c(i),i>=1&&(n.tween=null),!0}},d=m;export{d as default,t as registerNetworkPerspective};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r}from"./c-LIMFU6RD.min.js";export{r as networkPerspectiveExtras};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as e,l as t,m as l,n as o,o as r,p as n,q as a}from"./c-Q5LZRQGD.min.js";function i(e,t){if(!t)return e;let l=Math.min(1,Math.abs(t)),o=e.trim(),r=null,n=1,a=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.exec(o);if(a){let e=a[1].length<6?a[1].replace(/./g,"$&$&"):a[1];r=[0,2,4].map(t=>parseInt(e.slice(t,t+2),16)),8===e.length&&(n=parseInt(e.slice(6),16)/255)}else{let e=/^rgba?\(([^)]+)\)$/i.exec(o)?.[1].split(/[\s,/]+/).filter(Boolean).map(parseFloat);e&&e.length>=3&&!e.slice(0,3).some(isNaN)&&(r=e.slice(0,3),e.length>3&&!isNaN(e[3])&&(n=e[3]))}if(!r)return`color-mix(in srgb, ${o} ${Math.round(100*(1-l))}%, ${t<0?"black":"white"})`;let i=t<0?0:255,[p,s,h]=r.map(e=>Math.round(e+(i-e)*l));return n<1?`rgba(${p},${s},${h},${n})`:`rgb(${p},${s},${h})`}function p(e,t,r,n){let a=o(t),i=a.map(([t,l])=>e.project(t,l,n));return{up:i,down:a.map(([t,l])=>e.project(t,l,r)),faces:l(i,(n-r)*e.lift)}}function s(e,t){if(!e.length)return null;let l=[1/0,1/0,-1/0,-1/0];for(let[t,o,r,n]of e)l[0]=Math.min(l[0],t),l[1]=Math.min(l[1],o),l[2]=Math.max(l[2],r),l[3]=Math.max(l[3],n);return l.every(Number.isFinite)?[l[0]-t,l[1]-t,l[2]+t,l[3]+t]:null}var h=e=>Math.round(100*e)/100;function f(e,t,l,o){let r=0,n=1,a=t[0]-e[0],i=t[1]-e[1];for(let[t,p]of[[-a,e[0]],[a,l-e[0]],[-i,e[1]],[i,o-e[1]]]){if(0===t){if(p<0)return null;continue}let e=p/t;if(t<0){if(e>n)return null;e>r&&(r=e)}else{if(e<r)return null;e<n&&(n=e)}}return`M${h(e[0]+r*a)} ${h(e[1]+r*i)}L${h(e[0]+n*a)} ${h(e[1]+n*i)}`}var u={plan(e,l,u,c){let m=l.ground?.grid,g=l.ground?.plate;if(!m&&!g&&!l.regions?.length)return null;let d=n(l),b=/* @__PURE__ */new Map;for(let t of e)for(let e of r(t.node))b.has(e)||b.set(e,t);let M=[];for(let e of l.regions??[]){if(!e||"object"!=typeof e)continue;let t=[...new Set((e.nodes??[]).map(e=>b.get(String(e))).filter(Boolean))],l=null;if(e.nodes?.length)l=s(t.map(e=>e.box),e.padding??16);else if(e.bounds){let[[t,o],[r,n]]=e.bounds;l=[Math.min(t,r),Math.min(o,n),Math.max(t,r),Math.max(o,n)]}if(!l||!l.every(Number.isFinite))continue;let o=Number.isFinite(e.elevation)?Number(e.elevation):0,r=o+Math.max(0,Number.isFinite(e.depth)?Number(e.depth):d);M.push({region:e,box:l,base:o,top:r});for(let e of t)e.z+=r}let x=null;if(g&&e.length){let t="object"==typeof g?g:{},l=s([...e.map(e=>e.box),...M.map(e=>e.box)],t.padding??24);l&&(x={region:{id:"plate",fill:t.fill,stroke:t.stroke},box:l,base:-Math.max(0,Number.isFinite(t.depth)?Number(t.depth):d),top:0})}return{add(e){for(let t of x?[...M,x]:M)for(let[l,r]of o(t.box))e(l,r,t.top),e(l,r,t.base)},underlay(l){let o=[],r=[],n=(e,t,l)=>o.push({type:"curved",pathD:e,style:t,datum:null,interactive:!1,_perspectivePart:l});if(m){let t="object"==typeof m?m:{},o=Math.max(2,t.step??24),[r,a]=u,i="content"===t.extent,p=i?s(e.map(e=>e.box),o):s([[0,0],[r,0],[r,a],[0,a]].map(([e,t])=>{let[o,r]=l.unproject(e,t);return[o,r,o,r]}),0);if(p){let e=[],s=(t,l)=>{let o=i?`M${h(t[0])} ${h(t[1])}L${h(l[0])} ${h(l[1])}`:f(t,l,r,a);o&&e.push(o)};for(let e=Math.ceil(p[0]/o)*o,t=0;e<=p[2]&&t<400;e+=o,t++)s(l.project(e,p[1]),l.project(e,p[3]));for(let e=Math.ceil(p[1]/o)*o,t=0;e<=p[3]&&t<400;e+=o,t++)s(l.project(p[0],e),l.project(p[2],e));e.length&&n(e.join(""),{fill:"none",stroke:t.stroke??c.grid??"rgba(128,128,128,0.22)",strokeWidth:t.strokeWidth??1,opacity:t.opacity??.55},"ground-grid")}}let g=(e,o,r,a="region")=>{let s=null!=e.region.fill,h=e.region.fill??o,f=p(l,e.box,e.base,e.top);for(let e of f.faces)n(e.pathD,{fill:i(h,e.shade),fillOpacity:s?1:Math.min(1,2.2*r),stroke:"none"},`${a}-face`);let u=t(f.up);return n(u,{fill:h,fillOpacity:s?1:r,stroke:"none"},`${a}-top`),n(u,{fill:"none",stroke:e.region.stroke??(s?i(h,.25):o),strokeWidth:1,opacity:s?1:.6},`${a}-outline`),f.up};x&&g(x,c.textSecondary??"rgb(128,128,128)",.08,"plate");for(let e of[...M].sort((e,t)=>e.top-t.top)){let t=g(e,c.primary??"#4e79a7",.14);if(!e.region.label)continue;let l=0;for(let e=1;e<4;e++)t[e][1]+t[(e+1)%4][1]<t[l][1]+t[(l+1)%4][1]&&(l=e);let o=t[l],n=t[(l+1)%4],i=a(n[0]-o[0],n[1]-o[1]);Math.cos(i)*(n[0]-o[0])+Math.sin(i)*(n[1]-o[1])<0&&([o,n]=[n,o]);let p=Math.hypot(n[0]-o[0],n[1]-o[1])||1,s=(n[0]-o[0])/p,h=(n[1]-o[1])/p,f=(t[0][0]+t[2][0])/2,u=(t[0][1]+t[2][1])/2,m=-h*(f-o[0])+s*(u-o[1])<0?-1:1,d=-h*m,b=s*m,M=12,x=Math.sin(i)*d-Math.cos(i)*b<0?M+8:8;r.push({x:o[0]+12*s+d*x,y:o[1]+12*h+b*x,text:e.region.label,anchor:"start",baseline:"auto",fontSize:M,fontWeight:700,fill:e.region.labelColor??e.region.stroke??c.text,rotate:i})}return{edges:o,labels:r}}}},extrude(e,l){let o=e.node,r=p(l,e.box,e.z,e.z+e.h),n=t(r.up),a=[...r.up,...r.down],i=a.map(e=>e[0]),s=a.map(e=>e[1]),h=Math.min(...i),f=Math.min(...s),u=n+r.faces.map(e=>e.pathD).join("");return{...o,x:h,y:f,w:Math.max(.001,Math.max(...i)-h),h:Math.max(.001,Math.max(...s)-f),pathD:n,faces:r.faces.length?r.faces:void 0,_hitPath:{pathD:u,transform:[0,0,1,1],fill:!0,strokeWidth:0}}},sort(e,t){let l=e=>t.depth(e.gx,e.gy,e.z),o=(e,t)=>l(e)-l(t)||e.index-t.index;if(e.length>600)return[...e].sort(o);let r=t.matrix[1],n=t.matrix[3],a=e=>"extrude"===e.mode?e.box:[e.gx,e.gy,e.gx,e.gy],i=e.length,p=e.map(()=>[]),s=new Array(i).fill(0),h=(e,t)=>e>0?t?-1:1:e<0?t?1:-1:0;for(let t=0;t<i;t++)for(let l=t+1;l<i;l++){let i=a(e[t]),f=a(e[l]),u=i[2]<=f[0]+1e-6?h(r,!0):f[2]<=i[0]+1e-6?h(r,!1):i[3]<=f[1]+1e-6?h(n,!0):f[3]<=i[1]+1e-6?h(n,!1):0;u||(u=o(e[t],e[l])<=0?-1:1);let[c,m]=u<0?[t,l]:[l,t];p[c].push(m),s[m]++}let f=e.map((e,t)=>t).filter(e=>0===s[e]),u=[];for(;f.length;){f.sort((t,l)=>o(e[l],e[t]));let t=f.pop();u.push(e[t]);for(let e of p[t])0===--s[e]&&f.push(e)}return u.length===i?u:[...e].sort(o)},route(t,l,o){let{x1:r,y1:n,x2:a,y2:i,...p}=t,s=(r+a)/2,h=(n+i)/2,f=Math.abs(a-r)>=Math.abs(i-n)?[[r,n],[s,n],[s,i],[a,i]]:[[r,n],[r,h],[a,h],[a,i]],u=f.slice(1).reduce((e,t,l)=>e+Math.hypot(t[0]-f[l][0],t[1]-f[l][1]),0)||1,c=[{c:"M",p:[r,n]}],m=0,g=/* @__PURE__ */new Map([[`${r}|${n}`,0]]);for(let e=1;e<f.length;e++){let[t,o]=f[e-1],[r,n]=f[e];m+=Math.hypot(r-t,n-o),g.set(`${r}|${n}`,m/u);let a=f[e+1];if(!l||!a){c.push({c:"L",p:[r,n]});continue}let i=Math.hypot(r-t,n-o),p=Math.hypot(a[0]-r,a[1]-n),s=Math.min(10,i/2,p/2);if(s<.5){c.push({c:"L",p:[r,n]});continue}let h=r-(r-t)/i*s,d=n-(n-o)/i*s,b=r+(a[0]-r)/p*s,M=n+(a[1]-n)/p*s;c.push({c:"L",p:[h,d]},{c:"Q",p:[r,n,b,M]})}let d=(e,t)=>{let l=g.get(`${e}|${t}`);if(null!=l)return l;let o=0,r=1/0;for(let l of f){let n=Math.hypot(l[0]-e,l[1]-t);n<r&&(r=n,o=g.get(`${l[0]}|${l[1]}`)??0)}return o};return{...p,type:"curved",pathD:e(c,(e,t)=>o(e,t,d(e,t))),style:{...t.style,fill:"none"}}}};export{i as a,u as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as t}from"./c-YEB6Z35F.min.js";import{a as e,b as r,d as l}from"./c-RBWJFQDC.min.js";var i=Math.PI/180,a={isometric:{rotation:45,tilt:/* @__PURE__ */Math.asin(/* @__PURE__ */Math.tan(30*i))/i},pixel:{rotation:45,tilt:30},dimetric:{rotation:45,tilt:20},military:{rotation:45,tilt:90,verticalScale:1},cabinet:{rotation:45,tilt:90,verticalScale:1}},n=(t,e)=>"number"==typeof t&&Number.isFinite(t)?t:e,o=/* @__PURE__ */new Set;function s(t){if(!t)return null;let e="string"==typeof t?{type:t}:t,r=e.type??"isometric";if("flat"===r)return null;if(!Object.prototype.hasOwnProperty.call(a,r))return"production"!==process.env.NODE_ENV&&!o.has(String(r))&&(o.add(String(r)),console.warn(`[Semiotic] Unknown perspective "${String(r)}"; drawing flat. Use "isometric", "pixel", "dimetric", "military", "cabinet" or "flat".`)),null;let l,s,h=a[r],c=n(e.rotation,h.rotation)*i;if("cabinet"===r)l=[1,0,-.5*Math.cos(c),.5*Math.sin(c)],s=n(e.verticalScale,1);else{let t=Math.min(90,Math.max(1,n(e.tilt,h.tilt)))*i,r=Math.sin(t),a=Math.cos(c),o=Math.sin(c);l=[a,r*o,-o,r*a],s=n(e.verticalScale,null==e.tilt&&null!=h.verticalScale?h.verticalScale:Math.cos(t))}let u=e.origin;return{type:r,linear:l,verticalScale:Math.max(0,s),origin:[n(u?.[0],.5),n(u?.[1],.5)],fit:"none"===e.fit?"none":"contain",fitPadding:Math.max(0,n(e.fitPadding,12)),config:e}}var h=t=>Math.round(1e3*t)/1e3;function c(t,e,r,l=1,i=null){let[a,n,o,s,c,u]=e,p=a*s-n*o,f=(t,e,l=0)=>[a*t+o*e+c,n*t+s*e+u-r*l];return{type:t,matrix:e,lift:r,scale:l,bounds:i,project:f,unproject(t,e,l=0){let i=t-c,h=e+r*l-u;return Math.abs(p)<1e-12?[i,h]:[(s*i-o*h)/p,(a*h-n*i)/p]},depth:(t,e,r=0)=>n*t+s*e+u+.001*r,groundTransform:`matrix(${e.join(" ")})`,billboardTransform(t,e,r=0){let[l,i]=f(t,e,r);return`translate(${h(l)},${h(i)})`}}}var u=/* @__PURE__ */c("flat",[1,0,0,1,0,0],0);function p(t,e,r){if(r>=1)return e;if(r<=0)return t;let l=t.matrix.map((t,l)=>t+(e.matrix[l]-t)*r);return c(e.type,l,t.lift+(e.lift-t.lift)*r,t.scale+(e.scale-t.scale)*r,e.bounds)}var f=class{constructor(t){this.resolved=t,this.sx=[],this.sy=[],this.left=[],this.right=[],this.top=[],this.bottom=[]}add(t,e,r=0,l=0,i=l,a=l,n=a){let[o,s,h,c]=this.resolved.linear,u=o*t+h*e,p=s*t+c*e-this.resolved.verticalScale*r;!Number.isFinite(u)||!Number.isFinite(p)||(this.sx.push(u),this.sy.push(p),this.left.push(l),this.right.push(i),this.top.push(a),this.bottom.push(n))}get size(){return this.sx.length}};function d(t,e,r,l){let i=1/0,a=-1/0;for(let n=0;n<t.length;n++){let o=l*t[n];o-e[n]<i&&(i=o-e[n]),o+r[n]>a&&(a=o+r[n])}return[i,a]}function y(t,e,r){let[l,i]=e,[a,n,o,s]=t.linear,h=t.verticalScale;if("none"===t.fit||0===r.size){let e=t.origin[0]*l,u=t.origin[1]*i,p=c(t.type,[a,n,o,s,e-a*e-o*u,u-n*e-s*u],h);return 0===r.size?p:c(t.type,p.matrix,h,1,g(p,r,1))}let u=t.fitPadding,p=Math.max(1,l-2*u),f=Math.max(1,i-2*u),y=t=>{let[e,l]=d(r.sx,r.left,r.right,t),[i,a]=d(r.sy,r.top,r.bottom,t);return l-e<=p&&a-i<=f},m=1;if(!y(1)){let t=0,e=1;for(let r=0;r<32;r++){let r=(t+e)/2;y(r)?t=r:e=r}m=Math.max(t,.001)}let[x,b]=d(r.sx,r.left,r.right,m),[M,v]=d(r.sy,r.top,r.bottom,m),k=l/2-(x+b)/2,w=i/2-(M+v)/2;return c(t.type,[a*m,n*m,o*m,s*m,k,w],h*m,m,{x:x+k,y:M+w,width:b-x,height:v-M})}function g(t,e,r){let[l,i]=d(e.sx,e.left,e.right,r),[a,n]=d(e.sy,e.top,e.bottom,r);return{x:l+t.matrix[4],y:a+t.matrix[5],width:i-l,height:n-a}}function m(t,e,r=[]){let l=s(t);if(!l)return u;let i=new f(l);for(let t of r)i.add(t[0],t[1],t[2]??0);return y(l,e,i)}function x(t){if(!t||"object"!=typeof t)return null;let e=t.data;return e&&"object"==typeof e?e:t}function b(t,e){if(null==t)return NaN;if("number"==typeof t)return t;let r,l=x(e);if(!l)return NaN;"function"==typeof t?r=t(l):(r=l[t],null==r&&e&&"object"==typeof e&&(r=e[t]));let i="number"==typeof r?r:Number(r);return Number.isFinite(i)?i:NaN}var M=/[MmLlHhVvCcSsQqTtAaZz]/,v=/[MmLlHhVvCcSsQqTtAaZz]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/g,k={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function w(t,e,r,l,i,a,n,o,s){if(0===r||0===l||t===o&&e===s)return[[t,e,o,s,o,s]];r=Math.abs(r),l=Math.abs(l);let h=i*Math.PI/180,c=Math.cos(h),u=Math.sin(h),p=(t-o)/2,f=(e-s)/2,d=c*p+u*f,y=-u*p+c*f,g=d*d/(r*r)+y*y/(l*l);if(g>1){let t=Math.sqrt(g);r*=t,l*=t}let m=r*r*l*l-r*r*y*y-l*l*d*d,x=r*r*y*y+l*l*d*d,b=Math.sqrt(Math.max(0,m/x));a===n&&(b=-b);let M=b*r*y/l,v=-b*l*d/r,k=c*M-u*v+(t+o)/2,w=u*M+c*v+(e+s)/2,$=(t,e,r,l)=>Math.atan2(t*l-e*r,t*r+e*l),z=$(1,0,(d-M)/r,(y-v)/l),S=$((d-M)/r,(y-v)/l,(-d-M)/r,(-y-v)/l);!n&&S>0?S-=2*Math.PI:n&&S<0&&(S+=2*Math.PI);let N=Math.max(1,Math.ceil(Math.abs(S)/(Math.PI/2)-1e-9)),P=S/N,D=4/3*Math.tan(P/4),j=t=>[k+r*Math.cos(t)*c-l*Math.sin(t)*u,w+r*Math.cos(t)*u+l*Math.sin(t)*c],F=t=>[-r*Math.sin(t)*c-l*Math.cos(t)*u,-r*Math.sin(t)*u+l*Math.cos(t)*c],L=[],R=z;for(let t=0;t<N;t++){let e=R+P,[r,l]=j(R),[i,a]=t===N-1?[o,s]:j(e),[n,h]=F(R),[c,u]=F(e);L.push([r+D*n,l+D*h,i-D*c,a-D*u,i,a]),R=e}return L}function $(t){let e=t.match(v);if(!e)return[];let r=[],l=0,i="",a=0,n=0,o=0,s=0,h=null,c=null;for(;l<e.length;){if(M.test(e[l]))i=e[l++];else if(!i)return r;let t=i.toUpperCase(),u=i!==t,p=k[t];if("Z"===t){r.push({c:"Z",p:[]}),a=o,n=s,h=c=null,i="";continue}if(l+p>e.length)break;let f=e.slice(l,l+p).map(Number);if(l+=p,f.some(t=>!Number.isFinite(t)))break;let d=u?a:0,y=u?n:0,g=null,m=null;switch(t){case"M":a=f[0]+d,n=f[1]+y,o=a,s=n,r.push({c:"M",p:[a,n]}),i=u?"l":"L";break;case"L":a=f[0]+d,n=f[1]+y,r.push({c:"L",p:[a,n]});break;case"H":a=f[0]+d,r.push({c:"L",p:[a,n]});break;case"V":n=f[0]+(u?n:0),r.push({c:"L",p:[a,n]});break;case"C":{let t=[f[0]+d,f[1]+y,f[2]+d,f[3]+y,f[4]+d,f[5]+y];r.push({c:"C",p:t}),g=[t[2],t[3]],a=t[4],n=t[5];break}case"S":{let t=[h?2*a-h[0]:a,h?2*n-h[1]:n,f[0]+d,f[1]+y,f[2]+d,f[3]+y];r.push({c:"C",p:t}),g=[t[2],t[3]],a=t[4],n=t[5];break}case"Q":{let t=[f[0]+d,f[1]+y,f[2]+d,f[3]+y];r.push({c:"Q",p:t}),m=[t[0],t[1]],a=t[2],n=t[3];break}case"T":{let t=c?2*a-c[0]:a,e=c?2*n-c[1]:n,l=[t,e,f[0]+d,f[1]+y];r.push({c:"Q",p:l}),m=[t,e],a=l[2],n=l[3];break}case"A":{let t=f[5]+d,e=f[6]+y;for(let l of w(a,n,f[0],f[1],f[2],f[3],f[4],t,e))r.push({c:"C",p:l}),g=[l[2],l[3]];a=t,n=e;break}}h=g,c=m}return r}var z=t=>{let e=Math.round(100*t)/100;return Object.is(e,-0)?"0":String(e)};function S(t,e){let r="";for(let l of t){r+=l.c;for(let t=0;t<l.p.length;t+=2){let[i,a]=e?e(l.p[t],l.p[t+1]):[l.p[t],l.p[t+1]];r+=(t?" ":"")+z(i)+" "+z(a)}}return r}function N(t,e){for(let r of t)for(let t=0;t<r.p.length;t+=2)e(r.p[t],r.p[t+1])}function P(t){let e="";return t.forEach(([t,r],l)=>{e+=(l?"L":"M")+z(t)+" "+z(r)}),e+"Z"}function D(t,e=8){let r=[],l=0,i=0;for(let a of t){let t=a.p;if("M"===a.c){if(r.length)break;l=t[0],i=t[1],r.push([l,i])}else if("L"===a.c)l=t[0],i=t[1],r.push([l,i]);else if("Q"===a.c||"C"===a.c){for(let n=1;n<=e;n++){let o=n/e,s=1-o;r.push("Q"===a.c?[s*s*l+2*s*o*t[0]+o*o*t[2],s*s*i+2*s*o*t[1]+o*o*t[3]]:[s*s*s*l+3*s*s*o*t[0]+3*s*o*o*t[2]+o*o*o*t[4],s*s*s*i+3*s*s*o*t[1]+3*s*o*o*t[3]+o*o*o*t[5]])}l=t[t.length-2],i=t[t.length-1]}else if("Z"===a.c)break}let[a,n]=r[0]??[0,0],[o,s]=r[r.length-1]??[0,0];return r.length>1&&Math.abs(a-o)<1e-9&&Math.abs(n-s)<1e-9&&r.pop(),r}function j(t,e,r="faceted"){let l=t.length;if(l<3||!(e>.05))return[];let i=0;for(let e=0;e<l;e++){let[r,a]=t[e],[n,o]=t[(e+1)%l];i+=r*o-n*a}let a=i>=0?1:-1,n=t.map((e,i)=>{let n=t[(i+1)%l],o=n[0]-e[0],s=n[1]-e[1],h=Math.hypot(o,s);if(h<1e-9)return null;let c=a*s/h;return-a*o/h<=.02?null:"flat"===r?-.26:.04*Math.round(-6.5-4*c+1e-9)}),o=n.findIndex((t,e)=>t!==n[(e+l-1)%l]);o<0&&(o=0);let s=[],h=(r,i,a)=>{let n=[];for(let e of r)n.push(t[e]);n.push(t[(r[r.length-1]+1)%l]);let o=n.map(([t,r])=>[t,r+e]).reverse();s.push({pathD:P([...n,...o]),shade:i,depth:a??Math.round(n.reduce((t,e)=>t+e[1],0)/n.length*1e6)/1e6})},c=[],u=[],p=()=>{c.length&&h(c,n[c[0]]),c=[]},f=()=>{p();let t=new Set(u.map(t=>n[t]));t.size>1&&h(u,Math.min(...t),-1/0),u=[]};for(let t=0;t<l;t++){let e=(o+t)%l,r=n[e];null!=r?(c.length&&n[c[0]]!==r&&p(),c.push(e),u.push(e)):f()}return f(),s.sort((t,e)=>t.depth-e.depth).map(({pathD:t,shade:e})=>({pathD:t,shade:Math.round(100*e)/100}))}function F(t,e,r){let l=.5522847498*r;return[{c:"M",p:[t+r,e]},{c:"C",p:[t+r,e+l,t+l,e+r,t,e+r]},{c:"C",p:[t-l,e+r,t-r,e+l,t-r,e]},{c:"C",p:[t-r,e-l,t-l,e-r,t,e-r]},{c:"C",p:[t+l,e-r,t+r,e-l,t+r,e]},{c:"Z",p:[]}]}function L(t){let e=Math.min(t.startAngle,t.endAngle),r=Math.min(2*Math.PI-1e-6,Math.abs(t.endAngle-t.startAngle)),l=(e,r)=>`${t.cx+e*Math.cos(r)} ${t.cy+e*Math.sin(r)}`,i=r>Math.PI?1:0,a=e+r,n=t.innerR>0?`L${l(t.innerR,a)}A${t.innerR} ${t.innerR} 0 ${i} 0 ${l(t.innerR,e)}`:`L${t.cx} ${t.cy}`;return $(`M${l(t.outerR,e)}A${t.outerR} ${t.outerR} 0 ${i} 1 ${l(t.outerR,a)}${n}Z`)}function R(t){return[[t[0],t[1]],[t[2],t[1]],[t[2],t[3]],[t[0],t[3]]]}function C(t){let e=t.datum;return[t.id,e?.id,e?.data?.id].filter(t=>null!=t&&""!==t).map(String)}function _(t){if("rect"===t.type)return[t.x,t.y,t.x+t.w,t.y+t.h];let e="circle"===t.type?t.r:"arc"===t.type?t.outerR:"symbol"===t.type?r(t.size):t.size/2;return[t.cx-e,t.cy-e,t.cx+e,t.cy+e]}function A(t,e,r){if("arc"===t.type)return"ground";if("glyph"===t.type)return"billboard";if("symbol"===t.type)return"billboard"===e?"billboard":"token";if("circle"===t.type)return"billboard"===e||"ground"===e?e:e||"circlepack"!==r?"token":"ground";if(!e||"token"===e)return"ground";if("extrude"===e){let e=t.datum;if(e?.children?.length||e?.data?.children?.length)return"ground"}return e}function I(t){let e=t.thickness;return"number"==typeof e&&Number.isFinite(e)?Math.max(0,e):6}var T=/* @__PURE__ */new Set(["treemap","circlepack"]);function Z(t,e,r,l,i){let a=t.map(t=>i(t)?null==e?l:b(e,t.node.datum):NaN);if(null==e||"number"==typeof e)return a.map(t=>Number.isFinite(t)?t:0);let n=a.reduce((t,e)=>Number.isFinite(e)?Math.max(t,Math.abs(e)):t,0),o="number"==typeof r&&Number.isFinite(r)?r:n>0?48/n:0;return a.map(t=>Number.isFinite(t)?t*o:0)}function E(t,e){let r=Math.atan2(e,t);return r>Math.PI/2?r-Math.PI:r<=-Math.PI/2?r+Math.PI:r}function Q(t){let e=t.fontSize??11,r=String(t.text??"").length*e*.56,l="end"===t.anchor?r:"start"===t.anchor?0:r/2;return[l,r-l,.7*e,.7*e]}function O(t){if(null==t)return null;if("object"!=typeof t)return String(t);let e=t.id;return null==e?null:String(e)}function W(i){let{perspective:a,size:n,chartType:o,theme:s={}}=i,h=a.config,c=t(),u="feet"===h.anchor,p=h.glyph,d=I(h),g=i.sceneNodes.map((t,e)=>{let r=A(t,"function"==typeof h.marks?h.marks(t):h.marks,o);"extrude"===r&&!c&&(r="ground");let l=_(t),i="billboard"!==r&&"token"!==r||!p||"circle"!==t.type&&"symbol"!==t.type?void 0:("function"==typeof p?p(x(t.datum)??{}):p)??void 0;return i&&(r="billboard"),{node:t,mode:r,z:0,lift:0,h:0,t:0,gx:"rect"===t.type?t.x+t.w/2:t.cx,gy:"rect"===t.type?t.y+t.h/2:t.cy,box:l,index:e,glyph:i}}),m=Z(g,h.elevation,h.elevationScale,0,()=>!0),b=Z(g,h.extrude,h.extrudeScale,24,t=>"extrude"===t.mode),M=T.has(o??"");g.forEach((t,e)=>{t.z=t.lift=m[e],t.t="billboard"===t.mode?0:d,t.h="extrude"===t.mode?Math.max(d,b[e]):0,M&&"billboard"!==t.mode&&(t.z+=(t.node.depth??0)*d)});let v=c?.plan(g,h,n,s)??null,k=t=>t.z+("extrude"===t.mode?t.h:t.t),w=t=>h.glyphSize??Math.max(16,2.8*("circle"===t.node.type?t.node.r:r(t.node.size))),z=new f(a),W=(t,e,r,l,i,a,n)=>z.add(t,e,r,l,i,a,n),[V,q,H,U]=a.linear;for(let t of g){let{node:e,mode:r,z:i}=t,a=k(t);if("billboard"===r){if(t.glyph||"glyph"===e.type){let r=l(t.glyph??e.glyph,t.glyph?w(t):e.size);W(t.gx,t.gy,i,-r.offsetX,r.offsetX+r.width,-r.offsetY,r.offsetY+r.height)}else if("rect"===e.type)W(t.gx,t.gy,i,e.w/2,e.w/2,e.h/2,e.h/2);else{let e=(t.box[2]-t.box[0])/2;W(t.gx,t.gy,i,e,e,u?2*e:e,u?0:e)}t.lift>0&&W(t.gx,t.gy,i-t.lift)}else if("token"===r){let e=(t.box[2]-t.box[0])/2;W(t.gx,t.gy,a,e,e,e,e),W(t.gx,t.gy,i,e,e,e,e),t.lift>0&&W(t.gx,t.gy,i-t.lift)}else if("circle"===e.type)for(let t of[Math.atan2(H,V),Math.atan2(U,q)]){let r=e.r*Math.cos(t),l=e.r*Math.sin(t);for(let t of[i,a])W(e.cx+r,e.cy+l,t),W(e.cx-r,e.cy-l,t)}else if("arc"===e.type)for(let t=0;t<=12;t++){let r=e.startAngle+(e.endAngle-e.startAngle)*t/12;W(e.cx+e.outerR*Math.cos(r),e.cy+e.outerR*Math.sin(r),i),W(e.cx+e.outerR*Math.cos(r),e.cy+e.outerR*Math.sin(r),a)}else for(let[e,r]of R(t.box))W(e,r,i),W(e,r,a)}let Y=h.edges?.elevation??"surface",B=/* @__PURE__ */new Map,X=/* @__PURE__ */new Map,G=/* @__PURE__ */new Map;for(let t of g){let e=`${t.gx}|${t.gy}`;B.has(e)||B.set(e,t),G.set(e,t);for(let e of C(t.node))X.has(e)||X.set(e,t)}let J=(t,e,r)=>{let l=O(t),i=(null!=l?X.get(l):void 0)??(null!=e&&null!=r?G.get(`${e}|${r}`):void 0);return i?i.z-("nodes"===Y?0:i.lift):0},K=t=>{if("number"==typeof Y)return Number.isFinite(Y)?[Y,Y]:[0,0];if("ground"===Y||!B.size)return[0,0];let e=t.datum;return"line"===t.type?[J(e?.source,t.x1,t.y1),J(e?.target,t.x2,t.y2)]:[J(e?.source),J(e?.target)]},tt=/* @__PURE__ */new Map,et=[],rt=/* @__PURE__ */new Map,lt=([t,e],r)=>t+(e-t)*r;for(let t of i.sceneEdges){let[e,r]=K(t),l=[e,r];et.push(l);let i=(e+r)/2;if(rt.set(t.datum,"line"===t.type?l:[i,i]),"line"===t.type)for(let l of[0,d])W(t.x1,t.y1,e+l),W(t.x2,t.y2,r+l);else if(t.pathD){let l=$(t.pathD);tt.set(t,l),N(l,(t,l)=>{W(t,l,(e+r)/2),W(t,l,(e+r)/2+d)})}}v?.add(W);let it=g.filter(t=>"ground"===t.mode||"extrude"===t.mode),at=i.labels.map(t=>{let[e,r,l,i]=Q(t),a=t.anchorPoint;if(a){let n=B.get(`${a[0]}|${a[1]}`),o=t.x-a[0],s=t.y-a[1];return W(a[0],a[1],n?k(n):0,Math.max(0,e-o),Math.max(0,r+o),Math.max(0,l-s),Math.max(0,i+s)),{label:t,item:n,z:n?k(n):0,ox:o,oy:s}}let n=d,o=1/0;for(let e of it){let[r,l,i,a]=e.box,s=(i-r)*(a-l);t.x>=r&&t.x<=i&&t.y>=l&&t.y<=a&&s<o&&(o=s,n=k(e))}return W(t.x,t.y,n,e,r,l,i),{label:t,item:void 0,z:n,ox:0,oy:0}}),nt=(i.htmlMarks??[]).map(t=>{let e=t.x+t.width/2,r=t.y+t.height/2,l=X.get(t.id)??B.get(`${e}|${r}`),i=l?e-l.gx:0,a=l?r-l.gy:0;return W(l?.gx??e,l?.gy??r,l?k(l):d,Math.max(0,t.width/2-i),Math.max(0,t.width/2+i),Math.max(0,t.height/2-a),Math.max(0,t.height/2+a)),{mark:t,item:l}});for(let t of i.bounds??[]){if(!t||!Number.isFinite(t.x)||!Number.isFinite(t.y))continue;let e=(t,e)=>"top"===t?d:Number.isFinite(t)?Number(t):e;if("extent"in t){let[r,l,i,a]=t.extent;W(t.x,t.y,e(t.z,d),r,l,i,a)}else if(Number.isFinite(t.width)&&Number.isFinite(t.height)){let r=e(t.z,0);for(let[e,l]of R([t.x,t.y,t.x+t.width,t.y+t.height]))W(e,l,r)}}let ot=y(a,n,z);return{frame:ot,emit:(t=ot)=>{let r=t.project,[l,a,n,o]=t.matrix,p=[],f=[],y=/* @__PURE__ */new Map,m=/* @__PURE__ */new Map,x=Math.hypot(l,n)||1,b=(t,e)=>[(l*t+n*e)/x,(a*t+o*e)/x],M=(e,l,i)=>{let a=(t,e)=>r(t,e,l+i),n=D(e).map(([t,e])=>a(t,e)),o=j(n,i*t.lift),s=i*t.lift,h=n.map(t=>t[0]),c=n.map(t=>t[1]),u=Math.min(...h),p=Math.min(...c);return{pathD:S(e,a),faces:o.length?o:void 0,bounds:[u,p,Math.max(...h)-u,Math.max(...c)+s-p]}};for(let l of g){let i,{node:a,mode:n,z:o}=l;if("extrude"===n&&c)i=c.extrude(l,t);else if("billboard"===n){let[t,e]=r(l.gx,l.gy,o);if(l.glyph&&"rect"!==a.type&&"arc"!==a.type)i={type:"glyph",cx:t,cy:e,size:w(l),glyph:l.glyph,color:"string"==typeof a.style.fill?a.style.fill:void 0,style:a.style,datum:a.datum,accessibleDatum:a.accessibleDatum,accessibility:a.accessibility,id:a.id,label:a.label,depth:a.depth};else if("rect"===a.type)i={...a,x:t-a.w/2,y:e-a.h/2,_hitPath:void 0};else{let r=u&&"glyph"!==a.type?(l.box[2]-l.box[0])/2:0;i={...a,cx:t,cy:e-r}}}else if("token"!==n||"circle"!==a.type&&"symbol"!==a.type)if("rect"===a.type){let t=a._hitPath,e=M($(t?S($(t.pathD),(e,r)=>[t.transform[0]+e*t.transform[2],t.transform[1]+r*t.transform[3]]):P(R(l.box))),o,l.t),[r,n,s,h]=e.bounds,c=e.pathD+(e.faces??[]).map(t=>t.pathD).join("");i={...a,x:r,y:n,w:Math.max(.001,s),h:Math.max(.001,h),pathD:e.pathD,faces:e.faces,_hitPath:{pathD:c,transform:[0,0,1,1],fill:!0,strokeWidth:t?.strokeWidth??0}}}else{let[t,e]=r(l.gx,l.gy,o+l.t),n=M("circle"===a.type?F(a.cx,a.cy,a.r):L(a),o,l.t);i={...a,cx:t,cy:e,pathD:n.pathD,faces:n.faces}}else{let[n,s]=r(l.gx,l.gy,o+l.t),c="symbol"===a.type?a.rotation??0:0,u=Math.cos(c),p=Math.sin(c),f=(t,e)=>b(t*u-e*p,t*p+e*u),d="circle"===a.type?F(0,0,a.r):$(e(a.symbolType,a.size,a.path)),y=j(D(d,6).map(([t,e])=>{let[r,l]=f(t,e);return[n+r,s+l]}),l.t*t.lift,h.tokenRim);i="circle"===a.type?{...a,cx:n,cy:s,pathD:S(d,(t,e)=>{let[r,l]=f(t,e);return[n+r,s+l]}),faces:y.length?y:void 0,_perspectiveToken:!0}:{...a,cx:n,cy:s,rotation:0,path:S(d,f),faces:y.length?y:void 0,_perspectiveToken:!0}}y.set(l,i);let s="rect"===i.type?i.x+i.w/2:i.cx,d="rect"===i.type?i.y+i.h/2:i.cy;m.set(l,[s-l.gx,d-l.gy]),"ground"===n?p.push(i):f.push(l)}let z=!1===h.depthSort?f:f.some(t=>"extrude"===t.mode)&&c?c.sort(f,t):[...f].sort((e,r)=>t.depth(e.gx,e.gy,e.z)-t.depth(r.gx,r.gy,r.z)||e.index-r.index),N=p.concat(z.map(t=>y.get(t))),C=h.edges?.route,_=h.edgeShadow??!0,A=d>0&&!1!==_,I=[],T=/* @__PURE__ */new Map,Z=t=>"string"==typeof t?""!==t&&"none"!==t&&"transparent"!==t:null!=t,Q=(t,e)=>{if(!A||(t.style.opacity??1)<=0)return;let r=t.style,l="bezier"===t.type||"ribbon"===t.type,i=r.strokeWidth??(l?.5:1),a=r.fillOpacity??("curved"===t.type?.1:r.opacity??.5);if("line"!==t.type&&Z(r.fill)&&a>0)I.push(e);else if(Z(r.stroke||(l?void 0:"#999"))&&(r.opacity??1)*(r.strokeOpacity??1)>0&&i>0){let t=T.get(i)??[];t.push(e),T.set(i,t)}},O=i.sceneEdges.map((t,e)=>{let l=et[e],[i,a]=l;if("line"===t.type){if(C&&"layout"!==C&&c){let e="orthogonal-rounded"===C,i=t=>(e,i,a)=>r(e,i,lt(l,a)+t),a=c.route(t,e,i(d));return A&&Q(t,c.route(t,e,i(0)).pathD),{...a,_perspectivePart:"edge"}}let[e,n]=r(t.x1,t.y1,i+d),[o,s]=r(t.x2,t.y2,a+d);if(A){let[e,l]=r(t.x1,t.y1,i),[n,o]=r(t.x2,t.y2,a);Q(t,`M${e} ${l}L${n} ${o}`)}return{...t,x1:e,y1:n,x2:o,y2:s,_perspectivePart:"edge"}}let n=tt.get(t);if(!n)return t;let o=(i+a)/2;A&&Q(t,S(n,(t,e)=>r(t,e,o)));let s={...t,_perspectivePart:"edge",pathD:S(n,(t,e)=>r(t,e,o+d)),_cachedPath2D:void 0,_cachedPath2DSource:void 0};if("bezier"===s.type){s.bezierCache=void 0;let t=s._gradient;if(t){let[e,l]=r(t.x0,t.y0??0,o+d),[i,a]=r(t.x1,t.y1??0,o+d);s._gradient={...t,x0:e,y0:l,x1:i,y1:a}}}return s}),W="ground"===h.labels?.mode?"y"===h.labels.axis?E(n,o):E(l,a):void 0,V=at.map(({label:t,item:e,z:l,ox:i,oy:a})=>{let n,o;if(e){let r=m.get(e);n=t.x+r[0],o=t.y+r[1]}else if(t.anchorPoint){let[e,s]=r(t.anchorPoint[0],t.anchorPoint[1],l);n=e+i,o=s+a}else[n,o]=r(t.x,t.y,l);return null==W?{...t,x:n,y:o}:{...t,x:n,y:o,rotate:W}}),q=nt.map(({mark:t,item:e})=>{let l=e?.gx??t.x+t.width/2,i=e?.gy??t.y+t.height/2,a="billboard"===e?.mode?m.get(e):void 0;if(!a){let[t,n]=r(l,i,e?k(e):d);a=[t-l,n-i]}let[n,o]=a;return{...t,x:t.x+n,y:t.y+o}}),H=v?.underlay(t)??{edges:[],labels:[]},U=H.edges.slice(),Y=(t,e,r="edge-shadow")=>U.push({type:"curved",pathD:t,style:e,datum:null,interactive:!1,_perspectivePart:r}),B="object"==typeof _?_:{},X=B.color??"#000",G=B.opacity??.16;I.length&&Y(I.join(""),{fill:X,fillOpacity:.75*G,stroke:"none"});for(let[t,e]of T)Y(e.join(""),{fill:"none",stroke:X,strokeWidth:t+2,opacity:G,strokeLinecap:"round"});let J=h.elevationGuides??!0;if(J){let e="object"==typeof J?J:{},l=[],i=[];for(let a of g){if("billboard"!==a.mode&&"token"!==a.mode||a.lift<=0)continue;let n=y.get(a),o=a.z-a.lift,[s,h]=r(a.gx,a.gy,o),c=a.glyph?w(a)/3:(a.box[2]-a.box[0])/2;!1!==e.shadow&&l.push(S(F(a.gx,a.gy,c),(t,e)=>r(t,e,o)));let u="rect"===n.type?n.x+n.w/2:n.cx,p="rect"===n.type?n.y+n.h:n.cy+a.t*t.lift;Math.abs(p-h)>1&&i.push(`M${s} ${h}L${u} ${p}`)}l.length&&Y(l.join(""),{fill:X,fillOpacity:.14,stroke:"none"},"node-shadow"),i.length&&Y(i.join(""),{stroke:e.stroke??s.textSecondary??"rgba(128,128,128,0.8)",strokeWidth:1,strokeDasharray:e.strokeDasharray??"3 3",fill:"none"},"elevation-guide")}return{sceneNodes:N,sceneEdges:O,labels:H.labels.length?H.labels.concat(V):V,htmlMarks:q,underlay:U,frame:{...t,thickness:d},edgeLift:d,projectParticle:(t,e,l,i)=>{let a=rt.get(l),n=a?lt(a,i):0;return r(t,e,d+n)}}}}}function V(t){return W(t).emit()}export{s as a,u as b,p as c,m as d,S as e,P as f,j as g,R as h,C as i,I as j,E as k,W as l,V as m};
|
package/dist/c-M7QUZZCE.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,d as t}from"./c-AAIPWVQ5.min.js";import{a}from"./c-GU2FIJ7F.min.js";import{c as l,k as n,m as s}from"./c-K2Z4F22S.min.js";import*as r from"react";function o(e){return null==e||"object"!=typeof e||Array.isArray(e)?{}:e}function i(e){return null!=e&&"object"==typeof e?o(e).id:e}function g(e){let t=o(e.datum);return{source:i(t.source??e.source),target:i(t.target??e.target)}}function u(t,a){let n=/* @__PURE__ */new Map,s=[],r=!1,i=a.flatMap(e=>{let t=o(e?.datum).__chordEdges;return Array.isArray(t)?t.map(t=>({...e,datum:t,accessibleDatum:o(t).data??t})):[e]});for(let e=0;e<i.length;e++){let t=i[e];if(!t||"object"!=typeof t)continue;let a=o(t.datum),{source:u,target:d}=g(t),m="number"==typeof a.value&&Number.isFinite(a.value),c=m?a.value:0;r||(r=m);for(let[e,t,a]of[[u,1,3],[d,0,2]]){if(null==e||""===e)continue;let l=String(e),s=n.get(l)??[0,0,0,0];s[t]++,s[a]+=c,n.set(l,s)}let h=null!=u||null!=d?`${null==u?"?":String(u)} → ${null==d?"?":String(d)}`:`Edge ${e+1}`;s.push(l(t,h))}let u=[],d=0,m=0;for(let e=0;e<t.length;e++){let a=t[e];if(!a||"object"!=typeof a||null===a.datum)continue;let s=o(a.datum).id??a.id,r=null!=s?String(s):`node-${e}`,[i,g,c,h]=n.get(r)??[0,0,0,0],p=i+g;d+=p,p>m&&(m=p),u.push({id:r,degree:p,inDeg:i,outDeg:g,wDegree:c+h,wInDeg:c,wOutDeg:h,semantic:l(a,r)})}u.sort((e,t)=>t.degree-e.degree);let c=[`${u.length} nodes, ${s.length} edges.`];return u.length>0&&c.push(`Mean degree: ${e(d/u.length)}, max degree: ${m}.`),{nodeRows:u,edgeRows:s,hasWeights:r,summary:c.join(" ")}}import{Fragment as d,jsx as m,jsxs as c}from"react/jsx-runtime";function h({nodes:e,edges:l,sceneRevision:o,chartType:i,revealRows:g}){let[h,p]=r.useState(5),[b,f]=r.useState(5),y=r.useMemo(()=>u(e,l),[o??e,o??l]),{nodeRows:w,edgeRows:$,hasWeights:v,summary:j}=y,D=Math.min(h,w.length),A=w.slice(0,D),M=w.length-D,R=Math.min(b,$.length),S=$.slice(0,R),x=$.length-R,F=[{label:"degree",values:A.map(e=>e.degree)},{label:"in",values:A.map(e=>e.inDeg)},{label:"out",values:A.map(e=>e.outDeg)},...v?[{label:"w. degree",values:A.map(e=>e.wDegree)},{label:"w. in",values:A.map(e=>e.wInDeg)},{label:"w. out",values:A.map(e=>e.wOutDeg)}]:[]];/*
|
|
1
|
+
import{a as e,d as t}from"./c-AAIPWVQ5.min.js";import{a}from"./c-GU2FIJ7F.min.js";import{c as l,k as n,m as s}from"./c-K2Z4F22S.min.js";import*as r from"react";function o(e){return null==e||"object"!=typeof e||Array.isArray(e)?{}:e}function i(e){return null!=e&&"object"==typeof e?o(e).id:e}function g(e){let t=o(e.datum);return{source:i(t.source??e.source),target:i(t.target??e.target)}}function u(t,a){let n=/* @__PURE__ */new Map,s=[],r=!1,i=a.flatMap(e=>{let t=o(e?.datum).__chordEdges;return Array.isArray(t)?t.map(t=>({...e,datum:t,accessibleDatum:o(t).data??t})):[e]});for(let e=0;e<i.length;e++){let t=i[e];if(!t||"object"!=typeof t)continue;let a=o(t.datum),{source:u,target:d}=g(t),m="number"==typeof a.value&&Number.isFinite(a.value),c=m?a.value:0;r||(r=m);for(let[e,t,a]of[[u,1,3],[d,0,2]]){if(null==e||""===e)continue;let l=String(e),s=n.get(l)??[0,0,0,0];s[t]++,s[a]+=c,n.set(l,s)}let h=null!=u||null!=d?`${null==u?"?":String(u)} → ${null==d?"?":String(d)}`:`Edge ${e+1}`;s.push(l(t,h))}let u=[],d=0,m=0;for(let e=0;e<t.length;e++){let a=t[e];if(!a||"object"!=typeof a||null===a.datum)continue;let s=o(a.datum).id??a.id,r=null!=s?String(s):`node-${e}`,[i,g,c,h]=n.get(r)??[0,0,0,0],p=i+g;d+=p,p>m&&(m=p),u.push({id:r,degree:p,inDeg:i,outDeg:g,wDegree:c+h,wInDeg:c,wOutDeg:h,semantic:l(a,r)})}u.sort((e,t)=>t.degree-e.degree);let c=[`${u.length} nodes, ${s.length} edges.`];return u.length>0&&c.push(`Mean degree: ${e(d/u.length)}, max degree: ${m}.`),{nodeRows:u,edgeRows:s,hasWeights:r,summary:c.join(" ")}}import{Fragment as d,jsx as m,jsxs as c}from"react/jsx-runtime";function h({nodes:e,edges:l,sceneRevision:o,chartType:i,revealRows:g}){let[h,p]=r.useState(5),[b,f]=r.useState(5),y=r.useMemo(()=>u(e,l),[o??e,o??l]),{nodeRows:w,edgeRows:$,hasWeights:v,summary:j}=y,D=Math.min(h,w.length),A=w.slice(0,D),M=w.length-D,R=Math.min(b,$.length),S=$.slice(0,R),x=$.length-R,F=[{label:"degree",values:A.map(e=>e.degree)},{label:"in",values:A.map(e=>e.inDeg)},{label:"out",values:A.map(e=>e.outDeg)},...v?[{label:"w. degree",values:A.map(e=>e.wDegree)},{label:"w. in",values:A.map(e=>e.wInDeg)},{label:"w. out",values:A.map(e=>e.wOutDeg)}]:[]];/* */
|
|
2
2
|
return c(d,{children:[
|
|
3
3
|
/* @__PURE__ */m("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:n,children:j}),w.length>0&&/* @__PURE__ */m(t,{rows:A.map(e=>e.semantic),label:`Node data and degree summary for ${i}`,typeLabel:"node",labelRows:!0,extraColumns:F,caption:M>0?`Top ${D} of ${w.length} nodes by degree`:`All ${w.length} nodes by degree`}),
|
|
4
4
|
/* @__PURE__ */m(a,{remaining:M,onClick:e=>{g(e.currentTarget,D,Math.min(D+25,w.length),w.length,"nodes"),p(e=>e+25)},kind:"node"}),$.length>0&&/* @__PURE__ */m(t,{rows:S,label:`Edge data for ${i}`,typeLabel:"edge",labelRows:!0,className:"semiotic-accessible-data-table-table semiotic-accessible-data-table-edges",style:{...s,marginTop:12},caption:x>0?`First ${R} of ${$.length} edges`:`All ${$.length} edges`}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,n){return"touch"===n?Math.max(t,24):t}function n(t){return Array.isArray(t)?t[0]:t}function r(t,r,a,e){return{data:n(t),x:r,y:a,__semioticHoverData:!0,...e}}function a(t,n){if("number"!=typeof t?.binStart||"number"!=typeof t.binEnd)return n;let r=t.binStart+(t.binEnd-t.binStart)/2;return Number.isFinite(r)?n instanceof Date?new Date(r):r:n}export{t as a,n as b,r as c,a as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,e){let i=(e??t.currentTarget)?.getScreenCTM?.();if(!i)return null;let r=i.a*i.d-i.b*i.c;if(!Number.isFinite(r)||0===r)return null;let n=t.clientX-i.e,a=t.clientY-i.f;return{x:(i.d*n-i.c*a)/r,y:(i.a*a-i.b*n)/r}}function e({graphics:e,size:i,margin:r,scales:n,label:a="Chart controls"}){let s=y(null),l=v(e=>t({clientX:e.clientX,clientY:e.clientY,currentTarget:null},s.current),[]);if(null==e||!1===e)return null;let h="function"==typeof e?e({size:i,margin:r,scales:n,pointerToPlot:l}):e;return null==h||!1===h?null:/* @__PURE__ */k("svg",{className:"stream-frame-interactive-layer",role:"group","aria-label":a,width:i[0],height:i[1],overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:/* @__PURE__ */k("g",{ref:s,transform:`translate(${r.left},${r.top})`,children:h})})}function i(t){return t===1/0?1/0:Number.isFinite(t)?Math.max(0,Math.floor(t)):5e3}function r(t){return t===1/0?1/0:Number.isFinite(t)?Math.max(1,Math.floor(t)):5e3}function n(t,e,i,r){return"string"==typeof t?{key:t,fn:null}:"function"==typeof t?{key:i,fn:t}:"string"==typeof e?{key:e,fn:null}:"function"==typeof e?{key:r,fn:e}:{key:void 0,fn:null}}function a(t,e,i){return r=>{if(!r||!i||!t.fn&&!e.fn)return r;let n=!1,a=r.map(i=>{let r=t.fn&&t.key&&!(t.key in i),a=e.fn&&e.key&&!(e.key in i);if(!r&&!a)return i;n=!0;let s={...i};return r&&(s[t.key]=t.fn(i)),a&&(s[e.key]=e.fn(i)),s});return n?a:r}}function s(t,e){return t.__legendMarginReservedFor===e}function l(t,e){return{legendLayout:t.legendLayout,axisChrome:_({showAxes:t.showAxes,xLabel:t.xLabel,yLabel:t.yLabel,yLabelRight:t.yLabelRight,axes:t.axes}),legendMarginReserved:s(t,e)}}function h(t,e){return{legendLayout:t.legendLayout,axisChrome:m({showAxes:t.showAxes,projection:t.projection,hasCategoryLabel:!!(t.categoryLabel??t.oLabel),hasValueLabel:!!(t.valueLabel??t.rLabel)}),legendMarginReserved:s(t,e)}}function u(t){return new Set(Array.isArray(t)?t:[t])}function o(t){for(let e of t){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}if("point"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0);else if("glyph"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.size=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0);else if("rect"===e.type||"heatcell"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0);else if("candlestick"===e.type)void 0!==e._targetX&&(e.x=e._targetX,void 0!==e._targetOpenY&&(e.openY=e._targetOpenY),void 0!==e._targetCloseY&&(e.closeY=e._targetCloseY),void 0!==e._targetHighY&&(e.highY=e._targetHighY),void 0!==e._targetLowY&&(e.lowY=e._targetLowY),e._targetX=void 0,e._targetOpenY=void 0,e._targetCloseY=void 0,e._targetHighY=void 0,e._targetLowY=void 0);else if("line"===e.type||"area"===e.type){if(e._introClipFraction=void 0,"line"===e.type&&e._targetPath){for(let t=0;t<e.path.length;t++)e.path[t]=e._targetPath[t];e._prevPath=void 0,e._targetPath=void 0}if("area"===e.type){if(e._targetTopPath)for(let t=0;t<e.topPath.length;t++)e.topPath[t]=e._targetTopPath[t];if(e._targetBottomPath)for(let t=0;t<e.bottomPath.length;t++)e.bottomPath[t]=e._targetBottomPath[t];e._prevTopPath=void 0,e._prevBottomPath=void 0,e._targetTopPath=void 0,e._targetBottomPath=void 0}}}}function c(t){for(let e of t){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}"point"===e.type?void 0!==e._targetX?(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0):void 0!==e._targetR&&(e.r=e._targetR,e._targetR=void 0):"rect"===e.type?void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0):"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0)}}function g(t,e){let i=t.domain(),r=i[0],n=i[i.length-1],a=r instanceof Date,s=r instanceof Date?r.getTime():r,l=n instanceof Date?n.getTime():n;if(e<2||s===l)return a?[new Date(s),new Date(l)]:[s,l];let h=(l-s)/(e-1),u=new Array(e);for(let t=0;t<e;t++){let i=t===e-1?l:s+t*h;u[t]=a?new Date(i):i}return u}function d(t,e,i){return"exact"===i?g(t,e):t.ticks(e)}import{b as f,u as _,w as m}from"./c-
|
|
1
|
+
function t(t,e){let i=(e??t.currentTarget)?.getScreenCTM?.();if(!i)return null;let r=i.a*i.d-i.b*i.c;if(!Number.isFinite(r)||0===r)return null;let n=t.clientX-i.e,a=t.clientY-i.f;return{x:(i.d*n-i.c*a)/r,y:(i.a*a-i.b*n)/r}}function e({graphics:e,size:i,margin:r,scales:n,label:a="Chart controls"}){let s=y(null),l=v(e=>t({clientX:e.clientX,clientY:e.clientY,currentTarget:null},s.current),[]);if(null==e||!1===e)return null;let h="function"==typeof e?e({size:i,margin:r,scales:n,pointerToPlot:l}):e;return null==h||!1===h?null:/* @__PURE__ */k("svg",{className:"stream-frame-interactive-layer",role:"group","aria-label":a,width:i[0],height:i[1],overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:/* @__PURE__ */k("g",{ref:s,transform:`translate(${r.left},${r.top})`,children:h})})}function i(t){return t===1/0?1/0:Number.isFinite(t)?Math.max(0,Math.floor(t)):5e3}function r(t){return t===1/0?1/0:Number.isFinite(t)?Math.max(1,Math.floor(t)):5e3}function n(t,e,i,r){return"string"==typeof t?{key:t,fn:null}:"function"==typeof t?{key:i,fn:t}:"string"==typeof e?{key:e,fn:null}:"function"==typeof e?{key:r,fn:e}:{key:void 0,fn:null}}function a(t,e,i){return r=>{if(!r||!i||!t.fn&&!e.fn)return r;let n=!1,a=r.map(i=>{let r=t.fn&&t.key&&!(t.key in i),a=e.fn&&e.key&&!(e.key in i);if(!r&&!a)return i;n=!0;let s={...i};return r&&(s[t.key]=t.fn(i)),a&&(s[e.key]=e.fn(i)),s});return n?a:r}}function s(t,e){return t.__legendMarginReservedFor===e}function l(t,e){return{legendLayout:t.legendLayout,axisChrome:_({showAxes:t.showAxes,xLabel:t.xLabel,yLabel:t.yLabel,yLabelRight:t.yLabelRight,axes:t.axes}),legendMarginReserved:s(t,e)}}function h(t,e){return{legendLayout:t.legendLayout,axisChrome:m({showAxes:t.showAxes,projection:t.projection,hasCategoryLabel:!!(t.categoryLabel??t.oLabel),hasValueLabel:!!(t.valueLabel??t.rLabel)}),legendMarginReserved:s(t,e)}}function u(t){return new Set(Array.isArray(t)?t:[t])}function o(t){for(let e of t){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}if("point"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0);else if("glyph"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.size=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0);else if("rect"===e.type||"heatcell"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0);else if("candlestick"===e.type)void 0!==e._targetX&&(e.x=e._targetX,void 0!==e._targetOpenY&&(e.openY=e._targetOpenY),void 0!==e._targetCloseY&&(e.closeY=e._targetCloseY),void 0!==e._targetHighY&&(e.highY=e._targetHighY),void 0!==e._targetLowY&&(e.lowY=e._targetLowY),e._targetX=void 0,e._targetOpenY=void 0,e._targetCloseY=void 0,e._targetHighY=void 0,e._targetLowY=void 0);else if("line"===e.type||"area"===e.type){if(e._introClipFraction=void 0,"line"===e.type&&e._targetPath){for(let t=0;t<e.path.length;t++)e.path[t]=e._targetPath[t];e._prevPath=void 0,e._targetPath=void 0}if("area"===e.type){if(e._targetTopPath)for(let t=0;t<e.topPath.length;t++)e.topPath[t]=e._targetTopPath[t];if(e._targetBottomPath)for(let t=0;t<e.bottomPath.length;t++)e.bottomPath[t]=e._targetBottomPath[t];e._prevTopPath=void 0,e._prevBottomPath=void 0,e._targetTopPath=void 0,e._targetBottomPath=void 0}}}}function c(t){for(let e of t){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}"point"===e.type?void 0!==e._targetX?(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0):void 0!==e._targetR&&(e.r=e._targetR,e._targetR=void 0):"rect"===e.type?void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0):"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0)}}function g(t,e){let i=t.domain(),r=i[0],n=i[i.length-1],a=r instanceof Date,s=r instanceof Date?r.getTime():r,l=n instanceof Date?n.getTime():n;if(e<2||s===l)return a?[new Date(s),new Date(l)]:[s,l];let h=(l-s)/(e-1),u=new Array(e);for(let t=0;t<e;t++){let i=t===e-1?l:s+t*h;u[t]=a?new Date(i):i}return u}function d(t,e,i){return"exact"===i?g(t,e):t.ticks(e)}import{b as f,u as _,w as m}from"./c-XCV7VUU3.min.js";var p=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isFinite(t)&&(t<this._min&&(this._min=t),t>this._max&&(this._max=t))}evict(t){(t===this._min||t===this._max)&&(this._dirty=!0)}recalculate(t,e){this._min=1/0,this._max=-1/0;for(let i of t){let t=e?e(i):i;Number.isFinite(t)&&(t<this._min&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}};import{useCallback as v,useRef as y}from"react";import{jsx as k}from"react/jsx-runtime";var b=class{constructor(t,e){this.lastBoundedData=null,this.chunkTimer=null,this.pushBuffer=[],this.flushScheduled=!1,this.callback=t,this.chunkThreshold=i(e?.chunkThreshold),this.chunkSize=r(e?.chunkSize)}updateChunkOptions(t){this.chunkThreshold=i(t.chunkThreshold),this.chunkSize=r(t.chunkSize)}clearLastData(){this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1,null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null)}setBoundedData(t){if(t=f(t),this.lastBoundedData===t)return;if(this.lastBoundedData=t,null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null),t.length<=this.chunkThreshold)return void this.callback({inserts:t,bounded:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,totalSize:t.length});let e=this.chunkSize,i=()=>{if(e>=t.length)return void(this.chunkTimer=null);if(t!==this.lastBoundedData)return void(this.chunkTimer=null);let r=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,r),bounded:!1}),e=r,e<t.length?this.chunkTimer=requestAnimationFrame(i):this.chunkTimer=null};e<t.length?this.chunkTimer=requestAnimationFrame(i):this.chunkTimer=null}setReplacementData(t){if(t=f(t),this.lastBoundedData=t,null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null),this.pushBuffer=[],this.flushScheduled=!1,t.length<=this.chunkThreshold)return void this.callback({inserts:t,bounded:!0,preserveCategoryOrder:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,preserveCategoryOrder:!0,totalSize:t.length});let e=this.chunkSize,i=()=>{if(e>=t.length)return void(this.chunkTimer=null);if(t!==this.lastBoundedData)return void(this.chunkTimer=null);let r=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,r),bounded:!1}),e=r,e<t.length?this.chunkTimer=requestAnimationFrame(i):this.chunkTimer=null};e<t.length?this.chunkTimer=requestAnimationFrame(i):this.chunkTimer=null}flushPushBuffer(){if(this.flushScheduled=!1,0===this.pushBuffer.length)return;let t=this.pushBuffer;this.pushBuffer=[],this.callback({inserts:t,bounded:!1})}scheduleFlush(){this.flushScheduled||(this.flushScheduled=!0,queueMicrotask(()=>this.flushPushBuffer()))}push(t){null==t||"object"!=typeof t||(this.pushBuffer.push(t),this.scheduleFlush())}pushMany(t){if(0===t.length)return;let e=0;for(let i=0;i<t.length;i++){let r=t[i];null==r||"object"!=typeof r||(this.pushBuffer.push(r),e++)}0!==e&&this.scheduleFlush()}flush(){this.flushPushBuffer()}clear(){null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null),this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1}};export{t as a,e as b,b as c,p as d,u as e,o as f,c as g,d as h,n as i,a as j,l as k,h as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./c-IGONIKZL.min.js";export{i as registerBuiltInXYPlugins};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function e(e,t,n={}){let{execution:r="auto",signal:o,workerThreshold:u,nodeRadius:l,...d}=n,p=d.iterations??260;if(!a()||!s(r,e.length,t.length,p,u))return i(e,t,{...d,nodeRadius:l});let c={kind:"normalized",nodes:e.map(e=>({...e})),edges:t.map(e=>({...e})),options:d,nodeRadii:"function"==typeof l?Object.fromEntries(e.map(e=>[e.id,l(e)])):null==l?void 0:Object.fromEntries(e.map(e=>[e.id,l]))};try{let{runForceLayoutWorker:e}=await(import("./c-VW3UFK54.min.js"));return(await e(c,o)).positions}catch(n){if("AbortError"===n?.name)throw n;return i(e,t,{...d,nodeRadius:l})}}function t(e){let t=[];for(let n of Object.keys(e).sort()){let r=e[n];if(void 0!==r){if("function"==typeof r)return null;t.push(`${n}:${String(r)}`)}}return t.join("|")}function n(e,t,n){return null==n?null:f.get(e)?.get(t)?.get(n)??null}function r(e,t,n,r){if(null==n)return;let o=f.get(e);o||(o=/* @__PURE__ */new WeakMap,f.set(e,o));let i=o.get(t);if(i||(i=/* @__PURE__ */new Map,o.set(t,i)),!i.has(n)&&i.size>=16){let e=i.keys().next().value;void 0!==e&&i.delete(e)}i.set(n,r)}function o(o,s,a={}){let f=u(),{seed:m,iterations:g,repulsion:h,linkDistance:k,linkStrength:y,centerStrength:w,damping:R,nodeRadius:b,nodePadding:j,inset:v,execution:S,workerThreshold:x}=a,E=d(()=>({seed:m,iterations:g,repulsion:h,linkDistance:k,linkStrength:y,centerStrength:w,damping:R,nodeRadius:b,nodePadding:j,inset:v,execution:S,workerThreshold:x}),[m,g,h,k,y,w,R,b,j,v,S,x]),M=p(f),[A,T]=c(()=>{if(typeof window>"u"||f){let e=i(o,s,E);return r(o,s,t(E),e),{positions:e,status:"ready",error:null}}let e=n(o,s,t(E));return e?{positions:e,status:"ready",error:null}:{positions:null,status:"pending",error:null}});return l(()=>{if(M.current)return void(M.current=!1);let i=t(E),a=n(o,s,i);if(a)return void T(e=>"ready"===e.status&&e.positions===a?e:{positions:a,status:"ready",error:null});let u=new AbortController;return T(e=>({positions:e.positions,status:"pending",error:null})),e(o,s,{...E,signal:u.signal}).then(e=>{r(o,s,i,e),T({positions:e,status:"ready",error:null})}).catch(e=>{"AbortError"!==e.name&&T(t=>({positions:t.positions,status:"error",error:e}))}),()=>u.abort()},[o,s,E]),A}import{q as i}from"./c-TRMNDRC4.min.js";import{b as s,c as a}from"./c-NIYSAQGB.min.js";import{ka as u}from"./c-XCV7VUU3.min.js";import{useEffect as l,useMemo as d,useRef as p,useState as c}from"react";var f=/* @__PURE__ */new WeakMap;export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e({isPushMode:e,colorBy:m,colorScheme:y,showLegend:h,legendPosition:p="right",trackCategoryDomain:b=!0,registerLinkedCategories:C=!0}){let[S,A]=c(0),w=t(null!=y),v=r(),P=a(),j=e&&!!m&&(b||P),M="function"==typeof m?f:m,k=u(()=>({lifecycle:{colorByDomainKey:M,isPushMode:e,shouldTrackCategoryDomain:j},categories:/* @__PURE__ */new Set,ordered:[]}),[M,e,j]),D=d(e=>{if(!m)return null;let r="function"==typeof m?m(e):e[m];return String(r)},[m]),B=d(e=>{if(!j)return;let r=!1;for(let t of e){if(!t||"object"!=typeof t)continue;let e=D(t);null!=e&&!k.categories.has(e)&&(k.categories.add(e),k.ordered.push(e),r=!0)}r&&A(e=>e+1)},[k,D,j]),L=d(e=>{if(!j)return;let r=Array.from(new Set(e.map(String))),t=k.ordered;t.length===r.length&&t.every((e,t)=>e===r[t])||(k.categories=new Set(r),k.ordered=r,A(e=>e+1))},[k,j]),T=d(e=>r=>{B([r]),e(r)},[B]),U=d(e=>r=>{B(r),e(r)},[B]),V=d(()=>{k.categories=/* @__PURE__ */new Set,k.ordered=[],A(e=>e+1)},[k]),_=u(()=>j?[...k.ordered]:[],[k,j,S]);o(C&&e&&m?_:[]);let x=u(()=>{if(!e||!m||!1===h)return;let r=k.ordered;if(0===r.length)return;let t=Array.isArray(y)&&y.length>0||"string"==typeof y&&y.length>0?y:v&&v.length>0?v:i,o="string"==typeof m?m:"__streamCat",a=r.map(e=>({[o]:e})),c=g(a,o,t),d=y&&"object"==typeof y&&!Array.isArray(y)?y:void 0;return n({data:a,colorBy:o,colorScale:e=>(w?l(w,e):void 0)??(d?l(d,e):void 0)??c(e)??"#999",getColor:s})},[e,m,h,y,w,v,S,k]),E=u(()=>{if(x)return"right"===p?{right:110}:"left"===p?{left:110}:"top"===p?{top:50}:"bottom"===p?{bottom:80}:{right:110}},[x,p]);return{wrapPush:T,wrapPushMany:U,resetCategories:V,categories:_,categoryDomainProps:j?{legendCategoryAccessor:m,onCategoriesChange:L}:{},streamingLegend:x,streamingMarginAdjust:E}}import{Ab as r,cb as t,sb as o,tb as a,vb as n}from"./c-XCV7VUU3.min.js";import{p as i,r as s,s as l,t as g}from"./c-ZOE7TAR3.min.js";import{useState as c,useCallback as d,useMemo as u}from"react";var f=/* @__PURE__ */Symbol("streaming-function-color-domain");export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){let t=e?.config.transition;if(!t)return 0;let r="object"==typeof t?t.duration:void 0;return"number"==typeof r&&Number.isFinite(r)?Math.max(0,r):600}function t(){o(c)}import{a as r,b as n,c as a,l as i}from"./c-
|
|
1
|
+
function e(e){let t=e?.config.transition;if(!t)return 0;let r="object"==typeof t?t.duration:void 0;return"number"==typeof r&&Number.isFinite(r)?Math.max(0,r):600}function t(){o(c)}import{a as r,b as n,c as a,l as i}from"./c-M4T43G76.min.js";import{a as l}from"./c-SBP7KEMI.min.js";import{a as o,d as s,e as u,f}from"./c-YEB6Z35F.min.js";var m=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,c={project:function(t,o,m,c,d){let p=t.internal,v=l(o.perspective),y=p;if(!p||p.key!==v){let a=r(o.perspective),i=d?0:e(a)||e(p?.resolved??null);y={key:v,resolved:a,tween:i>0&&(a||p?.resolved)?{from:t.frame??n,modes:a??p.resolved,toFlat:!a,start:null,duration:i,progress:0}:null},t.internal=y}let g=y.tween,j=g?g.modes:y.resolved;if(!j)return t.frame=null,t.underlay=[],t.edgeLift=0,t.projectParticle=void 0,t.internal=null,null;u(j.config)&&!s()&&f().then(()=>t.extrasReady(),()=>{});let h=i({...c,size:m,perspective:j,chartType:o.chartType,theme:o.themeSemantic}),b=g?.toFlat?n:h.frame,w=g?a(g.from,b,g.progress):b,F=h.emit(w);return t.frame=F.frame,t.underlay=F.underlay,t.edgeLift=F.edgeLift,t.projectParticle=F.projectParticle,F},advance:function(e,t,r){let n=e.internal,a=n?.tween;if(!n||!a)return!1;if(r)return n.tween=null,!0;null==a.start&&(a.start=t);let i=a.duration>0?Math.min(1,(t-a.start)/a.duration):1;return a.progress=m(i),i>=1&&(n.tween=null),!0}},d=c;export{t as a,d as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Math.PI/180,e={isometric:{rotation:45,tilt:/* @__PURE__ */Math.asin(/* @__PURE__ */Math.tan(30*t))/t},pixel:{rotation:45,tilt:30},dimetric:{rotation:45,tilt:20},military:{rotation:45,tilt:90,verticalScale:1},cabinet:{rotation:45,tilt:90,verticalScale:1}},r=(t,e)=>"number"==typeof t&&Number.isFinite(t)?t:e,i=/* @__PURE__ */new Set;function l(l){if(!l)return null;let n="string"==typeof l?{type:l}:l,a=n.type??"isometric";if("flat"===a)return null;if(!Object.prototype.hasOwnProperty.call(e,a))return"production"!==process.env.NODE_ENV&&!i.has(String(a))&&(i.add(String(a)),console.warn(`[Semiotic] Unknown perspective "${String(a)}"; drawing flat. Use "isometric", "pixel", "dimetric", "military", "cabinet" or "flat".`)),null;let o,s,h=e[a],c=r(n.rotation,h.rotation)*t;if("cabinet"===a)o=[1,0,-.5*Math.cos(c),.5*Math.sin(c)],s=r(n.verticalScale,1);else{let e=Math.min(90,Math.max(1,r(n.tilt,h.tilt)))*t,i=Math.sin(e),l=Math.cos(c),a=Math.sin(c);o=[l,i*a,-a,i*l],s=r(n.verticalScale,null==n.tilt&&null!=h.verticalScale?h.verticalScale:Math.cos(e))}let u=n.origin;return{type:a,linear:o,verticalScale:Math.max(0,s),origin:[r(u?.[0],.5),r(u?.[1],.5)],fit:"none"===n.fit?"none":"contain",fitPadding:Math.max(0,r(n.fitPadding,12)),config:n}}var n=t=>Math.round(1e3*t)/1e3;function a(t,e,r,i=1,l=null){let[a,o,s,h,c,u]=e,f=a*h-o*s,p=(t,e,i=0)=>[a*t+s*e+c,o*t+h*e+u-r*i];return{type:t,matrix:e,lift:r,scale:i,bounds:l,project:p,unproject(t,e,i=0){let l=t-c,n=e+r*i-u;return Math.abs(f)<1e-12?[l,n]:[(h*l-s*n)/f,(a*n-o*l)/f]},depth:(t,e,r=0)=>o*t+h*e+u+.001*r,groundTransform:`matrix(${e.join(" ")})`,billboardTransform(t,e,r=0){let[i,l]=p(t,e,r);return`translate(${n(i)},${n(l)})`}}}var o=/* @__PURE__ */a("flat",[1,0,0,1,0,0],0);function s(t,e,r){if(r>=1)return e;if(r<=0)return t;let i=t.matrix.map((t,i)=>t+(e.matrix[i]-t)*r);return a(e.type,i,t.lift+(e.lift-t.lift)*r,t.scale+(e.scale-t.scale)*r,e.bounds)}var h=/[MmLlHhVvCcSsQqTtAaZz]/,c=/[MmLlHhVvCcSsQqTtAaZz]|[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/g,u={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function f(t,e,r,i,l,n,a,o,s){if(0===r||0===i||t===o&&e===s)return[[t,e,o,s,o,s]];r=Math.abs(r),i=Math.abs(i);let h=l*Math.PI/180,c=Math.cos(h),u=Math.sin(h),f=(t-o)/2,p=(e-s)/2,d=c*f+u*p,y=-u*f+c*p,g=d*d/(r*r)+y*y/(i*i);if(g>1){let t=Math.sqrt(g);r*=t,i*=t}let m=r*r*i*i-r*r*y*y-i*i*d*d,x=r*r*y*y+i*i*d*d,b=Math.sqrt(Math.max(0,m/x));n===a&&(b=-b);let M=b*r*y/i,v=-b*i*d/r,w=c*M-u*v+(t+o)/2,k=u*M+c*v+(e+s)/2,$=(t,e,r,i)=>Math.atan2(t*i-e*r,t*r+e*i),S=$(1,0,(d-M)/r,(y-v)/i),z=$((d-M)/r,(y-v)/i,(-d-M)/r,(-y-v)/i);!a&&z>0?z-=2*Math.PI:a&&z<0&&(z+=2*Math.PI);let P=Math.max(1,Math.ceil(Math.abs(z)/(Math.PI/2)-1e-9)),N=z/P,D=4/3*Math.tan(N/4),j=t=>[w+r*Math.cos(t)*c-i*Math.sin(t)*u,k+r*Math.cos(t)*u+i*Math.sin(t)*c],F=t=>[-r*Math.sin(t)*c-i*Math.cos(t)*u,-r*Math.sin(t)*u+i*Math.cos(t)*c],L=[],C=S;for(let t=0;t<P;t++){let e=C+N,[r,i]=j(C),[l,n]=t===P-1?[o,s]:j(e),[a,h]=F(C),[c,u]=F(e);L.push([r+D*a,i+D*h,l-D*c,n-D*u,l,n]),C=e}return L}function p(t){let e=t.match(c);if(!e)return[];let r=[],i=0,l="",n=0,a=0,o=0,s=0,p=null,d=null;for(;i<e.length;){if(h.test(e[i]))l=e[i++];else if(!l)return r;let t=l.toUpperCase(),c=l!==t,y=u[t];if("Z"===t){r.push({c:"Z",p:[]}),n=o,a=s,p=d=null,l="";continue}if(i+y>e.length)break;let g=e.slice(i,i+y).map(Number);if(i+=y,g.some(t=>!Number.isFinite(t)))break;let m=c?n:0,x=c?a:0,b=null,M=null;switch(t){case"M":n=g[0]+m,a=g[1]+x,o=n,s=a,r.push({c:"M",p:[n,a]}),l=c?"l":"L";break;case"L":n=g[0]+m,a=g[1]+x,r.push({c:"L",p:[n,a]});break;case"H":n=g[0]+m,r.push({c:"L",p:[n,a]});break;case"V":a=g[0]+(c?a:0),r.push({c:"L",p:[n,a]});break;case"C":{let t=[g[0]+m,g[1]+x,g[2]+m,g[3]+x,g[4]+m,g[5]+x];r.push({c:"C",p:t}),b=[t[2],t[3]],n=t[4],a=t[5];break}case"S":{let t=[p?2*n-p[0]:n,p?2*a-p[1]:a,g[0]+m,g[1]+x,g[2]+m,g[3]+x];r.push({c:"C",p:t}),b=[t[2],t[3]],n=t[4],a=t[5];break}case"Q":{let t=[g[0]+m,g[1]+x,g[2]+m,g[3]+x];r.push({c:"Q",p:t}),M=[t[0],t[1]],n=t[2],a=t[3];break}case"T":{let t=d?2*n-d[0]:n,e=d?2*a-d[1]:a,i=[t,e,g[0]+m,g[1]+x];r.push({c:"Q",p:i}),M=[t,e],n=i[2],a=i[3];break}case"A":{let t=g[5]+m,e=g[6]+x;for(let i of f(n,a,g[0],g[1],g[2],g[3],g[4],t,e))r.push({c:"C",p:i}),b=[i[2],i[3]];n=t,a=e;break}}p=b,d=M}return r}var d=t=>{let e=Math.round(100*t)/100;return Object.is(e,-0)?"0":String(e)};function y(t,e){let r="";for(let i of t){r+=i.c;for(let t=0;t<i.p.length;t+=2){let[l,n]=e?e(i.p[t],i.p[t+1]):[i.p[t],i.p[t+1]];r+=(t?" ":"")+d(l)+" "+d(n)}}return r}function g(t,e){for(let r of t)for(let t=0;t<r.p.length;t+=2)e(r.p[t],r.p[t+1])}function m(t){let e="";return t.forEach(([t,r],i)=>{e+=(i?"L":"M")+d(t)+" "+d(r)}),e+"Z"}function x(t,e=8){let r=[],i=0,l=0;for(let n of t){let t=n.p;if("M"===n.c){if(r.length)break;i=t[0],l=t[1],r.push([i,l])}else if("L"===n.c)i=t[0],l=t[1],r.push([i,l]);else if("Q"===n.c||"C"===n.c){for(let a=1;a<=e;a++){let o=a/e,s=1-o;r.push("Q"===n.c?[s*s*i+2*s*o*t[0]+o*o*t[2],s*s*l+2*s*o*t[1]+o*o*t[3]]:[s*s*s*i+3*s*s*o*t[0]+3*s*o*o*t[2]+o*o*o*t[4],s*s*s*l+3*s*s*o*t[1]+3*s*o*o*t[3]+o*o*o*t[5]])}i=t[t.length-2],l=t[t.length-1]}else if("Z"===n.c)break}let[n,a]=r[0]??[0,0],[o,s]=r[r.length-1]??[0,0];return r.length>1&&Math.abs(n-o)<1e-9&&Math.abs(a-s)<1e-9&&r.pop(),r}function b(t,e,r="faceted"){let i=t.length;if(i<3||!(e>.05))return[];let l=0;for(let e=0;e<i;e++){let[r,n]=t[e],[a,o]=t[(e+1)%i];l+=r*o-a*n}let n=l>=0?1:-1,a=t.map((e,l)=>{let a=t[(l+1)%i],o=a[0]-e[0],s=a[1]-e[1],h=Math.hypot(o,s);if(h<1e-9)return null;let c=n*s/h;return-n*o/h<=.02?null:"flat"===r?-.26:.04*Math.round(-6.5-4*c+1e-9)}),o=a.findIndex((t,e)=>t!==a[(e+i-1)%i]);o<0&&(o=0);let s=[],h=(r,l,n)=>{let a=[];for(let e of r)a.push(t[e]);a.push(t[(r[r.length-1]+1)%i]);let o=a.map(([t,r])=>[t,r+e]).reverse();s.push({pathD:m([...a,...o]),shade:l,depth:n??Math.round(a.reduce((t,e)=>t+e[1],0)/a.length*1e6)/1e6})},c=[],u=[],f=()=>{c.length&&h(c,a[c[0]]),c=[]},p=()=>{f();let t=new Set(u.map(t=>a[t]));t.size>1&&h(u,Math.min(...t),-1/0),u=[]};for(let t=0;t<i;t++){let e=(o+t)%i,r=a[e];null!=r?(c.length&&a[c[0]]!==r&&f(),c.push(e),u.push(e)):p()}return p(),s.sort((t,e)=>t.depth-e.depth).map(({pathD:t,shade:e})=>({pathD:t,shade:Math.round(100*e)/100}))}var M=class{constructor(t){this.resolved=t,this.sx=[],this.sy=[],this.left=[],this.right=[],this.top=[],this.bottom=[]}add(t,e,r=0,i=0,l=i,n=i,a=n){let[o,s,h,c]=this.resolved.linear,u=o*t+h*e,f=s*t+c*e-this.resolved.verticalScale*r;!Number.isFinite(u)||!Number.isFinite(f)||(this.sx.push(u),this.sy.push(f),this.left.push(i),this.right.push(l),this.top.push(n),this.bottom.push(a))}get size(){return this.sx.length}};function v(t,e,r,i){let l=1/0,n=-1/0;for(let a=0;a<t.length;a++){let o=i*t[a];o-e[a]<l&&(l=o-e[a]),o+r[a]>n&&(n=o+r[a])}return[l,n]}function w(t,e,r){let[i,l]=e,[n,o,s,h]=t.linear,c=t.verticalScale;if("none"===t.fit||0===r.size){let e=t.origin[0]*i,u=t.origin[1]*l,f=a(t.type,[n,o,s,h,e-n*e-s*u,u-o*e-h*u],c);return 0===r.size?f:a(t.type,f.matrix,c,1,k(f,r,1))}let u=t.fitPadding,f=Math.max(1,i-2*u),p=Math.max(1,l-2*u),d=t=>{let[e,i]=v(r.sx,r.left,r.right,t),[l,n]=v(r.sy,r.top,r.bottom,t);return i-e<=f&&n-l<=p},y=1;if(!d(1)){let t=0,e=1;for(let r=0;r<32;r++){let r=(t+e)/2;d(r)?t=r:e=r}y=Math.max(t,.001)}let[g,m]=v(r.sx,r.left,r.right,y),[x,b]=v(r.sy,r.top,r.bottom,y),M=i/2-(g+m)/2,w=l/2-(x+b)/2;return a(t.type,[n*y,o*y,s*y,h*y,M,w],c*y,y,{x:g+M,y:x+w,width:m-g,height:b-x})}function k(t,e,r){let[i,l]=v(e.sx,e.left,e.right,r),[n,a]=v(e.sy,e.top,e.bottom,r);return{x:i+t.matrix[4],y:n+t.matrix[5],width:l-i,height:a-n}}function $(t){if(!t||"object"!=typeof t)return null;let e=t.data;return e&&"object"==typeof e?e:t}function S(t,e){if(null==t)return NaN;if("number"==typeof t)return t;let r,i=$(e);if(!i)return NaN;"function"==typeof t?r=t(i):(r=i[t],null==r&&e&&"object"==typeof e&&(r=e[t]));let l="number"==typeof r?r:Number(r);return Number.isFinite(l)?l:NaN}import{symbol as z,symbolCircle as P,symbolCross as N,symbolDiamond as D,symbolSquare as j,symbolStar as F,symbolTriangle as L,symbolWye as C}from"d3-shape";var R={circle:P,square:j,triangle:L,diamond:D,star:F,cross:N,wye:C},I=/* @__PURE__ */new Set(["circle","square","triangle","diamond","star","cross","wye","chevron"]),_=["circle","triangle","diamond","star","square","chevron","cross","wye"];function A(t,e,r){if(r)return r;let i=t??"circle";if("chevron"===i)return q(e);let l=Object.prototype.hasOwnProperty.call(R,i)?R[i]:P;return z(l,Math.max(1,e))()??""}function O(t){return Math.sqrt(Math.max(1,t)/Math.PI)}function T(t,e){let r=/* @__PURE__ */new Map,i=0;return l=>{let n=String(t(l)),a=e&&Object.prototype.hasOwnProperty.call(e,n)?e[n]:void 0;if(a&&I.has(a))return a;let o=r.get(n);return o||(o=_[i%_.length],i++,r.set(n,o)),o}}function q(t){let e=1.5*O(t),r=.92*e;return`M0,${-e}L${r},${(.78*e).toFixed(3)}L0,${(.28*e).toFixed(3)}L${-r},${(.78*e).toFixed(3)}Z`}var Z=[40,40],E=[.5,.5];function Q(t,e){let[r,i]=t.viewBox??Z,[l,n]=t.anchor??E,a=i>0?i:1,o=Math.max(0,e)/a,s=(r>0?r:a)*o,h=a*o;return{width:s,height:h,scale:o,offsetX:-l*s,offsetY:-n*h}}function W(t,e,r,i){if("none"!==t)return"color"===t||null==t?e??i:"accent"===t?r:t}function H(t,e,r=0,i="horizontal"){let[l,n]=t.viewBox??Z,a=Math.min(1,Math.max(0,r)),o=Math.min(1,Math.max(0,e));return o<=a?{x:0,y:0,width:0,height:0}:a<=0&&o>=1?null:"vertical"===i?{x:0,y:n*(1-o),width:l,height:n*(o-a)}:{x:l*a,y:0,width:l*(o-a),height:n}}function V(t,e){let r=Q(t,e);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}}var X=null,Y=null;function B(t){}function U(t){X=t}function J(){return X}function G(t){let e=t.edges?.route;return!!(t.ground?.grid||t.ground?.plate||t.regions?.length||e&&"layout"!==e||"extrude"===t.marks||"function"==typeof t.marks)}function K(){return X?Promise.resolve():(Y??(Y=import("./c-KWJIBJ4R.min.js").then(t=>{X=t.networkPerspectiveExtras}).catch(t=>{throw Y=null,t})),Y)}function tt(t,e,r){let i=.5522847498*r;return[{c:"M",p:[t+r,e]},{c:"C",p:[t+r,e+i,t+i,e+r,t,e+r]},{c:"C",p:[t-i,e+r,t-r,e+i,t-r,e]},{c:"C",p:[t-r,e-i,t-i,e-r,t,e-r]},{c:"C",p:[t+i,e-r,t+r,e-i,t+r,e]},{c:"Z",p:[]}]}function et(t){let e=Math.min(t.startAngle,t.endAngle),r=Math.min(2*Math.PI-1e-6,Math.abs(t.endAngle-t.startAngle)),i=(e,r)=>`${t.cx+e*Math.cos(r)} ${t.cy+e*Math.sin(r)}`,l=r>Math.PI?1:0,n=e+r,a=t.innerR>0?`L${i(t.innerR,n)}A${t.innerR} ${t.innerR} 0 ${l} 0 ${i(t.innerR,e)}`:`L${t.cx} ${t.cy}`;return p(`M${i(t.outerR,e)}A${t.outerR} ${t.outerR} 0 ${l} 1 ${i(t.outerR,n)}${a}Z`)}function rt(t){return[[t[0],t[1]],[t[2],t[1]],[t[2],t[3]],[t[0],t[3]]]}function it(t){let e=t.datum;return[t.id,e?.id,e?.data?.id].filter(t=>null!=t&&""!==t).map(String)}function lt(t){if("rect"===t.type)return[t.x,t.y,t.x+t.w,t.y+t.h];let e="circle"===t.type?t.r:"arc"===t.type?t.outerR:"symbol"===t.type?O(t.size):t.size/2;return[t.cx-e,t.cy-e,t.cx+e,t.cy+e]}function nt(t,e,r){if("arc"===t.type)return"ground";if("glyph"===t.type)return"billboard";if("symbol"===t.type)return"billboard"===e?"billboard":"token";if("circle"===t.type)return"billboard"===e||"ground"===e?e:e||"circlepack"!==r?"token":"ground";if(!e||"token"===e)return"ground";if("extrude"===e){let e=t.datum;if(e?.children?.length||e?.data?.children?.length)return"ground"}return e}function at(t){let e=t.thickness;return"number"==typeof e&&Number.isFinite(e)?Math.max(0,e):6}var ot=/* @__PURE__ */new Set(["treemap","circlepack"]);function st(t,e,r,i,l){let n=t.map(t=>l(t)?null==e?i:S(e,t.node.datum):NaN);if(null==e||"number"==typeof e)return n.map(t=>Number.isFinite(t)?t:0);let a=n.reduce((t,e)=>Number.isFinite(e)?Math.max(t,Math.abs(e)):t,0),o="number"==typeof r&&Number.isFinite(r)?r:a>0?48/a:0;return n.map(t=>Number.isFinite(t)?t*o:0)}function ht(t,e){let r=Math.atan2(e,t);return r>Math.PI/2?r-Math.PI:r<=-Math.PI/2?r+Math.PI:r}function ct(t){let e=t.fontSize??11,r=String(t.text??"").length*e*.56,i="end"===t.anchor?r:"start"===t.anchor?0:r/2;return[i,r-i,.7*e,.7*e]}function ut(t){if(null==t)return null;if("object"!=typeof t)return String(t);let e=t.id;return null==e?null:String(e)}function ft(t){let{perspective:e,size:r,chartType:i,theme:l={}}=t,n=e.config,a=J(),o="feet"===n.anchor,s=n.glyph,h=at(n),c=t.sceneNodes.map((t,e)=>{let r=nt(t,"function"==typeof n.marks?n.marks(t):n.marks,i);"extrude"===r&&!a&&(r="ground");let l=lt(t),o="billboard"!==r&&"token"!==r||!s||"circle"!==t.type&&"symbol"!==t.type?void 0:("function"==typeof s?s($(t.datum)??{}):s)??void 0;return o&&(r="billboard"),{node:t,mode:r,z:0,lift:0,h:0,t:0,gx:"rect"===t.type?t.x+t.w/2:t.cx,gy:"rect"===t.type?t.y+t.h/2:t.cy,box:l,index:e,glyph:o}}),u=st(c,n.elevation,n.elevationScale,0,()=>!0),f=st(c,n.extrude,n.extrudeScale,24,t=>"extrude"===t.mode),d=ot.has(i??"");c.forEach((t,e)=>{t.z=t.lift=u[e],t.t="billboard"===t.mode?0:h,t.h="extrude"===t.mode?Math.max(h,f[e]):0,d&&"billboard"!==t.mode&&(t.z+=(t.node.depth??0)*h)});let v=a?.plan(c,n,r,l)??null,k=t=>t.z+("extrude"===t.mode?t.h:t.t),S=t=>n.glyphSize??Math.max(16,2.8*("circle"===t.node.type?t.node.r:O(t.node.size))),z=new M(e),P=(t,e,r,i,l,n,a)=>z.add(t,e,r,i,l,n,a),[N,D,j,F]=e.linear;for(let t of c){let{node:e,mode:r,z:i}=t,l=k(t);if("billboard"===r){if(t.glyph||"glyph"===e.type){let r=Q(t.glyph??e.glyph,t.glyph?S(t):e.size);P(t.gx,t.gy,i,-r.offsetX,r.offsetX+r.width,-r.offsetY,r.offsetY+r.height)}else if("rect"===e.type)P(t.gx,t.gy,i,e.w/2,e.w/2,e.h/2,e.h/2);else{let e=(t.box[2]-t.box[0])/2;P(t.gx,t.gy,i,e,e,o?2*e:e,o?0:e)}t.lift>0&&P(t.gx,t.gy,i-t.lift)}else if("token"===r){let e=(t.box[2]-t.box[0])/2;P(t.gx,t.gy,l,e,e,e,e),P(t.gx,t.gy,i,e,e,e,e),t.lift>0&&P(t.gx,t.gy,i-t.lift)}else if("circle"===e.type)for(let t of[Math.atan2(j,N),Math.atan2(F,D)]){let r=e.r*Math.cos(t),n=e.r*Math.sin(t);for(let t of[i,l])P(e.cx+r,e.cy+n,t),P(e.cx-r,e.cy-n,t)}else if("arc"===e.type)for(let t=0;t<=12;t++){let r=e.startAngle+(e.endAngle-e.startAngle)*t/12;P(e.cx+e.outerR*Math.cos(r),e.cy+e.outerR*Math.sin(r),i),P(e.cx+e.outerR*Math.cos(r),e.cy+e.outerR*Math.sin(r),l)}else for(let[e,r]of rt(t.box))P(e,r,i),P(e,r,l)}let L=n.edges?.elevation??"surface",C=/* @__PURE__ */new Map,R=/* @__PURE__ */new Map,I=/* @__PURE__ */new Map;for(let t of c){let e=`${t.gx}|${t.gy}`;C.has(e)||C.set(e,t),I.set(e,t);for(let e of it(t.node))R.has(e)||R.set(e,t)}let _=(t,e,r)=>{let i=ut(t),l=(null!=i?R.get(i):void 0)??(null!=e&&null!=r?I.get(`${e}|${r}`):void 0);return l?l.z-("nodes"===L?0:l.lift):0},T=t=>{if("number"==typeof L)return Number.isFinite(L)?[L,L]:[0,0];if("ground"===L||!C.size)return[0,0];let e=t.datum;return"line"===t.type?[_(e?.source,t.x1,t.y1),_(e?.target,t.x2,t.y2)]:[_(e?.source),_(e?.target)]},q=/* @__PURE__ */new Map,Z=[],E=/* @__PURE__ */new Map,W=([t,e],r)=>t+(e-t)*r;for(let e of t.sceneEdges){let[t,r]=T(e),i=[t,r];Z.push(i);let l=(t+r)/2;if(E.set(e.datum,"line"===e.type?i:[l,l]),"line"===e.type)for(let i of[0,h])P(e.x1,e.y1,t+i),P(e.x2,e.y2,r+i);else if(e.pathD){let i=p(e.pathD);q.set(e,i),g(i,(e,i)=>{P(e,i,(t+r)/2),P(e,i,(t+r)/2+h)})}}v?.add(P);let H=c.filter(t=>"ground"===t.mode||"extrude"===t.mode),V=t.labels.map(t=>{let[e,r,i,l]=ct(t),n=t.anchorPoint;if(n){let a=C.get(`${n[0]}|${n[1]}`),o=t.x-n[0],s=t.y-n[1];return P(n[0],n[1],a?k(a):0,Math.max(0,e-o),Math.max(0,r+o),Math.max(0,i-s),Math.max(0,l+s)),{label:t,item:a,z:a?k(a):0,ox:o,oy:s}}let a=h,o=1/0;for(let e of H){let[r,i,l,n]=e.box,s=(l-r)*(n-i);t.x>=r&&t.x<=l&&t.y>=i&&t.y<=n&&s<o&&(o=s,a=k(e))}return P(t.x,t.y,a,e,r,i,l),{label:t,item:void 0,z:a,ox:0,oy:0}}),X=(t.htmlMarks??[]).map(t=>{let e=t.x+t.width/2,r=t.y+t.height/2,i=R.get(t.id)??C.get(`${e}|${r}`),l=i?e-i.gx:0,n=i?r-i.gy:0;return P(i?.gx??e,i?.gy??r,i?k(i):h,Math.max(0,t.width/2-l),Math.max(0,t.width/2+l),Math.max(0,t.height/2-n),Math.max(0,t.height/2+n)),{mark:t,item:i}});for(let e of t.bounds??[]){if(!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))continue;let t=(t,e)=>"top"===t?h:Number.isFinite(t)?Number(t):e;if("extent"in e){let[r,i,l,n]=e.extent;P(e.x,e.y,t(e.z,h),r,i,l,n)}else if(Number.isFinite(e.width)&&Number.isFinite(e.height)){let r=t(e.z,0);for(let[t,i]of rt([e.x,e.y,e.x+e.width,e.y+e.height]))P(t,i,r)}}let Y=w(e,r,z);return{frame:Y,emit:(e=Y)=>{let r=e.project,[i,s,u,f]=e.matrix,d=[],g=[],M=/* @__PURE__ */new Map,w=/* @__PURE__ */new Map,$=Math.hypot(i,u)||1,z=(t,e)=>[(i*t+u*e)/$,(s*t+f*e)/$],P=(t,i,l)=>{let n=(t,e)=>r(t,e,i+l),a=x(t).map(([t,e])=>n(t,e)),o=b(a,l*e.lift),s=l*e.lift,h=a.map(t=>t[0]),c=a.map(t=>t[1]),u=Math.min(...h),f=Math.min(...c);return{pathD:y(t,n),faces:o.length?o:void 0,bounds:[u,f,Math.max(...h)-u,Math.max(...c)+s-f]}};for(let t of c){let i,{node:l,mode:s,z:h}=t;if("extrude"===s&&a)i=a.extrude(t,e);else if("billboard"===s){let[e,n]=r(t.gx,t.gy,h);if(t.glyph&&"rect"!==l.type&&"arc"!==l.type)i={type:"glyph",cx:e,cy:n,size:S(t),glyph:t.glyph,color:"string"==typeof l.style.fill?l.style.fill:void 0,style:l.style,datum:l.datum,accessibleDatum:l.accessibleDatum,accessibility:l.accessibility,id:l.id,label:l.label,depth:l.depth};else if("rect"===l.type)i={...l,x:e-l.w/2,y:n-l.h/2,_hitPath:void 0};else{let r=o&&"glyph"!==l.type?(t.box[2]-t.box[0])/2:0;i={...l,cx:e,cy:n-r}}}else if("token"!==s||"circle"!==l.type&&"symbol"!==l.type)if("rect"===l.type){let e=l._hitPath,r=P(p(e?y(p(e.pathD),(t,r)=>[e.transform[0]+t*e.transform[2],e.transform[1]+r*e.transform[3]]):m(rt(t.box))),h,t.t),[n,a,o,s]=r.bounds,c=r.pathD+(r.faces??[]).map(t=>t.pathD).join("");i={...l,x:n,y:a,w:Math.max(.001,o),h:Math.max(.001,s),pathD:r.pathD,faces:r.faces,_hitPath:{pathD:c,transform:[0,0,1,1],fill:!0,strokeWidth:e?.strokeWidth??0}}}else{let[e,n]=r(t.gx,t.gy,h+t.t),a=P("circle"===l.type?tt(l.cx,l.cy,l.r):et(l),h,t.t);i={...l,cx:e,cy:n,pathD:a.pathD,faces:a.faces}}else{let[a,o]=r(t.gx,t.gy,h+t.t),s="symbol"===l.type?l.rotation??0:0,c=Math.cos(s),u=Math.sin(s),f=(t,e)=>z(t*c-e*u,t*u+e*c),d="circle"===l.type?tt(0,0,l.r):p(A(l.symbolType,l.size,l.path)),g=b(x(d,6).map(([t,e])=>{let[r,i]=f(t,e);return[a+r,o+i]}),t.t*e.lift,n.tokenRim);i="circle"===l.type?{...l,cx:a,cy:o,pathD:y(d,(t,e)=>{let[r,i]=f(t,e);return[a+r,o+i]}),faces:g.length?g:void 0,_perspectiveToken:!0}:{...l,cx:a,cy:o,rotation:0,path:y(d,f),faces:g.length?g:void 0,_perspectiveToken:!0}}M.set(t,i);let c="rect"===i.type?i.x+i.w/2:i.cx,u="rect"===i.type?i.y+i.h/2:i.cy;w.set(t,[c-t.gx,u-t.gy]),"ground"===s?d.push(i):g.push(t)}let N=!1===n.depthSort?g:g.some(t=>"extrude"===t.mode)&&a?a.sort(g,e):[...g].sort((t,r)=>e.depth(t.gx,t.gy,t.z)-e.depth(r.gx,r.gy,r.z)||t.index-r.index),D=d.concat(N.map(t=>M.get(t))),j=n.edges?.route,F=n.edgeShadow??!0,L=h>0&&!1!==F,C=[],R=/* @__PURE__ */new Map,I=t=>"string"==typeof t?""!==t&&"none"!==t&&"transparent"!==t:null!=t,_=(t,e)=>{if(!L||(t.style.opacity??1)<=0)return;let r=t.style,i="bezier"===t.type||"ribbon"===t.type,l=r.strokeWidth??(i?.5:1),n=r.fillOpacity??("curved"===t.type?.1:r.opacity??.5);if("line"!==t.type&&I(r.fill)&&n>0)C.push(e);else if(I(r.stroke||(i?void 0:"#999"))&&(r.opacity??1)*(r.strokeOpacity??1)>0&&l>0){let t=R.get(l)??[];t.push(e),R.set(l,t)}},O=t.sceneEdges.map((t,e)=>{let i=Z[e],[l,n]=i;if("line"===t.type){if(j&&"layout"!==j&&a){let e="orthogonal-rounded"===j,l=t=>(e,l,n)=>r(e,l,W(i,n)+t),n=a.route(t,e,l(h));return L&&_(t,a.route(t,e,l(0)).pathD),{...n,_perspectivePart:"edge"}}let[e,o]=r(t.x1,t.y1,l+h),[s,c]=r(t.x2,t.y2,n+h);if(L){let[e,i]=r(t.x1,t.y1,l),[a,o]=r(t.x2,t.y2,n);_(t,`M${e} ${i}L${a} ${o}`)}return{...t,x1:e,y1:o,x2:s,y2:c,_perspectivePart:"edge"}}let o=q.get(t);if(!o)return t;let s=(l+n)/2;L&&_(t,y(o,(t,e)=>r(t,e,s)));let c={...t,_perspectivePart:"edge",pathD:y(o,(t,e)=>r(t,e,s+h)),_cachedPath2D:void 0,_cachedPath2DSource:void 0};if("bezier"===c.type){c.bezierCache=void 0;let t=c._gradient;if(t){let[e,i]=r(t.x0,t.y0??0,s+h),[l,n]=r(t.x1,t.y1??0,s+h);c._gradient={...t,x0:e,y0:i,x1:l,y1:n}}}return c}),T="ground"===n.labels?.mode?"y"===n.labels.axis?ht(u,f):ht(i,s):void 0,Q=V.map(({label:t,item:e,z:i,ox:l,oy:n})=>{let a,o;if(e){let r=w.get(e);a=t.x+r[0],o=t.y+r[1]}else if(t.anchorPoint){let[e,s]=r(t.anchorPoint[0],t.anchorPoint[1],i);a=e+l,o=s+n}else[a,o]=r(t.x,t.y,i);return null==T?{...t,x:a,y:o}:{...t,x:a,y:o,rotate:T}}),H=X.map(({mark:t,item:e})=>{let i=e?.gx??t.x+t.width/2,l=e?.gy??t.y+t.height/2,n="billboard"===e?.mode?w.get(e):void 0;if(!n){let[t,a]=r(i,l,e?k(e):h);n=[t-i,a-l]}let[a,o]=n;return{...t,x:t.x+a,y:t.y+o}}),B=v?.underlay(e)??{edges:[],labels:[]},U=B.edges.slice(),J=(t,e,r="edge-shadow")=>U.push({type:"curved",pathD:t,style:e,datum:null,interactive:!1,_perspectivePart:r}),G="object"==typeof F?F:{},K=G.color??"#000",it=G.opacity??.16;C.length&&J(C.join(""),{fill:K,fillOpacity:.75*it,stroke:"none"});for(let[t,e]of R)J(e.join(""),{fill:"none",stroke:K,strokeWidth:t+2,opacity:it,strokeLinecap:"round"});let lt=n.elevationGuides??!0;if(lt){let t="object"==typeof lt?lt:{},i=[],n=[];for(let l of c){if("billboard"!==l.mode&&"token"!==l.mode||l.lift<=0)continue;let a=M.get(l),o=l.z-l.lift,[s,h]=r(l.gx,l.gy,o),c=l.glyph?S(l)/3:(l.box[2]-l.box[0])/2;!1!==t.shadow&&i.push(y(tt(l.gx,l.gy,c),(t,e)=>r(t,e,o)));let u="rect"===a.type?a.x+a.w/2:a.cx,f="rect"===a.type?a.y+a.h:a.cy+l.t*e.lift;Math.abs(f-h)>1&&n.push(`M${s} ${h}L${u} ${f}`)}i.length&&J(i.join(""),{fill:K,fillOpacity:.14,stroke:"none"},"node-shadow"),n.length&&J(n.join(""),{stroke:t.stroke??l.textSecondary??"rgba(128,128,128,0.8)",strokeWidth:1,strokeDasharray:t.strokeDasharray??"3 3",fill:"none"},"elevation-guide")}return{sceneNodes:D,sceneEdges:O,labels:B.labels.length?B.labels.concat(Q):Q,htmlMarks:H,underlay:U,frame:{...e,thickness:h},edgeLift:h,projectParticle:(t,e,i,l)=>{let n=E.get(i),a=n?W(n,l):0;return r(t,e,h+a)}}}}}function pt(t){return ft(t).emit()}export{A as a,O as b,T as c,Q as d,W as e,H as f,V as g,l as h,o as i,s as j,y as k,m as l,b as m,rt as n,it as o,at as p,ht as q,ft as r,pt as s,B as t,U as u,J as v,G as w,K as x};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};let t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}function t(t){return e(t)}function n(e){let n=s(null);return r(e.imperativeRef,{variant:e.imperativeVariant,frameRef:n}),{frameRef:n,resolved:a(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}),normalizedMargin:l(()=>t(e.margin),[e.margin])}}function o(e){let t=n(e),{resolved:o,normalizedMargin:r}=t,a=i({responsive:e.responsive,data:e.data??[],rawData:e.data,colorBy:e.colorBy,colorScheme:e.colorScheme,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,frameLegend:e.frameLegend,selection:e.selection,linkedHover:e.linkedHover,hoverHighlight:e.hoverHighlight,fallbackFields:"string"==typeof e.colorBy?[e.colorBy]:[],unwrapData:e.unwrapData,onObservation:e.onObservation,onClick:e.onClick,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:e.chartTypeLabel,chartId:e.chartId,showLegend:o.showLegend,legend:e.legend,userMargin:r,marginDefaults:o.marginDefaults,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,width:o.width,height:o.height});return{...t,safeData:a.data,setup:a,earlyReturn:a.earlyReturn}}import{b as i,c as r}from"./c-XI6CLZII.min.js";import{Hb as a}from"./c-XCV7VUU3.min.js";import{useMemo as l,useRef as s}from"react";export{e as a,n as b,o as c};
|