d3.js Drag and Zoom
<!DOCTYPE html> <meta charset="utf-8"> <style> .dot circle { fill: lightsteelblue; stroke: steelblue; stroke-width: 1.5px; } .dot circle.dragging { fill: red; stroke: brown; } .axis line { fill: none; stroke: #ddd; shape-rendering: crispEdges; vector-effect: non-scaling-stroke; } </style> <body> <script src="//d3js.org/d3.v3.min.js"></script> <script> var margin = {top: -5, right: -5, bottom: -5, left: -5}, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; var zoom = d3.