PixiRenderer#attach( data ) -> this
- data (PIXI.Graphics|Object): Graphics object or event data (`data.body`)

Event callback to attach a child to the stage
974408
function( data ){

            // interpred data as either dom node or event data
            var el = (data instanceof PIXI.Graphics && data) || (data.body && data.body.view);

            if ( el ){
                // attach to viewport
                this.stage.addChild( el );
            }

            return this;
        }
1080152
private void attachPlot(SVGPlot newplot) {
    this.plot = newplot;
    if(newplot == null) {
      super.setSVGDocument(null);
      return;
    }
    newplot.synchronizeWith(synchronizer);
    super.setSVGDocument(newplot.getDocument());
    super.setDisableInteractions(newplot.getDisableInteractions());
  }
978744
def attach(self, gui):
        """"""
        super(TraceView, self).attach(gui)
        self.actions.add(self.go_to, alias='tg')
        self.actions.separator()
        self.actions.add(self.shift, alias='ts')
        self.actions.add(self.go_right)
        self.actions.add(self.go_left)
        self.actions.separator()
        self.actions.add(self.increase)
        self.actions.add(self.decrease)
        self.actions.separator()
        self.actions.add(self.widen)
        self.actions.add(self.narrow)
        self.actions.separator()
        self.actions.add(self.toggle_show_labels)

        # We forward the event from VisPy to the phy GUI.
        @self.connect
        def on_spike_click(e):
            logger.log(5, "Spike click on channel %s, spike %s, cluster %s.",
                       e.channel_id, e.spike_id, e.cluster_id)
            gui.emit('spike_click',
                     channel_id=e.channel_id,
                     spike_id=e.spike_id,
                     cluster_id=e.cluster_id,
                     )
532537
function PixmapRenderer(generator, config, logger, document) {
        BaseRenderer.call(this, generator, config, logger, document);

        if (config.hasOwnProperty("interpolation-type")) {
            this._interpolationType = config["interpolation-type"];
        }
    }
941128
def AddEventData(self, event_data):
    
    self._RaiseIfNotWritable()

    event_data = self._PrepareAttributeContainer(event_data)

    identifier = event_data.GetIdentifier()
    lookup_key = identifier.CopyToString()
    self._event_data[lookup_key] = event_data
1075812
def child_task(self):
        ''''''
        mp_util.child_close_fds()
        
        import matplotlib
        import wx_processguard
        from wx_loader import wx
        from live_graph_ui import GraphFrame

        matplotlib.use('WXAgg')
        app = wx.App(False)
        app.frame = GraphFrame(state=self)
        app.frame.Show()
        app.MainLoop()
89690
def add_child(self, child):
        
        self.children.append(child)
        child.parent = self

        if self.view and self.view.is_loaded:
            self.view.dispatch({
                'name': 'append',
                'html': child.compile(),
                'selector': '#' + str(self.id)
            })
1171884
def render_addPersonForm(self, ctx, data):
        
        addPersonForm = liveform.LiveForm(
            self.addPerson, self._baseParameters, description='Add Person')
        addPersonForm.compact()
        addPersonForm.jsClass = u'Mantissa.People.AddPersonForm'
        addPersonForm.setFragmentParent(self)
        return addPersonForm
105165
function(data){
	var container = document.createElement(data.childTag);
	data.nodes.forEach(function(node){
		container.appendChild(renderNodeTarget.hydrate({node: node, childTag: data.childTag}));
	});
	return container;
}
421227
@Override
    public void attachToLayerColorMap()
    {
        final Layer layer = getLayer();

        if (null != layer)
        {
            final NFastArrayList<T> list = getChildNodes();

            if (null != list)
            {
                final int size = list.size();

                for (int i = 0; i < size; i++)
                {
                    list.get(i).attachToLayerColorMap();
                }
            }
        }
    }
1243513
def childEvent(self, event):    
        
        super(AbstractDragView, self).childEvent(event)
        if event.type() == QtCore.QEvent.ChildRemoved:
            # hack to catch drop offs   
            if self.originalPos is not None:
                selected = self.limbo_component
                self.model().insertItem(self.originalPos, selected)
                self.originalPos = None
                self.dragStartPosition = None
                self.viewport().update()
1294276
function () {
    var collisionEntities;
    var data = this.data;
    var el = this.el;

    if (!data.collisionEntities) {
      this.collisionEntities = [];
      return;
    }

    collisionEntities = [].slice.call(el.sceneEl.querySelectorAll(data.collisionEntities));
    this.collisionEntities = collisionEntities;

    // Update entity list on attach.
    this.childAttachHandler = function childAttachHandler (evt) {
      if (!evt.detail.el.matches(data.collisionEntities)) { return; }
      collisionEntities.push(evt.detail.el);
    };
    el.sceneEl.addEventListener('child-attached', this.childAttachHandler);

    // Update entity list on detach.
    this.childDetachHandler = function childDetachHandler (evt) {
      var index;
      if (!evt.detail.el.matches(data.collisionEntities)) { return; }
      index = collisionEntities.indexOf(evt.detail.el);
      if (index === -1) { return; }
      collisionEntities.splice(index, 1);
    };
    el.sceneEl.addEventListener('child-detached', this.childDetachHandler);
  }
976819
function(name, parent) {
      
      this.name = name;
      this.parent = parent;
      
      // if the parent has a custom context the child should inherit it
      if (parent._context && (parent._context._id !== parent._id)) {
        
        this._context = parent._context;
        if (this.scenes) {
          _.each(this.scenes , function(scene) {
            scene.attach(scene.name, this);
          }, this);
        }
      }
      return this;
    }
686357
def _apply_post_render_hooks(self, data, obj, fmt):
        
        hooks = self.post_render_hooks.get(fmt,[])
        for hook in hooks:
            try:
                data = hook(data, obj)
            except Exception as e:
                self.param.warning("The post_render_hook %r could not "
                                   "be applied:\n\n %s" % (hook, e))
        return data
1078952
public ClassificationModel attachClassification(GraphRewrite event, EvaluationContext context, FileModel fileModel, String classificationText, String description)
    {
        return attachClassification(event, context, fileModel, IssueCategoryRegistry.DEFAULT, classificationText, description);
    }
221134
function (data) {
            var atlas = {};
            var image = data.image;
            var spacing = data.spacing || 0;
            var margin = data.margin || 0;

            var width = image.width;
            var height = image.height;

            // calculate the sprite count (line, col)
            var spritecount = me.pool.pull("me.Vector2d",
                ~~((width - margin + spacing) / (data.framewidth + spacing)),
                ~~((height - margin + spacing) / (data.frameheight + spacing))
            );

            // verifying the texture size
            if ((width % (data.framewidth + spacing)) !== 0 ||
                (height % (data.frameheight + spacing)) !== 0) {
                // "truncate size"
                width = spritecount.x * (data.framewidth + spacing);
                height = spritecount.y * (data.frameheight + spacing);
                // warning message
                console.warn(
                    "Spritesheet Texture for image: " + image.src +
                    " is not divisible by " + (data.framewidth + spacing) +
                    "x" + (data.frameheight + spacing) +
                    ", truncating effective size to " + width + "x" + height
                );
            }

            // build the local atlas
            for (var frame = 0, count = spritecount.x * spritecount.y; frame < count; frame++) {
                var name = "" + frame;
                atlas[name] = {
                    name        : name,
                    texture     : "default", // the source texture
                    offset      : new me.Vector2d(
                        margin + (spacing + data.framewidth) * (frame % spritecount.x),
                        margin + (spacing + data.frameheight) * ~~(frame / spritecount.x)
                    ),
                    anchorPoint : (data.anchorPoint || null),
                    trimmed     : false,
                    width       : data.framewidth,
                    height      : data.frameheight,
                    angle       : 0
                };
                this.addUvsMap(atlas, name, width, height);
            }

            me.pool.push(spritecount);

            return atlas;
        }
685131
function( data ){

            // interpred data as either dom node or event data
            var el = (data.nodeType && data) || (data.body && data.body.view)
                ;

            if ( el ){
                // attach to viewport
                this.el.appendChild( el );
            }

            return this;
        }