graph

package
v2.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportDOT

func ExportDOT(vaultRoot string, outputPath string, opts ExportOptions) error

ExportDOT exports the graph to DOT format

Types

type Edge

type Edge struct {
	FromID    model.NoteID
	ToID      *model.NoteID // nil for unresolved links
	EdgeType  model.EdgeType
	RawTarget model.RawTarget
	Span      model.Span
}

Edge represents a graph edge in memory

type ExportOptions

type ExportOptions struct {
	Roots     []string // Root nodes (type:key or key) - empty means all nodes
	Types     []string // Filter by types
	Tags      []string // Filter by tags
	States    []string // Filter by states
	EdgeTypes []string // Filter by edge types
	Depth     int      // Maximum depth (default: 10)
	Force     bool     // Overwrite existing file
}

ExportOptions represents options for graph export

type Graph

type Graph struct {
	Nodes         map[model.NoteID]*Node
	OutgoingEdges map[model.NoteID][]Edge // fromID -> []Edge
	IncomingEdges map[model.NoteID][]Edge // toID -> []Edge
}

Graph represents a loaded subgraph

func LoadGraph

func LoadGraph(vaultRoot string) (*Graph, error)

LoadGraph loads the complete graph from SQLite

func LoadSubgraph

func LoadSubgraph(vaultRoot string, nodeIDs []model.NoteID) (*Graph, error)

LoadSubgraph loads a subgraph for specific node IDs

func NewGraph

func NewGraph() *Graph

NewGraph creates a new empty graph

type Node

type Node struct {
	ID      model.NoteID
	Type    model.TypeName
	Key     model.Key
	Title   string
	State   string
	Created string
	Updated string
	Path    string
}

Node represents a graph node in memory

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL