()
| 453 | } |
| 454 | |
| 455 | draw_map() { |
| 456 | this.reset_drawing_controls(); |
| 457 | // Removing pre existing elements from the map |
| 458 | this.fig_map.selectAll('.element_group').remove(); |
| 459 | this.fig_names.selectAll('.names_object').remove(); |
| 460 | this.rect_groups = this.fig_map |
| 461 | .selectAll('.element_group') |
| 462 | .data(this.groups); |
| 463 | const color_scale = this.scales.color; |
| 464 | |
| 465 | const that = this; |
| 466 | this.rect_groups = this.rect_groups |
| 467 | .enter() |
| 468 | .append('g') |
| 469 | .attr('class', 'element_group') |
| 470 | .attr('transform', (d, i) => { |
| 471 | return that.get_group_transform(i); |
| 472 | }) |
| 473 | .merge( |
| 474 | this.rect_groups as d3.Selection< |
| 475 | SVGGElement, |
| 476 | any, |
| 477 | SVGGraphicsElement, |
| 478 | any |
| 479 | > |
| 480 | ); |
| 481 | |
| 482 | this.rect_groups.exit().remove(); |
| 483 | this.end_points = []; |
| 484 | this.rect_groups.nodes().forEach((d, i) => { |
| 485 | const data = that.grouped_data[that.groups[i]]; |
| 486 | const return_arr = that.get_new_cords(); |
| 487 | const ends = that.get_end_points( |
| 488 | return_arr[2], |
| 489 | data.length, |
| 490 | return_arr[0], |
| 491 | return_arr[1], |
| 492 | return_arr[3], |
| 493 | return_arr[4] |
| 494 | ); |
| 495 | ends.forEach((point) => { |
| 496 | that.end_points.push(point); |
| 497 | }); |
| 498 | const element_count = that.running_sums[i]; |
| 499 | |
| 500 | let groups = d3 |
| 501 | .select(d) |
| 502 | .selectAll<SVGGElement, undefined>('.rect_element') |
| 503 | .data(data); |
| 504 | |
| 505 | // Appending the <g> <rect> and <text> elements to the newly |
| 506 | // added nodes |
| 507 | const new_groups = groups |
| 508 | .enter() |
| 509 | .append('g') |
| 510 | .classed('rect_element', true); |
| 511 | |
| 512 | new_groups |
no test coverage detected