semiotic 3.13.0 → 3.13.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 +53 -41
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/dist/mcp-server.js +132 -106
- package/ai/reference.md +12 -4
- package/ai/schema.json +16 -2
- 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-CRKR5M42.min.js → c-2M2OPWVA.min.js} +37 -37
- package/dist/c-3GIPT46Z.min.js +1 -0
- package/dist/c-3UXQGCQT.min.js +1 -0
- package/dist/{c-MHNU6KYQ.min.js → c-4P2EM44G.min.js} +3 -3
- package/dist/c-4RVDKSMQ.min.js +1 -0
- package/dist/{c-6MEEA5VY.min.js → c-4YPPVFZH.min.js} +1 -1
- package/dist/{c-6MPP6QF5.min.js → c-62JIVHK5.min.js} +1 -1
- package/dist/{c-KYRH3XKJ.min.js → c-6QCSRJSC.min.js} +1 -1
- package/dist/c-6WJKNYIG.min.js +1 -0
- package/dist/c-7BVQDXFU.min.js +1 -0
- package/dist/c-7UN2WUMI.min.js +1 -0
- package/dist/c-AQUX6L2O.min.js +1 -0
- package/dist/c-BR5QDUCR.min.js +1 -0
- package/dist/c-C3YQVUB6.min.js +1 -0
- package/dist/{c-RQ2XZHWY.min.js → c-COP4OISO.min.js} +1 -1
- package/dist/c-ENRZPF5E.min.js +1 -0
- package/dist/c-HBLICBM6.min.js +1 -0
- package/dist/{c-EQVM754Z.min.js → c-HGWITEJI.min.js} +1 -1
- package/dist/{c-3K2FJDLE.min.js → c-I54V24WG.min.js} +1 -1
- package/dist/c-IDCFMBA4.min.js +2 -0
- package/dist/{c-TPL7X32J.min.js → c-ISHYKYII.min.js} +1 -1
- package/dist/c-KSSS3HSA.min.js +1 -0
- package/dist/c-LEICSI5V.min.js +1 -0
- package/dist/c-LJ4XY3Z3.min.js +1 -0
- package/dist/c-MBE6PPHN.min.js +1 -0
- package/dist/c-MOK4RWNO.min.js +1 -0
- package/dist/c-N2TVSOYL.min.js +2 -0
- package/dist/{c-EAAKQIUZ.min.js → c-NHZ2E3CI.min.js} +1 -1
- package/dist/{c-MDY3ULP6.min.js → c-OBA7XSLH.min.js} +1 -1
- package/dist/c-OIJL2WZH.min.js +1 -0
- package/dist/c-ONOWKUUZ.min.js +1 -0
- package/dist/{c-CPJR4LHF.min.js → c-OSLNYZ3Q.min.js} +17 -17
- package/dist/c-PBFRYNKM.min.js +1 -0
- package/dist/c-QUAEYF34.min.js +1 -0
- package/dist/c-RDFFLRKC.min.js +1 -0
- package/dist/c-SDGGMIYI.min.js +1 -0
- package/dist/c-SQQZPFVY.min.js +1 -0
- package/dist/c-SU6Z75M2.min.js +1 -0
- package/dist/{c-BWM7MU2Y.min.js → c-SX4TPG3Z.min.js} +1 -1
- package/dist/{c-DTYG34WG.min.js → c-VGHU2LTF.min.js} +2 -2
- package/dist/c-VLWWXOM5.min.js +1 -0
- package/dist/c-VZNIIKL6.min.js +1 -0
- package/dist/{c-GBO32OML.min.js → c-W5ATXREF.min.js} +1 -1
- package/dist/c-WSWMQDFZ.min.js +1 -0
- package/dist/{c-3SDC7AQQ.min.js → c-XM76UG3P.min.js} +1 -1
- package/dist/c-XORVM6C5.min.js +1 -0
- package/dist/{c-MYRI7NF2.min.js → c-XZJWL7UL.min.js} +1 -1
- package/dist/c-Y43GTKGR.min.js +1 -0
- package/dist/c-YGTMWEEF.min.js +1 -0
- package/dist/c-ZFIURPZA.min.js +1 -0
- package/dist/c-ZWJDTDEV.min.js +1 -0
- package/dist/c-ZYMXDR42.min.js +1 -0
- package/dist/components/ai/chartClinic.d.ts +4 -0
- package/dist/components/ai/evaluateChart.d.ts +3 -1
- package/dist/components/ai/generativeChart.d.ts +13 -0
- package/dist/components/ai/renderEvidenceMemoKey.d.ts +9 -0
- package/dist/components/ai/reportRenderError.d.ts +2 -0
- package/dist/components/charts/physics/eventDropSources.d.ts +1 -1
- package/dist/components/evidence/claimReferences.d.ts +9 -0
- package/dist/components/realtime/BinAccumulator.d.ts +5 -0
- package/dist/components/recipes/atlas/dependencyEvidence.d.ts +5 -0
- package/dist/components/recipes/atlas/support.d.ts +5 -0
- package/dist/components/server/staticXYAxisTicks.d.ts +1 -1
- package/dist/components/stream/MarginalGraphics.d.ts +4 -2
- package/dist/components/stream/PipelineStore.d.ts +6 -18
- package/dist/components/stream/axisTickUtils.d.ts +1 -1
- package/dist/components/stream/countNoun.d.ts +2 -0
- package/dist/components/stream/heatmapBandTicks.d.ts +68 -0
- package/dist/components/stream/pipelineDomainResolution.d.ts +52 -3
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +8 -0
- package/dist/components/stream/uniqueRegionLabel.d.ts +6 -0
- package/dist/components/stream/xyAxisTicks.d.ts +8 -1
- package/dist/components/stream/xyFrameAxisTypes.d.ts +4 -2
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -0
- package/dist/geo.min.js +152 -152
- 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/physicsWorker.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/semiotic-access.module.min.js +2 -2
- package/dist/semiotic-ai-core.min.js +5 -5
- package/dist/semiotic-ai-core.module.min.js +4 -4
- package/dist/semiotic-ai.module.min.js +2 -2
- package/dist/semiotic-artifact.min.js +6 -6
- package/dist/semiotic-artifact.module.min.js +2 -2
- package/dist/semiotic-atlas-core.min.js +1 -1
- package/dist/semiotic-atlas-core.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1023 -1023
- package/dist/semiotic-evidence.min.js +4 -4
- package/dist/semiotic-evidence.module.min.js +3 -3
- 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 +101 -101
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +3 -3
- package/dist/semiotic-server-edge.min.js +397 -397
- package/dist/semiotic-server-edge.module.min.js +3 -3
- package/dist/semiotic-server-node.min.js +397 -397
- package/dist/semiotic-utils-core.min.js +11 -11
- package/dist/semiotic-utils-core.module.min.js +3 -3
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +397 -397
- package/dist/server.module.min.js +3 -3
- package/dist/xy.module.min.js +1 -1
- package/package.json +2 -2
- package/dist/c-3OBJLOXI.min.js +0 -1
- package/dist/c-4VFGNUWG.min.js +0 -1
- package/dist/c-5BN7GWJH.min.js +0 -1
- package/dist/c-65GMYND6.min.js +0 -1
- package/dist/c-AGRMJIUH.min.js +0 -1
- package/dist/c-BJKGYOPX.min.js +0 -1
- package/dist/c-C332PFY6.min.js +0 -1
- package/dist/c-DDZ5TZ7P.min.js +0 -1
- package/dist/c-F4DZ3NMI.min.js +0 -1
- package/dist/c-GZJ2XEQ5.min.js +0 -1
- package/dist/c-HFQ3Z65X.min.js +0 -1
- package/dist/c-HNW73MXJ.min.js +0 -1
- package/dist/c-HWFZB7SD.min.js +0 -1
- package/dist/c-IIV4DB7T.min.js +0 -1
- package/dist/c-J2QH3PEI.min.js +0 -1
- package/dist/c-JZNWRFVJ.min.js +0 -2
- package/dist/c-KHLBCSIO.min.js +0 -1
- package/dist/c-L7FQHKGH.min.js +0 -1
- package/dist/c-LYPOBMKC.min.js +0 -1
- package/dist/c-NGMMPKNJ.min.js +0 -1
- package/dist/c-NOME4L5M.min.js +0 -1
- package/dist/c-OKIJBK5K.min.js +0 -2
- package/dist/c-OXV4W7YX.min.js +0 -1
- package/dist/c-P73SQZEP.min.js +0 -1
- package/dist/c-PD5EZI24.min.js +0 -1
- package/dist/c-RAL7HCTV.min.js +0 -1
- package/dist/c-S4OGXAVO.min.js +0 -1
- package/dist/c-UWE3VZEO.min.js +0 -1
- package/dist/c-VP7WX6QI.min.js +0 -1
- package/dist/c-VW7ZSLDC.min.js +0 -1
- package/dist/c-WDVYLMCM.min.js +0 -1
- package/dist/c-XEACLH4B.min.js +0 -1
- package/dist/c-YJDGSPNB.min.js +0 -1
- package/dist/c-ZYBEKQCT.min.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t=new Map(e.nodes.map(e=>[e.id,[]])),n=new Map(e.nodes.map(e=>[e.id,[]]));for(let o of e.edges)t.get(o.source).push(o),n.get(o.target).push(o);return{outgoing:t,incoming:n}}function t(e,t){let n=new Set,o=[];for(let r of t){if(n.has(r))continue;n.add(r);let t=[{node:r,next:0}];for(;t.length;){let r=t[t.length-1],i=e[r.node][r.next++];void 0===i?(o.push(r.node),t.pop()):n.has(i)||(n.add(i),t.push({node:i,next:0}))}}return o}function n(e){let n=e.nodes.map(e=>e.id).sort(),o=new Map(n.map((e,t)=>[e,t])),r=n.map(()=>[]),i=n.map(()=>[]);for(let t of e.edges){let e=o.get(t.source),n=o.get(t.target);r[e].push(n),i[n].push(e)}let s=new Set,a=[];for(let e of t(r,n.map((e,t)=>t)).reverse()){if(s.has(e))continue;let t=[],o=[e];for(s.add(e);o.length;){let e=o.pop();t.push(n[e]);for(let t of i[e])s.has(t)||(s.add(t),o.push(t))}a.push(t.sort())}return a.sort((e,t)=>e[0].localeCompare(t[0]))}function o(t,n,o="rooted-traversal:id-asc"){let{outgoing:r}=e(t),i=o.endsWith("id-desc")?-1:1;for(let e of r.values())e.sort((e,t)=>i*e.id.localeCompare(t.id));let s=new Set(n),a=[],d=[...new Set(n)],c=e=>{let t=[{node:e,next:0}];for(;t.length;){let e=t[t.length-1],n=r.get(e.node)?.[e.next++];n?s.has(n.target)||(s.add(n.target),a.push([n.target,n.id]),t.push({node:n.target,next:0})):t.pop()}};for(let e of d)c(e);for(let e of t.nodes.map(e=>e.id).sort())s.has(e)||(d.push(e),s.add(e),c(e));let u=a.map(([,e])=>e),l=new Set(u);return{forest:{kind:"rooted-backbone",roots:d,rankingPolicyId:o,backboneEdgeIds:u,primaryParentEdgeIdByNode:Object.fromEntries(a)},residual:{originalEdgeIds:t.edges.map(e=>e.id),residualEdgeIds:t.edges.filter(e=>!l.has(e.id)).map(e=>e.id)}}}function r(e,t,n){if("ordinal"!==t.coordinate.kind)return!0;let o=e.nodes.find(e=>e.id===n);return!(!o?.sectionId||!t.coordinate.sectionIds.includes(o.sectionId))}function i(e,t){return[...e].sort((e,n)=>"id-asc"===t?e.id.localeCompare(n.id):n.id.localeCompare(e.id))}function s(e,t){let n=new Set(e.originalEdgeIds),o=new Set(t.backboneEdgeIds),r=new Set(e.residualEdgeIds);if(o.size!==t.backboneEdgeIds.length)throw new Error("duplicate backbone edge id");if(r.size!==e.residualEdgeIds.length)throw new Error("duplicate residual edge id");for(let e of o){if(r.has(e))throw new Error(`edge ${e} is both backbone and residual`);if(!n.has(e))throw new Error(`backbone edge ${e} is not original`)}for(let e of r)if(!n.has(e))throw new Error(`residual edge ${e} is not original`);if(o.size+r.size!==n.size)throw new Error("original edge IDs != backbone ⊎ residual")}function a(e,t){return e.sectionByNode.get(t)}function d(e,t){let n=new Set,o=[];for(let r of t){let t=a(e,r);!t||n.has(t)||(n.add(t),o.push(t))}return o}function c(e,t,n){return e.pairs.get(t)?.get(n)??[]}function u(e){return e.entityCount??1}function l(e,t){let n=[],o=0;for(let r of e)!r.nodePath.includes(t)||r.missingPrehistory||(n.push(r.entityId),o+=u(r));return{entityIds:n,entityCount:o}}function p(e,t,n,o,r,i){if(n.length<2)return;let{kept:s,truncation:a}=function(e,t){return null==t||e.length<=t?{kept:e}:{kept:e.slice(0,t),truncation:{disclosed:!0,omitted:e.length-t,fullCount:e.length}}}(n,i),u=[t,...s],p=[];for(let n of s){let o="fan-out"===e?c(r,t,n):c(r,n,t);p.push(...o)}let f=d(r,[t,...n]),g=l(o.occurrences??[],t);return{id:`${e}:${t}`,template:e,roles:"fan-out"===e?{source:t,destinations:s}:{destination:t,sources:s},nodePath:u,edgeIds:p,startSectionId:f[0],completionSectionId:f[f.length-1],intersectSectionIds:f,entityIds:g.entityIds,entityWeights:j(),entityCount:g.entityCount,flags:{occurrence:g.entityIds.length>0,temporal:!1,trajectorySupported:g.entityIds.length>0,enriched:!1},truncation:a}}function f(e,t,n){return 1===t.length&&1===n.length}function g(e){return e.entityCount??1}function m(e,t,n){let o=t??"";e.partitionCounts.set(o,(e.partitionCounts.get(o)??0)+n)}function h(e,n){let o=e.nodes.map(e=>e.id).sort(),r=new Map(o.map((e,t)=>[e,t])),i=o.length,s=Array.from({length:o.length+1},()=>[]),a=s.map(()=>[]),d=(e,t)=>{s[e].push(t),a[t].push(e)};for(let t of e.edges)d(r.get(t.source),r.get(t.target));for(let e of n.roots)d(i,r.get(e));let c=t(s,[i]).reverse(),u=new Map(c.map((e,t)=>[e,t])),l=new Map([[i,i]]),p=(e,t)=>{for(;e!==t;)u.get(e)>u.get(t)?e=l.get(e):t=l.get(t);return e},f=!0;for(;f;){f=!1;for(let e of c.slice(1)){let t=a[e].filter(e=>l.has(e)).reduce(p);l.get(e)!==t&&(l.set(e,t),f=!0)}}return{...n,roots:[...new Set(n.roots)].sort(),status:e.nodes.some(e=>e.completeness&&"known"!==e.completeness)?"incomplete":"exact",immediateDominatorByNode:Object.fromEntries(o.flatMap((e,t)=>l.has(t)?[[e,l.get(t)===i?null:o[l.get(t)]]]:[])),reachableNodeIds:o.filter((e,t)=>l.has(t)),unreachableNodeIds:o.filter((e,t)=>!l.has(t))}}function y(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof Date||e instanceof Map||e instanceof Set)}function I(e,t){return Array.isArray(t)?t.includes(e):"strings"===t?Array.isArray(e)&&Array.from(e).every(e=>"string"==typeof e):"object"===t?y(e):"count"===t||"budget"===t?"number"==typeof e&&Number.isFinite(e)&&e>=0&&("budget"!==t||Number.isSafeInteger(e)):typeof e===t}function b(e,t,n,o){e.push({kind:t,severity:"fatal",message:n,id:o})}function k(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function w(e,t){let n=function(e,t){let n=[],o=(e,t,o)=>{n.push({kind:e,severity:"fatal",message:`${t} must be ${o}`})},r=(e,t,n)=>{if(!y(e))return o(n,n,"an object"),!1;for(let[r,i]of Object.entries(t)){let t=r.endsWith("?"),s=t?r.slice(0,-1):r;t&&void 0===e[s]||I(e[s],i)||o(n,s,Array.isArray(i)?i.join(" or "):String(i))}return!0};if(!r(e,{relations:"object",coordinate:"object",forest:"object",measures:"object",motifs:"object",temporal:"object",dataRevision:"string",evidencePolicyId:"string"},"input-shape")||!r(t,{graphRef:"string",revision:"string"},"source-shape")||n.length)return n;let i=e,s=t,{coordinate:a,forest:d,measures:c,motifs:u,temporal:l}=i;"ordinal"===a.kind&&r(a,{sectionIds:"strings"},"coordinate"),r(d.display,{"roots?":"strings","rankingPolicyId?":"string","referencePartition?":"string"},"forest")&&"rooted-backbone"===d.display.kind&&(r(d.display,{roots:"strings"},"missing-root"),r(d.display,{rankingPolicyId:"string"},"forest")),void 0!==d.requiredPaths&&r(d.requiredPaths,{roots:"strings"},"required-path-roots"),void 0!==i.comparison&&r(i.comparison,{partitions:"strings",denominatorMeasureId:"string","referencePartition?":"string"},"comparison");for(let e of Object.values(c))r(e,{unitKind:["stock","rate","capacity"],countUnit:V,"timeDenominator?":"string","description?":"string"},"measures");r(u,{catalogId:"string",catalogVersion:"string",countUnit:V,anchor:["completion"],"denominatorRef?":"string","timeWindowMs?":"count","matchBudget?":"budget"},"motifs"),r(l,{kind:["snapshot","window"]},"temporal"),"window"===l.kind&&(!Number.isFinite(l.start)||!Number.isFinite(l.end)||l.end<l.start)&&o("temporal","window bounds","finite and ordered");for(let e of["nodes","edges","measureValues","occurrences"]){let t=s[e];if("occurrences"===e&&void 0===t)continue;if(!Array.isArray(t)){o("source-shape",e,"an array");continue}let n="nodes"===e?{id:"string","sectionId?":"string","completeness?":["known","unknown","incomplete","truncated","unsupported-template"]}:"edges"===e?{id:"string",source:"string",target:"string"}:"measureValues"===e?{measureId:"string",subjectId:"string",status:["exact","estimated","unknown","incomplete"]}:{id:"string",entityId:"string",complete:"boolean","missingPrehistory?":"boolean","entityCount?":"count","partition?":"string"};for(let i of t)r(i,n,"occurrences"===e?"occurrence":"source-shape")&&"occurrences"===e&&(r(i,{nodePath:"strings"},"occurrence-node"),void 0!==i.groupKeys&&(!y(i.groupKeys)||Object.values(i.groupKeys).some(e=>"string"!=typeof e))&&o("occurrence","groupKeys","a string map"))}return n}(e,t);if(n.length)return{ok:!1,issues:n};"0.2"!==e.schemaVersion&&b(n,"schema-version","expected schemaVersion 0.2"),(!0!==e.relations.directed||!0!==e.relations.edgeIdRequired||"keep-by-id"!==e.relations.parallelEdges||"keep-by-id"!==e.relations.selfLoops)&&b(n,"relations","Phase 1 requires directed edges, preserving parallel edges and self-loops by id"),"rooted-backbone"!==e.forest.display.kind&&"observed-prefix"!==e.forest.display.kind&&b(n,"forest","supported display kinds: rooted-backbone, observed-prefix"),"ordinal"!==e.coordinate.kind&&b(n,"coordinate","Phase 1 kernel uses ordinal sections");let o=j();for(let r of t.nodes)r.id?(o[r.id]&&b(n,"duplicate-node","duplicate node id",r.id),C(o,r.id,!0),"ordinal"===e.coordinate.kind&&r.sectionId&&!e.coordinate.sectionIds.includes(r.sectionId)&&b(n,"section-membership",`node section ${r.sectionId} is not in the coordinate`,r.id)):b(n,"node-id","node is missing id");let r=j();for(let e of t.edges)e.id?(r[e.id]&&b(n,"duplicate-edge","duplicate edge id",e.id),C(r,e.id,!0),o[e.source]||b(n,"dangling-source","edge source is not a node",e.id),o[e.target]||b(n,"dangling-target","edge target is not a node",e.id)):b(n,"edge-id","edge is missing id");for(let t of e.forest.display.roots??[])o[t]||b(n,"missing-root","display root is not a node",t);let i=e.forest.requiredPaths;if(i)if("directed-admitted"!==i.relationScopeId&&b(n,"required-path-scope","required paths use the full directed-admitted relation scope"),Array.isArray(i.roots)&&0!==i.roots.length)for(let e of i.roots)o[e]||b(n,"required-path-roots","required-path root is not a node",e);else b(n,"required-path-roots","required paths need declared roots");if("rooted-backbone"===e.forest.display.kind&&0===e.forest.display.roots.length&&b(n,"missing-root","rooted-backbone requires at least one root"),e.comparison&&(e.comparison.partitions.length<2&&b(n,"comparison","comparison requires at least two partitions"),S(e.measures,e.comparison.denominatorMeasureId)||b(n,"comparison-denominator","comparison denominatorMeasureId is not a declared measure")),k(e.measures))for(let[t,o]of Object.entries(e.measures))"rate"===o.unitKind&&!o.timeDenominator&&b(n,"rate-denominator","rate measures require a timeDenominator",t);else b(n,"measures","measures must be an object");let s=new Map;for(let o of t.measureValues){let t=s.get(o.measureId);t||(t=new Set,s.set(o.measureId,t)),t.has(o.subjectId)&&b(n,"duplicate-measure-value","measureValue must be unique per measureId and subjectId",o.subjectId),t.add(o.subjectId),S(e.measures,o.measureId)?Number.isFinite(o.value)||b(n,"non-finite-measure","measure value is not finite",o.measureId):b(n,"unknown-measure","measureValue refers to an undeclared measure",o.measureId)}let a=new Set;for(let e of t.occurrences??[])if(e.id&&e.entityId){a.has(e.id)&&b(n,"duplicate-occurrence","occurrence id must be unique",e.id),a.add(e.id),void 0!==e.stepEntityCounts&&(!Array.isArray(e.stepEntityCounts)||e.stepEntityCounts.length!==e.nodePath.length||Array.from(e.stepEntityCounts).some(e=>!Number.isFinite(e)||e<0))&&b(n,"occurrence-step-counts","stepEntityCounts must contain one finite, nonnegative count per nodePath step",e.id);for(let t of e.nodePath)o[t]||b(n,"occurrence-node","occurrence path references a missing node",e.id)}else b(n,"occurrence","occurrence needs id and entityId");return{ok:n.every(e=>"fatal"!==e.severity),issues:n}}function P(e,t,n){let o=k(n?.measures)?S(n.measures,e):void 0,r=k(n?.measures)?S(n.measures,t):void 0;if(!k(o)||!k(r))return{ok:!1,reason:"unknown-measure"};if(o.countUnit!==r.countUnit)return{ok:!1,reason:"count-unit-mismatch"};if("rate"===o.unitKind||"rate"===r.unitKind){if(o.unitKind!==r.unitKind)return{ok:!1,reason:"stock-or-capacity-cannot-compare-to-rate"};if(o.timeDenominator!==r.timeDenominator)return{ok:!1,reason:"rate-time-denominator-mismatch"}}return{ok:!0}}function v(e,t,n={}){let I=w(e,t);if(!I.ok)return{ok:!1,issues:I.issues};if(!y(n)||void 0!==n.generation&&(!Number.isSafeInteger(n.generation)||n.generation<0))return{ok:!1,issues:[{kind:"generation",severity:"fatal",message:"generation must be a nonnegative safe integer"}]};let b,k=n.generation??1;try{b=function(e,t,n){return JSON.stringify([n,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)}catch{return{ok:!1,issues:[{kind:"spec-serialization",severity:"fatal",message:"atlas spec must be serializable as JSON"}]}}let P=function(e,t){if("ordinal"!==e.coordinate.kind)return{kind:"ordinal",sectionIds:[],nodeIdsBySection:j()};let n=j();for(let t of e.coordinate.sectionIds)C(n,t,[]);for(let e of t.nodes){if(!e.sectionId)continue;let t=n[e.sectionId];t&&t.push(e.id)}return{kind:"ordinal",sectionIds:[...e.coordinate.sectionIds],nodeIdsBySection:n}}(e,t),v=function(e,t){let n=e.motifs.matchBudget,o=function(e){let t=new Map(e.nodes.map(e=>[e.id,new Set])),n=new Map(e.nodes.map(e=>[e.id,new Set])),o=new Map;for(let r of e.edges){t.get(r.target)?.add(r.source),n.get(r.source)?.add(r.target);let e=o.get(r.source);e||o.set(r.source,e=new Map);let i=e.get(r.target);i?i.push(r.id):e.set(r.target,[r.id])}return{incoming:new Map([...t].map(([e,t])=>[e,[...t]])),outgoing:new Map([...n].map(([e,t])=>[e,[...t]])),sectionByNode:new Map(e.nodes.map(e=>[e.id,e.sectionId])),pairs:o}}(t),r=[];for(let e of t.nodes){let i=p("fan-out",e.id,o.outgoing.get(e.id)??[],t,o,n);i&&r.push(i);let s=p("fan-in",e.id,o.incoming.get(e.id)??[],t,o,n);s&&r.push(s)}r.push(...function(e,t){let n=t.incoming,o=t.outgoing,r=[];for(let i of e.nodes){let s=n.get(i.id)??[],a=o.get(i.id)??[];if(1!==a.length)continue;let u=1===s.length&&f(s[0],n.get(s[0])??[],o.get(s[0])??[]);if(f(i.id,s,a)&&u)continue;let p=[i.id],g=i.id,m=new Set([g]);for(;;){let e=(o.get(g)??[])[0];if(!e||m.has(e)||(p.push(e),m.add(e),!f(0,n.get(e)??[],o.get(e)??[])))break;g=e}if(p.length<2)continue;let h=[];for(let e=0;e<p.length-1;e++)h.push(...c(t,p[e],p[e+1]));let y=d(t,p),I=l(e.occurrences??[],p[0]);r.push({id:`serial-chain:${p.join(">")}`,template:"serial-chain",roles:{nodes:p,start:p[0],end:p[p.length-1]},nodePath:p,edgeIds:h,startSectionId:y[0],completionSectionId:y[y.length-1],intersectSectionIds:y,entityIds:I.entityIds,entityWeights:j(),entityCount:I.entityCount,flags:{occurrence:I.entityIds.length>0,temporal:!1,trajectorySupported:I.entityIds.length>0,enriched:!1}})}return r}(t,o)),r.push(...function(e,t){let n=[];for(let o of e.occurrences??[]){if(o.missingPrehistory)continue;let e=new Map,r=new Set;for(let[i,s]of o.nodePath.entries()){let c=e.get(s);if(null==c){e.set(s,i);continue}if(r.has(s))continue;r.add(s);let l=o.nodePath.slice(c,i+1),p=d(t,l),f=j();C(f,o.entityId,u(o)),n.push({id:`repeated-state-episode:${o.id}:${s}`,template:"repeated-state-episode",roles:{state:s,occurrence:o.id},nodePath:l,edgeIds:[],startSectionId:a(t,l[0]),completionSectionId:a(t,l[l.length-1]),intersectSectionIds:p,entityIds:[o.entityId],entityWeights:f,entityCount:u(o),flags:{occurrence:!0,temporal:!1,trajectorySupported:!0,enriched:!1}})}}return n}(t,o)),function(e,t){let n=t.occurrences??[];if(0!==n.length)for(let t of e){if("repeated-state-episode"===t.template)continue;let e=t.nodePath,o=j();for(let t of n)t.missingPrehistory||!e.some(e=>t.nodePath.includes(e))||C(o,t.entityId,u(t));let r=Object.keys(o);t.entityIds=r,t.entityWeights=o,t.entityCount=r.reduce((e,t)=>e+(o[t]??0),0),t.flags={...t.flags,occurrence:r.length>0,trajectorySupported:r.length>0}}}(r,t);let i=[];for(let e of t.occurrences??[])e.missingPrehistory&&(i.push({template:"serial-chain",occurrenceId:e.id,reason:"missing-prehistory"}),i.push({template:"repeated-state-episode",occurrenceId:e.id,reason:"missing-prehistory"}));let s=N.filter(e=>!O.includes(e));return{catalogId:e.motifs.catalogId,catalogVersion:e.motifs.catalogVersion,matches:r,incompleteCandidates:i,unsupportedTemplates:s}}(e,t),S=function(e,t){if(e.forest.display.rankingPolicyId?.startsWith("rooted-traversal"))return o(t,e.forest.display.roots??[],e.forest.display.rankingPolicyId);let n=t.edges.map(e=>e.id),s=e.forest.display.rankingPolicyId??"main-transport",{mode:a,order:d}=function(e){let[t,n]=e.split(":");return{mode:"tree-only"===t?"tree-only":"main-transport",order:"id-desc"===n?"id-desc":"id-asc"}}(s),c=n=>r(t,e,n.source)&&r(t,e,n.target),u=new Map;for(let e of t.nodes)u.set(e.id,[]);for(let e of t.edges)u.has(e.target)||u.set(e.target,[]),u.get(e.target).push(e);let l,p=j(),f=e.forest.display.roots&&e.forest.display.roots.length>0?e.forest.display.roots:t.nodes[0]?[t.nodes[0].id]:[],g=new Set(f);for(let e of t.nodes){if(g.has(e.id))continue;let t=i(u.get(e.id)??[],d),n=t.find(e=>c(e))??t[0];n&&C(p,e.id,n.id)}l="tree-only"===a?Object.values(p):t.edges.filter(e=>c(e)).map(e=>e.id);let m=new Set(l),h=n.filter(e=>!m.has(e));return{forest:{kind:"rooted-backbone",roots:[...f],rankingPolicyId:s,backboneEdgeIds:l,primaryParentEdgeIdByNode:p},residual:{residualEdgeIds:h,originalEdgeIds:n}}}(e,t);s(S.residual,S.forest);let q=M(e,t,P),$=function(e,t){let n=j();for(let t of e.nodes)C(n,t.id,t.completeness??"known");let o=j();for(let e of t.unsupportedTemplates)C(o,e,"unsupported-template");if(t.incompleteCandidates.length>0){let e=new Set(t.incompleteCandidates.map(e=>e.template));for(let t of e)C(o,t,"incomplete")}let r=t.matches.find(e=>e.truncation),i={nodes:n,motifs:o,traces:e.occurrences?.some(e=>e.missingPrehistory||!1===e.complete)?"incomplete":e.nodes.some(e=>"unknown"===e.completeness)?"unknown":"known"};return r?.truncation&&(i.truncation={disclosed:!0,template:r.template,omitted:r.truncation.omitted}),i}(t,v),V=x(t),K="observed-prefix"===e.forest.display.kind||(t.occurrences?.length??0)>0?function(e,t={}){function n(e){let t=[...e.children.keys()];return t.sort((t,n)=>{let o=e.children.get(t),r=e.children.get(n),i=s?o.partitionCounts.get(s)??0:1;return i>0!=(s?r.partitionCounts.get(s)??0:1)>0?i>0?-1:1:t.localeCompare(n)}),t}let o={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),n=o;n.occurrenceIds.push(t.id),n.entityCount+=e,m(n,t.partition,e);for(let o of t.nodePath){let r=[...n.prefix,o],i=E(r,r.length-1),s=n.children.get(o);s||(s={id:i,stateId:o,prefix:r,children:new Map,occurrenceIds:[],entityCount:0,partitionCounts:new Map},n.children.set(o,s)),s.occurrenceIds.push(t.id),s.entityCount+=e,m(s,t.partition,e),n=s}}let r=[],i=[],s=t.referencePartition;return function e(t,o){if(t.id){let e=j();for(let[n,o]of t.partitionCounts)C(e,n,o);r.push({id:t.id,stateId:t.stateId,prefix:t.prefix,parentId:o,childIds:n(t).map(e=>t.children.get(e).id),entityCount:t.entityCount,occurrenceIds:[...t.occurrenceIds],partitionCounts:e}),i.push(t.id)}for(let o of n(t))e(t.children.get(o),t.id||null)}(o,null),{kind:"observed-prefix",rootIds:n(o).map(e=>o.children.get(e).id),nodes:r,order:i,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:b,spec:e,source:t,sections:P,motifs:v,forest:S.forest,residualEdges:S.residual,ports:V,ledger:q,completeness:$,provenance:{sourceRevision:t.revision,analysisRevision:b,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??S.forest.roots],rankingPolicyId:S.forest.rankingPolicyId,population:e.motifs.countUnit,temporalHorizon:e.temporal.kind,evidencePolicyId:e.evidencePolicyId},prefixForest:K,...e.forest.requiredPaths&&{requiredPaths:h(t,e.forest.requiredPaths)}};return R.comparison=A(R),{ok:!0,atlas:R,issues:I.issues}}import{b as S,c as C,d as j,e as E,f as M,h as A,l as x}from"./c-KSSS3HSA.min.js";var q="0.2",N=["serial-chain","repeated-state-episode","fan-out","fan-in","split-rejoin-diamond","shared-upstream-source","connector-bypass"],$=["serial-chain","fan-out","fan-in"],O=[...$,"repeated-state-episode"],V=["entity","occurrence","embedding","work-item"];export{q as a,N as b,$ as c,O as d,e,n as f,o as g,s as h,w as i,P as j,v as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){Y[e.chartType]=e}function t(e){return Y[e]}function r(e){return Y[e]?.buildScene}function o(e,t=!1){if(t){let e=Y.custom?.canvasRenderers;if(e&&e.length>0)return e;let t=new Set,r=[];for(let e of Object.values(Y))if(e)for(let o of e.canvasRenderers)t.has(o)||(t.add(o),r.push(o));return r}return Y[e]?.canvasRenderers??[]}function n(e){return Array.isArray(e)?{nodes:e,binBoundaries:[]}:{nodes:e.nodes,binBoundaries:e.binBoundaries}}function i(e,t,r,o){if(!e.config.pointStyle)return;let n=o??e.getY;for(let o of t){let t=e.resolveGroupColor(o.key);for(let i of o.data){let o=e.config.pointStyle(i);!o.fill&&t&&(o={...o,fill:t});let a=o.r??3,l=e.getPointId?String(e.getPointId(i)):void 0,s=h(i,e.scales,e.getX,n,a,o,l);s&&r.push(s)}}}function a(e){return"threshold"===e.type&&"string"==typeof e.color&&"number"==typeof e.value}function l(e){return m(e)}function s(e,t){if("domain"!==e.extent)return;let[r,o]=t.domain(),n=t(o),i=t(r);return Number.isFinite(n)&&Number.isFinite(i)?[n,i]:void 0}function f(e,t){let r=e.groupData(t),o=e.config.stackOrder??"key",n=()=>r.sort((e,t)=>e.key<t.key?-1:e.key>t.key?1:0);if("input"!==o)if("key"===o)n();else if("asc"===o||"desc"===o||"insideOut"===o){let t=new Map;for(let o of r){let r=0;for(let t of o.data){let o=e.getX(t),n=e.getY(t);Number.isFinite(o)&&Number.isFinite(n)&&(r+=n)}t.set(o.key,r)}let n=(e,t)=>e<t?-1:e>t?1:0;if("asc"===o)r.sort((e,r)=>{let o=(t.get(e.key)??0)-(t.get(r.key)??0);return 0!==o?o:n(e.key,r.key)});else if("desc"===o)r.sort((e,r)=>{let o=(t.get(r.key)??0)-(t.get(e.key)??0);return 0!==o?o:n(e.key,r.key)});else{let e=[...r].sort((e,r)=>{let o=(t.get(r.key)??0)-(t.get(e.key)??0);return 0!==o?o:n(e.key,r.key)}),o=[],i=[],a=0,l=0;for(let r of e)a<l?(o.push(r),a+=t.get(r.key)??0):(i.push(r),l+=t.get(r.key)??0);r.length=0,r.push(...i.reverse(),...o)}}else n();let a=e.config.curve&&"linear"!==e.config.curve?e.config.curve:void 0,l=e.config.normalize?"zero":e.config.baseline??"zero",{nodes:s,stackedTops:f}=b(r,e.scales,e.getX,e.getY,(t,r)=>e.resolveAreaStyle(t,r),e.config.normalize,a,l,e.getPointId),c=s;if(e.config.pointStyle){let t=new WeakMap;for(let o of r){let r=f.get(o.key);if(r)for(let n of o.data){let o=e.getX(n),i=e.getY(n);null!=o&&!Number.isNaN(o)&&null!=i&&!Number.isNaN(i)&&r.has(o)&&t.set(n,r.get(o))}}i(e,r,c,r=>t.get(r)??e.getY(r))}return c}function c(e,t,r="start"){let o="center"===r?t/2:0;return Math.floor((e+o)/t)*t-o}function u(e,t,r,o,n,i=!1,a="start"){let l=new Map;for(let s of e){let e=t(s),f=r(s);if(null==e||null==f||Number.isNaN(e)||Number.isNaN(f))continue;let u=c(e,o,a),g=l.get(u);if(g||(g={start:u,end:u+o,total:0,categories:new Map,...i?{rows:[],categoryRows:new Map}:{}},l.set(u,g)),g.total+=f,g.rows?.push(s),n){let e=n(s);if(g.categories.set(e,(g.categories.get(e)||0)+f),g.categoryRows){let t=g.categoryRows.get(e);t||(t=[],g.categoryRows.set(e,t)),t.push(s)}}}return l}function g(e,t,r,o,n,i="start"){let a=u(e,t,r,o,n,!1,i);if(0===a.size)return[0,0];let l=0,s=0;for(let e of a.values()){let t=0,r=0;if(n&&e.categories.size>0)for(let o of e.categories.values())o<0?t+=o:o>0&&(r+=o);else t=Math.min(0,e.total),r=Math.max(0,e.total);t<l&&(l=t),r>s&&(s=r)}return[l,s]}function d(e,t,r,o,n,i="start",a=[]){let l=u(e,t,r,o,n,!1,i),s=[];if(!n){for(let e of l.values())s.push(e.total);return s}let f=new Set;for(let e of l.values())for(let t of e.categories.keys())f.add(t);let c=new Set(a),g=[...a.filter(e=>f.has(e)),...Array.from(f).filter(e=>!c.has(e)).sort()];for(let e of l.values()){if(0===e.categories.size){s.push(e.total);continue}let t=0;for(let r of g){let o=e.categories.get(r);null==o||0===o||(t+=o,s.push(t))}}return s}import{a as y}from"./c-NHZ2E3CI.min.js";import{b as p}from"./c-4RVDKSMQ.min.js";import{e as h,a as v,i as m,b as k,d as b}from"./c-ZYMXDR42.min.js";import{b as S,c as N,d as G}from"./c-5XCN6BMT.min.js";import{a as w}from"./c-COP4OISO.min.js";import{e as M}from"./c-5PCO2P5Q.min.js";var Y=/*#__PURE__*/Object.create(null),R={chartType:"line",buildScene:(e,t)=>function(e,t){let r=e.groupData(t),o=[],n=e.config.annotations?.filter(a).map(e=>({value:e.value,color:e.color,thresholdType:e.thresholdType||"greater"}));if(e.ribbons&&e.ribbons.length>0){let{perSeries:n,aggregate:i}=S(e.ribbons);if(i.length>0&&o.push(...N(e,t,i)),n.length>0)for(let t of r)o.push(...G(e,t.data,t.key,n))}for(let t of r){let r=e.resolveLineStyle(t.key,M(t.data)),i=v(t.data,e.scales,e.getX,e.getY,r,t.key,e.getPointId);n&&n.length>0&&(i.colorThresholds=n),e.config.curve&&"linear"!==e.config.curve&&(i.curve=e.config.curve),e.config.lineGradient&&(i.strokeGradient=e.config.lineGradient),o.push(i)}return i(e,r,o),o}(e,t),canvasRenderers:[y,p,w]},T={chartType:"area",buildScene:(e,t)=>function(e,t){let r=e.groupData(t),o=[];if(e.ribbons&&e.ribbons.length>0){let{perSeries:n,aggregate:i}=S(e.ribbons);if(i.length>0&&o.push(...N(e,t,i)),n.length>0)for(let t of r)o.push(...G(e,t.data,t.key,n))}let n=e.scales.y.domain(),a=n[0],f=e.config.semanticLineStops?.filter(e=>Number.isFinite(e.offset)).map(e=>({value:n[0]+Math.max(0,Math.min(1,e.offset))*(n[1]-n[0]),color:e.color,opacity:e.opacity,thresholdType:"greater"})).sort((e,t)=>e.value-t.value),c=f&&f.length>0?(()=>{let t=f.reduce((e,t)=>(e.at(-1)?.value===t.value?e[e.length-1]=t:e.push(t),e),[]),r=[{from:n[0],to:t[0].value,color:t[0].color,opacity:t[0].opacity}];for(let e=0;e<t.length;e++)r.push({from:t[e].value,to:t[e+1]?.value??n[1],color:t[e].color,opacity:t[e].opacity});return r.map(({from:t,to:r,color:o,opacity:n})=>{let i=e.scales.y(t),a=e.scales.y(r);return{y:Math.min(i,a),height:Math.abs(a-i),color:o,...null!=n&&{opacity:n}}}).filter(e=>e.height>0)})():void 0,u=e.getY0?t=>e.getY0(t)??a:void 0;for(let t of r){let r=e.resolveAreaStyle(t.key,M(t.data)),n=k(t.data,e.scales,e.getX,e.getY,a,r,t.key,u,e.getPointId),i=l(e.config.gradientFill);if(i){n.fillGradient=i;let t=s(i,e.scales.y);t&&(n.fillGradientSpan=t)}e.config.curve&&"linear"!==e.config.curve&&(n.curve=e.config.curve),e.config.lineGradient&&(n.strokeGradient=e.config.lineGradient),f&&f.length>0&&(n.colorThresholds=f,n.strokeColorBands=c),o.push(n)}return i(e,r,o),o}(e,t),canvasRenderers:[y,w]},P={chartType:"mixed",buildScene:(e,t)=>function(e,t){let r=e.groupData(t),o=[],n=e.config.areaGroups||new Set;if(e.ribbons&&e.ribbons.length>0){let{perSeries:n,aggregate:i}=S(e.ribbons);if(i.length>0&&o.push(...N(e,t,i)),n.length>0)for(let t of r)o.push(...G(e,t.data,t.key,n))}let a=e.scales.y.domain()[0],f=e.getY0?t=>e.getY0(t)??a:void 0;for(let t of r)if(n.has(t.key)){let r=e.resolveAreaStyle(t.key,M(t.data)),n=k(t.data,e.scales,e.getX,e.getY,a,r,t.key,f,e.getPointId),i=l(e.config.gradientFill);if(i){n.fillGradient=i;let t=s(i,e.scales.y);t&&(n.fillGradientSpan=t)}e.config.curve&&"linear"!==e.config.curve&&(n.curve=e.config.curve),e.config.lineGradient&&(n.strokeGradient=e.config.lineGradient),o.push(n)}else{let r=e.resolveLineStyle(t.key,M(t.data)),n=v(t.data,e.scales,e.getX,e.getY,r,t.key,e.getPointId);e.config.curve&&"linear"!==e.config.curve&&(n.curve=e.config.curve),e.config.lineGradient&&(n.strokeGradient=e.config.lineGradient),o.push(n)}return i(e,r,o),o}(e,t),canvasRenderers:[y,p,w]};export{c as a,u as b,g as c,d,e,t as f,r as g,o as h,n as i,R as j,f as k,T as l,P as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,e=h){if(t)return!0===t?e:"stops"in t?Array.isArray(t.stops)?t:void 0:"colorStops"in t?Array.isArray(t.colorStops)?{stops:t.colorStops.map(({offset:t,color:e})=>({offset:t,color:e}))}:void 0:{stops:[{offset:0,opacity:t.topOpacity??e.stops[0]?.opacity??.8},{offset:1,opacity:t.bottomOpacity??e.stops.at(-1)?.opacity??.05}]}}function e(e){return e?t(e):void 0}function o(t){if(t)return Array.isArray(t)?{stops:t.map(({at:t,color:e,opacity:o})=>({offset:t/100,color:e,...null!=o&&{opacity:o}}))}:Array.isArray(t.stops)?t:void 0}function s(t){let e=t?.stops.filter(t=>"string"==typeof t.color&&Number.isFinite(t.offset)).map(({offset:t,color:e,opacity:o})=>({offset:Math.max(0,Math.min(1,t)),color:e,...Number.isFinite(o)&&{opacity:Math.max(0,Math.min(1,o))}})).sort((t,e)=>t.offset-e.offset);if(!e?.length)return;let o=e[0];return o.offset>0?[{...o,offset:0},...e]:e}function a(t){return{...t.extent&&{extent:t.extent},stops:t.stops.map(t=>({...t,offset:1-t.offset})).sort((t,e)=>t.offset-e.offset)}}function r(t){return{...a(t),extent:"domain"}}function i(t,e,o,s,a,r,i){let{topPath:l,rawValues:n,datum:f,pathIds:u}=c(t,e,o,s,void 0,i),p={type:"line",path:l,rawValues:n,style:a,datum:f,group:r};return u&&(p.pathIds=u),p}function l(t,e,o,s,a,r,i,l,n){return{type:"area",...c(t,e,o,s,l??(()=>a),n),style:r,group:i}}function n(t,e,o,s){let a=new Map;if("silhouette"===s)for(let s of t){let t=0;for(let a of e)t+=o(a,s)||0;a.set(s,-t/2)}else if("wiggle"===s){t.length>0&&a.set(t[0],0);for(let s=1;s<t.length;s++){let r=t[s-1],i=t[s],l=0,n=0,f=0;for(let t of e){let e=o(t,i)||0;l+=(2*f+e)*(e-(o(t,r)||0)),n+=e,f+=e}let u=a.get(r)??0,p=n>0?l/(2*n):0;a.set(i,u-p)}if(t.length>0){let s=0;for(let r of t){let t=0;for(let s of e)t+=o(s,r)||0;s+=(a.get(r)??0)+t/2}let r=s/t.length;for(let e of t)a.set(e,(a.get(e)??0)-r)}}else for(let e of t)a.set(e,0);return a}function f(t,e,o,s,a,r,i,l="zero",f){let u=new Set,p=new Map;for(let e of t){let t=new Map;for(let a of e.data){let e=o(a),r=s(a);if(!Number.isFinite(e)||(u.add(e),!Number.isFinite(r)))continue;let i=t.get(e);i?(i.value+=r,i.sources?i.sources.push(a):i.sources=[i.datum,a]):t.set(e,{value:r,datum:a})}p.set(e.key,t)}let m,y=Array.from(u).sort((t,e)=>t-e);if(r){m=new Map;for(let e of y){let o=0;for(let s of t)o+=p.get(s.key)?.get(e)?.value||0;m.set(e,o||1)}}let c=n(y,t.map(t=>t.key),(t,e)=>p.get(t)?.get(e)?.value||0,l),h="diverging"===l&&!r,d=[],v=new Map,b=new Map,w=new Map,x=new Map;for(let t of y)b.set(t,c.get(t)??0),w.set(t,0),x.set(t,0);for(let o of t){let t=p.get(o.key),s=new Map,l=[],n=[],u=[],c=[],F=[],M=f?[]:void 0,N=!1,k=()=>{if(0!==l.length){if(l.length>=2){let t=N?l.map((t,e)=>e).sort((t,e)=>l[t][0]-l[e][0]):void 0,e=t?t.map(t=>c[t]):c,s={type:"area",topPath:t?t.map(t=>l[t]):l,bottomPath:t?t.map(t=>n[t]):n,rawValues:t?t.map(t=>u[t]):u,style:a(o.key,g(o.data)),datum:e,accessibleDatum:t?t.map(t=>F[t]):F,group:o.key};M&&(s.pathIds=t?t.map(t=>M[t]):M),i&&(s.curve=i),d.push(s)}l=[],n=[],u=[],c=[],F=[],M=f?[]:void 0,N=!1}};for(let a of y){let i,f,p=t.get(a),y=void 0!==p,g=p?.value??0;if(r&&y&&(g/=m.get(a)),!y||!Number.isFinite(g)||0===g){k();continue}h?g>0?(i=w.get(a),f=i+g,w.set(a,f)):(i=x.get(a),f=i+g,x.set(a,f)):(i=b.get(a),f=i+g,b.set(a,f));let d=e.x(a),v=e.y(i),A=e.y(f);if(!Number.isFinite(d)||!Number.isFinite(v)||!Number.isFinite(A)){k();continue}let V=p.sources,_=p.value,I=V?{...V[0],__aggregateValue:_,__aggregateCount:V.length,__aggregateRows:V}:p.datum;l.length>0&&d<l[l.length-1][0]&&(N=!0),l.push([d,A]),n.push([d,v]),c.push(I),u.push(_),M&&M.push(`x:${a}`),F.push(V?{x:a,value:_,group:o.key,observations:V.length}:I),s.set(a,f)}k(),v.set(o.key,s)}return{nodes:d,stackedTops:v}}function u(t,e,o,s,a,r,i){let l=o(t),n=s(t);if(!Number.isFinite(l)||!Number.isFinite(n))return null;let f={type:"point",x:e.x(l),y:e.y(n),r:a,style:r,datum:t};return void 0!==i&&(f.pointId=i),f}function p(t,e,o,s,a,r,i,l){let n=o(t),f=s(t);if(!Number.isFinite(n)||!Number.isFinite(f))return null;let u={type:"symbol",x:e.x(n),y:e.y(f),size:a,symbolType:r,style:i,datum:t};return void 0!==l&&(u.pointId=l),u}function m(t,e,o,s,a,r,i){return{type:"rect",x:t,y:e,w:o,h:s,style:a,datum:r,group:i}}function y(t,e,o,s,a,r,i){let l={type:"heatcell",x:t,y:e,w:o,h:s,fill:a,datum:r};return void 0!==i?.value&&(l.value=i.value),i?.showValues&&(l.showValues=!0,i.valueFormat&&(l.valueFormat=i.valueFormat)),l}import{a as c}from"./c-5XCN6BMT.min.js";import{e as g}from"./c-5PCO2P5Q.min.js";var h={stops:[{offset:0,opacity:.8},{offset:1,opacity:.05}]};export{i as a,l as b,n as c,f as d,u as e,p as f,m as g,y as h,t as i,e as j,o as k,s as l,r as m};
|
|
@@ -40,6 +40,8 @@ export interface ChartClinicOptions {
|
|
|
40
40
|
* as a stable code rather than rethrowing arbitrary error text.
|
|
41
41
|
*/
|
|
42
42
|
readonly render?: RenderFn;
|
|
43
|
+
/** Observe the original renderer error locally without including it in this report. */
|
|
44
|
+
readonly onRenderError?: (error: unknown) => void;
|
|
43
45
|
}
|
|
44
46
|
export interface ChartClinicSceneSummary {
|
|
45
47
|
readonly status: RenderEvidence["status"];
|
|
@@ -82,6 +84,8 @@ export interface ChartClinicReport {
|
|
|
82
84
|
readonly bundle: ChartClinicBundleGuidance;
|
|
83
85
|
/** Stable reasons; arbitrary renderer exception messages are never copied here. */
|
|
84
86
|
readonly reasons: readonly string[];
|
|
87
|
+
/** Nonblocking renderer warning codes, retained on successful inspections. */
|
|
88
|
+
readonly warnings?: readonly string[];
|
|
85
89
|
readonly ok: boolean;
|
|
86
90
|
}
|
|
87
91
|
/**
|
|
@@ -13,7 +13,7 @@ import type { ValidationResult } from "../charts/shared/validateProps";
|
|
|
13
13
|
import { type AuditDataOptions, type DataAuditResult } from "../data/auditData";
|
|
14
14
|
import type { RenderEvidence } from "../server/renderEvidence";
|
|
15
15
|
import type { RenderFn } from "./generativeChart";
|
|
16
|
-
export type EvaluateChartStage = "data" | "deception" | "accessibility" | "render";
|
|
16
|
+
export type EvaluateChartStage = "validation" | "data" | "deception" | "accessibility" | "render";
|
|
17
17
|
export type EvaluateChartSeverity = "error" | "warning" | "manual";
|
|
18
18
|
export interface EvaluateChartFinding {
|
|
19
19
|
readonly id: string;
|
|
@@ -46,6 +46,8 @@ export interface EvaluateChartOptions extends AuditAccessibilityOptions {
|
|
|
46
46
|
readonly dataAudit?: AuditDataOptions;
|
|
47
47
|
/** Optionally prove the configuration against a server or custom renderer. */
|
|
48
48
|
readonly render?: RenderFn;
|
|
49
|
+
/** Observe the original renderer error locally without including it in findings. */
|
|
50
|
+
readonly onRenderError?: (error: unknown) => void;
|
|
49
51
|
/** Maximum number of findings shown in the notification feed. */
|
|
50
52
|
readonly notificationMax?: number;
|
|
51
53
|
}
|
|
@@ -42,6 +42,15 @@ export interface RenderEvidenceMemo {
|
|
|
42
42
|
/** Invalidate every cached result after mutable data or external state changes. */
|
|
43
43
|
clear: () => void;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Memoize SVG and evidence within each primary input identity (`data`, `nodes`,
|
|
47
|
+
* or `edges`). Plain data and configuration values are compared structurally,
|
|
48
|
+
* including in-place edits, key order and enumerability; callbacks use identity.
|
|
49
|
+
* Each input and the scalar value cache retain at most 64 configurations in
|
|
50
|
+
* least-recently-used order.
|
|
51
|
+
* Oversized, cyclic or unsupported values render without caching. Call
|
|
52
|
+
* `clear()` when callback closures or other external renderer state changes.
|
|
53
|
+
*/
|
|
45
54
|
export declare function createRenderEvidenceMemo(render: RenderFn): RenderEvidenceMemo;
|
|
46
55
|
export interface PrepareChartInput {
|
|
47
56
|
/** Chart component name the model proposed (e.g. "LineChart"). */
|
|
@@ -76,6 +85,8 @@ export interface PrepareChartOptions {
|
|
|
76
85
|
* and `ok` is decided on validation + diagnostics alone.
|
|
77
86
|
*/
|
|
78
87
|
render?: RenderFn;
|
|
88
|
+
/** Observe the original renderer error locally; it is never copied into the report. */
|
|
89
|
+
onRenderError?: (error: unknown) => void;
|
|
79
90
|
/**
|
|
80
91
|
* Treat error-severity diagnostics as blocking `ok` (default true). Set false
|
|
81
92
|
* to let a caller surface warnings without failing the gate.
|
|
@@ -108,6 +119,8 @@ export interface PrepareChartResult {
|
|
|
108
119
|
svg?: string;
|
|
109
120
|
/** Human-readable reasons the proposal is not `ok` (empty when `ok`). */
|
|
110
121
|
reasons: string[];
|
|
122
|
+
/** Nonblocking renderer warning codes, retained even when `ok` is true. */
|
|
123
|
+
warnings?: readonly string[];
|
|
111
124
|
}
|
|
112
125
|
/** Re-run only the inexpensive configuration diagnosis after props change. */
|
|
113
126
|
export declare function refreshChartDiagnostics(component: string, props: Datum): Diagnosis[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural keys for ordinary chart data and props. Unsupported values,
|
|
3
|
+
* accessors, cycles and oversized inputs bypass memoization rather than risk
|
|
4
|
+
* stale evidence or unbounded serialization work. Enumeration order and
|
|
5
|
+
* enumerability are significant; functions retain identity.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderEvidenceMemoKey(component: string, props: Record<string, unknown>, functionIds: WeakMap<object, number>, nextFunctionId: {
|
|
8
|
+
value: number;
|
|
9
|
+
}): string | undefined;
|
|
@@ -14,7 +14,7 @@ export interface EventDropSource {
|
|
|
14
14
|
description?: string;
|
|
15
15
|
}
|
|
16
16
|
export interface EventDropSourceRail {
|
|
17
|
-
side?: "left" | "top" | "none";
|
|
17
|
+
side?: "left" | "right" | "top" | "none";
|
|
18
18
|
tileSize?: number;
|
|
19
19
|
}
|
|
20
20
|
export declare function eventDropSourceStyle(sources: readonly EventDropSource[] | undefined, source: unknown): Style;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChartEvidenceEnvelope } from "./chartEvidenceEnvelope";
|
|
2
|
+
/** Validate fields whose types are needed to resolve support, before the gate runs. */
|
|
3
|
+
export declare function validateClaimReferences(envelope: ChartEvidenceEnvelope): void;
|
|
4
|
+
/** Resolve declared references only; arbitrary object paths are not evidence ids. */
|
|
5
|
+
export declare function claimReferenceIssues(envelope: ChartEvidenceEnvelope): Array<{
|
|
6
|
+
id: string;
|
|
7
|
+
claim: string;
|
|
8
|
+
message: string;
|
|
9
|
+
}>;
|
|
@@ -14,3 +14,8 @@ export interface Bin {
|
|
|
14
14
|
}
|
|
15
15
|
export declare function computeBins(data: Iterable<Datum>, getTime: (d: Datum) => number, getValue: (d: Datum) => number, binSize: number, getCategory?: (d: Datum) => string, trackRows?: boolean, binAlign?: BinAlign): Map<number, Bin>;
|
|
16
16
|
export declare function computeBinExtent(data: Iterable<Datum>, getTime: (d: Datum) => number, getValue: (d: Datum) => number, binSize: number, getCategory?: (d: Datum) => string, binAlign?: BinAlign): [number, number];
|
|
17
|
+
/**
|
|
18
|
+
* Y coordinates a bar scene passes to the scale: unstacked bin totals, or
|
|
19
|
+
* category stack boundaries in the same order as the scene.
|
|
20
|
+
*/
|
|
21
|
+
export declare function barPlottedYValues(data: Iterable<Datum>, getTime: (d: Datum) => number, getValue: (d: Datum) => number, binSize: number, getCategory?: (d: Datum) => string, binAlign?: BinAlign, colorKeys?: string[]): number[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AtlasEdge, PreparedNetworkAtlas } from "./types";
|
|
2
|
+
/** Relations on admitted root-to-target walks, including alternatives and cycles. */
|
|
3
|
+
export declare function targetRelations(atlas: PreparedNetworkAtlas, target: string): AtlasEdge[];
|
|
4
|
+
/** Original root-reachable relations removed by excluding the selected nodes. */
|
|
5
|
+
export declare function removalReferences(atlas: PreparedNetworkAtlas, avoiding: ReadonlySet<string>, relations?: readonly AtlasEdge[]): string[];
|
|
@@ -4,4 +4,9 @@ export declare function containsRoute(path: readonly string[], route: readonly s
|
|
|
4
4
|
export declare function buildRouteSupportIndex(source: NetworkAtlasSource): RouteSupportIndex;
|
|
5
5
|
export declare function graphWalkExists(source: NetworkAtlasSource, route: readonly string[]): boolean;
|
|
6
6
|
export declare function isSupportedRoute(source: NetworkAtlasSource, route: readonly string[]): boolean;
|
|
7
|
+
export declare function supportedRouteOccurrences(source: NetworkAtlasSource, route: readonly string[]): Generator<import("./types").AtlasOccurrence, void, unknown>;
|
|
8
|
+
export declare function supportedNextHops(source: NetworkAtlasSource, fromNode: string, viaNode?: string): Generator<{
|
|
9
|
+
nodeId: string;
|
|
10
|
+
occurrenceId: string;
|
|
11
|
+
}, void, unknown>;
|
|
7
12
|
export declare function nextSupportedNodes(source: NetworkAtlasSource, fromNode: string, viaNode?: string): string[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { XYFrameAxisConfig } from "../stream/xyFrameAxisTypes";
|
|
2
|
-
import type
|
|
2
|
+
import { type AxisTick } from "../stream/xyAxisTicks";
|
|
3
3
|
export declare function isStaticAxisLandmark(landmarkTicks: XYFrameAxisConfig["landmarkTicks"], tick: AxisTick, index: number, ticks: AxisTick[]): boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { ScaleLinear } from "d3-scale";
|
|
3
2
|
import type { MarginalConfig } from "./types";
|
|
4
3
|
import { normalizeMarginalConfig } from "./marginalConfig";
|
|
5
4
|
export { normalizeMarginalConfig };
|
|
@@ -10,7 +9,10 @@ export interface MarginalGraphicsProps {
|
|
|
10
9
|
/** Raw numeric values along the relevant axis */
|
|
11
10
|
values: number[];
|
|
12
11
|
/** The chart's scale for the axis this marginal summarizes */
|
|
13
|
-
scale:
|
|
12
|
+
scale: {
|
|
13
|
+
(value: number): number;
|
|
14
|
+
domain(): Array<number | Date>;
|
|
15
|
+
};
|
|
14
16
|
/** Available pixel space in the margin (perpendicular to axis) */
|
|
15
17
|
size: number;
|
|
16
18
|
/** Chart width (top/bottom) or height (left/right) */
|
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
import type { Datum } from "../charts/shared/datumTypes";
|
|
2
|
-
/**
|
|
3
|
-
* PipelineStore — stateful pipeline for XY/streaming chart data.
|
|
4
|
-
*
|
|
5
|
-
* Owns: data ingestion (RingBuffer), extent tracking, scale computation,
|
|
6
|
-
* scene layout delegation (via xySceneBuilders/), transition animation,
|
|
7
|
-
* decay/pulse/staleness encoding, and quadtree spatial indexing.
|
|
8
|
-
*
|
|
9
|
-
* Scene building was extracted to xySceneBuilders/ — this store constructs
|
|
10
|
-
* an XYSceneContext and dispatches to the appropriate builder function.
|
|
11
|
-
*
|
|
12
|
-
* Key dependencies:
|
|
13
|
-
* xySceneBuilders/ — per-chartType scene layout (line, area, point, etc.)
|
|
14
|
-
* SceneGraph — node constructors (buildLineNode, buildPointNode, etc.)
|
|
15
|
-
* RingBuffer — sliding window data storage
|
|
16
|
-
* IncrementalExtent — O(1) min/max tracking
|
|
17
|
-
*
|
|
18
|
-
* Consumed by: StreamXYFrame (sole consumer).
|
|
19
|
-
*/
|
|
20
2
|
import { RingBuffer } from "../realtime/RingBuffer";
|
|
21
3
|
import type { Changeset, StreamScales, StreamLayout, SceneNode } from "./types";
|
|
22
4
|
import { type ActiveTransition } from "./pipelineTransitionUtils";
|
|
@@ -128,6 +110,8 @@ export declare class PipelineStore extends UpdateResultStoreBase {
|
|
|
128
110
|
/** True when the effective x accessor returns Date objects or date strings. */
|
|
129
111
|
xIsDate: boolean;
|
|
130
112
|
private xTypeDetected;
|
|
113
|
+
private _warnedNonPositiveLogX;
|
|
114
|
+
private _warnedNonPositiveLogY;
|
|
131
115
|
private spatialIndex;
|
|
132
116
|
constructor(config: PipelineConfig);
|
|
133
117
|
/** Resolve and detect with the same accessor in bounded, push, and reconfigured charts. */
|
|
@@ -256,6 +240,10 @@ export declare class PipelineStore extends UpdateResultStoreBase {
|
|
|
256
240
|
x: [number, number];
|
|
257
241
|
y: [number, number];
|
|
258
242
|
} | null;
|
|
243
|
+
private positiveAxisSamples;
|
|
244
|
+
/** Y values the scene actually passes to the scale, when those are not raw rows. */
|
|
245
|
+
private plottedAggregateY;
|
|
246
|
+
private warnDroppedLogSamples;
|
|
259
247
|
clear(): void;
|
|
260
248
|
get size(): number;
|
|
261
249
|
getBuffer(): RingBuffer<Datum>;
|
|
@@ -12,7 +12,7 @@ export declare function axisTickCount(axis: {
|
|
|
12
12
|
export declare function hasSameTickLabel(a: string | ReactNode, b: string | ReactNode): boolean;
|
|
13
13
|
/** Greedily filter ticks so consecutive labels are at least `minPx` apart. */
|
|
14
14
|
export declare function filterTicksByPixelDistance<T extends {
|
|
15
|
-
value: number | Date;
|
|
15
|
+
value: number | Date | string;
|
|
16
16
|
pixel: number;
|
|
17
17
|
label: string | ReactNode;
|
|
18
18
|
}>(ticks: T[], minPx: number): T[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type ScaleLinear } from "d3-scale";
|
|
2
|
+
export declare const HEATMAP_BAND_TICKS: unique symbol;
|
|
3
|
+
export type HeatmapBandTick = {
|
|
4
|
+
value: number;
|
|
5
|
+
label: string | number | Date;
|
|
6
|
+
};
|
|
7
|
+
/** Integer tick positions for a static heatmap axis, or null for a linear scale. */
|
|
8
|
+
export declare function heatmapBandTicks(scale: object | null | undefined): HeatmapBandTick[] | null;
|
|
9
|
+
/**
|
|
10
|
+
* Keep the tick list on scale copies. A resize copies the scale and changes
|
|
11
|
+
* its range; a second resize copies that copy. The symbol is not enumerable,
|
|
12
|
+
* so d3's copy does not carry it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function attachHeatmapBandTicks<Scale extends object>(scale: Scale, ticks: HeatmapBandTick[]): Scale;
|
|
15
|
+
/**
|
|
16
|
+
* Index scale whose `scale(i)` is the center of column or row `i`.
|
|
17
|
+
* Domain `[-0.5, n - 0.5]` keeps the existing cell geometry: index 0 is
|
|
18
|
+
* centered in the first cell, and the last index is centered in the last.
|
|
19
|
+
*/
|
|
20
|
+
export declare function heatmapBandScale(labels: Array<string | number | Date>, range: [number, number], domain?: [number, number]): ScaleLinear<number, number>;
|
|
21
|
+
/**
|
|
22
|
+
* Index-space domain for a static heatmap. Explicit data bounds become band
|
|
23
|
+
* coordinates so the cells and the axis share them. An omitted side stays on
|
|
24
|
+
* the automatic cell edge. Categorical keys have no numeric position, so the
|
|
25
|
+
* extent is left alone.
|
|
26
|
+
*/
|
|
27
|
+
export declare function heatmapBandDomain(labels: ReadonlyArray<string | number | Date>, extent?: readonly (number | undefined)[]): [number, number];
|
|
28
|
+
/** Cell index for a data key, or null when the key is not a column or row. */
|
|
29
|
+
export declare function heatmapBandIndex(ticks: HeatmapBandTick[], value: unknown): number | null;
|
|
30
|
+
/**
|
|
31
|
+
* Project a data key through a static heatmap band scale.
|
|
32
|
+
* Linear and time scales keep their existing value mapping.
|
|
33
|
+
*/
|
|
34
|
+
export declare function projectHeatmapBandValue(scale: ((value: number) => number) | null | undefined, value: unknown): number | null;
|
|
35
|
+
type BandScale = ((value: number) => number) & {
|
|
36
|
+
domain?: () => unknown[];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Project one band edge. An omitted bound is the plot edge (`scale` of the
|
|
40
|
+
* domain endpoint). An explicit key goes through the cell index. A missing
|
|
41
|
+
* key is null — it is not a pixel.
|
|
42
|
+
*/
|
|
43
|
+
export declare function projectHeatmapBandBound(scale: BandScale | null | undefined, explicit: unknown, endpoint: 0 | 1): number | null;
|
|
44
|
+
/** Map a data value, including one that falls between keys, back to a pixel. */
|
|
45
|
+
export declare function projectHeatmapBandDataValue(scale: ((value: number) => number) | null | undefined, value: number | Date): number | null;
|
|
46
|
+
/**
|
|
47
|
+
* Project a fitted coordinate. Numeric and date bands interpolate between
|
|
48
|
+
* keys. A categorical anchor stays an exact lookup.
|
|
49
|
+
*/
|
|
50
|
+
export declare function projectHeatmapBandComputedValue(scale: ((value: number) => number) | null | undefined, value: unknown): number | null;
|
|
51
|
+
/**
|
|
52
|
+
* Scale adapter for marginal binning. A band scale's domain is cell indexes,
|
|
53
|
+
* so a histogram of the raw keys would see an empty domain. This adapter's
|
|
54
|
+
* domain is the data extent of that index domain, including a cropped
|
|
55
|
+
* heatmap extent, and calls project through the keys.
|
|
56
|
+
*/
|
|
57
|
+
export declare function heatmapDataScale<Scale extends (value: number) => number>(scale: Scale): Scale;
|
|
58
|
+
type InvertibleScale = {
|
|
59
|
+
(value: number): number;
|
|
60
|
+
invert: (pixel: number) => number;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Invert a pixel to the brush's data coordinate.
|
|
64
|
+
* Numeric and date bands interpolate between adjacent keys.
|
|
65
|
+
* A categorical band has no numeric range, so the cell index is returned.
|
|
66
|
+
*/
|
|
67
|
+
export declare function invertHeatmapBandValue(scale: InvertibleScale, pixel: number): number;
|
|
68
|
+
export {};
|
|
@@ -12,6 +12,8 @@ import type { RingBuffer } from "../realtime/RingBuffer";
|
|
|
12
12
|
export type StackExtentCache = {
|
|
13
13
|
key: string;
|
|
14
14
|
yDomain: [number, number];
|
|
15
|
+
/** Stack boundaries the scene passes to the y scale. */
|
|
16
|
+
plottedY?: number[];
|
|
15
17
|
};
|
|
16
18
|
export declare function getTimeAxis(_arrowOfTime: ArrowOfTime): "x";
|
|
17
19
|
export declare function mergePartialDomain(dataDomain: [number, number], userExtent: [number | undefined, number | undefined] | [number] | undefined): [number, number];
|
|
@@ -21,7 +23,7 @@ export declare function isFullySpecifiedExtent(extent: [number | undefined, numb
|
|
|
21
23
|
* normalized). Mirrors buildStackedAreaNodes order for wiggle offsets.
|
|
22
24
|
*/
|
|
23
25
|
export declare function resolveStackedAreaYDomain(options: {
|
|
24
|
-
config: Pick<PipelineConfig, "normalize" | "baseline" | "stackOrder" | "extentPadding" | "axisExtent" | "yAxisExtent">;
|
|
26
|
+
config: Pick<PipelineConfig, "normalize" | "baseline" | "stackOrder" | "extentPadding" | "axisExtent" | "yAxisExtent" | "yScaleType">;
|
|
25
27
|
groups: {
|
|
26
28
|
key: string;
|
|
27
29
|
data: Datum[];
|
|
@@ -38,7 +40,12 @@ export declare function resolveStackedAreaYDomain(options: {
|
|
|
38
40
|
export declare function resolveBarBinYDomain(buffer: RingBuffer<Datum>, getX: (d: Datum) => number, getY: (d: Datum) => number, binSize: number, getCategory: ((d: Datum) => string) | undefined, extentPadding: number, exactMode: boolean, binAlign?: BinAlign): [number, number];
|
|
39
41
|
/** Cover whole centered edge bins automatically, preserving explicit bounds. */
|
|
40
42
|
export declare function resolveCenteredBinXDomain(dataDomain: [number, number], binSize: number, userExtent: PipelineConfig["xExtent"]): [number, number];
|
|
41
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Cumulative ends of the bars `buildWaterfallScene` draws. A missing or
|
|
45
|
+
* non-finite x is not a bar, so that row must not move the cursor.
|
|
46
|
+
*/
|
|
47
|
+
export declare function waterfallCumulativeEnds(data: Iterable<Datum>, getX: (d: Datum) => number, getY: (d: Datum) => number): number[];
|
|
48
|
+
export declare function resolveWaterfallYDomain(buffer: RingBuffer<Datum>, getX: (d: Datum) => number, getY: (d: Datum) => number, extentPadding: number, exactMode: boolean): [number, number];
|
|
42
49
|
/**
|
|
43
50
|
* Waterfall x values identify bar centers, so the automatic domain needs half
|
|
44
51
|
* of the neighboring interval beyond each edge datum. User-specified bounds
|
|
@@ -55,10 +62,52 @@ export declare function padYDomain(yDomain: [number, number], options: {
|
|
|
55
62
|
dataYDomain: [number, number];
|
|
56
63
|
}): [number, number];
|
|
57
64
|
export declare function reapplyPartialYExtent(yDomain: [number, number], yExtent: PipelineConfig["yExtent"], yFullySpecified: boolean): [number, number];
|
|
58
|
-
export declare function rescueDegenerateDomains(xDomain: [number, number], yDomain: [number, number], xScaleType?: PipelineConfig["xScaleType"]
|
|
65
|
+
export declare function rescueDegenerateDomains(xDomain: [number, number], yDomain: [number, number], xScaleType?: PipelineConfig["xScaleType"], extents?: {
|
|
66
|
+
x?: readonly (number | undefined)[];
|
|
67
|
+
y?: readonly (number | undefined)[];
|
|
68
|
+
yScaleType?: PipelineConfig["yScaleType"];
|
|
69
|
+
}): {
|
|
59
70
|
xDomain: [number, number];
|
|
60
71
|
yDomain: [number, number];
|
|
61
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Log scales cannot plot non-positive bounds. Keep an already-positive
|
|
75
|
+
* domain, including a flipped one. With no positive sample, keep an explicit
|
|
76
|
+
* positive end and open one decade from it. Use [1, 10] only when neither
|
|
77
|
+
* end is an explicit positive bound, even if padding left a positive end.
|
|
78
|
+
* Otherwise replace each non-positive end with the smallest or largest
|
|
79
|
+
* positive sample. A sample past an explicit positive end must not replace
|
|
80
|
+
* that end; open one decade from it instead. Computed ends, such as a
|
|
81
|
+
* normalized unit domain, still expand.
|
|
82
|
+
*/
|
|
83
|
+
export declare function clampLogDomain(domain: [number, number], positive: {
|
|
84
|
+
min: number;
|
|
85
|
+
max: number;
|
|
86
|
+
} | null, explicit?: readonly (number | undefined)[]): [number, number];
|
|
87
|
+
/**
|
|
88
|
+
* Y channels a non-aggregate scene paints. Mirrors PipelineStore's y-extent
|
|
89
|
+
* walk: candle high/low, open/close when the body is drawn, an explicit area
|
|
90
|
+
* baseline, and ribbon endpoints. Sampling only `getY` drops a valid low onto
|
|
91
|
+
* the same pixel as a larger high. Range candles have no separate body.
|
|
92
|
+
*/
|
|
93
|
+
export declare function collectPlottedYChannels(input: {
|
|
94
|
+
chartType: string;
|
|
95
|
+
data: Iterable<Datum>;
|
|
96
|
+
getY: (datum: Datum) => number;
|
|
97
|
+
getY0?: (datum: Datum) => number;
|
|
98
|
+
getHigh?: (datum: Datum) => number;
|
|
99
|
+
getLow?: (datum: Datum) => number;
|
|
100
|
+
getOpen?: (datum: Datum) => number;
|
|
101
|
+
getClose?: (datum: Datum) => number;
|
|
102
|
+
ribbons: readonly ResolvedRibbon[];
|
|
103
|
+
}): number[];
|
|
104
|
+
export declare function collectPositiveSamples(values: Iterable<number>): {
|
|
105
|
+
positive: {
|
|
106
|
+
min: number;
|
|
107
|
+
max: number;
|
|
108
|
+
} | null;
|
|
109
|
+
droppedNonPositive: boolean;
|
|
110
|
+
};
|
|
62
111
|
export declare function makePipelineScale(type: "linear" | "log" | "symlog" | "time" | "utc" | undefined, domain: [number, number], range: [number, number]): ScaleLinear<number, number>;
|
|
63
112
|
export declare function buildPipelineScales(options: {
|
|
64
113
|
config: PipelineConfig;
|
|
@@ -9,10 +9,18 @@ import type { CurveFactory } from "d3-shape";
|
|
|
9
9
|
* "use linear fallback" sentinel instead of a separate has-curve check.
|
|
10
10
|
*/
|
|
11
11
|
export declare function resolveCurveFactory(curve: CurveType | undefined): CurveFactory | null;
|
|
12
|
+
/**
|
|
13
|
+
* SVG's `none` is not a canvas color. Assigning it is ignored, so the
|
|
14
|
+
* context keeps the default black and the following fill or stroke paints
|
|
15
|
+
* a black mark. Transparent is the canvas paint that matches SVG.
|
|
16
|
+
*/
|
|
17
|
+
export declare const CANVAS_NONE_PAINT = "rgba(0,0,0,0)";
|
|
18
|
+
export declare function isNoneCanvasPaint(paint: unknown): boolean;
|
|
12
19
|
/**
|
|
13
20
|
* Resolve a node's `style.fill` (or `style.stroke`) to something the
|
|
14
21
|
* canvas can accept as `fillStyle` / `strokeStyle`:
|
|
15
22
|
*
|
|
23
|
+
* - `"none"` becomes transparent so it cannot fall through to black.
|
|
16
24
|
* - Strings go through `resolveCSSColor` so `var(...)` references
|
|
17
25
|
* resolve via the canvas DOM ancestor's computed style.
|
|
18
26
|
* - `CanvasPattern` values pass through untouched.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** One summary counter for every chart in a server document. */
|
|
3
|
+
export declare function SummaryRegionRoot({ children }: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}): React.ReactElement;
|
|
6
|
+
export declare function useUniqueRegionLabel(base: string): string;
|
|
@@ -2,10 +2,17 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
import { type AxisExtentMode } from "../charts/shared/axisExtent";
|
|
3
3
|
import type { AxisTickFormatter, XYFrameAxisConfig } from "./xyFrameAxisTypes";
|
|
4
4
|
export interface AxisTick {
|
|
5
|
-
value: number | Date;
|
|
5
|
+
value: number | Date | string;
|
|
6
6
|
pixel: number;
|
|
7
7
|
label: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Original data key when `value` is only a band-scale cell index.
|
|
10
|
+
* Landmark detection reads this so a date column is not passed as 0, 1, 2.
|
|
11
|
+
*/
|
|
12
|
+
dataValue?: string | number | Date;
|
|
8
13
|
}
|
|
14
|
+
/** Key passed to landmark detection. Non-band ticks only have `value`. */
|
|
15
|
+
export declare function axisTickDataValue(tick: AxisTick): string | number | Date;
|
|
9
16
|
type AxisScale = {
|
|
10
17
|
(value: number | Date): number;
|
|
11
18
|
domain(): (number | Date)[];
|
|
@@ -47,8 +47,10 @@ export interface XYFrameAxisConfig {
|
|
|
47
47
|
/** Explicit tick values. When provided, bypasses both d3's "nice"
|
|
48
48
|
* generator and `axisExtent: "exact"` — the caller has hand-picked
|
|
49
49
|
* the positions. Pixel-distance filtering downstream still drops
|
|
50
|
-
* overlapping labels. Mirrors the ordinal frame's `rTickValues`.
|
|
51
|
-
|
|
50
|
+
* overlapping labels. Mirrors the ordinal frame's `rTickValues`.
|
|
51
|
+
* A heatmap band axis matches each entry to a column or row key,
|
|
52
|
+
* including a string category, and draws that cell's center. */
|
|
53
|
+
tickValues?: Array<number | Date | string>;
|
|
52
54
|
/** Grid line stroke style. A string is a dash preset (`"dashed"`,
|
|
53
55
|
* `"dotted"`) or custom strokeDasharray; an object controls each grid
|
|
54
56
|
* line's SVG stroke attributes. */
|
|
@@ -77,6 +77,12 @@ export interface XYSceneConfig {
|
|
|
77
77
|
symbolMap?: Record<string, SymbolName>;
|
|
78
78
|
xAccessor?: string | ((d: Datum) => CoercibleNumber);
|
|
79
79
|
yAccessor?: string | ((d: Datum) => CoercibleNumber);
|
|
80
|
+
/** Fixed x domain. Either side may be omitted so the cells keep that edge. */
|
|
81
|
+
xExtent?: [number | undefined, number | undefined] | [number];
|
|
82
|
+
/** Fixed y domain. Either side may be omitted so the cells keep that edge. */
|
|
83
|
+
yExtent?: [number | undefined, number | undefined] | [number];
|
|
84
|
+
/** Draw the smallest y key at the top of the plot. */
|
|
85
|
+
invertY?: boolean;
|
|
80
86
|
valueAccessor?: string | ((d: Datum) => CoercibleNumber);
|
|
81
87
|
heatmapAggregation?: "count" | "sum" | "mean";
|
|
82
88
|
heatmapXBins?: number;
|