react-dicision-tree
react dicision tree component.
features
- css3/js only, no images needed
- fully customizable
- umd/minified css
use
npm i --save-dev react-dicision-tree
// or import the jsx// import DTree from 'react-dicision-tree/src/react-dicision-tree.jsx' // or import the stylus// import 'react-dicision-tree/src/style.styl'// or just style it yourself state = data: {} { return <div style= minHeight: 5000 position: 'relative' > <DTree data=thisstatedata /> </div> }
check test.data.js for data structure
more props, read src for detail
showAllChildren: PropTypes.bool,
caretRender: PropTypes.func,
conditionRender: PropTypes.func,
renderYesLabel: PropTypes.func,
renderNoLabel: PropTypes.func,
renderTitle: PropTypes.func
get/dev
git clone git@github.com:zxdong262/react-dicision-tree.gitcd react-dicision-tree # deps install npm inpm i react react-dom # start dev auto rebuild when code change) npm start# then edit src/*.jsx to see changes # test and create code coverage npm run test
License
MIT