Spacer

semagrams.layout.Spacer
trait Spacer

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

Members list

Concise view

Value members

Abstract 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

Concrete methods

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