FixedRangeExceptEnds

semagrams.layout.FixedRangeExceptEnds
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.

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

Members list

Concise view

Value members

Concrete methods

def assignPos(i: Int, n: Int): Double

Positions the ith element of {0,...,n-1}

Positions the ith element of {0,...,n-1}

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def spaceBy[X, T](f: X => Option[T])(xs: Seq[X]): Map[X, Double]

Returns a map of element => position, where each element is assigned a position based on its index when xs is grouped by f.

Returns a map of element => position, where each element is assigned a position based on its index when xs is grouped by f.

Elements for which f returns None are not included in the map.

Attributes

`xs`

the list of things to assign positions to

f

the function to group xs by

Inherited from:
Spacer