react-raphael-scrawl

0.8.0 • Public • Published

react-raphael-scrawl

Version Downloads

so easy! create scrawl with react-raphael.

Install

# or specify the externals in webpack config
npm install --save raphael
# install react-raphael-scrawl in your react-raphael-scrawl project
npm install --save react-raphael-scrawl

Quickly Start

var React = require('react');
var ReactDOM = require('react-dom');
var Scrawl = require('react-raphael-scrawl');
    
class ScrawlApp extends React.Component {
    handleClick(){
        this.refs.scrawl.clear();
    }
    render(){
        return (<div>
        <div>
                <button onClick={this.handleClick.bind(this)}>清除画布</button>
        </div>        
        <Scrawl ref="scrawl" width={500} height={600} attr={{"stroke": "#000","stroke-width": 6}} />
        </div>)
    }
}
 
ReactDOM.render(<div>
                <ScrawlApp />
                </div>,document.getElementById("react-container"));

API

All Scrawl Props

All Scrawl Ref

  • clear function clear all scrawl path

Contact

Email: liuhong1.happy@163.com

Package Sidebar

Install

npm i react-raphael-scrawl

Weekly Downloads

1

Version

0.8.0

License

MIT

Last publish

Collaborators

  • liuhong1happy