vortx-gl 1.0.28 → 1.0.29

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.
@@ -14,8 +14,16 @@ export interface HUDAction {
14
14
  */
15
15
  export declare class ComboRenderer {
16
16
  private hudRects;
17
+ private expandedRects;
17
18
  private state;
18
19
  constructor(state: SharedOverlayState);
20
+ /**
21
+ * Hit-test the BORDER RING of an expanded MANAGED combo's hull. Returns the
22
+ * combo id if the cursor is within `band` px of the drawn hull edge, else
23
+ * null. A press in the deep interior returns null so it falls through to
24
+ * panning — otherwise a group covering the viewport would trap navigation.
25
+ */
26
+ pickComboBorder(mouseX: number, mouseY: number): string | null;
19
27
  /** Hit-test the rendered HUD strip. Returns the action under the cursor, or null. */
20
28
  pickHUDAction(mouseX: number, mouseY: number): HUDAction | null;
21
29
  draw(combos: Map<string, Combo>, positions: Float32Array, nodeCount: number, viewMatrix: mat3, zoom: number, selectedComboId: string | null, dropTargetId: string | null, editingComboId: string | null, theme: string, dpr: number): void;
@@ -28,5 +28,5 @@ export declare class EdgeRenderer {
28
28
  */
29
29
  drawCustomEdges(indices: Uint32Array, count: number, edgeMetadata: Map<string, EdgeMetadata>, edgeIndexToId: string[], theme: string, dpr: number, nodeMetadata: Map<number, NodeMetadata>, pointSize: number): void;
30
30
  drawLabels(indices: Uint32Array, count: number, edgeMetadata: Map<string, EdgeMetadata>, edgeIndexToId: string[], theme: "dark" | "light", dpr: number, zoom: number, nodeMetadata: Map<number, NodeMetadata>, pointSize: number, defaultLabelMinZoom?: number, defaultLabelMaxZoom?: number): void;
31
- drawArrows(indices: Uint32Array, count: number, edgeMetadata: Map<string, EdgeMetadata>, edgeIndexToId: string[], theme: string, dpr: number, zoom: number, nodeMetadata: Map<number, NodeMetadata>, pointSize: number): void;
31
+ drawArrows(indices: Uint32Array, count: number, edgeMetadata: Map<string, EdgeMetadata>, edgeIndexToId: string[], theme: string, dpr: number, zoom: number, nodeMetadata: Map<number, NodeMetadata>, pointSize: number, selectedEdgeIds?: Set<string>): void;
32
32
  }
@@ -29,6 +29,8 @@ export declare class OverlayManager {
29
29
  clearOnly(): void;
30
30
  /** Hit-test the combo HUD strip (delegates to ComboRenderer). */
31
31
  pickHUDAction(mouseX: number, mouseY: number): HUDAction | null;
32
+ /** Hit-test the border ring of an expanded managed combo (delegates to ComboRenderer). */
33
+ pickComboBorder(mouseX: number, mouseY: number): string | null;
32
34
  /** Hit-test the corner expand/collapse button of nodeGroup nodes (delegates to NodeRenderer). */
33
35
  pickExpandButton(mouseX: number, mouseY: number): number | null;
34
36
  render(params: OverlayRenderParams): void;
@@ -66,6 +66,46 @@ export declare class GraphEngine {
66
66
  requestRender(): void;
67
67
  private startRenderLoop;
68
68
  render(): void;
69
+ /**
70
+ * Capture the current graph view as an image data URL (PNG by default).
71
+ *
72
+ * Composites the WebGL layer (nodes/edges) and the Canvas2D overlay
73
+ * (labels, borders, arrows, hulls) onto an opaque canvas filled with the
74
+ * theme background, so the output matches exactly what is on screen.
75
+ *
76
+ * A full synchronous render is forced first — the WebGL context is created
77
+ * WITHOUT `preserveDrawingBuffer`, so its drawing buffer is only readable
78
+ * within the same task as the draw. Both `drawImage(this.canvas)` and the
79
+ * `toDataURL` therefore run in this same call, before the browser
80
+ * composites and clears the buffer.
81
+ *
82
+ * @returns a data URL string, or "" when the canvas has zero area / the
83
+ * context is lost or destroyed.
84
+ */
85
+ /**
86
+ * Render the graph to a PNG data URL, optionally super-sampled for a crisp,
87
+ * higher-resolution capture.
88
+ *
89
+ * `scale` is the pixel ratio to render at, expressed in CSS pixels (like
90
+ * devicePixelRatio) — NOT a multiplier on the current backing store. It
91
+ * replaces the display dpr for this one render, so `scale: 2.5` yields an
92
+ * image 2.5× the CSS size with node points, labels, borders, arrows and edge
93
+ * widths all drawn at that resolution (genuinely sharper, not upscaled).
94
+ * Defaults to the live display dpr.
95
+ *
96
+ * `minHeight` / `minWidth` raise `scale` if it wouldn't reach that output
97
+ * size; `maxDimension` caps the largest output side so we never exceed the
98
+ * GPU / 2D-canvas limits (scale is reduced to fit).
99
+ */
100
+ captureImage(opts?: {
101
+ mimeType?: string;
102
+ quality?: number;
103
+ background?: string;
104
+ scale?: number;
105
+ minWidth?: number;
106
+ minHeight?: number;
107
+ maxDimension?: number;
108
+ }): string;
69
109
  /** Shared WebGL clear + LOD + edge + node draw. Called by both render paths. */
70
110
  private _drawWebGL;
71
111
  /** Fast-path render for layout animations: draws WebGL only, skips the Canvas2D overlay entirely. */
@@ -154,6 +194,12 @@ export declare class GraphEngine {
154
194
  getEdgeAt(mouseX: number, mouseY: number): string | null;
155
195
  pickCombo(mouseX: number, mouseY: number, exclude?: Set<number>): string | null;
156
196
  pickHUD(mouseX: number, mouseY: number): import('./overlay').HUDAction | null;
197
+ /**
198
+ * The expanded managed combo whose hull BORDER is under the cursor (or null).
199
+ * Only the border grabs the group for a whole-group move; the hull interior
200
+ * is left free so the user can pan the graph a group covers.
201
+ */
202
+ pickComboBorder(mouseX: number, mouseY: number): string | null;
157
203
  /**
158
204
  * Hit-test the corner expand/collapse (`+`/`−`) button of a collapsed-group
159
205
  * (`nodeGroup`) node. Returns the node's internal index, or null. CSS px
@@ -198,7 +244,7 @@ export declare class GraphEngine {
198
244
  /** Edge equivalent of `setNodeLabelSource`. */
199
245
  setEdgeLabelSource(edgeId: string, source?: string): void;
200
246
  reverseEdge(edgeId: string): void;
201
- setPhantomEdge(sourceNodeId: number, x: number, y: number): void;
247
+ setPhantomEdge(sourceNodeId: number, x: number, y: number, color?: string): void;
202
248
  clearPhantomEdge(): void;
203
249
  setFlowAnimation(enabled: boolean): void;
204
250
  setFlowVelocity(v: number): void;
@@ -397,6 +397,8 @@ export interface PhantomEdge {
397
397
  sourceNodeId: number;
398
398
  /** World-space target position (usually mouse position). */
399
399
  targetPos: vec2;
400
+ /** Stroke color (any CSS color). Defaults to a blue when unset. */
401
+ color?: string;
400
402
  }
401
403
  /**
402
404
  * Captures the current state of viewport interaction.
@@ -674,6 +676,13 @@ export interface GraphEventPayloadMap {
674
676
  export type GraphEvent = keyof GraphEventPayloadMap;
675
677
  /** Complete parameter object for overlay rendering. */
676
678
  export interface OverlayRenderParams extends InteractionState {
679
+ /**
680
+ * Device-pixel-ratio the overlay should draw at. Defaults to
681
+ * `window.devicePixelRatio` when omitted; captureImage() overrides it to
682
+ * super-sample the overlay at a higher resolution in lock-step with the
683
+ * WebGL layer.
684
+ */
685
+ dpr?: number;
677
686
  /** Selected node indices. */
678
687
  selectedNodes: Set<number>;
679
688
  /** Locked node indices. */