Skip to content

feat(joint-core): add directional modes to midSide anchor#3272

Merged
Geliogabalus merged 2 commits intoclientIO:masterfrom
kumilingus:feat/midside-directional-modes
Apr 14, 2026
Merged

feat(joint-core): add directional modes to midSide anchor#3272
Geliogabalus merged 2 commits intoclientIO:masterfrom
kumilingus:feat/midside-directional-modes

Conversation

@kumilingus
Copy link
Copy Markdown
Contributor

@kumilingus kumilingus commented Apr 13, 2026

Summary

Adds four directional modes to the midSide anchor: 'top-bottom', 'bottom-top', 'left-right', 'right-left'.

These modes set the anchor side based on endType (source vs target). The mode name describes where the anchors are placed:

  • 'top-bottom' — source anchor at top, target anchor at bottom
  • 'bottom-top' — source anchor at bottom, target anchor at top
  • 'left-right' — source anchor at left, target anchor at right
  • 'right-left' — source anchor at right, target anchor at left

Useful for directed layouts (e.g. flowcharts, org charts) where links should flow in a consistent direction.

Changes

  • packages/joint-core/src/anchors/index.mjs — add modes to SideMode, pass endType to getMiddleSide(), handle new modes in switch
  • packages/joint-core/types/joint.d.ts — add new modes to MidSideAnchorArguments.mode type

Test plan

  • Existing midSide modes (auto, horizontal, vertical, etc.) unchanged
  • New modes correctly pick source/target sides

🤖 Generated with Claude Code

Add 'top-bottom', 'bottom-top', 'left-right', 'right-left' modes to the
midSide anchor. These set the anchor side based on endType — source exits
from the first side, target enters from the second.

Pass endType to getMiddleSide() to support the new directional modes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kumilingus kumilingus requested a review from Geliogabalus April 13, 2026 17:31
Mode name describes anchor positions, not flow direction:
top-bottom = source at top, target at bottom.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Geliogabalus Geliogabalus merged commit 67d83ba into clientIO:master Apr 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants