A React component for rendering a parametric SVG
npm install react-parametric-svgThis is a React component to render a parametric SVG.
It should be considered at an early stage of development, and may contain bugs.
Install using npm install react-parametric-svg.
Render using default parameter values:
``jsx
import React from 'react';
import {ParametricSVG} from 'react-parametric-svg';
const ExampleComponent = () => {
const defaultSVGString = xmlns="http://www.w3.org/2000/svg"
xmlns:parametric="https://parametric-svg.github.io/v0.2"
width="500"
height="500"
parametric:defaults="x=60;y=60;d=5">
;
return
}
`
You can provide an object of values for the parameters (you don't need to specify values for all of them, as the values you provide will be merged with the defaults specified in the SVG):
`jsx`
You can set innerOnly={true} to render just the contents of the SVG, not the actual SVG element itself.
This allows you to combine several parametric SVGs into a single SVG:
`jsx
``