Histogram

widgets. Histogram

Class to handle the display and update of the histogram of the user's current click-time-distribution estimate.

Constructor

new Histogram(output_canvas)

Source:
Properties:
Name Type Description
num_bins number

The number of bins to draw on the histogram. Determined by config file.

dens_li Array.<number>

The height of the histogram at each bin. Updated with the values from the KernelDensityEstimation class.

Parameters:
Name Type Description
output_canvas OutputCanvas

The OutputCanvas instance used to draw the histogram and text box.

Methods

calculate_size()

Description:
  • Calculates the size of the histogram from the available screen space. Needs to be recalled on any window resizing event.

Source:

draw_box()

Description:
  • Draws the white box in the background of the histogram.

Source:

draw_histogram()

Description:
  • Draws the bars of the histogram from the dens_li attribute.

Source:

generate_normal_values()

Description:
  • Generates the initial normal distribution used for the KDE when the user has no prior click data.

Source:

renormalize()

Description:
  • Normalizes the dens_li values prior to the drawing process.

Source:

update(dens_li)

Description:
  • Redraws the histogram based on a new density list estimate from the KDE class.

Source:
Parameters:
Name Type Description
dens_li Array.<number>

An array of integers representing the relative height of each histogram bar.