Skip to content

A highlighted edge draws last on both canvases - #625

Merged
WaylandYang merged 1 commit into
devfrom
fix/a-highlighted-schema-edge-draws-last
Sep 12, 2026
Merged

WaylandYang merged 1 commit into
devfrom
fix/a-highlighted-schema-edge-draws-last

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

On the Ontology page, selecting a class lights its edges — and a dimmed edge from
another program still drew over them, cutting the bright lines into segments. The
Graph page does not have this, because it solved the same problem in 2026-08 and
kept the solution to itself.

zIndex cannot fix it. Sigma draws one program per batch, and zIndex only orders
within a batch; across programs the order is the key order of edgeProgramClasses.
So a dimmed straight edge is still painted after a highlighted curved one.

The fix is to register each edge program a second time under a later key and move
highlighted edges into that batch. That trick now lives in graphCanvas.ts, the
module both canvases already share, instead of in either page:

  • withTopLayer(programs) returns the programs plus a …Top duplicate of each.
  • drawLast(type) is what a reducer assigns when it highlights an edge.

Both pages use it. The Graph page's hand-written version (curved / lineTop /
curvedTop, with a ternary in the reducer) is replaced by the shared one — same
programs, same key order, no behaviour change there.

Checked by hand on a seven-class schema with nine relations: the selected class's
edges stay unbroken where they cross dimmed ones, and the Graph page renders as
before.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
@WaylandYang
WaylandYang merged commit d116534 into dev Sep 12, 2026
4 checks passed
@WaylandYang
WaylandYang deleted the fix/a-highlighted-schema-edge-draws-last branch September 12, 2026 14:41
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.

1 participant