MCPcopy Create free account
hub / github.com/idank/explainshell / move1

Function move1

explainshell/web/static/js/d3.v3.js:7688–7712  ·  view source on GitHub ↗
(point, scale, i)

Source from the content-addressed store, hash-verified

7686 }
7687 }
7688 function move1(point, scale, i) {
7689 var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], size = extent[1][i] - extent[0][i], min, max;
7690 if (dragging) {
7691 r0 -= position;
7692 r1 -= size + position;
7693 }
7694 min = Math.max(r0, Math.min(r1, point[i]));
7695 if (dragging) {
7696 max = (min += position) + size;
7697 } else {
7698 if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min));
7699 if (position < min) {
7700 max = min;
7701 min = position;
7702 } else {
7703 max = position;
7704 }
7705 }
7706 if (extent[0][i] !== min || extent[1][i] !== max) {
7707 extentDomain = null;
7708 extent[0][i] = min;
7709 extent[1][i] = max;
7710 return true;
7711 }
7712 }
7713 function brushend() {
7714 brushmove();
7715 g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null);

Callers 1

brushmoveFunction · 0.85

Calls 1

d3_scaleRangeFunction · 0.85

Tested by

no test coverage detected