semagrams.layout

This contains a variety of utility functions for computing the layout of a Semagram.

Attributes

Members list

Concise view

Type members

Classlikes

object Align

An object containing several basic instances of BoxPosition

An object containing several basic instances of BoxPosition

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Align.type
case class AlignPoints(windowPoint: BoxPos, boxPoint: BoxPos) extends BoxPosition

An implementation of BoxPosition that works by matching up the two points in the window and the box given by windowPoint and boxPoint

An implementation of BoxPosition that works by matching up the two points in the window and the box given by windowPoint and boxPoint

Attributes

boxPoint

the point relative to the box to align to

windowPoint

the point relative to the window to align to

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class BoxData(pos: Complex, dims: Complex)

The data describing the geometry of a box

The data describing the geometry of a box

Attributes

dims

the dimensions of the box

pos

the top-left corner of the box

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class BoxPos(point: Complex, offset: Complex)

A reference to a point in coordinates relative to a box

A reference to a point in coordinates relative to a box

Attributes

offset

An offset in absolute coordinates from point

point

A point in the coordinate scale where 0+0i is the top left corner of the box, and 1+1i is the bottom right.

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

An implementation of BoxPosition is a description of how to place a box in a window.

An implementation of BoxPosition is a description of how to place a box in a window.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class FixedRange(from: Double, to: Double) extends Spacer

An implementation of Spacer that assigns from to 0 and to to n-1, with the rest of the elements evenly spaced between them.

An implementation of Spacer that assigns from to 0 and to to n-1, with the rest of the elements evenly spaced between them.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Spacer
class Object
trait Matchable
class Any
case class FixedRangeExceptEnds(from: Double, to: Double) extends Spacer

An implementation of Spacer that assigns from to -1 and to to n, with the rest of the elements evenly space between them.

An implementation of Spacer that assigns from to -1 and to to n, with the rest of the elements evenly space between them.

Useful when you want to, for instance, put ports evenly on a side of a box but you don't want to put ports on the corners of the box.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Spacer
class Object
trait Matchable
class Any
case class FixedSpacing(spacing: Double, centered: Boolean) extends Spacer

An implementation of Spacer that spaces the elements according to a fixed spacing. If centered is true, then the elements are spaced centered around 0, otherwise the elements are spaced starting from 0.

An implementation of Spacer that spaces the elements according to a fixed spacing. If centered is true, then the elements are spaced centered around 0, otherwise the elements are spaced starting from 0.

Useful for assigning bends to the edges going between two vertices.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Spacer
class Object
trait Matchable
class Any
trait Spacer

An implementation of this trait describes how to assign real numbers to elements of a finite set {0,...,n-1}.

An implementation of this trait describes how to assign real numbers to elements of a finite set {0,...,n-1}.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Value members

Concrete methods

def assignBends(edges: Map[Ob, (Hom, Hom)], spacing: Double)(a: ACSet): ACSet

Evenly space the edges in an acset by assigning bends to them

Evenly space the edges in an acset by assigning bends to them

Attributes

a

the acset to assign bends to.

edges

a collection of objects to assign bends to, along with a source and target for each object. We want multiple objects because there could be different types of edge that all need to be spaced together.

spacing

the increment between bends of adjacent edges