semiotic 3.8.1 → 3.8.2

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 (147) hide show
  1. package/CLAUDE.md +3 -1
  2. package/README.md +53 -52
  3. package/ai/behaviorContracts.cjs +9 -0
  4. package/ai/dist/mcp-server.js +142 -13
  5. package/ai/schema.json +616 -42
  6. package/ai/surface-manifest.json +1 -1
  7. package/ai/system-prompt.md +5 -2
  8. package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +2 -0
  9. package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +1 -0
  10. package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +2 -0
  11. package/dist/chunk-chunk-255KDHW5.module.min.js +1 -0
  12. package/dist/chunk-chunk-27HVVXS6.module.min.js +1 -0
  13. package/dist/chunk-chunk-2CXCXRB4.module.min.js +1 -0
  14. package/dist/chunk-chunk-2JGJ5GUG.module.min.js +2 -0
  15. package/dist/chunk-chunk-2UN3ANRN.module.min.js +2 -0
  16. package/dist/chunk-chunk-2VUEY5TH.module.min.js +1 -0
  17. package/dist/chunk-chunk-2WVCH4PL.module.min.js +1 -0
  18. package/dist/chunk-chunk-5UKL5W76.module.min.js +2 -0
  19. package/dist/chunk-chunk-5WEFWNUW.module.min.js +2 -0
  20. package/dist/chunk-chunk-6F6GEAQU.module.min.js +1 -0
  21. package/dist/chunk-chunk-7LHMKRKE.module.min.js +2 -0
  22. package/dist/chunk-chunk-BHYTYMY2.module.min.js +2 -0
  23. package/dist/chunk-chunk-C6EJ4IOD.module.min.js +2 -0
  24. package/dist/chunk-chunk-CA3YDW6F.module.min.js +1 -0
  25. package/dist/chunk-chunk-CP3EN6KZ.module.min.js +1 -0
  26. package/dist/chunk-chunk-CYIML3AV.module.min.js +2 -0
  27. package/dist/chunk-chunk-DNY43POY.module.min.js +1 -0
  28. package/dist/chunk-chunk-DSNGDNJY.module.min.js +1 -0
  29. package/dist/chunk-chunk-E7MIQX7D.module.min.js +2 -0
  30. package/dist/chunk-chunk-EMO5NUGE.module.min.js +1 -0
  31. package/dist/chunk-chunk-ES4DCG3L.module.min.js +1 -0
  32. package/dist/chunk-chunk-FAKO3RGQ.module.min.js +2 -0
  33. package/dist/chunk-chunk-FYY2ACNJ.module.min.js +2 -0
  34. package/dist/chunk-chunk-G7WFWHAD.module.min.js +2 -0
  35. package/dist/chunk-chunk-GMQ5AYTD.module.min.js +1 -0
  36. package/dist/chunk-chunk-H4PPRW6N.module.min.js +1 -0
  37. package/dist/chunk-chunk-IFYPMWKY.module.min.js +1 -0
  38. package/dist/chunk-chunk-J3ELI22J.module.min.js +1 -0
  39. package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
  40. package/dist/chunk-chunk-J3XWETBJ.module.min.js +2 -0
  41. package/dist/chunk-chunk-JCG72SGW.module.min.js +2 -0
  42. package/dist/{semiotic-ai-chunk-OG7BQUUW.module.min.js → chunk-chunk-JJ2OOIET.module.min.js} +0 -1
  43. package/dist/chunk-chunk-KTWEBFMX.module.min.js +2 -0
  44. package/dist/chunk-chunk-L6D3I3V7.module.min.js +2 -0
  45. package/dist/chunk-chunk-M337NY6L.module.min.js +1 -0
  46. package/dist/chunk-chunk-NO4MCQVD.module.min.js +1 -0
  47. package/dist/chunk-chunk-ODUZEEBH.module.min.js +2 -0
  48. package/dist/chunk-chunk-P6UBCMSQ.module.min.js +2 -0
  49. package/dist/chunk-chunk-Q2YADC2V.module.min.js +2 -0
  50. package/dist/chunk-chunk-QRIBHZYW.module.min.js +1 -0
  51. package/dist/chunk-chunk-QSQVBIJA.module.min.js +1 -0
  52. package/dist/chunk-chunk-RCF52Z42.module.min.js +2 -0
  53. package/dist/chunk-chunk-RH5TSQPH.module.min.js +1 -0
  54. package/dist/chunk-chunk-ROP4HI7H.module.min.js +2 -0
  55. package/dist/chunk-chunk-RZH7VZYS.module.min.js +2 -0
  56. package/dist/chunk-chunk-SIRIJ3DY.module.min.js +1 -0
  57. package/dist/chunk-chunk-STZFFTAN.module.min.js +2 -0
  58. package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
  59. package/dist/chunk-chunk-T27ZEV6A.module.min.js +1 -0
  60. package/dist/chunk-chunk-U3AGQ5EF.module.min.js +2 -0
  61. package/dist/chunk-chunk-U66USBWU.module.min.js +1 -0
  62. package/dist/chunk-chunk-VVCA3DB7.module.min.js +1 -0
  63. package/dist/chunk-chunk-W3DB2MN4.module.min.js +2 -0
  64. package/dist/chunk-chunk-WCX6U47H.module.min.js +2 -0
  65. package/dist/chunk-chunk-WDIN4LRC.module.min.js +1 -0
  66. package/dist/chunk-chunk-XEVJDUTH.module.min.js +1 -0
  67. package/dist/chunk-chunk-XOYX77KF.module.min.js +2 -0
  68. package/dist/chunk-chunk-YCQYG6J5.module.min.js +2 -0
  69. package/dist/chunk-chunk-YHNZCPOZ.module.min.js +2 -0
  70. package/dist/chunk-chunk-YWZB3KPI.module.min.js +2 -0
  71. package/dist/chunk-chunk-Z5KXAVQD.module.min.js +2 -0
  72. package/dist/chunk-chunk-ZCNBUZPL.module.min.js +2 -0
  73. package/dist/chunk-chunk-ZLKRTF5N.module.min.js +2 -0
  74. package/dist/chunk-chunk-ZTNVDWAK.module.min.js +2 -0
  75. package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +2 -0
  76. package/dist/components/charts/physics/PhysicalFlowChart.d.ts +7 -0
  77. package/dist/components/charts/shared/auditAccessibilityText.d.ts +13 -0
  78. package/dist/components/server/staticSVGChrome.d.ts +3 -2
  79. package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -2
  80. package/dist/components/stream/OrdinalBrushOverlayLazy.d.ts +9 -0
  81. package/dist/components/stream/XYBrushOverlayLazy.d.ts +17 -0
  82. package/dist/controls.min.js +1 -1
  83. package/dist/controls.module.min.js +1 -1
  84. package/dist/geo.min.js +1 -1
  85. package/dist/geo.module.min.js +1 -1
  86. package/dist/network.min.js +1 -1
  87. package/dist/network.module.min.js +1 -1
  88. package/dist/ordinal.min.js +1 -1
  89. package/dist/ordinal.module.min.js +1 -1
  90. package/dist/physics-matter.min.js +1 -1
  91. package/dist/physics-matter.module.min.js +1 -1
  92. package/dist/physics-rapier.min.js +1 -1
  93. package/dist/physics-rapier.module.min.js +1 -1
  94. package/dist/physics.min.js +1 -1
  95. package/dist/physics.module.min.js +1 -1
  96. package/dist/realtime.min.js +1 -1
  97. package/dist/realtime.module.min.js +1 -1
  98. package/dist/rough.min.js +1 -1
  99. package/dist/rough.module.min.js +1 -1
  100. package/dist/semiotic-ai-core.min.js +1 -1
  101. package/dist/semiotic-ai-core.module.min.js +1 -1
  102. package/dist/semiotic-ai.min.js +1 -1
  103. package/dist/semiotic-ai.module.min.js +1 -1
  104. package/dist/semiotic-data.min.js +1 -1
  105. package/dist/semiotic-data.module.min.js +1 -1
  106. package/dist/semiotic-experimental.min.js +1 -1
  107. package/dist/semiotic-experimental.module.min.js +1 -1
  108. package/dist/semiotic-realtime-core.min.js +1 -1
  109. package/dist/semiotic-realtime-core.module.min.js +1 -1
  110. package/dist/semiotic-realtime-react.min.js +1 -1
  111. package/dist/semiotic-realtime-react.module.min.js +1 -1
  112. package/dist/semiotic-recipes-core.min.js +1 -1
  113. package/dist/semiotic-recipes-core.module.min.js +1 -1
  114. package/dist/semiotic-recipes-react.min.js +1 -1
  115. package/dist/semiotic-recipes-react.module.min.js +1 -1
  116. package/dist/semiotic-recipes.min.js +1 -1
  117. package/dist/semiotic-recipes.module.min.js +1 -1
  118. package/dist/semiotic-server-edge.min.js +1 -1
  119. package/dist/semiotic-server-edge.module.min.js +1 -1
  120. package/dist/semiotic-server-node.min.js +1 -1
  121. package/dist/semiotic-server-node.module.min.js +1 -1
  122. package/dist/semiotic-themes-core.min.js +1 -1
  123. package/dist/semiotic-themes-core.module.min.js +1 -1
  124. package/dist/semiotic-themes-react.min.js +1 -1
  125. package/dist/semiotic-themes-react.module.min.js +1 -1
  126. package/dist/semiotic-themes.min.js +1 -1
  127. package/dist/semiotic-themes.module.min.js +1 -1
  128. package/dist/semiotic-utils-core.min.js +1 -1
  129. package/dist/semiotic-utils-core.module.min.js +1 -1
  130. package/dist/semiotic-utils-react.min.js +1 -1
  131. package/dist/semiotic-utils-react.module.min.js +1 -1
  132. package/dist/semiotic-utils.min.js +1 -1
  133. package/dist/semiotic-utils.module.min.js +1 -1
  134. package/dist/semiotic-value.min.js +1 -1
  135. package/dist/semiotic-value.module.min.js +1 -1
  136. package/dist/semiotic.min.js +1 -1
  137. package/dist/semiotic.module.min.js +1 -1
  138. package/dist/server.min.js +1 -1
  139. package/dist/server.module.min.js +1 -1
  140. package/dist/xy.min.js +1 -1
  141. package/dist/xy.module.min.js +1 -1
  142. package/package.json +4 -4
  143. package/dist/semiotic-ai-statisticalOverlays-CY4WKR4A.module.min.js +0 -2
  144. package/dist/semiotic-chunk-3FSVZ46U.module.min.js +0 -2
  145. package/dist/semiotic-statisticalOverlays-UOMSFKVJ.module.min.js +0 -2
  146. package/dist/xy-chunk-IWD6IB6V.module.min.js +0 -2
  147. package/dist/xy-statisticalOverlays-7RWG6LJT.module.min.js +0 -2
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i={};function n(e){let t=1/0,a=-1/0;for(const r of e)t>r&&(t=r),r>a&&(a=r);return[t,a]}function s(e,t){const{field:a,bins:r=10}=t,o=e.map(e=>Number(e[a])).filter(e=>!isNaN(e));if(0===o.length)return[];const[i,s]=n(o),l=t.domain?t.domain[0]:i,c=t.domain?t.domain[1]:s;if(l===c)return[{category:`${l}-${c}`,value:o.length}];const u=(c-l)/r,d=Array(r).fill(0);for(const e of o){let t=Math.floor((e-l)/u);t===r&&(t=r-1),t>=0&&r>t&&d[t]++}return d.map((e,t)=>{const a=l+t*u,r=a+u;return{category:`${f(a)}-${f(r)}`,value:e}})}function l(e,t){const{groupBy:a,value:r,agg:o="sum"}=t,i=new Map;for(const t of e){const e=t[a]+"";i.has(e)||i.set(e,[]),i.get(e).push(Number(t[r]))}const s=[];for(const[e,t]of i){let r;switch(o){case"count":r=t.length;break;case"mean":r=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":r=n(t)[0];break;case"max":r=n(t)[1];break;default:r=t.reduce((e,t)=>e+t,0)}s.push({[a]:e,value:r})}return s}function c(e,t){const{key:a,fields:r}=t,o=new Map;for(const t of e){const e=t[a]+"";if(o.has(e)||o.set(e,[]),r){const a={};for(const e of r)e in t&&(a[e]=t[e]);o.get(e).push(a)}else o.get(e).push({...t})}const i=[];for(const[e,t]of o)i.push({id:e,coordinates:t});return i}function u(e,t){const{columns:a,nameField:r="name",valueField:o="value"}=t,i=new Set(a),n=[];for(const t of e){const e={};for(const a of Object.keys(t))i.has(a)||(e[a]=t[a]);for(const i of a)n.push({...e,[r]:i,[o]:t[i]})}return n}function f(e){return Math.round(1e3*e)/1e3+""}function d(e){return"nominal"===e||"ordinal"===e}function p(e){return"quantitative"===e||"temporal"===e}((e,a)=>{for(var r in a)t(e,r,{get:a[r],enumerable:!0})})(i,{bin:()=>s,fromArrow:()=>x,fromVegaLite:()=>b,groupBy:()=>c,mergeData:()=>A,pivot:()=>u,rollup:()=>l}),module.exports=(e=i,((e,i,n,s)=>{if(i)for(let n of r(i))o.call(e,n)||void 0===n||t(e,n,{get:()=>i[n],enumerable:!(s=a(i,n))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var m={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},y={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},g={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function b(e){e=function(e){if(!function(e){return e.usermeta?.idid}(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!function(e){return"annotation-layer"===e.usermeta?.idid?.role}(e));if(1!==t.length)return e;const{layer:a,...r}=e,{usermeta:o,...i}=t[0];return{...r,...i}}(e);const t=[],{type:a,markProps:r}=function(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...a}=e;return{type:t,markProps:a}}(e.mark),o=e.encoding||{},i=o.x,n=o.y,s=o.color,c=o.size,u=o.theta,f=o.opacity;let b;e.data?.values?b=e.data.values:e.data?.url&&t.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&t.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&t.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&t.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||o.facet||o.row||o.column)&&t.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&t.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&t.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const x={};e.width&&(x.width=e.width),e.height&&(x.height=e.height);const A=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(A&&(x.title=A),s?.field&&(x.colorBy=s.field,s.scale?.scheme)){const e=m[s.scale.scheme];e&&(x.colorScheme=e)}void 0!==f?.value&&(x.pointOpacity=f.value);const w=i?.aggregate,k=n?.aggregate;if(b&&(w||k)){const e=k?n:i,t=k?i:n,a=g[e.aggregate];if(a&&t?.field&&e.field)b=l(b,{groupBy:t.field,value:e.field,agg:a});else if(("count"===a||"count"===e.aggregate)&&t?.field&&b){const e=new Map;for(const a of b){const r=a[t.field]+"";e.set(r,(e.get(r)||0)+1)}b=Array.from(e,([e,a])=>({[t.field]:e,value:a}))}}if(i?.bin||n?.bin){const e="Histogram";b&&(x.data=b),i?.bin?(x.valueAccessor=i.field,n?.field&&(x.categoryAccessor=n.field),i.axis?.title&&(x.valueLabel=i.axis.title)):n?.bin&&(x.valueAccessor=n.field,i?.field&&(x.categoryAccessor=i.field),n.axis?.title&&(x.valueLabel=n.axis.title));const a=i?.bin||n?.bin,r="object"==typeof a?a.maxbins:void 0;return r&&(x.bins=r),v(e,x,t)}let L;switch(a){case"bar":L=function(e,t,a,r,o,i,n){let s;return a?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(s="StackedBarChart",r.stackBy=a.field):s="BarChart",d(e?.type)&&p(t?.type)?(r.categoryAccessor=e.field,r.valueAccessor=n?"value":t.field,e?.axis?.title&&(r.categoryLabel=e.axis.title),t?.axis?.title&&(r.valueLabel=t.axis.title)):p(e?.type)&&d(t?.type)?(r.categoryAccessor=t.field,r.valueAccessor=i?"value":e.field,r.orientation="horizontal",t?.axis?.title&&(r.categoryLabel=t.axis.title),e?.axis?.title&&(r.valueLabel=e.axis.title)):(e?.field&&(r.categoryAccessor=e.field),t?.field&&(r.valueAccessor=n?"value":t.field),e?.axis?.title&&(r.categoryLabel=e.axis.title),t?.axis?.title&&(r.valueLabel=t.axis.title)),o&&(r.data=o),s}(i,n,s,x,b,w,k);break;case"line":if(L="LineChart",h(i,n,x,w,k),s?.field&&(x.lineBy=s.field),r.interpolate){const e=y[r.interpolate];e&&(x.curve=e)}!0===r.point&&(x.showPoints=!0),b&&(x.data=b);break;case"area":if(s?.field?(L="StackedAreaChart",x.areaBy=s.field):L="AreaChart",h(i,n,x,w,k),r.interpolate){const e=y[r.interpolate];e&&(x.curve=e)}void 0!==r.opacity&&(x.areaOpacity=r.opacity),b&&(x.data=b);break;case"point":case"circle":case"square":c?.field?(L="BubbleChart",x.sizeBy=c.field,c.scale?.range&&(x.sizeRange=c.scale.range)):L="Scatterplot",h(i,n,x,w,k),b&&(x.data=b);break;case"rect":L="Heatmap",i?.field&&(x.xAccessor=i.field),n?.field&&(x.yAccessor=n.field),s?.field&&(x.valueAccessor=s.field,delete x.colorBy),i?.axis?.title&&(x.xLabel=i.axis.title),n?.axis?.title&&(x.yLabel=n.axis.title),b&&(x.data=b);break;case"arc":r.innerRadius&&r.innerRadius>0?(L="DonutChart",x.innerRadius=r.innerRadius):L="PieChart",u?.field?x.valueAccessor=u.field:n?.field&&(x.valueAccessor=k?"value":n.field),s?.field&&(x.categoryAccessor=s.field),i?.field&&!u?.field&&(x.categoryAccessor=i.field),b&&(x.data=b);break;case"tick":L="DotPlot",d(i?.type)?(x.categoryAccessor=i.field,n?.field&&(x.valueAccessor=k?"value":n.field),i?.axis?.title&&(x.categoryLabel=i.axis.title),n?.axis?.title&&(x.valueLabel=n.axis.title)):d(n?.type)?(x.categoryAccessor=n.field,i?.field&&(x.valueAccessor=w?"value":i.field),x.orientation="horizontal",n?.axis?.title&&(x.categoryLabel=n.axis.title),i?.axis?.title&&(x.valueLabel=i.axis.title)):(i?.field&&(x.categoryAccessor=i.field),n?.field&&(x.valueAccessor=k?"value":n.field)),b&&(x.data=b);break;default:t.push(`Unsupported mark type "${a}". Defaulting to Scatterplot.`),L="Scatterplot",h(i,n,x,w,k),b&&(x.data=b)}return v(L,x,t)}function h(e,t,a,r,o){e?.field&&(a.xAccessor=r?"value":e.field),t?.field&&(a.yAccessor=o?"value":t.field),e?.axis?.title&&(a.xLabel=e.axis.title),t?.axis?.title&&(a.yLabel=t.axis.title)}function v(e,t,a){const r={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(a.length>0){r.warnings=a;for(const e of a)console.warn("[semiotic/fromVegaLite] "+e)}return r}function x(e,t={}){if(!e||"number"!=typeof e.numRows||!e.schema)return console.warn("[semiotic/fromArrow] Expected an Arrow table with `numRows` and `schema`. Returning []."),[];const a=!1!==t.coerceBigInt,r=e.schema.fields.map(e=>e.name),o=t.fields??r,i=[];for(const t of o){const a=e.getChild(t);a?i.push({name:t,column:a}):console.warn(`[semiotic/fromArrow] Column "${t}" is not in the table schema; skipping it.`)}let n=!1;const s=Array(e.numRows);for(let t=0;e.numRows>t;t++){const e={};for(const{name:r,column:o}of i){let i=o.get(t);a&&"bigint"==typeof i&&(i<BigInt(Number.MIN_SAFE_INTEGER)||i>BigInt(Number.MAX_SAFE_INTEGER)?n||(n=!0,console.warn("[semiotic/fromArrow] A 64-bit integer exceeds Number.MAX_SAFE_INTEGER; left as bigint to avoid precision loss.")):i=Number(i)),e[r]=i}s[t]=e}return s}function A(e,t,a){const{featureKey:r,dataKey:o}=a,i=new Map;for(const e of t)i.set(e[o]+"",e);return e.map(e=>{const t=(e=>{const t=r.split(".");let a=e;for(const e of t)a=null!==a&&"object"==typeof a?a[e]:void 0;return(a??"")+""})(e),a=i.get(t);return a?{...e,properties:{...e.properties,...a}}:e})}
1
+ var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i={};function n(e){let t=1/0,a=-1/0;for(const o of e)t>o&&(t=o),o>a&&(a=o);return[t,a]}function s(e,t){const{field:a,bins:o=10}=t,r=e.map(e=>Number(e[a])).filter(e=>!isNaN(e));if(0===r.length)return[];const[i,s]=n(r),l=t.domain?t.domain[0]:i,c=t.domain?t.domain[1]:s;if(l===c)return[{category:`${l}-${c}`,value:r.length}];const u=(c-l)/o,d=Array(o).fill(0);for(const e of r){let t=Math.floor((e-l)/u);t===o&&(t=o-1),t>=0&&o>t&&d[t]++}return d.map((e,t)=>{const a=l+t*u,o=a+u;return{category:`${f(a)}-${f(o)}`,value:e}})}function l(e,t){const{groupBy:a,value:o,agg:r="sum"}=t,i=new Map;for(const t of e){const e=t[a]+"";i.has(e)||i.set(e,[]),i.get(e).push(Number(t[o]))}const s=[];for(const[e,t]of i){let o;switch(r){case"count":o=t.length;break;case"mean":o=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":o=n(t)[0];break;case"max":o=n(t)[1];break;default:o=t.reduce((e,t)=>e+t,0)}s.push({[a]:e,value:o})}return s}function c(e,t){const{key:a,fields:o}=t,r=new Map;for(const t of e){const e=t[a]+"";if(r.has(e)||r.set(e,[]),o){const a={};for(const e of o)e in t&&(a[e]=t[e]);r.get(e).push(a)}else r.get(e).push({...t})}const i=[];for(const[e,t]of r)i.push({id:e,coordinates:t});return i}function u(e,t){const{columns:a,nameField:o="name",valueField:r="value"}=t,i=new Set(a),n=[];for(const t of e){const e={};for(const a of Object.keys(t))i.has(a)||(e[a]=t[a]);for(const i of a)n.push({...e,[o]:i,[r]:t[i]})}return n}function f(e){return Math.round(1e3*e)/1e3+""}function d(e){return"nominal"===e||"ordinal"===e}function p(e){return"quantitative"===e||"temporal"===e}((e,a)=>{for(var o in a)t(e,o,{get:a[o],enumerable:!0})})(i,{bin:()=>s,fromArrow:()=>x,fromVegaLite:()=>b,groupBy:()=>c,mergeData:()=>A,pivot:()=>u,rollup:()=>l}),module.exports=(e=i,((e,i,n,s)=>{if(i)for(let n of o(i))r.call(e,n)||void 0===n||t(e,n,{get:()=>i[n],enumerable:!(s=a(i,n))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var m={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},y={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},g={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function b(e){e=function(e){if(!function(e){return e.usermeta?.idid}(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!function(e){return"annotation-layer"===e.usermeta?.idid?.role}(e));if(1!==t.length)return e;const{layer:a,...o}=e,{usermeta:r,...i}=t[0];return{...o,...i}}(e);const t=[],{type:a,markProps:o}=function(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...a}=e;return{type:t,markProps:a}}(e.mark),r=e.encoding||{},i=r.x,n=r.y,s=r.color,c=r.size,u=r.theta,f=r.opacity;let b;e.data?.values?b=e.data.values:e.data?.url&&t.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&t.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&t.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&t.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||r.facet||r.row||r.column)&&t.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&t.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&t.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const x={};e.width&&(x.width=e.width),e.height&&(x.height=e.height);const A=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(A&&(x.title=A),s?.field&&(x.colorBy=s.field,s.scale?.scheme)){const e=m[s.scale.scheme];e&&(x.colorScheme=e)}void 0!==f?.value&&(x.pointOpacity=f.value);const w=i?.aggregate,k=n?.aggregate;if(b&&(w||k)){const e=k?n:i,t=k?i:n,a=g[e.aggregate];if(a&&t?.field&&e.field)b=l(b,{groupBy:t.field,value:e.field,agg:a});else if(("count"===a||"count"===e.aggregate)&&t?.field&&b){const e=new Map;for(const a of b){const o=a[t.field]+"";e.set(o,(e.get(o)||0)+1)}b=Array.from(e,([e,a])=>({[t.field]:e,value:a}))}}if(i?.bin||n?.bin){const e="Histogram";b&&(x.data=b),i?.bin?(x.valueAccessor=i.field,n?.field&&(x.categoryAccessor=n.field),i.axis?.title&&(x.valueLabel=i.axis.title)):n?.bin&&(x.valueAccessor=n.field,i?.field&&(x.categoryAccessor=i.field),n.axis?.title&&(x.valueLabel=n.axis.title));const a=i?.bin||n?.bin,o="object"==typeof a?a.maxbins:void 0;return o&&(x.bins=o),v(e,x,t)}let L;switch(a){case"bar":L=function(e,t,a,o,r,i,n){let s;return a?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(s="StackedBarChart",o.stackBy=a.field):s="BarChart",d(e?.type)&&p(t?.type)?(o.categoryAccessor=e.field,o.valueAccessor=n?"value":t.field,e?.axis?.title&&(o.categoryLabel=e.axis.title),t?.axis?.title&&(o.valueLabel=t.axis.title)):p(e?.type)&&d(t?.type)?(o.categoryAccessor=t.field,o.valueAccessor=i?"value":e.field,o.orientation="horizontal",t?.axis?.title&&(o.categoryLabel=t.axis.title),e?.axis?.title&&(o.valueLabel=e.axis.title)):(e?.field&&(o.categoryAccessor=e.field),t?.field&&(o.valueAccessor=n?"value":t.field),e?.axis?.title&&(o.categoryLabel=e.axis.title),t?.axis?.title&&(o.valueLabel=t.axis.title)),r&&(o.data=r),s}(i,n,s,x,b,w,k);break;case"line":if(L="LineChart",h(i,n,x,w,k),s?.field&&(x.lineBy=s.field),o.interpolate){const e=y[o.interpolate];e&&(x.curve=e)}!0===o.point&&(x.showPoints=!0),b&&(x.data=b);break;case"area":if(s?.field?(L="StackedAreaChart",x.areaBy=s.field):L="AreaChart",h(i,n,x,w,k),o.interpolate){const e=y[o.interpolate];e&&(x.curve=e)}void 0!==o.opacity&&(x.areaOpacity=o.opacity),b&&(x.data=b);break;case"point":case"circle":case"square":c?.field?(L="BubbleChart",x.sizeBy=c.field,c.scale?.range&&(x.sizeRange=c.scale.range)):L="Scatterplot",h(i,n,x,w,k),b&&(x.data=b);break;case"rect":L="Heatmap",i?.field&&(x.xAccessor=i.field),n?.field&&(x.yAccessor=n.field),s?.field&&(x.valueAccessor=s.field,delete x.colorBy),i?.axis?.title&&(x.xLabel=i.axis.title),n?.axis?.title&&(x.yLabel=n.axis.title),b&&(x.data=b);break;case"arc":o.innerRadius&&o.innerRadius>0?(L="DonutChart",x.innerRadius=o.innerRadius):L="PieChart",u?.field?x.valueAccessor=u.field:n?.field&&(x.valueAccessor=k?"value":n.field),s?.field&&(x.categoryAccessor=s.field),i?.field&&!u?.field&&(x.categoryAccessor=i.field),b&&(x.data=b);break;case"tick":L="DotPlot",d(i?.type)?(x.categoryAccessor=i.field,n?.field&&(x.valueAccessor=k?"value":n.field),i?.axis?.title&&(x.categoryLabel=i.axis.title),n?.axis?.title&&(x.valueLabel=n.axis.title)):d(n?.type)?(x.categoryAccessor=n.field,i?.field&&(x.valueAccessor=w?"value":i.field),x.orientation="horizontal",n?.axis?.title&&(x.categoryLabel=n.axis.title),i?.axis?.title&&(x.valueLabel=i.axis.title)):(i?.field&&(x.categoryAccessor=i.field),n?.field&&(x.valueAccessor=k?"value":n.field)),b&&(x.data=b);break;default:t.push(`Unsupported mark type "${a}". Defaulting to Scatterplot.`),L="Scatterplot",h(i,n,x,w,k),b&&(x.data=b)}return v(L,x,t)}function h(e,t,a,o,r){e?.field&&(a.xAccessor=o?"value":e.field),t?.field&&(a.yAccessor=r?"value":t.field),e?.axis?.title&&(a.xLabel=e.axis.title),t?.axis?.title&&(a.yLabel=t.axis.title)}function v(e,t,a){const o={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(a.length>0){o.warnings=a;for(const e of a)console.warn("[semiotic/fromVegaLite] "+e)}return o}function x(e,t={}){if(!e||"number"!=typeof e.numRows||!e.schema)return console.warn("[semiotic/fromArrow] Expected an Arrow table with `numRows` and `schema`. Returning []."),[];const a=!1!==t.coerceBigInt,o=e.schema.fields.map(e=>e.name),r=t.fields??o,i=[];for(const t of r){const a=e.getChild(t);a?i.push({name:t,column:a}):console.warn(`[semiotic/fromArrow] Column "${t}" is not in the table schema; skipping it.`)}let n=!1;const s=Array(e.numRows);for(let t=0;e.numRows>t;t++){const e={};for(const{name:o,column:r}of i){let i=r.get(t);a&&"bigint"==typeof i&&(i<BigInt(Number.MIN_SAFE_INTEGER)||i>BigInt(Number.MAX_SAFE_INTEGER)?n||(n=!0,console.warn("[semiotic/fromArrow] A 64-bit integer exceeds Number.MAX_SAFE_INTEGER; left as bigint to avoid precision loss.")):i=Number(i)),e[o]=i}s[t]=e}return s}function A(e,t,a){const{featureKey:o,dataKey:r}=a,i=new Map;for(const e of t)i.set(e[r]+"",e);return e.map(e=>{const t=(e=>{const t=o.split(".");let a=e;for(const e of t)a=null!==a&&"object"==typeof a?a[e]:void 0;return(a??"")+""})(e),a=i.get(t);return a?{...e,properties:{...e.properties,...a}}:e})}
@@ -1 +1 @@
1
- function e(e){let t=1/0,a=-1/0;for(const o of e)t>o&&(t=o),o>a&&(a=o);return[t,a]}function t(t,a){const{field:o,bins:r=10}=a,n=t.map(e=>Number(e[o])).filter(e=>!isNaN(e));if(0===n.length)return[];const[s,l]=e(n),c=a.domain?a.domain[0]:s,u=a.domain?a.domain[1]:l;if(c===u)return[{category:`${c}-${u}`,value:n.length}];const f=(u-c)/r,d=Array(r).fill(0);for(const e of n){let t=Math.floor((e-c)/f);t===r&&(t=r-1),t>=0&&r>t&&d[t]++}return d.map((e,t)=>{const a=c+t*f,o=a+f;return{category:`${i(a)}-${i(o)}`,value:e}})}function a(t,a){const{groupBy:o,value:r,agg:i="sum"}=a,n=new Map;for(const e of t){const t=e[o]+"";n.has(t)||n.set(t,[]),n.get(t).push(Number(e[r]))}const s=[];for(const[t,a]of n){let r;switch(i){case"count":r=a.length;break;case"mean":r=a.reduce((e,t)=>e+t,0)/a.length;break;case"min":r=e(a)[0];break;case"max":r=e(a)[1];break;default:r=a.reduce((e,t)=>e+t,0)}s.push({[o]:t,value:r})}return s}function o(e,t){const{key:a,fields:o}=t,r=new Map;for(const t of e){const e=t[a]+"";if(r.has(e)||r.set(e,[]),o){const a={};for(const e of o)e in t&&(a[e]=t[e]);r.get(e).push(a)}else r.get(e).push({...t})}const i=[];for(const[e,t]of r)i.push({id:e,coordinates:t});return i}function r(e,t){const{columns:a,nameField:o="name",valueField:r="value"}=t,i=new Set(a),n=[];for(const t of e){const e={};for(const a of Object.keys(t))i.has(a)||(e[a]=t[a]);for(const i of a)n.push({...e,[o]:i,[r]:t[i]})}return n}function i(e){return Math.round(1e3*e)/1e3+""}function n(e){return"nominal"===e||"ordinal"===e}function s(e){return"quantitative"===e||"temporal"===e}var l={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},c={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},u={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function f(e){e=function(e){if(!function(e){return e.usermeta?.idid}(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!function(e){return"annotation-layer"===e.usermeta?.idid?.role}(e));if(1!==t.length)return e;const{layer:a,...o}=e,{usermeta:r,...i}=t[0];return{...o,...i}}(e);const t=[],{type:o,markProps:r}=function(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...a}=e;return{type:t,markProps:a}}(e.mark),i=e.encoding||{},f=i.x,m=i.y,y=i.color,g=i.size,h=i.theta,b=i.opacity;let v;e.data?.values?v=e.data.values:e.data?.url&&t.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&t.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&t.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&t.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||i.facet||i.row||i.column)&&t.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&t.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&t.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const x={};e.width&&(x.width=e.width),e.height&&(x.height=e.height);const A=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(A&&(x.title=A),y?.field&&(x.colorBy=y.field,y.scale?.scheme)){const e=l[y.scale.scheme];e&&(x.colorScheme=e)}void 0!==b?.value&&(x.pointOpacity=b.value);const k=f?.aggregate,w=m?.aggregate;if(v&&(k||w)){const e=w?m:f,t=w?f:m,o=u[e.aggregate];if(o&&t?.field&&e.field)v=a(v,{groupBy:t.field,value:e.field,agg:o});else if(("count"===o||"count"===e.aggregate)&&t?.field&&v){const e=new Map;for(const a of v){const o=a[t.field]+"";e.set(o,(e.get(o)||0)+1)}v=Array.from(e,([e,a])=>({[t.field]:e,value:a}))}}if(f?.bin||m?.bin){const e="Histogram";v&&(x.data=v),f?.bin?(x.valueAccessor=f.field,m?.field&&(x.categoryAccessor=m.field),f.axis?.title&&(x.valueLabel=f.axis.title)):m?.bin&&(x.valueAccessor=m.field,f?.field&&(x.categoryAccessor=f.field),m.axis?.title&&(x.valueLabel=m.axis.title));const a=f?.bin||m?.bin,o="object"==typeof a?a.maxbins:void 0;return o&&(x.bins=o),p(e,x,t)}let L;switch(o){case"bar":L=function(e,t,a,o,r,i,l){let c;return a?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(c="StackedBarChart",o.stackBy=a.field):c="BarChart",n(e?.type)&&s(t?.type)?(o.categoryAccessor=e.field,o.valueAccessor=l?"value":t.field,e?.axis?.title&&(o.categoryLabel=e.axis.title),t?.axis?.title&&(o.valueLabel=t.axis.title)):s(e?.type)&&n(t?.type)?(o.categoryAccessor=t.field,o.valueAccessor=i?"value":e.field,o.orientation="horizontal",t?.axis?.title&&(o.categoryLabel=t.axis.title),e?.axis?.title&&(o.valueLabel=e.axis.title)):(e?.field&&(o.categoryAccessor=e.field),t?.field&&(o.valueAccessor=l?"value":t.field),e?.axis?.title&&(o.categoryLabel=e.axis.title),t?.axis?.title&&(o.valueLabel=t.axis.title)),r&&(o.data=r),c}(f,m,y,x,v,k,w);break;case"line":if(L="LineChart",d(f,m,x,k,w),y?.field&&(x.lineBy=y.field),r.interpolate){const e=c[r.interpolate];e&&(x.curve=e)}!0===r.point&&(x.showPoints=!0),v&&(x.data=v);break;case"area":if(y?.field?(L="StackedAreaChart",x.areaBy=y.field):L="AreaChart",d(f,m,x,k,w),r.interpolate){const e=c[r.interpolate];e&&(x.curve=e)}void 0!==r.opacity&&(x.areaOpacity=r.opacity),v&&(x.data=v);break;case"point":case"circle":case"square":g?.field?(L="BubbleChart",x.sizeBy=g.field,g.scale?.range&&(x.sizeRange=g.scale.range)):L="Scatterplot",d(f,m,x,k,w),v&&(x.data=v);break;case"rect":L="Heatmap",f?.field&&(x.xAccessor=f.field),m?.field&&(x.yAccessor=m.field),y?.field&&(x.valueAccessor=y.field,delete x.colorBy),f?.axis?.title&&(x.xLabel=f.axis.title),m?.axis?.title&&(x.yLabel=m.axis.title),v&&(x.data=v);break;case"arc":r.innerRadius&&r.innerRadius>0?(L="DonutChart",x.innerRadius=r.innerRadius):L="PieChart",h?.field?x.valueAccessor=h.field:m?.field&&(x.valueAccessor=w?"value":m.field),y?.field&&(x.categoryAccessor=y.field),f?.field&&!h?.field&&(x.categoryAccessor=f.field),v&&(x.data=v);break;case"tick":L="DotPlot",n(f?.type)?(x.categoryAccessor=f.field,m?.field&&(x.valueAccessor=w?"value":m.field),f?.axis?.title&&(x.categoryLabel=f.axis.title),m?.axis?.title&&(x.valueLabel=m.axis.title)):n(m?.type)?(x.categoryAccessor=m.field,f?.field&&(x.valueAccessor=k?"value":f.field),x.orientation="horizontal",m?.axis?.title&&(x.categoryLabel=m.axis.title),f?.axis?.title&&(x.valueLabel=f.axis.title)):(f?.field&&(x.categoryAccessor=f.field),m?.field&&(x.valueAccessor=w?"value":m.field)),v&&(x.data=v);break;default:t.push(`Unsupported mark type "${o}". Defaulting to Scatterplot.`),L="Scatterplot",d(f,m,x,k,w),v&&(x.data=v)}return p(L,x,t)}function d(e,t,a,o,r){e?.field&&(a.xAccessor=o?"value":e.field),t?.field&&(a.yAccessor=r?"value":t.field),e?.axis?.title&&(a.xLabel=e.axis.title),t?.axis?.title&&(a.yLabel=t.axis.title)}function p(e,t,a){const o={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(a.length>0){o.warnings=a;for(const e of a)console.warn("[semiotic/fromVegaLite] "+e)}return o}function m(e,t={}){if(!e||"number"!=typeof e.numRows||!e.schema)return console.warn("[semiotic/fromArrow] Expected an Arrow table with `numRows` and `schema`. Returning []."),[];const a=!1!==t.coerceBigInt,o=e.schema.fields.map(e=>e.name),r=t.fields??o,i=[];for(const t of r){const a=e.getChild(t);a?i.push({name:t,column:a}):console.warn(`[semiotic/fromArrow] Column "${t}" is not in the table schema; skipping it.`)}let n=!1;const s=Array(e.numRows);for(let t=0;e.numRows>t;t++){const e={};for(const{name:o,column:r}of i){let i=r.get(t);a&&"bigint"==typeof i&&(i<BigInt(Number.MIN_SAFE_INTEGER)||i>BigInt(Number.MAX_SAFE_INTEGER)?n||(n=!0,console.warn("[semiotic/fromArrow] A 64-bit integer exceeds Number.MAX_SAFE_INTEGER; left as bigint to avoid precision loss.")):i=Number(i)),e[o]=i}s[t]=e}return s}function y(e,t,a){const{featureKey:o,dataKey:r}=a,i=new Map;for(const e of t)i.set(e[r]+"",e);return e.map(e=>{const t=(e=>{const t=o.split(".");let a=e;for(const e of t)a=null!==a&&"object"==typeof a?a[e]:void 0;return(a??"")+""})(e),a=i.get(t);return a?{...e,properties:{...e.properties,...a}}:e})}export{t as bin,m as fromArrow,f as fromVegaLite,o as groupBy,y as mergeData,r as pivot,a as rollup};
1
+ import{bin as e,fromVegaLite as o,groupBy as n,pivot as t,rollup as r}from"./chunk-chunk-QSQVBIJA.module.min.js";import"./chunk-chunk-JJ2OOIET.module.min.js";function s(e,o={}){if(!e||"number"!=typeof e.numRows||!e.schema)return console.warn("[semiotic/fromArrow] Expected an Arrow table with `numRows` and `schema`. Returning []."),[];const n=!1!==o.coerceBigInt,t=e.schema.fields.map(e=>e.name),r=o.fields??t,s=[];for(const o of r){const n=e.getChild(o);n?s.push({name:o,column:n}):console.warn(`[semiotic/fromArrow] Column "${o}" is not in the table schema; skipping it.`)}let i=!1;const c=Array(e.numRows);for(let o=0;e.numRows>o;o++){const e={};for(const{name:t,column:r}of s){let s=r.get(o);n&&"bigint"==typeof s&&(s<BigInt(Number.MIN_SAFE_INTEGER)||s>BigInt(Number.MAX_SAFE_INTEGER)?i||(i=!0,console.warn("[semiotic/fromArrow] A 64-bit integer exceeds Number.MAX_SAFE_INTEGER; left as bigint to avoid precision loss.")):s=Number(s)),e[t]=s}c[o]=e}return c}function i(e,o,n){const{featureKey:t,dataKey:r}=n,s=new Map;for(const e of o)s.set(e[r]+"",e);return e.map(e=>{const o=(e=>{const o=t.split(".");let n=e;for(const e of o)n=null!==n&&"object"==typeof n?n[e]:void 0;return(n??"")+""})(e),n=s.get(o);return n?{...e,properties:{...e.properties,...n}}:e})}export{e as bin,s as fromArrow,o as fromVegaLite,n as groupBy,i as mergeData,t as pivot,r as rollup};