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

Method panzoom

js/src/FigureModel.ts:90–110  ·  view source on GitHub ↗

* Start or stop pan zoom mode *

()

Source from the content-addressed store, hash-verified

88 *
89 */
90 panzoom(): void {
91 if (this.panzoomData.panning) {
92 this.set('interaction', this.panzoomData.cached_interaction);
93 this.panzoomData.panning = false;
94 this.save_changes();
95 } else {
96 this.panzoomData.cached_interaction = this.get('interaction');
97 const panzoom = this.panzoomData.panzoom;
98 if (panzoom) {
99 this.set('interaction', panzoom);
100 this.save_changes();
101 } else {
102 this.create_panzoom_model().then((model) => {
103 this.set('interaction', model);
104 this.panzoomData.panzoom = model;
105 this.save_changes();
106 });
107 }
108 this.panzoomData.panning = true;
109 }
110 }
111
112 /**
113 * Creates a panzoom interaction widget for the this model.

Callers

nothing calls this directly

Calls 1

create_panzoom_modelMethod · 0.95

Tested by

no test coverage detected