0.2.5 • Published 1 year ago

techradar-component v0.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Techradar

npm GitHub top language npm GitHub GitHub issues GitHub last commit GitHub Repo stars

This is a TypeScript React component for displaying a tech radar, with customizable quadrants, rings, and items.

Contribution

To contribute to techradar-component, report issues on GitHub with details and steps to reproduce. For pull requests, follow coding guidelines, describe your changes, and ensure tests pass. Your participation helps improve the project for the community.

Installation

To install, run:

npm install techradar-component

or:

yarn add techradar-component

Usage

To use, import the TechRadar component from techradar-component and provide the necessary props:

import React from 'react';
import { TechRadar } from 'techradar-component';


type RadarProps = {
  quadrants: string[];
  rings?: string[];
  data?: {
    id: number;
    name: string;
    quadrant: string;
    ring: string;
  }[]
  width?: number;
  fontSize?: number;
  itemFontSize?: number;
  colorScaleIndex?: number;
  radiusDiminish?: number;
}

const setup: RadarProps  = {
    rings: ['adopt', 'trial', 'assess', 'hold'],
    quadrants: ['tools', 'techniques', 'platforms', 'languages'],
    data: [
      {
        id: 1,
        name: 'D3',
        quadrant: 'tools',
        ring: 'assess',
      },
      {
        id: 2,
        name: 'TypeScript',
        quadrant: 'languages',
        ring: 'trial',
      },
      {
        id: 3,
        name: 'Storybook',
        quadrant: 'tools',
        ring: 'adopt',
      },
    ],
  }

const MyComponent = () => {
  return (
    <TechRadar
      {...setup}
    />
  );
};

Props

PropTypeRequiredDefault valueDescription
quadrantsstring[]Yes-An array of strings representing the quadrants of the radar chart
ringsstring[]No-An array of strings representing the rings of the radar chart
dataDataType[]No-An array of objects with the following properties: id, name, quadrant, ring
widthnumberNo700pxThe width of the TechRadar component
fontSizenumberNo12pxThe radius of the radar chart
itemFontSizenumberNo12pxItem size differentiation than quadrant titles
colorScaleIndexnumberNo200The item fontSize
radiusDiminishnumberNo2The factor in which the rings are equal

License

This component is licensed under the MIT License.