Draws a box with p_min and p_max as corners. Don't forget to add 'await self._client.send_debug'.
484123
def debug_box_out(self, p_min: Union[Unit, Point2, Point3], p_max: Union[Unit, Point2, Point3], color=None):
        
        self._debug_boxes.append(
            debug_pb.DebugBox(
                min=self.to_debug_point(p_min), max=self.to_debug_point(p_max), color=self.to_debug_color(color)
            )
        )
185518
def draw(self, img, pixmapper, bounds):
        ''''''
        if self.hidden:
            return
        self._pix_points = []
        for i in range(len(self.points)-1):
            if len(self.points[i]) > 2:
                colour = self.points[i][2]
            else:
                colour = self.colour
            self.draw_line(img, pixmapper, self.points[i], self.points[i+1],
                           colour, self.linewidth)
390094
def _draw_cursor(self, dc, grid, row, col,
                     pen=None, brush=None):
        """"""

        # If in full screen mode draw no cursor
        if grid.main_window.IsFullScreen():
            return

        key = row, col, grid.current_table
        rect = grid.CellToRect(row, col)
        rect = self.get_merged_rect(grid, key, rect)

        # Check if cell is invisible
        if rect is None:
            return

        size = self.get_zoomed_size(1.0)

        caret_length = int(min([rect.width, rect.height]) / 5.0)

        color = get_color(config["text_color"])
        if pen is None:
          pen = wx.Pen(color)
        if brush is None:
          brush = wx.Brush(color)

        pen.SetWidth(size)

        # Inner right and lower borders
        border_left = rect.x + size - 1
        border_right = rect.x + rect.width - size - 1
        border_upper = rect.y + size - 1
        border_lower = rect.y + rect.height - size - 1

        points_lr = [
            (border_right, border_lower - caret_length),
            (border_right, border_lower),
            (border_right - caret_length, border_lower),
            (border_right, border_lower),
        ]

        points_ur = [
            (border_right, border_upper + caret_length),
            (border_right, border_upper),
            (border_right - caret_length, border_upper),
            (border_right, border_upper),
        ]

        points_ul = [
            (border_left, border_upper + caret_length),
            (border_left, border_upper),
            (border_left + caret_length, border_upper),
            (border_left, border_upper),
        ]

        points_ll = [
            (border_left, border_lower - caret_length),
            (border_left, border_lower),
            (border_left + caret_length, border_lower),
            (border_left, border_lower),
        ]

        point_list = [points_lr, points_ur, points_ul, points_ll]

        dc.DrawPolygonList(point_list, pens=pen, brushes=brush)

        self.old_cursor_row_col = row, col
970315
function (zMin, zMax, minSize, maxSize) {
		var len,
			i,
			pos,
			zData = this.zData,
			radii = [],
			sizeByArea = this.options.sizeBy !== 'width',
			zRange;
		
		// Set the shape type and arguments to be picked up in drawPoints
		for (i = 0, len = zData.length; i < len; i++) {
			zRange = zMax - zMin;
			pos = zRange > 0 ? // relative size, a number between 0 and 1
				(zData[i] - zMin) / (zMax - zMin) : 
				0.5;
			if (sizeByArea && pos >= 0) {
				pos = Math.sqrt(pos);
			}
			radii.push(math.ceil(minSize + pos * (maxSize - minSize)) / 2);
		}
		this.radii = radii;
	}
282630
def bounding_box(obj):
    '''
    '''
    return np.array([np.min(obj.points[:, 0:3], axis=0),
                     np.max(obj.points[:, 0:3], axis=0)])
861086
public static Element drawFrame(SVGPlot svgp, Projection2D proj, SpatialComparable box) {
    SVGPath path = new SVGPath();
    ArrayList<double[]> edges = getVisibleEdges(proj, box);
    final int dim = box.getDimensionality();
    double[] min = new double[dim];
    for(int i = 0; i < dim; i++) {
      min[i] = box.getMin(i);
    }
    double[] rv_min = proj.fastProjectDataToRenderSpace(min);
    recDrawEdges(path, rv_min[0], rv_min[1], edges, BitsUtil.zero(edges.size()));
    return path.makeElement(svgp);
  }
850666
def calculate_bounding_box(data):
    
    mins = data.min(0)
    maxes = data.max(0)
    return mins, maxes
523989
def draw_icon(point, icon)
      x, y = point.pixel(@bounding_box)
      icon.draw(@canvas, x, y)
    end
798744
function drawBadCells(cells) {
  var context = c.getContext('2d');
  var canvas = c; // from global.
  // Drawing bad cells
  var draw_loc = {x: 0, y: 0};
  for (var i = 0; i < cells.length; i++) {
    var cell_info = cells[i];
    var cell = cell_info[0];
    var matched_entrances = cell_info[1];
    var matched_exits = cell_info[2]

    // Write information.
    context.fillStyle = 'black';
    context.fillText(cell.toString(), draw_loc.x + 5, draw_loc.y + 10)
    context.fillText("ents:" + matched_entrances.length, draw_loc.x + 5, draw_loc.y + 20)
    context.fillText("exts:" + matched_exits.length, draw_loc.x + 5, draw_loc.y + 35)

    drawCell(cell, canvas, {x: draw_loc.x + text_width, y: draw_loc.y});
    // Increment drawing location.
    if ((i % 5) == 4) {
      draw_loc = {x: 0, y: draw_loc.y + total_width};
    } else {
      draw_loc = {x: draw_loc.x + total_width, y: draw_loc.y};
    }
  }
}
501351
function draw(c, frame)
{
    const pixels = frame.data
    for (let y = 0; y < frame.height; y++)
    {
        for (let x = 0; x < frame.width; x++)
        {
            const color = pixels[x + y * frame.width]
            if (typeof color !== 'undefined')
            {
                let hex = color.toString(16)
                while (hex.length < 6)
                {
                    hex = '0' + hex
                }
                c.fillStyle = '#' + hex
                c.beginPath()
                c.fillRect(x, y, 1, 1)
            }
        }
    }
}
1152567
protected void renderDebugBoundingBoxOuter(Graphics2D context) {
		java.awt.Color previousColor = context.getColor();
		context.setColor(java.awt.Color.RED);
		Rectangle2D bb = getBoundingBox();
		bb.setRect(bb.getX()-1, bb.getY()-1, bb.getWidth()+2, bb.getHeight()+2);
		context.draw(bb);
		context.setColor(previousColor);
	}
978650
def drawBezier(self, p1, p2, p3, p4):
        
        p1 = Point(p1)
        p2 = Point(p2)
        p3 = Point(p3)
        p4 = Point(p4)
        if not (self.lastPoint == p1):
            self.draw_cont += "%g %g m\n" % JM_TUPLE(p1 * self.ipctm)
        self.draw_cont += "%g %g %g %g %g %g c\n" % JM_TUPLE(list(p2 * self.ipctm) + \
                                                          list(p3 * self.ipctm) + \
                                                          list(p4 * self.ipctm))
        self.updateRect(p1)
        self.updateRect(p2)
        self.updateRect(p3)
        self.updateRect(p4)
        self.lastPoint = p4
        return self.lastPoint
371733
function _drawBound (side, dist) {
        dist += 'px';
        switch (side) {
            case 'top':
                $('.boundary-top').css({
                    top: dist,
                    height: dist,
                    marginTop: '-' + dist
                });
                break;

            case 'right':
                $('.boundary-right').css({
                    right: dist,
                    width: dist,
                    marginRight: '-' + dist
                });
                break;

            case 'bottom':
                $('.boundary-bottom').css({
                    bottom: dist,
                    height: dist,
                    marginBottom: '-' + dist
                });
                break;

            case 'left':
                $('.boundary-left').css({
                    left: dist,
                    width: dist,
                    marginLeft: '-' + dist
                });
                break;

            default:
                break;
        }
    }
341552
private void draw() throws IOException { // NOPMD
		assert x == 0;
		final double myPercent = Math.max(Math.min(percentValue, 100d), 0d);
		final int fullBlockCount = (int) Math.floor(myPercent / (UNIT_SIZE * PARTIAL_BLOCKS));
		final int partialBlockIndex = (int) Math
				.floor((myPercent - fullBlockCount * UNIT_SIZE * PARTIAL_BLOCKS) / UNIT_SIZE);

		addImage(getBarImage(fullBlockCount > 0 || partialBlockIndex > 0 ? "a" : "a0"));

		final BufferedImage fullBody = getBarImage(String.valueOf(PARTIAL_BLOCKS));
		for (int i = 0; i < fullBlockCount; i++) {
			addImage(fullBody);
		}

		if (partialBlockIndex > 0) {
			final BufferedImage partialBody = getBarImage(String.valueOf(partialBlockIndex));
			addImage(partialBody);
		}

		final int emptyBlocks = FULL_BLOCKS - fullBlockCount - (partialBlockIndex > 0 ? 1 : 0);
		final BufferedImage emptyBody = getBarImage(String.valueOf(0));
		for (int i = 0; i < emptyBlocks; i++) {
			addImage(emptyBody);
		}

		addImage(getBarImage(fullBlockCount == FULL_BLOCKS ? "b" : "b0"));

		if (alertOnHighUsage) {
			x += 8;
			graphics.drawImage(getImage("alert.png"), x, 0, null);
		}
	}
649666
function _drawArrow(pStart, pEnd, arrowSize, color) {
        var p = new Primitive();
        p.color = toColor(color);

        p.vertices.push(pStart);
        p.vertices.push(pEnd);

        var dir = new THREE.Vector3();
        dir.subVectors(pEnd, pStart);
        dir.normalize();

        var right = new THREE.Vector3();
        var dot = dir.dot(UNIT_Y);
        if (dot > 0.99 || dot < -0.99) {
            right.crossVectors(dir, UNIT_X);
        } else {
            right.crossVectors(dir, UNIT_Y);
        }

        var top = new THREE.Vector3();
        top.crossVectors(right, dir);

        dir.multiplyScalar(arrowSize);
        right.multiplyScalar(arrowSize);
        top.multiplyScalar(arrowSize);

        // Right slant.
        var tmp = new THREE.Vector3();
        p.vertices.push(pEnd);
        p.vertices.push(tmp.addVectors(pEnd, right).sub(dir));

        // Left slant.
        tmp = new THREE.Vector3();
        p.vertices.push(pEnd);
        p.vertices.push(tmp.subVectors(pEnd, right).sub(dir));

        // Top slant.
        tmp = new THREE.Vector3();
        p.vertices.push(pEnd);
        p.vertices.push(tmp.addVectors(pEnd, top).sub(dir));

        // Bottom slant.
        tmp = new THREE.Vector3();
        p.vertices.push(pEnd);
        p.vertices.push(tmp.subVectors(pEnd, top).sub(dir));

        renderer.addPrimitive(p);
    }
771292
def _show_corners(self, image, corners):
        """"""
        temp = image
        cv2.drawChessboardCorners(temp, (self.rows, self.columns), corners,
                                  True)
        window_name = "Chessboard"
        cv2.imshow(window_name, temp)
        if cv2.waitKey(0):
            cv2.destroyWindow(window_name)
205957
def draw(self, **kwargs):
        
        # Set the axes aspect to be equal
        self.ax.set_aspect("equal")

        # Generate a mask for the upper triangle
        mask = np.zeros_like(self.ranks_, dtype=np.bool)
        mask[np.triu_indices_from(mask)] = True

        # Draw the heatmap
        # TODO: Move mesh to a property so the colorbar can be finalized
        data = np.ma.masked_where(mask, self.ranks_)
        mesh = self.ax.pcolormesh(data, cmap=self.colormap, vmin=-1, vmax=1)

        # Set the Axis limits
        self.ax.set(
            xlim=(0, data.shape[1]), ylim=(0, data.shape[0])
        )

        # Add the colorbar
        cb = self.ax.figure.colorbar(mesh, None, self.ax)
        cb.outline.set_linewidth(0)

        # Reverse the rows to get the lower left triangle
        self.ax.invert_yaxis()

        # Add ticks and tick labels
        self.ax.set_xticks(np.arange(len(self.ranks_)) + 0.5)
        self.ax.set_yticks(np.arange(len(self.ranks_)) + 0.5)
        if self.show_feature_names_:
            self.ax.set_xticklabels(self.features_, rotation=90)
            self.ax.set_yticklabels(self.features_)
        else:
            self.ax.set_xticklabels([])
            self.ax.set_yticklabels([])