Clicks

number_of_clicks(df)

Calculate the number of clicks per session. :type df: DataFrame :param df: DataFrame containing mouse event data. :type df: pd.DataFrame

Returns:

A dictionary with session IDs as keys and number of clicks as values.

Return type:

dict

click_slip(df, threshold=5.0)

Calculate the number of click slips per session. A click slip is defined as a click event that occurs within a certain distance from the previous mouse position (indicating an unintended click).

We define a click slip as: the total path distance of all EVENT_ON_MOUSE_MOVE events that occur between an EVENT_ON_MOUSE_DOWN and the subsequent EVENT_ON_MOUSE_UP. If that total move-distance is less than threshold we count it as a slip.

Parameters:
  • df (pd.DataFrame) – DataFrame containing mouse event data.

  • threshold (float) – Distance threshold to consider a click as a slip.

Returns:

A dictionary with session IDs as keys and the metrics (click slips, max, min, average) as values.

Return type:

dict