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

@evanpatchouli/react-native-radar

v1.0.1

Published

A simple radar chart for react native applications

Downloads

29

Readme

react-native-radar

A simple radar chart for react-native.

Installation

npm i @evanpatchouli/react-native-radar react-native-svg

Example

const MyRadar = (
  <EvpRadar
    data={[100, 20, 30, 10, 40]}
    labels={["Aaa", "Bbb", "Ccc", "Ddd", "Eee"]}
    radius={100} // default: 100
    backgroundColor="rgba(0, 0, 200, 0.05)" //default: none
    strokeColor="rgba(0, 0, 200, 0.5)" // none
    strokeWidth={1.5} // default: 1
    strokeType="solid" // dashed
    dashArray={[5, 3]} // default: [10, 5]
    fillColor="rgba(0, 255, 255, 0.4)"
    labelProps={{ fill: "rgba(0, 0, 200, 0.3)" }}
    coefficient={1} // default: 1
    labelSpace={40} // default: 0
    border={{
      type: "polygon", // circle, none, default: none
      color: "rgba(0, 0, 200, 0.5)", // default: black
      width: 10, // default: 1
    }}
    Axis={{
      // default: none of axis
      type: "dashed", // solid, none
      width: 1, // default: 1
      color: "rgba(0, 0, 200,  0.2)", // default: grey
      dashArray: [5, 4], // default: [10, 5]
    }}
    ScaleLine={{
      // default: none of scale lines
      type: "solid", // solid, none
      number: 4,
      width: 1, // default: 1
      color: "rgba(0, 0, 200, 0.2)", // default: grey
      dashArray: [5, 4], // default: [20, 5]
    }}
  />
);

Props Api

You can learn from the table or the interface code at bottom.

Table of Props:

|Prop|Description|Type|Default| |---|---|---|---| |data|Data to be displayed in the radar chart|number[]|[]| |labels|Labels for each data|string[]|[]| |radius|Radius of the radar chart|number|100| |backgroundColor|Background color of the radar chart|string|"null"| |strokeColor|Color of the stroke|string|"black"| |strokeWidth|Width of the stroke|number|1| |strokeType|Type of the stroke|"solid" | "dashed"|"solid"| |dashArray|Dash array of the stroke|[number, number]|[10, 5]| |fillColor|Color of the fill area|string|"null"| |labelProps|Props for the labels|TextProps | ((idx: number) => TextProps)|{}| |coefficient|Coefficient for the data|number|1| |labelSpace|Space between the label and the radar chart|number|0| |border|Border of the radar chart|{ type: "circle" | "polygon" | "none"; width?: number; color?: string; }|{ type: "none" }| |Axis|Axis of the radar chart|{ type: "dashed" | "solid" | "none"; color?: string; width?: number; dashArray?: [number, number]; }|{ type: "none" }| |ScaleLine|Scale lines of the radar chart|{ number: number; type: "dashed" | "solid" | "none"; color?: string; width?: number; dashArray?: [number, number]; opacity?: number; }|{ type: "none" }|

Interface of RadarProps:

interface RadarProps {
  data: number[];
  labels: string[];
  /** @default: 100 */
  radius?: number;
  /** @default "null" */
  backgroundColor?: string;
  strokeColor?: string;
  /** @default 1 */
  strokeWidth?: number;
  /** @default "solid" */
  strokeType?: "solid" | "dashed";
  /** @default [10,5] */
  dashArray?: [number, number];
  /** @default 1 */
  strokeOpacity?: number;
  fillColor?: string;
  labelProps?: TextProps | ((idx: number) => TextProps);
  /** @default 1 */
  coefficient?: number;
  /** @default 0 */
  labelSpace: number;
  border?: {
    type: "circle" | "polygon" | "none";
    /** @default 1 */
    width?: number;
    /** @default "black" */
    color?: string;
  };
  Axis?: {
    type: "dashed" | "solid" | "none";
    color?: string;
    width?: number;
    /** @default [10,5] */
    dashArray?: [number, number];
  };
  ScaleLine?: {
    number: number;
    type: "dashed" | "solid" | "none";
    color?: string;
    width?: number;
    /** @default [20,5] */
    dashArray?: [number, number];
    opacity?: number;
  };
}