1BaseChart # 23:import BaseChart from './BaseChart'; 2from 3makeSVGGroup 4makeHeatSquare 5makeText 6from 7addDays 8getDdMmYyyy 9getWeeksBetween 10from 11calcDistribution 12getMaxCheckpoint 13from 14isValidColor 15from 16Heatmap # 23:export default class Heatmap extends BaseChart { 17BaseChart 18constructor 19start 20domain 21subdomain 22data 23discrete_domains 24count_label 25legend_colors 26arguments 27type 28domain 29domain 30subdomain 31subdomain 32data 33data 34discrete_domains 35discrete_domains 36count_label 37count_label 38today 39start 40start 41addDays 42today 43legend_colors 44legend_colors 45slice 46legend_colors 47validate_colors 48legend_colors 49legend_colors 50distribution_size 51translate_x 52setup 53validate_colors # 65: validate_colors(colors) { 54colors 55colors 56length 57valid 58colors 59forEach 60string 61isValidColor 62string 63valid 64console 65warn 66string 67valid 68setup_base_values # 79: setup_base_values() { 69today 70start 71start 72start 73setFullYear 74start 75getFullYear 76first_week_start 77start 78toDateString 79last_week_start 80today 81toDateString 82first_week_start 83getDay 84addDays 85first_week_start 86first_week_start 87getDay 88last_week_start 89getDay 90addDays 91last_week_start 92last_week_start 93getDay 94no_of_cols 95getWeeksBetween 96first_week_start 97last_week_start 98set_width # 97: set_width() { 99base_width 100no_of_cols 101discrete_domains 102base_width 103setup_components # 105: setup_components() { 104domain_label_group 105makeDrawAreaComponent 106data_groups 107makeDrawAreaComponent 108setup_values # 115: setup_values() { 109domain_label_group 110textContent 111data_groups 112textContent 113data_values 114keys 115data 116map 117key 118data 119key 120distribution 121calcDistribution 122data_values 123distribution_size 124month_names 125render_all_weeks_and_store_x_values 126no_of_cols 127render_all_weeks_and_store_x_values # 129: render_all_weeks_and_store_x... 128no_of_weeks 129current_week_sunday 130first_week_start 131week_col 132current_month 133current_week_sunday 134getMonth 135months 136current_month 137month_weeks 138month_start_points 139month_weeks 140current_month 141month_start_points 142push 143i 144i 145no_of_weeks 146i 147data_group 148month_change 149day 150current_week_sunday 151data_group 152month_change 153get_week_squares_group 154day 155week_col 156data_groups 157appendChild 158data_group 159week_col 160parseInt 161discrete_domains 162month_change 163month_weeks 164current_month 165month_change 166current_month 167current_month 168months 169push 170current_month 171month_weeks 172current_month 173addDays 174current_week_sunday 175render_month_labels 176get_week_squares_group # 157: get_week_squares_group(current_date, index) { 177current_date 178index 179no_of_weekdays 180square_side 181cell_padding 182step 183today_time 184today 185getTime 186month_change 187week_col_change 188data_group 189makeSVGGroup 190data_groups 191y 192i 193i 194no_of_weekdays 195i 196step 197y 198square_side 199cell_padding 200data_value 201color_index 202current_timestamp 203current_date 204getTime 205timestamp 206floor 207current_timestamp 208current_timestamp 209toFixed 210data 211timestamp 212data_value 213data 214timestamp 215data 216round 217timestamp 218data_value 219data 220round 221timestamp 222data_value 223color_index 224getMaxCheckpoint 225data_value 226distribution 227x 228index 229week_col_change 230dataAttr 231getDdMmYyyy 232current_date 233data_value 234current_date 235getDay 236heatSquare 237makeHeatSquare 238x 239y 240square_side 241legend_colors 242color_index 243dataAttr 244data_group 245appendChild 246heatSquare 247next_date 248current_date 249addDays 250next_date 251next_date 252getTime 253today_time 254next_date 255getMonth 256current_date 257getMonth 258month_change 259discrete_domains 260week_col_change 261month_start_points 262push 263index 264week_col_change 265current_date 266next_date 267data_group 268month_change 269render_month_labels # 219: render_month_labels() { 270months 271shift 272month_start_points 273shift 274months 275pop 276month_start_points 277pop 278month_start_points 279map 280start 281i 282month_name 283month_names 284months 285i 286substring 287text 288makeText 289start 290month_name 291domain_label_group 292appendChild 293text 294make_graph_components # 246: make_graph_components() { 295prototype 296slice 297call 298container 299querySelectorAll 300map 301d 302d 303style 304display 305chart_wrapper 306style 307marginTop 308chart_wrapper 309style 310paddingTop 311bind_tooltip # 256: bind_tooltip() { 312prototype 313slice 314call 315document 316querySelectorAll 317map 318el 319el 320addEventListener 321e 322count 323e 324target 325getAttribute 326date_parts 327e 328target 329getAttribute 330split 331month 332month_names 333parseInt 334date_parts 335substring 336g_off 337chart_wrapper 338getBoundingClientRect 339p_off 340e 341target 342getBoundingClientRect 343width 344parseInt 345e 346target 347getAttribute 348x 349p_off 350left 351g_off 352left 353width 354y 355p_off 356top 357g_off 358top 359width 360value 361count 362count_label 363name 364month 365date_parts 366date_parts 367tip 368set_values 369x 370y 371name 372value 373tip 374show_tip 375update # 280: update(data) { 376data 377data 378data 379setup_values 380bind_tooltip 381foo # 285: foo() { 382u1 383u2 384str 385