MCPcopy Index your code
hub / github.com/plotly/plotly.js / zoomPrep

Function zoomPrep

src/plots/cartesian/dragbox.js:326–346  ·  view source on GitHub ↗
(e, startX, startY)

Source from the content-addressed store, hash-verified

324 var zoomDragged;
325
326 function zoomPrep(e, startX, startY) {
327 var dragBBox = dragger.getBoundingClientRect();
328 x0 = startX - dragBBox.left;
329 y0 = startY - dragBBox.top;
330
331 gd._fullLayout._calcInverseTransform(gd);
332 var transformedCoords = Lib.apply3DTransform(gd._fullLayout._invTransform)(x0, y0);
333 x0 = transformedCoords[0];
334 y0 = transformedCoords[1];
335
336 box = {l: x0, r: x0, w: 0, t: y0, b: y0, h: 0};
337 lum = gd._hmpixcount ?
338 (gd._hmlumcount / gd._hmpixcount) :
339 tinycolor(gd._fullLayout.plot_bgcolor).getLuminance();
340 path0 = 'M0,0H' + pw + 'V' + ph + 'H0V0';
341 dimmed = false;
342 zoomMode = 'xy';
343 zoomDragged = false;
344 zb = makeZoombox(zoomlayer, lum, xs, ys, path0);
345 corners = makeCorners(zoomlayer, xs, ys);
346 }
347
348 function zoomMove(dx0, dy0) {
349 if(gd._transitioningWithDuration) {

Callers 1

makeDragBoxFunction · 0.70

Calls 2

makeZoomboxFunction · 0.85
makeCornersFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…