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

Method render

js/src/Image.ts:22–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20
21export 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,

Callers

nothing calls this directly

Calls 3

update_imageMethod · 0.95
create_listenersMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected