0.1.97 • Published 8 months ago

simple-bubble-chart v0.1.97

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

Simple Bubble Chart

Simple Bubble Chart is a lightweight JavaScript library that allows you to create and display bubble charts effortlessly. It provides components for individual bubbles and a container to organize and visualize multiple bubbles.

Installation

You can install Simple Bubble Chart using npm:

npm install simple-bubble-chart

Usage

Importing the Components

To use Simple Bubble Chart, import the necessary components as follows:

import Bubble from "simple-bubble-chart/Bubble";
import BubbleChartContainer from "simple-bubble-chart/BubbleChartContainer";

Creating a Bubble

To create an individual bubble, use the Bubble component with the following props:

  • title (String): The title of the bubble.
  • titleColor (String): The color of the title text.
  • subTitle (String): The subtitle of the bubble.
  • subTitleColor (String): The color of the subtitle text.
  • backgroundColor (String): The background color of the bubble.
  • size (Number): The size of the bubble.

Example:

<Bubble
  title="Some title"
  titleColor="some color"
  subTitle="Some subtitle"
  subTitleColor="subtitle color"
  backgroundColor="bubble background color"
  size={bubbleSize}
/>

Creating a Bubble Chart

To create a bubble chart, use the BubbleChartContainer component with the following props:

  • bubbles (Array): An array of components or other elements to be displayed within the chart.
  • height (Number): The height of the chart container.
  • width (Number): The width of the chart container.
  • elementSize (Number): The default size for bubbles within the chart.

Example:

<BubbleChartContainer
  bubbles={
    [
      // Insert Bubble Components or other elements here
    ]
  }
  height={500}
  width={500}
  elementSize={150}
/>

Example

Here's a complete example of how to use Simple Bubble Chart to create a bubble chart:

import React from "react";
import Bubble from "simple-bubble-chart/Bubble";
import BubbleChartContainer from "simple-bubble-chart/BubbleChartContainer";

function BubbleChartExample() {
  return (
    <BubbleChartContainer
      bubbles={[
        <Bubble
          title="Bubble 1"
          titleColor="#FF5733"
          subTitle="Subtitle 1"
          subTitleColor="#3366FF"
          backgroundColor="#FFD700"
          size={100}
        />,
        // Add more bubbles here
      ]}
      height={150}
      width={150}
      elementSize={150}
    />
  );
}

export default BubbleChartExample;
0.1.97

8 months ago

0.1.96

8 months ago

0.1.95

8 months ago

0.1.94

8 months ago

0.1.93

8 months ago

0.1.92

8 months ago

0.1.91

8 months ago

0.1.9

8 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago

0.0.91

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago