SIGN IN SIGN UP
mermaid-js / mermaid UNCLAIMED

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown

0 0 165 TypeScript

fix(architecture): address PR feedback on align directive

Addresses three review comments from pbrolin47 on #7708:

1. Wrap layout.run() in try/catch and rethrow fcose's raw
   'RangeError: Invalid array length' as a friendly Error explaining the
   most likely causes (contradictory align order, or two aligns sharing
   a node along the same axis). Previously the failure surfaced as an
   opaque RangeError from FDLayout.calcGrid.

2. Use idealEdgeLengthMultiplier * iconSize for the heuristic relative
   constraint gap, matching the declared hint gap. Previously hardcoded
   to 1.5 * iconSize, which diverged from declared spacing when users
   tuned the multiplier away from 1.5.

3. Add a unit test covering the DB-level guard in addLayoutHint that
   rejects hints with fewer than two members. The grammar already
   enforces members+=ID (members+=ID)+ structurally, so this is dead
   code for the parser path, but the guard exists for programmatic
   callers and is now tested.
T
Timothy committed
2c17b71024ebeb7f058faf40a04f77f463db9394
Parent: 6049025