case class Animation(diagrams: Seq[Diagram]) extends Product with Serializable
The central type for producing animations — sequences of diagrams
Animations can be combined in parallel (using +
) or in sequence (using chain
).
While in most cases this library provides sane defaults, various techniques can be applied to ensure continuity between the frames:
- By default, the adjacent frames are aligned to reduce the overall movement
of the tree nodes inside them. You can “anchor” the roots of one or more diagrams
to minimize their movement instead, while allowing everything else to move (in case
of several anchors in one frame, completely pinning all of them might not be possible).
To do that, use the
withAnchor
method for each diagram in question, and provide the same anchor id for the same diagram across different frames. - By default, colors are auto-assigned within each frame. However if you have
several diagrams in each frame and their number or order changes, you will want
to assign colors manually. You can do that by using the
withColor
diagram method and providing the same color palette index for the same diagram across different frames. - When combining several animations in parallel, you might want to prevent the trees
inside them from sharing nodes with the same ids. This can be achieved with the
namespacing functionality (see Diagram for more details). Just like with diagrams,
you can use the
toNamespace
method to adjust that for the entire animation.
Usage examples:
// Basic animation Animation .startWith(Queue(1)) .iterateWithIndex(2)((queue, i) => queue :+ (i + 1)) .build() // Configure how the diagram for each frame is produced Animation .startWith(Queue(1)) .iterateWithIndex(2)((queue, i) => queue :+ (i + 1)) .build(Diagram(_).withCaption("My Queue").withColor(2)) // Adding anchors Animation .startWith(Queue(1)) .iterateWithIndex(2)((queue, i) => queue :+ (i + 1)) .build(Diagram(_).withAnchor("queue").withCaption("This node is anchored!")) // Combining in parallel Animation .startWith(Queue(1)) .iterateWithIndex(2)((queue, i) => queue :+ (i + 1)) .build() .toNamespace("one") + Animation .startWith(Queue(10)) .iterateWithIndex(2)((queue, i) => queue :+ (10 * (i + 1))) .build() .toNamespace("two")
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Animation
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(that: Animation): Animation
Combine with another animation in parallel
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def chain(that: Animation): Animation
Combine with another animation in sequence
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- val diagrams: Seq[Diagram]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mirror: Animation
Chain with the reverse of this animation for the extra wow factor
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toNamespace(name: String): Animation
Put this animation into a namespace with the given name (add one more hierarchy level)
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)