Packages

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
Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Animation
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Animation(diagrams: Seq[Diagram])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(that: Animation): Animation

    Combine with another animation in parallel

  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def chain(that: Animation): Animation

    Combine with another animation in sequence

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  8. val diagrams: Seq[Diagram]
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. def mirror: Animation

    Chain with the reverse of this animation for the extra wow factor

  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  16. def productElementNames: Iterator[String]
    Definition Classes
    Product
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toNamespace(name: String): Animation

    Put this animation into a namespace with the given name (add one more hierarchy level)

  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped