BaseChart # 23:import BaseChart from './BaseChart'; from makeSVGGroup makeHeatSquare makeText from addDays getDdMmYyyy getWeeksBetween from calcDistribution getMaxCheckpoint from isValidColor from Heatmap # 23:export default class Heatmap extends BaseChart { BaseChart constructor start domain subdomain data discrete_domains count_label legend_colors arguments type domain domain subdomain subdomain data data discrete_domains discrete_domains count_label count_label today start start addDays today legend_colors legend_colors slice legend_colors validate_colors legend_colors legend_colors distribution_size translate_x setup validate_colors # 65: validate_colors(colors) { colors colors length valid colors forEach string isValidColor string valid console warn string valid setup_base_values # 79: setup_base_values() { today start start start setFullYear start getFullYear first_week_start start toDateString last_week_start today toDateString first_week_start getDay addDays first_week_start first_week_start getDay last_week_start getDay addDays last_week_start last_week_start getDay no_of_cols getWeeksBetween first_week_start last_week_start set_width # 97: set_width() { base_width no_of_cols discrete_domains base_width setup_components # 105: setup_components() { domain_label_group makeDrawAreaComponent data_groups makeDrawAreaComponent setup_values # 115: setup_values() { domain_label_group textContent data_groups textContent data_values keys data map key data key distribution calcDistribution data_values distribution_size month_names render_all_weeks_and_store_x_values no_of_cols render_all_weeks_and_store_x_values # 129: render_all_weeks_and_store_x... no_of_weeks current_week_sunday first_week_start week_col current_month current_week_sunday getMonth months current_month month_weeks month_start_points month_weeks current_month month_start_points push i i no_of_weeks i data_group month_change day current_week_sunday data_group month_change get_week_squares_group day week_col data_groups appendChild data_group week_col parseInt discrete_domains month_change month_weeks current_month month_change current_month current_month months push current_month month_weeks current_month addDays current_week_sunday render_month_labels get_week_squares_group # 157: get_week_squares_group(current_date, index) { current_date index no_of_weekdays square_side cell_padding step today_time today getTime month_change week_col_change data_group makeSVGGroup data_groups y i i no_of_weekdays i step y square_side cell_padding data_value color_index current_timestamp current_date getTime timestamp floor current_timestamp current_timestamp toFixed data timestamp data_value data timestamp data round timestamp data_value data round timestamp data_value color_index getMaxCheckpoint data_value distribution x index week_col_change dataAttr getDdMmYyyy current_date data_value current_date getDay heatSquare makeHeatSquare x y square_side legend_colors color_index dataAttr data_group appendChild heatSquare next_date current_date addDays next_date next_date getTime today_time next_date getMonth current_date getMonth month_change discrete_domains week_col_change month_start_points push index week_col_change current_date next_date data_group month_change render_month_labels # 219: render_month_labels() { months shift month_start_points shift months pop month_start_points pop month_start_points map start i month_name month_names months i substring text makeText start month_name domain_label_group appendChild text make_graph_components # 246: make_graph_components() { prototype slice call container querySelectorAll map d d style display chart_wrapper style marginTop chart_wrapper style paddingTop bind_tooltip # 256: bind_tooltip() { prototype slice call document querySelectorAll map el el addEventListener e count e target getAttribute date_parts e target getAttribute split month month_names parseInt date_parts substring g_off chart_wrapper getBoundingClientRect p_off e target getBoundingClientRect width parseInt e target getAttribute x p_off left g_off left width y p_off top g_off top width value count count_label name month date_parts date_parts tip set_values x y name value tip show_tip update # 280: update(data) { data data data setup_values bind_tooltip foo # 285: foo() { u1 u2 str