Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.
mattt edited this page Jul 15, 2020 · 12 revisions

Graph

@dynamicMemberLookup public struct Graph: Equatable

Inheritance

Equatable

Nested Type Aliases

Fragment

typealias Fragment = GraphBuilder.Fragment

Initializers

init(directed:strict:)

Creates a graph.

public init(directed: Bool = false, strict: Bool = false)

Parameters

  • directed: - directed: Whether the graph is directed; false by default.
  • strict: - strict: Whether the graph is strict; false by default.

init(directed:strict:_:)

public init(directed: Bool = false, strict: Bool = false, _ builder: () -> GraphMember)

Properties

directed

Whether the graph is directed.

var directed: Bool

strict

Whether the graph is strict.

var strict: Bool

id

The id of the graph, is any.

var id: String?

subgraphs

Subgraphs contained by the graph.

var subgraphs: [Subgraph]

nodes

Nodes contained by the graph.

var nodes: [Node]

edges

Edges contained by the graph.

var edges: [Edge]

isEmpty

Returns whether the graph is empty.

var isEmpty: Bool

A graph is considered to be empty if it has no subgraphs, has no edges, has no nodes with attributes, and has no attributes itself.

attributes

var attributes: Attributes

Methods

render(using:to:)

public func render(using layout: LayoutAlgorithm, to format: Format) throws -> Data

append(_:)

public mutating func append(_ subgraph: Subgraph)

append(contentsOf:)

public mutating func append<S>(contentsOf subgraphs: S) where S.Element == Subgraph, S: Sequence

append(_:)

public mutating func append(_ node: Node)

append(contentsOf:)

public mutating func append<S>(contentsOf nodes: S) where S.Element == Node, S: Sequence

append(_:)

public mutating func append(_ edge: Edge)

append(contentsOf:)

public mutating func append<S>(contentsOf edges: S) where S.Element == Edge, S: Sequence

append(_:)

private mutating func append(_ fragment: Fragment)

append(typeErased:)

private mutating func append(typeErased member: GraphMember)

Clone this wiki locally