semiotic 3.10.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -59
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/componentMetadata.cjs +3 -1
- package/ai/dist/mcp-server.js +45 -45
- package/ai/examples.md +67 -0
- package/ai/reference.md +75 -1
- package/ai/schema.json +5199 -1
- package/ai/surface-manifest.json +24 -3
- package/ai/task-packets/compare-category-totals.json +6 -6
- package/ai/task-packets/compare-category-totals.md +3 -3
- package/ai/task-packets/correct-published-chart.json +6 -6
- package/ai/task-packets/correct-published-chart.md +3 -3
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +6 -6
- package/ai/task-packets/update-live-chart.md +3 -3
- package/dist/c-2RL2QPZJ.min.js +1 -0
- package/dist/c-45CQWZZ6.min.js +1 -0
- package/dist/{c-PP6VY3QU.min.js → c-4BRHKVKV.min.js} +1 -1
- package/dist/c-7DVPSB5C.min.js +1 -0
- package/dist/{c-XDQKXPX4.min.js → c-A7OGOFSL.min.js} +1 -1
- package/dist/{c-AZKPVBOC.min.js → c-AH5HWZWS.min.js} +1 -1
- package/dist/c-B7GW7IHJ.min.js +1 -0
- package/dist/{c-ROEHCIGV.min.js → c-C3TZLTZK.min.js} +1 -1
- package/dist/c-CGQAQWBV.min.js +1 -0
- package/dist/c-DIPEYUOW.min.js +1 -0
- package/dist/{c-WNGH47HF.min.js → c-E72OTUZU.min.js} +1 -1
- package/dist/{c-DY2676CR.min.js → c-EUMPMDCS.min.js} +1 -1
- package/dist/c-EZZT2WAE.min.js +1 -0
- package/dist/c-FHBVFCQB.min.js +1 -0
- package/dist/{c-E32M6XW5.min.js → c-G4HCO2IQ.min.js} +1 -1
- package/dist/{c-ZYPXQF7B.min.js → c-G5VIJEOK.min.js} +1 -1
- package/dist/c-GHVOXAYH.min.js +1 -0
- package/dist/{c-EBOQ7ER7.min.js → c-HP4ZFM47.min.js} +1 -1
- package/dist/{c-IDJV3CZK.min.js → c-HYDTS5OP.min.js} +1 -1
- package/dist/c-IK33LNZ6.min.js +1 -0
- package/dist/c-IK3PZHRY.min.js +1 -0
- package/dist/{c-JO2UGTCP.min.js → c-J6DVC236.min.js} +1 -1
- package/dist/{c-MXCP7GNZ.min.js → c-JIMJF6F6.min.js} +1 -1
- package/dist/{c-4FN7Q6VQ.min.js → c-KKPMHAZC.min.js} +1 -1
- package/dist/c-L6WNDBHV.min.js +1 -0
- package/dist/c-LDEX5OFW.min.js +1 -0
- package/dist/{c-CPSPZH6A.min.js → c-LESEUVC5.min.js} +1 -1
- package/dist/c-MB6CV5NC.min.js +1 -0
- package/dist/{c-OO5QLMJC.min.js → c-MOKJOIPE.min.js} +1 -1
- package/dist/{c-BNG5ECK5.min.js → c-N3FXLRNT.min.js} +1 -1
- package/dist/c-N5NPTJVJ.min.js +1 -0
- package/dist/{c-DE5Q3U2X.min.js → c-NHBL4J67.min.js} +1 -1
- package/dist/{c-LMGSSD2E.min.js → c-ODG6TFSY.min.js} +1 -1
- package/dist/{c-HXDKPIKR.min.js → c-PSKKFZNP.min.js} +1 -1
- package/dist/{c-NYZ2QNAM.min.js → c-R2P4RR7Q.min.js} +1 -1
- package/dist/{c-KCRJGUHP.min.js → c-RFC7UAG7.min.js} +1 -1
- package/dist/c-SGAURYHG.min.js +1 -0
- package/dist/{c-DK662R77.min.js → c-SJMWU6UX.min.js} +1 -1
- package/dist/c-STIIGQOD.min.js +1 -0
- package/dist/c-T2ASIJVZ.min.js +1 -0
- package/dist/c-TX3THUTO.min.js +1 -0
- package/dist/{c-55BAJ333.min.js → c-TX7XJM3Z.min.js} +1 -1
- package/dist/c-UMXSJIOV.min.js +1 -0
- package/dist/{c-JLGRHXGZ.min.js → c-VRSXMLYF.min.js} +1 -1
- package/dist/c-VSLWSAN2.min.js +1 -0
- package/dist/{c-33QOXEUG.min.js → c-WCBRPILW.min.js} +1 -1
- package/dist/{c-WH2O53VI.min.js → c-WGHT7OCY.min.js} +1 -1
- package/dist/c-WWCW3APR.min.js +1 -0
- package/dist/c-Y6PYUMFU.min.js +1 -0
- package/dist/c-ZIVPFTOC.min.js +1 -0
- package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
- package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
- package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
- package/dist/components/charts/shared/hooks.d.ts +3 -1
- package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
- package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
- package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
- package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
- package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
- package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
- package/dist/components/recipes/atlas/braid.d.ts +62 -0
- package/dist/components/recipes/atlas/capsules.d.ts +18 -0
- package/dist/components/recipes/atlas/compare.d.ts +4 -0
- package/dist/components/recipes/atlas/completeness.d.ts +2 -0
- package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
- package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
- package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
- package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
- package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
- package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
- package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
- package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
- package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
- package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
- package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
- package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
- package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
- package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
- package/dist/components/recipes/atlas/forests.d.ts +11 -0
- package/dist/components/recipes/atlas/ids.d.ts +6 -0
- package/dist/components/recipes/atlas/index.d.ts +26 -0
- package/dist/components/recipes/atlas/ledger.d.ts +7 -0
- package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
- package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
- package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
- package/dist/components/recipes/atlas/motifs.d.ts +3 -0
- package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
- package/dist/components/recipes/atlas/prepare.d.ts +14 -0
- package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
- package/dist/components/recipes/atlas/profile.d.ts +19 -0
- package/dist/components/recipes/atlas/publish.d.ts +10 -0
- package/dist/components/recipes/atlas/queries.d.ts +34 -0
- package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
- package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
- package/dist/components/recipes/atlas/sections.d.ts +3 -0
- package/dist/components/recipes/atlas/support.d.ts +7 -0
- package/dist/components/recipes/atlas/types.d.ts +278 -0
- package/dist/components/recipes/atlas/validate.d.ts +12 -0
- package/dist/components/semiotic-atlas-core.d.ts +20 -0
- package/dist/components/semiotic-atlas.d.ts +8 -0
- package/dist/components/semiotic-recipes-core.d.ts +9 -0
- package/dist/components/server/serverChartConfigs.d.ts +3 -0
- package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
- package/dist/components/stream/canvasSetup.d.ts +1 -2
- package/dist/components/stream/fontLoading.d.ts +4 -0
- package/dist/components/stream/networkCustomLayout.d.ts +8 -0
- package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
- package/dist/components/stream/physics/physicsSemanticUI.d.ts +2 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
- package/dist/components/stream/shallowEqual.d.ts +2 -0
- package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-access.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-artifact.min.js +1 -1
- package/dist/semiotic-artifact.module.min.js +1 -1
- package/dist/semiotic-atlas-core.d.ts +20 -0
- package/dist/semiotic-atlas-core.min.js +1 -0
- package/dist/semiotic-atlas-core.module.min.js +1 -0
- package/dist/semiotic-atlas-selection.module.min.js +2 -0
- package/dist/semiotic-atlas.d.ts +8 -0
- package/dist/semiotic-atlas.min.js +2 -0
- package/dist/semiotic-atlas.module.min.js +2 -0
- package/dist/semiotic-client-cjs-shared.min.js +1 -1
- package/dist/semiotic-evidence.min.js +1 -1
- package/dist/semiotic-evidence.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +9 -0
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-text.min.js +1 -1
- package/dist/semiotic-text.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +16 -1
- package/dist/c-447VIMRO.min.js +0 -1
- package/dist/c-553QUDKA.min.js +0 -1
- package/dist/c-7HP7MB2I.min.js +0 -1
- package/dist/c-7NBU5ZKS.min.js +0 -1
- package/dist/c-CCTGN5CK.min.js +0 -1
- package/dist/c-GSZRZRD6.min.js +0 -1
- package/dist/c-GWX7JGMF.min.js +0 -1
- package/dist/c-ITKX3RC5.min.js +0 -1
- package/dist/c-JG2JCQLP.min.js +0 -1
- package/dist/c-LYVKDBQJ.min.js +0 -1
- package/dist/c-NG7BLZTR.min.js +0 -1
- package/dist/c-PYNW54D2.min.js +0 -1
- package/dist/c-TIXX5CAU.min.js +0 -1
- /package/dist/{c-OOVX2JPQ.min.js → c-UC7SIU2W.min.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t=new Map(e.nodes.map(e=>[e.id,[]])),o=new Map(e.nodes.map(e=>[e.id,[]]));for(let n of e.edges)t.get(n.source).push(n),o.get(n.target).push(n);return{outgoing:t,incoming:o}}function t(e,t){let o=new Set,n=[];for(let i of t){if(o.has(i))continue;o.add(i);let t=[{node:i,next:0}];for(;t.length;){let i=t[t.length-1],r=e[i.node][i.next++];void 0===r?(n.push(i.node),t.pop()):o.has(r)||(o.add(r),t.push({node:r,next:0}))}}return n}function o(e){let o=e.nodes.map(e=>e.id).sort(),n=new Map(o.map((e,t)=>[e,t])),i=o.map(()=>[]),r=o.map(()=>[]);for(let t of e.edges){let e=n.get(t.source),o=n.get(t.target);i[e].push(o),r[o].push(e)}let s=new Set,d=[];for(let e of t(i,o.map((e,t)=>t)).reverse()){if(s.has(e))continue;let t=[],n=[e];for(s.add(e);n.length;){let e=n.pop();t.push(o[e]);for(let t of r[e])s.has(t)||(s.add(t),n.push(t))}d.push(t.sort())}return d.sort((e,t)=>e[0].localeCompare(t[0]))}function n(t,o,n="rooted-traversal:id-asc"){let{outgoing:i}=e(t),r=n.endsWith("id-desc")?-1:1;for(let e of i.values())e.sort((e,t)=>r*e.id.localeCompare(t.id));let s=new Set(o),d=[],a=[...new Set(o)],c=e=>{let t=[{node:e,next:0}];for(;t.length;){let e=t[t.length-1],o=i.get(e.node)?.[e.next++];o?s.has(o.target)||(s.add(o.target),d.push([o.target,o.id]),t.push({node:o.target,next:0})):t.pop()}};for(let e of a)c(e);for(let e of t.nodes.map(e=>e.id).sort())s.has(e)||(a.push(e),s.add(e),c(e));let l=d.map(([,e])=>e),u=new Set(l);return{forest:{kind:"rooted-backbone",roots:a,rankingPolicyId:n,backboneEdgeIds:l,primaryParentEdgeIdByNode:Object.fromEntries(d)},residual:{originalEdgeIds:t.edges.map(e=>e.id),residualEdgeIds:t.edges.filter(e=>!u.has(e.id)).map(e=>e.id)}}}function i(e,t,o){if("ordinal"!==t.coordinate.kind)return!0;let n=e.nodes.find(e=>e.id===o);return!(!n?.sectionId||!t.coordinate.sectionIds.includes(n.sectionId))}function r(e,t){return[...e].sort((e,o)=>"id-asc"===t?e.id.localeCompare(o.id):o.id.localeCompare(e.id))}function s(e,t){let o=new Set(e.originalEdgeIds),n=new Set(t.backboneEdgeIds),i=new Set(e.residualEdgeIds);if(n.size!==t.backboneEdgeIds.length)throw Error("duplicate backbone edge id");if(i.size!==e.residualEdgeIds.length)throw Error("duplicate residual edge id");for(let e of n){if(i.has(e))throw Error(`edge ${e} is both backbone and residual`);if(!o.has(e))throw Error(`backbone edge ${e} is not original`)}for(let e of i)if(!o.has(e))throw Error(`residual edge ${e} is not original`);if(n.size+i.size!==o.size)throw Error("original edge IDs != backbone ⊎ residual")}function d(e,t){return e.sectionByNode.get(t)}function a(e,t){let o=new Set,n=[];for(let i of t){let t=d(e,i);!t||o.has(t)||(o.add(t),n.push(t))}return n}function c(e,t,o){return e.pairs.get(t)?.get(o)??[]}function l(e){return e.entityCount??1}function u(e,t){let o=[],n=0;for(let i of e)!i.nodePath.includes(t)||i.missingPrehistory||(o.push(i.entityId),n+=l(i));return{entityIds:o,entityCount:n}}function f(e,t,o,n,i,r){if(2>o.length)return;let{kept:s,truncation:d}=function(e,t){return null!=t&&e.length>t?{kept:e.slice(0,t),truncation:{disclosed:!0,omitted:e.length-t,fullCount:e.length}}:{kept:e}}(o,r),l=[t,...s],f=[];for(let o of s){let n="fan-out"===e?c(i,t,o):c(i,o,t);f.push(...n)}let p=a(i,[t,...o]),g=u(n.occurrences??[],t);return{id:`${e}:${t}`,template:e,roles:"fan-out"===e?{source:t,destinations:s}:{destination:t,sources:s},nodePath:l,edgeIds:f,startSectionId:p[0],completionSectionId:p[p.length-1],intersectSectionIds:p,entityIds:g.entityIds,entityWeights:S(),entityCount:g.entityCount,flags:{occurrence:g.entityIds.length>0,temporal:!1,trajectorySupported:g.entityIds.length>0,enriched:!1},truncation:d}}function p(e,t,o){return 1===t.length&&1===o.length}function g(e){return e.entityCount??1}function m(e,t,o){let n=t??"";e.partitionCounts.set(n,(e.partitionCounts.get(n)??0)+o)}function h(e,o){let n=e.nodes.map(e=>e.id).sort(),i=new Map(n.map((e,t)=>[e,t])),r=n.length,s=Array.from({length:n.length+1},()=>[]),d=s.map(()=>[]),a=(e,t)=>{s[e].push(t),d[t].push(e)};for(let t of e.edges)a(i.get(t.source),i.get(t.target));for(let e of o.roots)a(r,i.get(e));let c=t(s,[r]).reverse(),l=new Map(c.map((e,t)=>[e,t])),u=new Map([[r,r]]),f=(e,t)=>{for(;e!==t;)l.get(e)>l.get(t)?e=u.get(e):t=u.get(t);return e},p=!0;for(;p;){p=!1;for(let e of c.slice(1)){let t=d[e].filter(e=>u.has(e)).reduce(f);u.get(e)!==t&&(u.set(e,t),p=!0)}}return{...o,roots:[...new Set(o.roots)].sort(),status:e.nodes.some(e=>e.completeness&&"known"!==e.completeness)?"incomplete":"exact",immediateDominatorByNode:Object.fromEntries(n.flatMap((e,t)=>u.has(t)?[[e,u.get(t)===r?null:n[u.get(t)]]]:[])),reachableNodeIds:n.filter((e,t)=>u.has(t)),unreachableNodeIds:n.filter((e,t)=>!u.has(t))}}function y(e,t,o,n){e.push({kind:t,severity:"fatal",message:o,id:n})}function I(e,t){let o=[];"0.2"!==e.schemaVersion&&y(o,"schema-version","expected schemaVersion 0.2"),(!e.relations.directed||!0!==e.relations.edgeIdRequired)&&y(o,"relations","Phase 1 requires directed edges with ids"),"rooted-backbone"!==e.forest.display.kind&&"observed-prefix"!==e.forest.display.kind&&y(o,"forest","supported display kinds: rooted-backbone, observed-prefix"),"ordinal"!==e.coordinate.kind&&y(o,"coordinate","Phase 1 kernel uses ordinal sections");let n=S();for(let i of t.nodes)i.id?(n[i.id]&&y(o,"duplicate-node","duplicate node id",i.id),E(n,i.id,!0),"ordinal"===e.coordinate.kind&&i.sectionId&&!e.coordinate.sectionIds.includes(i.sectionId)&&y(o,"section-membership",`node section ${i.sectionId} is not in the coordinate`,i.id)):y(o,"node-id","node is missing id");let i=S();for(let e of t.edges)e.id?(i[e.id]&&y(o,"duplicate-edge","duplicate edge id",e.id),E(i,e.id,!0),n[e.source]||y(o,"dangling-source","edge source is not a node",e.id),n[e.target]||y(o,"dangling-target","edge target is not a node",e.id)):y(o,"edge-id","edge is missing id");for(let t of e.forest.display.roots??[])n[t]||y(o,"missing-root","display root is not a node",t);let r=e.forest.requiredPaths;if(r)if("directed-admitted"!==r.relationScopeId&&y(o,"required-path-scope","required paths use the full directed-admitted relation scope"),Array.isArray(r.roots)&&0!==r.roots.length)for(let e of r.roots)n[e]||y(o,"required-path-roots","required-path root is not a node",e);else y(o,"required-path-roots","required paths need declared roots");if("rooted-backbone"===e.forest.display.kind&&0===e.forest.display.roots.length&&y(o,"missing-root","rooted-backbone requires at least one root"),e.comparison&&(2>e.comparison.partitions.length&&y(o,"comparison","comparison requires at least two partitions"),e.measures[e.comparison.denominatorMeasureId]||y(o,"comparison-denominator","comparison denominatorMeasureId is not a declared measure")),null===(s=e.measures)||"object"!=typeof s||Array.isArray(s))y(o,"measures","measures must be an object");else for(let[t,n]of Object.entries(e.measures))"rate"===n.unitKind&&!n.timeDenominator&&y(o,"rate-denominator","rate measures require a timeDenominator",t);var s;for(let n of t.measureValues)e.measures[n.measureId]?Number.isFinite(n.value)||y(o,"non-finite-measure","measure value is not finite",n.measureId):y(o,"unknown-measure","measureValue refers to an undeclared measure",n.measureId);for(let e of t.occurrences??[])if(e.id&&e.entityId){void 0!==e.stepEntityCounts&&(!Array.isArray(e.stepEntityCounts)||e.stepEntityCounts.length!==e.nodePath.length||Array.from(e.stepEntityCounts).some(e=>!Number.isFinite(e)||0>e))&&y(o,"occurrence-step-counts","stepEntityCounts must contain one finite, nonnegative count per nodePath step",e.id);for(let t of e.nodePath)n[t]||y(o,"occurrence-node","occurrence path references a missing node",e.id)}else y(o,"occurrence","occurrence needs id and entityId");return{ok:o.every(e=>"fatal"!==e.severity),issues:o}}function k(e,t,o){let n=o.measures[e],i=o.measures[t];if(!n||!i)return{ok:!1,reason:"unknown-measure"};if(n.countUnit!==i.countUnit)return{ok:!1,reason:"count-unit-mismatch"};if("rate"===n.unitKind||"rate"===i.unitKind){if(n.unitKind!==i.unitKind)return{ok:!1,reason:"stock-or-capacity-cannot-compare-to-rate"};if(n.timeDenominator!==i.timeDenominator)return{ok:!1,reason:"rate-time-denominator-mismatch"}}return{ok:!0}}function b(e,t,o={}){let y=I(e,t);if(!y.ok)return{ok:!1,issues:y.issues};let k=o.generation??1,b=function(e,t){if("ordinal"!==e.coordinate.kind)return{kind:"ordinal",sectionIds:[],nodeIdsBySection:S()};let o=S();for(let t of e.coordinate.sectionIds)E(o,t,[]);for(let e of t.nodes){if(!e.sectionId)continue;let t=o[e.sectionId];t&&t.push(e.id)}return{kind:"ordinal",sectionIds:[...e.coordinate.sectionIds],nodeIdsBySection:o}}(e,t),M=function(e,t){let o=e.motifs.matchBudget,n=function(e){let t=new Map(e.nodes.map(e=>[e.id,new Set])),o=new Map(e.nodes.map(e=>[e.id,new Set])),n=new Map;for(let i of e.edges){t.get(i.target)?.add(i.source),o.get(i.source)?.add(i.target);let e=n.get(i.source);e||n.set(i.source,e=new Map);let r=e.get(i.target);r?r.push(i.id):e.set(i.target,[i.id])}return{incoming:new Map([...t].map(([e,t])=>[e,[...t]])),outgoing:new Map([...o].map(([e,t])=>[e,[...t]])),sectionByNode:new Map(e.nodes.map(e=>[e.id,e.sectionId])),pairs:n}}(t),i=[];for(let e of t.nodes){let r=f("fan-out",e.id,n.outgoing.get(e.id)??[],t,n,o);r&&i.push(r);let s=f("fan-in",e.id,n.incoming.get(e.id)??[],t,n,o);s&&i.push(s)}i.push(...function(e,t){let o=t.incoming,n=t.outgoing,i=[];for(let r of e.nodes){let s=o.get(r.id)??[],d=n.get(r.id)??[];if(1!==d.length)continue;let l=1===s.length&&p(0,o.get(s[0])??[],n.get(s[0])??[]);if(p(0,s,d)&&l)continue;let f=[r.id],g=r.id,m=new Set([g]);for(;;){let e=(n.get(g)??[])[0];if(!e||m.has(e)||(f.push(e),m.add(e),!p(0,o.get(e)??[],n.get(e)??[])))break;g=e}if(2>f.length)continue;let h=[];for(let e=0;f.length-1>e;e++)h.push(...c(t,f[e],f[e+1]));let y=a(t,f),I=u(e.occurrences??[],f[0]);i.push({id:"serial-chain:"+f.join(">"),template:"serial-chain",roles:{nodes:f,start:f[0],end:f[f.length-1]},nodePath:f,edgeIds:h,startSectionId:y[0],completionSectionId:y[y.length-1],intersectSectionIds:y,entityIds:I.entityIds,entityWeights:S(),entityCount:I.entityCount,flags:{occurrence:I.entityIds.length>0,temporal:!1,trajectorySupported:I.entityIds.length>0,enriched:!1}})}return i}(t,n)),i.push(...function(e,t){let o=[];for(let n of e.occurrences??[]){if(n.missingPrehistory)continue;let e=new Map,i=new Set;for(let[r,s]of n.nodePath.entries()){let c=e.get(s);if(null==c){e.set(s,r);continue}if(i.has(s))continue;i.add(s);let u=n.nodePath.slice(c,r+1),f=a(t,u),p=S();E(p,n.entityId,l(n)),o.push({id:`repeated-state-episode:${n.id}:${s}`,template:"repeated-state-episode",roles:{state:s,occurrence:n.id},nodePath:u,edgeIds:[],startSectionId:d(t,u[0]),completionSectionId:d(t,u[u.length-1]),intersectSectionIds:f,entityIds:[n.entityId],entityWeights:p,entityCount:l(n),flags:{occurrence:!0,temporal:!1,trajectorySupported:!0,enriched:!1}})}}return o}(t,n)),function(e,t){let o=t.occurrences??[];if(0!==o.length)for(let t of e){if("repeated-state-episode"===t.template)continue;let e=t.nodePath,n=S();for(let t of o)t.missingPrehistory||!e.some(e=>t.nodePath.includes(e))||E(n,t.entityId,l(t));let i=Object.keys(n);t.entityIds=i,t.entityWeights=n,t.entityCount=i.reduce((e,t)=>e+(n[t]??0),0),t.flags={...t.flags,occurrence:i.length>0,trajectorySupported:i.length>0}}}(i,t);let r=[];for(let e of t.occurrences??[])e.missingPrehistory&&(r.push({template:"serial-chain",occurrenceId:e.id,reason:"missing-prehistory"}),r.push({template:"repeated-state-episode",occurrenceId:e.id,reason:"missing-prehistory"}));let s=x.filter(e=>!q.includes(e));return{catalogId:e.motifs.catalogId,catalogVersion:e.motifs.catalogVersion,matches:i,incompleteCandidates:r,unsupportedTemplates:s}}(e,t),j=function(e,t){if(e.forest.display.rankingPolicyId?.startsWith("rooted-traversal"))return n(t,e.forest.display.roots??[],e.forest.display.rankingPolicyId);let o=t.edges.map(e=>e.id),s=e.forest.display.rankingPolicyId??"main-transport",{mode:d,order:a}=function(e){let[t,o]=e.split(":");return{mode:"tree-only"===t?"tree-only":"main-transport",order:"id-desc"===o?"id-desc":"id-asc"}}(s),c=o=>i(t,e,o.source)&&i(t,e,o.target),l=new Map;for(let e of t.nodes)l.set(e.id,[]);for(let e of t.edges)l.has(e.target)||l.set(e.target,[]),l.get(e.target).push(e);let u,f=S(),p=e.forest.display.roots&&e.forest.display.roots.length>0?e.forest.display.roots:t.nodes[0]?[t.nodes[0].id]:[],g=new Set(p);for(let e of t.nodes){if(g.has(e.id))continue;let t=r(l.get(e.id)??[],a),o=t.find(e=>c(e))??t[0];o&&E(f,e.id,o.id)}u="tree-only"===d?Object.values(f):t.edges.filter(e=>c(e)).map(e=>e.id);let m=new Set(u),h=o.filter(e=>!m.has(e));return{forest:{kind:"rooted-backbone",roots:[...p],rankingPolicyId:s,backboneEdgeIds:u,primaryParentEdgeIdByNode:f},residual:{residualEdgeIds:h,originalEdgeIds:o}}}(e,t);s(j.residual,j.forest);let A=P(e,t,b),B=function(e,t){let o=S();for(let t of e.nodes)E(o,t.id,t.completeness??"known");let n=S();for(let e of t.unsupportedTemplates)E(n,e,"unsupported-template");if(t.incompleteCandidates.length>0){let e=new Set(t.incompleteCandidates.map(e=>e.template));for(let t of e)E(n,t,"incomplete")}let i=t.matches.find(e=>e.truncation),r={nodes:o,motifs:n,traces:e.occurrences?.some(e=>e.missingPrehistory||!1===e.complete)?"incomplete":e.nodes.some(e=>"unknown"===e.completeness)?"unknown":"known"};return i?.truncation&&(r.truncation={disclosed:!0,template:i.template,omitted:i.truncation.omitted}),r}(t,M),N=C(t),V=function(e,t,o){return JSON.stringify([o,t.graphRef,t.revision,e],(e,t)=>t&&"object"==typeof t&&!Array.isArray(t)?Object.fromEntries(Object.keys(t).sort().map(e=>[e,t[e]])):t)}(e,t,k),O="observed-prefix"===e.forest.display.kind||(t.occurrences?.length??0)>0?function(e,t={}){function o(e){let t=[...e.children.keys()];return t.sort((t,o)=>{let n=e.children.get(t),i=e.children.get(o),r=s?n.partitionCounts.get(s)??0:1;return r>0!=(s?i.partitionCounts.get(s)??0:1)>0?r>0?-1:1:t.localeCompare(o)}),t}let n={id:"",stateId:"",prefix:[],children:new Map,occurrenceIds:[],entityCount:0,partitionCounts:new Map};for(let t of e){if(t.missingPrehistory)continue;let e=g(t),o=n;o.occurrenceIds.push(t.id),o.entityCount+=e,m(o,t.partition,e);for(let n of t.nodePath){let i=[...o.prefix,n],r=v(i,i.length-1),s=o.children.get(n);s||(s={id:r,stateId:n,prefix:i,children:new Map,occurrenceIds:[],entityCount:0,partitionCounts:new Map},o.children.set(n,s)),s.occurrenceIds.push(t.id),s.entityCount+=e,m(s,t.partition,e),o=s}}let i=[],r=[],s=t.referencePartition;return function e(t,n){if(t.id){let e=S();for(let[o,n]of t.partitionCounts)E(e,o,n);i.push({id:t.id,stateId:t.stateId,prefix:t.prefix,parentId:n,childIds:o(t).map(e=>t.children.get(e).id),entityCount:t.entityCount,occurrenceIds:[...t.occurrenceIds],partitionCounts:e}),r.push(t.id)}for(let n of o(t))e(t.children.get(n),t.id||null)}(n,null),{kind:"observed-prefix",rootIds:o(n).map(e=>n.children.get(e).id),nodes:i,order:r,referencePartition:s}}(t.occurrences??[],{referencePartition:"observed-prefix"===e.forest.display.kind?e.forest.display.referencePartition??e.comparison?.referencePartition:e.comparison?.referencePartition}):void 0,R={sourceGraphRef:t.graphRef,analysisRevision:V,spec:e,source:t,sections:b,motifs:M,forest:j.forest,residualEdges:j.residual,ports:N,ledger:A,completeness:B,provenance:{sourceRevision:t.revision,analysisRevision:V,generation:k,relationScope:"directed-admitted",motifCatalogVersion:e.motifs.catalogVersion,coordinatePolicy:"ordinal"===e.coordinate.kind?"ordinal:"+e.coordinate.sectionIds.join(","):"numeric:"+e.coordinate.field,forestRoots:[...e.forest.display.roots??j.forest.roots],rankingPolicyId:j.forest.rankingPolicyId,population:e.motifs.countUnit,temporalHorizon:e.temporal.kind,evidencePolicyId:e.evidencePolicyId},prefixForest:O,...e.forest.requiredPaths&&{requiredPaths:h(t,e.forest.requiredPaths)}};return R.comparison=w(R),{ok:!0,atlas:R,issues:y.issues}}import{buildComparison as w,buildLedger as P,buildRouteSupportIndex as C,idDictionary as S,prefixIdFor as v,setOwnValue as E}from"./c-FHBVFCQB.min.js";var M="0.2",x=["serial-chain","repeated-state-episode","fan-out","fan-in","split-rejoin-diamond","shared-upstream-source","connector-bypass"],j=["serial-chain","fan-out","fan-in"],q=[...j,"repeated-state-episode"];export{M as NETWORK_ATLAS_SCHEMA_VERSION,x as MOTIF_CATALOG_TEMPLATES,j as PHASE1_MOTIF_MATCHERS,q as PHASE2_MOTIF_MATCHERS,e as graphAdjacency,o as stronglyConnectedComponents,n as buildRootedForest,s as assertEdgeCoverage,I as validateAtlas,k as measuresAreComparable,b as prepareNetworkAtlas};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,e){let[l,i,o]=f(t,e);return.299*l+.587*i+.114*o>128?"#000":"#fff"}function e(t){return Number.isInteger(t)?t+"":100>Math.abs(t)?1>Math.abs(t)?t.toPrecision(3):t.toFixed(1):t.toFixed(0)}import{areaCanvasRenderer as l}from"./c-
|
|
1
|
+
function t(t,e){let[l,i,o]=f(t,e);return.299*l+.587*i+.114*o>128?"#000":"#fff"}function e(t){return Number.isInteger(t)?t+"":100>Math.abs(t)?1>Math.abs(t)?t.toPrecision(3):t.toFixed(1):t.toFixed(0)}import{areaCanvasRenderer as l}from"./c-LESEUVC5.min.js";import{lineCanvasRenderer as i}from"./c-R2P4RR7Q.min.js";import{barCanvasRenderer as o}from"./c-SJMWU6UX.min.js";import{pointCanvasRenderer as r}from"./c-MOKJOIPE.min.js";import{symbolCanvasRenderer as a}from"./c-PSKKFZNP.min.js";import{glyphCanvasRenderer as n}from"./c-KKPMHAZC.min.js";import{renderRectPulse as s}from"./c-W4ZUKSEQ.min.js";import{isHatchFill as h,parseCanvasColor as f,resolveCSSColor as c,resolveCanvasPaint as m}from"./c-MB6CV5NC.min.js";var y=(l,i,o,r)=>{let a=i.filter(t=>"heatcell"===t.type);l.save();try{let i=c(l,"var(--semiotic-font-family, sans-serif)")||"sans-serif";for(let o of a){let r=o.style;null!=r?.opacity&&(l.globalAlpha=r.opacity);let a=m(l,o.fill,"#4e79a7");l.fillStyle=a,l.fillRect(o.x,o.y,o.w,o.h);let n=Math.max(0,r?.strokeWidth??1);if(n>0&&(l.strokeStyle=c(l,r?.stroke??"var(--semiotic-surface, #fff)"),l.lineWidth=n,l.strokeRect(o.x,o.y,o.w,o.h)),s(l,o),l.globalAlpha=1,o.showValues&&null!=o.value){if(20>o.w||20>o.h)continue;let r=o.valueFormat?o.valueFormat(o.value):e(o.value),n=Math.max(10,Math.min(16,.3*Math.min(o.w,o.h))),s=o.x+o.w/2,h=o.y+o.h/2;l.fillStyle=t(l,"string"==typeof a?a:"#4e79a7"),l.font=`${n}px ${i}`,l.textAlign="center",l.textBaseline="middle",l.fillText(r,s,h)}}}finally{l.restore()}},d=(t,e,l,i)=>{for(let l of e){if("candlestick"!==l.type)continue;let e=l;t.save();let o=(e._decayOpacity??1)*(e.style?.opacity??1);1!==o&&(t.globalAlpha=o);let r=c(t,e.wickColor)||e.wickColor,a=60>i.height,n=a?Math.max(e.wickWidth,2):e.wickWidth,s=()=>{t.beginPath(),t.moveTo(e.x,e.highY),t.lineTo(e.x,e.lowY),t.strokeStyle=r,t.lineWidth=n,t.stroke()};if(a||s(),e.isRange){let l=e.dotRadius??Math.max(2,Math.min(e.bodyWidth/2,.12*i.height)),o=m(t,h(e.style?.fill)?e.style.fill:e.wickColor,e.wickColor);t.fillStyle=o,t.beginPath(),t.arc(e.x,e.highY,l,0,2*Math.PI),t.fill(),t.beginPath(),t.arc(e.x,e.lowY,l,0,2*Math.PI),t.fill()}else if(e.bodyWidth>0){let l=Math.min(e.openY,e.closeY),i=Math.abs(e.openY-e.closeY),o=e.isUp?e.upColor:e.downColor,r=m(t,h(e.style?.fill)?e.style.fill:o,o),a="string"==typeof r?r:c(t,e.wickColor)||e.wickColor;t.fillStyle=r,t.fillRect(e.x-e.bodyWidth/2,l,e.bodyWidth,Math.max(i,1)),t.strokeStyle=a,t.lineWidth=1,t.strokeRect(e.x-e.bodyWidth/2,l,e.bodyWidth,Math.max(i,1))}a&&s(),t.restore()}},u=r,p=(t,e,l,i)=>{o(t,e,l,i);let r=e.filter(t=>"rect"===t.type);if(2>r.length)return;let a=r[0].datum,n=a?._connectorStroke;if(n){t.save(),t.strokeStyle=c(t,n)||n,t.lineWidth=a?._connectorWidth??1,t.setLineDash([]);for(let e=0;r.length-1>e;e++){let i=r[e],o=r[e+1],a=i.datum,n=o.datum;if(null==a?.cumEnd||null==n?.baseline)continue;let s=l.y(a.cumEnd),h=i.x+i.w,f=o.x;t.beginPath(),t.moveTo(h,s),t.lineTo(f,s),t.stroke()}t.restore()}},x={chartType:"custom",buildScene:()=>[],canvasRenderers:[l,o,y,i,r,a,n,d,u,p]};export{y as heatmapCanvasRenderer,d as candlestickCanvasRenderer,u as swarmCanvasRenderer,p as waterfallCanvasRenderer,x as customXYPlugin};
|