d3/d3-brush

SHIFT modifier?

mbostock opened this issue · 4 comments

Holding down the SHIFT key should lock to resizing along x or y based on the difference between the mouse position before SHIFT and the mouse position after SHIFT. (If the mouse moves more horizontally than vertically, resizing should be horizontal-only, e.g.)

Interestingly this means on keyup we can trigger a redraw of the brush.

Well actually the SHIFT key when dragging a window (which is probably a better analogy than dragging the screenshot region) causes it to preserve the aspect ratio, not to lock x or y.

I’m going to punt on this for now because it doesn’t seem essential.

Reopening. It would be nice to support this, at the very least for dragging so that you can lock to x- or y-translation. I’m fine punting on the SHIFT to preserve the aspect ratio when resizing.