mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-09-02 01:20:23 +08:00
feat(diagram-engine): connection vocabulary — arrowheads, parallel edges, edge ids
Arrowheads carry meaning: a crow's foot IS one-to-many, a hollow diamond IS aggregation. The engine allowed exactly one arrowhead; this opens the vocabulary the same way shapes were opened: - LinkSpec gains head/tail (pass-through to endArrow/startArrow, charset- gated against style injection) and headFill/tailFill — fill is written explicitly whenever a head is declared, because UML composition and aggregation differ ONLY by fill and draw.io's per-head default would flip the meaning. bold (4px amber, for THE key relationship) included. - Parallel edges: a second link between the same pair is allowed when it carries an id (ER's 'places' and 'cancels' between the same two entities); without one it stays an error, since two identical overlapping lines is a mistake. Edge ids are also what later operations address. - Sequence messages respect a declared head (an async message's open arrow is UML notation) while defaulting to the solid block as before. - draw_graph's edge schema extended to match; GraphEdge passes the new fields through to the link operations it generates. 5 new tests: crow's foot style emission, hollow-vs-filled round trip, injection rejection, parallel-edge gating, bold round trip. 561 unit tests green. ER+UML acceptance diagram (crow's foot, zero-to-one, hollow inheritance triangle, filled composition diamond) verified in the real editor.
This commit is contained in:
@@ -842,6 +842,26 @@ Grouping: when the nodes fall into natural zones (remote vs local, frontend vs b
|
||||
target: z.string(),
|
||||
label: z.string().optional(),
|
||||
dashed: z.boolean().optional(),
|
||||
bold: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.describe(
|
||||
"Thick coloured arrow for THE key relationship; use sparingly",
|
||||
),
|
||||
head: z
|
||||
.string()
|
||||
.optional()
|
||||
.describe(
|
||||
"Arrowhead at the target: block/open/diamond/diamondThin/oval/none, ER: ERone/ERmany/ERoneToMany/ERzeroToMany. UML inheritance: head=block headFill=false",
|
||||
),
|
||||
tail: z
|
||||
.string()
|
||||
.optional()
|
||||
.describe(
|
||||
"Arrowhead at the source, same values. ER 1:N: tail=ERone head=ERoneToMany",
|
||||
),
|
||||
headFill: z.boolean().optional(),
|
||||
tailFill: z.boolean().optional(),
|
||||
}),
|
||||
)
|
||||
.describe(
|
||||
|
||||
Reference in New Issue
Block a user