()
| 20 | |
| 21 | export class Image extends Mark { |
| 22 | render() { |
| 23 | const base_render_promise = super.render(); |
| 24 | const el = this.d3el || this.el; |
| 25 | this.im = ( |
| 26 | el.append('image') as d3.Selection<SVGImageElement, any, any, any> |
| 27 | ) |
| 28 | .attr('x', 0) |
| 29 | .attr('y', 0) |
| 30 | .attr('width', 1) |
| 31 | .attr('height', 1) |
| 32 | .attr('preserveAspectRatio', 'none') |
| 33 | .classed('image_pixelated', this.model.get('pixelated')); |
| 34 | this.update_image(); |
| 35 | |
| 36 | this.event_metadata = { |
| 37 | mouse_over: { |
| 38 | msg_name: 'hover', |
| 39 | lookup_data: false, |
| 40 | hit_test: true, |
| 41 | }, |
| 42 | legend_clicked: { |
| 43 | msg_name: 'legend_click', |
| 44 | hit_test: true, |
| 45 | }, |
| 46 | element_clicked: { |
| 47 | msg_name: 'element_click', |
| 48 | lookup_data: false, |
| 49 | hit_test: false, |
| 50 | }, |
| 51 | parent_clicked: { |
| 52 | msg_name: 'background_click', |
| 53 | hit_test: false, |
| 54 | }, |
| 55 | }; |
| 56 | |
| 57 | const that = this; |
| 58 | return base_render_promise.then(() => { |
| 59 | that.event_listeners = {}; |
| 60 | that.reset_click(); |
| 61 | that.create_listeners(); |
| 62 | that.listenTo(that.parent, 'margin_updated', () => { |
| 63 | that.draw(false); |
| 64 | }); |
| 65 | }); |
| 66 | } |
| 67 | |
| 68 | set_positional_scales() { |
| 69 | const x_scale = this.scales.x, |
nothing calls this directly
no test coverage detected