def realizeSymbol(self, pp, grp, arp, symbol, annotation, onY2, clipPlotArea, clipDecoratedChart, drawMainSymbol, x, y, prevX, prevY, nextX, nextY):

        if (Double.NaN==(x))  or  (Double.NaN==(y)):
            # this point undefined (isNaN)
            return

        # else point itself is at least defined

        spacing = symbol.getFillSpacing()
        thickness = symbol.getFillThickness()
        canvas = grp.getCanvas()

        if 0 == spacing  and  None != canvas  and  thickness > 0:
            # when canvas is available and continuous fill requested,
            # BOX_CENTER and LINE work exactly the same way
            BOX_CENTER.realizeSymbol(
                    pp, grp, arp, symbol, annotation,
                    onY2,  clipPlotArea, clipDecoratedChart, drawMainSymbol,
                    x,  y, prevX,  prevY, nextX,  nextY)
            return


        xPx = pp.xToPixel(x)
        yPx = pp.yToPixel(y, onY2)
        nextXPx = pp.xToPixel(nextX)
        nextYPx = pp.yToPixel(nextY, onY2)

        # next point defined
        # not a zero thickness connection
        if (not Double.NaN==(nextX))  and  (not Double.NaN==(nextY))  and   thickness > 0  and    (x!=nextX  or  y!=nextY):
            # this/next point not overlayed
            # draw HTML-element rendered line segment

            # Continuous fill not supported; 1px is reasonable approx.
            if 0 == spacing:
                spacing = 1

            deltaX = nextXPx - xPx
            deltaY = nextYPx - yPx
            dXIsShorter = deltaX*deltaX < deltaY*deltaY
            # increasing width by 1 adds half px on each edge
            # to heal the occasional roundoff-induced gap
            EPS = 1
            # TODO: the case in which the connecting line does not intersect the
            # plot area, and off-plot-area points are not being drawn is handled
            # very inefficiently, and not entirely correctly, by trying to draw
            # the entire line and excluding each segment as we attempt to draw it.
            # Need to compute intersecting sub-line-segment and just draw that
            # instead, ignoring lines with no intersecting segments completely. Can
            # make a huge difference with lots of off-chart points, such as a
            # deliberately narrowed x axis range.
            if deltaX == 0:
                # special-case of vertical line

                self.realizeOneImageOfSymbol(pp, grp, arp, symbol, None,
                                        onY2,
                                        clipPlotArea,
                                        clipDecoratedChart,
                                        xPx,
                                        0.5*(yPx+nextYPx),
                                        Double.NaN, Double.NaN,
                                        nextXPx, nextYPx,
                                        thickness,
                                        abs(nextYPx - yPx)+EPS)

            elif deltaY == 0:
                # special case of horizontal line

                self.realizeOneImageOfSymbol(pp, grp, arp, symbol, None,
                                        onY2,
                                        clipPlotArea,
                                        clipDecoratedChart,
                                        0.5*(xPx+nextXPx),
                                        yPx,
                                        Double.NaN, Double.NaN,
                                        nextXPx, nextYPx,
                                        abs(nextXPx - xPx)+EPS,
                                        thickness)

            elif dXIsShorter:
                # series of vertical segments
                xMin = min(xPx, nextXPx)
                xMax = max(xPx, nextXPx)
                yAtXMin = min(xPx, nextXPx)
                yAtXMax = max(xPx, nextXPx)

                xiPrev = xMin
                yiPrev = yAtXMin
                xi = xiPrev
                yi = yiPrev
                # round up to err on side of providing more detail
                N = int (math.ceil((xMax-xMin)/spacing))
                dy = abs((yAtXMax - yAtXMin)/N)+EPS
                for i in range(1, N):
                    xi = xMin + i*(xMax - xMin)/N
                    yi = yAtXMin + i * (yAtXMax - yAtXMin)/N
                    self.realizeOneImageOfSymbol(pp, grp, arp, symbol, None,
                                            onY2,
                                            clipPlotArea,
                                            clipDecoratedChart,
                                            0.5*(xiPrev+xi), 0.5*(yiPrev+yi),
                                            Double.NaN, Double.NaN,
                                            nextXPx, nextYPx,
                                            thickness, dy)
                    xiPrev = xi
                    yiPrev = yi


            else:
                # dY is shorter. Series of horizontal segments
                yMin = min(yPx, nextYPx)
                yMax = max(yPx, nextYPx)
                xAtYMin = min(yPx, nextYPx)
                xAtYMax = max(yPx, nextYPx)

                xiPrev = xAtYMin
                yiPrev = yMin
                xi = xiPrev
                yi = yiPrev
                N = int (math.ceil((yMax-yMin)/spacing))
                dx = abs((xAtYMax - xAtYMin)/N)+ EPS
                for i in range(1, N):
                    yi = yMin + i*(yMax - yMin)/N
                    xi = xAtYMin + i * (xAtYMax - xAtYMin)/N
                    self.realizeOneImageOfSymbol(pp, grp, arp, symbol, None,
                                            onY2,
                                            clipPlotArea,
                                            clipDecoratedChart,
                                            0.5*(xiPrev+xi),0.5*(yiPrev+yi),
                                            Double.NaN, Double.NaN,
                                            nextXPx, nextYPx,
                                            dx, thickness)
                    xiPrev = xi
                    yiPrev = yi




        # the "main" symbol (the one on the (x,y) point itself) is
        # rendered last to put it on top of interpolated images
        if drawMainSymbol:
            w = symbol.getWidth(pp)
            h = symbol.getHeight(pp, onY2)
            self.realizeOneImageOfSymbol(pp, grp, arp, symbol, annotation,
                                    onY2,
                                    clipPlotArea,
                                    clipDecoratedChart,
                                    xPx, yPx,
                                    Double.NaN, Double.NaN,
                                    nextXPx, nextYPx,
                                    w, h)

     # realizeSymbol
dataset/ETHPy150Open anandology/pyjamas/library/gwt/chart/SymbolType.py/LineSymbolType.realizeSymbol/original