Wire
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
Members list
Value members
Concrete methods
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
becausepresent
attaches handlers to the generated svg that need to report events that referenceent
.- 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 frominit
.- 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.
Inherited methods
Compute the bounding box of the sprite
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
Compute the geometric center of the sprite
An optional layout algorithm to run before rendering an ACSet
Compute the layout for a full window of size sz
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product