New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@digieggs/rn-polygon-chart

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digieggs/rn-polygon-chart

Customizable and animatable polygon chart.

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

React Native Polygon Chart

DIGIEGGS - RNPolygonChart stars - RNPolygonChart forks - RNPolygonChart

Unit Tests GitHub tag License issues - RNPolygonChart

Customizable and animatable polygon chart.

Getting started

Installation

React Native CLI
npm install react-native-svg @digieggs/rn-polygon-chart

or

yarn add react-native-svg @digieggs/rn-polygon-chart
Expo CLI
expo install react-native-svg
expo install @digieggs/rn-polygon-chart
Additional steps
  • iOS

In your project's ios directory

pod install
  • Android

No additional steps needed

Usage

Import
import {
  Hexagon,
  Pentagon,
  Tetragon,
  Triangle,
} from 'react-native-polygon-chart';
Usage
<Triangle
  poles= {[
    {
      score: 0.8,
      innerStroke: {opacity: 1, stroke: "#30d158", strokeWidth: 2},
      stroke: {opacity: 1, stroke: "#0a84ff"},
    },
    {
      score: 0.6,
      innerStroke: {opacity: 1, stroke: "#30d158", strokeWidth: 2},
      stroke: {opacity: 1, stroke: "#0a84ff"},
    },
    {
      score: 0.9,
      innerStroke: {opacity: 1, stroke: "#30d158", strokeWidth: 2},
      stroke: {opacity: 1, stroke: "#0a84ff"},
    },
  ]}
  innerColor="#30d158"
  innerOpacity={0.2}
  outerStroke={{stroke: green, opacity: 1, strokeWidth: 1}}
  animation={{delay: 0, duration: 500}}
  style={styles.triangle}
/>

...

const styles = StyleSheet.create({
  triangle: {width: 300, height: 600},
});

You can use more poles for other polygons or polygon will render as if remaining scores are zero.

polygon2

Props

animation

TypeRequiredDescription
IAnimationParamsnoObject that specifies the details of the polygon render animation.

innerColor

TypeRequiredDescription
stringnoFill color of the polygon.

innerOpacity

TypeRequiredDescription
numbernoFill opacity of the polygon.

outerStroke

TypeRequiredDescription
ILinePropsnoProps for outer stroke of the polygon.

poles

TypeRequiredDescription
Array<IPole>yesAn array of details to draw the polygon.

style

TypeRequiredDescription
ViewStylenoStyle of the polygon's container.

Essential types and interfaces

ILineProps

PropsTypeRequired
strokestringno
strokeWidthnumberno
opacity numberno
  • The stroke prop is being used for line color.

IPole

PropsTypeRequired
scorenumberyes
infoIInfono
strokeILinePropsno
innerStrokeILinePropsno
  • The point prop is a multiplier between 0 and 1 determines the vertex distance from the center of the polygon.

IInfo

PropsTypeRequired
textstringno
textStyleTextStyleno
styleViewStyleno
onPress() => voidno
offsetIOffsetno
  • The offset prop determines the absolute x and y offsets of info element.

IOffset

PropsTypeRequired
xnumberyes
ynumberyes

IAnimationParams

PropsTypeRequired
delaynumberno
durationnumberno
easingEasingFunctionno

Keywords

FAQs

Package last updated on 27 Dec 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc