(event, data)
| 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(); |
no test coverage detected