Skip to content

Commit

Permalink
Add manual expand feature (#20)
Browse files Browse the repository at this point in the history
* Upgraded React version, along with peer deps (couldn't resolve one peer dep warning). Added expandedIndex prop so you can manually control which piece is expanded.
* Updated docs to include expandedIndex prop
* Added requestAnimationFrame shim, and setup enzyme adapter to work with React 16
  • Loading branch information
tnormington authored and Cédric Delpoux committed Apr 27, 2018
1 parent 9992119 commit 15400e1
Show file tree
Hide file tree
Showing 10 changed files with 15,299 additions and 15 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ const MyCompo = () => (
| Name | PropType | Description | Default |
| ------------------------ | --------------------- | ------------------------------------------------------------------------------------------------------------ | ---------- |
| data | Array of data Objects | One data is {value: number (required), color: string, title: string, expanded: bool} | [] |
| expandedIndex | Number | Pass in an index to manually control the expanded pie of the pie | -1 |
| expandOnHover | Boolean | Active hover and touch (mobile) effetcs | false |
| onSectorHover | Function | Callback when one sector is hovered or touched (mobile) - ex: `(data, index, event) => {}` | null |
| expandSize | Number | expand size, in pixels. Used if `expandOnHover` is active or one data has `expanded` attribute set to `true` |
| expandSize | Number | expand size, in pixels. Used if `expandOnHover` is active or one data has `expanded` attribute set to `true` | |
| strokeColor | String | Sector stroke color | "#fff" |
| strokeLinejoin | String | Sector stroke line join (One of `miter`, `round`, `bevel`) | "round" |
| strokeWidth | Number | Sector width, in pixels (0 to disable stroke) | 1 |
Expand Down
4 changes: 3 additions & 1 deletion jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
},
"moduleNameMapper": {
"\\.(css)$": "<rootDir>/node_modules/jest-css-modules"
}
},
"setupFiles": ["<rootDir>/shim.js", "<rootDir>/setup.js"],
"coveragePathIgnorePatterns": ["/node_modules/", "/shim.js"]
}
Loading

0 comments on commit 15400e1

Please sign in to comment.