github.com/jingcheng-WU/gonum@v0.9.1-0.20210323123734-f1a2a11a8f7b/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 "github.com/jingcheng-WU/gonum/graph" 9 "github.com/jingcheng-WU/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 }