Wire

semagrams.sprites.Wire
case class Wire() extends Sprite

A sprite used for wires. Similar to Arrow, except this one is a spline where the beginning and the end are both horizontal, and it has no arrowhead.

Attributes

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

Members list

Concise view

Value members

Concrete methods

def blockPath(z1: Complex, z2: Complex, dz1: Complex, dz2: Complex, d: Double, bend: Double): Seq[Element]
def curvedPath(z1: Complex, z2: Complex, dz1: Complex, dz2: Complex, bend: Double): Seq[Element]
def exAt(p: Complex, d: Double): Seq[Element]
def present(ent: Entity, init: ACSet, updates: Signal[ACSet], attachHandlers: HandlerAttacher): SvgElement

Construct an SvgElement for a subacset.

Construct an SvgElement for a subacset.

This is the main method to override in an implementation of Sprite.

SVG is an absolute medium, so what is returned here is precisely what is shown on the screen; it is not moved or scaled (except possibly by a global transform). Thus, this must use the properties given to fill in all of the necessary parts of the sprite.

Attributes

attachHandlers

This is used by MiddleWare to inject event handlers into the sprite. This should be called on the svg element that the mouse interacts with (which may be different from the top-level svg element).

ent

This is the entity that is associated with this Sprite. We pass this into present because present attaches handlers to the generated svg that need to report events that reference ent.

init

This is the initial value of the subacset that specifies the properties for the sprite. In most cases, we are just interested in the top-level properties, but sometimes we use the parts inside to, for instance, display ports. Most of the time, one should get properties from updates, as those will change over time, but there may be some things that you need in order to construct the svg that will never change, and those can be taken from init.

updates

This is the same data as init, except changing over time. This should be used to, for instance, set the center of the Sprite, because then the center will change when the Sprite is dragged.

override def toTikz(w: Part, data: ACSet, visible: Boolean): String

Convert a diagram element into tikz code

Convert a diagram element into tikz code

Attributes

Definition Classes

Inherited methods

def bbox(subent: Entity, data: ACSet): Option[BoundingBox]

Compute the bounding box of the sprite

Compute the bounding box of the sprite

Similar to boundaryPt

Attributes

Inherited from:
Sprite
def boundaryPt(subent: Entity, data: ACSet, dir: Complex): Option[Complex]

Compute a point on the geometrical boundary of the sprite

Compute a point on the geometrical boundary of the sprite

Note that this does not reference the constructed SVG element, so this can be called with no side effects or global state.

This might not make sense, so is optional to implement.

Attributes

Inherited from:
Sprite
def center(subent: Entity, data: ACSet): Option[Complex]

Compute the geometric center of the sprite

Compute the geometric center of the sprite

Similar to boundaryPt

Attributes

Inherited from:
Sprite

An optional layout algorithm to run before rendering an ACSet

An optional layout algorithm to run before rendering an ACSet

Attributes

Inherited from:
Sprite
def layoutBg(sz: Complex, a: ACSet): ACSet

Compute the layout for a full window of size sz

Compute the layout for a full window of size sz

Attributes

Inherited from:
Sprite
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product