]> Repositorios git - classgraph.git/commit
Add LR/TD layout toggle and render equality superclasses as arrows
authorJavier Sagredo <[email protected]>
Fri, 19 Jun 2026 15:58:47 +0000 (17:58 +0200)
committerJavier Sagredo <[email protected]>
Fri, 19 Jun 2026 15:58:47 +0000 (17:58 +0200)
commitb7858140e2806d7ce3f0c6e928bb4f55af6ae53b
treead2ea16d7c29b36e56f033cb36fb0fbc0dec6d03
parente8a7716e251d4bed771d0d0e20c95347170b10d8
Add LR/TD layout toggle and render equality superclasses as arrows

Two pieces of showcase feedback:

1. Layout direction toggle. Class/method names are usually wider than
   tall, so a left-to-right flow often packs the graph more readably than
   the default top-to-bottom. Add a #dir-btn control (and `L` shortcut)
   that flips the shared dagre rankDir and re-lays-out the current view.

2. Equality superclass constraints as arrows. Previously `class (a ~ b)
   => C` dropped the equality entirely (predToSuperEdges returned no edge
   for the boxed `~`/`~~` classes and for EqPred). Now they become a
   superclass edge to the equality operator's node, carrying both operands
   as positional args, so the classes view draws `-{a}-{b}-> (~)` the same
   way any multi-param superclass renders. External operator node labels
   are parenthesised (`~` -> `(~)`). Instance-context equalities are
   unchanged — they still surface as chips on the instance node.

The demo gains a NormIsInt class exercising the new superclass-equality
path.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
data/viewer.css
data/viewer.html
data/viewer.js
examples/demo/src/Demo/Equality.hs
src/Classgraph/Extract.hs
src/Classgraph/Render.hs