semiotic 3.8.2 → 3.8.3

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.
Files changed (113) hide show
  1. package/CLAUDE.md +1 -1
  2. package/README.md +34 -33
  3. package/ai/schema.json +1 -1
  4. package/ai/surface-manifest.json +1 -1
  5. package/ai/system-prompt.md +1 -1
  6. package/dist/{chunk-chunk-C6EJ4IOD.module.min.js → chunk-chunk-2CCFBTQC.module.min.js} +1 -1
  7. package/dist/chunk-chunk-2RXP3FS3.module.min.js +1 -0
  8. package/dist/chunk-chunk-4TMZXLCR.module.min.js +1 -0
  9. package/dist/{chunk-chunk-H4PPRW6N.module.min.js → chunk-chunk-5APBQXZA.module.min.js} +1 -1
  10. package/dist/{chunk-chunk-NO4MCQVD.module.min.js → chunk-chunk-5RKXZQ2P.module.min.js} +1 -1
  11. package/dist/chunk-chunk-6HSGDMTA.module.min.js +2 -0
  12. package/dist/{chunk-chunk-7LHMKRKE.module.min.js → chunk-chunk-7FW6EGLP.module.min.js} +1 -1
  13. package/dist/{chunk-chunk-RH5TSQPH.module.min.js → chunk-chunk-7OEOSCBP.module.min.js} +1 -1
  14. package/dist/{chunk-chunk-FAKO3RGQ.module.min.js → chunk-chunk-A63CTACR.module.min.js} +1 -1
  15. package/dist/chunk-chunk-ANYDWOZF.module.min.js +1 -0
  16. package/dist/{chunk-chunk-ZLKRTF5N.module.min.js → chunk-chunk-AZJUDQRM.module.min.js} +1 -1
  17. package/dist/{chunk-chunk-W3DB2MN4.module.min.js → chunk-chunk-B6V35LMY.module.min.js} +1 -1
  18. package/dist/chunk-chunk-BOSVL645.module.min.js +2 -0
  19. package/dist/chunk-chunk-EMO5NUGE.module.min.js +1 -0
  20. package/dist/chunk-chunk-F25UA5HT.module.min.js +1 -0
  21. package/dist/chunk-chunk-FRIO6MCV.module.min.js +1 -0
  22. package/dist/{chunk-chunk-T27ZEV6A.module.min.js → chunk-chunk-GWSWSPXN.module.min.js} +1 -1
  23. package/dist/chunk-chunk-I6C3KR5H.module.min.js +2 -0
  24. package/dist/chunk-chunk-IP2UE74X.module.min.js +1 -0
  25. package/dist/chunk-chunk-J5RL6GXU.module.min.js +2 -0
  26. package/dist/chunk-chunk-JNCHKRIR.module.min.js +2 -0
  27. package/dist/{chunk-chunk-Z5KXAVQD.module.min.js → chunk-chunk-L3H6DQCR.module.min.js} +1 -1
  28. package/dist/{chunk-chunk-5WEFWNUW.module.min.js → chunk-chunk-M7VYYHCE.module.min.js} +1 -1
  29. package/dist/chunk-chunk-MC35ILYP.module.min.js +2 -0
  30. package/dist/{chunk-chunk-2VUEY5TH.module.min.js → chunk-chunk-N72SWNBV.module.min.js} +1 -1
  31. package/dist/chunk-chunk-OBQRFTIL.module.min.js +2 -0
  32. package/dist/chunk-chunk-OQTLSTGI.module.min.js +2 -0
  33. package/dist/{chunk-chunk-2UN3ANRN.module.min.js → chunk-chunk-SA3D43RA.module.min.js} +1 -1
  34. package/dist/chunk-chunk-SANERMIZ.module.min.js +2 -0
  35. package/dist/{chunk-chunk-DNY43POY.module.min.js → chunk-chunk-UHSZEB74.module.min.js} +1 -1
  36. package/dist/{chunk-chunk-CYIML3AV.module.min.js → chunk-chunk-XQYVEKEJ.module.min.js} +1 -1
  37. package/dist/{chunk-chunk-27HVVXS6.module.min.js → chunk-chunk-Y6AXCRVO.module.min.js} +1 -1
  38. package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
  39. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -6
  40. package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +11 -0
  41. package/dist/components/charts/shared/areaSeriesData.d.ts +15 -0
  42. package/dist/components/charts/shared/chartMode.d.ts +67 -0
  43. package/dist/components/charts/shared/colorUtils.d.ts +8 -0
  44. package/dist/components/charts/shared/geoStyleDefaults.d.ts +3 -0
  45. package/dist/components/charts/shared/hooks.d.ts +13 -80
  46. package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
  47. package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
  48. package/dist/components/charts/shared/useXYLineStyle.d.ts +3 -2
  49. package/dist/components/charts/shared/xyLineStyle.d.ts +21 -0
  50. package/dist/components/charts/xy/LineChart.d.ts +3 -0
  51. package/dist/components/legendLayout.d.ts +31 -0
  52. package/dist/components/server/serverChartConfigShared.d.ts +29 -0
  53. package/dist/components/server/serverChartConfigs.d.ts +2 -13
  54. package/dist/components/server/serverChartConfigsXY.d.ts +3 -0
  55. package/dist/components/server/serverGaugeOverlay.d.ts +28 -0
  56. package/dist/components/server/staticLegend.d.ts +7 -1
  57. package/dist/components/server/staticSVGChrome.d.ts +57 -0
  58. package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
  59. package/dist/components/stream/GeoSVGOverlay.d.ts +2 -0
  60. package/dist/components/stream/SceneToSVG.d.ts +8 -6
  61. package/dist/components/stream/SceneToSVGGeo.d.ts +10 -0
  62. package/dist/components/stream/SceneToSVGNetwork.d.ts +12 -0
  63. package/dist/components/stream/canvasBackground.d.ts +7 -0
  64. package/dist/components/stream/networkTypes.d.ts +2 -4
  65. package/dist/components/stream/renderBackend.d.ts +14 -0
  66. package/dist/components/stream/sceneToSVGShared.d.ts +51 -0
  67. package/dist/components/types/legendTypes.d.ts +16 -3
  68. package/dist/geo.min.js +1 -1
  69. package/dist/geo.module.min.js +1 -1
  70. package/dist/network.min.js +1 -1
  71. package/dist/network.module.min.js +1 -1
  72. package/dist/ordinal.min.js +1 -1
  73. package/dist/ordinal.module.min.js +1 -1
  74. package/dist/physics.min.js +1 -1
  75. package/dist/physics.module.min.js +1 -1
  76. package/dist/realtime.min.js +1 -1
  77. package/dist/realtime.module.min.js +1 -1
  78. package/dist/semiotic-ai-core.min.js +1 -1
  79. package/dist/semiotic-ai-core.module.min.js +1 -1
  80. package/dist/semiotic-ai.min.js +1 -1
  81. package/dist/semiotic-ai.module.min.js +1 -1
  82. package/dist/semiotic-experimental.min.js +1 -1
  83. package/dist/semiotic-experimental.module.min.js +1 -1
  84. package/dist/semiotic-realtime-core.min.js +1 -1
  85. package/dist/semiotic-realtime-core.module.min.js +1 -1
  86. package/dist/semiotic-recipes-core.module.min.js +1 -1
  87. package/dist/semiotic-recipes.module.min.js +1 -1
  88. package/dist/semiotic-server-edge.min.js +1 -1
  89. package/dist/semiotic-server-edge.module.min.js +1 -1
  90. package/dist/semiotic-server-node.min.js +1 -1
  91. package/dist/semiotic-server-node.module.min.js +1 -1
  92. package/dist/semiotic-utils-core.module.min.js +1 -1
  93. package/dist/semiotic-utils.module.min.js +1 -1
  94. package/dist/semiotic.min.js +1 -1
  95. package/dist/semiotic.module.min.js +1 -1
  96. package/dist/server.min.js +1 -1
  97. package/dist/server.module.min.js +1 -1
  98. package/dist/xy.min.js +1 -1
  99. package/dist/xy.module.min.js +1 -1
  100. package/package.json +1 -1
  101. package/dist/chunk-chunk-6F6GEAQU.module.min.js +0 -1
  102. package/dist/chunk-chunk-BHYTYMY2.module.min.js +0 -2
  103. package/dist/chunk-chunk-E7MIQX7D.module.min.js +0 -2
  104. package/dist/chunk-chunk-ES4DCG3L.module.min.js +0 -1
  105. package/dist/chunk-chunk-IFYPMWKY.module.min.js +0 -1
  106. package/dist/chunk-chunk-L6D3I3V7.module.min.js +0 -2
  107. package/dist/chunk-chunk-ODUZEEBH.module.min.js +0 -2
  108. package/dist/chunk-chunk-P6UBCMSQ.module.min.js +0 -2
  109. package/dist/chunk-chunk-STZFFTAN.module.min.js +0 -2
  110. package/dist/chunk-chunk-U3AGQ5EF.module.min.js +0 -2
  111. package/dist/chunk-chunk-WDIN4LRC.module.min.js +0 -1
  112. package/dist/chunk-chunk-XOYX77KF.module.min.js +0 -2
  113. package/dist/chunk-chunk-ZTNVDWAK.module.min.js +0 -2
@@ -0,0 +1 @@
1
+ import{contrastRatio as e,fieldForRole as t,recipeConfig as i,recipeIntentId as a}from"./chunk-chunk-M337NY6L.module.min.js";import{extractAllRows as n}from"./chunk-chunk-255KDHW5.module.min.js";import{resolveResponsiveRules as r}from"./chunk-chunk-2WVCH4PL.module.min.js";import*as s from"react";function o(e){if(null==e)return"";if("number"!=typeof e)return e+"";if(!isFinite(e))return e+"";if(0===e)return"0";const t=parseFloat(e.toPrecision(12)),i=Math.abs(t);return 1e9>i?1e6>i?1e4>i?Number.isInteger(t)?t+"":parseFloat(t.toPrecision(6))+"":parseFloat((t/1e3).toPrecision(3))+"K":parseFloat((t/1e6).toPrecision(3))+"M":parseFloat((t/1e9).toPrecision(3))+"B"}var l=864e5;function c(e){return 10>e?"0"+e:e+""}var u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function d(e){let t,i=e;return(a,n,r)=>{const s=a instanceof Date?a:new Date(a);e||!r||2>r.length||r===t||(t=r,i=function(e){if(2>e.length)return"days";const t=[];for(let i=1;e.length>i;i++)t.push(e[i]-e[i-1]);t.sort((e,t)=>e-t);const i=t[Math.floor(t.length/2)];return 12e4>i?"seconds":72e5>i?"minutes":2*l>i?"hours":60*l>i?"days":400*l>i?"months":"years"}(r));const o=i||"days";return null!=n&&0!==n&&r&&0!==r.length?function(e,t,i){const a=e.getUTCFullYear()!==t.getUTCFullYear(),n=a||e.getUTCMonth()!==t.getUTCMonth(),r=n||e.getUTCDate()!==t.getUTCDate(),s=r||e.getUTCHours()!==t.getUTCHours(),o=s||e.getUTCMinutes()!==t.getUTCMinutes(),l=u[e.getUTCMonth()],d=e.getUTCDate(),m=e.getUTCFullYear(),h=c(e.getUTCHours()),p=c(e.getUTCMinutes()),g=c(e.getUTCSeconds());switch(i){case"seconds":return a?`${l} ${d}, ${m} ${h}:${p}:${g}`:r?`${l} ${d} ${h}:${p}:${g}`:s?`${h}:${p}:${g}`:o?`${p}:${g}`:":"+g;case"minutes":return a?`${l} ${d}, ${m} ${h}:${p}`:r?`${l} ${d} ${h}:${p}`:s?`${h}:${p}`:":"+p;case"hours":return a?`${l} ${d}, ${m} ${h}:00`:n?`${l} ${d} ${h}:${p}`:r?`${l} ${d} ${h}:00`:h+":00";case"days":return a?`${l} ${d}, ${m}`:n?`${l} ${d}`:""+d;case"months":return a?`${l} ${m}`:""+l;case"years":return""+m}}(s,new Date(r[n-1]),o):function(e,t){const i=u[e.getUTCMonth()],a=e.getUTCDate(),n=e.getUTCFullYear(),r=c(e.getUTCHours()),s=c(e.getUTCMinutes()),o=c(e.getUTCSeconds());switch(t){case"seconds":return`${i} ${a}, ${n} ${r}:${s}:${o}`;case"minutes":case"hours":return`${i} ${a}, ${n} ${r}:${s}`;case"days":return`${i} ${a}, ${n}`;case"months":return`${i} ${n}`;case"years":return""+n}}(s,o)}}function m(e,t=.5){const i=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!i)return e;const a=Math.round(parseInt(i[1],16)*(1-t)),n=Math.round(parseInt(i[2],16)*(1-t)),r=Math.round(parseInt(i[3],16)*(1-t));return`#${a.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}function h(e,t=.5){const i=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!i)return e;const a=Math.round(parseInt(i[1],16)+(255-parseInt(i[1],16))*t),n=Math.round(parseInt(i[2],16)+(255-parseInt(i[2],16))*t),r=Math.round(parseInt(i[3],16)+(255-parseInt(i[3],16))*t);return`#${a.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}var p=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart","RealtimeLineChart","RealtimeHeatmap"]),g=new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),y={Scatterplot:["pointRadius","hoverRadius"],BubbleChart:["pointRadius","hoverRadius"],ConnectedScatterplot:["pointRadius","hoverRadius"],QuadrantChart:["pointRadius","hoverRadius"],SwarmPlot:["pointRadius","hoverRadius"],DotPlot:["dotRadius","hoverRadius"]};function f(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function b(e){return"string"==typeof e&&e.trim().length>0}function v(e){const t=f(e.capability)?e.capability:null,i=f(e.recipe)?e.recipe:null,a=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,i?.mobile];for(const e of a)if(f(e))return e;return null}function x(e){return Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1]&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[e[0],e[1]]:null}function w(e){return x(e.size)||x(f(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function k(e,t){e.push({...t,status:"pass"})}function $(e,t){e.push({...t,status:"warn"})}function C(e,t){e.push({...t,status:"manual"})}function S(e,t={},i={}){const a=i.viewportWidth??390,n=i.targetSize??44,s=w(t),o=r(t,{width:a,height:s?.[1]}),l=[],c=w(t=o.props),u=v(t),d=function(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}(e,t),m=function(e){const t=v(e);return!0===e.responsive||!0===e.mobile||!0===t?.responsive||!0===t?.supportsResponsiveLayout||Array.isArray(t?.breakpoints)||"number"==typeof t?.minViewportWidth||"responsive"===t?.strategy||"small-multiples"===t?.strategy||"summary-cards"===t?.strategy||null!=e.mobileLayout||null!=e.responsiveRules||"mobile-readable"===e.density}(t),h=!0===i.inChartContainer,x=b(t.title)||b(t.summary)||b(t.description)||!0===u?.summary||b(u?.summary);if(o.matches.length>0&&k(l,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${o.matches.length} responsive rule(s) applied for the ${a}px mobile audit.`}),c){const[t,i]=c;t>a&&!m?$(l,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${a}px mobile viewport with no responsive/mobile transform hint.`,fix:"Use responsive sizing, responsiveRules/mobileLayout, or an explicit mobile variant that preserves the task instead of clipping the desktop chart."}):k(l,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof u?.minViewportWidth&&u.minViewportWidth>a&&$(l,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${u.minViewportWidth}px minimum, wider than the audited ${a}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});const n=t/Math.max(1,i);430>=a&&n>2.4&&"BigNumber"!==e&&$(l,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${n.toFixed(1)}:1, which tends to compress phone charts vertically.`,fix:"Prefer stacked sections, small multiples, cards plus a sparkline, or a taller mobile-specific chart ratio."}),160>i&&"BigNumber"!==e&&$(l,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${i}px; most phone charts need enough vertical room for marks plus readable labels.`,fix:"Reserve more vertical space, remove nonessential axes, or switch to a card/sparkline pattern with external labels."})}else C(l,{id:"layout.unknown-size",category:"layout",impact:"medium",message:"No explicit size is available to audit. This may be responsive, but static mobile overflow cannot be checked.",fix:"Audit rendered widths at 320, 360, 390, and 430px, or pass size/responsiveRules metadata into the config."});const S=function(e){const t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,f(e.frameProps)?e.frameProps.data:void 0];let i=0;for(const e of t)Array.isArray(e)&&(i+=e.length);return i}(t);S>0&&(S>("number"==typeof u?.maxMarks?u.maxMarks:p.has(e)?1.25*a:g.has(e)?Math.max(8,Math.floor(a/34)):a)?$(l,{id:"density.mark-budget",category:"density",impact:p.has(e)?"medium":"high",message:`${S} data item(s) exceed the rough mobile density budget for ${e} at ${a}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):k(l,{id:"density.mark-budget",category:"density",impact:"medium",message:S+" data item(s) are within the rough mobile density budget for this component."}));const A=function(e){const t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues];let i=0;for(const e of t)Array.isArray(e)&&(i+=e.length);return i>0?i:null}(t),T=!1!==t.showAxes&&!1!==t.axis;if(T&&null!=A){const e=Math.max(3,Math.floor(a/58));A>e&&$(l,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${A} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${a}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else T&&(p.has(e)||g.has(e))&&C(l,{id:"density.axis-label-collision",category:"density",impact:"medium",message:"Axes are enabled, but label collision depends on rendered tick text and cannot be checked statically.",fix:"Verify tick labels at phone widths or provide explicit mobile tick density."});!function(e){const t=f(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!function(e){const t=v(e),i=f(e.mobileInteraction)?e.mobileInteraction:null;return null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||null!=e.selection||null!=e.onClick||null!=e.onSelect||!0===e.mobileInteraction||!0===i?.tapToSelect||!0===i?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||b(t?.interaction?.hoverFallback)}(e)}(t)?k(l,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."}):$(l,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"The chart exposes tooltip/hover detail without an obvious tap, selection, or control alternative.",fix:"Enable tap-to-select, a persistent details panel, visible segment buttons, or another non-hover path for the same information."});const M=function(e,t){const i=y[e];if(!i)return null;let a=i.includes("hoverRadius")?30:null;for(const e of i){const i=t[e];"number"==typeof i&&Number.isFinite(i)&&i>0&&(a=null==a?i:Math.max(a,i))}return null==a?null:2*a}(e,t),R=f(t.mobileInteraction)?t.mobileInteraction:null,z=M??("number"==typeof R?.targetSize?R.targetSize:!0===t.mobileInteraction?44:"number"==typeof u?.minimumHitTarget?u.minimumHitTarget:"number"==typeof u?.interaction?.targetSize?u.interaction.targetSize:null);null!=z&&(24>z?$(l,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${z}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):n>z?$(l,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${z}px, above 24px but below the ${n}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):k(l,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${z}px, meeting the configured ${n}px target.`}));const I=[];null==t.brush&&null==t.onBrush||I.push("brush"),!0===t.zoomable&&I.push("pan/zoom"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||I.push("legend filtering"),I.length>0&&!function(e,t){const i=v(e),a=f(e.mobileInteraction)?e.mobileInteraction:null,n=a?.standardControls;return!!(null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||Array.isArray(i?.interaction?.alternatives)&&i.interaction.alternatives.length>0)||!0===n||"all"===n||t.every(e=>"brush"===e?Array.isArray(n)?n.includes("brush"):"brush"===n:"pan/zoom"===e?Array.isArray(n)?n.includes("zoom"):"zoom"===n:"legend filtering"===e&&(Array.isArray(n)?n.includes("legend"):"legend"===n))}(t,I)&&$(l,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${I.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."}),!1===t.showLegend||!1===t.legend||!0!==t.showLegend&&!0!==t.legend&&null==t.colorBy&&null==t.groupBy&&null==t.lineBy&&null==t.areaBy&&null==t.stackBy||!0===t.directLabel||!0===t.showLabels||"direct"===t.labelStrategy||"direct-end"===t.labelStrategy||"direct"===u?.labels?.strategy||"inline"===u?.labels?.strategy||"external"===u?.labels?.strategy||a>430||$(l,{id:"semantics.legend-over-direct-labels",category:"semantics",impact:"medium",message:"The chart appears to rely on a legend instead of direct labels at phone width.",fix:"Prefer direct end labels, inline labels, or a compact chip selector so readers do not bounce between plot and legend."});const U=Array.isArray(t.annotations)?t.annotations.filter(e=>f(e)):[];if(U.length>("number"==typeof u?.maxAnnotations?u.maxAnnotations:3)&&430>=a&&$(l,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:U.length+" annotation(s) compete for phone plot space.",fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),U.length>0){const e=U.filter(e=>!b(e.mobileText)&&!b(e.shortText)&&!b(e.label));e.length>0&&C(l,{id:"annotation.mobile-copy",category:"annotation",impact:"low",message:e.length+" annotation(s) lack explicit short/mobile copy.",fix:"Add mobileText or shortText for notes that need to survive narrow layouts."})}m||"BigNumber"===e||C(l,{id:"layout.no-responsive-transform",category:"layout",impact:"low",message:"No explicit responsive transformation hint is present.",fix:"Declare responsiveRules/mobileLayout or a density/label strategy so the mobile version is a designed transformation, not an accidental resize."}),d&&(u?(k(l,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart/recipe provides a mobileSemantics/mobile contract, so the audit can inspect its authored phone behavior."}),!1===u.custom?.dataBearingSceneNodes?$(l,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"medium",message:"Custom mobile contract says emitted scene nodes are not data-bearing.",fix:"Preserve datum references, semantic roles, or accessible-table fields so intelligence, navigation, and tap details can recover the chart's meaning."}):!0!==u.custom?.dataBearingSceneNodes&&C(l,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"low",message:"Custom chart mobile contract does not state whether scene nodes are data-bearing.",fix:"Set mobile.custom.dataBearingSceneNodes and mobile.custom.navigationGranularity for custom layouts and interoperability adapters."})):C(l,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart layout is opaque to static mobile analysis because no mobileSemantics/mobile contract is present.",fix:"Declare mobileSemantics with strategy, breakpoints, mark budgets, touch target size, interaction alternatives, and custom scene semantics."})),x||h||$(l,{id:"semantics.no-mobile-summary",category:"semantics",impact:"medium",message:"No title, summary, description, or ChartContainer context is visible from the config.",fix:"Add title/summary text or wrap in ChartContainer so the small-screen reader gets the task before the chart."});const P=l.filter(e=>"warn"===e.status),N={highRisk:P.filter(e=>"high"===e.impact).length,warnings:P.length,manual:l.filter(e=>"manual"===e.status).length,passes:l.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:a,ok:0===N.highRisk,summary:N,findings:l,reference:"Mobile visualization audit: informed by MobileVisFixer, mobile exploratory interaction research, small-multiple mobile studies, responsive visualization grammars, constraint-based breakpoints, and WCAG 2.2 input modalities."}}var A={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},T=["layout","density","interaction","annotation","semantics"];function M(e){const t=[],i=e.summary,a=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${i.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${a} - ${i.warnings} warning(s) - ${i.manual} manual check(s)`);for(const i of T){const a=e.findings.filter(e=>e.category===i&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(" "+i.toUpperCase());for(const e of a)t.push(` ${A[e.status]} [${e.impact}] ${e.id}: ${e.message}`),!e.fix||"warn"!==e.status&&"manual"!==e.status||t.push(" -> "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function R(){return["Static audit only: rendered label collision, CSS-resolved type size, and actual touch behavior still require viewport testing.","Use multiple widths, usually 320, 360, 390, 430, and 768 CSS pixels.","A mobile pass means no high-risk static warnings, not that the chart is perceptually or ergonomically optimal."]}function z(e){const t={};for(const[i,a]of e){const e=[];for(const[,t]of a.clauses){const i={};for(const[e,a]of Object.entries(t.fields))i[e]="point"===a.type?{type:"point",values:Array.from(a.values)}:{type:"interval",range:a.range};e.push({clientId:t.clientId,type:t.type,fields:i})}t[i]={name:a.name,resolution:a.resolution,clauses:e}}return t}function I(e){const t=new Map;for(const[i,a]of Object.entries(e)){const e=new Map;for(const t of a.clauses){const i={};for(const[e,a]of Object.entries(t.fields))i[e]="point"===a.type?{type:"point",values:new Set(a.values)}:{type:"interval",range:a.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:i})}t.set(i,{name:a.name,resolution:a.resolution,clauses:e})}return t}async function U(e,t){const{format:i="png",filename:a="chart",scale:n=2,background:r="white"}=t||{},s=e.querySelector("svg");if(!s)throw Error("No SVG element found in the container");const o=s.cloneNode(!0),l=s.getBoundingClientRect();if(o.getAttribute("width")||o.setAttribute("width",l.width+""),o.getAttribute("height")||o.setAttribute("height",l.height+""),o.getAttribute("xmlns")||o.setAttribute("xmlns","http://www.w3.org/2000/svg"),P(s,o),"svg"===i){const e=(new XMLSerializer).serializeToString(o);N(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),a+".svg")}else{const t=l.width*n,i=l.height*n,s=document.createElement("canvas");s.width=t,s.height=i;const c=s.getContext("2d");c.fillStyle=r,c.fillRect(0,0,t,i),c.scale(n,n);const u=e.querySelector("canvas");u&&c.drawImage(u,0,0,l.width,l.height);const d=(new XMLSerializer).serializeToString(o),m=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),h=URL.createObjectURL(m),p=new Image;p.width=l.width,p.height=l.height,await new Promise((e,t)=>{p.onload=()=>{c.drawImage(p,0,0),s.toBlob(i=>{i?(N(i,a+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(h)},p.onerror=()=>{URL.revokeObjectURL(h),t(Error("Failed to load SVG image"))},p.src=h})}}function P(e,t){const i=e.children,a=t.children,n=window.getComputedStyle(e),r=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(const e of r){const i=n.getPropertyValue(e);i&&"none"!==i&&""!==i&&t.style?.setProperty(e,i)}for(let e=0;Math.min(i.length,a.length)>e;e++)P(i[e],a[e])}function N(e,t){const i=URL.createObjectURL(e),a=document.createElement("a");a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}function F(e){const t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:t+""}function L(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function D(e){return"number"==typeof e&&Number.isFinite(e)}function B(e){if(D(e.x)&&D(e.y)&&D(e.w)&&D(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(D(e.x)&&D(e.y)&&D(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(D(e.cx)&&D(e.cy)&&D(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(D(e.cx)&&D(e.cy)&&D(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};const t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&D(e[0])&&D(e[1]));return t.length>0?{x0:Math.min(...t.map(e=>e[0])),y0:Math.min(...t.map(e=>e[1])),x1:Math.max(...t.map(e=>e[0])),y1:Math.max(...t.map(e=>e[1]))}:null}function j(e,t){const i=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),a=Math.min(Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0));return a>0?i/a:0}function V(e,i,a,n,r){if(e===i)return!0;const s=a.dataRoles.map(e=>t(e,n,r)).filter(e=>!!e).filter(t=>null!=e[t]&&null!=i[t]);return s.length>0&&s.every(t=>e[t]+""==i[t]+"")}function q(e,t,i,a,n,r="warn",s){return{id:e,category:t,status:i?"pass":r,message:i?a:n,...s?{evidence:s}:{}}}function W(r){const{recipe:s}=r,o=function(e){return Array.isArray(e)?e:e&&"object"==typeof e?[...e.nodes??e.sceneNodes??[],...e.sceneEdges??[]]:[]}(r.scene),l=r.layoutConfig??i({layoutConfig:r.layoutConfig}),c=r.dimensions.plot??{x:0,y:0,width:r.dimensions.width,height:r.dimensions.height},u=c.x??0,d=c.y??0,m=[],h=o.filter(e=>null!=L(e)),p=o.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||function(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));m.push(q("geometry.finite","geometry",0===p.length,"All emitted geometry is finite.",p.length+" marks contain non-finite geometry.","fail",{count:p.length}));const g=o.map(B),y=g.filter(e=>e&&(e.x0>=e.x1||e.y0>=e.y1)).length;m.push(q("geometry.nonzero-area","geometry",0===y,"All bounded marks have positive area.",y+" marks have zero or negative area.","warn",{count:y}));const f=g.filter(e=>e&&(u>e.x0||d>e.y0||e.x1>u+c.width||e.y1>d+c.height)).length;m.push(q("geometry.bounds","geometry",0===f,"All bounded marks stay inside the plot.",f+" marks extend outside the plot bounds.","warn",{count:f}));const b=s.audit?.minimumHitTargetSize??s.accessibility.minimumHitTarget??24,v=g.filter(e=>!!e&&(b>e.x1-e.x0||b>e.y1-e.y0)).length;m.push(q("interaction.target-size","interaction",0===v,`All bounded targets meet the declared ${b}px minimum.`,`${v} targets are smaller than ${b}px in at least one dimension.`,"warn",{count:v,minimumTarget:b}));const x=h.map(F),w=x.filter(e=>!e).length,k=new Set,$=x.filter(e=>!(!e||!k.has(e)&&(k.add(e),1)));m.push(q("identity.stable-ids","identity",0===w,"Every data-bearing mark exposes a stable id.",w+" data-bearing marks have no pointId, id, or transition key.",s.audit?.requireStableIds?"fail":"warn",{missing:w})),m.push(q("identity.unique-ids","identity",0===$.length,"Stable mark ids are unique.",$.length+" duplicate stable ids were observed.","fail",{duplicates:[...new Set($)].slice(0,10)}));const C=x.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;C>0&&m.push({id:"identity.index-pattern",category:"identity",status:"warn",message:C+" ids look index-derived and may change when data is reordered.",remediation:"Derive ids from a declared identifier role or stable domain key."});const S=new Set;let A=0;const T=r.inputData;for(const e of h){const t=L(e),i=Array.isArray(t)?t:[t];let a=!1;for(const e of i)if(e&&"object"==typeof e)for(let t=0;T.length>t;t+=1)V(e,T[t],s,l,T)&&(S.add(t),a=!0);a||(A+=1)}const M=Math.max(0,T.length-S.size);m.push(q("coverage.input-data","coverage",0===M,"Every input datum is represented by the observed scene.",M+" input data items have no matching scene mark.",s.audit?.requireDatumCoverage?"fail":"warn",{represented:S.size,input:T.length})),m.push(q("coverage.scene-data","coverage",0===A,"Every data-bearing scene mark maps back to input data.",A+" scene marks do not map back to an input datum.","warn",{count:A}));const R=s.encodings?.some(e=>"count"===e.channel);!R&&h.length>S.size&&S.size>0&&m.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});const z=h.filter(e=>!1===e.interactive).length;m.push(q("interaction.hit-targets","interaction",0===z&&h.length>0,"Every observed data-bearing scene node participates in hit testing.",0===h.length?"No data-bearing scene nodes were emitted for interaction.":z+" data-bearing marks explicitly disable interaction.","fail"));const I=(r.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),U=I.filter(e=>!k.has(e));m.push(q("coverage.annotation-anchors","coverage",0===U.length,I.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",U.length+" annotations point to missing scene ids.","fail",{unresolved:U}));const P=(r.chart?.selectedIds??[]).filter(e=>!k.has(e));r.chart?.selectedIds&&m.push(q("interaction.selection-reachability","interaction",0===P.length,"Selected/highlighted states resolve to observed marks.",P.length+" selected ids are not reachable in the scene.","fail",{missing:P}));const N=n(o),D=(s.accessibility.tableFields??s.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;const i=e.role?s.dataRoles.find(t=>t.role===e.role):void 0;return i?t(i,l,T):void 0}).filter(e=>!!e),W=new Set(N.flatMap(e=>Object.keys(e.values))),E=D.filter(e=>!W.has(e));m.push(q("accessibility.table-fields","accessibility",0===E.length,D.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${E.join(", ")}.`,"fail",{expectedFields:D,observedFields:[...W]})),new Set(T.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&2>=W.size&&[...W].every(e=>"category"===e||"value"===e)&&m.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});const H=(s.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);m.push(q("accessibility.color-only","accessibility",0===H.length,"Every declared color encoding names a redundant cue.",H.length+" color encodings have no declared redundant cue.","warn"));const O=r.chart;if(O){for(const[e,t]of[["title",s.accessibility.requiresTitle],["summary",s.accessibility.requiresSummary],["description","required"===s.accessibility.description]])t&&m.push(q("accessibility."+e,"accessibility","string"==typeof O[e]&&O[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(s.accessibility.requiresAccessibleTable||"required"===s.accessibility.accessibleTable||s.accessibility.fallbackTable)&&m.push(q("accessibility.fallback-table","accessibility",!1!==O.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),O.navigationTree&&m.push(q("accessibility.navigation-depth","accessibility",(O.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}const Y=r.theme?.background??"#ffffff",G=o.filter(t=>{const i=t.style?.fill??t.fill;if("string"!=typeof i||!i.startsWith("#")||!Y.startsWith("#"))return!1;const a=e(i,Y);return null!=a&&3>a}).length;m.push(q("visual.contrast","visual",0===G,"All statically checkable mark fills meet 3:1 contrast.",G+" marks have fill contrast below 3:1.","warn",{background:Y}));let J=0;const K=g.filter(e=>!!e).slice(0,500);for(let e=0;K.length>e;e+=1)for(let t=e+1;K.length>t;t+=1).8>j(K[e],K[t])||(J+=1);J>K.length&&m.push({id:"visual.overlap-density",category:"visual",status:"warn",message:J+" near-total mark overlaps suggest occlusion or excessive density.",remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});const Q=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),X={dataRoles:s.dataRoles.map(e=>e.role),intents:s.intents.map(a).filter(e=>!!e),accessibilityExpectations:[...s.accessibility.requirements??[],...s.accessibility.tableFields?.map(e=>"table field: "+e.label)??[]],fallbackDeclared:!0===s.accessibility.fallbackTable||"required"===s.accessibility.accessibleTable||!0===s.accessibility.requiresAccessibleTable,designContractDeclared:!!s.designContract?.whyCustom},_=[...m,...Q],Z=m.filter(e=>"fail"===e.status).length;return{recipeId:s.id,ok:0===Z,summary:{marks:o.length,passes:_.filter(e=>"pass"===e.status).length,warnings:_.filter(e=>"warn"===e.status).length,failures:Z,manual:_.filter(e=>"manual"===e.status).length},declaredSemantics:X,observedSceneEvidence:m,manualATChecks:Q}}export{o as smartTickFormat,d as adaptiveTimeTicks,m as darkenColor,h as lightenColor,S as auditMobileVisualization,M as formatMobileVisualizationAudit,R as mobileVisualizationCaveats,z as serializeSelections,I as deserializeSelections,U as exportChart,W as auditObservedScene};
@@ -1 +1 @@
1
- import{createSeededFrameRandom as t,schemeCategory10 as e}from"./chunk-chunk-NO4MCQVD.module.min.js";import{getMinMax as o}from"./chunk-chunk-JJ2OOIET.module.min.js";import{forceSimulation as n,forceCenter as r,forceX as s,forceY as c,forceLink as i,forceManyBody as a,forceCollide as f}from"d3-force";import{scaleLinear as l}from"d3-scale";var u=new Set,d=new WeakMap;function g(t,e){if("production"===process.env.NODE_ENV)return t;if(!t||!t.data||"object"!=typeof t.data)return t;let o=d.get(t);if(o){const t=o.get(e);if(t)return t}else o=new Map,d.set(t,o);const n=new Proxy(t,{get(t,o,n){if("string"==typeof o&&!(o in t)&&t.data&&o in t.data){const t=`${e}:${o}`;u.has(t)||(u.add(t),console.warn(`[Semiotic] "${e}" callback accessed "${o}" on the wrapper object, but it only exists on ".data". Use d.data.${o} (or d.data?.${o}) instead. Frame callbacks receive RealtimeNode/RealtimeEdge wrappers, not your raw data.`))}return Reflect.get(t,o,n)}});return o.set(e,n),n}var h={supportsStreaming:!0,hierarchical:!1,computeLayout(e,o,l,u){if(0===e.length)return;const d=l.forceStrength??.1,g=u[0]/2,h=u[1]/2,x=l.__previousPositions;let M=0;const S=[];for(const t of e){const e=null!=t.x&&null!=t.y&&(0!==t.x||0!==t.y),o=x?.get(t.id);e?M++:o?(t.x=o.x,t.y=o.y,M++):S.push(t)}const b=M>0&&.3>=(e.length>0?S.length/e.length:1);if(b){const t=new Map;for(const o of e)t.set(o.id,o);for(const e of S){const n=y(e.id,o,t);if(n.length>0){let t=0,o=0;for(const e of n)t+=e.x,o+=e.y;const r=p(e.id),s=r%360*(Math.PI/180),c=10+r%20;e.x=t/n.length+c*Math.cos(s),e.y=o/n.length+c*Math.sin(s)}else{const t=p(e.id),o=t%360*(Math.PI/180),n=15+t%30;e.x=g+n*Math.cos(o),e.y=h+n*Math.sin(o)}}}else{const t=2.399963229728653;for(let o=0;e.length>o;o++){const n=e[o];if(null==n.x||null==n.y||0===n.x&&0===n.y){const e=10*Math.sqrt(o+.5),r=o*t;n.x=g+e*Math.cos(r),n.y=h+e*Math.sin(r)}}}const k=l.__skipForceSimulation||0===l.iterations?0:b?40:l.iterations??Math.max(50,Math.min(300,Math.floor(300-2*(e.length-30)))),w=m(l.nodeSize,l.nodeSizeRange,e),_=t=>w(t);if(k>0){const u=new Map,y=new Map;for(const t of e)u.set(t.id,0),y.set(t.id,t);for(const t of o){const e="string"==typeof t.source?t.source:t.source.id,o="string"==typeof t.target?t.target:t.target.id;u.set(e,(u.get(e)??0)+1),u.set(o,(u.get(o)??0)+1)}const p=i().strength(t=>{const e=t.weight,o="string"==typeof t.target?t.target:t.target.id,n=Math.max(1,Math.min(u.get("string"==typeof t.source?t.source:t.source.id)??1,u.get(o)??1));return Math.min(2.5,(e&&e>0?Math.sqrt(e):1)*d/(.1*n))}).distance(t=>{const e="string"==typeof t.source?y.get(t.source):t.source,o="string"==typeof t.target?y.get(t.target):t.target,n=(e?_(e):0)+(o?_(o):0)+12;return Math.max(40,n)}).id(t=>t.id),m=n();if(void 0===l.random&&void 0===l.seed||m.randomSource(l.random??t(l.seed)),m.force("charge",a().strength(t=>{const e=u.get(t.id)??0;return-15*_(t)*Math.sqrt(e+1)})).force("collide",f(t=>_(t)+3).strength(.9).iterations(2)).force("center",r(g,h).strength(.8)).force("x",s(g).strength(.06)).force("y",c(h).strength(.06)),m.nodes(e),o.length>0){const t=o.map(t=>({...t,source:"string"==typeof t.source?t.source:t.source.id,target:"string"==typeof t.target?t.target:t.target.id}));p.links(t),m.force("link",p)}b?m.alpha(.3):.1>m.alpha()&&m.alpha(1),m.stop();for(let t=0;k>t;++t)m.tick()}for(const t of e){if(null==t.x||null==t.y)continue;const e=_(t);t.x=Math.max(e,Math.min(u[0]-e,t.x)),t.y=Math.max(e,Math.min(u[1]-e,t.y)),t.x0=0,t.x1=0,t.y0=0,t.y1=0}const v=new Map;for(const t of e)v.set(t.id,t);for(const t of o){if("string"==typeof t.source){const e=v.get(t.source);e&&(t.source=e)}if("string"==typeof t.target){const e=v.get(t.target);e&&(t.target=e)}}},buildScene(t,o,n,r){const s=n.nodeStyle,c=n.edgeStyle,i=m(n.nodeSize,n.nodeSizeRange,t),a=Array.isArray(n.colorScheme)?n.colorScheme:n.themeCategorical&&n.themeCategorical.length>0?n.themeCategorical:e,f=new Map;t.forEach((t,e)=>{f.set(t.id,a[e%a.length])});const l=[],u=[],d=[];for(const e of t){if(null==e.x||null==e.y)continue;const t=i(g(e,"nodeSize")),o=s?s(g(e,"nodeStyle")):{},r={fill:o.fill||f.get(e.id)||n.themeSemantic?.primary||"#007bff",stroke:o.stroke||n.themeSemantic?.surface||"#fff",strokeWidth:o.strokeWidth??2,opacity:o.opacity};l.push({type:"circle",cx:e.x,cy:e.y,r:t,style:r,datum:e,id:e.id,label:e.id})}const h=new Map;for(const e of t)h.set(e.id,e);for(const t of o){const e="object"==typeof t.source?t.source:h.get(t.source),o="object"==typeof t.target?t.target:h.get(t.target);if(!e||!o)continue;if(null==e.x||null==e.y)continue;if(null==o.x||null==o.y)continue;const r=c?c(g(t,"edgeStyle")):{};u.push({type:"line",x1:e.x,y1:e.y,x2:o.x,y2:o.y,style:{stroke:r.stroke||n.themeSemantic?.border||n.themeSemantic?.secondary||"#999",strokeWidth:r.strokeWidth??1,opacity:r.opacity??.6},datum:t})}if(!1!==n.showLabels){const e=(y=n.nodeLabel)?"function"==typeof y?y:t=>t[y]||t.id:null;for(const o of t){if(null==o.x||null==o.y)continue;const t=e?e(o):o.id;if(!t)continue;const n=i(g(o,"nodeSize"));d.push({x:o.x,y:o.y-n-4,text:t+"",anchor:"middle",baseline:"auto",fontSize:11})}}var y;return{sceneNodes:l,sceneEdges:u,labels:d}}};function y(t,e,o){const n=[];for(const r of e){const e="string"==typeof r.source?r.source:r.source.id,s="string"==typeof r.target?r.target:r.target.id;let c=null;if(e===t?c=s:s===t&&(c=e),c){const t=o.get(c);!t||0===t.x&&0===t.y||n.push({x:t.x,y:t.y})}}return n}function p(t){let e=0;for(let o=0;t.length>o;o++)e=(e<<5)-e+t.charCodeAt(o)|0;return Math.abs(e)}function m(t,e,n){if(n.some(t=>null!=t.__forceRadius))return t=>t.__forceRadius??8;if(null==t)return()=>8;if("number"==typeof t)return()=>t;if("function"==typeof t)return e=>t(e)||8;const r=e||[5,20],s=[];for(const e of n){const o=e.data?.[t];"number"==typeof o&&s.push(o)}if(0===s.length)return()=>r[0];const[c,i]=o(s);if(c===i)return()=>(r[0]+r[1])/2;const a=l().domain([c,i]).range(r).clamp(!0);return e=>{const o=e.data?.[t];return null==o||"number"!=typeof o?r[0]:a(o)}}export{g as wrapWithDataHint,h as forceLayoutPlugin,m as resolveNodeSizeFn};
1
+ import{createSeededFrameRandom as t,schemeCategory10 as e}from"./chunk-chunk-5RKXZQ2P.module.min.js";import{getMinMax as o}from"./chunk-chunk-JJ2OOIET.module.min.js";import{forceSimulation as n,forceCenter as r,forceX as s,forceY as c,forceLink as i,forceManyBody as a,forceCollide as f}from"d3-force";import{scaleLinear as l}from"d3-scale";var u=new Set,d=new WeakMap;function g(t,e){if("production"===process.env.NODE_ENV)return t;if(!t||!t.data||"object"!=typeof t.data)return t;let o=d.get(t);if(o){const t=o.get(e);if(t)return t}else o=new Map,d.set(t,o);const n=new Proxy(t,{get(t,o,n){if("string"==typeof o&&!(o in t)&&t.data&&o in t.data){const t=`${e}:${o}`;u.has(t)||(u.add(t),console.warn(`[Semiotic] "${e}" callback accessed "${o}" on the wrapper object, but it only exists on ".data". Use d.data.${o} (or d.data?.${o}) instead. Frame callbacks receive RealtimeNode/RealtimeEdge wrappers, not your raw data.`))}return Reflect.get(t,o,n)}});return o.set(e,n),n}var h={supportsStreaming:!0,hierarchical:!1,computeLayout(e,o,l,u){if(0===e.length)return;const d=l.forceStrength??.1,g=u[0]/2,h=u[1]/2,x=l.__previousPositions;let M=0;const S=[];for(const t of e){const e=null!=t.x&&null!=t.y&&(0!==t.x||0!==t.y),o=x?.get(t.id);e?M++:o?(t.x=o.x,t.y=o.y,M++):S.push(t)}const b=M>0&&.3>=(e.length>0?S.length/e.length:1);if(b){const t=new Map;for(const o of e)t.set(o.id,o);for(const e of S){const n=y(e.id,o,t);if(n.length>0){let t=0,o=0;for(const e of n)t+=e.x,o+=e.y;const r=p(e.id),s=r%360*(Math.PI/180),c=10+r%20;e.x=t/n.length+c*Math.cos(s),e.y=o/n.length+c*Math.sin(s)}else{const t=p(e.id),o=t%360*(Math.PI/180),n=15+t%30;e.x=g+n*Math.cos(o),e.y=h+n*Math.sin(o)}}}else{const t=2.399963229728653;for(let o=0;e.length>o;o++){const n=e[o];if(null==n.x||null==n.y||0===n.x&&0===n.y){const e=10*Math.sqrt(o+.5),r=o*t;n.x=g+e*Math.cos(r),n.y=h+e*Math.sin(r)}}}const k=l.__skipForceSimulation||0===l.iterations?0:b?40:l.iterations??Math.max(50,Math.min(300,Math.floor(300-2*(e.length-30)))),w=m(l.nodeSize,l.nodeSizeRange,e),_=t=>w(t);if(k>0){const u=new Map,y=new Map;for(const t of e)u.set(t.id,0),y.set(t.id,t);for(const t of o){const e="string"==typeof t.source?t.source:t.source.id,o="string"==typeof t.target?t.target:t.target.id;u.set(e,(u.get(e)??0)+1),u.set(o,(u.get(o)??0)+1)}const p=i().strength(t=>{const e=t.weight,o="string"==typeof t.target?t.target:t.target.id,n=Math.max(1,Math.min(u.get("string"==typeof t.source?t.source:t.source.id)??1,u.get(o)??1));return Math.min(2.5,(e&&e>0?Math.sqrt(e):1)*d/(.1*n))}).distance(t=>{const e="string"==typeof t.source?y.get(t.source):t.source,o="string"==typeof t.target?y.get(t.target):t.target,n=(e?_(e):0)+(o?_(o):0)+12;return Math.max(40,n)}).id(t=>t.id),m=n();if(void 0===l.random&&void 0===l.seed||m.randomSource(l.random??t(l.seed)),m.force("charge",a().strength(t=>{const e=u.get(t.id)??0;return-15*_(t)*Math.sqrt(e+1)})).force("collide",f(t=>_(t)+3).strength(.9).iterations(2)).force("center",r(g,h).strength(.8)).force("x",s(g).strength(.06)).force("y",c(h).strength(.06)),m.nodes(e),o.length>0){const t=o.map(t=>({...t,source:"string"==typeof t.source?t.source:t.source.id,target:"string"==typeof t.target?t.target:t.target.id}));p.links(t),m.force("link",p)}b?m.alpha(.3):.1>m.alpha()&&m.alpha(1),m.stop();for(let t=0;k>t;++t)m.tick()}for(const t of e){if(null==t.x||null==t.y)continue;const e=_(t);t.x=Math.max(e,Math.min(u[0]-e,t.x)),t.y=Math.max(e,Math.min(u[1]-e,t.y)),t.x0=0,t.x1=0,t.y0=0,t.y1=0}const v=new Map;for(const t of e)v.set(t.id,t);for(const t of o){if("string"==typeof t.source){const e=v.get(t.source);e&&(t.source=e)}if("string"==typeof t.target){const e=v.get(t.target);e&&(t.target=e)}}},buildScene(t,o,n,r){const s=n.nodeStyle,c=n.edgeStyle,i=m(n.nodeSize,n.nodeSizeRange,t),a=Array.isArray(n.colorScheme)?n.colorScheme:n.themeCategorical&&n.themeCategorical.length>0?n.themeCategorical:e,f=new Map;t.forEach((t,e)=>{f.set(t.id,a[e%a.length])});const l=[],u=[],d=[];for(const e of t){if(null==e.x||null==e.y)continue;const t=i(g(e,"nodeSize")),o=s?s(g(e,"nodeStyle")):{},r={fill:o.fill||f.get(e.id)||n.themeSemantic?.primary||"#007bff",stroke:o.stroke||n.themeSemantic?.surface||"#fff",strokeWidth:o.strokeWidth??2,opacity:o.opacity};l.push({type:"circle",cx:e.x,cy:e.y,r:t,style:r,datum:e,id:e.id,label:e.id})}const h=new Map;for(const e of t)h.set(e.id,e);for(const t of o){const e="object"==typeof t.source?t.source:h.get(t.source),o="object"==typeof t.target?t.target:h.get(t.target);if(!e||!o)continue;if(null==e.x||null==e.y)continue;if(null==o.x||null==o.y)continue;const r=c?c(g(t,"edgeStyle")):{};u.push({type:"line",x1:e.x,y1:e.y,x2:o.x,y2:o.y,style:{stroke:r.stroke||n.themeSemantic?.border||n.themeSemantic?.secondary||"#999",strokeWidth:r.strokeWidth??1,opacity:r.opacity??.6},datum:t})}if(!1!==n.showLabels){const e=(y=n.nodeLabel)?"function"==typeof y?y:t=>t[y]||t.id:null;for(const o of t){if(null==o.x||null==o.y)continue;const t=e?e(o):o.id;if(!t)continue;const n=i(g(o,"nodeSize"));d.push({x:o.x,y:o.y-n-4,text:t+"",anchor:"middle",baseline:"auto",fontSize:11})}}var y;return{sceneNodes:l,sceneEdges:u,labels:d}}};function y(t,e,o){const n=[];for(const r of e){const e="string"==typeof r.source?r.source:r.source.id,s="string"==typeof r.target?r.target:r.target.id;let c=null;if(e===t?c=s:s===t&&(c=e),c){const t=o.get(c);!t||0===t.x&&0===t.y||n.push({x:t.x,y:t.y})}}return n}function p(t){let e=0;for(let o=0;t.length>o;o++)e=(e<<5)-e+t.charCodeAt(o)|0;return Math.abs(e)}function m(t,e,n){if(n.some(t=>null!=t.__forceRadius))return t=>t.__forceRadius??8;if(null==t)return()=>8;if("number"==typeof t)return()=>t;if("function"==typeof t)return e=>t(e)||8;const r=e||[5,20],s=[];for(const e of n){const o=e.data?.[t];"number"==typeof o&&s.push(o)}if(0===s.length)return()=>r[0];const[c,i]=o(s);if(c===i)return()=>(r[0]+r[1])/2;const a=l().domain([c,i]).range(r).clamp(!0);return e=>{const o=e.data?.[t];return null==o||"number"!=typeof o?r[0]:a(o)}}export{g as wrapWithDataHint,h as forceLayoutPlugin,m as resolveNodeSizeFn};
@@ -1 +1 @@
1
- import{annotationBudget as e,annotationDensity as t,isNoteAnnotation as n}from"./chunk-chunk-U66USBWU.module.min.js";import{symbol as i,symbolCircle as o,symbolCross as s,symbolDiamond as r,symbolSquare as a,symbolStar as c,symbolTriangle as f,symbolWye as d}from"d3-shape";var l={circle:o,square:a,triangle:f,diamond:r,star:c,cross:s,wye:d},u=["circle","triangle","diamond","star","square","chevron","cross","wye"];function h(e,t,n){if(n)return n;const s=e??"circle";return"chevron"===s?function(e){const t=1.5*b(e),n=.92*t;return`M0,${-t}L${n},${(.78*t).toFixed(3)}L0,${(.28*t).toFixed(3)}L${-n},${(.78*t).toFixed(3)}Z`}(t):i(l[s]??o,Math.max(1,t))()??""}function b(e){return Math.sqrt(Math.max(1,e)/Math.PI)}var y=new Map;function p(e,t,n){if(!n&&"circle"===(e??"circle"))return b(t);const i=n?"p:"+n:`${e}:${Math.round(t)}`,o=y.get(i);if(null!=o)return o;const s=(n??h(e,t)).match(/-?\d*\.?\d+(?:e-?\d+)?/gi);let r=0;if(s)for(let e=0;s.length>e+1;e+=2){const t=+s[e],n=+s[e+1],i=Math.sqrt(t*t+n*n);i>r&&(r=i)}return r>0||(r=b(t)),y.size>512&&y.clear(),y.set(i,r),r}var m=[40,40],x=[.5,.5];function g(e,t){const[n,i]=e.viewBox??m,[o,s]=e.anchor??x,r=i>0?i:1,a=Math.max(0,t)/r,c=(n>0?n:r)*a,f=r*a;return{width:c,height:f,scale:a,offsetX:-o*c,offsetY:-s*f}}function v(e,t){const n=g(e,t),i=[[n.offsetX,n.offsetY],[n.offsetX+n.width,n.offsetY],[n.offsetX,n.offsetY+n.height],[n.offsetX+n.width,n.offsetY+n.height]];let o=0;for(const[e,t]of i){const n=Math.sqrt(e*e+t*t);n>o&&(o=n)}return o}function w(e,t,n,i){if("none"!==e)return"color"===e||null==e?t??i:"accent"===e?n:e}var M=null;function k(e){if("undefined"==typeof Path2D)return null;M||(M=new Map);const t=M.get(e);if(t)return t;const n=new Path2D(e);return M.size>1024&&M.clear(),M.set(e,n),n}function I(e,t,n=0,i="horizontal"){const[o,s]=e.viewBox??m,r=Math.min(1,Math.max(0,n)),a=Math.min(1,Math.max(0,t));return a>r?r>0||1>a?"vertical"===i?{x:0,y:s*(1-a),width:o,height:s*(a-r)}:{x:o*r,y:0,width:o*(a-r),height:s}:null:{x:0,y:0,width:0,height:0}}function A(e,t){const n=g(e,t);return{centerDx:n.offsetX+n.width/2,centerDy:n.offsetY+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2,radius:Math.hypot(n.width,n.height)/2}}function S(e,t,n,i,o,s=e=>e){for(const r of t.parts){const t=k(r.d);if(!t)continue;const a=r.opacity??1,c=e.globalAlpha;1!==a&&(e.globalAlpha=c*a);const f=o?"none"===r.fill?void 0:o:w(r.fill,n,i);f&&(e.fillStyle=s(f),e.fill(t));const d=o?r.stroke&&"none"!==r.stroke?o:void 0:w(r.stroke??"none",n,i);d&&(e.strokeStyle=s(d),e.lineWidth=r.strokeWidth??1,e.lineCap=r.strokeLinecap??"butt",e.lineJoin=r.strokeLinejoin??"miter",e.stroke(t)),1!==a&&(e.globalAlpha=c)}}function V(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function $(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function T(e){return null==e?null:e+""}function N(e,t,n){return t.stickyPositionCache?.set(e,n),n}function P(e,t,n){const i=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===i){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let i=n.pointNodes.length-1;i>=0;i--){const o=n.pointNodes[i];if(o.pointId===e.pointId)return N(t,n,{x:o.x,y:o.y})}const i=function(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],i=e.scales?.x??e.scales?.time,o=e.scales?.y??e.scales?.value;if(!i||!o)return null;const s=n[e.xAccessor||"x"],r=n[e.yAccessor||"y"];return null==s||null==r?null:{x:i(s),y:o(r)}}(n);return i?N(t,n,i):null}if("semantic"===i){const i=function(e,t,n){const i=function(e){return T(e.provenance?.stableId??e.stableId)}(e);if(!i)return null;const o=n.pointNodes?.find(e=>T(e.pointId)===i);if(o)return N(t,n,{x:o.x,y:o.y});const s=n.data?.find(e=>function(e){return T(e.stableId??e.id??e.provenance?.stableId)}(e)===i);if(!s)return null;const r=V(s,n),a=$(s,n);return null==r||null==a?null:N(t,n,{x:r,y:a})}(e,t,n);if(i)return i}let o=null,s=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(o=t.x,s=t.y)}if(null!=o&&null!=s||(o=V(e,n),s=$(e,n)),null!=o&&null!=s)return N(t,n,{x:o,y:s});if("sticky"===i){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function W(e,t,n,i=50){return!(-i>e||e>(n.width||0)+i||-i>t||t>(n.height||0)+i)}var j=32,C=6,D=4,F=8,z=72;var L={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};function X(e){if(!Y(e))return e;const t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function Y(e){return n(e)}function q(e,t){if(!e)return[];const n=Math.max(1,Math.floor(t/7)),i=e.split(/\s+/).filter(Boolean),o=[];let s="";for(const e of i)s&&s.length+e.length+1>n?(o.push(s),s=e):s=s?`${s} ${e}`:e;return s&&o.push(s),o}function B(e,t,n,i,o){const s=e+n,r=t+i;return Math.abs(n)>Math.abs(i)?{x:0>n?s-o.width-4:s+4,y:0>i?r-o.height:r,width:o.width,height:o.height}:{x:0>n?s-o.width:s,y:0>i?r-o.height-4:r+4,width:o.width,height:o.height}}function O(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function R(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function U(e,t,n,i,o,s,r,a){const c=O(e,r);let f=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,n,i){const o=Math.max(0,i-e.x),s=Math.max(0,i-e.y);return(o+Math.max(0,e.x+e.width-(t-i)))*e.height+(s+Math.max(0,e.y+e.height-(n-i)))*e.width}(c,o,s,a);for(const e of n)f+=12*R(c,e);for(const e of i)f+=4*R(c,e);return f}function G(n){const{annotations:i,context:o,defaultOffset:s=j,notePadding:r=C,markPadding:a=D,edgePadding:c=F,preserveManualOffsets:f=!0,routeLongConnectors:d=!0,connectorThreshold:l=z,density:u,progressiveDisclosure:h=!1,redundantCues:b=!1,responsive:y,mobile:p,cohesion:m,audience:x}=n,g=o.width||0,v=o.height||0,w="object"==typeof p?p:{},M=w.breakpoint??480,k=!!p&&M>=g,I=k&&!1!==w.preferShortText?i.map(X):i,A=k&&!u?{maxAnnotations:w.maxAnnotations??("callout-list"===w.strategy?1:2),minVisible:w.minVisible??1}:u,S=h||k&&(!1!==w.progressiveDisclosure||"callout-list"===w.strategy),V=k&&!y?w.responsive??{minWidth:M}:y,$=k&&!m?w.cohesion:m;if(0===I.length||0>=g||0>=v)return I.slice();const T=[],N=function(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}(o,a);let W=!1;const R=I.map((e,t)=>{if(!Y(e))return e;const n=function(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const i=e.pointId??e.nodeId;if(null!=i&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===i);if(e)return{x:e.x,y:e.y}}const o=e.coordinates,s=n.scales?.geoProjection;if(Array.isArray(o)&&o.length>=2&&s){const e=o[0],t=o[1];if("number"==typeof e&&"number"==typeof t){const n=s([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?P(e,t,n):{x:e.x,y:e.y}}(e,t,o);if(!n)return e;const i=function(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t="number"==typeof e.wrap?e.wrap:120,n=[...q("string"==typeof e.title?e.title:void 0,t),...q("string"==typeof e.label?e.label:void 0,t)],i=n.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(t,7*i)+10),height:Math.max(18,16*n.length+6)}}(e);if(f&&("number"==typeof(a=e).dx||"number"==typeof a.dy)){const t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e);return T.push(O(B(n.x,n.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,i),r)),e}var a;let u=null,h=1/0;for(const e of function(e){const t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}(s)){const t=U(B(n.x,n.y,e.dx,e.dy,i),e,T,N,g,v,r,c);h>t&&(u=e,h=t)}if(!u)return e;const b=O(B(n.x,n.y,u.dx,u.dy,i),r);T.push(b);const y=Math.hypot(u.dx,u.dy),p=d&&y>=l&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return W=!0,{...e,dx:u.dx,dy:u.dy,...p?{connector:p}:{}}}),G=W?R:I.slice();let _=G;if(b){let e=!1;const t=G.map(t=>{const n=function(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}(t);return n!==t&&(e=!0),n});_=e?t:G}{let e=!1;const t=_.map(t=>{if(!0!==t?.defensive)return t;const n=function(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?L[t.source]??t.source:null,i="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!i)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const o=[n,i].filter(Boolean).join(" · "),s="string"==typeof e.label?e.label:"";return s.includes(`(${o})`)?e:{...e,label:s?`${s} (${o})`:`(${o})`}}(t);return n!==t&&(e=!0),n});_=e?t:_}const H=new Set;if(A){const n="object"==typeof A?A:{},i=function(e){if(!e)return 1;const t=function(e){const t=e?.familiarity;if(!t)return 3;const n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}(e);return t>2?4>t?1:.6:1.5}(x),o=1===i?n:{...n,maxAnnotations:Math.max(0,Math.round((n.maxAnnotations??e(g,v,n))*i))},{deferred:s}=t({annotations:_,width:g,height:v,...o});for(const e of s)H.add(e)}if(V&&("object"==typeof V&&"number"==typeof V.minWidth?V.minWidth:480)>=g)for(const e of _)Y(e)&&"secondary"===e.emphasis&&H.add(e);if(H.size>0)for(const e of _)!0===e?.defensive&&H.delete(e);let J;return J=0===H.size?_:S?_.map(e=>H.has(e)?{...e,_annotationDeferred:!0}:e):_.filter(e=>!H.has(e)),$?function(e,t){let n=!1;const i=e.map(e=>Y(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?i:e}(J,$):J}var _={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"};function H(e,t){const n={...e};for(const e of t)n[_[e]]++;return n}function J(e,t,n){const i=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:i,revisions:H(n,i)}}var Z=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=J({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){const n=J(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}};function E(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function K(e,t,n){const i=e=>e.toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(n)}`}function Q(e){const t=e.map(E),n=t.length-1;return e=>{if(0>=e){const[e,n,i]=t[0];return K(e,n,i)}if(e>=1){const[e,i,o]=t[n];return K(e,i,o)}const i=e*n,o=Math.floor(i),s=i-o,[r,a,c]=t[o],[f,d,l]=t[o+1];return K(Math.round(r+(f-r)*s),Math.round(a+(d-a)*s),Math.round(c+(l-c)*s))}}var ee=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],te=["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],ne=["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],ie=Q(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),oe=Q(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),se=Q(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),re=Q(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),ae=Q(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),ce=Q(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),fe=Q(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),de=Q(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),le=Q(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),ue=Q(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),he=Q(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),be=Q(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),ye={blues:ie,reds:oe,greens:se,viridis:fe,oranges:re,purples:ae,greys:ce,plasma:de,inferno:le,magma:ue,cividis:he,turbo:be};function pe(e){return e&&ye[e]||ie}Q(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),Q(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),Q(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),Q(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),Q(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),Q(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),Q(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]);var me=()=>"undefined"!=typeof performance?performance.now():Date.now();function xe(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function ge(e,t){const n=e();return Number.isFinite(n)?n:t}var ve=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??me,this.lastWallTime=ge(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=ge(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??me;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=ge(t,this.lastWallTime))}setRandomSource(e,t){const n=function(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:xe(n)))}};export{ee as schemeCategory10,te as schemeTableau10,ne as schemeSet3,fe as interpolateViridis,ye as SEQUENTIAL_INTERPOLATORS,pe as getSequentialInterpolator,u as SYMBOL_SEQUENCE,h as symbolPathString,b as symbolRadius,p as symbolExtent,Z as UpdateResultTracker,m as DEFAULT_GLYPH_VIEWBOX,x as DEFAULT_GLYPH_ANCHOR,g as glyphPlacement,v as glyphExtent,w as resolveGlyphPaint,I as glyphFractionClipRect,A as glyphHitGeometry,S as drawGlyphParts,V as resolveX,$ as resolveY,P as resolveAnchoredPosition,W as isInBounds,G as annotationLayout,xe as createSeededFrameRandom,ve as FrameRuntime};
1
+ import{annotationBudget as e,annotationDensity as t,isNoteAnnotation as n}from"./chunk-chunk-U66USBWU.module.min.js";import{symbol as i,symbolCircle as o,symbolCross as s,symbolDiamond as r,symbolSquare as a,symbolStar as c,symbolTriangle as f,symbolWye as d}from"d3-shape";var l={circle:o,square:a,triangle:f,diamond:r,star:c,cross:s,wye:d},u=["circle","triangle","diamond","star","square","chevron","cross","wye"];function h(e,t,n){if(n)return n;const s=e??"circle";return"chevron"===s?function(e){const t=1.5*b(e),n=.92*t;return`M0,${-t}L${n},${(.78*t).toFixed(3)}L0,${(.28*t).toFixed(3)}L${-n},${(.78*t).toFixed(3)}Z`}(t):i(l[s]??o,Math.max(1,t))()??""}function b(e){return Math.sqrt(Math.max(1,e)/Math.PI)}var y=new Map;function p(e,t,n){if(!n&&"circle"===(e??"circle"))return b(t);const i=n?"p:"+n:`${e}:${Math.round(t)}`,o=y.get(i);if(null!=o)return o;const s=(n??h(e,t)).match(/-?\d*\.?\d+(?:e-?\d+)?/gi);let r=0;if(s)for(let e=0;s.length>e+1;e+=2){const t=+s[e],n=+s[e+1],i=Math.sqrt(t*t+n*n);i>r&&(r=i)}return r>0||(r=b(t)),y.size>512&&y.clear(),y.set(i,r),r}var m=[40,40],x=[.5,.5];function g(e,t){const[n,i]=e.viewBox??m,[o,s]=e.anchor??x,r=i>0?i:1,a=Math.max(0,t)/r,c=(n>0?n:r)*a,f=r*a;return{width:c,height:f,scale:a,offsetX:-o*c,offsetY:-s*f}}function v(e,t){const n=g(e,t),i=[[n.offsetX,n.offsetY],[n.offsetX+n.width,n.offsetY],[n.offsetX,n.offsetY+n.height],[n.offsetX+n.width,n.offsetY+n.height]];let o=0;for(const[e,t]of i){const n=Math.sqrt(e*e+t*t);n>o&&(o=n)}return o}function w(e,t,n,i){if("none"!==e)return"color"===e||null==e?t??i:"accent"===e?n:e}var M=null;function k(e){if("undefined"==typeof Path2D)return null;M||(M=new Map);const t=M.get(e);if(t)return t;const n=new Path2D(e);return M.size>1024&&M.clear(),M.set(e,n),n}function I(e,t,n=0,i="horizontal"){const[o,s]=e.viewBox??m,r=Math.min(1,Math.max(0,n)),a=Math.min(1,Math.max(0,t));return a>r?r>0||1>a?"vertical"===i?{x:0,y:s*(1-a),width:o,height:s*(a-r)}:{x:o*r,y:0,width:o*(a-r),height:s}:null:{x:0,y:0,width:0,height:0}}function A(e,t){const n=g(e,t);return{centerDx:n.offsetX+n.width/2,centerDy:n.offsetY+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2,radius:Math.hypot(n.width,n.height)/2}}function S(e,t,n,i,o,s=e=>e){for(const r of t.parts){const t=k(r.d);if(!t)continue;const a=r.opacity??1,c=e.globalAlpha;1!==a&&(e.globalAlpha=c*a);const f=o?"none"===r.fill?void 0:o:w(r.fill,n,i);f&&(e.fillStyle=s(f),e.fill(t));const d=o?r.stroke&&"none"!==r.stroke?o:void 0:w(r.stroke??"none",n,i);d&&(e.strokeStyle=s(d),e.lineWidth=r.strokeWidth??1,e.lineCap=r.strokeLinecap??"butt",e.lineJoin=r.strokeLinejoin??"miter",e.stroke(t)),1!==a&&(e.globalAlpha=c)}}function V(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function $(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function T(e){return null==e?null:e+""}function N(e,t,n){return t.stickyPositionCache?.set(e,n),n}function P(e,t,n){const i=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===i){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let i=n.pointNodes.length-1;i>=0;i--){const o=n.pointNodes[i];if(o.pointId===e.pointId)return N(t,n,{x:o.x,y:o.y})}const i=function(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],i=e.scales?.x??e.scales?.time,o=e.scales?.y??e.scales?.value;if(!i||!o)return null;const s=n[e.xAccessor||"x"],r=n[e.yAccessor||"y"];return null==s||null==r?null:{x:i(s),y:o(r)}}(n);return i?N(t,n,i):null}if("semantic"===i){const i=function(e,t,n){const i=function(e){return T(e.provenance?.stableId??e.stableId)}(e);if(!i)return null;const o=n.pointNodes?.find(e=>T(e.pointId)===i);if(o)return N(t,n,{x:o.x,y:o.y});const s=n.data?.find(e=>function(e){return T(e.stableId??e.id??e.provenance?.stableId)}(e)===i);if(!s)return null;const r=V(s,n),a=$(s,n);return null==r||null==a?null:N(t,n,{x:r,y:a})}(e,t,n);if(i)return i}let o=null,s=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(o=t.x,s=t.y)}if(null!=o&&null!=s||(o=V(e,n),s=$(e,n)),null!=o&&null!=s)return N(t,n,{x:o,y:s});if("sticky"===i){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function W(e,t,n,i=50){return!(-i>e||e>(n.width||0)+i||-i>t||t>(n.height||0)+i)}var j=32,C=6,D=4,F=8,z=72;var L={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};function X(e){if(!Y(e))return e;const t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function Y(e){return n(e)}function q(e,t){if(!e)return[];const n=Math.max(1,Math.floor(t/7)),i=e.split(/\s+/).filter(Boolean),o=[];let s="";for(const e of i)s&&s.length+e.length+1>n?(o.push(s),s=e):s=s?`${s} ${e}`:e;return s&&o.push(s),o}function B(e,t,n,i,o){const s=e+n,r=t+i;return Math.abs(n)>Math.abs(i)?{x:0>n?s-o.width-4:s+4,y:0>i?r-o.height:r,width:o.width,height:o.height}:{x:0>n?s-o.width:s,y:0>i?r-o.height-4:r+4,width:o.width,height:o.height}}function O(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function R(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function U(e,t,n,i,o,s,r,a){const c=O(e,r);let f=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,n,i){const o=Math.max(0,i-e.x),s=Math.max(0,i-e.y);return(o+Math.max(0,e.x+e.width-(t-i)))*e.height+(s+Math.max(0,e.y+e.height-(n-i)))*e.width}(c,o,s,a);for(const e of n)f+=12*R(c,e);for(const e of i)f+=4*R(c,e);return f}function G(n){const{annotations:i,context:o,defaultOffset:s=j,notePadding:r=C,markPadding:a=D,edgePadding:c=F,preserveManualOffsets:f=!0,routeLongConnectors:d=!0,connectorThreshold:l=z,density:u,progressiveDisclosure:h=!1,redundantCues:b=!1,responsive:y,mobile:p,cohesion:m,audience:x}=n,g=o.width||0,v=o.height||0,w="object"==typeof p?p:{},M=w.breakpoint??480,k=!!p&&M>=g,I=k&&!1!==w.preferShortText?i.map(X):i,A=k&&!u?{maxAnnotations:w.maxAnnotations??("callout-list"===w.strategy?1:2),minVisible:w.minVisible??1}:u,S=h||k&&(!1!==w.progressiveDisclosure||"callout-list"===w.strategy),V=k&&!y?w.responsive??{minWidth:M}:y,$=k&&!m?w.cohesion:m;if(0===I.length||0>=g||0>=v)return I.slice();const T=[],N=function(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}(o,a);let W=!1;const R=I.map((e,t)=>{if(!Y(e))return e;const n=function(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const i=e.pointId??e.nodeId;if(null!=i&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===i);if(e)return{x:e.x,y:e.y}}const o=e.coordinates,s=n.scales?.geoProjection;if(Array.isArray(o)&&o.length>=2&&s){const e=o[0],t=o[1];if("number"==typeof e&&"number"==typeof t){const n=s([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?P(e,t,n):{x:e.x,y:e.y}}(e,t,o);if(!n)return e;const i=function(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t="number"==typeof e.wrap?e.wrap:120,n=[...q("string"==typeof e.title?e.title:void 0,t),...q("string"==typeof e.label?e.label:void 0,t)],i=n.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(t,7*i)+10),height:Math.max(18,16*n.length+6)}}(e);if(f&&("number"==typeof(a=e).dx||"number"==typeof a.dy)){const t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e);return T.push(O(B(n.x,n.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,i),r)),e}var a;let u=null,h=1/0;for(const e of function(e){const t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}(s)){const t=U(B(n.x,n.y,e.dx,e.dy,i),e,T,N,g,v,r,c);h>t&&(u=e,h=t)}if(!u)return e;const b=O(B(n.x,n.y,u.dx,u.dy,i),r);T.push(b);const y=Math.hypot(u.dx,u.dy),p=d&&y>=l&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return W=!0,{...e,dx:u.dx,dy:u.dy,...p?{connector:p}:{}}}),G=W?R:I.slice();let _=G;if(b){let e=!1;const t=G.map(t=>{const n=function(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}(t);return n!==t&&(e=!0),n});_=e?t:G}{let e=!1;const t=_.map(t=>{if(!0!==t?.defensive)return t;const n=function(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?L[t.source]??t.source:null,i="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!i)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const o=[n,i].filter(Boolean).join(" · "),s="string"==typeof e.label?e.label:"";return s.includes(`(${o})`)?e:{...e,label:s?`${s} (${o})`:`(${o})`}}(t);return n!==t&&(e=!0),n});_=e?t:_}const H=new Set;if(A){const n="object"==typeof A?A:{},i=function(e){if(!e)return 1;const t=function(e){const t=e?.familiarity;if(!t)return 3;const n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}(e);return t>2?4>t?1:.6:1.5}(x),o=1===i?n:{...n,maxAnnotations:Math.max(0,Math.round((n.maxAnnotations??e(g,v,n))*i))},{deferred:s}=t({annotations:_,width:g,height:v,...o});for(const e of s)H.add(e)}if(V&&("object"==typeof V&&"number"==typeof V.minWidth?V.minWidth:480)>=g)for(const e of _)Y(e)&&"secondary"===e.emphasis&&H.add(e);if(H.size>0)for(const e of _)!0===e?.defensive&&H.delete(e);let J;return J=0===H.size?_:S?_.map(e=>H.has(e)?{...e,_annotationDeferred:!0}:e):_.filter(e=>!H.has(e)),$?function(e,t){let n=!1;const i=e.map(e=>Y(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?i:e}(J,$):J}var _={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"};function H(e,t){const n={...e};for(const e of t)n[_[e]]++;return n}function J(e,t,n){const i=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:i,revisions:H(n,i)}}var Z=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=J({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){const n=J(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}};function E(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function K(e,t,n){const i=e=>e.toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(n)}`}function Q(e){const t=e.map(E),n=t.length-1;return e=>{if(0>=e){const[e,n,i]=t[0];return K(e,n,i)}if(e>=1){const[e,i,o]=t[n];return K(e,i,o)}const i=e*n,o=Math.floor(i),s=i-o,[r,a,c]=t[o],[f,d,l]=t[o+1];return K(Math.round(r+(f-r)*s),Math.round(a+(d-a)*s),Math.round(c+(l-c)*s))}}var ee=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],te=["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],ne=["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],ie=Q(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),oe=Q(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),se=Q(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),re=Q(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),ae=Q(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),ce=Q(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),fe=Q(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),de=Q(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),le=Q(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),ue=Q(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),he=Q(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),be=Q(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),ye={blues:ie,reds:oe,greens:se,viridis:fe,oranges:re,purples:ae,greys:ce,plasma:de,inferno:le,magma:ue,cividis:he,turbo:be};function pe(e){return e&&ye[e]||ie}var me=Q(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),xe=Q(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),ge=Q(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),ve=Q(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),we=Q(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),Me=Q(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),ke=Q(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]),Ie=()=>"undefined"!=typeof performance?performance.now():Date.now();function Ae(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function Se(e,t){const n=e();return Number.isFinite(n)?n:t}var Ve=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??Ie,this.lastWallTime=Se(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=Se(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??Ie;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=Se(t,this.lastWallTime))}setRandomSource(e,t){const n=function(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:Ae(n)))}};export{ee as schemeCategory10,te as schemeTableau10,ne as schemeSet3,fe as interpolateViridis,ye as SEQUENTIAL_INTERPOLATORS,pe as getSequentialInterpolator,me as interpolateRdBu,xe as interpolatePiYG,ge as interpolatePRGn,ve as interpolateBrBG,we as interpolateRdYlBu,Me as interpolateRdYlGn,ke as interpolateSpectral,u as SYMBOL_SEQUENCE,h as symbolPathString,b as symbolRadius,p as symbolExtent,Z as UpdateResultTracker,m as DEFAULT_GLYPH_VIEWBOX,x as DEFAULT_GLYPH_ANCHOR,g as glyphPlacement,v as glyphExtent,w as resolveGlyphPaint,I as glyphFractionClipRect,A as glyphHitGeometry,S as drawGlyphParts,V as resolveX,$ as resolveY,P as resolveAnchoredPosition,W as isInBounds,G as annotationLayout,Ae as createSeededFrameRandom,Ve as FrameRuntime};