def sonde3(isTest=False): TILE_TEMPLATE = 'line_chart' TILE_ID = 'line_chartjs_ex' print(f'{getTimeStr()} (+) Starting sensors 3', flush=True) start_time = time.time() data = buildChartUpdateRandomly() tipboardAnswer = sendDataToTipboard(data=data, tile_template=TILE_TEMPLATE, tile_id=TILE_ID, isTest=isTest) end(title=f'sensors3 -> {TILE_ID}', start_time=start_time, tipboardAnswer=tipboardAnswer, TILE_ID=TILE_ID)
def sonde12(isTest=False): TILE_ID = 'normjs_ex' start_time = time.time() print(f'{getTimeStr()} (+) Starting sensors 3', flush=True) data = buildChartUpdateRandomly(colorTabIndataset=False) tipboardAnswer = sendDataToTipboard(tile_template='norm_chart', tile_id=TILE_ID, data=data, isTest=isTest) end(title=f'sensors12 -> {TILE_ID}', start_time=start_time, tipboardAnswer=tipboardAnswer, TILE_ID=TILE_ID)
def sonde4(isTest=False): TILE_ID = 'cfjs_ex' print(f'{getTimeStr()} (+) Starting sensors 4', flush=True) start_time = time.time() data = buildChartUpdateRandomly() tipboardAnswer = sendDataToTipboard(data=data, tile_template='cumulative_flow', tile_id=TILE_ID, isTest=isTest) end(title=f'sensors4 -> {TILE_ID}', start_time=start_time, tipboardAnswer=tipboardAnswer, TILE_ID=TILE_ID)
def sonde15(isTest=False): print(f'{getTimeStr()} (+) Starting sensors 15', flush=True) start_time = time.time() data = buildChartUpdateRandomly(nbrDataset=1, colorTabIndataset=True) meta = {"scale": {"ticks": {"display": False}}} answer = sendDataToTipboard(data=data, tile_template='polararea_chart', tile_id='polararea_ex', meta=meta, isTest=isTest) end(title=f'sensor15 -> polararea_ex', start_time=start_time, tipboardAnswer=answer, TILE_ID='polararea_ex')
def sonde16(isTest=False): TILE_ID = 'doughnut_ex' print(f'{getTimeStr()} (+) Starting sensors 16', flush=True) start_time = time.time() data = buildChartUpdateRandomly(nbrDataset=random.randrange(1, 3), colorTabIndataset=True) tipboardAnswer = sendDataToTipboard(data=data, tile_template='doughnut_chart', tile_id=TILE_ID, isTest=isTest) end(title=f'sensors3 -> {TILE_ID}', start_time=start_time, tipboardAnswer=tipboardAnswer, TILE_ID=TILE_ID)
def sonde2(isTest=False, checker=None, fake_client=None): TILE_ID = 'pie_chartjs_ex' print(f'{getTimeStr()} (+) Starting sensors 2', flush=True) start_time = time.time() data = buildChartUpdateRandomly(nbrDataset=random.randrange(1, 3), colorTabIndataset=True) if isTest: testTipboardUpdate(checker, fake_client, TILE_ID, data) else: tipboardAnswer = sendDataToTipboard(data=data, tile_template='pie_chart', tile_id=TILE_ID, isTest=isTest) end(title=f'sensors2 -> {TILE_ID}', start_time=start_time, tipboardAnswer=tipboardAnswer, TILE_ID=TILE_ID)
def sonde14(isTest=False): TILE_ID = 'radar_ex' print(f'{getTimeStr()} (+) Starting sensors 14', flush=True) start_time = time.time() data = buildChartUpdateRandomly(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 = sendDataToTipboard(data=data, tile_template='radar_chart', tile_id=TILE_ID, isTest=isTest) end(title=f'sensors14 -> {TILE_ID}', start_time=start_time, tipboardAnswer=tipboardAnswer, TILE_ID=TILE_ID)