How to use the beakerx.beakerx.plot.plotitem.XYGraphics function in beakerx

To help you get started, we’ve selected a few beakerx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twosigma / beakerx / beakerx / beakerx / plot / plotitem.py View on Github external
self.display_name = getValue(kwargs, 'displayName')
        self.lod_filter = getValue(kwargs, 'lodFilter')
        self.tooltips = getValue(kwargs, 'tooltips')


class Line(XYGraphics):
    def __init__(self, *args, **kwargs):
        super(Line, self).__init__(*args, **kwargs)
        self.width = getValue(kwargs, 'width', 1.5)
        self.style = getValue(kwargs, 'style')
        self.interpolation = getValue(kwargs, 'interpolation')
        self.color = getColor(getValue(kwargs, 'color'))


class BasedXYGraphics(XYGraphics):
    def __init__(self, *args, **kwargs):
        super(BasedXYGraphics, self).__init__(*args, **kwargs)
        base = getValue(kwargs, 'base')
        if isinstance(base, list):
            self.bases = base
        else:
            self.bases = getValue(kwargs, 'base', 0)


class Bars(BasedXYGraphics):
    def __init__(self, *args, **kwargs):
        super(Bars, self).__init__(*args, **kwargs)

        width = getValue(kwargs, 'width')
        if isinstance(width, list):
            self.widths = width
github twosigma / beakerx / beakerx / beakerx / plot / plotitem.py View on Github external
else:
                    self.x[idx] = x

        self.y = defY
        if self.y is not None:
            for idx in range(len(self.y)):
                y = self.y[idx]
                if isinstance(y, float) and math.isnan(y):
                    self.y[idx] = "NaN"

        self.display_name = getValue(kwargs, 'displayName')
        self.lod_filter = getValue(kwargs, 'lodFilter')
        self.tooltips = getValue(kwargs, 'tooltips')


class Line(XYGraphics):
    def __init__(self, *args, **kwargs):
        super(Line, self).__init__(*args, **kwargs)
        self.width = getValue(kwargs, 'width', 1.5)
        self.style = getValue(kwargs, 'style')
        self.interpolation = getValue(kwargs, 'interpolation')
        self.color = getColor(getValue(kwargs, 'color'))


class BasedXYGraphics(XYGraphics):
    def __init__(self, *args, **kwargs):
        super(BasedXYGraphics, self).__init__(*args, **kwargs)
        base = getValue(kwargs, 'base')
        if isinstance(base, list):
            self.bases = base
        else:
            self.bases = getValue(kwargs, 'base', 0)
github twosigma / beakerx / beakerx / beakerx / plot / plotitem.py View on Github external
self.width = width

        color = getColor(getValue(kwargs, 'color'))
        if isinstance(color, list):
            self.colors = color
        else:
            self.color = color

        outlineColor = getColor(getValue(kwargs, 'outlineColor'))
        if isinstance(outlineColor, list):
            self.outline_colors = outlineColor
        else:
            self.outline_color = outlineColor


class Points(XYGraphics):
    def __init__(self, *args, **kwargs):
        super(Points, self).__init__(*args, **kwargs)

        shape = getColor(getValue(kwargs, 'shape'))
        if isinstance(shape, list):
            self.shapes = shape
        else:
            self.shape = getValue(kwargs, 'shape', ShapeType.DEFAULT)

        size = getColor(getValue(kwargs, 'size'))
        if isinstance(size, list):
            self.sizes = size
        else:
            self.size = getValue(kwargs, 'size', 6)

        fill = getColor(getValue(kwargs, 'fill'))
github twosigma / beakerx / beakerx / beakerx / plot / plotitem.py View on Github external
def __init__(self, *args, **kwargs):
        super(XYGraphics, self).__init__(**kwargs)
        if len(args) > 0 and isinstance(args[0], pd.Series):
            defX = args[0].index.tolist()
            defY = args[0].tolist()
        else:
            defY = getValue(kwargs, 'y')

            if defY is not None:
                if isinstance(defY, pd.Series) or isinstance(defY, np.ndarray):
                    defY = defY.tolist()
                defX = list(range(0, len(defY)))
            else:
                defX = []

        local_x = getValue(kwargs, 'x', defX)

        if local_x is not None: