pan(domNode, direction) {
let speed = 20;
let translateCoords = d3.zoomTransform(domNode.attr("transform", `translate(${translateX}, ${translateY})`));
if (direction == 'left' || direction == 'right') {
translateX = direction == 'left' ? translateCoords.x + speed : translateCoords.x - speed;
translateY = translateCoords.y;
} else if (direction == 'up' || direction == 'down') {
translateX = translateCoords.x;
translateY = direction == 'up' ? translateCoords.y + speed : translateCoords.y - speed;
}
domNode.attr("transform", `translate(${translateX}, ${translateY})`);
},