@opentrace/components 0.1.0

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 (56) hide show
  1. package/dist/assets/d3LayoutWorker-BMQ60AVN.js +864 -0
  2. package/dist/assets/d3LayoutWorker-BMQ60AVN.js.map +1 -0
  3. package/dist/assets/spacingWorker-hXLGHyRg.js +123 -0
  4. package/dist/assets/spacingWorker-hXLGHyRg.js.map +1 -0
  5. package/dist/components.css +1 -0
  6. package/dist/opentrace-components.cjs +7555 -0
  7. package/dist/opentrace-components.cjs.map +1 -0
  8. package/dist/opentrace-components.js +7555 -0
  9. package/dist/opentrace-components.js.map +1 -0
  10. package/dist/src/GraphCanvas.d.ts +60 -0
  11. package/dist/src/GraphCanvas.d.ts.map +1 -0
  12. package/dist/src/colors/communityColors.d.ts +31 -0
  13. package/dist/src/colors/communityColors.d.ts.map +1 -0
  14. package/dist/src/colors/linkColors.d.ts +2 -0
  15. package/dist/src/colors/linkColors.d.ts.map +1 -0
  16. package/dist/src/colors/nodeColors.d.ts +2 -0
  17. package/dist/src/colors/nodeColors.d.ts.map +1 -0
  18. package/dist/src/config/graphLayout.d.ts +50 -0
  19. package/dist/src/config/graphLayout.d.ts.map +1 -0
  20. package/dist/src/graph/LayoutPipeline.d.ts +26 -0
  21. package/dist/src/graph/LayoutPipeline.d.ts.map +1 -0
  22. package/dist/src/graph/drawNodeHover.d.ts +13 -0
  23. package/dist/src/graph/drawNodeHover.d.ts.map +1 -0
  24. package/dist/src/graph/spacingWorker.d.ts +43 -0
  25. package/dist/src/graph/spacingWorker.d.ts.map +1 -0
  26. package/dist/src/graph/types.d.ts +78 -0
  27. package/dist/src/graph/types.d.ts.map +1 -0
  28. package/dist/src/graph/useCommunities.d.ts +8 -0
  29. package/dist/src/graph/useCommunities.d.ts.map +1 -0
  30. package/dist/src/graph/useGraphFilters.d.ts +19 -0
  31. package/dist/src/graph/useGraphFilters.d.ts.map +1 -0
  32. package/dist/src/graph/useGraphInstance.d.ts +15 -0
  33. package/dist/src/graph/useGraphInstance.d.ts.map +1 -0
  34. package/dist/src/graph/useGraphVisuals.d.ts +9 -0
  35. package/dist/src/graph/useGraphVisuals.d.ts.map +1 -0
  36. package/dist/src/graph/useHighlights.d.ts +16 -0
  37. package/dist/src/graph/useHighlights.d.ts.map +1 -0
  38. package/dist/src/index.d.ts +27 -0
  39. package/dist/src/index.d.ts.map +1 -0
  40. package/dist/src/sigma/zoomToNodes.d.ts +15 -0
  41. package/dist/src/sigma/zoomToNodes.d.ts.map +1 -0
  42. package/dist/src/types/graph.d.ts +33 -0
  43. package/dist/src/types/graph.d.ts.map +1 -0
  44. package/dist/src/utils.d.ts +16 -0
  45. package/dist/src/utils.d.ts.map +1 -0
  46. package/dist/src/workers/d3LayoutWorker.d.ts +22 -0
  47. package/dist/src/workers/d3LayoutWorker.d.ts.map +1 -0
  48. package/dist/useHighlights-BHlafcBH.js +6692 -0
  49. package/dist/useHighlights-BHlafcBH.js.map +1 -0
  50. package/dist/useHighlights-D6Jl6Woe.cjs +6691 -0
  51. package/dist/useHighlights-D6Jl6Woe.cjs.map +1 -0
  52. package/dist/utils.cjs +12 -0
  53. package/dist/utils.cjs.map +1 -0
  54. package/dist/utils.js +12 -0
  55. package/dist/utils.js.map +1 -0
  56. package/package.json +67 -0
@@ -0,0 +1,60 @@
1
+ import '@react-sigma/core/lib/style.css';
2
+ import type { GraphNode, GraphLink, SelectedEdge } from './types/graph';
3
+ import type { LayoutConfig } from './graph/types';
4
+ import { type OptimizeStatus } from './graph/LayoutPipeline';
5
+ import type { GetSubTypeFn } from './graph/types';
6
+ export interface GraphCanvasProps {
7
+ /** Graph nodes to render. */
8
+ nodes: GraphNode[];
9
+ /** Graph links/edges to render. */
10
+ links: GraphLink[];
11
+ /** Width of the canvas in pixels. */
12
+ width: number;
13
+ /** Height of the canvas in pixels. */
14
+ height: number;
15
+ /** Layout and color configuration. Defaults to DEFAULT_LAYOUT_CONFIG. */
16
+ layoutConfig?: LayoutConfig;
17
+ /** Color mode for nodes — 'type' uses node type colors, 'community' uses Louvain community colors. */
18
+ colorMode?: 'type' | 'community';
19
+ /** Set of node type strings to hide. */
20
+ hiddenNodeTypes?: Set<string>;
21
+ /** Set of link label strings to hide. */
22
+ hiddenLinkTypes?: Set<string>;
23
+ /** Set of "Type:SubType" strings to hide. */
24
+ hiddenSubTypes?: Set<string>;
25
+ /** Set of community IDs to hide. */
26
+ hiddenCommunities?: Set<number>;
27
+ /** Search query for highlighting matching nodes. */
28
+ searchQuery?: string;
29
+ /** Currently selected node ID (for BFS highlight). */
30
+ selectedNodeId?: string | null;
31
+ /** Number of hops for BFS neighborhood highlight. Default: 2. */
32
+ hops?: number;
33
+ /** Function to extract sub-type from a node (e.g. file extension). */
34
+ getSubType?: GetSubTypeFn;
35
+ /** Called when a node is clicked. */
36
+ onNodeClick?: (node: GraphNode) => void;
37
+ /** Called when an edge is clicked. */
38
+ onEdgeClick?: (edge: SelectedEdge) => void;
39
+ /** Called when the background (stage) is clicked. */
40
+ onStageClick?: () => void;
41
+ /** Called when the optimize status changes. */
42
+ onOptimizeStatus?: (status: OptimizeStatus | null) => void;
43
+ /** CSS class name for the container div. */
44
+ className?: string;
45
+ /** Inline styles for the container div. */
46
+ style?: React.CSSProperties;
47
+ }
48
+ export interface GraphCanvasHandle {
49
+ /** Select and zoom to a node by ID. */
50
+ selectNode: (nodeId: string, hops?: number) => void;
51
+ /** Zoom to fit all visible nodes. */
52
+ zoomToFit: (duration?: number) => void;
53
+ /** Zoom to specific node IDs. */
54
+ zoomToNodes: (nodeIds: Iterable<string>, duration?: number) => void;
55
+ /** Trigger a layout re-optimization. */
56
+ optimize: () => void;
57
+ }
58
+ declare const GraphCanvas: import("react").NamedExoticComponent<GraphCanvasProps & import("react").RefAttributes<GraphCanvasHandle>>;
59
+ export default GraphCanvas;
60
+ //# sourceMappingURL=GraphCanvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphCanv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IAAI,CAAC;IACxC,sCAAsC;IACtC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3C,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,qCAAqC;IACrC,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,iCAAiC;IACjC,WAAW,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,wCAAwC;IACxC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAkHD,QAAA,MAAM,WAAW,2GAmRhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Build a stable community→color mapping, sorted by member count (largest community
3
+ * gets the first palette slot). This ensures the most prominent communities get the
4
+ * most visually distinct colors.
5
+ */
6
+ export declare function buildCommunityColorMap(assignments: Record<string, number>): Map<number, string>;
7
+ interface NameableNode {
8
+ id: string;
9
+ name: string;
10
+ type: string;
11
+ }
12
+ /**
13
+ * Derive a human-readable name for each community based on its member nodes.
14
+ *
15
+ * Strategy (in priority order):
16
+ * 1. Highest-priority container node (Module > Package > Directory > ...)
17
+ * 2. Longest common path prefix of node names (e.g., "src/components")
18
+ * 3. Hub node — the node whose name appears most often as a prefix/substring
19
+ * in other members' names, or failing that, the shortest-named node
20
+ * (often the defining class/file of the cluster)
21
+ * 4. Dominant node type + hub qualifier (e.g., "Functions · handleRequest")
22
+ *
23
+ * A final dedup pass appends the hub node name to any colliding labels.
24
+ */
25
+ export declare function buildCommunityNames(assignments: Record<string, number>, nodes: NameableNode[]): Map<number, string>;
26
+ /**
27
+ * Look up the community color for a given node.
28
+ */
29
+ export declare function getCommunityColor(communityAssignments: Record<string, number>, communityColorMap: Map<number, string>, nodeId: string): string;
30
+ export {};
31
+ //# sourceMappingURL=communityColors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"communityColors.d.ts","sourceRoot":"","sources":["../../../src/colors/communityColors.ts"],"names":[],"mappings":"AA2CA;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAerB;AAKD,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,KAAK,EAAE,YAAY,EAAE,GACpB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAiFrB;AA8FD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5C,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,MAAM,EAAE,MAAM,GACb,MAAM,CAIR"}
@@ -0,0 +1,2 @@
1
+ export declare function getLinkColor(type: string): string;
2
+ //# sourceMappingURL=linkColors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkColors.d.ts","sourceRoot":"","sources":["../../../src/colors/linkColors.ts"],"names":[],"mappings":"AA6DA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD"}
@@ -0,0 +1,2 @@
1
+ export declare function getNodeColor(type: string): string;
2
+ //# sourceMappingURL=nodeColors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeColors.d.ts","sourceRoot":"","sources":["../../../src/colors/nodeColors.ts"],"names":[],"mappings":"AAsDA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * ═══════════════════════════════════════════════════════════════════════
3
+ * Graph Layout & Rendering Configuration
4
+ *
5
+ * All tunable parameters for graph appearance in one place.
6
+ * Edit values here and see changes immediately on reload.
7
+ * ═══════════════════════════════════════════════════════════════════════
8
+ */
9
+ export declare const NODE_SIZE_MIN = 2;
10
+ export declare const NODE_SIZE_MAX = 8;
11
+ export declare const NODE_SIZE_DEGREE_SCALE = 1.1;
12
+ export declare const NODE_SIZE_MULTIPLIERS: Record<string, number>;
13
+ export declare const EDGE_SIZE_DEFAULT = 1;
14
+ export declare const EDGE_SIZE_DEFAULT_LINE = 2;
15
+ export declare const EDGE_SIZE_HIGHLIGHTED = 2.5;
16
+ export declare const EDGE_SIZE_DIMMED = 0.5;
17
+ export declare const EDGE_OPACITY_DEFAULT = 0.6;
18
+ export declare const EDGE_OPACITY_HIGHLIGHTED = 1;
19
+ export declare const EDGE_OPACITY_DIMMED = 0.05;
20
+ export declare const NODE_OPACITY_DIMMED = 0.15;
21
+ export declare const ZOOM_SIZE_EXPONENT = 0.9;
22
+ export declare const FORCE_LINK_DISTANCE = 200;
23
+ export declare const FORCE_CHARGE_STRENGTH = -200;
24
+ export declare const FORCE_SIMULATION_TICKS = 80;
25
+ export declare const FORCE_CLUSTER_STRENGTH = 0.3;
26
+ export declare const FORCE_CLUSTER_TICKS = 40;
27
+ export declare const FA2_ENABLED = true;
28
+ export declare const FA2_GRAVITY = 0.1;
29
+ export declare const FA2_SCALING_RATIO = 30;
30
+ export declare const FA2_SLOW_DOWN = 2;
31
+ export declare const FA2_BARNES_HUT_THRESHOLD = 300;
32
+ export declare const FA2_BARNES_HUT_THETA = 0.5;
33
+ export declare const FA2_STRONG_GRAVITY = false;
34
+ export declare const FA2_LIN_LOG_MODE = true;
35
+ export declare const FA2_OUTBOUND_ATTRACTION = true;
36
+ export declare const FA2_ADJUST_SIZES = true;
37
+ export declare const FA2_DURATION = 3000;
38
+ export declare const NOVERLAP_MAX_ITERATIONS = 50;
39
+ export declare const NOVERLAP_RATIO = 1.5;
40
+ export declare const NOVERLAP_MARGIN = 10;
41
+ export declare const NOVERLAP_EXPANSION = 1.5;
42
+ export declare const EDGE_PROGRAM_THRESHOLD = 50000;
43
+ export declare const LABEL_RENDERED_SIZE_THRESHOLD = 8;
44
+ export declare const LABEL_SIZE = 12;
45
+ export declare const LABEL_FONT = "Inter, system-ui, sans-serif";
46
+ export declare const LABEL_COLOR = "#e2e8f0";
47
+ export declare const LOUVAIN_RESOLUTION = 1;
48
+ import type { LayoutConfig } from '../graph/types';
49
+ export declare const DEFAULT_LAYOUT_CONFIG: LayoutConfig;
50
+ //# sourceMappingURL=graphLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphLayout.d.ts","sourceRoot":"","sources":["../../../src/config/graphLayout.ts"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AAMH,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAG1C,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKxD,CAAC;AAIF,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAKp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MAAM,gBAAgB,CAAC;AASnD,eAAO,MAAM,qBAAqB,EAAE,YAkCnC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { LayoutConfig } from './types';
2
+ interface LayoutPipelineProps {
3
+ layoutReady: boolean;
4
+ layoutConfig: LayoutConfig;
5
+ optimizeTick: number;
6
+ /** Community assignments for size-aware community spacing */
7
+ communityAssignments?: Record<string, number>;
8
+ /** Called with the current optimize status for UI display */
9
+ onOptimizeStatus?: (status: OptimizeStatus | null) => void;
10
+ }
11
+ export interface OptimizeStatus {
12
+ phase: 'fa2' | 'noverlap' | 'spacing' | 'optimizing' | 'done';
13
+ iteration?: number;
14
+ cleanRatio?: number;
15
+ totalOverlaps?: number;
16
+ }
17
+ /**
18
+ * Renderless component that orchestrates the layout pipeline inside a
19
+ * `<SigmaContainer>`. Requires `useSigma()` context.
20
+ *
21
+ * Pipeline: ForceAtlas2 → Noverlap → Optimize → Zoom-to-fit
22
+ * Optimize button: re-runs FA2 → Noverlap → Optimize
23
+ */
24
+ export default function LayoutPipeline({ layoutReady, layoutConfig, optimizeTick, communityAssignments, onOptimizeStatus, }: LayoutPipelineProps): null;
25
+ export {};
26
+ //# sourceMappingURL=LayoutPipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutPipeline.d.ts","sourceRoot":"","sources":["../../../src/graph/LayoutPipeline.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAO5C,UAAU,mBAAmB;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,GACjB,EAAE,mBAAmB,QA8UrB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Custom node hover renderer for Sigma.
3
+ *
4
+ * Theme-aware: reads --popover / --popover-foreground CSS variables.
5
+ * Shows the node label + community name in the tooltip.
6
+ */
7
+ import type { Attributes } from 'graphology-types';
8
+ import type { NodeDisplayData } from 'sigma/types';
9
+ import type { Settings } from 'sigma/settings';
10
+ type PartialButFor<T, K extends keyof T> = Pick<T, K> & Partial<T>;
11
+ export declare function drawNodeHover<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes>(context: CanvasRenderingContext2D, data: PartialButFor<NodeDisplayData, 'x' | 'y' | 'size' | 'label' | 'color'>, settings: Settings<N, E, G>): void;
12
+ export {};
13
+ //# sourceMappingURL=drawNodeHover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawNodeHover.d.ts","sourceRoot":"","sources":["../../../src/graph/drawNodeHover.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,KAAK,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AA8BnE,wBAAgB,aAAa,CAC3B,CAAC,SAAS,UAAU,GAAG,UAAU,EACjC,CAAC,SAAS,UAAU,GAAG,UAAU,EACjC,CAAC,SAAS,UAAU,GAAG,UAAU,EAEjC,OAAO,EAAE,wBAAwB,EACjC,IAAI,EAAE,aAAa,CAAC,eAAe,EAAE,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,EAC5E,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC1B,IAAI,CAqGN"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Web Worker that iteratively pushes community centroids apart so they
3
+ * don't overlap. Each community is treated as a circle with radius
4
+ * proportional to sqrt(memberCount).
5
+ *
6
+ * Posts position updates after each iteration so the graph updates live.
7
+ */
8
+ export interface SpacingNode {
9
+ id: string;
10
+ x: number;
11
+ y: number;
12
+ communityId: number;
13
+ }
14
+ export interface SpacingRequest {
15
+ nodes: SpacingNode[];
16
+ /** Multiplier for community radius (higher = more space between communities) */
17
+ radiusScale: number;
18
+ /** Extra gap between community borders (in graph coordinate units) */
19
+ gap: number;
20
+ /** Max iterations */
21
+ maxIterations: number;
22
+ /** Stop when max overlap between any two communities is below this (0–1) */
23
+ overlapThreshold: number;
24
+ }
25
+ export interface SpacingProgress {
26
+ type: 'progress';
27
+ iteration: number;
28
+ maxOverlap: number;
29
+ /** Per-node position updates (delta applied to all members of moved communities) */
30
+ updates: {
31
+ id: string;
32
+ x: number;
33
+ y: number;
34
+ }[];
35
+ }
36
+ export interface SpacingDone {
37
+ type: 'done';
38
+ iterations: number;
39
+ maxOverlap: number;
40
+ totalMs: number;
41
+ }
42
+ export type SpacingResponse = SpacingProgress | SpacingDone;
43
+ //# sourceMappingURL=spacingWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spacingWorker.d.ts","sourceRoot":"","sources":["../../../src/graph/spacingWorker.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AAEH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,qBAAqB;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACjD;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,WAAW,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Graph node — the minimal interface required by the graph layout system.
3
+ * Consumers can extend this with additional properties.
4
+ */
5
+ export interface GraphNode {
6
+ id: string;
7
+ name: string;
8
+ type: string;
9
+ properties?: Record<string, unknown>;
10
+ }
11
+ /**
12
+ * Graph link — the minimal interface required by the graph layout system.
13
+ */
14
+ export interface GraphLink {
15
+ source: string;
16
+ target: string;
17
+ label: string;
18
+ properties?: Record<string, unknown>;
19
+ }
20
+ /** All layout tuning parameters bundled into one object. */
21
+ export interface LayoutConfig {
22
+ linkDistance: number;
23
+ chargeStrength: number;
24
+ simulationTicks: number;
25
+ clusterStrength: number;
26
+ clusterTicks: number;
27
+ clusterSeparation: number;
28
+ fa2Enabled: boolean;
29
+ fa2Gravity: number;
30
+ fa2ScalingRatio: number;
31
+ fa2SlowDown: number;
32
+ fa2BarnesHutThreshold: number;
33
+ fa2BarnesHutTheta: number;
34
+ fa2StrongGravity: boolean;
35
+ fa2LinLogMode: boolean;
36
+ fa2OutboundAttraction: boolean;
37
+ fa2AdjustSizes: boolean;
38
+ fa2Duration: number;
39
+ noverlapMaxNodes: number;
40
+ noverlapMaxIterations: number;
41
+ noverlapRatio: number;
42
+ noverlapMargin: number;
43
+ noverlapExpansion: number;
44
+ louvainResolution: number;
45
+ edgeProgramThreshold: number;
46
+ layoutEdgeType: string;
47
+ structuralTypes: string[];
48
+ getNodeColor: (type: string) => string;
49
+ getLinkColor: (label: string) => string;
50
+ /** Build a community→color mapping from assignments (largest community gets first palette slot) */
51
+ buildCommunityColorMap: (assignments: Record<string, number>) => Map<number, string>;
52
+ /** Derive human-readable community names from assignments and nodes */
53
+ buildCommunityNames: (assignments: Record<string, number>, nodes: GraphNode[]) => Map<number, string>;
54
+ /** Look up the community color for a given node */
55
+ getCommunityColor: (assignments: Record<string, number>, colorMap: Map<number, string>, nodeId: string) => string;
56
+ }
57
+ export interface FilterState {
58
+ hiddenNodeTypes: Set<string>;
59
+ hiddenLinkTypes: Set<string>;
60
+ hiddenSubTypes: Set<string>;
61
+ hiddenCommunities: Set<number>;
62
+ }
63
+ export interface VisualState {
64
+ colorMode: 'type' | 'community';
65
+ highlightNodes: Set<string>;
66
+ highlightLinks: Set<string>;
67
+ labelNodes: Set<string>;
68
+ selectedNodeId: string | null;
69
+ }
70
+ export interface CommunityData {
71
+ assignments: Record<string, number>;
72
+ colorMap: Map<number, string>;
73
+ names: Map<number, string>;
74
+ count: number;
75
+ }
76
+ /** Function to extract a sub-type from a node (e.g. file extension, language). */
77
+ export type GetSubTypeFn = (node: GraphNode) => string | null;
78
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/graph/types.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,4DAA4D;AAC5D,MAAM,WAAW,YAAY;IAE3B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IAExB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAE1B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IAEpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;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cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,MAAM,GAAG,IAAI,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { GraphNode, GraphLink, CommunityData, LayoutConfig } from './types';
2
+ /**
3
+ * Compute Louvain communities on the full (unfiltered) graph.
4
+ * Color and naming functions are provided via layoutConfig to avoid
5
+ * coupling to a specific color palette.
6
+ */
7
+ export declare function useCommunities(allNodes: GraphNode[], allLinks: GraphLink[], layoutConfig: LayoutConfig): CommunityData;
8
+ //# sourceMappingURL=useCommunities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCommunities.d.ts","sourceRoot":"","sources":["../../../src/graph/useCommunities.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,SAAS,EAAE,EACrB,QAAQ,EAAE,SAAS,EAAE,EACrB,YAAY,EAAE,YAAY,GACzB,aAAa,CA0Df"}
@@ -0,0 +1,19 @@
1
+ import type Graph from 'graphology';
2
+ import type { GraphNode, FilterState, GetSubTypeFn } from './types';
3
+ /**
4
+ * Determine whether a node should be hidden based on the current filter state.
5
+ * Exported so it can be reused by other components.
6
+ */
7
+ export declare function shouldHideNode(node: GraphNode, filterState: FilterState, communityAssignments: Record<string, number>, availableSubTypes: Map<string, {
8
+ subType: string;
9
+ count: number;
10
+ }[]>, getSubType: GetSubTypeFn): boolean;
11
+ /**
12
+ * Sets `hidden` attribute on nodes/edges based on filter state.
13
+ * Never touches x/y positions.
14
+ */
15
+ export declare function useGraphFilters(graph: Graph, layoutReady: boolean, filterState: FilterState, communityAssignments: Record<string, number>, availableSubTypes: Map<string, {
16
+ subType: string;
17
+ count: number;
18
+ }[]>, getSubType: GetSubTypeFn): void;
19
+ //# sourceMappingURL=useGraphFilters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGraphFilters.d.ts","sourceRoot":"","sources":["../../../src/graph/useGraphFilters.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIpE;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,EACf,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5C,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,EACpE,UAAU,EAAE,YAAY,GACvB,OAAO,CAyBT;AAID;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,OAAO,EACpB,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5C,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,EACpE,UAAU,EAAE,YAAY,GACvB,IAAI,CAmDN"}
@@ -0,0 +1,15 @@
1
+ import Graph from 'graphology';
2
+ import type { GraphNode, GraphLink, CommunityData, LayoutConfig } from './types';
3
+ export interface UseGraphInstanceResult {
4
+ graph: Graph;
5
+ /** True once d3-force layout has been applied and positions seeded into the graph */
6
+ layoutReady: boolean;
7
+ }
8
+ export interface UseGraphInstanceOptions {
9
+ allNodes: GraphNode[];
10
+ allLinks: GraphLink[];
11
+ communityData: CommunityData;
12
+ layoutConfig: LayoutConfig;
13
+ }
14
+ export declare function useGraphInstance({ allNodes, allLinks, communityData, layoutConfig, }: UseGraphInstanceOptions): UseGraphInstanceResult;
15
+ //# sourceMappingURL=useGraphInstance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGraphInstance.d.ts","sourceRoot":"","sources":["../../../src/graph/useGraphInstance.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,YAAY,EACb,MAAM,SAAS,CAAC;AAyCjB,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,KAAK,CAAC;IACb,qFAAqF;IACrF,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,YAAY,GACb,EAAE,uBAAuB,GAAG,sBAAsB,CAqMlD"}
@@ -0,0 +1,9 @@
1
+ import type Graph from 'graphology';
2
+ import type { VisualState, LayoutConfig } from './types';
3
+ /**
4
+ * Updates colors, highlights, and selection state on graph nodes/edges.
5
+ * Color functions are read from layoutConfig to avoid coupling to a specific palette.
6
+ * Never touches x/y positions.
7
+ */
8
+ export declare function useGraphVisuals(graph: Graph, layoutReady: boolean, visualState: VisualState, layoutConfig: LayoutConfig, _degreeMap: Map<string, number>, isLargeGraph: boolean): void;
9
+ //# sourceMappingURL=useGraphVisuals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGraphVisuals.d.ts","sourceRoot":"","sources":["../../../src/graph/useGraphVisuals.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAqCzD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,OAAO,EACpB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,YAAY,EAAE,OAAO,GACpB,IAAI,CA0DN"}
@@ -0,0 +1,16 @@
1
+ import type Graph from 'graphology';
2
+ import type { GraphNode, GraphLink, FilterState } from './types';
3
+ /**
4
+ * Compute highlight sets (nodes, links, labels) and a hop-distance map based on
5
+ * the current search query, selected node, hop depth, and filter state.
6
+ *
7
+ * Adjacency is built from `allLinks` filtered by `filterState.hiddenLinkTypes`
8
+ * and excluding links whose endpoints belong to hidden node types.
9
+ */
10
+ export declare function useHighlights(_graph: Graph, _layoutReady: boolean, allNodes: GraphNode[], allLinks: GraphLink[], searchQuery: string, selectedNodeId: string | null, hops: number, filterState: FilterState): {
11
+ highlightNodes: Set<string>;
12
+ highlightLinks: Set<string>;
13
+ labelNodes: Set<string>;
14
+ hopMap: Map<string, number>;
15
+ };
16
+ //# sourceMappingURL=useHighlights.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHighlights.d.ts","sourceRoot":"","sources":["../../../src/graph/useHighlights.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAUjE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,KAAK,EACb,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,SAAS,EAAE,EACrB,QAAQ,EAAE,SAAS,EAAE,EACrB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,WAAW,GACvB;IACD,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,CA6FA"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @opentrace/components — React component library for graph visualization.
3
+ *
4
+ * Usage:
5
+ * import { GraphCanvas } from '@opentrace/components';
6
+ * import '@opentrace/components/style.css'; // optional base styles
7
+ */
8
+ export { default as GraphCanvas } from './GraphCanvas';
9
+ export type { GraphCanvasProps, GraphCanvasHandle } from './GraphCanvas';
10
+ export { useGraphInstance } from './graph/useGraphInstance';
11
+ export type { UseGraphInstanceResult, UseGraphInstanceOptions, } from './graph/useGraphInstance';
12
+ export { useGraphFilters, shouldHideNode } from './graph/useGraphFilters';
13
+ export { useGraphVisuals } from './graph/useGraphVisuals';
14
+ export { useCommunities } from './graph/useCommunities';
15
+ export { useHighlights } from './graph/useHighlights';
16
+ export { default as LayoutPipeline } from './graph/LayoutPipeline';
17
+ export type { OptimizeStatus } from './graph/LayoutPipeline';
18
+ export { zoomToNodes, zoomToFit } from './sigma/zoomToNodes';
19
+ export { drawNodeHover } from './graph/drawNodeHover';
20
+ export type { GraphNode, GraphLink, GraphData, GraphStats, SelectedNode, SelectedEdge, } from './types/graph';
21
+ export type { LayoutConfig, FilterState, VisualState, CommunityData, GetSubTypeFn, } from './graph/types';
22
+ export { DEFAULT_LAYOUT_CONFIG } from './config/graphLayout';
23
+ export { NODE_SIZE_MIN, NODE_SIZE_MAX, NODE_SIZE_DEGREE_SCALE, NODE_SIZE_MULTIPLIERS, EDGE_SIZE_DEFAULT, EDGE_SIZE_HIGHLIGHTED, EDGE_SIZE_DIMMED, EDGE_OPACITY_DEFAULT, EDGE_OPACITY_HIGHLIGHTED, EDGE_OPACITY_DIMMED, NODE_OPACITY_DIMMED, ZOOM_SIZE_EXPONENT, EDGE_PROGRAM_THRESHOLD, LABEL_RENDERED_SIZE_THRESHOLD, LABEL_SIZE, LABEL_FONT, LABEL_COLOR, FA2_ENABLED, FA2_GRAVITY, FA2_SCALING_RATIO, FA2_DURATION, LOUVAIN_RESOLUTION, } from './config/graphLayout';
24
+ export { getNodeColor } from './colors/nodeColors';
25
+ export { getLinkColor } from './colors/linkColors';
26
+ export { buildCommunityColorMap, buildCommunityNames, getCommunityColor, } from './colors/communityColors';
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AAGH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,YAAY,EACV,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,YAAY,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,YAAY,EACZ,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EACL,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,6BAA6B,EAC7B,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type Sigma from 'sigma';
2
+ /**
3
+ * Zoom the sigma camera to fit a set of node IDs.
4
+ * Replaces `fgRef.current.zoomToFit(duration, padding, predicate)`.
5
+ */
6
+ export declare function zoomToNodes(sigma: Sigma, nodeIds: Iterable<string>, duration?: number, padding?: number): void;
7
+ /**
8
+ * Zoom the camera to fit all nodes in the graph.
9
+ *
10
+ * Sigma normalizes all graph coordinates to [0,1] space internally.
11
+ * Camera state {x: 0.5, y: 0.5, ratio: 1} centers on the full extent —
12
+ * equivalent to a "reset" that shows everything.
13
+ */
14
+ export declare function zoomToFit(sigma: Sigma, duration?: number): void;
15
+ //# sourceMappingURL=zoomToNodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoomToNodes.d.ts","sourceRoot":"","sources":["../../../src/sigma/zoomToNodes.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,EACzB,QAAQ,SAAM,EACd,OAAO,SAAM,GACZ,IAAI,CA6CN;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,SAAM,GAAG,IAAI,CAG5D"}
@@ -0,0 +1,33 @@
1
+ export interface GraphNode {
2
+ id: string;
3
+ name: string;
4
+ type: string;
5
+ properties?: Record<string, unknown>;
6
+ }
7
+ export interface GraphLink {
8
+ source: string;
9
+ target: string;
10
+ label: string;
11
+ properties?: Record<string, unknown>;
12
+ }
13
+ export interface GraphData {
14
+ nodes: GraphNode[];
15
+ links: GraphLink[];
16
+ }
17
+ export interface GraphStats {
18
+ total_nodes: number;
19
+ total_edges: number;
20
+ nodes_by_type: Record<string, number>;
21
+ }
22
+ /** Replaces NodeObject<GraphNode> — no more mutable D3 refs */
23
+ export type SelectedNode = GraphNode;
24
+ /** Replaces LinkObject<GraphNode, GraphLink> — endpoints always strings */
25
+ export interface SelectedEdge {
26
+ source: string;
27
+ target: string;
28
+ label: string;
29
+ properties?: Record<string, unknown>;
30
+ sourceNode?: GraphNode;
31
+ targetNode?: GraphNode;
32
+ }
33
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/types/graph.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED,+DAA+D;AAC/D,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC;AAErC,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Lightweight re-exports that don't pull in sigma/WebGL.
3
+ * Use this entry point in non-browser contexts (tests, SSR, Node).
4
+ *
5
+ * Usage:
6
+ * import { getNodeColor, getLinkColor } from '@opentrace/components/utils';
7
+ */
8
+ export type { GraphNode, GraphLink, GraphData, GraphStats, SelectedNode, SelectedEdge, } from './types/graph';
9
+ export type { LayoutConfig, FilterState, VisualState, CommunityData, GetSubTypeFn, } from './graph/types';
10
+ export { getNodeColor } from './colors/nodeColors';
11
+ export { getLinkColor } from './colors/linkColors';
12
+ export { buildCommunityColorMap, buildCommunityNames, getCommunityColor, } from './colors/communityColors';
13
+ export { shouldHideNode } from './graph/useGraphFilters';
14
+ export { useCommunities } from './graph/useCommunities';
15
+ export { useHighlights } from './graph/useHighlights';
16
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AAGH,YAAY,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,YAAY,EACZ,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,22 @@
1
+ interface SimLink {
2
+ source: string;
3
+ target: string;
4
+ }
5
+ export interface LayoutRequest {
6
+ nodeIds: string[];
7
+ links: SimLink[];
8
+ communities?: Record<string, number>;
9
+ config: {
10
+ linkDistance: number;
11
+ chargeStrength: number;
12
+ ticks: number;
13
+ clusterStrength?: number;
14
+ clusterTicks?: number;
15
+ clusterSeparation?: number;
16
+ };
17
+ }
18
+ export interface LayoutResponse {
19
+ positions: [string, number, number][];
20
+ }
21
+ export {};
22
+ //# sourceMappingURL=d3LayoutWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d3LayoutWorker.d.ts","sourceRoot":"","sources":["../../../src/workers/d3LayoutWorker.ts"],"names":[],"mappings":"AAqCA,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,EAAE;QACN,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CACvC"}