semiotic 3.7.0 → 3.7.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 (70) hide show
  1. package/CLAUDE.md +3 -2
  2. package/README.md +46 -7
  3. package/ai/behaviorContracts.cjs +19 -9
  4. package/ai/cli.js +15 -0
  5. package/ai/dist/mcp-server.js +583 -66
  6. package/ai/schema.json +1 -1
  7. package/ai/system-prompt.md +3 -3
  8. package/dist/components/AccessibleNavTree.d.ts +2 -1
  9. package/dist/components/Annotation.d.ts +1 -1
  10. package/dist/components/CategoryColors.d.ts +1 -1
  11. package/dist/components/ChartGrid.d.ts +1 -1
  12. package/dist/components/ContextLayout.d.ts +1 -1
  13. package/dist/components/DataSummaryContext.d.ts +1 -1
  14. package/dist/components/DetailsPanel.d.ts +1 -1
  15. package/dist/components/Legend.d.ts +3 -2
  16. package/dist/components/LinkedCharts.d.ts +1 -1
  17. package/dist/components/ThemeProvider.d.ts +1 -1
  18. package/dist/components/Tooltip/FlippingTooltip.d.ts +1 -1
  19. package/dist/components/Tooltip/Tooltip.d.ts +2 -2
  20. package/dist/components/ai/qualityScorecard.d.ts +11 -0
  21. package/dist/components/charts/geo/ChoroplethMap.d.ts +2 -1
  22. package/dist/components/charts/network/CirclePack.d.ts +2 -1
  23. package/dist/components/charts/network/OrbitDiagram.d.ts +1 -1
  24. package/dist/components/charts/network/TreeDiagram.d.ts +2 -1
  25. package/dist/components/charts/network/Treemap.d.ts +2 -1
  26. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +1 -1
  27. package/dist/components/charts/shared/ChartError.d.ts +2 -1
  28. package/dist/components/charts/shared/withChartWrapper.d.ts +1 -1
  29. package/dist/components/charts/xy/MinimapChart.d.ts +2 -1
  30. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +2 -1
  31. package/dist/components/semiotic-server.d.ts +2 -1
  32. package/dist/components/server/renderEvidence.d.ts +92 -0
  33. package/dist/components/server/renderToStaticSVG.d.ts +14 -1
  34. package/dist/components/stream/AccessibleDataTable.d.ts +5 -5
  35. package/dist/components/stream/FocusRing.d.ts +2 -1
  36. package/dist/components/stream/MarginalGraphics.d.ts +2 -1
  37. package/dist/components/stream/NetworkCanvasHitTester.d.ts +3 -2
  38. package/dist/components/stream/NetworkPipelineStore.d.ts +46 -1
  39. package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -1
  40. package/dist/components/stream/OrdinalBrushOverlay.d.ts +19 -1
  41. package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -2
  42. package/dist/components/stream/PipelineStore.d.ts +6 -0
  43. package/dist/components/stream/SVGOverlay.d.ts +3 -2
  44. package/dist/components/stream/StalenessBadge.d.ts +19 -0
  45. package/dist/components/stream/XYBrushOverlay.d.ts +21 -1
  46. package/dist/components/stream/quadtreeHitTest.d.ts +7 -1
  47. package/dist/geo.min.js +1 -1
  48. package/dist/geo.module.min.js +1 -1
  49. package/dist/network.min.js +1 -1
  50. package/dist/network.module.min.js +1 -1
  51. package/dist/ordinal.min.js +1 -1
  52. package/dist/ordinal.module.min.js +1 -1
  53. package/dist/realtime.min.js +1 -1
  54. package/dist/realtime.module.min.js +1 -1
  55. package/dist/semiotic-ai.min.js +1 -1
  56. package/dist/semiotic-ai.module.min.js +1 -1
  57. package/dist/semiotic-server.d.ts +2 -1
  58. package/dist/semiotic-themes.min.js +1 -1
  59. package/dist/semiotic-themes.module.min.js +1 -1
  60. package/dist/semiotic-utils.min.js +1 -1
  61. package/dist/semiotic-utils.module.min.js +1 -1
  62. package/dist/semiotic-value.min.js +1 -1
  63. package/dist/semiotic-value.module.min.js +1 -1
  64. package/dist/semiotic.min.js +1 -1
  65. package/dist/semiotic.module.min.js +1 -1
  66. package/dist/server.min.js +1 -1
  67. package/dist/server.module.min.js +1 -1
  68. package/dist/xy.min.js +1 -1
  69. package/dist/xy.module.min.js +1 -1
  70. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
1
  import type { Datum } from "../charts/shared/datumTypes";
2
+ import * as React from "react";
2
3
  import type { ReactNode } from "react";
3
4
  import type { NetworkLabel } from "./networkTypes";
4
5
  import type { LegendGroup, GradientLegendConfig, LegendLayout } from "../types/legendTypes";
@@ -69,7 +70,7 @@ export interface NetworkSVGOverlayProps {
69
70
  * Unlike XY/ordinal overlays, network charts don't have axes or grid lines.
70
71
  * The overlay is positioned absolutely over the canvas.
71
72
  */
72
- export declare function NetworkSVGOverlay(props: NetworkSVGOverlayProps): import("react/jsx-runtime").JSX.Element;
73
+ export declare function NetworkSVGOverlay(props: NetworkSVGOverlayProps): React.JSX.Element;
73
74
  export declare namespace NetworkSVGOverlay {
74
75
  var displayName: string;
75
76
  }
@@ -1,3 +1,21 @@
1
+ /**
2
+ * OrdinalBrushOverlay — d3-brush SVG overlay for ordinal frames.
3
+ *
4
+ * Renders a transparent SVG positioned above the canvas. Brushes along the
5
+ * r-axis (value axis) only: horizontal projection → brushX, vertical → brushY.
6
+ *
7
+ * Key design decisions:
8
+ * - Outer SVG has pointerEvents:"none", inner brush-g has "all", so
9
+ * axes/legends rendered underneath remain clickable.
10
+ * - d3-brush lifecycle (useEffect) depends on [width, height, isHorizontal]
11
+ * only — NOT scales. Scales are read from a ref to avoid brush teardown
12
+ * mid-drag (scales change every render due to new object identity).
13
+ * - A separate useEffect repositions the brush when scales change (streaming).
14
+ *
15
+ * Consumed by: StreamOrdinalFrame (rendered when brush prop is set).
16
+ * Wired by: useOrdinalBrush hook in HOC charts.
17
+ */
18
+ import * as React from "react";
1
19
  import type { OrdinalScales } from "./ordinalTypes";
2
20
  interface OrdinalBrushOverlayProps {
3
21
  width: number;
@@ -21,5 +39,5 @@ interface OrdinalBrushOverlayProps {
21
39
  * In horizontal projection, r maps to x-pixels → uses brushX.
22
40
  * In vertical projection, r maps to y-pixels → uses brushY.
23
41
  */
24
- export declare function OrdinalBrushOverlay({ width, height, totalWidth, totalHeight, margin, scales, onBrush }: OrdinalBrushOverlayProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare function OrdinalBrushOverlay({ width, height, totalWidth, totalHeight, margin, scales, onBrush }: OrdinalBrushOverlayProps): React.JSX.Element;
25
43
  export {};
@@ -81,6 +81,6 @@ interface OrdinalSVGUnderlayProps {
81
81
  rTickValues?: number[];
82
82
  axisExtent?: AxisExtentMode;
83
83
  }
84
- export declare function OrdinalSVGUnderlay(props: OrdinalSVGUnderlayProps): import("react/jsx-runtime").JSX.Element | null;
85
- export declare function OrdinalSVGOverlay(props: OrdinalSVGOverlayProps): import("react/jsx-runtime").JSX.Element | null;
84
+ export declare function OrdinalSVGUnderlay(props: OrdinalSVGUnderlayProps): React.JSX.Element | null;
85
+ export declare function OrdinalSVGOverlay(props: OrdinalSVGOverlayProps): React.JSX.Element | null;
86
86
  export {};
@@ -174,6 +174,12 @@ export declare class PipelineStore {
174
174
  lastIngestTime: number;
175
175
  /** Unified color map cache keyed by sorted category set — shared across point, swarm, etc. */
176
176
  private _colorMapCache;
177
+ /** groupData() result cache. The line/area/stacked-area builders all re-bucket
178
+ * the same buffer by group on every scene build (twice per frame for stacked
179
+ * area); cache keyed on (_ingestVersion, group accessor, data ref) so a
180
+ * streaming push re-buckets once rather than per builder. Mirrors the
181
+ * resolveColorMap cache. Buckets are read-only downstream, so sharing is safe. */
182
+ private _groupDataCache;
177
183
  /** Separate group→color map for resolveGroupColor (insertion-order based, never invalidates _colorMapCache).
178
184
  * FIFO-bounded to `GROUP_COLOR_MAP_CAP` entries — in long-running streams with unique group IDs (e.g. UUIDs
179
185
  * as `lineBy` keys) this would otherwise grow unboundedly. Evicted groups that re-appear get a new palette
@@ -1,4 +1,5 @@
1
1
  import type { Datum } from "../charts/shared/datumTypes";
2
+ import * as React from "react";
2
3
  import type { StreamScales, MarginalGraphicsConfig, XYFrameAxisConfig } from "./types";
3
4
  import type { AnnotationContext } from "../realtime/types";
4
5
  import type { ReactNode } from "react";
@@ -111,6 +112,6 @@ interface SVGUnderlayProps {
111
112
  yFormat?: (d: number | Date | string) => string | ReactNode;
112
113
  axisExtent?: import("../charts/shared/axisExtent").AxisExtentMode;
113
114
  }
114
- export declare function SVGUnderlay(props: SVGUnderlayProps): import("react/jsx-runtime").JSX.Element | null;
115
- export declare function SVGOverlay(props: SVGOverlayProps): import("react/jsx-runtime").JSX.Element | null;
115
+ export declare function SVGUnderlay(props: SVGUnderlayProps): React.JSX.Element | null;
116
+ export declare function SVGOverlay(props: SVGOverlayProps): React.JSX.Element | null;
116
117
  export {};
@@ -0,0 +1,19 @@
1
+ import type { StalenessConfig } from "./types";
2
+ interface StalenessBadgeProps {
3
+ isStale: boolean;
4
+ position?: StalenessConfig["badgePosition"];
5
+ }
6
+ /**
7
+ * Live/stale indicator chip shown in a corner of a streaming chart when
8
+ * `staleness.showBadge` is set.
9
+ *
10
+ * Shared by all four Stream Frames (XY / ordinal / network / geo) so the badge
11
+ * is pixel-identical across families. Previously each frame inlined its own
12
+ * copy and they had drifted — the network frame used a smaller, heavier variant
13
+ * (10px/700, tighter padding, letterSpacing). This is the canonical style: the
14
+ * more legible 11px/600 the other three shared, plus `zIndex`/`pointerEvents`
15
+ * hardening so the badge always sits above the canvas and never intercepts
16
+ * pointer events.
17
+ */
18
+ export declare function StalenessBadge({ isStale, position }: StalenessBadgeProps): import("react").JSX.Element;
19
+ export {};
@@ -1,3 +1,23 @@
1
+ /**
2
+ * XYBrushOverlay — d3-brush SVG overlay for XY frames.
3
+ *
4
+ * Renders a transparent SVG positioned above the canvas. Supports x, y, and
5
+ * xy brush dimensions, bin snapping, and streaming brush tracking (shrinks/
6
+ * clears the brush as data scrolls past the selected range).
7
+ *
8
+ * Key design decisions:
9
+ * - d3-brush lifecycle depends on [width, height, dimension, snap, binSize, snapDuring]
10
+ * only — scales and binBoundaries are read from refs to avoid teardown mid-drag.
11
+ * - Data-driven snapping (binBoundaries) uses binary search to snap to actual bin
12
+ * edges. Falls back to uniform grid math (binSize) when no boundaries are provided.
13
+ * - Bin snapping applies on "end" events by default. Set snapDuring=true to also
14
+ * snap during drag (the "brush" event).
15
+ * - Streaming tracking guards against y-only dimension (no x-domain to track).
16
+ * - isProgrammaticMoveRef prevents re-entrant brush events from .move() calls.
17
+ *
18
+ * Consumed by: StreamXYFrame (rendered when brush prop is set).
19
+ */
20
+ import * as React from "react";
1
21
  import type { StreamScales } from "./types";
2
22
  export interface XYBrushOverlayProps {
3
23
  width: number;
@@ -24,4 +44,4 @@ export interface XYBrushOverlayProps {
24
44
  snapDuring?: boolean;
25
45
  streaming?: boolean;
26
46
  }
27
- export declare function XYBrushOverlay({ width, height, totalWidth, totalHeight, margin, dimension, scales, onBrush, binSize, snap, binBoundaries, snapDuring, streaming }: XYBrushOverlayProps): import("react/jsx-runtime").JSX.Element;
47
+ export declare function XYBrushOverlay({ width, height, totalWidth, totalHeight, margin, dimension, scales, onBrush, binSize, snap, binBoundaries, snapDuring, streaming }: XYBrushOverlayProps): React.JSX.Element;
@@ -13,10 +13,16 @@ export interface QuadtreeHit<T> {
13
13
  * much larger visual radius can still be a valid hit that `find()` would
14
14
  * hide.
15
15
  *
16
- * `T` must expose `x`, `y`, and `r` the standard `PointSceneNode` shape.
16
+ * For the standard `{ x, y, r }` node shape (e.g. `PointSceneNode`) call it
17
+ * without accessors. For nodes that store their center under different field
18
+ * names (e.g. network circle nodes use `cx`/`cy`) pass `getX`/`getY`/`getR` —
19
+ * the typed overload requires them, so an incompatible shape is a compile
20
+ * error rather than a runtime NaN. The quadtree itself must be built with
21
+ * matching `.x()`/`.y()` accessors.
17
22
  */
18
23
  export declare function findHitPointInQuadtree<T extends {
19
24
  x: number;
20
25
  y: number;
21
26
  r: number;
22
27
  }>(qt: Quadtree<T>, px: number, py: number, maxDistance: number, maxPointRadius: number): QuadtreeHit<T> | null;
28
+ export declare function findHitPointInQuadtree<T>(qt: Quadtree<T>, px: number, py: number, maxDistance: number, maxPointRadius: number, getX: (n: T) => number, getY: (n: T) => number, getR: (n: T) => number): QuadtreeHit<T> | null;