semiotic 3.1.2 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/CLAUDE.md +173 -213
  2. package/LICENSE +197 -10
  3. package/README.md +12 -11
  4. package/ai/dist/componentRegistry.js +6 -0
  5. package/ai/dist/mcp-server.js +115 -5
  6. package/ai/examples.md +184 -0
  7. package/ai/schema.json +4140 -888
  8. package/ai/system-prompt.md +36 -1
  9. package/dist/components/ChartContainer.d.ts +2 -0
  10. package/dist/components/DataSummaryContext.d.ts +12 -0
  11. package/dist/components/ThemeProvider.d.ts +5 -3
  12. package/dist/components/Tooltip/FlippingTooltip.d.ts +34 -0
  13. package/dist/components/charts/geo/ChoroplethMap.d.ts +1 -1
  14. package/dist/components/charts/index.d.ts +12 -1
  15. package/dist/components/charts/ordinal/BarChart.d.ts +4 -1
  16. package/dist/components/charts/ordinal/BoxPlot.d.ts +4 -1
  17. package/dist/components/charts/ordinal/DonutChart.d.ts +1 -1
  18. package/dist/components/charts/ordinal/DotPlot.d.ts +4 -1
  19. package/dist/components/charts/ordinal/FunnelChart.d.ts +57 -0
  20. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +4 -1
  21. package/dist/components/charts/ordinal/Histogram.d.ts +17 -2
  22. package/dist/components/charts/ordinal/LikertChart.d.ts +94 -0
  23. package/dist/components/charts/ordinal/PieChart.d.ts +1 -1
  24. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +12 -7
  25. package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -1
  26. package/dist/components/charts/ordinal/SwarmPlot.d.ts +15 -1
  27. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +65 -0
  28. package/dist/components/charts/ordinal/ViolinPlot.d.ts +17 -2
  29. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +20 -0
  30. package/dist/components/charts/shared/annotationResolvers.d.ts +28 -0
  31. package/dist/components/charts/shared/colorManipulation.d.ts +15 -0
  32. package/dist/components/charts/shared/formatUtils.d.ts +28 -0
  33. package/dist/components/charts/shared/hatchPattern.d.ts +35 -0
  34. package/dist/components/charts/shared/hooks.d.ts +39 -3
  35. package/dist/components/charts/shared/legendUtils.d.ts +2 -1
  36. package/dist/components/charts/shared/selectionUtils.d.ts +16 -1
  37. package/dist/components/charts/shared/statisticalOverlays.d.ts +49 -5
  38. package/dist/components/charts/shared/statsTooltip.d.ts +11 -0
  39. package/dist/components/charts/shared/types.d.ts +26 -2
  40. package/dist/components/charts/shared/useChartSetup.d.ts +12 -2
  41. package/dist/components/charts/shared/useLikertAggregation.d.ts +51 -0
  42. package/dist/components/charts/shared/useOrdinalBrush.d.ts +28 -0
  43. package/dist/components/charts/shared/useOrdinalStreaming.d.ts +54 -0
  44. package/dist/components/charts/shared/useStreamingLegend.d.ts +2 -2
  45. package/dist/components/charts/shared/validateProps.d.ts +2 -2
  46. package/dist/components/charts/shared/validationMap.d.ts +12 -0
  47. package/dist/components/charts/xy/AreaChart.d.ts +11 -0
  48. package/dist/components/charts/xy/Heatmap.d.ts +1 -1
  49. package/dist/components/charts/xy/MinimapChart.d.ts +1 -1
  50. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +71 -0
  51. package/dist/components/charts/xy/StackedAreaChart.d.ts +11 -0
  52. package/dist/components/realtime/types.d.ts +6 -0
  53. package/dist/components/semiotic-ai.d.ts +4 -0
  54. package/dist/components/semiotic-ordinal.d.ts +5 -0
  55. package/dist/components/semiotic-themes.d.ts +80 -0
  56. package/dist/components/semiotic-utils.d.ts +30 -0
  57. package/dist/components/semiotic-xy.d.ts +1 -0
  58. package/dist/components/semiotic.d.ts +11 -5
  59. package/dist/components/store/LinkedCrosshairStore.d.ts +11 -0
  60. package/dist/components/store/ThemeStore.d.ts +22 -2
  61. package/dist/components/store/useSelection.d.ts +1 -0
  62. package/dist/components/stream/AccessibleDataTable.d.ts +28 -6
  63. package/dist/components/stream/FocusRing.d.ts +33 -0
  64. package/dist/components/stream/OrdinalBrushOverlay.d.ts +43 -0
  65. package/dist/components/stream/OrdinalPipelineStore.d.ts +16 -0
  66. package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -1
  67. package/dist/components/stream/PipelineStore.d.ts +7 -47
  68. package/dist/components/stream/SVGOverlay.d.ts +9 -3
  69. package/dist/components/stream/SceneGraph.d.ts +6 -1
  70. package/dist/components/stream/XYBrushOverlay.d.ts +47 -0
  71. package/dist/components/stream/accessorUtils.d.ts +14 -0
  72. package/dist/components/stream/geoTypes.d.ts +5 -1
  73. package/dist/components/stream/keyboardNav.d.ts +85 -9
  74. package/dist/components/stream/layouts/hierarchySceneBuilders.d.ts +35 -0
  75. package/dist/components/stream/layouts/hierarchyUtils.d.ts +25 -0
  76. package/dist/components/stream/networkTypes.d.ts +7 -1
  77. package/dist/components/stream/ordinalSceneBuilders/barFunnelScene.d.ts +27 -0
  78. package/dist/components/stream/ordinalSceneBuilders/funnelScene.d.ts +26 -0
  79. package/dist/components/stream/ordinalSceneBuilders/swimlaneScene.d.ts +12 -0
  80. package/dist/components/stream/ordinalTypes.d.ts +30 -4
  81. package/dist/components/stream/pipelineDecay.d.ts +20 -0
  82. package/dist/components/stream/pipelinePulse.d.ts +24 -0
  83. package/dist/components/stream/pipelineTransitions.d.ts +59 -0
  84. package/dist/components/stream/renderers/barFunnelCanvasRenderer.d.ts +12 -0
  85. package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +2 -1
  86. package/dist/components/stream/renderers/trapezoidCanvasRenderer.d.ts +15 -0
  87. package/dist/components/stream/sceneUtils.d.ts +10 -0
  88. package/dist/components/stream/types.d.ts +29 -4
  89. package/dist/components/stream/useMediaPreferences.d.ts +11 -0
  90. package/dist/components/stream/xySceneBuilders/areaScene.d.ts +13 -0
  91. package/dist/components/stream/xySceneBuilders/barScene.d.ts +18 -0
  92. package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +8 -0
  93. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +10 -0
  94. package/dist/components/stream/xySceneBuilders/emitPointNodes.d.ts +13 -0
  95. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +3 -0
  96. package/dist/components/stream/xySceneBuilders/lineScene.d.ts +12 -0
  97. package/dist/components/stream/xySceneBuilders/pointScene.d.ts +12 -0
  98. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +10 -0
  99. package/dist/components/stream/xySceneBuilders/types.d.ts +93 -0
  100. package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +12 -0
  101. package/dist/geo.min.js +1 -1
  102. package/dist/geo.module.min.js +1 -1
  103. package/dist/network.min.js +1 -1
  104. package/dist/network.module.min.js +1 -1
  105. package/dist/ordinal.min.js +1 -1
  106. package/dist/ordinal.module.min.js +1 -1
  107. package/dist/realtime.min.js +1 -1
  108. package/dist/realtime.module.min.js +1 -1
  109. package/dist/semiotic-ai-statisticalOverlays-C2PPlmXv.js +1 -0
  110. package/dist/semiotic-ai.d.ts +4 -0
  111. package/dist/semiotic-ai.min.js +1 -1
  112. package/dist/semiotic-ai.module.min.js +1 -1
  113. package/dist/semiotic-ordinal.d.ts +5 -0
  114. package/dist/semiotic-statisticalOverlays-DGX_WWc5.js +1 -0
  115. package/dist/semiotic-themes.d.ts +80 -0
  116. package/dist/semiotic-themes.min.js +1 -0
  117. package/dist/semiotic-themes.module.min.js +1 -0
  118. package/dist/semiotic-utils.d.ts +30 -0
  119. package/dist/semiotic-utils.min.js +1 -0
  120. package/dist/semiotic-utils.module.min.js +1 -0
  121. package/dist/semiotic-xy.d.ts +1 -0
  122. package/dist/semiotic.d.ts +11 -5
  123. package/dist/semiotic.min.js +1 -1
  124. package/dist/semiotic.module.min.js +1 -1
  125. package/dist/server.min.js +1 -1
  126. package/dist/server.module.min.js +1 -1
  127. package/dist/xy-statisticalOverlays-C2PPlmXv.js +1 -0
  128. package/dist/xy.min.js +1 -1
  129. package/dist/xy.module.min.js +1 -1
  130. package/package.json +38 -12
  131. package/dist/semiotic-ai-statisticalOverlays-C1f7TYyD.js +0 -1
  132. package/dist/semiotic-statisticalOverlays-C1f7TYyD.js +0 -1
  133. package/dist/xy-statisticalOverlays-C1f7TYyD.js +0 -1
@@ -0,0 +1 @@
1
+ function t(t,n=.5){const a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!a)return t;const s=Math.round(parseInt(a[1],16)*(1-n)),e=Math.round(parseInt(a[2],16)*(1-n)),o=Math.round(parseInt(a[3],16)*(1-n));return`#${s.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function n(t,n=.5){const a=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t);if(!a)return t;const s=Math.round(parseInt(a[1],16)+(255-parseInt(a[1],16))*n),e=Math.round(parseInt(a[2],16)+(255-parseInt(a[2],16))*n),o=Math.round(parseInt(a[3],16)+(255-parseInt(a[3],16))*n);return`#${s.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}const a="__forecastSegment";function s(t,n){return"function"==typeof n?n(t):!!t[n]}function e(t){var n,a,s;return[{type:"anomaly-band",threshold:null!==(n=t.threshold)&&void 0!==n?n:2,showBand:!1!==t.showBand,fill:t.bandColor||"#6366f1",fillOpacity:null!==(a=t.bandOpacity)&&void 0!==a?a:.1,anomalyColor:t.anomalyColor||"#ef4444",anomalyRadius:null!==(s=t.anomalyRadius)&&void 0!==s?s:6,label:t.label}]}function o(t,n,e,o,r){return(i=o).isTraining||i.isForecast||i.isAnomaly||i.upperBounds||i.lowerBounds?function(t,n,e,o,r){var i,l,c,p;const{isTraining:f,isForecast:u,isAnomaly:h,upperBounds:d,lowerBounds:g,color:y="#6366f1",bandOpacity:b=.15,anomalyColor:O="#ef4444",anomalyRadius:j=6,label:m}=o,v=t.map(t=>{let n="observed";return u&&s(t,u)?n="forecast":f&&s(t,f)&&(n="training"),Object.assign(Object.assign({},t),{[a]:n})}),k=o._groupBy,_=[];if(k){const t=new Map;for(const n of v){const a=null!==(i=n[k])&&void 0!==i?i:"__default";t.has(a)||t.set(a,[]),t.get(a).push(n)}const n=[];for(const[,s]of t)for(let t=0;s.length-1>t;t++)s[t][a]!==s[t+1][a]&&(n.push(Object.assign(Object.assign({},s[t+1]),{[a]:s[t][a]})),n.push(Object.assign(Object.assign({},s[t]),{[a]:s[t+1][a]})));_.push(...v,...n)}else for(let t=0;v.length>t;t++)_.push(v[t]),v.length-1>t&&v[t][a]!==v[t+1][a]&&(_.push(Object.assign(Object.assign({},v[t+1]),{[a]:v[t][a]})),_.push(Object.assign(Object.assign({},v[t]),{[a]:v[t+1][a]})));if(o.trainUnderline){const t=[];for(const n of _)"training"===n[a]&&t.push(Object.assign(Object.assign({},n),{[a]:"training-base"}));_.unshift(...t)}const w=[];if(d&&g){const t="string"==typeof d?d:"__envUpper",n="string"==typeof g?g:"__envLower";if("function"==typeof d||"function"==typeof g)for(const a of _)"function"==typeof d&&(a[t]=d(a)),"function"==typeof g&&(a[n]=g(a));w.push({type:"envelope",upperAccessor:t,lowerAccessor:n,fill:y,fillOpacity:b,label:m})}if(h){const t=o.anomalyStyle,n={type:"highlight",filter:t=>s(t,h)};t?(n.style=t,n.r=j):"function"==typeof O?(n.style=t=>{const n=O(t);return{stroke:n,strokeWidth:1.5,fill:n,fillOpacity:.7}},n.r=j):(n.color=O,n.r=j,n.style={stroke:O,strokeWidth:1.5,fill:O,fillOpacity:.7}),w.push(n)}return r&&w.push({type:"anomaly-band",threshold:null!==(l=r.threshold)&&void 0!==l?l:2,showBand:!1!==r.showBand,fill:r.bandColor||"#6366f1",fillOpacity:null!==(c=r.bandOpacity)&&void 0!==c?c:.1,anomalyColor:r.anomalyColor||"#ef4444",anomalyRadius:null!==(p=r.anomalyRadius)&&void 0!==p?p:6,label:r.label}),{processedData:_,annotations:w}}(t,0,0,o,r):function(t,n,s,e,o){var r,i,l;const{trainEnd:c,steps:p=10,confidence:f=.95,color:u="#6366f1",bandOpacity:h=.15,label:d}=e;if(null==c)return{processedData:t,annotations:[]};const g=[],y=[];for(const s of t)s[n]>c?y.push(Object.assign(Object.assign({},s),{[a]:"observed"})):g.push(Object.assign(Object.assign({},s),{[a]:"training"}));const b=g.map(t=>[t[n],t[s]]).filter(t=>null!=t[0]&&null!=t[1]&&isFinite(t[0])&&isFinite(t[1])).sort((t,n)=>t[0]-n[0]),O=[],j=[];if(b.length>=3){const e=b.length;let o=0,r=0,i=0,l=0;for(const[t,n]of b)o+=t,r+=n,i+=t*t,l+=t*n;const c=e*i-o*o;if(Math.abs(c)>1e-12){const i=(e*l-o*r)/c,g=(r-i*o)/e,y=t=>g+i*t,m=b.map(([t,n])=>n-y(t)).reduce((t,n)=>t+n*n,0),v=Math.sqrt(m/Math.max(e-2,1)),k=b.reduce((t,n)=>t+n[0],0)/e,_=b.reduce((t,n)=>t+Math.pow(n[0]-k,2),0),w=.99>f?.95>f?.9>f?1:1.645:1.96:2.576,S=t.map(t=>t[n]).filter(t=>null!=t&&isFinite(t)),M=Math.max(...S),B=b.length>1?(b[e-1][0]-b[0][0])/(e-1):1;for(let t=1;p>=t;t++){const o=M+t*B,r=y(o),i=v*Math.sqrt(1+1/e+(_>0?Math.pow(o-k,2)/_:0))*w;j.push({[n]:o,[s]:r,[a]:"forecast",__forecastUpper:r+i,__forecastLower:r-i})}O.push({type:"envelope",upperAccessor:"__forecastUpper",lowerAccessor:"__forecastLower",fill:u,fillOpacity:h,label:d})}}O.push({type:"x-threshold",x:c,color:"#94a3b8",strokeWidth:1,strokeDasharray:"4,2",label:"Train / Forecast"}),o&&O.push({type:"anomaly-band",threshold:null!==(r=o.threshold)&&void 0!==r?r:2,showBand:!1!==o.showBand,fill:o.bandColor||"#6366f1",fillOpacity:null!==(i=o.bandOpacity)&&void 0!==i?i:.1,anomalyColor:o.anomalyColor||"#ef4444",anomalyRadius:null!==(l=o.anomalyRadius)&&void 0!==l?l:6,label:o.label});const m=[];if(m.push(...g),g.length>0&&y.length>0&&m.push(Object.assign(Object.assign({},g[g.length-1]),{[a]:"observed"})),m.push(...y),j.length>0){const t=y.length>0?y[y.length-1]:g[g.length-1];t&&m.push(Object.assign(Object.assign({},t),{[a]:"forecast"})),m.push(...j)}return{processedData:m,annotations:O}}(t,n,e,o,r);var i}function r(s,e){var o,r;const i=null!==(o=e.trainDasharray)&&void 0!==o?o:"8,4",l=null!==(r=e.forecastDasharray)&&void 0!==r?r:"4,4",c=e.color||"#6366f1",p=e.trainOpacity,f=e.forecastOpacity,u=e.trainStroke,h=e.trainLinecap,d=e.trainUnderline;return e=>{const o=s(e),r=e[a];if("training"===r){let n=o.stroke;return"darken"===u?n=t(o.stroke||"#666",.5):u&&(n=u),Object.assign(Object.assign(Object.assign(Object.assign({},o),{stroke:n,strokeDasharray:i}),h&&{strokeLinecap:h}),null!=p&&{strokeOpacity:p})}if("training-base"===r){let t=o.stroke||"#666";return"lighten"===d&&(t=n(t,.4)),Object.assign(Object.assign({},o),{stroke:t,strokeDasharray:void 0})}return"forecast"===r?Object.assign(Object.assign(Object.assign({},o),{stroke:c,strokeDasharray:l}),null!=f&&{strokeOpacity:f}):o}}export{a as SEGMENT_FIELD,e as buildAnomalyAnnotations,o as buildForecast,r as createSegmentLineStyle,t as darkenColor,n as lightenColor};
@@ -6,6 +6,8 @@ export { ConnectedScatterplot } from "./charts/xy/ConnectedScatterplot";
6
6
  export { BubbleChart } from "./charts/xy/BubbleChart";
7
7
  export { Heatmap } from "./charts/xy/Heatmap";
8
8
  export { ScatterplotMatrix } from "./charts/xy/ScatterplotMatrix";
9
+ export { QuadrantChart } from "./charts/xy/QuadrantChart";
10
+ export { MultiAxisLineChart } from "./charts/xy/MultiAxisLineChart";
9
11
  export { LinkedCharts } from "./LinkedCharts";
10
12
  export { useSelection, useLinkedHover, useBrushSelection, useFilteredData } from "./LinkedCharts";
11
13
  export { BarChart } from "./charts/ordinal/BarChart";
@@ -19,6 +21,8 @@ export { DotPlot } from "./charts/ordinal/DotPlot";
19
21
  export { RidgelinePlot } from "./charts/ordinal/RidgelinePlot";
20
22
  export { PieChart } from "./charts/ordinal/PieChart";
21
23
  export { DonutChart } from "./charts/ordinal/DonutChart";
24
+ export { FunnelChart } from "./charts/ordinal/FunnelChart";
25
+ export { LikertChart } from "./charts/ordinal/LikertChart";
22
26
  export { ForceDirectedGraph } from "./charts/network/ForceDirectedGraph";
23
27
  export { ChordDiagram } from "./charts/network/ChordDiagram";
24
28
  export { SankeyDiagram } from "./charts/network/SankeyDiagram";