How to use the react-art.Path function in react-art

To help you get started, weโ€™ve selected a few react-art examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github circuitsim / circuit-simulator / src / components / utils / DrawingUtils.js View on Github external
drawCircle(p1: Vector, p2: Vector) {
    const v = utils.diff(p1, p2);
    const radius = v.length() / 2;

    return new Path()
        .moveTo(p1.x, p1.y)
        .arc(-v.x, -v.y, radius, radius)
        .arc(v.x, v.y, radius, radius)
        .close();
  },

react-art

React ART is a JavaScript library for drawing vector graphics using React. It provides declarative and reactive bindings to the ART library. Using the same declarative API you can render the output to either Canvas, SVG or VML (IE8).

MIT
Latest version published 19 days ago

Package Health Score

95 / 100
Full package analysis