Documentation
¶
Overview ¶
Package graph builds the memory graph the widget renders.
It never returns the whole vault. The graph view is ego-mode only — a focus node and its neighbourhood out to a few hops — because the full-graph hairball is a screenshot, not a tool: impressive once, useless every time after. The backend's job is to extract that neighbourhood, tag each edge with where it came from (so the UI can render trust), and, on request, add the view-time similarity edges that are computed from vectors already in the index and never written to disk.
Index ¶
Constants ¶
const SimilarityThreshold = 0.62
SimilarityThreshold is how close two notes must be to draw a lens edge between them. High on purpose — similarity edges are suggestive, and a low bar turns the graph into a cobweb where everything faintly touches everything.
Variables ¶
This section is empty.
Functions ¶
func DefaultFocus ¶
DefaultFocus picks where to open the graph: today's daily note if it exists, otherwise the highest-degree node — the natural centre of what you know.
Types ¶
type Edge ¶
type Edge struct {
Src string `json:"src"`
Dst string `json:"dst"`
Pred string `json:"pred"`
Conf float64 `json:"conf"`
Provenance Provenance `json:"provenance"`
}
type Graph ¶
type Node ¶
type Node struct {
Slug string `json:"slug"`
Title string `json:"title"`
Kind string `json:"kind"`
Degree int `json:"degree"`
FirstSeen int64 `json:"first_seen"`
// Hops is the distance from the focus node, 0 for the focus itself. The UI
// dims outer rings so the eye starts at the centre.
Hops int `json:"hops"`
}
type Provenance ¶
type Provenance string
Provenance is where an edge came from — the thing that decides how much a viewer should trust it, and therefore how it is drawn.
const ( // Wikilink: a [[link]] you typed. Absolute; drawn solid at full opacity. Wikilink Provenance = "wikilink" // Typed: a frontmatter relation carrying an explicit confidence. Typed Provenance = "typed" // Similarity: embedding proximity, computed at view time. A lens, not a // fact — faint, off by default, never persisted. Similarity Provenance = "similarity" )