Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

circle-divided-by-chord

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

circle-divided-by-chord

Circle divided by chord.

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by40%
Maintainers
1
Weekly downloads
 
Created
Source

Circle divided by chord

Circle divided by chord.

NPM JavaScript Style Guide

Install

npm install --save circle-divided-by-chord

or

yarn add circle-divided-by-chord

Usage

Basic example

import * as React from "react";
import CircleDividedByChord from "circle-divided-by-chord";

class Example extends React.Component {
  render() {
    return <CircleDividedByChord />;
  }
}

Example 1

Another example

import * as React from "react";
import CircleDividedByChord from "circle-divided-by-chord";
import { random, range } from "lodash";

function getRandomColor() {
  return `hsl(${parseInt(256 * Math.random())}, 70%, 85%, 1)`;
}

class Example extends React.Component {
  render() {
    return (
      <div className="pa2">
        {range(56).map(i => {
          const datum1 = random(0, 100, true);
          const datum2 = random(0, 100, true);
          const angle = random(0, 360, true);
          const color1 = getRandomColor();
          const color2 = getRandomColor();

          return (
            <CircleDividedByChord
              key={i}
              radius={30}
              datum1={datum1}
              datum2={datum2}
              angle={angle}
              color1={color1}
              color2={color2}
            />
          );
        })}
      </div>
    );
  }
}

Example 2

Props

Props are all optional:

Prop nameTypeDefault valueWhat is
color1string#8DC0B1color of the first section
color2string#F3E0D2color of the second section
radiusnumber200radius of the circle (px)
datum1number20first datum
datum2number80second datum
anglenumber135angle of the chord

License

MIT © ilariaventurini

FAQs

Package last updated on 20 Sep 2019

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