Show:

Encapsulates a stream of layout data (transform, origin, align, opacity). Listens on start/update/end events, batches them, and emits them downstream to descendant layout nodes.

Constructor

Core.LayoutNode

(
  • sources
)
private

Parameters:

  • sources Object

    Object of layout sources

    • [transform] Stream | Transform optional

      Transform source

    • [align] Stream | Array optional

      Align source

    • [origin] Stream | Array optional

      Origin source

    • [opacity] Stream | Number optional

      Opacity source

Example:

 var context = Context();
        
         var surface = new Surface({
             size : [100,100],
             properties : {background : 'red'}
         });
        
         var opacity = new Transitionable(1);
        
         var layout = new LayoutNode({
             transform : Transform.translateX(100),
             opacity : opacity
         });
        
         context.add(layout).add(surface);
         context.mount(document.body)
        
         opacity.set(0, {duration : 1000});

Item Index

Methods

Methods

set

(
  • sources
)

Introduce new data streams to the layout node in {key : value} pairs. Here the key is one of "transform", "origin", "align" or "opacity". The value is either a stream, or a simple type like a Number or Array. Simple types will be wrapped in an Observerable to emit appropriate events.

Parameters:

  • sources Object

    Object of data sources