(self, last_session=False, file_path=None, colour_override=None, _double_click=False)
Render heatmap of clicks.
Render heatmap of clicks.
Render heatmap of clicks .
def clicks(self, last_session=False, file_path=None, colour_override=None, _double_click=False):
        """Render heatmap of clicks."""

        top_resolution, (min_value, max_value), clicks = self.data.get_clicks(session=last_session, double_click=_double_click)
        output_resolution, upscale_resolution = calculate_resolution(clicks.keys(), top_resolution)

        lmb = CONFIG['GenerateHeatmap']['_MouseButtonLeft']
        mmb = CONFIG['GenerateHeatmap']['_MouseButtonMiddle']
        rmb = CONFIG['GenerateHeatmap']['_MouseButtonRight']
        skip = []
        if lmb or mmb or rmb:
            if not lmb:
                skip.append(0)
            if not mmb:
                skip.append(1)
            if not rmb:
                skip.append(2)
        upscaled_arrays = upscale_arrays_to_resolution(clicks, upscale_resolution, skip=skip)

        (min_value, max_value), heatmap = arrays_to_heatmap(upscaled_arrays,
                               gaussian_size=gaussian_size(upscale_resolution[0], upscale_resolution[1]),
                               clip=1-CONFIG['Advanced']['HeatmapRangeClipping'])

        colour_range = self._get_colour_range(min_value, max_value, 'GenerateHeatmap', custom_map=colour_override)
        
        image_output = Image.fromarray(colour_range.convert_to_rgb(heatmap))
        image_output = image_output.resize(output_resolution, Image.ANTIALIAS)

        if file_path is None:
            file_path = self.name.generate('Clicks', reload=True)
            
        if self.save:
            save_image_to_folder(image_output, file_path)
def clicks ( self , last_session = False , file_path = None , colour_override = None , _double_click = False ) : top_resolution , ( min_value , max_value ) , clicks = self . data . get_clicks ( session = last_session , double_click = _double_click ) output_resolution , upscale_resolution = calculate_resolution ( clicks . keys ( ) , top_resolution ) lmb = CONFIG [ 'GenerateHeatmap' ] [ '_MouseButtonLeft' ] mmb = CONFIG [ 'GenerateHeatmap' ] [ '_MouseButtonMiddle' ] rmb = CONFIG [ 'GenerateHeatmap' ] [ '_MouseButtonRight' ] skip = [ ] if lmb or mmb or rmb : if not lmb : skip . append ( 0 ) if not mmb : skip . append ( 1 ) if not rmb : skip . append ( 2 ) upscaled_arrays = upscale_arrays_to_resolution ( clicks , upscale_resolution , skip = skip ) ( min_value , max_value ) , heatmap = arrays_to_heatmap ( upscaled_arrays , gaussian_size = gaussian_size ( upscale_resolution [ 0 ] , upscale_resolution [ 1 ] ) , clip = 1 - CONFIG [ 'Advanced' ] [ 'HeatmapRangeClipping' ] ) colour_range = self . _get_colour_range ( min_value , max_value , 'GenerateHeatmap' , custom_map = colour_override ) image_output = Image . fromarray ( colour_range . convert_to_rgb ( heatmap ) ) image_output = image_output . resize ( output_resolution , Image . ANTIALIAS ) if file_path is None : file_path = self . name . generate ( 'Clicks' , reload = True ) if self . save : save_image_to_folder ( image_output , file_path )