lineRender.js 270 B

12345678910
  1. import { nth } from 'lodash-es';
  2. export const lineRender = ({ start, end, color, ctx }) => {
  3. ctx.strokeStyle = color;
  4. ctx.beginPath();
  5. ctx.setLineDash([3, 2]);
  6. ctx.moveTo(nth(start, 0), nth(start, 1));
  7. ctx.lineTo(nth(end, 0), nth(end, 1));
  8. ctx.stroke();
  9. };