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

Method apply_selected

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

Source from the content-addressed store, hash-verified

683 }
684
685 apply_selected() {
686 const selected = this.model.get('selected');
687 const that = this;
688 if (selected === undefined || selected === null || selected.length === 0) {
689 this.clear_selected();
690 } else {
691 selected.forEach((data) => {
692 const selected_cell = that.fig_map
693 .selectAll('.rect_element')
694 .filter((d: any, i) => {
695 return d.name === data;
696 });
697
698 const rect = that.fig_click
699 .append('rect')
700 .data(selected_cell.data())
701 .attr('transform', selected_cell.attr('transform'))
702 .attr('x', 0)
703 .attr('y', 0)
704 .attr('width', that.column_width)
705 .attr('height', that.row_height);
706 applyStyles(rect, {
707 stroke: that.selected_stroke,
708 'stroke-width': '3px',
709 fill: 'none',
710 });
711 });
712 }
713 }
714
715 clear_selected() {
716 this.fig_click.selectAll('rect').remove();

Callers 3

create_listenersMethod · 0.95
relayoutMethod · 0.80

Calls 2

clear_selectedMethod · 0.95
applyStylesFunction · 0.90

Tested by

no test coverage detected