gonum.org/v1/gonum@v0.14.0/graph/layout/layout.go (about)

     1  // Copyright ©2019 The Gonum Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package layout
     6  
     7  import (
     8  	"gonum.org/v1/gonum/graph"
     9  	"gonum.org/v1/gonum/spatial/r2"
    10  )
    11  
    12  // GraphR2 is a graph with planar spatial representation of node positions.
    13  type GraphR2 interface {
    14  	graph.Graph
    15  	LayoutNodeR2(id int64) NodeR2
    16  }
    17  
    18  // NodeR2 is a graph node with planar spatial representation of its position.
    19  // A NodeR2 is only valid when the graph.Node is not nil.
    20  type NodeR2 struct {
    21  	graph.Node
    22  	Coord2 r2.Vec
    23  }