def _build_draw_line(append, x_mapper, y_mapper):
    @ngjit
    def draw_line(vt, bounds, x0, y0, x1, y1, i, plot_start, clipped,
                  *aggs_and_cols):
        """Draw a line using Bresenham's algorithm"""
        sx, tx, sy, ty = vt
        # Project to pixel space
        x0i = int(x_mapper(x0) * sx + tx)
        y0i = int(y_mapper(y0) * sy + ty)
        x1i = int(x_mapper(x1) * sx + tx)
        y1i = int(y_mapper(y1) * sy + ty)

        dx = x1i - x0i
        ix = (dx > 0) - (dx < 0)
        dx = abs(dx) * 2

        dy = y1i - y0i
        iy = (dy > 0) - (dy < 0)
        dy = abs(dy) * 2

        if plot_start:
            append(i, x0i, y0i, *aggs_and_cols)

        if dx >= dy:
            # If vertices weren't clipped and are concurrent in integer space,
            # call append and return, as the second vertex won't be hit below.
            if not clipped and not (dx | dy):
                append(i, x0i, y0i, *aggs_and_cols)
                return
            error = 2*dy - dx
            while x0i != x1i:
                if error >= 0 and (error or ix > 0):
                    error -= 2 * dx
                    y0i += iy
                error += 2 * dy
                x0i += ix
                append(i, x0i, y0i, *aggs_and_cols)
        else:
            error = 2*dx - dy
            while y0i != y1i:
                if error >= 0 and (error or iy > 0):
                    error -= 2 * dy
                    x0i += ix
                error += 2 * dx
                y0i += iy
                append(i, x0i, y0i, *aggs_and_cols)

    return draw_line
Specialize a line plotting kernel for a given append/axis combination
dataset/ETHPy150Open bokeh/datashader/datashader/glyphs.py/_build_draw_line