()
| 39 | |
| 40 | export class MarketMap extends Figure { |
| 41 | protected async renderImpl() { |
| 42 | const figureSize = this.getFigureSize(); |
| 43 | this.width = figureSize.width; |
| 44 | this.height = figureSize.height; |
| 45 | |
| 46 | this.id = uuid(); |
| 47 | |
| 48 | this.scales = {}; |
| 49 | this.set_top_el_style(); |
| 50 | |
| 51 | this.num_rows = this.model.get('rows'); |
| 52 | this.num_cols = this.model.get('cols'); |
| 53 | this.row_groups = this.model.get('row_groups'); |
| 54 | this.enable_select = this.model.get('enable_select'); |
| 55 | |
| 56 | this.update_data(); |
| 57 | // set the number of rows and columns in the map |
| 58 | this.set_area_dimensions(this.data.length); |
| 59 | |
| 60 | if (this.model.get('theme')) { |
| 61 | this.svg.classed(this.model.get('theme'), true); |
| 62 | } |
| 63 | this.fig = this.svg |
| 64 | .append('g') |
| 65 | .attr( |
| 66 | 'transform', |
| 67 | 'translate(' + this.margin.left + ',' + this.margin.top + ')' |
| 68 | ); |
| 69 | |
| 70 | this.fig_map = this.fig.append('g'); |
| 71 | this.fig_axes = this.fig.append('g'); |
| 72 | this.fig_click = this.fig.append('g'); |
| 73 | this.fig_hover = this.fig.append('g'); |
| 74 | this.fig_names = this.fig |
| 75 | .append('g') |
| 76 | .style('display', this.model.get('show_groups') ? 'inline' : 'none'); |
| 77 | |
| 78 | this.fig_map.classed('g-map', true); |
| 79 | this.fig_axes.classed('g-axes', true); |
| 80 | this.fig_click.classed('g-click', true); |
| 81 | this.fig_hover.classed('g-hover', true); |
| 82 | this.fig_names.classed('g-names', true); |
| 83 | |
| 84 | // code for tool tip to be displayed |
| 85 | this.tooltip_div = d3 |
| 86 | .select(document.createElement('div')) |
| 87 | .attr('class', 'bqplot_mark_tooltip'); |
| 88 | applyStyles(this.tooltip_div, { opacity: 0, 'pointer-events': 'none' }); |
| 89 | |
| 90 | const freeze_tooltip_loc = this.model.get('freeze_tooltip_location'); |
| 91 | if (freeze_tooltip_loc) { |
| 92 | this.popper_reference = new popperreference.ElementReference( |
| 93 | this.svg.node() |
| 94 | ); |
| 95 | } else { |
| 96 | this.popper_reference = new popperreference.PositionReference({ |
| 97 | x: 0, |
| 98 | y: 0, |
nothing calls this directly
no test coverage detected