How to use the beakerx.beakerx.plot.chart.TimePlot 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 / chart.py View on Github external
def __init__(self, **kwargs):
        super(TimePlot, self).__init__(**kwargs)
        self.chart.type = 'TimePlot'
github twosigma / beakerx / beakerx / beakerx / plot / chart.py View on Github external
for i in range(len(columnNames)):
                if i < len(colors):
                    chartColors.append(self.createChartColor(colors[i]))
        return chartColors
    
    def createChartColor(self, color):
        if isinstance(color, list):
            try:
                return Color(color[0], color[1], color[2])
            except  Exception:
                raise Exception("Color list too short")
        else:
            return color


class NanoPlot(TimePlot):
    def __init__(self, **kwargs):
        super(NanoPlot, self).__init__(**kwargs)
        self.chart.type = 'NanoPlot'
    
    def add(self, item):
        super(NanoPlot, self).add(item)
        for l in self.chart.graphics_list:
            converted = []
            for x in l.x:
                converted.append(str(x))
            l.x = converted
        self.model = self.chart.transform()
        return self


class SimpleTimePlot(TimePlot):
github twosigma / beakerx / beakerx / beakerx / plot / chart.py View on Github external
def add(self, item):
        super(NanoPlot, self).add(item)
        for l in self.chart.graphics_list:
            convertedx = []
            convertedy = []
            for x in l.x:
                convertedx.append(str(x))
            l.x = convertedx
            for y in l.y:
                convertedy.append(str(y))
            l.y = convertedy
        self.model = self.chart.transform()
        return self


class SimpleTimePlot(TimePlot):
    def __init__(self, *args, **kwargs):
        super(SimpleTimePlot, self).__init__(**kwargs)
        self.chart.type = 'TimePlot'
        self.use_tool_tip = True
        self.show_legend = True
        time_column_default = 'time'
        displayNames = getValue(kwargs, 'displayNames')
        displayLines = getValue(kwargs, 'displayLines', True)
        displayPoints = getValue(kwargs, 'displayPoints', False)
        colors = getValue(kwargs, 'colors')

        if len(args) > 0:
            tableData = args[0]
        else:
            tableData = []
github twosigma / beakerx / beakerx / beakerx / plot / chart.py View on Github external
def __init__(self, **kwargs):
        super(NanoPlot, self).__init__(**kwargs)
        self.chart.type = 'NanoPlot'
    
    def add(self, item):
        super(NanoPlot, self).add(item)
        for l in self.chart.graphics_list:
            converted = []
            for x in l.x:
                converted.append(str(x))
            l.x = converted
        self.model = self.chart.transform()
        return self


class SimpleTimePlot(TimePlot):
    def __init__(self, *args, **kwargs):
        super(SimpleTimePlot, self).__init__(**kwargs)
        self.chart.type = 'TimePlot'
        self.use_tool_tip = True
        self.show_legend = True
        time_column_default = 'time'
        displayNames = getValue(kwargs, 'displayNames')
        displayLines = getValue(kwargs, 'displayLines', True)
        displayPoints = getValue(kwargs, 'displayPoints', False)
        colors = getValue(kwargs, 'colors')
        
        if len(args) > 0:
            tableData = args[0]
        else:
            tableData = []
github twosigma / beakerx / beakerx / beakerx / plot / chart.py View on Github external
for i in range(len(columnNames)):
                if i < len(colors):
                    chartColors.append(self.createChartColor(colors[i]))
        return chartColors

    def createChartColor(self, color):
        if isinstance(color, list):
            try:
                return Color(color[0], color[1], color[2])
            except  Exception:
                raise Exception("Color list too short")
        else:
            return color


class NanoPlot(TimePlot):
    def __init__(self, **kwargs):
        super(NanoPlot, self).__init__(**kwargs)
        self.chart.type = 'NanoPlot'

    def add(self, item):
        super(NanoPlot, self).add(item)
        for l in self.chart.graphics_list:
            convertedx = []
            convertedy = []
            for x in l.x:
                convertedx.append(str(x))
            l.x = convertedx
            for y in l.y:
                convertedy.append(str(y))
            l.y = convertedy
        self.model = self.chart.transform()
github twosigma / beakerx / beakerx / beakerx / plot / chart.py View on Github external
def __init__(self, **kwargs):
        super(TimePlot, self).__init__(**kwargs)
        self.chart.type = 'TimePlot'