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

Method show_tooltip

js/src/MarketMap.ts:757–806  ·  view source on GitHub ↗
(event, data)

Source from the content-addressed store, hash-verified

755 }
756
757 show_tooltip(event, data) {
758 const that = this;
759 if (
760 !this.tooltip_view &&
761 (!this.tooltip_fields || this.tooltip_fields.length == 0)
762 ) {
763 return;
764 } else {
765 const tooltip_div = this.tooltip_div;
766 tooltip_div.transition().style('opacity', 0.9).style('display', null);
767
768 this.move_tooltip();
769 tooltip_div.select('table').remove();
770
771 const ref_data = data.ref_data;
772 if (!this.tooltip_view) {
773 const tooltip_table = tooltip_div
774 .append('table')
775 .selectAll('tr')
776 .data(this.tooltip_fields);
777
778 tooltip_table.exit().remove();
779 const table_rows = tooltip_table.enter().append('tr');
780
781 table_rows
782 .append('td')
783 .attr('class', 'tooltiptext')
784 .text((datum) => {
785 return datum;
786 });
787
788 table_rows
789 .append('td')
790 .attr('class', 'tooltiptext')
791 .text((datum, index) => {
792 if (ref_data === null || ref_data === undefined) {
793 return null;
794 }
795
796 if (ref_data[datum] === null || ref_data[datum] === undefined) {
797 return 'N/A';
798 }
799
800 return that.tooltip_formats[index](ref_data[datum]);
801 });
802 }
803 this.popper.enableEventListeners();
804 this.move_tooltip();
805 }
806 }
807
808 mousemove_handler() {
809 this.move_tooltip();

Callers 3

mouseover_handlerMethod · 0.95
refresh_tooltipFunction · 0.80
mouse_overFunction · 0.80

Calls 2

move_tooltipMethod · 0.95
removeMethod · 0.45

Tested by

no test coverage detected