@crazyhappyone/auto-graph 0.0.6 → 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/cli/index.cjs +4011 -2983
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +4011 -2983
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +1131 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -2
- package/dist/index.d.ts +39 -2
- package/dist/index.js +1131 -100
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -193,6 +193,7 @@ interface SolvedTextAnnotation {
|
|
|
193
193
|
};
|
|
194
194
|
paddings: Insets;
|
|
195
195
|
lines: LabelLayout["lines"];
|
|
196
|
+
fontFamily: string;
|
|
196
197
|
fontSize: number;
|
|
197
198
|
textBackend?: LabelLayout["textBackend"];
|
|
198
199
|
}
|
|
@@ -247,6 +248,8 @@ type PortKind = "proxy" | "flow";
|
|
|
247
248
|
interface VisualStyle {
|
|
248
249
|
fill?: string;
|
|
249
250
|
stroke?: string;
|
|
251
|
+
fontFamily?: string;
|
|
252
|
+
fontSize?: number;
|
|
250
253
|
}
|
|
251
254
|
interface EvidenceCell {
|
|
252
255
|
text: string;
|
|
@@ -358,6 +361,9 @@ interface IntentGroup {
|
|
|
358
361
|
nodeIds?: string[];
|
|
359
362
|
groupIds?: string[];
|
|
360
363
|
padding?: Insets;
|
|
364
|
+
headerHeight?: number;
|
|
365
|
+
labelPosition?: "top" | "inside" | "outside";
|
|
366
|
+
direction?: "horizontal" | "vertical";
|
|
361
367
|
metadata?: JsonObject;
|
|
362
368
|
}
|
|
363
369
|
interface NormalizedGroup {
|
|
@@ -366,6 +372,9 @@ interface NormalizedGroup {
|
|
|
366
372
|
nodeIds: string[];
|
|
367
373
|
groupIds: string[];
|
|
368
374
|
padding: Insets;
|
|
375
|
+
headerHeight?: number;
|
|
376
|
+
labelPosition?: "top" | "inside" | "outside";
|
|
377
|
+
direction?: "horizontal" | "vertical";
|
|
369
378
|
metadata?: JsonObject;
|
|
370
379
|
labelLayout?: LabelLayout;
|
|
371
380
|
}
|
|
@@ -397,6 +406,10 @@ interface DiagramFrame {
|
|
|
397
406
|
context?: string;
|
|
398
407
|
name?: string;
|
|
399
408
|
titleTab: string;
|
|
409
|
+
headerHeight?: number;
|
|
410
|
+
padding?: number | Insets;
|
|
411
|
+
labelPosition?: "top" | "inside" | "outside";
|
|
412
|
+
direction?: "horizontal" | "vertical";
|
|
400
413
|
style?: VisualStyle;
|
|
401
414
|
}
|
|
402
415
|
interface CoordinatedFrame extends DiagramFrame {
|
|
@@ -412,6 +425,8 @@ interface LayoutLock {
|
|
|
412
425
|
interface ConstraintSolverInput {
|
|
413
426
|
direction: DiagramDirection;
|
|
414
427
|
overlapSpacing?: number;
|
|
428
|
+
minSiblingGap?: number;
|
|
429
|
+
distributeContainedChildren?: boolean;
|
|
415
430
|
boxes: ReadonlyMap<string, Box>;
|
|
416
431
|
nodes: readonly NormalizedNode[];
|
|
417
432
|
groups: readonly NormalizedGroup[];
|
|
@@ -686,7 +701,19 @@ interface SolveDiagramOptions {
|
|
|
686
701
|
routeKind?: RouteKind;
|
|
687
702
|
obstacleMargin?: number | Insets;
|
|
688
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;
|
|
689
714
|
portShifting?: PortShiftingOptions;
|
|
715
|
+
cjkFontFamily?: string | false;
|
|
716
|
+
minCjkFontSize?: number | false;
|
|
690
717
|
textMeasurer?: TextMeasurer;
|
|
691
718
|
}
|
|
692
719
|
interface PortShiftingOptions {
|
|
@@ -694,5 +721,15 @@ interface PortShiftingOptions {
|
|
|
694
721
|
spacing?: number;
|
|
695
722
|
}
|
|
696
723
|
declare function solveDiagram(diagram: NormalizedDiagram, options?: SolveDiagramOptions): CoordinatedDiagram;
|
|
697
|
-
|
|
698
|
-
|
|
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
|
@@ -193,6 +193,7 @@ interface SolvedTextAnnotation {
|
|
|
193
193
|
};
|
|
194
194
|
paddings: Insets;
|
|
195
195
|
lines: LabelLayout["lines"];
|
|
196
|
+
fontFamily: string;
|
|
196
197
|
fontSize: number;
|
|
197
198
|
textBackend?: LabelLayout["textBackend"];
|
|
198
199
|
}
|
|
@@ -247,6 +248,8 @@ type PortKind = "proxy" | "flow";
|
|
|
247
248
|
interface VisualStyle {
|
|
248
249
|
fill?: string;
|
|
249
250
|
stroke?: string;
|
|
251
|
+
fontFamily?: string;
|
|
252
|
+
fontSize?: number;
|
|
250
253
|
}
|
|
251
254
|
interface EvidenceCell {
|
|
252
255
|
text: string;
|
|
@@ -358,6 +361,9 @@ interface IntentGroup {
|
|
|
358
361
|
nodeIds?: string[];
|
|
359
362
|
groupIds?: string[];
|
|
360
363
|
padding?: Insets;
|
|
364
|
+
headerHeight?: number;
|
|
365
|
+
labelPosition?: "top" | "inside" | "outside";
|
|
366
|
+
direction?: "horizontal" | "vertical";
|
|
361
367
|
metadata?: JsonObject;
|
|
362
368
|
}
|
|
363
369
|
interface NormalizedGroup {
|
|
@@ -366,6 +372,9 @@ interface NormalizedGroup {
|
|
|
366
372
|
nodeIds: string[];
|
|
367
373
|
groupIds: string[];
|
|
368
374
|
padding: Insets;
|
|
375
|
+
headerHeight?: number;
|
|
376
|
+
labelPosition?: "top" | "inside" | "outside";
|
|
377
|
+
direction?: "horizontal" | "vertical";
|
|
369
378
|
metadata?: JsonObject;
|
|
370
379
|
labelLayout?: LabelLayout;
|
|
371
380
|
}
|
|
@@ -397,6 +406,10 @@ interface DiagramFrame {
|
|
|
397
406
|
context?: string;
|
|
398
407
|
name?: string;
|
|
399
408
|
titleTab: string;
|
|
409
|
+
headerHeight?: number;
|
|
410
|
+
padding?: number | Insets;
|
|
411
|
+
labelPosition?: "top" | "inside" | "outside";
|
|
412
|
+
direction?: "horizontal" | "vertical";
|
|
400
413
|
style?: VisualStyle;
|
|
401
414
|
}
|
|
402
415
|
interface CoordinatedFrame extends DiagramFrame {
|
|
@@ -412,6 +425,8 @@ interface LayoutLock {
|
|
|
412
425
|
interface ConstraintSolverInput {
|
|
413
426
|
direction: DiagramDirection;
|
|
414
427
|
overlapSpacing?: number;
|
|
428
|
+
minSiblingGap?: number;
|
|
429
|
+
distributeContainedChildren?: boolean;
|
|
415
430
|
boxes: ReadonlyMap<string, Box>;
|
|
416
431
|
nodes: readonly NormalizedNode[];
|
|
417
432
|
groups: readonly NormalizedGroup[];
|
|
@@ -686,7 +701,19 @@ interface SolveDiagramOptions {
|
|
|
686
701
|
routeKind?: RouteKind;
|
|
687
702
|
obstacleMargin?: number | Insets;
|
|
688
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;
|
|
689
714
|
portShifting?: PortShiftingOptions;
|
|
715
|
+
cjkFontFamily?: string | false;
|
|
716
|
+
minCjkFontSize?: number | false;
|
|
690
717
|
textMeasurer?: TextMeasurer;
|
|
691
718
|
}
|
|
692
719
|
interface PortShiftingOptions {
|
|
@@ -694,5 +721,15 @@ interface PortShiftingOptions {
|
|
|
694
721
|
spacing?: number;
|
|
695
722
|
}
|
|
696
723
|
declare function solveDiagram(diagram: NormalizedDiagram, options?: SolveDiagramOptions): CoordinatedDiagram;
|
|
697
|
-
|
|
698
|
-
|
|
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 };
|