Skip to content

feat: edge labels, neighbourhood and graph layouts, map views for any schema - #40

Merged
mindsocket merged 15 commits into
mainfrom
claude/project-thread-iv62tw
Nov 16, 2026
Merged

mindsocket merged 15 commits into
mainfrom
claude/project-thread-iv62tw

Conversation

@mindsocket

@mindsocket mindsocket commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Requested by Rog · project thread

What

  1. edges.labels (parameterisable boolean, default false): connectors show the field the relationship is declared in.
  2. neighbourhood layout: one focus node and its neighbours. Hierarchy parents go above and children below, relationship edges to the left, and siblings (or, for a hierarchy root, the other roots of its type) in a column at the far right. With no hierarchy, every edge runs down the page. The above, below, left and right settings override the defaults by field. Selecting a neighbour moves the focus. MapView takes focus and onFocusChange, and the navigator keeps the focus in ?focus=.
  3. graph layout: every node and edge as a network, settled by d3-force. Where the schema has a hierarchy, each level settles in a band below the one above and relationship edges are dashed. Nodes with no edge shown sit in a grid underneath. It needs no hierarchy.
  4. A definition's schema is optional. Without one it applies to every schema, and mapViewsForSchema includes it.
  5. Bundled views for any schema: graph, neighbourhood and tree. The tree shows a message for a schema with no hierarchy. strategy-tree stays as the view for the strategy schema.

Structure

  • src/layouts is now src/components, and EdgeOverlay is ConnectorOverlay (an edge is a reference in the space graph, a connector is a drawn line).
  • Each layout has a folder in core/layouts/<name>/ with its schema.ts, plus a projection.ts only when deciding what is shown takes logic of its own. The graph layout has none: its component runs d3-force itself. core/layouts/schemas.ts lists the layouts once, and the schema list, definition types and layout branch of the definition schema derive from it.
  • The graph, lane and occurrence helpers shared by the projections are in core/layouts/helpers.ts. The shared definition schemas moved from core/format to core/schema. MapView finds a layout's component through one registry, and the components share components/layout.ts.
  • d3-force is a dependency, external to the library build like ajv. Schema files stay out of the projection chunk.
  • Docs: new docs/layouts.md is the one place layouts are described. AGENTS.md is rewritten as principles plus "Adding a layout". concepts.md, architecture.md, definitions.md, api.md and the READMEs follow, and the latest schemas and bundled definitions are regenerated.

Also in this branch

These are unrelated to the layouts:

  • The release skill note and the preversion script now build the library first, because the plugin's tests import the built html entry.
  • Unexported types that only one file used (ViewerProps, Fetched, LoadMapViewDefinitionsOptions). The first two were not part of src/index.ts. LoadMapViewDefinitionsOptions was exported by the /node entry, whose loadMapViewDefinitions now takes { configDir?: string } inline, so a host that imports the type breaks.

Checks

  • bun test, typecheck and biome pass locally, and CI passes on the head commit. I did not run test:package locally.
  • The graph layout has no unit test. The earlier pure-projection test went when the settle moved into the component, so the layout is only checked by rendering.
  • Not covered: the Obsidian plugin doesn't set focus, and connector labels can overlap where connectors cross.

🤖 Generated with Claude Code

https://claude.ai/code/session_019XphpcKhuNyHcNArHFELR4

@mindsocket mindsocket self-assigned this Nov 15, 2026
@mindsocket mindsocket changed the title feat: edges.labels draws each connector's relationship field feat: edge labels and a compass layout Nov 15, 2026
@mindsocket mindsocket changed the title feat: edge labels and a compass layout feat: edge labels, neighbourhood and graph layouts, map views for any schema Nov 15, 2026
Comment thread apps/navigator/src/useUrlState.ts Resolved
Comment thread docs/api.md Resolved
Comment thread docs/architecture.md Resolved
Comment thread docs/architecture.md Resolved
Comment thread docs/architecture.md Resolved

@mindsocket mindsocket left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple more notes. Reply to open comments when addressing

Comment thread docs/architecture.md Resolved
claude and others added 11 commits November 16, 2026 18:14
Tree and XY connectors can show the field the relationship is declared in,
so typed relationships read at a glance.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpcKhuNyHcNArHFELR4
Adds the compass layout with a bundled knowledge wiki neighbourhood view.
Selecting a neighbour moves the focus; hosts can set it with focus.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpcKhuNyHcNArHFELR4
Adds the graph layout (d3-force) and makes a definition's schema optional;
without one it applies to every schema. Bundles graph, neighbourhood and tree
views for any schema. Renames compass to neighbourhood.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpcKhuNyHcNArHFELR4
…md, trimmed docs and tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpcKhuNyHcNArHFELR4
…a/ for the shared format, no barrel

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpcKhuNyHcNArHFELR4
…into core/layouts/helpers.ts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpcKhuNyHcNArHFELR4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpcKhuNyHcNArHFELR4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpcKhuNyHcNArHFELR4
… graph

- Rename src/layouts to src/components, and EdgeOverlay to ConnectorOverlay:
  an edge is a reference in the space graph, a connector is a drawn line.
  The projections share one Connector type in place of a link type each.
- A projection is optional: a layout has one only when deciding what is
  shown takes logic of its own. The graph layout has none; its component
  reads the space graph and runs d3-force itself.
- Graph layout: each hierarchy level settles in a band, hierarchy nodes
  gather in the middle, relationship connectors are dashed, and nodes with
  no edge shown sit in a grid underneath.
- Neighbourhood layout: a hierarchy root shows the other roots of its type,
  so the reader can move between them.
- Stop exporting types that one file uses, and use structured-context's
  NodeId in place of local aliases.
- AGENTS.md: principles for naming, exports, comments and docs, and what
  adding a layout involves. Docs no longer enumerate what the code lists.
@mindsocket
mindsocket force-pushed the claude/project-thread-iv62tw branch from b20bf12 to cf8ef1c Compare November 16, 2026 09:24
mindsocket and others added 3 commits November 16, 2026 20:26
…blings right

- By default hierarchy parents sit above the focus and hierarchy children
  below, relationship edges in either direction to the left, and siblings in
  a column at the far right. With no hierarchy, every edge runs down the page.
- The role settings are overrides: a listed field goes to that role in either
  direction. The `around` role is gone, as every edge has a default place.
- Zones wrap (three across above and below, six down at the sides), so a
  large zone doesn't push the focus off screen.
- The focus is marked with an accent ring.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpcKhuNyHcNArHFELR4
@mindsocket
mindsocket marked this pull request as ready for review November 16, 2026 10:13
core/layouts/schemas.ts holds the layout schemas and the checks a schema
can't express. The schema list, the definition types and the layout branch
of the definition schema are derived from it, and the per-layout config
aliases give way to LayoutConfig<'name'>.
@mindsocket
mindsocket merged commit cb9aac5 into main Nov 16, 2026
1 check passed
@mindsocket
mindsocket deleted the claude/project-thread-iv62tw branch November 18, 2026 05:14
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