@visualli/core 0.1.4 → 0.1.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 (85) hide show
  1. package/dist/animations/index.cjs +146 -0
  2. package/dist/animations/index.cjs.map +1 -0
  3. package/dist/animations/index.d.cts +81 -0
  4. package/dist/animations/index.d.ts +81 -0
  5. package/dist/animations/index.js +35 -0
  6. package/dist/animations/index.js.map +1 -0
  7. package/dist/chunk-6NXADJK2.js +562 -0
  8. package/dist/chunk-6NXADJK2.js.map +1 -0
  9. package/dist/chunk-F36SMC3K.js +106 -0
  10. package/dist/chunk-F36SMC3K.js.map +1 -0
  11. package/dist/chunk-G5H3P4YZ.js +273 -0
  12. package/dist/chunk-G5H3P4YZ.js.map +1 -0
  13. package/dist/chunk-GQMFBYLK.js +81 -0
  14. package/dist/chunk-GQMFBYLK.js.map +1 -0
  15. package/dist/chunk-I75TMOE4.js +108 -0
  16. package/dist/chunk-I75TMOE4.js.map +1 -0
  17. package/dist/chunk-LDJRGT2Q.js +163 -0
  18. package/dist/chunk-LDJRGT2Q.js.map +1 -0
  19. package/dist/chunk-LI3BVD6H.js +98 -0
  20. package/dist/chunk-LI3BVD6H.js.map +1 -0
  21. package/dist/chunk-LJYSKSCE.js +95 -0
  22. package/dist/chunk-LJYSKSCE.js.map +1 -0
  23. package/dist/chunk-LNTJTDB2.js +349 -0
  24. package/dist/chunk-LNTJTDB2.js.map +1 -0
  25. package/dist/chunk-PDP5CVUL.js +139 -0
  26. package/dist/chunk-PDP5CVUL.js.map +1 -0
  27. package/dist/chunk-VLGR5PZX.js +1 -0
  28. package/dist/chunk-VLGR5PZX.js.map +1 -0
  29. package/dist/config/index.cjs +391 -0
  30. package/dist/config/index.cjs.map +1 -0
  31. package/dist/config/index.d.cts +77 -0
  32. package/dist/config/index.d.ts +77 -0
  33. package/dist/config/index.js +38 -0
  34. package/dist/config/index.js.map +1 -0
  35. package/dist/constants/index.cjs +642 -0
  36. package/dist/constants/index.cjs.map +1 -0
  37. package/dist/constants/index.d.cts +448 -0
  38. package/dist/constants/index.d.ts +448 -0
  39. package/dist/constants/index.js +183 -0
  40. package/dist/constants/index.js.map +1 -0
  41. package/dist/document-B3hnNr-F.d.cts +73 -0
  42. package/dist/document-B3hnNr-F.d.ts +73 -0
  43. package/dist/index.cjs +32 -32
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.d.cts +15 -1044
  46. package/dist/index.d.ts +15 -1044
  47. package/dist/index.js +179 -1747
  48. package/dist/index.js.map +1 -1
  49. package/dist/layout/index.cjs +210 -0
  50. package/dist/layout/index.cjs.map +1 -0
  51. package/dist/layout/index.d.cts +80 -0
  52. package/dist/layout/index.d.ts +80 -0
  53. package/dist/layout/index.js +25 -0
  54. package/dist/layout/index.js.map +1 -0
  55. package/dist/mindmap-DWS0WZT_.d.cts +118 -0
  56. package/dist/mindmap-DWS0WZT_.d.ts +118 -0
  57. package/dist/parser/index.cjs +739 -0
  58. package/dist/parser/index.cjs.map +1 -0
  59. package/dist/parser/index.d.cts +87 -0
  60. package/dist/parser/index.d.ts +87 -0
  61. package/dist/parser/index.js +43 -0
  62. package/dist/parser/index.js.map +1 -0
  63. package/dist/performance/index.cjs +167 -0
  64. package/dist/performance/index.cjs.map +1 -0
  65. package/dist/performance/index.d.cts +40 -0
  66. package/dist/performance/index.d.ts +40 -0
  67. package/dist/performance/index.js +12 -0
  68. package/dist/performance/index.js.map +1 -0
  69. package/dist/types/index.cjs +19 -0
  70. package/dist/types/index.cjs.map +1 -0
  71. package/dist/types/index.d.cts +8 -0
  72. package/dist/types/index.d.ts +8 -0
  73. package/dist/types/index.js +2 -0
  74. package/dist/types/index.js.map +1 -0
  75. package/dist/viewport/index.cjs +131 -0
  76. package/dist/viewport/index.cjs.map +1 -0
  77. package/dist/viewport/index.d.cts +56 -0
  78. package/dist/viewport/index.d.ts +56 -0
  79. package/dist/viewport/index.js +26 -0
  80. package/dist/viewport/index.js.map +1 -0
  81. package/package.json +6 -1
  82. package/src/config/README.md +59 -0
  83. package/src/config/USAGE_EXAMPLES.md +285 -0
  84. package/src/config/index.ts +7 -0
  85. package/src/index.ts +1 -2
package/dist/index.d.ts CHANGED
@@ -1,971 +1,18 @@
1
- import { Connection, Container, Node, Meta, Layer } from '@visualli/bindings';
2
- export { Connection, Container, Extension, Layer, Meta, Node } from '@visualli/bindings';
1
+ import { R as RenderConfig, N as NodeSelection, F as FlatNode, M as MindMapConnection, V as ViewportState } from './mindmap-DWS0WZT_.js';
2
+ export { a as MindMapConfig, b as MindMapData, c as MindMapNode, d as NodeMap, S as SpatialBounds, T as TopLevelConnection } from './mindmap-DWS0WZT_.js';
3
+ import { V as VisualliDocument, a as VisualliLayer } from './document-B3hnNr-F.js';
4
+ export { L as LayerConnection, b as LayerContainer, c as LayerNode, d as VisualliMeta, e as VisualliRenderConnection, f as VisualliRenderNode } from './document-B3hnNr-F.js';
5
+ export { VisualliFragment } from './types/index.js';
6
+ export { CircularLayoutOptions, CollisionBox, LinearLayoutOptions, applyCircularLayout, applyLinearHorizontalLayout, applyLinearVerticalLayout, calculateMinimumRadius, calculateOptimalRadiusPercentage, checkCollision, getNodeBounds, optimizeLayout, resolveCollisions } from './layout/index.js';
7
+ export { VisualliParseError, calculateDistance, convertLayerToFlatNodes, convertVisualliToFlatNodes, countLayersBeneath, createMindMapConfig, fetchAndParseVisualli, flattenNodes, generateSampleConfig, getChildLayers, getNodeConnections, getNodesForLayer, getTopLevelConnections, getVisibleNodes, loadVisualliFileFromFile, parseVisualliFile, parseVisualliFromMongoDB, resolveNodeOverlaps } from './parser/index.js';
8
+ import { FEATURE_FLAGS } from './constants/index.js';
9
+ export { BORDER_WIDTH_NORMAL, BORDER_WIDTH_SELECTED, BRAND_COLORS, CANVAS_COLORS, CHAR_WIDTH, CIRCULAR_REFERENCE_MAX_DEPTH, CLICK_THRESHOLD, COLOR_BORDER_DARK, COLOR_BORDER_LIGHT, COLOR_DEFAULT_NODE, COLOR_SELECTED, CORNER_RADIUS, CULLING_QUERY_TIME_BUDGET, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_RENDER_CONFIG, DOUBLE_CLICK_DELAY, DRAG_START_DISTANCE, DS_COLORS, DS_RADII, DS_TYPOGRAPHY, FONTS, FONT_SIZES, FPS_CRITICAL_THRESHOLD, FPS_DOWNGRADE_THRESHOLD, FPS_SAMPLE_WINDOW, FPS_STABILIZATION_FRAMES, FPS_TARGET, FPS_TARGETS, FPS_UPDATE_INTERVAL, FPS_UPGRADE_THRESHOLD, FPS_WARNING_THRESHOLD, LAYOUT_SPACING, LEVEL_COLORS, LEVEL_COLOR_ARRAY, MAX_FRAME_TIME, MAX_NODES, MAX_VISIBLE_NODES, MEMORY_CHECK_INTERVAL, MEMORY_CRITICAL_MB, MEMORY_LIMITS, MEMORY_TARGET_MB, MEMORY_WARNING_MB, NODE_COUNT_THRESHOLDS, NODE_HEIGHT, NODE_MIN_WIDTH, NODE_PADDING, PARENT_FALLBACK_COLORS, PERFORMANCE_TOAST_COOLDOWN, QUALITY_HIGH, QUALITY_LEVELS, QUALITY_LOW, QUALITY_MEDIUM, QUALITY_SETTINGS, QualityLevel, RBUSH_MAX_ENTRIES, RENDER_MODES, RESIZE_DEBOUNCE, RenderMode, SCROLL_THROTTLE, SEARCH_DEBOUNCE, SEMANTIC_COLORS, SIMPLIFIED_RENDER_CONFIG, SPACING, SPATIAL_INDEX_BUILD_BUDGET, TARGET_FRAME_TIME, TEXT_LABEL_HIDE_BELOW_ZOOM, THEME_COLORS, TIMING_THRESHOLDS, TITLE_MAX_LENGTH, VIEWPORT_CONFIG, VIEWPORT_MARGIN, ZOOM_DEFAULT, ZOOM_MAX, ZOOM_MIN, ZOOM_NAV_IN_THRESHOLD, ZOOM_NAV_OUT_THRESHOLD, ZOOM_STEP, ZOOM_WHEEL_SENSITIVITY, darkenHexColor, getColorForLevel, getOptimalQualityLevel, getRecommendedRenderConfig, getRenderConfigForQuality, getThemeBackground, getThemeBorder, getThemeText, isFeatureEnabled } from './constants/index.js';
10
+ export { WorldBounds, calculateViewportBounds, clampZoom, focusOnNode, isNodeInViewport, panViewport, recalculateViewportBounds, screenToWorld, setViewportCenter, worldToScreen, zoomViewport } from './viewport/index.js';
11
+ export { FPSMonitor, MemoryMonitor, MemoryStats, PerformanceProfiler } from './performance/index.js';
12
+ export { ANIMATION_DURATION, ANIMATION_PHASES, COOLDOWN, EasingFunction, OPACITY, TARGET_ZOOM, VIEWPORT_FRAMING, ZOOM_THRESHOLDS, createCubicBezier, easeInCubic, easeInOutCubic, easeInOutQuart, easeInOutSine, easeOutCubic, easeOutQuad, easeZoomTransition } from './animations/index.js';
3
13
  import * as zustand_vanilla from 'zustand/vanilla';
4
-
5
- interface MindMapNode {
6
- id: string;
7
- title: string;
8
- level: number;
9
- x: number;
10
- y: number;
11
- children?: MindMapNode[];
12
- parent?: string;
13
- color?: string;
14
- relationshipLabel?: string;
15
- }
16
- /** Flat structure for performance-optimised storage (10K+ nodes). */
17
- interface FlatNode {
18
- id: string;
19
- parentId: string | null;
20
- /** IDs of child nodes for quick tree traversal */
21
- childrenIds?: string[];
22
- x: number;
23
- y: number;
24
- /** Alternative position format for compatibility */
25
- position?: {
26
- x: number;
27
- y: number;
28
- };
29
- /** Depth in tree hierarchy */
30
- level: number;
31
- title: string;
32
- description?: string;
33
- /** Label describing relationship to parent */
34
- relationshipLabel?: string;
35
- color: string;
36
- width: number;
37
- height: number;
38
- /** Whether this node's children are visible */
39
- isExpanded?: boolean;
40
- branchCount?: number;
41
- createdAt: Date;
42
- updatedAt: Date;
43
- }
44
- /** Map-based node storage for O(1) lookups. */
45
- type NodeMap = Map<string, FlatNode>;
46
- /** Spatial bounds for RBush indexing. */
47
- interface SpatialBounds {
48
- minX: number;
49
- minY: number;
50
- maxX: number;
51
- maxY: number;
52
- nodeId: string;
53
- }
54
- /** Viewport state for camera position and zoom. */
55
- interface ViewportState {
56
- centerX: number;
57
- centerY: number;
58
- zoomLevel: number;
59
- rotation: number;
60
- visibleBounds: {
61
- minX: number;
62
- minY: number;
63
- maxX: number;
64
- maxY: number;
65
- };
66
- }
67
- /** Single-selection node state. */
68
- interface NodeSelection {
69
- selectedId: string | null;
70
- }
71
- /** Render configuration flags. */
72
- interface RenderConfig {
73
- renderMode: 'canvas' | 'simplified';
74
- qualityLevel: 'high' | 'medium' | 'low';
75
- cullingEnabled: boolean;
76
- fpsTarget: number;
77
- memoryLimit: number;
78
- }
79
- interface MindMapData {
80
- nodes: MindMapNode[];
81
- connections: MindMapConnection[];
82
- }
83
- /** Simplified connection type for mindmap rendering (not to be confused with schema Connection) */
84
- interface MindMapConnection {
85
- from: string;
86
- to: string;
87
- level: number;
88
- label?: string;
89
- }
90
- interface TopLevelConnection {
91
- from: string;
92
- to: string;
93
- label: string;
94
- }
95
- /** Complete mindmap configuration schema. */
96
- interface MindMapConfig {
97
- metadata: {
98
- id?: string;
99
- title: string;
100
- description?: string;
101
- version: string;
102
- created: string;
103
- lastModified: string;
104
- };
105
- nodes: MindMapNode[];
106
- topLevelConnections: TopLevelConnection[];
107
- settings?: {
108
- defaultColors?: {
109
- level0: string;
110
- level1: string;
111
- level2: string;
112
- level3: string;
113
- [key: `level${number}`]: string;
114
- };
115
- layout?: {
116
- nodeSpacing: number;
117
- levelSpacing: number;
118
- };
119
- };
120
- }
121
-
122
- /** Alias to schema Node type for SDK consistency */
123
- type LayerNode = Node;
124
- /** Alias to schema Connection type for SDK consistency */
125
- type LayerConnection = Connection;
126
- /** Alias to schema Container type for SDK consistency */
127
- type LayerContainer = Container;
128
- /**
129
- * SDK's stricter version of schema Layer.
130
- * - Makes nodes/connections/containers required (always arrays, even if empty)
131
- * - Adds SDK-specific `description` field
132
- * - Explicitly types key fields to avoid 'unknown' from schema's index signature
133
- */
134
- interface VisualliLayer {
135
- type: 'layer';
136
- /** UUID of the layer */
137
- id: string;
138
- /** Hierarchy level (0 = root) */
139
- level: number;
140
- /** UUID of the parent layer */
141
- parentLayerId?: string;
142
- /** UUID of the specific node in parent layer */
143
- parentNodeId?: string;
144
- /** SDK-specific description field (not in schema) */
145
- description?: string;
146
- /** Spatial arrangement (inherits from schema) */
147
- layout?: 'radial' | 'linear-horizontal' | 'linear-vertical';
148
- /** Required array of nodes (schema has optional) */
149
- nodes: LayerNode[];
150
- /** Required array of connections (schema has optional) */
151
- connections: LayerConnection[];
152
- /** Required array of containers (schema has optional) */
153
- containers: LayerContainer[];
154
- }
155
- /** Intermediate format for rendering – converts VisualliLayer to flat nodes. */
156
- interface VisualliRenderNode {
157
- id: string;
158
- x: number;
159
- y: number;
160
- title: string;
161
- summary: string;
162
- level: number;
163
- layerId: string;
164
- layerLevel: number;
165
- color: string;
166
- width: number;
167
- height: number;
168
- branchCount: number;
169
- }
170
- interface VisualliRenderConnection {
171
- id: string;
172
- from: string;
173
- to: string;
174
- label?: string;
175
- style?: 'dashed' | 'solid';
176
- }
177
-
178
- type VisualliFragment = Meta | Layer;
179
-
180
- /** Alias to schema Meta type for SDK consistency */
181
- type VisualliMeta = Meta;
182
-
183
- /** Parsed .visualli document structure. */
184
- interface VisualliDocument {
185
- meta: VisualliMeta;
186
- /** Keyed by layer ID */
187
- layers: Map<string, VisualliLayer>;
188
- /** Quick lookup by level */
189
- layersByLevel: Map<number, VisualliLayer[]>;
190
- /** The level-0 layer */
191
- rootLayer: VisualliLayer | null;
192
- }
193
-
194
- interface CircularLayoutOptions {
195
- /** Radius as a fraction of the container's minimum dimension (0–1). Default: 0.135 */
196
- radiusPercentage?: number;
197
- /** Container width used to calculate absolute radius. Default: 2000 */
198
- containerWidth?: number;
199
- /** Container height used to calculate absolute radius. Default: 2000 */
200
- containerHeight?: number;
201
- /** World-space X of the circle centre. Default: 0 */
202
- centerX?: number;
203
- /** World-space Y of the circle centre. Default: 0 */
204
- centerY?: number;
205
- }
206
- /**
207
- * Apply circular layout to a set of nodes.
208
- * Mutates the `x` / `y` properties of each node and returns the same array.
209
- */
210
- declare function applyCircularLayout(nodes: FlatNode[], options?: CircularLayoutOptions): FlatNode[];
211
- /**
212
- * Calculate the minimum radius needed to prevent node boxes from overlapping.
213
- *
214
- * Uses the chord-length formula: `chord = 2r · sin(θ/2)`, solved for `r`.
215
- */
216
- declare function calculateMinimumRadius(nodeCount: number, nodeWidth?: number, nodePadding?: number): number;
217
- /**
218
- * Calculate the optimal radius percentage for a given node count,
219
- * ensuring sufficient spacing for edge labels.
220
- *
221
- * @returns A value in [0.135, 0.45]
222
- */
223
- declare function calculateOptimalRadiusPercentage(nodeCount: number, containerWidth?: number, containerHeight?: number, nodeWidth?: number, nodePadding?: number): number;
224
-
225
- interface LinearLayoutOptions {
226
- /** Logical node width (px). Default: 200 */
227
- nodeWidth?: number;
228
- /** Logical node height (px). Default: 80 */
229
- nodeHeight?: number;
230
- /** Gap between node edges for horizontal layout (px). Default: 180 */
231
- hGap?: number;
232
- /** Gap between node edges for vertical layout (px). Default: 220 */
233
- vGap?: number;
234
- /** World X of the layout midpoint. Default: 0 */
235
- centerX?: number;
236
- /** World Y of the layout midpoint. Default: 0 */
237
- centerY?: number;
238
- }
239
- /**
240
- * Arrange nodes in a horizontal row (shared Y, varying X).
241
- * Row is centred on (`centerX`, `centerY`).
242
- */
243
- declare function applyLinearHorizontalLayout(nodes: FlatNode[], options?: LinearLayoutOptions): FlatNode[];
244
- /**
245
- * Arrange nodes in a vertical column (shared X, varying Y).
246
- * Column is centred on (`centerX`, `centerY`).
247
- */
248
- declare function applyLinearVerticalLayout(nodes: FlatNode[], options?: LinearLayoutOptions): FlatNode[];
249
-
250
- interface CollisionBox {
251
- x: number;
252
- y: number;
253
- width: number;
254
- height: number;
255
- }
256
- /** Axis-aligned bounding box for a node, expanded by a fixed padding. */
257
- declare function getNodeBounds(node: MindMapNode): CollisionBox;
258
- declare function checkCollision(box1: CollisionBox, box2: CollisionBox): boolean;
259
- /**
260
- * Iteratively resolve bounding-box collisions within each level.
261
- * Nodes are pushed apart symmetrically until no overlaps remain
262
- * or `maxIterations` is reached.
263
- */
264
- declare function resolveCollisions(nodes: MindMapNode[], maxIterations?: number): MindMapNode[];
265
- /**
266
- * Apply a lightweight repulsive force between same-level nodes that are
267
- * closer than 300 px, then resolve remaining collisions.
268
- */
269
- declare function optimizeLayout(nodes: MindMapNode[]): MindMapNode[];
270
-
271
- declare class VisualliParseError extends Error {
272
- readonly lineNumber?: number | undefined;
273
- constructor(message: string, lineNumber?: number | undefined);
274
- }
275
- /**
276
- * Parse a .visualli file content (JSONL format) into a VisualliDocument.
277
- *
278
- * @throws VisualliParseError on malformed input
279
- */
280
- declare function parseVisualliFile(content: string): VisualliDocument;
281
- declare function fetchAndParseVisualli(url: string): Promise<VisualliDocument>;
282
- /**
283
- * Parse .visualli JSONL data as returned from the MongoDB `visualli` field.
284
- *
285
- * @throws VisualliParseError
286
- */
287
- declare function parseVisualliFromMongoDB(visualliJsonl: string): VisualliDocument;
288
- /**
289
- * Parse a .visualli file from a browser `File` object.
290
- * (Browser-only – requires `FileReader`.)
291
- */
292
- declare function loadVisualliFileFromFile(file: File): Promise<VisualliDocument>;
293
- /** Return all layers whose `parentNodeId` matches the given node ID. */
294
- declare function getChildLayers(doc: VisualliDocument, nodeId: string): VisualliLayer[];
295
- /**
296
- * Count the maximum depth of layers beneath a node (its "magnitude").
297
- * Returns 0 when the node has no child layers.
298
- */
299
- declare function countLayersBeneath(doc: VisualliDocument, nodeId: string, visited?: Set<string>): number;
300
-
301
- /** Iteratively push overlapping nodes apart using symmetric force separation. */
302
- declare function resolveNodeOverlaps(nodes: FlatNode[], maxIterations?: number): void;
303
- /**
304
- * Convert a single layer to an array of FlatNode objects.
305
- * Layout algorithm is determined by `layer.layout` (default: radial).
306
- */
307
- declare function convertLayerToFlatNodes(layer: VisualliLayer, doc: VisualliDocument): FlatNode[];
308
- /**
309
- * Convert an entire .visualli document to a flat NodeMap.
310
- * All layers are converted and a children-index is built for O(1) tree traversal.
311
- */
312
- declare function convertVisualliToFlatNodes(doc: VisualliDocument): NodeMap;
313
- /**
314
- * Get flat nodes for a specific layer only.
315
- *
316
- * @param doc - Parsed .visualli document
317
- * @param layerId - Layer ID to extract
318
- * @returns FlatNode array, or empty array if layer not found
319
- */
320
- declare function getNodesForLayer(doc: VisualliDocument, layerId: string): FlatNode[];
321
-
322
- /** Flatten a nested MindMapNode tree into a depth-first array. */
323
- declare function flattenNodes(nodes: MindMapNode[]): MindMapNode[];
324
- /**
325
- * Return nodes visible at the given zoom level.
326
- *
327
- * At lower zoom values only top-level nodes are shown; each 5% zoom increment
328
- * reveals one additional hierarchy level.
329
- */
330
- declare function getVisibleNodes(nodes: MindMapNode[], zoom: number, focusedNode?: string): MindMapNode[];
331
- /** Build parent→child connection pairs from the node tree. */
332
- declare function getNodeConnections(nodes: MindMapNode[]): Array<{
333
- from: MindMapNode;
334
- to: MindMapNode;
335
- label?: string;
336
- }>;
337
- /** Resolve top-level cross-connections to node pairs. */
338
- declare function getTopLevelConnections(nodes: MindMapNode[], topLevelConnections: TopLevelConnection[]): Array<{
339
- from: MindMapNode;
340
- to: MindMapNode;
341
- label: string;
342
- }>;
343
- /** Euclidean distance between two world-space points. */
344
- declare function calculateDistance(x1: number, y1: number, x2: number, y2: number): number;
345
-
346
- declare function createMindMapConfig(nodes: MindMapNode[], topLevelConnections: TopLevelConnection[], title?: string): MindMapConfig;
347
- /**
348
- * Generate a sample MindMapConfig with `maxLevels` of hierarchy.
349
- * Useful for testing and demos.
350
- */
351
- declare function generateSampleConfig(maxLevels?: number): MindMapConfig;
352
-
353
- declare const FPS_TARGET = 60;
354
- declare const FPS_WARNING_THRESHOLD = 45;
355
- declare const FPS_CRITICAL_THRESHOLD = 30;
356
- declare const TARGET_FRAME_TIME: number;
357
- declare const MAX_FRAME_TIME = 18;
358
- /** Legacy frame-rate targets kept for backward compatibility. */
359
- declare const FPS_TARGETS: {
360
- readonly PAN_MIN: 30;
361
- readonly ZOOM_TARGET: 60;
362
- readonly WARNING_THRESHOLD: 20;
363
- };
364
- declare const TIMING_THRESHOLDS: {
365
- readonly VIEWPORT_QUERY_MAX: 5;
366
- readonly SPATIAL_UPDATE_MAX: 10;
367
- readonly DRAG_RESPONSE_MAX: 16;
368
- readonly LOAD_5K_TARGET: 2000;
369
- readonly LOAD_10K_TARGET: 3000;
370
- readonly VIEWPORT_DEBOUNCE: 100;
371
- readonly SPATIAL_INDEX_BUILD: 50;
372
- };
373
- declare const MEMORY_TARGET_MB = 500;
374
- declare const MEMORY_WARNING_MB = 600;
375
- declare const MEMORY_CRITICAL_MB = 800;
376
- declare const MEMORY_LIMITS: {
377
- readonly MAX_10K_NODES: 500;
378
- readonly MAX_GROWTH_PERCENT: 20;
379
- readonly WARNING_THRESHOLD: 400;
380
- };
381
- declare const VIEWPORT_MARGIN = 0.1;
382
- declare const MAX_VISIBLE_NODES = 800;
383
- declare const CULLING_QUERY_TIME_BUDGET = 5;
384
- declare const RBUSH_MAX_ENTRIES = 16;
385
- declare const SPATIAL_INDEX_BUILD_BUDGET = 50;
386
- declare const NODE_MIN_WIDTH = 200;
387
- declare const NODE_HEIGHT = 80;
388
- declare const NODE_PADDING = 40;
389
- declare const CHAR_WIDTH = 8;
390
- declare const TITLE_MAX_LENGTH = 150;
391
- declare const CORNER_RADIUS = 8;
392
- declare const BORDER_WIDTH_NORMAL = 2;
393
- declare const BORDER_WIDTH_SELECTED = 3;
394
- declare const COLOR_SELECTED = "#1B2D4F";
395
- declare const COLOR_BORDER_LIGHT = "#4A3728";
396
- declare const COLOR_BORDER_DARK = "#FAF6F1";
397
- declare const COLOR_DEFAULT_NODE = "#FAF6F1";
398
- declare const ZOOM_MIN = 0.05;
399
- declare const ZOOM_MAX = 5;
400
- declare const ZOOM_DEFAULT = 1;
401
- declare const ZOOM_STEP = 0.1;
402
- declare const ZOOM_WHEEL_SENSITIVITY = 0.001;
403
- declare const ZOOM_NAV_IN_THRESHOLD = 2.7;
404
- declare const ZOOM_NAV_OUT_THRESHOLD = 0.4;
405
- declare const TEXT_LABEL_HIDE_BELOW_ZOOM = 0.3;
406
- declare const QUALITY_HIGH: {
407
- shadows: boolean;
408
- bezierCurves: boolean;
409
- animations: boolean;
410
- textQuality: "high";
411
- antialiasing: boolean;
412
- };
413
- declare const QUALITY_MEDIUM: {
414
- shadows: boolean;
415
- bezierCurves: boolean;
416
- animations: boolean;
417
- textQuality: "medium";
418
- antialiasing: boolean;
419
- };
420
- declare const QUALITY_LOW: {
421
- shadows: boolean;
422
- bezierCurves: boolean;
423
- animations: boolean;
424
- textQuality: "low";
425
- antialiasing: boolean;
426
- };
427
- declare const FPS_SAMPLE_WINDOW = 60;
428
- declare const FPS_UPDATE_INTERVAL = 1000;
429
- declare const MEMORY_CHECK_INTERVAL = 5000;
430
- declare const PERFORMANCE_TOAST_COOLDOWN = 10000;
431
- declare const FPS_DOWNGRADE_THRESHOLD = 45;
432
- declare const FPS_UPGRADE_THRESHOLD = 58;
433
- declare const FPS_STABILIZATION_FRAMES = 180;
434
- declare const DEFAULT_CANVAS_WIDTH = 1920;
435
- declare const DEFAULT_CANVAS_HEIGHT = 1080;
436
- declare const CLICK_THRESHOLD = 5;
437
- declare const DOUBLE_CLICK_DELAY = 300;
438
- declare const DRAG_START_DISTANCE = 10;
439
- declare const MAX_NODES = 20000;
440
- declare const CIRCULAR_REFERENCE_MAX_DEPTH = 1000;
441
- declare const RESIZE_DEBOUNCE = 300;
442
- declare const SCROLL_THROTTLE = 16;
443
- declare const SEARCH_DEBOUNCE = 500;
444
- /** Node count thresholds that gate optimisation strategies. */
445
- declare const NODE_COUNT_THRESHOLDS: {
446
- readonly SPATIAL_INDEX_MIN: 100;
447
- readonly VIEWPORT_CULLING_MIN: 500;
448
- readonly CANVAS_RENDERING_MIN: 2000;
449
- readonly DOM_RENDERING_MAX: 5000;
450
- };
451
- /** Viewport buffer configuration. */
452
- declare const VIEWPORT_CONFIG: {
453
- readonly BUFFER_PERCENT: 0.2;
454
- readonly MIN_VISIBLE_NODES: 10;
455
- };
456
-
457
- declare const DS_COLORS: {
458
- readonly light: {
459
- readonly bgApp: "#F0EDE6";
460
- readonly bgSurface: "#FAF8F4";
461
- readonly bgInput: "#FFFFFF";
462
- readonly border: "#DDD9D0";
463
- readonly borderDivider: "#E8E4DC";
464
- readonly primary: "#1B2D4F";
465
- readonly primaryHover: "#243B68";
466
- readonly textPrimary: "#1A1A18";
467
- readonly textSecondary: "#6B6860";
468
- readonly textMuted: "#747270";
469
- readonly textOnPrimary: "#FAF8F4";
470
- readonly hoverItem: "rgba(27,45,79,0.07)";
471
- readonly focusRing: "rgba(27,45,79,0.40)";
472
- readonly btnMuted: "#8E8C88";
473
- };
474
- readonly dark: {
475
- readonly bgApp: "#141412";
476
- readonly bgSurface: "#1C1C1A";
477
- readonly bgInput: "#262622";
478
- readonly border: "#333330";
479
- readonly borderDivider: "#2A2A28";
480
- readonly primary: "#BB532D";
481
- readonly primaryHover: "#CC6440";
482
- readonly textPrimary: "#F0EDE6";
483
- readonly textSecondary: "#B0ABA3";
484
- readonly textMuted: "#8E8C88";
485
- readonly textOnPrimary: "#FAF8F4";
486
- readonly hoverItem: "rgba(198,94,56,0.12)";
487
- readonly focusRing: "rgba(198,94,56,0.50)";
488
- readonly btnMuted: "#4A4845";
489
- };
490
- };
491
- declare const DS_TYPOGRAPHY: {
492
- readonly fontDisplay: "'Nunito', sans-serif";
493
- readonly fontBody: "'Nunito Sans', sans-serif";
494
- readonly logo: {
495
- readonly size: "20px";
496
- readonly weight: 800;
497
- readonly letterSpacing: "0.04em";
498
- };
499
- readonly heading: {
500
- readonly size: "16px";
501
- readonly weight: 700;
502
- readonly letterSpacing: "-0.2px";
503
- };
504
- readonly cta: {
505
- readonly size: "11px";
506
- readonly weight: 800;
507
- readonly letterSpacing: "0.12em";
508
- readonly transform: "uppercase";
509
- };
510
- readonly body: {
511
- readonly size: "13px";
512
- readonly weight: 400;
513
- };
514
- readonly input: {
515
- readonly size: "13px";
516
- readonly weight: 300;
517
- readonly style: "italic";
518
- };
519
- readonly search: {
520
- readonly size: "12px";
521
- readonly weight: 400;
522
- };
523
- readonly username: {
524
- readonly size: "13px";
525
- readonly weight: 600;
526
- };
527
- readonly avatar: {
528
- readonly size: "11px";
529
- readonly weight: 700;
530
- };
531
- readonly footer: {
532
- readonly size: "12px";
533
- readonly weight: 400;
534
- };
535
- readonly empty: {
536
- readonly size: "11px";
537
- readonly weight: 300;
538
- readonly style: "italic";
539
- };
540
- };
541
- declare const DS_RADII: {
542
- readonly sidebar: 16;
543
- readonly input: 8;
544
- readonly cta: 7;
545
- readonly item: 6;
546
- readonly swatch: 10;
547
- };
548
- declare const BRAND_COLORS: {
549
- readonly primary: {
550
- readonly 50: "#EFF6FF";
551
- readonly 100: "#DBEAFE";
552
- readonly 200: "#BFDBFE";
553
- readonly 300: "#93C5FD";
554
- readonly 400: "#60A5FA";
555
- readonly 500: "#3B82F6";
556
- readonly 600: "#2563EB";
557
- readonly 700: "#1D4ED8";
558
- readonly 800: "#1E40AF";
559
- readonly 900: "#1E3A8A";
560
- };
561
- readonly secondary: {
562
- readonly 50: "#F0FDF4";
563
- readonly 100: "#DCFCE7";
564
- readonly 200: "#BBF7D0";
565
- readonly 300: "#86EFAC";
566
- readonly 400: "#4ADE80";
567
- readonly 500: "#10B981";
568
- readonly 600: "#059669";
569
- readonly 700: "#047857";
570
- readonly 800: "#065F46";
571
- readonly 900: "#064E3B";
572
- };
573
- readonly accent: {
574
- readonly purple: "#8B5CF6";
575
- readonly cyan: "#06B6D4";
576
- readonly sky: "#0EA5E9";
577
- readonly lime: "#84CC16";
578
- readonly amber: "#F59E0B";
579
- readonly red: "#EF4444";
580
- };
581
- };
582
- declare const LEVEL_COLORS: {
583
- readonly level0: "#3B82F6";
584
- readonly level1: "#60A5FA";
585
- readonly level2: "#93C5FD";
586
- readonly level3: "#BFDBFE";
587
- readonly level4: "#93C5FD";
588
- readonly level5: "#60A5FA";
589
- readonly level6: "#3B82F6";
590
- readonly level7: "#2563EB";
591
- readonly level8: "#1D4ED8";
592
- };
593
- declare const LEVEL_COLOR_ARRAY: readonly ["#3B82F6", "#60A5FA", "#93C5FD", "#BFDBFE", "#93C5FD", "#60A5FA", "#3B82F6", "#2563EB", "#1D4ED8"];
594
- declare const PARENT_FALLBACK_COLORS: readonly ["#12C7D3", "#325E8C", "#8A70A6", "#F54A57", "#FF6C4D", "#F28C16", "#FFD347", "#7F7F7F", "#8D8D8D"];
595
- declare const SEMANTIC_COLORS: {
596
- readonly success: "#10B981";
597
- readonly error: "#EF4444";
598
- readonly warning: "#F59E0B";
599
- readonly info: "#3B82F6";
600
- };
601
- declare const THEME_COLORS: {
602
- readonly light: {
603
- readonly background: {
604
- readonly primary: "#FAF8F4";
605
- readonly secondary: "#F0EDE6";
606
- readonly tertiary: "#FFFFFF";
607
- };
608
- readonly text: {
609
- readonly primary: "#1A1A18";
610
- readonly secondary: "#6B6860";
611
- readonly tertiary: "#747270";
612
- };
613
- readonly border: {
614
- readonly primary: "#DDD9D0";
615
- readonly secondary: "#E8E4DC";
616
- };
617
- };
618
- readonly dark: {
619
- readonly background: {
620
- readonly primary: "#1C1C1A";
621
- readonly secondary: "#141412";
622
- readonly tertiary: "#262622";
623
- };
624
- readonly text: {
625
- readonly primary: "#F0EDE6";
626
- readonly secondary: "#B0ABA3";
627
- readonly tertiary: "#8E8C88";
628
- };
629
- readonly border: {
630
- readonly primary: "#333330";
631
- readonly secondary: "#2A2A28";
632
- };
633
- };
634
- };
635
- declare const CANVAS_COLORS: {
636
- readonly node: {
637
- readonly border: "#FFFFFF";
638
- readonly titleColor: "#1e1b4b";
639
- readonly badgeBackground: "#FFC107";
640
- readonly badgeStroke: "#fcd34d";
641
- };
642
- };
643
- declare const SPACING: {
644
- readonly xs: 4;
645
- readonly sm: 8;
646
- readonly md: 16;
647
- readonly lg: 24;
648
- readonly xl: 32;
649
- readonly '2xl': 48;
650
- readonly '3xl': 64;
651
- readonly '4xl': 96;
652
- };
653
- declare const LAYOUT_SPACING: {
654
- readonly nodeSpacing: 200;
655
- readonly levelSpacing: 150;
656
- readonly containerPadding: 20;
657
- readonly gridSize: 50;
658
- };
659
- declare const FONTS: {
660
- readonly primary: "'Inter', sans-serif";
661
- readonly secondary: "'Poppins', sans-serif";
662
- readonly mono: "'Roboto Mono', monospace";
663
- };
664
- declare const FONT_SIZES: {
665
- readonly xs: "0.75rem";
666
- readonly sm: "0.875rem";
667
- readonly base: "1rem";
668
- readonly lg: "1.125rem";
669
- readonly xl: "1.25rem";
670
- readonly '2xl': "1.5rem";
671
- readonly '3xl': "1.875rem";
672
- readonly '4xl': "2.25rem";
673
- };
674
- /** Get a level color, cycling back to level 0 for levels > 8. */
675
- declare function getColorForLevel(level: number): string;
676
- /**
677
- * Darken a hex color by reducing HSL lightness.
678
- * Returns a monochromatic darker version — used for border/stroke colors.
679
- * Falls back to the original string if parsing fails.
680
- */
681
- declare function darkenHexColor(hex: string, amount?: number): string;
682
- declare function getThemeBackground(isDark: boolean, variant?: 'primary' | 'secondary' | 'tertiary'): string;
683
- declare function getThemeText(isDark: boolean, variant?: 'primary' | 'secondary' | 'tertiary'): string;
684
- declare function getThemeBorder(isDark: boolean, variant?: 'primary' | 'secondary'): string;
685
-
686
- declare const DEFAULT_RENDER_CONFIG: RenderConfig;
687
- declare const SIMPLIFIED_RENDER_CONFIG: RenderConfig;
688
- declare const QUALITY_SETTINGS: {
689
- readonly high: {
690
- shadows: boolean;
691
- bezierCurves: boolean;
692
- animations: boolean;
693
- textQuality: "high";
694
- antialiasing: boolean;
695
- };
696
- readonly medium: {
697
- shadows: boolean;
698
- bezierCurves: boolean;
699
- animations: boolean;
700
- textQuality: "medium";
701
- antialiasing: boolean;
702
- };
703
- readonly low: {
704
- shadows: boolean;
705
- bezierCurves: boolean;
706
- animations: boolean;
707
- textQuality: "low";
708
- antialiasing: boolean;
709
- };
710
- };
711
- declare const FEATURE_FLAGS: {
712
- readonly viewportCulling: true;
713
- readonly spatialIndexing: true;
714
- readonly shadows: true;
715
- readonly bezierCurves: true;
716
- readonly animations: true;
717
- readonly branchBadges: true;
718
- readonly autoQualityAdjustment: true;
719
- readonly performanceMonitoring: true;
720
- readonly performanceToasts: true;
721
- readonly debugOverlay: false;
722
- readonly showFPS: false;
723
- readonly showMemory: false;
724
- readonly showVisibleCount: false;
725
- };
726
- type RenderMode = RenderConfig['renderMode'];
727
- type QualityLevel = RenderConfig['qualityLevel'];
728
- declare const RENDER_MODES: {
729
- readonly canvas: {
730
- readonly name: "Canvas";
731
- readonly description: "Full Konva canvas rendering with all features";
732
- readonly features: {
733
- readonly culling: true;
734
- readonly shadows: true;
735
- readonly bezierCurves: true;
736
- readonly animations: true;
737
- };
738
- };
739
- readonly simplified: {
740
- readonly name: "Simplified";
741
- readonly description: "Reduced feature set for low-end devices";
742
- readonly features: {
743
- readonly culling: true;
744
- readonly shadows: false;
745
- readonly bezierCurves: false;
746
- readonly animations: false;
747
- };
748
- };
749
- };
750
- declare const QUALITY_LEVELS: {
751
- readonly high: {
752
- readonly name: "High";
753
- readonly description: "All visual features enabled";
754
- readonly targetFPS: 60;
755
- readonly features: {
756
- shadows: boolean;
757
- bezierCurves: boolean;
758
- animations: boolean;
759
- textQuality: "high";
760
- antialiasing: boolean;
761
- };
762
- };
763
- readonly medium: {
764
- readonly name: "Medium";
765
- readonly description: "Shadows disabled, other features enabled";
766
- readonly targetFPS: 60;
767
- readonly features: {
768
- shadows: boolean;
769
- bezierCurves: boolean;
770
- animations: boolean;
771
- textQuality: "medium";
772
- antialiasing: boolean;
773
- };
774
- };
775
- readonly low: {
776
- readonly name: "Low";
777
- readonly description: "Minimal visual features, max performance";
778
- readonly targetFPS: 30;
779
- readonly features: {
780
- shadows: boolean;
781
- bezierCurves: boolean;
782
- animations: boolean;
783
- textQuality: "low";
784
- antialiasing: boolean;
785
- };
786
- };
787
- };
788
- declare function getOptimalQualityLevel(currentFPS: number, currentQuality: QualityLevel): QualityLevel;
789
- declare function getRenderConfigForQuality(quality: QualityLevel): Partial<RenderConfig>;
790
- declare function isFeatureEnabled(featureName: keyof typeof FEATURE_FLAGS, config: RenderConfig): boolean;
791
- /**
792
- * Recommend a render config based on detected device memory (browser only).
793
- * Falls back to SIMPLIFIED_RENDER_CONFIG when the Performance Memory API is
794
- * unavailable or memory is constrained.
795
- */
796
- declare function getRecommendedRenderConfig(): RenderConfig;
797
-
798
- interface WorldBounds {
799
- minX: number;
800
- minY: number;
801
- maxX: number;
802
- maxY: number;
803
- }
804
- /**
805
- * Calculate the visible world-space bounding box including a margin buffer.
806
- */
807
- declare function calculateViewportBounds(viewport: ViewportState, canvasWidth?: number, canvasHeight?: number): WorldBounds;
808
- /**
809
- * Return a new ViewportState with `visibleBounds` recalculated.
810
- */
811
- declare function recalculateViewportBounds(viewport: ViewportState, canvasWidth?: number, canvasHeight?: number): ViewportState;
812
- /**
813
- * Convert world-space coordinates to screen-space pixel coordinates.
814
- */
815
- declare function worldToScreen(worldX: number, worldY: number, viewport: ViewportState, canvasWidth?: number, canvasHeight?: number): {
816
- x: number;
817
- y: number;
818
- };
819
- /**
820
- * Convert screen-space pixel coordinates to world-space coordinates.
821
- */
822
- declare function screenToWorld(screenX: number, screenY: number, viewport: ViewportState, canvasWidth?: number, canvasHeight?: number): {
823
- x: number;
824
- y: number;
825
- };
826
- /** Clamp zoom to [ZOOM_MIN, ZOOM_MAX]. */
827
- declare function clampZoom(zoom: number): number;
828
- /**
829
- * Pan the viewport by a screen-space delta (positive = right/down).
830
- */
831
- declare function panViewport(deltaX: number, deltaY: number, viewport: ViewportState): ViewportState;
832
- /** Teleport the viewport centre to the given world coordinates. */
833
- declare function setViewportCenter(x: number, y: number, viewport: ViewportState): ViewportState;
834
- /**
835
- * Zoom the viewport by a multiplicative delta, optionally around a pivot point.
836
- *
837
- * @param delta - Multiplier delta, e.g. 0.1 for +10% zoom
838
- * @param pivotX - Optional screen-space X pivot
839
- * @param pivotY - Optional screen-space Y pivot
840
- */
841
- declare function zoomViewport(delta: number, viewport: ViewportState, pivotX?: number, pivotY?: number, canvasWidth?: number, canvasHeight?: number): ViewportState;
842
- /**
843
- * Create a viewport centred on a node (world coordinates) at the given zoom level.
844
- */
845
- declare function focusOnNode(nodeX: number, nodeY: number, zoom: number): ViewportState;
846
- /**
847
- * Test whether a world-space AABB intersects the viewport's visible bounds.
848
- */
849
- declare function isNodeInViewport(nodeX: number, nodeY: number, nodeWidth: number, nodeHeight: number, viewport: ViewportState, canvasWidth?: number, canvasHeight?: number): boolean;
850
-
851
- declare class FPSMonitor {
852
- private frameTimes;
853
- private lastTime;
854
- private currentFPS;
855
- private rafId;
856
- start(): void;
857
- stop(): void;
858
- private calc;
859
- getFPS(): number;
860
- getAverageFPS(): number;
861
- getP95FrameTime(): number;
862
- reset(): void;
863
- }
864
- interface MemoryStats {
865
- usedJSHeapSize: number;
866
- totalJSHeapSize: number;
867
- jsHeapSizeLimit: number;
868
- heapUsagePercent: number;
869
- }
870
- declare class MemoryMonitor {
871
- private timer;
872
- private current;
873
- start(onUpdate?: (mb: number) => void): void;
874
- stop(): void;
875
- private measure;
876
- getMemoryMB(): number;
877
- getStats(): MemoryStats | null;
878
- static isSupported(): boolean;
879
- }
880
- declare class PerformanceProfiler {
881
- private marks;
882
- private measures;
883
- mark(label: string): void;
884
- measure(label: string): number;
885
- getAverage(label: string): number;
886
- getP95(label: string): number;
887
- clear(label?: string): void;
888
- }
889
-
890
- type EasingFunction = (t: number) => number;
891
- /** Smooth cubic – slow start, fast middle, slow end. */
892
- declare const easeInOutCubic: EasingFunction;
893
- /** Smooth quartic – more dramatic than cubic. */
894
- declare const easeInOutQuart: EasingFunction;
895
- /** Fast start, slow end. */
896
- declare const easeOutCubic: EasingFunction;
897
- /** Slow start, fast end. */
898
- declare const easeInCubic: EasingFunction;
899
- /** Gentle ease-out (quadratic). */
900
- declare const easeOutQuad: EasingFunction;
901
- /** Very smooth, organic sine easing. */
902
- declare const easeInOutSine: EasingFunction;
903
- /**
904
- * Create a CSS cubic-bezier easing function from four control-point values.
905
- *
906
- * Builds a 256-entry lookup table at call time (once) so subsequent evaluations
907
- * are a single table lookup + linear interpolation.
908
- */
909
- declare function createCubicBezier(x1: number, y1: number, x2: number, y2: number): EasingFunction;
910
- /**
911
- * Zoom-transition easing — matches CSS cubic-bezier(0.2, 0.8, 0.2, 1).
912
- * Fast start with smooth, organic settle. Used for all layer transitions.
913
- * Pre-computed LUT: subsequent calls are a single table lookup + linear interpolation.
914
- */
915
- declare const easeZoomTransition: EasingFunction;
916
-
917
- declare const ANIMATION_DURATION: {
918
- readonly ZOOM_IN_LAYER: 500;
919
- readonly ZOOM_OUT_LAYER: 500;
920
- readonly ZOOM_GESTURE: 500;
921
- readonly FADE_OUT: 200;
922
- readonly FADE_IN: 250;
923
- readonly COLOR_TRANSITION: 500;
924
- readonly CURSOR_CHANGE: 150;
925
- readonly LOADING_FADE: 200;
926
- };
927
- declare const ANIMATION_PHASES: {
928
- readonly ZOOM_IN: {
929
- readonly ZOOM_TO_TARGET: 500;
930
- readonly FADE_OUT_START: 120;
931
- readonly FADE_OUT: 280;
932
- readonly CONTENT_SWAP: 310;
933
- readonly FADE_IN: 200;
934
- readonly TOTAL: 510;
935
- };
936
- readonly ZOOM_OUT: {
937
- readonly FADE_OUT: 200;
938
- readonly ZOOM_BACK: 50;
939
- readonly FADE_IN: 250;
940
- readonly TOTAL: 500;
941
- };
942
- };
943
- declare const ZOOM_THRESHOLDS: {
944
- readonly ENTER_LAYER: 5;
945
- readonly EXIT_LAYER: 0.5;
946
- readonly GESTURE_TRIGGER: 0.8;
947
- };
948
- declare const COOLDOWN: {
949
- readonly NAVIGATION: 1000;
950
- readonly ZOOM_GESTURE: 800;
951
- readonly DOUBLE_CLICK: 200;
952
- };
953
- declare const OPACITY: {
954
- readonly VISIBLE: 1;
955
- readonly HIDDEN: 0;
956
- readonly TRANSITIONING: 0.3;
957
- };
958
- declare const TARGET_ZOOM: {
959
- readonly NORMAL: 1;
960
- readonly FOCUSED: 0.8;
961
- readonly FILL_NODE: 3;
962
- readonly DETAIL: 2;
963
- };
964
- declare const VIEWPORT_FRAMING: {
965
- readonly NODE_FILL_RATIO: 0.7;
966
- readonly EXIT_NODE_SIZE: 0.4;
967
- readonly PADDING_RATIO: 0.1;
968
- };
14
+ export { ACTIVE_BLOB_TYPES, ALL_BLOB_SHAPES, BLOB_LAYER_CONFIG, BLOB_TEXT_OFFSETS, BlobPoint, BlobShape, CONTAINER_LABEL_BASE_FONT_PX, DESCRIPTION_TEXT_BASE_FONT_PX, EDGE_LABEL_BASE_FONT_PX, NODE_LAYER_CONFIG, NODE_TEXT_BASE_FONT_PX, OVERLAY_FONT_UPPER_BOOST_PX, computeEdgeLabelScale, computeNodeTextScreenScale, computeNodeTextWorldScale, computeOverlayScale, drawBlobPath, getBlobTypeForLayer } from './config/index.js';
15
+ export { Connection, Container, Extension, Layer, Meta, Node } from '@visualli/bindings';
969
16
 
970
17
  interface BoundingBox {
971
18
  minX: number;
@@ -1096,80 +143,4 @@ interface CullingOptions {
1096
143
  */
1097
144
  declare function getViewportVisibleNodes(options: CullingOptions): FlatNode[];
1098
145
 
1099
- declare const NODE_TEXT_BASE_FONT_PX = 28;
1100
- declare const DESCRIPTION_TEXT_BASE_FONT_PX = 12;
1101
- declare const CONTAINER_LABEL_BASE_FONT_PX = 24;
1102
- declare const EDGE_LABEL_BASE_FONT_PX = 18;
1103
- declare const OVERLAY_FONT_UPPER_BOOST_PX = 8;
1104
- /**
1105
- * Computes world-space text scale for node title:
1106
- * - inverse zoom for screen-space consistency
1107
- * - clamped so text stays inside the node blob with safe padding
1108
- *
1109
- * Matches visualli.ai's computeNodeTextWorldScale(nodeWidth, zoomLevel).
1110
- */
1111
- declare function computeNodeTextWorldScale(nodeWidth: number, zoomLevel: number): number;
1112
- /** Screen-space scale (zoom-adjusted) for text overlays. */
1113
- declare function computeNodeTextScreenScale(nodeWidth: number, zoomLevel: number): number;
1114
- /**
1115
- * Screen-space overlay scale for description/semantic tooltips.
1116
- * - lower bound: 1x
1117
- * - upper bound: node-title-root + OVERLAY_FONT_UPPER_BOOST_PX
1118
- */
1119
- declare function computeOverlayScale(zoomLevel: number): number;
1120
- /** Scale for edge path labels in screen pixels. */
1121
- declare function computeEdgeLabelScale(zoomLevel: number): number;
1122
-
1123
- interface BlobPoint {
1124
- x: number;
1125
- y: number;
1126
- }
1127
- type BlobShape = BlobPoint[];
1128
- declare const BLOB_LAYER_CONFIG: readonly [{
1129
- readonly opacity: 0.3;
1130
- readonly rotation: -15;
1131
- readonly scaleUp: 1.3;
1132
- readonly strokeWidth: 3;
1133
- readonly dash: readonly [6, 4];
1134
- }, {
1135
- readonly opacity: 0.4;
1136
- readonly rotation: -10;
1137
- readonly scaleUp: 1.2;
1138
- readonly strokeWidth: 1;
1139
- readonly dash: undefined;
1140
- }, {
1141
- readonly opacity: 0.5;
1142
- readonly rotation: -5;
1143
- readonly scaleUp: 1.1;
1144
- readonly strokeWidth: 2;
1145
- readonly dash: undefined;
1146
- }];
1147
- declare const NODE_LAYER_CONFIG: {
1148
- readonly opacity: 1;
1149
- readonly rotation: 0;
1150
- readonly strokeWidth: 3;
1151
- };
1152
- declare const ALL_BLOB_SHAPES: ReadonlyArray<BlobShape>;
1153
- declare const ACTIVE_BLOB_TYPES: ReadonlyArray<number>;
1154
- /**
1155
- * Per-shape text x-offset as a fraction of baseRadiusX.
1156
- * Compensates for visually asymmetric blobs. Positive = right, negative = left.
1157
- */
1158
- declare const BLOB_TEXT_OFFSETS: ReadonlyArray<number>;
1159
- /**
1160
- * Deterministic pseudo-random blob-type selector per tree level.
1161
- * Root level (0) always uses shape 0; consecutive levels use different shapes.
1162
- */
1163
- declare function getBlobTypeForLayer(level: number): number;
1164
- /**
1165
- * Draw the blob path onto a canvas context (centered at 0,0).
1166
- * Uses closed quadratic bezier curves through midpoints of control points.
1167
- */
1168
- declare function drawBlobPath(ctx: {
1169
- beginPath(): void;
1170
- moveTo(x: number, y: number): void;
1171
- quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
1172
- closePath(): void;
1173
- }, radiusX: number, radiusY: number, blobType: number): void;
1174
-
1175
- export { ACTIVE_BLOB_TYPES, ALL_BLOB_SHAPES, ANIMATION_DURATION, ANIMATION_PHASES, BLOB_LAYER_CONFIG, BLOB_TEXT_OFFSETS, BORDER_WIDTH_NORMAL, BORDER_WIDTH_SELECTED, BRAND_COLORS, type BlobPoint, type BlobShape, type BoundingBox, CANVAS_COLORS, CHAR_WIDTH, CIRCULAR_REFERENCE_MAX_DEPTH, CLICK_THRESHOLD, COLOR_BORDER_DARK, COLOR_BORDER_LIGHT, COLOR_DEFAULT_NODE, COLOR_SELECTED, CONTAINER_LABEL_BASE_FONT_PX, COOLDOWN, CORNER_RADIUS, CULLING_QUERY_TIME_BUDGET, type CircularLayoutOptions, type CollisionBox, type ContainerGroupInfo, type CullingOptions, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_RENDER_CONFIG, DESCRIPTION_TEXT_BASE_FONT_PX, DOUBLE_CLICK_DELAY, DRAG_START_DISTANCE, DS_COLORS, DS_RADII, DS_TYPOGRAPHY, EDGE_LABEL_BASE_FONT_PX, type EasingFunction, FEATURE_FLAGS, FONTS, FONT_SIZES, FPSMonitor, FPS_CRITICAL_THRESHOLD, FPS_DOWNGRADE_THRESHOLD, FPS_SAMPLE_WINDOW, FPS_STABILIZATION_FRAMES, FPS_TARGET, FPS_TARGETS, FPS_UPDATE_INTERVAL, FPS_UPGRADE_THRESHOLD, FPS_WARNING_THRESHOLD, type FitResult, type FlatNode, type IRenderConfigStore, type ISelectionStore, type ISpatialIndex, LAYOUT_SPACING, LEVEL_COLORS, LEVEL_COLOR_ARRAY, type LayerConnection, type LayerContainer, type LayerNode, type LinearLayoutOptions, MAX_FRAME_TIME, MAX_NODES, MAX_VISIBLE_NODES, MEMORY_CHECK_INTERVAL, MEMORY_CRITICAL_MB, MEMORY_LIMITS, MEMORY_TARGET_MB, MEMORY_WARNING_MB, MemoryMonitor, type MemoryStats, type MindMapConfig, type MindMapConnection, type MindMapData, type MindMapNode, NODE_COUNT_THRESHOLDS, NODE_HEIGHT, NODE_LAYER_CONFIG, NODE_MIN_WIDTH, NODE_PADDING, NODE_TEXT_BASE_FONT_PX, type NodeMap, type NodeSelection, OPACITY, OVERLAY_FONT_UPPER_BOOST_PX, PARENT_FALLBACK_COLORS, PERFORMANCE_TOAST_COOLDOWN, PerformanceProfiler, QUALITY_HIGH, QUALITY_LEVELS, QUALITY_LOW, QUALITY_MEDIUM, QUALITY_SETTINGS, type QualityLevel, RBUSH_MAX_ENTRIES, RBushSpatialIndex, RENDER_MODES, RESIZE_DEBOUNCE, type RenderConfig, type RenderMode, SCROLL_THROTTLE, SEARCH_DEBOUNCE, SEMANTIC_COLORS, SIMPLIFIED_RENDER_CONFIG, SPACING, SPATIAL_INDEX_BUILD_BUDGET, type SpatialBounds, TARGET_FRAME_TIME, TARGET_ZOOM, TEXT_LABEL_HIDE_BELOW_ZOOM, THEME_COLORS, TIMING_THRESHOLDS, TITLE_MAX_LENGTH, type TopLevelConnection, VIEWPORT_CONFIG, VIEWPORT_FRAMING, VIEWPORT_MARGIN, type ViewportState, type VisualliDocument, type VisualliFragment, type VisualliLayer, type VisualliMeta, VisualliParseError, type VisualliRenderConnection, type VisualliRenderNode, type WorldBounds, ZOOM_DEFAULT, ZOOM_MAX, ZOOM_MIN, ZOOM_NAV_IN_THRESHOLD, ZOOM_NAV_OUT_THRESHOLD, ZOOM_STEP, ZOOM_THRESHOLDS, ZOOM_WHEEL_SENSITIVITY, applyCircularLayout, applyLinearHorizontalLayout, applyLinearVerticalLayout, calculateDistance, calculateFitCenter, calculateFitView, calculateFitZoom, calculateMinimumRadius, calculateOptimalRadiusPercentage, calculateViewportBounds, checkCollision, clampZoom, computeEdgeLabelScale, computeNodeTextScreenScale, computeNodeTextWorldScale, computeOverlayScale, convertLayerToFlatNodes, convertVisualliToFlatNodes, countLayersBeneath, createCubicBezier, createMindMapConfig, darkenHexColor, drawBlobPath, easeInCubic, easeInOutCubic, easeInOutQuart, easeInOutSine, easeOutCubic, easeOutQuad, easeZoomTransition, fetchAndParseVisualli, flattenNodes, focusOnNode, generateSampleConfig, getBlobTypeForLayer, getChildLayerForNode, getChildLayers, getColorForLevel, getConnectionsForLayer, getContainersForLayer, getLayerForNavigation, getNodeBounds, getNodeConnections, getNodesForLayer, getOptimalQualityLevel, getRecommendedRenderConfig, getRenderConfigForQuality, getThemeBackground, getThemeBorder, getThemeText, getTopLevelConnections, getViewportVisibleNodes, getVisibleNodes, isFeatureEnabled, isNodeInViewport, loadVisualliFileFromFile, optimizeLayout, panViewport, parseVisualliFile, parseVisualliFromMongoDB, recalculateViewportBounds, renderConfigStore, resolveCollisions, resolveNodeOverlaps, screenToWorld, selectionStore, setViewportCenter, worldToScreen, zoomViewport };
146
+ export { type BoundingBox, type ContainerGroupInfo, type CullingOptions, FEATURE_FLAGS, type FitResult, FlatNode, type IRenderConfigStore, type ISelectionStore, type ISpatialIndex, MindMapConnection, NodeSelection, RBushSpatialIndex, RenderConfig, ViewportState, VisualliDocument, VisualliLayer, calculateFitCenter, calculateFitView, calculateFitZoom, getChildLayerForNode, getConnectionsForLayer, getContainersForLayer, getLayerForNavigation, getViewportVisibleNodes, renderConfigStore, selectionStore };