Skip to content

Commit

Permalink
Merge pull request #857 from Abhinandan-Kushwaha/development
Browse files Browse the repository at this point in the history
v1.4.43 Added left n right press to popn pyramid charts
  • Loading branch information
Abhinandan-Kushwaha authored Sep 29, 2024
2 parents 871b8bd + 94c08ad commit 8f7d606
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/PopulationPyramid/PopulationPyramid.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
| barBorderRadius | number | boder radius of the bars | 0 |
| leftBarBorderRadius | number | boder width of the bars displayed in the left half of the pyramid | 0 |
| rightBarBorderRadius | number | boder width of the bars displayed in the right half of the pyramid | 0 |
| onLeftPress | (item, index) => void | Callback function called when a left bar is pressed. Takes 2 params- item and index. | \_ |
| onRightPress | (item, index) => void | Callback function called when a right bar is pressed. Takes 2 params- item and index. | \_ |
| allCornersRounded | boolean | when set to true, border radius will apply to all the four corners of the bars, else applied only on outer edges | false |
| showSurplus | boolean | shows surplus values on the edges in highlighted colors (extra width of the bigger bar is highlighted ) | false |
| showSurplusLeft | boolean | shows surplus values on the left edges in highlighted colors (extra width of the bigger bar is highlighted ) | \_ |
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-gifted-charts",
"version": "1.4.42",
"version": "1.4.43",
"description": "The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar and Population Pyramid charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
"main": "dist/index.js",
"files": [
Expand All @@ -25,7 +25,7 @@
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
"gifted-charts-core": "0.1.42"
"gifted-charts-core": "0.1.43"
},
"devDependencies": {
"@babel/cli": "^7.24.8",
Expand All @@ -50,10 +50,10 @@
"typescript": "^5.5.4"
},
"peerDependencies": {
"expo-linear-gradient": "*",
"react": "*",
"react-native": "*",
"react-native-linear-gradient": "*",
"expo-linear-gradient": "*",
"react-native-svg": "*"
},
"peerDependenciesMeta": {
Expand Down
11 changes: 11 additions & 0 deletions release-notes/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 🎉 1.4.43

1. Added `onLeftPress` and `onRightPress` props to Population charts. See https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/discussions/855
2. Fix BarChart crash when maxValue is 0. Thanks to [sakisdog](https://github.com/sakisdog) for the PR- https://github.com/Abhinandan-Kushwaha/gifted-charts-core/pull/55

---

---

---

# 🎉 1.4.42

## ✨ Features added-
Expand Down
2 changes: 2 additions & 0 deletions src/PopulationPyramid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export const PopulationPyramid = (props: PopulationPyramidPropsType) => {
fill={item.leftBarColor ?? leftBarColor}
stroke={item.leftBarBorderColor ?? leftBarBorderColor}
strokeWidth={leftBorderWidth}
onPress={() => props.onLeftPress?.(item, index)}
/>
<ClipPath id={'cp-left' + index}>
<Rect {...leftBarCommonProps} />
Expand Down Expand Up @@ -384,6 +385,7 @@ export const PopulationPyramid = (props: PopulationPyramidPropsType) => {
fill={item.rightBarColor ?? rightBarColor}
stroke={item.rightBarBorderColor ?? rightBarBorderColor}
strokeWidth={rightBorderWidth}
onPress={() => props.onRightPress?.(item, index)}
/>
<ClipPath id={'cp-right' + index}>
<Rect {...rightBarCommonProps} />
Expand Down

0 comments on commit 8f7d606

Please sign in to comment.