Render the entire row evolution popover for a single row
494633
public function getRowEvolutionPopover()
    {
        $rowEvolution = $this->makeRowEvolution($isMulti = false);
        $view = new View('@CoreHome/getRowEvolutionPopover');
        return $rowEvolution->renderPopover($this, $view);
    }
1325501
def _render_rows(self):
        
        _datas = getattr(self, '_datas', ())
        headers = getattr(self, 'headers', ())
        for index, row in enumerate(_datas):
            row_number = index + 2
            for col_num, value in enumerate(row):
                cell = self.worksheet.cell(row=row_number, column=col_num + 1)
                if value is not None:
                    cell.value = value
                else:
                    cell.value = ""
                if len(headers) > col_num:
                    header = headers[col_num]
                    format = get_cell_format(header)
                    if format is not None:
                        cell.number_format = format
526759
def render(cls, obj):
        
        class_hierarchy = inspect.getmro(type(obj))
        hooks = []
        for _, type_hooks in cls._display_hooks.items():
            for cls in class_hierarchy:
                if cls in type_hooks:
                    hooks.append(type_hooks[cls])
                    break

        data, metadata = {}, {}
        for hook in hooks:
            ret = hook(obj)
            if ret is None:
                continue
            d, md = ret
            data.update(d)
            metadata.update(md)
        return data, metadata
383157
private void doPaintRows(final WDataTable table, final WebXmlRenderContext renderContext) {
		TableDataModel model = table.getDataModel();
		WRepeater repeater = table.getRepeater();
		List<?> beanList = repeater.getBeanList();
		final int rowCount = beanList.size();
		WComponent row = repeater.getRepeatedComponent();

		for (int i = 0; i < rowCount; i++) {
			if (model instanceof TreeTableDataModel) {
				Integer nodeIdx = (Integer) beanList.get(i);
				TableTreeNode node = ((TreeTableDataModel) model).getNodeAtLine(nodeIdx);

				if (node.getLevel() != 1) {
					// Handled by the layout, so don't paint the row.
					continue;
				}
			}

			// Each row has its own context. This is why we can reuse the same
			// WComponent instance for each row.
			UIContext rowContext = repeater.getRowContext(beanList.get(i), i);

			UIContextHolder.pushContext(rowContext);

			try {
				row.paint(renderContext);
			} finally {
				UIContextHolder.popContext();
			}
		}
	}
439016
async function(row, col, event) {
        if (this.isTreeCol(col)) {
            let isShift = false;
            if (event.primitiveEvent.detail.primitiveEvent) {
                isShift = !!event.primitiveEvent.detail.primitiveEvent.shiftKey; // typecast to boolean
            }
            let is_expanded = await this._view.get_row_expanded(row);
            if (isShift) {
                if (is_expanded) {
                    if (this.data[row][col].rowPath.length === 1) {
                        this._view.collapse(row);
                    } else {
                        this._view.set_depth(this.data[row][col].rowPath.length - 2);
                    }
                } else {
                    this._view.set_depth(this.data[row][col].rowPath.length - 1);
                }
            } else {
                if (is_expanded) {
                    this._view.collapse(row);
                } else {
                    this._view.expand(row);
                }
            }
            let nrows = await this._view.num_rows();
            this.setDirty(nrows);
            this.grid.canvas.paintNow();
        }
    }
463698
function renderContent(data, context, parentView, key, isLayout, onRender) {
		// Render template against data as a tree of subviews (nested rendered template instances), or as a string (top-level template).
		// If the data is the parent view, treat as layout template, re-render with the same data context.
		var i, l, dataItem, newView, childView, itemResult, props, swapContent, tagCtx, tag_, outerOnRender, tmplName,
			self = this,
			tmpl = self,
			allowDataLink = !self.attr || self.attr === "html",
			result = "";

		if (key === TRUE) {
			swapContent = TRUE;
			key = 0;
		}
		if (self._is === "tag") {
			tag_ = self._;
			tmplName = self.tagName;
			tagCtx = self.tagCtx;
			// This is a call from renderTag
			tmpl = tagCtx.isElse ? tag_.elses[tagCtx.isElse-1] : tag_.tmpl;
			context = extendCtx(context, self.ctx);
			props = tagCtx.props;
			if ( props.link === FALSE ) {
				// link=false setting on block tag
				// We will override inherited value of link by the explicit setting link=false taken from props
				// The child views of an unlinked view are also unlinked. So setting child back to true will not have any effect.
				context =  context || {};
				context.link = FALSE;
			}
			parentView = parentView || tagCtx.view;
			data = data === undefined ?  parentView : data;
		} else {
			tmpl = self.jquery && (self[0] || error('Unknown template: "' + self.selector + '"')) // This is a call from $(selector).render
				|| self;
		}
		if (tmpl) {
			if (parentView) {
				onRender = onRender || parentView._.onRender;
				if (data === parentView) {
					// Inherit the data from the parent view.
					// This may be the contents of an {{if}} block
					// Set isLayout = true so we don't iterate the if block if the data is an array.
					data = parentView.data;
					isLayout = TRUE;
				}
				context = extendCtx(context, parentView.ctx);
			} else {
				(context = context || {}).root = data; // Provide ~root as shortcut to top-level data.
			}

			// Set additional context on views created here, (as modified context inherited from the parent, and to be inherited by child views)
			// Note: If no jQuery, $extend does not support chained copies - so limit extend() to two parameters

			if (!tmpl.fn) {
				tmpl = $templates[tmpl] || $templates(tmpl);
			}

			if (tmpl) {
				onRender = (context && context.link) !== FALSE && allowDataLink && onRender;
				// If link===false, do not call onRender, so no data-linking marker nodes
				outerOnRender = onRender;
				if (onRender === TRUE) {
					// Used by view.refresh(). Don't create a new wrapper view.
					outerOnRender = undefined;
					onRender = parentView._.onRender;
				}
				if ($.isArray(data) && !isLayout) {
					// Create a view for the array, whose child views correspond to each data item. (Note: if key and parentView are passed in
					// along with parent view, treat as insert -e.g. from view.addViews - so parentView is already the view item for array)
					newView = swapContent ? parentView : (key !== undefined && parentView) || View(context, "array", parentView, data, tmpl, key, onRender);
					for (i = 0, l = data.length; i < l; i++) {
						// Create a view for each data item.
						dataItem = data[i];
						childView = View(context, "item", newView, dataItem, tmpl, (key || 0) + i, onRender);
						itemResult = tmpl.fn(dataItem, childView, $views);
						result += newView._.onRender ? newView._.onRender(itemResult, childView) : itemResult;
					}
				} else {
					// Create a view for singleton data object. The type of the view will be the tag name, e.g. "if" or "myTag" except for
					// "item", "array" and "data" views. A "data" view is from programatic render(object) against a 'singleton'.
					newView = swapContent ? parentView : View(context, tmplName||"data", parentView, data, tmpl, key, onRender);
					if (tag_ && !self.flow) {
						newView.tag = self;
					}
					result += tmpl.fn(data, newView, $views);
				}
				return outerOnRender ? outerOnRender(result, newView) : result;
			}
		}
		return "";
	}
278549
protected void paintRows(final WRepeater repeater, final WebXmlRenderContext renderContext) {
		List<?> beanList = repeater.getBeanList();
		WComponent row = repeater.getRepeatedComponent();

		for (int i = 0; i < beanList.size(); i++) {
			Object rowData = beanList.get(i);

			// Each row has its own context. This is why we can reuse the same
			// WComponent instance for each row.
			UIContext rowContext = repeater.getRowContext(rowData, i);
			UIContextHolder.pushContext(rowContext);

			try {
				row.paint(renderContext);
			} finally {
				UIContextHolder.popContext();
			}
		}
	}
944090
function render(){

	ll('Render start...');

	ll('nodes: ' + bbop.dump(nodes));
	// ll('matrix: ' + dump(matrix));
	ll('val_hash: ' + bbop.dump(val_hash));
	ll('max_val: ' + bbop.dump(max_val));

	var haxis = f2;
	var hhead = global_facet2;
	var vaxis = f1;
	var vhead = global_facet1;
	// Figure out which axis is the longer one and switch.
	// if( vaxis.length > haxis.length ){
	//     haxis = f1;
	//     vaxis = f2;	    
	//     vhead = global_facet1;
	//     hhead = global_facet2;
	// }

	var td_id_to_data = {};
	function _assemble_table(haxis, vaxis){
	    ll('try to _assemble_table...');
	    
	    // Start assembling the table parts.	
	    var thead = new html.tag('thead');
	    
	    // Add what we want in the header row.
	    var head = '';
	    var title_list = [head];
	    us.each(haxis, function(hline){
		var ht = hline[0];
		title_list.push(ht);
	    });
	    // Push the header row into thead.
	    us.each(title_list, function(title_item){
		thead.add_to('<th>' + title_item +
			     '<img style="border: 0px;" src="' +
			     sd.image_base + '/reorder.gif" />' +
			     '</th>');
	    });
	    
	    var tbody = new html.tag('tbody');
	    
	    // Add the rows.
	    us.each(vaxis, function(vline){
		var vt = vline[0];
		
		// Header row.
		var rhead = '<td style="background-color:#e9effa"><b>' +
			vt + '</b></td>';
		var row = [rhead];
		
		// Data rows.
		us.each(haxis, function(hline){
		    var ht = hline[0];
		    var cell_val = val_hash[vt][ht];
		    
		    var color = value_to_color(cell_val);
		    
		    // Data entry.
		    var td_attrs = {
			style: 'background-color:' +color + ';',
			title: vt +', '+ ht +': '+ cell_val,
			'class': 'bbop-js-tooltip',
			generate_id: true
		    };
		    var td = new html.tag('td', td_attrs, cell_val);
		    row.push(td.to_string());
		    
		    // Now save the data for later callback
		    // generation.
		    td_id_to_data[td.get_id()] = {
			x: ht,
			y: vt,
			z: cell_val
		    };
		});
		
		tbody.add_to('<tr>' + row.join('') + '</tr>');
	    });

	    //var tbl = new html.table(title_list);
	    var table_attrs = {
		'generate_id': true,
		'class': 'table' // bs3
	    };
	    var table = new html.tag('table', table_attrs);
	    table.add_to(thead);
	    table.add_to(tbody);

	    return table;
	}

	// Add table and sorting to DOM.
	jQuery(results_head).append(vhead + ' &#92; ' + hhead);
	var table_a = _assemble_table(haxis, vaxis);
	jQuery(results_div).append(table_a.to_string());
	jQuery('#' + table_a.get_id()).tablesorter();

	// Add tooltips.
	//var tt_args = {'position': {'my': 'left bottom', 'at': 'right top'}};
	var tt_args = {
	    'position': {'my': 'center bottom-5', 'at': 'center top'},
	    'tooltipClass': 'amigo-searchbar-tooltip-style'
	};
	jQuery('.bbop-js-tooltip').tooltip(tt_args);

	//
	ll('Completed render!');
	ll('Done!');
    }
37861
function defaultRenderer (data, callback) {

    linz.api.views.renderPartial('action-record', data, (err, html) => {

        if (err) {
            return callback(err);
        }

        return callback(null, html);

    });

}
690033
def render(self, rect, data):
        """"""
        size = self.get_minimum_size(data)

        # Find how much extra space we have.
        extra_width = rect.w - size.x
        extra_height = rect.h - size.y

        # Distribute the extra space into the correct rows and columns.
        if self.scaling_col is None or not 0 <= self.scaling_col < self.cols:
            width_per_col = extra_width / float(self.cols)
            col_widths = [
                width + width_per_col
                for width in self.col_widths
                ]
        else:
            col_widths = self.col_widths[:]
            col_widths[self.scaling_col] += extra_width

        if self.scaling_row is None or not 0 <= self.scaling_row < self.rows:
            height_per_row = extra_height / float(self.rows)
            row_heights = [
                height + height_per_row
                for height in self.row_heights
                ]
        else:
            row_heights = self.row_heights[:]
            row_heights[self.scaling_row] += extra_height

        # Find the (start, end) positions of each row and column.
        col_xs = []
        last_x = rect.left + self.outside_margin
        for width in col_widths:
            col_xs.append((last_x, last_x + width))
            last_x += width + self.margin
        row_ys = []
        last_y = rect.top - self.outside_margin
        for height in row_heights:
            row_ys.append((last_y, last_y - height))
            last_y -= height + self.margin

        # Now we can loop over the elements and have them rendered.
        for col, row, cols, rows, element in self.elements:
            x_start = col_xs[col][0]
            y_start = row_ys[row][0]
            x_end = col_xs[col+cols-1][1]
            y_end = row_ys[row+rows-1][1]
            element.render(datatypes.Rectangle(
                x_start, y_end, x_end-x_start, y_start-y_end
                ), data)

        # And finally we can draw the rules
        def _get_value(array, index, sign):
            """Returns the value of the index in the given array, where
            the array (like col_xs and row_ys), consists of start-end pairs
            of values."""
            if index <= 0:
                # Special case, it is the start of the first range
                return array[0][0]-self.outside_margin*sign
            elif index >= len(array):
                # Special case, it is the end of the last range
                return array[-1][1]+self.outside_margin*sign
            else:
                # Otherwise it is the blend of a start and end.
                return (array[index-1][1] + array[index][0])*0.5

        for start_col, start_row, end_col, end_row, width, color in self.rules:
            x_start = _get_value(col_xs, start_col, 1)
            y_start = _get_value(row_ys, start_row, -1)
            x_end = _get_value(col_xs, end_col, 1)
            y_end = _get_value(row_ys, end_row, -1)
            data['output'].line(
                x_start, y_start, x_end, y_end,
                stroke=color,
                stroke_width=width
                )
1243072
function ()
	{
		var that    = this;
		var dt      = this.s.dt;
		var details = this.c.details;

		// The inline type always uses the first child as the target
		if ( details.type === 'inline' ) {
			details.target = 'td:first-child';
		}

		// type.target can be a string jQuery selector or a column index
		var target   = details.target;
		var selector = typeof target === 'string' ? target : 'td';

		// Click handler to show / hide the details rows when they are available
		$( dt.table().body() ).on( 'click', selector, function (e) {
			// If the table is not collapsed (i.e. there is no hidden columns)
			// then take no action
			if ( ! $(dt.table().node()).hasClass('collapsed' ) ) {
				return;
			}

			// Check that the row is actually a DataTable's controlled node
			if ( ! dt.row( $(this).closest('tr') ).length ) {
				return;
			}

			// For column index, we determine if we should act or not in the
			// handler - otherwise it is already okay
			if ( typeof target === 'number' ) {
				var targetIdx = target < 0 ?
					dt.columns().eq(0).length + target :
					target;

				if ( dt.cell( this ).index().column !== targetIdx ) {
					return;
				}
			}

			// $().closest() includes itself in its check
			var row = dt.row( $(this).closest('tr') );

			if ( row.child.isShown() ) {
				row.child( false );
				$( row.node() ).removeClass( 'parent' );
			}
			else {
				var info = that.c.details.renderer( dt, row[0] );
				row.child( info, 'child' ).show();
				$( row.node() ).addClass( 'parent' );
			}
		} );
	}
1327267
def render(self, ctx=None):
        '''
        
        '''
        if ctx is None:
            ctx = RenderContext()
        ctx.push(self)
        self._initialize()
        offset = self.offset if self.offset else 0
        if self._mutating():
            field_idx = self._field_idx
        else:
            key_field = self.resolve_field(self._key_field)
            key_from_key_field = key_field._current_value
            if key_from_key_field in self._keys:
                field_idx = self._keys.index(key_from_key_field)
            else:
                field_idx = 0  # default value
        self._fields[field_idx].set_offset(offset)
        rendered = self._fields[field_idx].render(ctx)
        self.set_current_value(rendered)
        ctx.pop()
        return self._current_rendered
887423
function ()
	{
		var that = this;
		var dt = this.s.dt;

		// Find how many columns are hidden
		var hiddenColumns = dt.columns().indexes().filter( function ( idx ) {
			var col = dt.column( idx );

			if ( col.visible() ) {
				return null;
			}

			// Only counts as hidden if it doesn't have the `never` class
			return $( col.header() ).hasClass( 'never' ) ? null : idx;
		} );
		var haveHidden = true;

		if ( hiddenColumns.length === 0 || ( hiddenColumns.length === 1 && this.s.columns[ hiddenColumns[0] ].control ) ) {
			haveHidden = false;
		}

		if ( haveHidden ) {
			// Show all existing child rows
			dt.rows( { page: 'current' } ).eq(0).each( function (idx) {
				var row = dt.row( idx );

				if ( row.child() ) {
					var info = that.c.details.renderer( dt, row[0] );

					// The renderer can return false to have no child row
					if ( info === false ) {
						row.child.hide();
					}
					else {
						row.child( info, 'child' ).show();
					}
				}
			} );
		}
		else {
			// Hide all existing child rows
			dt.rows( { page: 'current' } ).eq(0).each( function (idx) {
				dt.row( idx ).child.hide();
			} );
		}
	}
792053
function render(template, locals, layoutTemplates, cb) {
    if (!layoutTemplates) layoutTemplates = [];

    // We'll render templates from bottom to top of the stack, each template
    // being passed the rendered string of the previous ones as `body`
    var i = layoutTemplates.length - 1;

    var _stackRenderer = function(err, htmlStr) {
      if (err) return cb(err);

      if (i >= 0) {
        locals.body = htmlStr;
        renderTemplate(layoutTemplates[i--], locals, _stackRenderer);
      } else {
        cb(null, htmlStr);
      }
    };

    // Start the rendering with the innermost page template
    renderTemplate(template, locals, _stackRenderer);
  }
357993
public function render(Row $row)
	{
		/**
		 * Renderer function may be used
		 */
		try {
			return $this->useRenderer($row);
		} catch (DataGridColumnRendererException $e) {
			/**
			 * Do not use renderer
			 */
		}

		$value = parent::render($row);

		if (!$value && !$this->icon) {
			return null;
		}

		$a = Html::el('a')
			->href($this->createLink(
				$this->grid,
				$this->href,
				$this->getItemParams($row, $this->params) + $this->parameters
			));

		if (!empty($this->data_attributes)) {
			foreach ($this->data_attributes as $key => $attr_value) {
				$a->data($key, $attr_value);
			}
		}

		if ($this->open_in_new_tab) {
			$a->addAttributes(['target' => '_blank']);
		}

		if ($this->title) {
			$a->title($this->title);
		}
		if ($this->class) {
			$a->class($this->class);
		}

		$element = $a;

		if ($this->icon) {
			$a->addHtml(Html::el('span')->class(DataGrid::$icon_prefix . $this->icon));

			if (strlen($value)) {
				$a->addHtml('&nbsp;');
			}
		}

		if ($this->isTemplateEscaped()) {
			$a->addText($value);
		} else {
			$a->addHtml($value);
		}

		return $element;
	}
777025
function(ev) {
    if (ev.output.hidden) {
      return;
    }

    var template = this.commandDom.cloneNode(true);
    var templateOptions = { stack: 'terminal.html#outputView' };

    var context = this.requisition.conversionContext;
    var data = {
      onclick: context.update,
      ondblclick: context.updateExec,
      language: this,
      output: ev.output,
      promptClass: (ev.output.error ? 'gcli-row-error' : '') +
                   (ev.output.completed ? ' gcli-row-complete' : ''),
      // Elements attached to this by template().
      rowinEle: null,
      rowoutEle: null,
      throbEle: null,
      promptEle: null
    };

    domtemplate.template(template, data, templateOptions);

    ev.output.promise.then(function() {
      var document = data.rowoutEle.ownerDocument;

      if (ev.output.completed) {
        data.promptEle.classList.add('gcli-row-complete');
      }
      if (ev.output.error) {
        data.promptEle.classList.add('gcli-row-error');
      }

      util.clearElement(data.rowoutEle);

      return ev.output.convert('dom', context).then(function(node) {
        this.terminal.scrollToBottom();
        data.throbEle.style.display = ev.output.completed ? 'none' : 'block';

        if (node == null) {
          data.promptEle.classList.add('gcli-row-error');
          // TODO: show some error to the user
        }

        this._linksToNewTab(node);
        data.rowoutEle.appendChild(node);

        var event = document.createEvent('Event');
        event.initEvent('load', true, true);
        event.addedElement = node;
        node.dispatchEvent(event);
      }.bind(this));
    }.bind(this)).catch(console.error);

    this.terminal.addElement(data.rowinEle);
    this.terminal.addElement(data.rowoutEle);
    this.terminal.scrollToBottom();

    this.focusManager.outputted();
  }
1128006
private void paintRows(final WTable table, final WebXmlRenderContext renderContext) {
		XmlStringBuilder xml = renderContext.getWriter();
		TableModel model = table.getTableModel();

		xml.appendTagOpen("ui:tbody");
		xml.appendAttribute("id", table.getId() + ".body");
		xml.appendClose();

		if (model.getRowCount() == 0) {
			xml.appendTag("ui:nodata");
			xml.appendEscaped(table.getNoDataMessage());
			xml.appendEndTag("ui:nodata");
		} else {
			// If has at least one visible col, paint the rows.
			final int columnCount = table.getColumnCount();

			for (int i = 0; i < columnCount; i++) {
				if (table.getColumn(i).isVisible()) {
					doPaintRows(table, renderContext);
					break;
				}
			}
		}

		xml.appendEndTag("ui:tbody");
	}