Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def limit_points(x):
if len(x) >= HistogramChart.ROWS_LIMIT:
return x[0:HistogramChart.ROWS_LIMIT_T0_INDEX]
return x
def __init__(self, **kwargs):
super(Histogram, self).__init__()
self.chart = HistogramChart(**kwargs)
data = getValue(kwargs, 'data', [])
if len(data) > 1 and isinstance(data[0], list):
for x in data:
self.chart.graphics_list.append(x)
else:
self.chart.graphics_list.append(data)
self.model = self.chart.transform()
def transform(self):
self_copy = copy.copy(self)
self_copy.totalNumberOfPoints = HistogramChart.total_number(self_copy.graphics_list)
self_copy.tooManyRows = self_copy.totalNumberOfPoints >= HistogramChart.ROWS_LIMIT
self_copy.rowsLimitItems = HistogramChart.ROWS_LIMIT
self_copy.numberOfPointsToDisplay = str(HistogramChart.ROWS_LIMIT_T0_INDEX) + " items"
self_copy.graphics_list = list(map(HistogramChart.limit_points, self_copy.graphics_list))
return super(HistogramChart, self_copy).transform()
def transform(self):
self_copy = copy.copy(self)
self_copy.totalNumberOfPoints = HistogramChart.total_number(self_copy.graphics_list)
self_copy.tooManyRows = self_copy.totalNumberOfPoints >= HistogramChart.ROWS_LIMIT
self_copy.rowsLimitItems = HistogramChart.ROWS_LIMIT
self_copy.numberOfPointsToDisplay = str(HistogramChart.ROWS_LIMIT_T0_INDEX) + " items"
self_copy.graphics_list = list(map(HistogramChart.limit_points, self_copy.graphics_list))
return super(HistogramChart, self_copy).transform()
def transform(self):
self_copy = copy.copy(self)
self_copy.totalNumberOfPoints = HistogramChart.total_number(self_copy.graphics_list)
self_copy.tooManyRows = self_copy.totalNumberOfPoints >= HistogramChart.ROWS_LIMIT
self_copy.rowsLimitItems = HistogramChart.ROWS_LIMIT
self_copy.numberOfPointsToDisplay = str(HistogramChart.ROWS_LIMIT_T0_INDEX) + " items"
self_copy.graphics_list = list(map(HistogramChart.limit_points, self_copy.graphics_list))
return super(HistogramChart, self_copy).transform()
def transform(self):
self_copy = copy.copy(self)
self_copy.totalNumberOfPoints = HistogramChart.total_number(self_copy.graphics_list)
self_copy.tooManyRows = self_copy.totalNumberOfPoints >= HistogramChart.ROWS_LIMIT
self_copy.rowsLimitItems = HistogramChart.ROWS_LIMIT
self_copy.numberOfPointsToDisplay = str(HistogramChart.ROWS_LIMIT_T0_INDEX) + " items"
self_copy.graphics_list = list(map(HistogramChart.limit_points, self_copy.graphics_list))
return super(HistogramChart, self_copy).transform()