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

Function render

js/src/ScatterBase.ts:27–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26export abstract class ScatterBase extends Mark {
27 render() {
28 const base_creation_promise = super.render();
29
30 const that = this;
31 // Warning: arrow functions actually breaks the drag
32 this.drag_listener = d3
33 .drag()
34 .subject((d: any) => {
35 return { x: that.x_scale.scale(d.x), y: that.y_scale.scale(d.y) };
36 })
37 .on('start', function (d, i) {
38 return that.drag_start(d, i, this);
39 })
40 .on('drag', function (d, i) {
41 return that.on_drag(d, i, this);
42 })
43 .on('end', function (d, i) {
44 return that.drag_ended(d, i, this);
45 });
46
47 this.selected_style = this.model.get('selected_style');
48 this.unselected_style = this.model.get('unselected_style');
49 this.selected_indices = this.model.get('selected');
50
51 this.hovered_style = this.model.get('hovered_style');
52 this.unhovered_style = this.model.get('unhovered_style');
53 this.hovered_index = !this.model.get('hovered_point')
54 ? null
55 : [this.model.get('hovered_point')];
56
57 this.display_el_classes = ['dot', 'legendtext']; //FIXME
58 this.event_metadata = {
59 mouse_over: {
60 msg_name: 'hover',
61 lookup_data: false,
62 hit_test: true,
63 },
64 legend_clicked: {
65 msg_name: 'legend_click',
66 hit_test: true,
67 },
68 element_clicked: {
69 msg_name: 'element_click',
70 lookup_data: false,
71 hit_test: true,
72 },
73 parent_clicked: {
74 msg_name: 'background_click',
75 hit_test: false,
76 },
77 };
78 this.displayed.then(() => {
79 this.parent.tooltip_div.node().appendChild(this.tooltip_div.node());
80 this.create_tooltip();
81 });
82
83 return base_creation_promise.then(() => {
84 this.event_listeners = {};

Callers

nothing calls this directly

Calls 6

drag_startMethod · 0.80
on_dragMethod · 0.80
renderMethod · 0.45
create_listenersMethod · 0.45
compute_view_paddingMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…