@crazyhappyone/auto-graph 0.0.21 → 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.
package/dist/index.d.cts CHANGED
@@ -180,6 +180,23 @@ interface LabelLayout {
180
180
  };
181
181
  diagnostics: Diagnostic[];
182
182
  }
183
+ type TextSurfaceKind = "node-label" | "group-label" | "port-label" | "edge-label" | "compartment-row" | "swimlane-label" | "frame-title";
184
+ interface SolvedTextAnnotation {
185
+ text: string;
186
+ ownerId: string;
187
+ surfaceKind: TextSurfaceKind;
188
+ surfaceIndex?: number;
189
+ box: Box;
190
+ anchor: Box | {
191
+ x: number;
192
+ y: number;
193
+ };
194
+ paddings: Insets;
195
+ lines: LabelLayout["lines"];
196
+ fontFamily: string;
197
+ fontSize: number;
198
+ textBackend?: LabelLayout["textBackend"];
199
+ }
183
200
 
184
201
  type NodeShape = "rectangle" | "rounded-rectangle" | "ellipse" | "diamond" | "parallelogram" | "hexagon" | "cylinder";
185
202
  interface Label {
@@ -231,6 +248,72 @@ type PortKind = "proxy" | "flow";
231
248
  interface VisualStyle {
232
249
  fill?: string;
233
250
  stroke?: string;
251
+ fontFamily?: string;
252
+ fontSize?: number;
253
+ }
254
+ interface EvidenceCell {
255
+ text: string;
256
+ style?: VisualStyle;
257
+ }
258
+ interface EvidenceTextLayout {
259
+ lines: string[];
260
+ }
261
+ interface MatrixBlock {
262
+ id: string;
263
+ rows: string[];
264
+ cols: string[];
265
+ cells: EvidenceCell[][];
266
+ position?: Point;
267
+ size?: Size;
268
+ style?: VisualStyle;
269
+ }
270
+ interface CoordinatedMatrixBlock extends MatrixBlock {
271
+ box: Box;
272
+ columnLabelLayouts?: EvidenceTextLayout[];
273
+ rowLabelLayouts?: EvidenceTextLayout[];
274
+ cellLabelLayouts?: EvidenceTextLayout[][];
275
+ }
276
+ interface TableColumn {
277
+ id: string;
278
+ label: Label;
279
+ }
280
+ interface TableRow {
281
+ id: string;
282
+ cells: Record<string, EvidenceCell>;
283
+ }
284
+ interface TableBlock {
285
+ id: string;
286
+ columns: TableColumn[];
287
+ rows: TableRow[];
288
+ position?: Point;
289
+ size?: Size;
290
+ style?: VisualStyle;
291
+ }
292
+ interface CoordinatedTableBlock extends TableBlock {
293
+ box: Box;
294
+ columnXOffsets: number[];
295
+ columnLabelLayouts?: EvidenceTextLayout[];
296
+ cellLabelLayouts?: EvidenceTextLayout[][];
297
+ }
298
+ type EvidencePanelKind = "legend" | "rule" | "note" | "verification";
299
+ interface EvidencePanelItem {
300
+ id?: string;
301
+ label: Label;
302
+ detail?: Label;
303
+ style?: VisualStyle;
304
+ }
305
+ interface EvidencePanel {
306
+ id: string;
307
+ kind: EvidencePanelKind;
308
+ items: EvidencePanelItem[];
309
+ position?: Point;
310
+ size?: Size;
311
+ style?: VisualStyle;
312
+ }
313
+ interface CoordinatedEvidencePanel extends EvidencePanel {
314
+ box: Box;
315
+ titleLayout?: EvidenceTextLayout;
316
+ itemLayouts?: EvidenceTextLayout[];
234
317
  }
235
318
  interface NodePort {
236
319
  id: string;
@@ -278,6 +361,9 @@ interface IntentGroup {
278
361
  nodeIds?: string[];
279
362
  groupIds?: string[];
280
363
  padding?: Insets;
364
+ headerHeight?: number;
365
+ labelPosition?: "top" | "inside" | "outside";
366
+ direction?: "horizontal" | "vertical";
281
367
  metadata?: JsonObject;
282
368
  }
283
369
  interface NormalizedGroup {
@@ -286,6 +372,9 @@ interface NormalizedGroup {
286
372
  nodeIds: string[];
287
373
  groupIds: string[];
288
374
  padding: Insets;
375
+ headerHeight?: number;
376
+ labelPosition?: "top" | "inside" | "outside";
377
+ direction?: "horizontal" | "vertical";
289
378
  metadata?: JsonObject;
290
379
  labelLayout?: LabelLayout;
291
380
  }
@@ -293,24 +382,34 @@ interface CoordinatedGroup extends NormalizedGroup {
293
382
  box: Box;
294
383
  }
295
384
  type SwimlaneOrientation = "vertical" | "horizontal";
385
+ type SwimlaneLayout = "overlay" | "contract";
296
386
  interface SwimlaneLane {
297
387
  id: string;
298
388
  label?: Label;
299
389
  children: string[];
300
390
  box?: Box;
391
+ headerBox?: Box;
392
+ contentBox?: Box;
301
393
  }
302
394
  interface Swimlane {
303
395
  id: string;
304
396
  label?: Label;
305
397
  orientation: SwimlaneOrientation;
398
+ layout?: SwimlaneLayout;
306
399
  lanes: SwimlaneLane[];
307
400
  box?: Box;
401
+ headerHeight?: number;
402
+ padding?: number;
308
403
  }
309
404
  interface DiagramFrame {
310
405
  kind: string;
311
406
  context?: string;
312
407
  name?: string;
313
408
  titleTab: string;
409
+ headerHeight?: number;
410
+ padding?: number | Insets;
411
+ labelPosition?: "top" | "inside" | "outside";
412
+ direction?: "horizontal" | "vertical";
314
413
  style?: VisualStyle;
315
414
  }
316
415
  interface CoordinatedFrame extends DiagramFrame {
@@ -326,6 +425,8 @@ interface LayoutLock {
326
425
  interface ConstraintSolverInput {
327
426
  direction: DiagramDirection;
328
427
  overlapSpacing?: number;
428
+ minSiblingGap?: number;
429
+ distributeContainedChildren?: boolean;
329
430
  boxes: ReadonlyMap<string, Box>;
330
431
  nodes: readonly NormalizedNode[];
331
432
  groups: readonly NormalizedGroup[];
@@ -349,6 +450,9 @@ interface IntentDiagram {
349
450
  edges?: IntentEdge[];
350
451
  groups?: IntentGroup[];
351
452
  swimlanes?: Swimlane[];
453
+ matrices?: MatrixBlock[];
454
+ tables?: TableBlock[];
455
+ evidencePanels?: EvidencePanel[];
352
456
  constraints?: Constraint[];
353
457
  frame?: DiagramFrame;
354
458
  metadata?: DiagramMetadata;
@@ -361,6 +465,9 @@ interface NormalizedDiagram {
361
465
  edges: NormalizedEdge[];
362
466
  groups: NormalizedGroup[];
363
467
  swimlanes?: Swimlane[];
468
+ matrices?: MatrixBlock[];
469
+ tables?: TableBlock[];
470
+ evidencePanels?: EvidencePanel[];
364
471
  constraints: Constraint[];
365
472
  diagnostics: Diagnostic[];
366
473
  frame?: DiagramFrame;
@@ -374,6 +481,10 @@ interface CoordinatedDiagram {
374
481
  edges: CoordinatedEdge[];
375
482
  groups: CoordinatedGroup[];
376
483
  swimlanes?: Swimlane[];
484
+ matrices?: CoordinatedMatrixBlock[];
485
+ tables?: CoordinatedTableBlock[];
486
+ evidencePanels?: CoordinatedEvidencePanel[];
487
+ textAnnotations?: SolvedTextAnnotation[];
377
488
  diagnostics: Diagnostic[];
378
489
  bounds: Box;
379
490
  frame?: CoordinatedFrame;
@@ -566,6 +677,7 @@ interface RouteEdgeInput {
566
677
  sourceAnchor?: AnchorName;
567
678
  targetAnchor?: AnchorName;
568
679
  obstacles?: readonly Box[];
680
+ hardObstacles?: readonly Box[];
569
681
  }
570
682
  interface RouteEdgeResult {
571
683
  points: Point[];
@@ -589,12 +701,35 @@ interface SolveDiagramOptions {
589
701
  routeKind?: RouteKind;
590
702
  obstacleMargin?: number | Insets;
591
703
  overlapSpacing?: number;
704
+ minLaneGutter?: number;
705
+ prefitLabelSize?: boolean;
706
+ minSiblingGap?: number;
707
+ distributeContainedChildren?: boolean;
708
+ pageBounds?: {
709
+ width: number;
710
+ height: number;
711
+ };
712
+ maxStackDepth?: number;
713
+ preferredAspectRatio?: number;
592
714
  portShifting?: PortShiftingOptions;
715
+ cjkFontFamily?: string | false;
716
+ minCjkFontSize?: number | false;
717
+ textMeasurer?: TextMeasurer;
593
718
  }
594
719
  interface PortShiftingOptions {
595
720
  enabled?: boolean;
596
721
  spacing?: number;
597
722
  }
598
723
  declare function solveDiagram(diagram: NormalizedDiagram, options?: SolveDiagramOptions): CoordinatedDiagram;
599
-
600
- export { type AlignConstraint, type AlignmentAxis, type AnchorName, type AnchorPoint, type Arrowhead, type Box, type CanonicalJson, type CanonicalizeOptions, type Constraint, type ConstraintBase, type ConstraintSolverInput, type ConstraintSolverResult, type ConstraintTarget, type ConstraintTargetKind, type ContainerGeometry, type ContainerGeometryInput, type ContainmentConstraint, type CoordinatedDiagram, type CoordinatedEdge, type CoordinatedFrame, type CoordinatedGroup, type CoordinatedNode, type CoordinatedPort, DEFAULT_CANONICAL_PRECISION, DEFAULT_DSL_MAX_BYTES, type DagreLayoutEdge, type DagreLayoutInput, type DagreLayoutNode, type DagreLayoutOptions, type DefaultTextMeasurerOptions, DeterministicTextMeasurer, type Diagnostic, type DiagnosticPathSegment, type DiagnosticSeverity, type DiagramDirection, type DiagramFrame, type DiagramMetadata, type DiagramStage, type DistributeConstraint, type DistributionAxis, type DslDiagnostic, type DslDiagnosticLayer, type DslOutputFormat, type EdgeArrowhead, type EdgeEndpoint, type EdgeStrokeStyle, type ExactPositionConstraint, type ExportFormat, type ExportOptions, type ExportResult, type InitialLayoutResult, type Insets, type IntentDiagram, type IntentEdge, type IntentGroup, type IntentNode, type JsonObject, type JsonPrimitive, type JsonValue, type Label, type LabelFitOptions, LabelFitter, type LabelLayout, type LabelLineLayout, type LayoutLock, type LayoutLockSource, type NodeBase, type NodeCompartments, type NodePort, type NodeShape, type NormalizeDiagramDslOptions, type NormalizeDiagramDslResult, type NormalizedDiagram, type NormalizedEdge, type NormalizedGroup, type NormalizedNode, type ParseDiagramDslOptions, type ParseDiagramDslResult, type ParsedEdgeShorthand, type Point, type PortKind, type PortShiftingOptions, type PortSide, type PreparedText, PretextTextMeasurer, type RelativePositionConstraint, type RelativePositionRelation, type RenderDiagramDslOptions, type RenderDiagramDslResult, type RouteEdgeInput, type RouteEdgeResult, type RouteKind, type ShapeGeometry, type ShapeGeometryInput, type Size, type SolveDiagramOptions, type Swimlane, type SwimlaneLane, type SwimlaneOrientation, type TextCursor, type TextLayout, type TextLayoutLine, type TextMeasurementBackend, type TextMeasurer, type TextStyleOptions, type VisualStyle, applyLayoutConstraints, assertFiniteNonNegative, assertFinitePositive, boxCenter, canonicalize, computeArrowhead, computeContainerGeometry, computeShapeGeometry, createDefaultTextMeasurer, expandBox, exportExcalidraw, exportSvg, fitLabel, getEdgePort, installNodeCanvasRuntime, intersectsAabb, isPretextRuntimeAvailable, normalizeDiagramDsl, normalizeInsets, parseDiagramDsl, parseEdgeShorthand, renderDiagramDsl, resolveLineHeight, resolveOutputFormat, routeEdge, runDagreInitialLayout, simplifyRoute, solveDiagram, sortDslDiagnostics, stringifyCanonical, toCanvasFont, unionBoxes, validateBox, validateTextStyle };
724
+ /**
725
+ * Convenience wrapper around {@link solveDiagram} that enables
726
+ * {@link SolveDiagramOptions.prefitLabelSize} by default so node sizes are
727
+ * expanded to fit their label text. Direct callers of `solveDiagram` who
728
+ * pass hard-coded `NormalizedNode.size` values without a `labelLayout`
729
+ * often see truncated labels; this wrapper avoids that trap.
730
+ *
731
+ * @see SolveDiagramOptions.prefitLabelSize
732
+ */
733
+ declare function solveDiagramSafe(diagram: NormalizedDiagram, options?: SolveDiagramOptions): CoordinatedDiagram;
734
+
735
+ export { type AlignConstraint, type AlignmentAxis, type AnchorName, type AnchorPoint, type Arrowhead, type Box, type CanonicalJson, type CanonicalizeOptions, type Constraint, type ConstraintBase, type ConstraintSolverInput, type ConstraintSolverResult, type ConstraintTarget, type ConstraintTargetKind, type ContainerGeometry, type ContainerGeometryInput, type ContainmentConstraint, type CoordinatedDiagram, type CoordinatedEdge, type CoordinatedEvidencePanel, type CoordinatedFrame, type CoordinatedGroup, type CoordinatedMatrixBlock, type CoordinatedNode, type CoordinatedPort, type CoordinatedTableBlock, DEFAULT_CANONICAL_PRECISION, DEFAULT_DSL_MAX_BYTES, type DagreLayoutEdge, type DagreLayoutInput, type DagreLayoutNode, type DagreLayoutOptions, type DefaultTextMeasurerOptions, DeterministicTextMeasurer, type Diagnostic, type DiagnosticPathSegment, type DiagnosticSeverity, type DiagramDirection, type DiagramFrame, type DiagramMetadata, type DiagramStage, type DistributeConstraint, type DistributionAxis, type DslDiagnostic, type DslDiagnosticLayer, type DslOutputFormat, type EdgeArrowhead, type EdgeEndpoint, type EdgeStrokeStyle, type EvidenceCell, type EvidencePanel, type EvidencePanelItem, type EvidencePanelKind, type EvidenceTextLayout, type ExactPositionConstraint, type ExportFormat, type ExportOptions, type ExportResult, type InitialLayoutResult, type Insets, type IntentDiagram, type IntentEdge, type IntentGroup, type IntentNode, type JsonObject, type JsonPrimitive, type JsonValue, type Label, type LabelFitOptions, LabelFitter, type LabelLayout, type LabelLineLayout, type LayoutLock, type LayoutLockSource, type MatrixBlock, type NodeBase, type NodeCompartments, type NodePort, type NodeShape, type NormalizeDiagramDslOptions, type NormalizeDiagramDslResult, type NormalizedDiagram, type NormalizedEdge, type NormalizedGroup, type NormalizedNode, type ParseDiagramDslOptions, type ParseDiagramDslResult, type ParsedEdgeShorthand, type Point, type PortKind, type PortShiftingOptions, type PortSide, type PreparedText, PretextTextMeasurer, type RelativePositionConstraint, type RelativePositionRelation, type RenderDiagramDslOptions, type RenderDiagramDslResult, type RouteEdgeInput, type RouteEdgeResult, type RouteKind, type ShapeGeometry, type ShapeGeometryInput, type Size, type SolveDiagramOptions, type SolvedTextAnnotation, type Swimlane, type SwimlaneLane, type SwimlaneLayout, type SwimlaneOrientation, type TableBlock, type TableColumn, type TableRow, type TextCursor, type TextLayout, type TextLayoutLine, type TextMeasurementBackend, type TextMeasurer, type TextStyleOptions, type TextSurfaceKind, type VisualStyle, applyLayoutConstraints, assertFiniteNonNegative, assertFinitePositive, boxCenter, canonicalize, computeArrowhead, computeContainerGeometry, computeShapeGeometry, createDefaultTextMeasurer, expandBox, exportExcalidraw, exportSvg, fitLabel, getEdgePort, installNodeCanvasRuntime, intersectsAabb, isPretextRuntimeAvailable, normalizeDiagramDsl, normalizeInsets, parseDiagramDsl, parseEdgeShorthand, renderDiagramDsl, resolveLineHeight, resolveOutputFormat, routeEdge, runDagreInitialLayout, simplifyRoute, solveDiagram, solveDiagramSafe, sortDslDiagnostics, stringifyCanonical, toCanvasFont, unionBoxes, validateBox, validateTextStyle };
package/dist/index.d.ts CHANGED
@@ -180,6 +180,23 @@ interface LabelLayout {
180
180
  };
181
181
  diagnostics: Diagnostic[];
182
182
  }
183
+ type TextSurfaceKind = "node-label" | "group-label" | "port-label" | "edge-label" | "compartment-row" | "swimlane-label" | "frame-title";
184
+ interface SolvedTextAnnotation {
185
+ text: string;
186
+ ownerId: string;
187
+ surfaceKind: TextSurfaceKind;
188
+ surfaceIndex?: number;
189
+ box: Box;
190
+ anchor: Box | {
191
+ x: number;
192
+ y: number;
193
+ };
194
+ paddings: Insets;
195
+ lines: LabelLayout["lines"];
196
+ fontFamily: string;
197
+ fontSize: number;
198
+ textBackend?: LabelLayout["textBackend"];
199
+ }
183
200
 
184
201
  type NodeShape = "rectangle" | "rounded-rectangle" | "ellipse" | "diamond" | "parallelogram" | "hexagon" | "cylinder";
185
202
  interface Label {
@@ -231,6 +248,72 @@ type PortKind = "proxy" | "flow";
231
248
  interface VisualStyle {
232
249
  fill?: string;
233
250
  stroke?: string;
251
+ fontFamily?: string;
252
+ fontSize?: number;
253
+ }
254
+ interface EvidenceCell {
255
+ text: string;
256
+ style?: VisualStyle;
257
+ }
258
+ interface EvidenceTextLayout {
259
+ lines: string[];
260
+ }
261
+ interface MatrixBlock {
262
+ id: string;
263
+ rows: string[];
264
+ cols: string[];
265
+ cells: EvidenceCell[][];
266
+ position?: Point;
267
+ size?: Size;
268
+ style?: VisualStyle;
269
+ }
270
+ interface CoordinatedMatrixBlock extends MatrixBlock {
271
+ box: Box;
272
+ columnLabelLayouts?: EvidenceTextLayout[];
273
+ rowLabelLayouts?: EvidenceTextLayout[];
274
+ cellLabelLayouts?: EvidenceTextLayout[][];
275
+ }
276
+ interface TableColumn {
277
+ id: string;
278
+ label: Label;
279
+ }
280
+ interface TableRow {
281
+ id: string;
282
+ cells: Record<string, EvidenceCell>;
283
+ }
284
+ interface TableBlock {
285
+ id: string;
286
+ columns: TableColumn[];
287
+ rows: TableRow[];
288
+ position?: Point;
289
+ size?: Size;
290
+ style?: VisualStyle;
291
+ }
292
+ interface CoordinatedTableBlock extends TableBlock {
293
+ box: Box;
294
+ columnXOffsets: number[];
295
+ columnLabelLayouts?: EvidenceTextLayout[];
296
+ cellLabelLayouts?: EvidenceTextLayout[][];
297
+ }
298
+ type EvidencePanelKind = "legend" | "rule" | "note" | "verification";
299
+ interface EvidencePanelItem {
300
+ id?: string;
301
+ label: Label;
302
+ detail?: Label;
303
+ style?: VisualStyle;
304
+ }
305
+ interface EvidencePanel {
306
+ id: string;
307
+ kind: EvidencePanelKind;
308
+ items: EvidencePanelItem[];
309
+ position?: Point;
310
+ size?: Size;
311
+ style?: VisualStyle;
312
+ }
313
+ interface CoordinatedEvidencePanel extends EvidencePanel {
314
+ box: Box;
315
+ titleLayout?: EvidenceTextLayout;
316
+ itemLayouts?: EvidenceTextLayout[];
234
317
  }
235
318
  interface NodePort {
236
319
  id: string;
@@ -278,6 +361,9 @@ interface IntentGroup {
278
361
  nodeIds?: string[];
279
362
  groupIds?: string[];
280
363
  padding?: Insets;
364
+ headerHeight?: number;
365
+ labelPosition?: "top" | "inside" | "outside";
366
+ direction?: "horizontal" | "vertical";
281
367
  metadata?: JsonObject;
282
368
  }
283
369
  interface NormalizedGroup {
@@ -286,6 +372,9 @@ interface NormalizedGroup {
286
372
  nodeIds: string[];
287
373
  groupIds: string[];
288
374
  padding: Insets;
375
+ headerHeight?: number;
376
+ labelPosition?: "top" | "inside" | "outside";
377
+ direction?: "horizontal" | "vertical";
289
378
  metadata?: JsonObject;
290
379
  labelLayout?: LabelLayout;
291
380
  }
@@ -293,24 +382,34 @@ interface CoordinatedGroup extends NormalizedGroup {
293
382
  box: Box;
294
383
  }
295
384
  type SwimlaneOrientation = "vertical" | "horizontal";
385
+ type SwimlaneLayout = "overlay" | "contract";
296
386
  interface SwimlaneLane {
297
387
  id: string;
298
388
  label?: Label;
299
389
  children: string[];
300
390
  box?: Box;
391
+ headerBox?: Box;
392
+ contentBox?: Box;
301
393
  }
302
394
  interface Swimlane {
303
395
  id: string;
304
396
  label?: Label;
305
397
  orientation: SwimlaneOrientation;
398
+ layout?: SwimlaneLayout;
306
399
  lanes: SwimlaneLane[];
307
400
  box?: Box;
401
+ headerHeight?: number;
402
+ padding?: number;
308
403
  }
309
404
  interface DiagramFrame {
310
405
  kind: string;
311
406
  context?: string;
312
407
  name?: string;
313
408
  titleTab: string;
409
+ headerHeight?: number;
410
+ padding?: number | Insets;
411
+ labelPosition?: "top" | "inside" | "outside";
412
+ direction?: "horizontal" | "vertical";
314
413
  style?: VisualStyle;
315
414
  }
316
415
  interface CoordinatedFrame extends DiagramFrame {
@@ -326,6 +425,8 @@ interface LayoutLock {
326
425
  interface ConstraintSolverInput {
327
426
  direction: DiagramDirection;
328
427
  overlapSpacing?: number;
428
+ minSiblingGap?: number;
429
+ distributeContainedChildren?: boolean;
329
430
  boxes: ReadonlyMap<string, Box>;
330
431
  nodes: readonly NormalizedNode[];
331
432
  groups: readonly NormalizedGroup[];
@@ -349,6 +450,9 @@ interface IntentDiagram {
349
450
  edges?: IntentEdge[];
350
451
  groups?: IntentGroup[];
351
452
  swimlanes?: Swimlane[];
453
+ matrices?: MatrixBlock[];
454
+ tables?: TableBlock[];
455
+ evidencePanels?: EvidencePanel[];
352
456
  constraints?: Constraint[];
353
457
  frame?: DiagramFrame;
354
458
  metadata?: DiagramMetadata;
@@ -361,6 +465,9 @@ interface NormalizedDiagram {
361
465
  edges: NormalizedEdge[];
362
466
  groups: NormalizedGroup[];
363
467
  swimlanes?: Swimlane[];
468
+ matrices?: MatrixBlock[];
469
+ tables?: TableBlock[];
470
+ evidencePanels?: EvidencePanel[];
364
471
  constraints: Constraint[];
365
472
  diagnostics: Diagnostic[];
366
473
  frame?: DiagramFrame;
@@ -374,6 +481,10 @@ interface CoordinatedDiagram {
374
481
  edges: CoordinatedEdge[];
375
482
  groups: CoordinatedGroup[];
376
483
  swimlanes?: Swimlane[];
484
+ matrices?: CoordinatedMatrixBlock[];
485
+ tables?: CoordinatedTableBlock[];
486
+ evidencePanels?: CoordinatedEvidencePanel[];
487
+ textAnnotations?: SolvedTextAnnotation[];
377
488
  diagnostics: Diagnostic[];
378
489
  bounds: Box;
379
490
  frame?: CoordinatedFrame;
@@ -566,6 +677,7 @@ interface RouteEdgeInput {
566
677
  sourceAnchor?: AnchorName;
567
678
  targetAnchor?: AnchorName;
568
679
  obstacles?: readonly Box[];
680
+ hardObstacles?: readonly Box[];
569
681
  }
570
682
  interface RouteEdgeResult {
571
683
  points: Point[];
@@ -589,12 +701,35 @@ interface SolveDiagramOptions {
589
701
  routeKind?: RouteKind;
590
702
  obstacleMargin?: number | Insets;
591
703
  overlapSpacing?: number;
704
+ minLaneGutter?: number;
705
+ prefitLabelSize?: boolean;
706
+ minSiblingGap?: number;
707
+ distributeContainedChildren?: boolean;
708
+ pageBounds?: {
709
+ width: number;
710
+ height: number;
711
+ };
712
+ maxStackDepth?: number;
713
+ preferredAspectRatio?: number;
592
714
  portShifting?: PortShiftingOptions;
715
+ cjkFontFamily?: string | false;
716
+ minCjkFontSize?: number | false;
717
+ textMeasurer?: TextMeasurer;
593
718
  }
594
719
  interface PortShiftingOptions {
595
720
  enabled?: boolean;
596
721
  spacing?: number;
597
722
  }
598
723
  declare function solveDiagram(diagram: NormalizedDiagram, options?: SolveDiagramOptions): CoordinatedDiagram;
599
-
600
- export { type AlignConstraint, type AlignmentAxis, type AnchorName, type AnchorPoint, type Arrowhead, type Box, type CanonicalJson, type CanonicalizeOptions, type Constraint, type ConstraintBase, type ConstraintSolverInput, type ConstraintSolverResult, type ConstraintTarget, type ConstraintTargetKind, type ContainerGeometry, type ContainerGeometryInput, type ContainmentConstraint, type CoordinatedDiagram, type CoordinatedEdge, type CoordinatedFrame, type CoordinatedGroup, type CoordinatedNode, type CoordinatedPort, DEFAULT_CANONICAL_PRECISION, DEFAULT_DSL_MAX_BYTES, type DagreLayoutEdge, type DagreLayoutInput, type DagreLayoutNode, type DagreLayoutOptions, type DefaultTextMeasurerOptions, DeterministicTextMeasurer, type Diagnostic, type DiagnosticPathSegment, type DiagnosticSeverity, type DiagramDirection, type DiagramFrame, type DiagramMetadata, type DiagramStage, type DistributeConstraint, type DistributionAxis, type DslDiagnostic, type DslDiagnosticLayer, type DslOutputFormat, type EdgeArrowhead, type EdgeEndpoint, type EdgeStrokeStyle, type ExactPositionConstraint, type ExportFormat, type ExportOptions, type ExportResult, type InitialLayoutResult, type Insets, type IntentDiagram, type IntentEdge, type IntentGroup, type IntentNode, type JsonObject, type JsonPrimitive, type JsonValue, type Label, type LabelFitOptions, LabelFitter, type LabelLayout, type LabelLineLayout, type LayoutLock, type LayoutLockSource, type NodeBase, type NodeCompartments, type NodePort, type NodeShape, type NormalizeDiagramDslOptions, type NormalizeDiagramDslResult, type NormalizedDiagram, type NormalizedEdge, type NormalizedGroup, type NormalizedNode, type ParseDiagramDslOptions, type ParseDiagramDslResult, type ParsedEdgeShorthand, type Point, type PortKind, type PortShiftingOptions, type PortSide, type PreparedText, PretextTextMeasurer, type RelativePositionConstraint, type RelativePositionRelation, type RenderDiagramDslOptions, type RenderDiagramDslResult, type RouteEdgeInput, type RouteEdgeResult, type RouteKind, type ShapeGeometry, type ShapeGeometryInput, type Size, type SolveDiagramOptions, type Swimlane, type SwimlaneLane, type SwimlaneOrientation, type TextCursor, type TextLayout, type TextLayoutLine, type TextMeasurementBackend, type TextMeasurer, type TextStyleOptions, type VisualStyle, applyLayoutConstraints, assertFiniteNonNegative, assertFinitePositive, boxCenter, canonicalize, computeArrowhead, computeContainerGeometry, computeShapeGeometry, createDefaultTextMeasurer, expandBox, exportExcalidraw, exportSvg, fitLabel, getEdgePort, installNodeCanvasRuntime, intersectsAabb, isPretextRuntimeAvailable, normalizeDiagramDsl, normalizeInsets, parseDiagramDsl, parseEdgeShorthand, renderDiagramDsl, resolveLineHeight, resolveOutputFormat, routeEdge, runDagreInitialLayout, simplifyRoute, solveDiagram, sortDslDiagnostics, stringifyCanonical, toCanvasFont, unionBoxes, validateBox, validateTextStyle };
724
+ /**
725
+ * Convenience wrapper around {@link solveDiagram} that enables
726
+ * {@link SolveDiagramOptions.prefitLabelSize} by default so node sizes are
727
+ * expanded to fit their label text. Direct callers of `solveDiagram` who
728
+ * pass hard-coded `NormalizedNode.size` values without a `labelLayout`
729
+ * often see truncated labels; this wrapper avoids that trap.
730
+ *
731
+ * @see SolveDiagramOptions.prefitLabelSize
732
+ */
733
+ declare function solveDiagramSafe(diagram: NormalizedDiagram, options?: SolveDiagramOptions): CoordinatedDiagram;
734
+
735
+ export { type AlignConstraint, type AlignmentAxis, type AnchorName, type AnchorPoint, type Arrowhead, type Box, type CanonicalJson, type CanonicalizeOptions, type Constraint, type ConstraintBase, type ConstraintSolverInput, type ConstraintSolverResult, type ConstraintTarget, type ConstraintTargetKind, type ContainerGeometry, type ContainerGeometryInput, type ContainmentConstraint, type CoordinatedDiagram, type CoordinatedEdge, type CoordinatedEvidencePanel, type CoordinatedFrame, type CoordinatedGroup, type CoordinatedMatrixBlock, type CoordinatedNode, type CoordinatedPort, type CoordinatedTableBlock, DEFAULT_CANONICAL_PRECISION, DEFAULT_DSL_MAX_BYTES, type DagreLayoutEdge, type DagreLayoutInput, type DagreLayoutNode, type DagreLayoutOptions, type DefaultTextMeasurerOptions, DeterministicTextMeasurer, type Diagnostic, type DiagnosticPathSegment, type DiagnosticSeverity, type DiagramDirection, type DiagramFrame, type DiagramMetadata, type DiagramStage, type DistributeConstraint, type DistributionAxis, type DslDiagnostic, type DslDiagnosticLayer, type DslOutputFormat, type EdgeArrowhead, type EdgeEndpoint, type EdgeStrokeStyle, type EvidenceCell, type EvidencePanel, type EvidencePanelItem, type EvidencePanelKind, type EvidenceTextLayout, type ExactPositionConstraint, type ExportFormat, type ExportOptions, type ExportResult, type InitialLayoutResult, type Insets, type IntentDiagram, type IntentEdge, type IntentGroup, type IntentNode, type JsonObject, type JsonPrimitive, type JsonValue, type Label, type LabelFitOptions, LabelFitter, type LabelLayout, type LabelLineLayout, type LayoutLock, type LayoutLockSource, type MatrixBlock, type NodeBase, type NodeCompartments, type NodePort, type NodeShape, type NormalizeDiagramDslOptions, type NormalizeDiagramDslResult, type NormalizedDiagram, type NormalizedEdge, type NormalizedGroup, type NormalizedNode, type ParseDiagramDslOptions, type ParseDiagramDslResult, type ParsedEdgeShorthand, type Point, type PortKind, type PortShiftingOptions, type PortSide, type PreparedText, PretextTextMeasurer, type RelativePositionConstraint, type RelativePositionRelation, type RenderDiagramDslOptions, type RenderDiagramDslResult, type RouteEdgeInput, type RouteEdgeResult, type RouteKind, type ShapeGeometry, type ShapeGeometryInput, type Size, type SolveDiagramOptions, type SolvedTextAnnotation, type Swimlane, type SwimlaneLane, type SwimlaneLayout, type SwimlaneOrientation, type TableBlock, type TableColumn, type TableRow, type TextCursor, type TextLayout, type TextLayoutLine, type TextMeasurementBackend, type TextMeasurer, type TextStyleOptions, type TextSurfaceKind, type VisualStyle, applyLayoutConstraints, assertFiniteNonNegative, assertFinitePositive, boxCenter, canonicalize, computeArrowhead, computeContainerGeometry, computeShapeGeometry, createDefaultTextMeasurer, expandBox, exportExcalidraw, exportSvg, fitLabel, getEdgePort, installNodeCanvasRuntime, intersectsAabb, isPretextRuntimeAvailable, normalizeDiagramDsl, normalizeInsets, parseDiagramDsl, parseEdgeShorthand, renderDiagramDsl, resolveLineHeight, resolveOutputFormat, routeEdge, runDagreInitialLayout, simplifyRoute, solveDiagram, solveDiagramSafe, sortDslDiagnostics, stringifyCanonical, toCanvasFont, unionBoxes, validateBox, validateTextStyle };