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
@@ -60,7 +60,28 @@ export interface AreaChartProps<TDatum extends Record<string, any> = Record<stri
60
60
  */
61
61
  curve?: "linear" | "monotoneX" | "monotoneY" | "step" | "stepAfter" | "stepBefore" | "basis" | "cardinal" | "catmullRom";
62
62
  /**
63
- * Area opacity
63
+ * Per-point lower bound accessor for band/ribbon charts.
64
+ * When set, the area fills between yAccessor (top) and y0Accessor (bottom)
65
+ * instead of filling down to the axis. Use for percentile bands (p5–p95),
66
+ * confidence intervals, or any ribbon visualization.
67
+ * @example
68
+ * ```ts
69
+ * // Data: [{ x: 0, p95: 80, p5: 20 }, ...]
70
+ * <AreaChart data={d} xAccessor="x" yAccessor="p95" y0Accessor="p5" />
71
+ * ```
72
+ */
73
+ y0Accessor?: ChartAccessor<TDatum, number>;
74
+ /**
75
+ * Gradient fill from line to baseline. Set `true` for default (80% → 5%)
76
+ * or `{ topOpacity, bottomOpacity }` for custom values.
77
+ * @default false
78
+ */
79
+ gradientFill?: boolean | {
80
+ topOpacity: number;
81
+ bottomOpacity: number;
82
+ };
83
+ /**
84
+ * Area opacity (flat fill, ignored when gradientFill is set)
64
85
  * @default 0.7
65
86
  */
66
87
  areaOpacity?: number;
@@ -0,0 +1,60 @@
1
+ import * as React from "react";
2
+ import type { StreamXYFrameProps } from "../../stream/types";
3
+ import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
4
+ import { type TooltipProp } from "../../Tooltip/Tooltip";
5
+ /**
6
+ * ConnectedScatterplot component props
7
+ */
8
+ export interface ConnectedScatterplotProps<TDatum extends Record<string, any> = Record<string, any>> extends BaseChartProps, AxisConfig {
9
+ /** Array of data points. Each point needs x and y properties. */
10
+ data: TDatum[];
11
+ /** Field name or function to access x values @default "x" */
12
+ xAccessor?: ChartAccessor<TDatum, number>;
13
+ /** Field name or function to access y values @default "y" */
14
+ yAccessor?: ChartAccessor<TDatum, number>;
15
+ /**
16
+ * Field name or function that determines point ordering.
17
+ * Data is sorted by this value (ascending) before connecting.
18
+ * Supports numbers and Dates. Shown in tooltip. @default undefined (use data array order)
19
+ */
20
+ orderAccessor?: string | ((d: TDatum) => number | Date);
21
+ /** Label for the ordering metric in tooltips @default "Order" or the accessor field name */
22
+ orderLabel?: string;
23
+ /** Point radius @default 4 */
24
+ pointRadius?: number;
25
+ /** Enable hover annotations @default true */
26
+ enableHover?: boolean;
27
+ /** Show grid lines @default false */
28
+ showGrid?: boolean;
29
+ /** Tooltip configuration */
30
+ tooltip?: TooltipProp;
31
+ /** Accessor for unique point IDs, used by point-anchored annotations */
32
+ pointIdAccessor?: ChartAccessor<TDatum, string>;
33
+ /** Annotation objects to render on the chart */
34
+ annotations?: Record<string, any>[];
35
+ /** Additional StreamXYFrame props for advanced customization */
36
+ frameProps?: Partial<Omit<StreamXYFrameProps, "chartType" | "data" | "size">>;
37
+ }
38
+ /**
39
+ * ConnectedScatterplot — points connected in sequence by lines.
40
+ *
41
+ * Points are colored using viridis from start (purple) to end (yellow).
42
+ * Lines match the color of their source point and have the same width
43
+ * as the point radius, so the 2×radius circle remains distinctive.
44
+ * When fewer than 100 points, a 50% transparent white halo is drawn
45
+ * under each connecting line for legibility.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * <ConnectedScatterplot
50
+ * data={trajectory}
51
+ * xAccessor="gdp"
52
+ * yAccessor="lifeExpectancy"
53
+ * pointRadius={4}
54
+ * />
55
+ * ```
56
+ */
57
+ export declare function ConnectedScatterplot<TDatum extends Record<string, any> = Record<string, any>>(props: ConnectedScatterplotProps<TDatum>): React.JSX.Element;
58
+ export declare namespace ConnectedScatterplot {
59
+ var displayName: string;
60
+ }
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
  import type { StreamXYFrameProps } from "../../stream/types";
3
3
  import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
4
4
  import { type TooltipProp } from "../../Tooltip/Tooltip";
5
+ import type { AnomalyConfig, ForecastConfig } from "../shared/statisticalOverlays";
5
6
  /**
6
7
  * LineChart component props
7
8
  */
@@ -115,6 +116,17 @@ export interface LineChartProps<TDatum extends Record<string, any> = Record<stri
115
116
  * Annotation objects to render on the chart
116
117
  */
117
118
  annotations?: Record<string, any>[];
119
+ /**
120
+ * Anomaly detection configuration. Highlights outlier points and shows
121
+ * a shaded band representing the expected range (mean +/- threshold * stddev).
122
+ */
123
+ anomaly?: AnomalyConfig;
124
+ /**
125
+ * Forecast configuration. Splits the line into training (dashed),
126
+ * observed (solid), and forecast (dotted) segments. Shows a confidence
127
+ * envelope around the extrapolated forecast region.
128
+ */
129
+ forecast?: ForecastConfig;
118
130
  /**
119
131
  * Additional StreamXYFrame props for advanced customization
120
132
  * For full control, consider using StreamXYFrame directly