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

Method panzoom

js/src/Toolbar.ts:48–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46 // and can take the value of the figure interaction, which can be
47 // null.
48 panzoom() {
49 const figure = this.get('figure');
50 if (this.get('_panning')) {
51 if (figure) {
52 figure.set('interaction', this.cached_interaction);
53 figure.save_changes();
54 }
55 this.set('_panning', false);
56 this.save_changes();
57 } else {
58 if (figure) {
59 this.cached_interaction = figure.get('interaction');
60 const panzoom = this.get('_panzoom');
61 if (panzoom) {
62 figure.set('interaction', panzoom);
63 figure.save_changes();
64 } else {
65 this._create_panzoom_model(figure).then((model) => {
66 this.set('_panzoom', model);
67 this.save_changes();
68 figure.set('interaction', model);
69 figure.save_changes();
70 });
71 }
72 }
73 this.set('_panning', true);
74 this.save_changes();
75 }
76 }
77
78 reset() {
79 /**

Callers 2

renderMethod · 0.45
create_toolbarMethod · 0.45

Calls 1

_create_panzoom_modelMethod · 0.95

Tested by

no test coverage detected