semiotic 3.0.0-beta.4 → 3.0.0-beta.6

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 (42) hide show
  1. package/CLAUDE.md +81 -126
  2. package/README.md +6 -3
  3. package/ai/cli.js +72 -0
  4. package/dist/CategoryColors.d.ts +48 -0
  5. package/dist/ChartGrid.d.ts +37 -0
  6. package/dist/ContextLayout.d.ts +38 -0
  7. package/dist/charts/index.d.ts +2 -0
  8. package/dist/charts/shared/statisticalOverlays.d.ts +76 -0
  9. package/dist/charts/shared/types.d.ts +4 -0
  10. package/dist/charts/shared/validateChartData.d.ts +3 -0
  11. package/dist/charts/shared/withChartWrapper.d.ts +18 -0
  12. package/dist/charts/xy/AreaChart.d.ts +22 -1
  13. package/dist/charts/xy/ConnectedScatterplot.d.ts +60 -0
  14. package/dist/charts/xy/LineChart.d.ts +12 -0
  15. package/dist/network.min.js +1 -1
  16. package/dist/network.module.min.js +1 -1
  17. package/dist/ordinal.min.js +1 -1
  18. package/dist/ordinal.module.min.js +1 -1
  19. package/dist/realtime.min.js +1 -1
  20. package/dist/realtime.module.min.js +1 -1
  21. package/dist/semiotic-ai.d.ts +8 -0
  22. package/dist/semiotic-ai.min.js +1 -1
  23. package/dist/semiotic-ai.module.min.js +1 -1
  24. package/dist/semiotic-data.min.js +1 -1
  25. package/dist/semiotic-data.module.min.js +1 -1
  26. package/dist/semiotic-xy.d.ts +1 -0
  27. package/dist/semiotic.d.ts +9 -3
  28. package/dist/semiotic.min.js +1 -1
  29. package/dist/semiotic.module.min.js +1 -1
  30. package/dist/server.min.js +1 -1
  31. package/dist/server.module.min.js +1 -1
  32. package/dist/stream/DataSourceAdapter.d.ts +3 -0
  33. package/dist/stream/PipelineStore.d.ts +6 -0
  34. package/dist/stream/SceneGraph.d.ts +1 -1
  35. package/dist/stream/keyboardNav.d.ts +39 -0
  36. package/dist/stream/networkTypes.d.ts +2 -0
  37. package/dist/stream/ordinalTypes.d.ts +2 -0
  38. package/dist/stream/types.d.ts +24 -0
  39. package/dist/stream/useResponsiveSize.d.ts +10 -0
  40. package/dist/xy.min.js +1 -1
  41. package/dist/xy.module.min.js +1 -1
  42. package/package.json +6 -2
@@ -1,6 +1,6 @@
1
1
  import type { SceneNode, LineSceneNode, AreaSceneNode, PointSceneNode, RectSceneNode, HeatcellSceneNode, Style, StreamScales } from "./types";
2
2
  export declare function buildLineNode(data: Record<string, any>[], scales: StreamScales, xGet: (d: Record<string, any>) => number, yGet: (d: Record<string, any>) => number, style: Style, group?: string): LineSceneNode;
3
- export declare function buildAreaNode(data: Record<string, any>[], scales: StreamScales, xGet: (d: Record<string, any>) => number, yGet: (d: Record<string, any>) => number, baselineY: number, style: Style, group?: string): AreaSceneNode;
3
+ export declare function buildAreaNode(data: Record<string, any>[], scales: StreamScales, xGet: (d: Record<string, any>) => number, yGet: (d: Record<string, any>) => number, baselineY: number, style: Style, group?: string, y0Get?: (d: Record<string, any>) => number): AreaSceneNode;
4
4
  export declare function buildStackedAreaNodes(groups: {
5
5
  key: string;
6
6
  data: Record<string, any>[];
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Keyboard navigation utilities for Stream Frames.
3
+ *
4
+ * Extracts navigable data points from the scene graph, sorts them
5
+ * spatially, and provides an index-based iteration API for arrow-key
6
+ * navigation. Reuses the existing hover/tooltip system — keyboard
7
+ * focus sets the same HoverData state that mouse hover does.
8
+ */
9
+ import type { HoverData } from "../realtime/types";
10
+ export interface NavPoint {
11
+ x: number;
12
+ y: number;
13
+ datum: any;
14
+ }
15
+ /**
16
+ * Extract navigable data points from XY scene nodes.
17
+ * Points/rects yield one point each. Lines/areas yield their path points
18
+ * paired with the underlying data. Sorted left-to-right by x.
19
+ */
20
+ export declare function extractXYNavPoints(scene: any[]): NavPoint[];
21
+ /**
22
+ * Extract navigable points from ordinal scene nodes.
23
+ * Sorted left-to-right (horizontal) or top-to-bottom (vertical).
24
+ */
25
+ export declare function extractOrdinalNavPoints(scene: any[]): NavPoint[];
26
+ /**
27
+ * Extract navigable points from network scene nodes.
28
+ * Node-only (edges are not individually navigable).
29
+ */
30
+ export declare function extractNetworkNavPoints(scene: any[]): NavPoint[];
31
+ /**
32
+ * Compute the next focus index given a key and current index.
33
+ * Returns -1 to clear focus.
34
+ */
35
+ export declare function nextIndex(key: string, current: number, total: number): number | null;
36
+ /**
37
+ * Convert a NavPoint to HoverData for the tooltip system.
38
+ */
39
+ export declare function navPointToHover(point: NavPoint): HoverData;
@@ -338,6 +338,8 @@ export interface StreamNetworkFrameProps<T = Record<string, any>> {
338
338
  nodeLabel?: string | ((d: any) => string);
339
339
  showLabels?: boolean;
340
340
  size?: [number, number];
341
+ responsiveWidth?: boolean;
342
+ responsiveHeight?: boolean;
341
343
  margin?: {
342
344
  top?: number;
343
345
  right?: number;
@@ -169,6 +169,8 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
169
169
  categoryAccessor?: string | ((d: T) => string);
170
170
  projection?: "vertical" | "horizontal" | "radial";
171
171
  size?: [number, number];
172
+ responsiveWidth?: boolean;
173
+ responsiveHeight?: boolean;
172
174
  margin?: {
173
175
  top?: number;
174
176
  right?: number;
@@ -92,6 +92,11 @@ export interface AreaSceneNode {
92
92
  style: Style;
93
93
  datum: any;
94
94
  group?: string;
95
+ /** Vertical gradient fill: opacity fades from topOpacity at the line to bottomOpacity at the baseline */
96
+ fillGradient?: {
97
+ topOpacity: number;
98
+ bottomOpacity: number;
99
+ };
95
100
  /** When false, skip hit testing (used for decorative bounds areas) */
96
101
  interactive?: boolean;
97
102
  }
@@ -207,6 +212,21 @@ export interface StreamXYFrameProps<T = Record<string, any>> {
207
212
  * When set, an uncertainty band is drawn ± this offset from the line.
208
213
  */
209
214
  boundsAccessor?: string | ((d: T) => number);
215
+ /**
216
+ * Per-point area baseline accessor. When set, area charts fill between
217
+ * yAccessor (top) and y0Accessor (bottom) instead of filling to the axis.
218
+ * Use for percentile bands, confidence ribbons, or any band/ribbon chart.
219
+ */
220
+ y0Accessor?: string | ((d: T) => number);
221
+ /**
222
+ * Gradient fill for area charts. The fill fades from topOpacity at the line
223
+ * to bottomOpacity at the baseline. Set to `true` for default (0.8 → 0.05)
224
+ * or `{ topOpacity, bottomOpacity }` for custom values.
225
+ */
226
+ gradientFill?: boolean | {
227
+ topOpacity: number;
228
+ bottomOpacity: number;
229
+ };
210
230
  /**
211
231
  * Style for bounds/uncertainty areas.
212
232
  * If omitted, defaults to the line color at 0.2 opacity.
@@ -228,6 +248,10 @@ export interface StreamXYFrameProps<T = Record<string, any>> {
228
248
  extentPadding?: number;
229
249
  sizeRange?: [number, number];
230
250
  size?: [number, number];
251
+ /** Auto-match width to container. Requires a sized parent element. */
252
+ responsiveWidth?: boolean;
253
+ /** Auto-match height to container. Requires a parent with explicit height. */
254
+ responsiveHeight?: boolean;
231
255
  margin?: {
232
256
  top?: number;
233
257
  right?: number;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Hook that measures the parent container and returns responsive dimensions.
3
+ * Uses ResizeObserver to track container size changes.
4
+ *
5
+ * @param baseSize - The default [width, height] from the size prop
6
+ * @param responsiveWidth - Whether width should follow container width
7
+ * @param responsiveHeight - Whether height should follow container height
8
+ * @returns [containerRef, effectiveSize] — attach the ref to the container div
9
+ */
10
+ export declare function useResponsiveSize(baseSize: [number, number], responsiveWidth?: boolean, responsiveHeight?: boolean): [React.RefObject<HTMLDivElement>, [number, number]];