npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@digieggs/rn-polygon-chart

v1.0.5

Published

Customizable and animatable polygon chart.

Downloads

53

Readme

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

| Type | Required | Description | | --------------------------------------- | -------- | ------------------------------------------------------------------ | | IAnimationParams | no | Object that specifies the details of the polygon render animation. |


innerColor

| Type | Required | Description | | -------- | -------- | -------------------------- | | string | no | Fill color of the polygon. |


innerOpacity

| Type | Required | Description | | -------- | -------- | ---------------------------- | | number | no | Fill opacity of the polygon. |


outerStroke

| Type | Required | Description | | --------------------------- | -------- | -------------------------------------- | | ILineProps | no | Props for outer stroke of the polygon. |


poles

| Type | Required | Description | | ------------------------ | -------- | ---------------------------------------- | | Array<IPole> | yes | An array of details to draw the polygon. |


style

| Type | Required | Description | | ----------- | -------- | --------------------------------- | | ViewStyle | no | Style of the polygon's container. |


Essential types and interfaces

ILineProps

| Props | Type | Required | | ------------- | -------- | -------- | | stroke | string | no | | strokeWidth | number | no | | opacity | number | no |

  • The stroke prop is being used for line color.

IPole

| Props | Type | Required | | ------------- | ----------------- | -------- | | score | number | yes | | info | IInfo | no | | stroke | ILineProps | no | | innerStroke | ILineProps | no |

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

IInfo

| Props | Type | Required | | ----------- | --------------------- | -------- | | text | string | no | | textStyle | TextStyle | no | | style | ViewStyle | no | | onPress | () => void | no | | offset | IOffset | no |

  • The offset prop determines the absolute x and y offsets of info element.

IOffset

| Props | Type | Required | | ----- | -------- | -------- | | x | number | yes | | y | number | yes |


IAnimationParams

| Props | Type | Required | | ---------- | ---------------- | -------- | | delay | number | no | | duration | number | no | | easing | EasingFunction | no |