MCPcopy Index your code
hub / github.com/bqplot/bqplot / draw_map

Method draw_map

js/src/MarketMap.ts:455–609  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 3

renderImplMethod · 0.95
relayoutMethod · 0.80

Calls 14

update_font_styleMethod · 0.95
draw_group_namesMethod · 0.95
applyStylesFunction · 0.90
get_group_transformMethod · 0.80
get_new_cordsMethod · 0.80
get_end_pointsMethod · 0.80
get_cell_transformMethod · 0.80
cell_click_handlerMethod · 0.80
mousemove_handlerMethod · 0.80
create_bounding_pathMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected