1.0.0 • Published 5 years ago

react-dragon-curve v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

React component for a Heighway Dragon dragon curve

React Dragon Curve

npm version npm Downloads license

Installation

npm install react-pgn-viewer --save

Usage

Add this style or similar to your project

  .konvajs-content {
    border: 3px solid #e02626;
    background-color: #000814;
  }

then

import DragonCurve from 'react-dragon-curve'

class Example extends React.Component {
  render() {
    return (
      <DragonCurve
        height={600}
        width={600}
        controlClassnames={{
          controlContainer: 'button-container',
          controlStart: 'btn btn-primary',
          controlReset: 'btn btn-warning',
          controlPause: 'btn btn-warning',
        }}
        strokeWidth={2}
        strokeColor={'#d3dee2'}
        lineLength={25}
        animationSpeed={1500}
      />
    )
  }
}

Properties

This library uses react-konva for the canvas and drawing and shares a few props.

PropTypeDefaultExplanation
heightnumber (px)600Height of background canvas
widthnumber (px)600Width of background canvas
strokeColorstring (hex)'#d3dee2'Line Color
strokeWidthnumber (px)2Line Width
lineLengthnumber (px)50Length of each individual line
animationSpeednumber (ms)1000Animation duration in between each iteration in ms
controlClassnamesobject{ controlContainer: '', controlStart: '', controlReset: '', controlPause: '' }classnames for the control buttons

Demo

To be added

Contributing

To run the example:

npm install
npm run build
npm run dev

Then open localhost:8000 in a browser.

Tested with React 16.6

1.0.0

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

6 years ago