graphml

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package graphml provides GraphML format export for code graphs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// Directed controls whether edges are directed (default: true).
	Directed bool

	// GraphID is the identifier for the graph element.
	GraphID string

	// Description is the GraphML document description.
	Description string
}

Generator creates GraphML output from a code graph.

func NewGenerator

func NewGenerator() *Generator

NewGenerator creates a Generator with default settings.

func (*Generator) Generate

func (g *Generator) Generate(nodes []*graph.Node, edges []*graph.Edge) (*Result, error)

Generate creates GraphML output from nodes and edges.

func (*Generator) WriteTo

func (g *Generator) WriteTo(w io.Writer, nodes []*graph.Node, edges []*graph.Edge) (*Result, error)

WriteTo writes GraphML output to the provided writer.

type Result

type Result struct {
	// Data is the generated GraphML content.
	Data []byte

	// NodeCount is the number of nodes exported.
	NodeCount int

	// EdgeCount is the number of edges exported.
	EdgeCount int

	// SkippedEdges is the number of edges skipped due to missing nodes.
	SkippedEdges int
}

Result contains the generated GraphML and statistics.

Jump to

Keyboard shortcuts

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