def sonde14(tester=None, tile_id='radar_ex'): start_time = time.time() data = updateChartJS(nbrLabel=5, data=None) index = 0 for dataset in data['datasets']: # TODO: ADD THIS TO .JS not in sensors... for simplicity dataset['pointBorderColor'] = COLOR_TAB[index] dataset['pointBackgroundColor'] = 'rgba(255, 255, 255, 0.5)' dataset['fill'] = True index = index + 1 tipboardAnswer = sendUpdateByApi(data=data, tileTemplate='radar_chart', tileId=tile_id, tester=tester) end(title=f'sensors14 -> {tile_id}', startTime=start_time, tipboardAnswer=tipboardAnswer, tileId=tile_id)
def sonde12(tester=None, tile_id='normjs_ex'): start_time = time.time() data = updateChartJS(colorTabIndataset=False) tipboardAnswer = sendUpdateByApi(tileTemplate='norm_chart', tileId=tile_id, data=data, tester=tester) end(title=f'sensors12 -> {tile_id}', startTime=start_time, tipboardAnswer=tipboardAnswer, tileId=tile_id)
def sonde4(tester=None, tile_id='cfjs_ex'): start_time = time.time() data = updateChartJS() tipboardAnswer = sendUpdateByApi(data=data, tileTemplate='cumulative_flow', tileId=tile_id, tester=tester) end(title=f'sensors4 -> {tile_id}', startTime=start_time, tipboardAnswer=tipboardAnswer, tileId=tile_id)
def sonde17(tester=None, tile_id='half_doughnut_ex'): start_time = time.time() data = updateChartJS(nbrDataset=random.randrange(1, 3), colorTabIndataset=True) tipboardAnswer = sendUpdateByApi(data=data, tileTemplate='half_doughnut_chart', tileId=tile_id, tester=tester) end(title=f'sensors17 -> {tile_id}', startTime=start_time, tipboardAnswer=tipboardAnswer, tileId=tile_id)
def sonde3(tester=None, tile_id='line_chartjs_ex'): TILE_TEMPLATE = 'line_chart' start_time = time.time() data = updateChartJS(nbrLabel=50, nbrDataset=2) tipboardAnswer = sendUpdateByApi(data=data, tileTemplate=TILE_TEMPLATE, tileId=tile_id, tester=tester) end(title=f'sensors3 -> {tile_id}', startTime=start_time, tipboardAnswer=tipboardAnswer, tileId=tile_id)
def sonde15(tester=None, tile_id='polararea_ex'): start_time = time.time() data = updateChartJS(nbrDataset=1, colorTabIndataset=True) meta = {"scale": {"ticks": {"display": False}}} answer = sendUpdateByApi(data=data, tileTemplate='polararea_chart', tileId=tile_id, meta=meta, tester=tester) end(title=f'sensor15 -> -> {tile_id}', startTime=start_time, tipboardAnswer=answer, tileId=tile_id)
def sonde19(tester=None, tile_id='lgauge_ex'): start_time = time.time() data = updateChartJS(nbrDataset=3, nbrLabel=3, colorTabIndataset=False) nbrDataset = 3 data = dict() data['datasets'] = list() offset = 9 # offset start at the end of width of center axis for idx in range(nbrDataset): offset = offset + 11 data['datasets'].append(dict(label=f'Serie {idx}', backgroundColor=COLOR_TAB[idx], data=[random.randrange(100, 500)], offset=offset, width=10)) answer = sendUpdateByApi(data=data, tileTemplate='linear_gauge_chart', tileId=tile_id, tester=tester) end(title=f'sensor19 -> -> {tile_id}', startTime=start_time, tipboardAnswer=answer, tileId=tile_id)
def sonde7(tester=None, tile_id='barjs_ex', isHorizontal=False): TILE_TEMPLATE = 'bar_chart' if isHorizontal else 'vbar_chart' start_time = time.time() data = updateChartJS(nbrDataset=random.randrange(5, 9), nbrLabel=random.randrange(4, 6), colorTabIndataset=False) meta = updateMeta() tipboardAnswer = sendUpdateByApi(data=data, tileTemplate=TILE_TEMPLATE, tileId=tile_id, tester=tester, meta=meta) end(title=f'sensors7 -> {tile_id}', startTime=start_time, tipboardAnswer=tipboardAnswer, tileId=tile_id)
def sonde2(tester=None, tile_id='pie_chartjs_ex'): start_time = time.time() data = updateChartJS(nbrDataset=1, colorTabIndataset=True) tipboardAnswer = sendUpdateByApi(data=data, tileTemplate='pie_chart', tileId=tile_id, tester=tester) end(title=f'sensors2 -> {tile_id}', startTime=start_time, tipboardAnswer=tipboardAnswer, tileId=tile_id)