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

Function dragAxList

src/plots/cartesian/dragbox.js:1112–1137  ·  view source on GitHub ↗
(axList, pix)

Source from the content-addressed store, hash-verified

1110}
1111
1112function dragAxList(axList, pix) {
1113 for(var i = 0; i < axList.length; i++) {
1114 var axi = axList[i];
1115 if(!axi.fixedrange) {
1116 if(axi.rangebreaks) {
1117 var p0 = 0;
1118 var p1 = axi._length;
1119 var d0 = axi.p2l(p0 + pix) - axi.p2l(p0);
1120 var d1 = axi.p2l(p1 + pix) - axi.p2l(p1);
1121 var delta = (d0 + d1) / 2;
1122
1123 axi.range = [
1124 axi.l2r(axi._rl[0] - delta),
1125 axi.l2r(axi._rl[1] - delta)
1126 ];
1127 } else {
1128 axi.range = [
1129 axi.l2r(axi._rl[0] - pix / axi._m),
1130 axi.l2r(axi._rl[1] - pix / axi._m)
1131 ];
1132 }
1133
1134 if(axi.limitRange) axi.limitRange();
1135 }
1136 }
1137}
1138
1139// common transform for dragging one end of an axis
1140// d>0 is compressing scale (cursor is over the plot,

Callers 1

plotDragFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…