Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
react-native-svg-charts
Advanced tools
Customizable charts (Line, Bar, Area, Pie, Circle, Waterfall, Progress) for React Native
This library uses react-native-svg to render its graphs. Therefore this library is listed as a peerDependency
and needs to be installed AND linked into your project to work.
Creating beautiful graphs in React Native shouldn't be hard or require a ton of knowledge. With react-native-svg-charts we utilize the very popular d3 library to create our SVG paths and to calculate all coordinates.
This library currently provides the following chart components
import { AreaChart } from 'react-native-svg-charts'
const chart = () => (
<AreaChart
style={styles.flex1}
dataPoints={data.map(data => data.value)}
showPoints={false}
strokeColor={'white'}
strokeWidth={2}
renderGradient={({ id }) => (
<LinearGradient id={id} x1={'0'} y={'0'} x2={'0'} y2={`50%`}>
<Stop offset={'0'} stopColor={'blue'} stopOpacity={0.9}/>
<Stop offset={`1`} stopColor={'blue'} stopOpacity={0.3}/>
</LinearGradient>
)}
contentInset={{ bottom: 10, left: 15, top: 10, right: 15 }}
/>
)
Property | Default | Description |
---|---|---|
dataPoints | required | An array of integers - the data points you want plotted |
strokeColor | 'black' | PropTypes.string |
strokeWidth | 1 | PropTypes.number |
fillColor | 'none' | PropTypes.string |
dashArray | [ 5, 5] | PropTypes.arrayOf(PropTypes.number) |
showPoints | true | PropTypes.bool |
pointColor | 'white' | PropTypes.string |
renderGradient | () => {} | PropTypes.func (see this for more info) |
pointSize | 5 | PropTypes.number |
pointWidth | 5 | PropTypes.number |
animate | true | PropTypes.bool |
animationDuration | 300 | PropTypes.number |
style | undefined | PropTypes.any |
curve | foo | PropTypes.func |
contentInset | { top: 0, left: 0, right: 0, bottom: 0 } | PropTypes.shape |
numberOfTicks | 9 | PropTypes.number |
showGrid | true | PropTypes.bool |
gridMin | undefined | PropTypes.number |
gridMax | undefined | PropTypes.number |
intersections | [ ] | PropTypes.arrayOf(PropTypes.number) |
renderIntersection | () => {} | PropTypes.func |
Property | Default | Description |
---|---|---|
dataPoints | required | dataPoints: PropTypes.arrayOf(PropTypes.shape({ fillColor: PropTypes.string, strokeColor: PropTypes.string, strokeColorNegative: PropTypes.string, fillColorNegative: PropTypes.string, values: PropTypes.arrayOf(PropTypes.number).isRequired, })).isRequired, |
spacing | 0.05 | PropTypes.number |
strokeColor | 'black' | PropTypes.string |
strokeWidth | 1 | PropTypes.number |
fillColor | 'none' | PropTypes.string |
renderGradient | () => {} | PropTypes.func (see this for more info) |
animate | true | PropTypes.bool |
animationDuration | 300 | PropTypes.number |
style | undefined | PropTypes.any |
curve | foo | PropTypes.func |
contentInset | { top: 0, left: 0, right: 0, bottom: 0 } | PropTypes.shape |
numberOfTicks | 9 | PropTypes.number |
showGrid | true | PropTypes.bool |
gridMin | undefined | PropTypes.number |
gridMax | undefined | PropTypes.number |
intersections | [ ] | PropTypes.arrayOf(PropTypes.number) |
renderIntersection | () => {} | PropTypes.func |
Property | Default | Description |
---|---|---|
dataPoints | required | An array of integers - the data points you want plotted |
strokeColor | 'black' | PropTypes.string |
strokeWidth | 1 | PropTypes.number |
shadowColor | 'black' | PropTypes.string |
fillColor | 'none' | PropTypes.string |
dashArray | [ 5, 5] | PropTypes.arrayOf(PropTypes.number) |
showPoints | true | PropTypes.bool |
pointColor | 'white' | PropTypes.string |
pointSize | 5 | PropTypes.number |
pointWidth | 5 | PropTypes.number |
animate | true | PropTypes.bool |
animationDuration | 300 | PropTypes.number |
style | undefined | PropTypes.any |
curve | foo | PropTypes.func |
contentInset | { top: 0, left: 0, right: 0, bottom: 0 } | PropTypes.shape |
numberOfTicks | 9 | PropTypes.number |
showGrid | true | PropTypes.bool |
gridMin | undefined | PropTypes.number |
gridMax | undefined | PropTypes.number |
intersections | [ ] | PropTypes.arrayOf(PropTypes.number) |
renderIntersection | () => {} | PropTypes.func |
Property | Default | Description |
---|---|---|
dataPoints | required | PropTypes.arrayOf(PropTypes.shape({ color: PropTypes.string.isRequired, key: PropTypes.string.isRequired, value: PropTypes.number.isRequired, })).isRequired |
innerRadius | 0.5 | PropTypes.number |
padAngle | PropTypes.number | |
animate | true | PropTypes.bool |
animationDuration | 300 | PropTypes.number |
style | PropTypes.any | |
renderLabel | () => {} | PropTypes.func |
labelSpacing | 0 | PropTypes.number |
Property | Default | Description |
---|---|---|
progress | required | PropTypes.number.isRequired |
style | PropTypes.any | |
progressColor | 'black' | PropTypes.any |
startAngle | -Math.PI * 0.8 | PropTypes.number |
endAngle | Math.PI * 0.8 | PropTypes.number |
animate | true | PropTypes.bool |
animateDuration | 300 | PropTypes.number |
Property | Default | Description |
---|---|---|
dataPoints | required | dataPoints: PropTypes.arrayOf(PropTypes.shape({ fillColor: PropTypes.string, strokeColor: PropTypes.string, strokeColorNegative: PropTypes.string, fillColorNegative: PropTypes.string, values: PropTypes.arrayOf(PropTypes.number).isRequired, })).isRequired, |
spacing | 0.05 | PropTypes.number |
strokeColor | 'black' | PropTypes.string |
strokeWidth | 1 | PropTypes.number |
fillColor | 'none' | PropTypes.string |
renderGradient | () => {} | PropTypes.func (see this for more info) |
animate | true | PropTypes.bool |
animationDuration | 300 | PropTypes.number |
style | undefined | PropTypes.any |
curve | foo | PropTypes.func |
contentInset | { top: 0, left: 0, right: 0, bottom: 0 } | PropTypes.shape |
numberOfTicks | 9 | PropTypes.number |
showGrid | true | PropTypes.bool |
gridMin | undefined | PropTypes.number |
gridMax | undefined | PropTypes.number |
intersections | [ ] | PropTypes.arrayOf(PropTypes.number) |
renderIntersection | () => {} | PropTypes.func |
FAQs
Customizable charts (Line, Bar, Area, Pie, Circle, Progress) for React Native
The npm package react-native-svg-charts receives a total of 30,603 weekly downloads. As such, react-native-svg-charts popularity was classified as popular.
We found that react-native-svg-charts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.