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

Function brushmove

explainshell/web/static/js/d3.v3.js:7659–7687  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7657 }
7658 }
7659 function brushmove() {
7660 var point = mouse(), moved = false;
7661 if (offset) {
7662 point[0] += offset[0];
7663 point[1] += offset[1];
7664 }
7665 if (!dragging) {
7666 if (d3.event.altKey) {
7667 if (!center) center = [ (extent[0][0] + extent[1][0]) / 2, (extent[0][1] + extent[1][1]) / 2 ];
7668 origin[0] = extent[+(point[0] < center[0])][0];
7669 origin[1] = extent[+(point[1] < center[1])][1];
7670 } else center = null;
7671 }
7672 if (resizingX && move1(point, x, 0)) {
7673 redrawX(g);
7674 moved = true;
7675 }
7676 if (resizingY && move1(point, y, 1)) {
7677 redrawY(g);
7678 moved = true;
7679 }
7680 if (moved) {
7681 redraw(g);
7682 event_({
7683 type: "brush",
7684 mode: dragging ? "move" : "resize"
7685 });
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) {

Callers 2

brushstartFunction · 0.85
brushendFunction · 0.85

Calls 5

mouseFunction · 0.85
move1Function · 0.85
redrawXFunction · 0.85
redrawYFunction · 0.85
redrawFunction · 0.85

Tested by

no test coverage detected