@nealrame/react-l-system
v0.1.0
Published
L-System for your React application.
Downloads
2
Readme
@nealRame/react-l-system
An implementation of Lindenmayer Systems for your React application.
Installation
> npm install @nealrame/react-l-system
Example
import * as React from "react"
import { LSystemSVGRenderer } from "@nealrame/l-system"
const app = () => {
return <LSystemSVGRenderer
axiom={["F", "-", "-", "F", "-", "-", "F"]}
productionRules={{
"F": ["F", "+", "F", "-", "-", "F", "+", "F"],
}}
renderingRules={{
"F": ["forward", 1],
"+": ["turn", Math.PI/3],
"-": ["turn", -Math.PI/3],
}}
steps="4"
backgroundColor="#171717"
strokeColor="#7ae4ff"
/>
}
Which should produce something like :