Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mid = midPoint(...dragPoints),
dir = direction(...dragPoints),
offsetDir = dir.perpendicular().invert(),
offsetAngle = dir.angle(),
offsetLength = CircuitComponent.width / 2,
textWidth = CONTEXT.measureText(label).width,
extraX = Math.sin(offsetAngle) * (textWidth / 2),
extraY = -Math.cos(offsetAngle) * (FONT_SIZE / 2),
offset = offsetDir.multiply(offsetLength).add(new Vector(extraX, extraY)),
textPos = mid.add(offset),
t = new Transform().moveTo(textPos.x, textPos.y - FONT_SIZE / 2);
return (
);
};
import React from 'react';
import ReactART from 'react-art';
import Rectangle from 'react-art/lib/Rectangle.art';
import ReactDOM from 'react-dom';
import QRCode from 'react-qr-code';
ReactDOM.render(
,
document.getElementById('Container')
);