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

Method render

js/src/PanZoom.ts:33–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32export class PanZoom extends interaction.Interaction {
33 render() {
34 super.render();
35 const that = this;
36 // chrome bug that requires a listener on the parent svg node
37 // https://github.com/d3/d3-zoom/issues/231#issuecomment-802713799
38 this.parent.svg.node().addEventListener('wheel', nop, { passive: false });
39 this.d3el
40 .style('cursor', 'move')
41 .call(
42 d3
43 .drag()
44 .on('start', () => {
45 that.mousedown();
46 })
47 .on('drag', () => {
48 that.mousemove();
49 })
50 .on('end', () => {
51 that.mouseup();
52 })
53 )
54 .on('wheel', () => {
55 that.mousewheel();
56 });
57 this.active = false;
58
59 this.update_scales();
60 this.listenTo(this.model, 'change:scales', this.update_scales);
61
62 this.set_ranges();
63 this.listenTo(this.parent, 'margin_updated', this.set_ranges);
64 }
65
66 remove() {
67 this.parent.svg.node().removeEventListener('wheel', nop);

Callers

nothing calls this directly

Calls 6

update_scalesMethod · 0.95
set_rangesMethod · 0.95
mousewheelMethod · 0.80
mousedownMethod · 0.45
mousemoveMethod · 0.45
mouseupMethod · 0.45

Tested by

no test coverage detected