title: SVG / Canvas :: shape-rendering="crispEdges" via JavaScript?
body: <p>I want to turn off anti-aliasing and I believe I need to set <strong>shape-rendering</strong> to <em>"crispEdges"</em> for that.</p>
  
  <p>How can I do that with <strong><em>JavaScript</em></strong> ?</p>
  
  <p>This a a part of my code where I need turn off anti-aliasing:</p>
  
  <pre><code>context.strokeStyle = gradient;
  context.lineWidth = 1;
  context.moveTo(x + size, y + size);
  context.lineTo(x + dx, y + dy);
  context.stroke();
  </code></pre>
  
  <p>So lines should look like the one on right, and not other one on left.</p>
  
  <p><img src="https://i.stack.imgur.com/QgIJA.png" alt="enter image description here"></p>
  
  <p>Every help would be greatly appreciated!</p>