Skip to content

Commit

Permalink
feat: rename props defaultShowTooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
xile611 committed Jul 5, 2018
1 parent 173cc83 commit 7f4bd29
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 1.0.0(Jul 05, 2018)

### fix

- #1195 Replace axis scale value `utcTime` with `utc`
- Clip dots of <Line />


### refactor

- use lodash-es for es6 build

### feat

- Add touchStart & touchEnd event handling
- Add explicit prop `defaultShowTooltip` to activate tooltip

## 1.0.0-beta.10(Jan 31, 2018)

### fix
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recharts",
"version": "1.0.0-beta.10",
"version": "1.0.0",
"description": "React charts",
"main": "lib/index",
"module": "es6/index",
Expand Down
5 changes: 3 additions & 2 deletions src/chart/generateCategoricalChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const generateCategoricalChart = ({
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]),
defaultShowTooltip: PropTypes.bool,
onClick: PropTypes.func,
onMouseLeave: PropTypes.func,
onMouseEnter: PropTypes.func,
Expand Down Expand Up @@ -96,7 +97,7 @@ const generateCategoricalChart = ({
* @return {Object} Whole new state
*/
static createDefaultState = (props) => {
const { children, isTooltipActive } = props;
const { children, defaultShowTooltip } = props;
const brushItem = findChildByType(children, Brush);
const startIndex = (brushItem && brushItem.props && brushItem.props.startIndex) || 0;
const endIndex = (brushItem && brushItem.props && brushItem.props.endIndex)
Expand All @@ -107,7 +108,7 @@ const generateCategoricalChart = ({
dataStartIndex: startIndex,
dataEndIndex: endIndex,
activeTooltipIndex: -1,
isTooltipActive: isTooltipActive || false,
isTooltipActive: !_.isNil(defaultShowTooltip) ? defaultShowTooltip : false,
};
};

Expand Down

0 comments on commit 7f4bd29

Please sign in to comment.