1.0.37 β€’ Published 1 year ago

react-tooltip-bubble-chart v1.0.37

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

react-tooltip-bubble-chart

FILES LICENSE DOWNLOADS

This is a bubble chart component that includes a tooltip using d3. I created a component based on React and Typescript by referring to the open source Draw a bubble chart. When the mouse hovers over the bubble chart object, the contents inside the bubble chart are displayed as a tooltip. You can also customize the movement of the bubble chart through the move setting. This library can be an excellent choice for data visualization. I hope this is what you were looking for.

✨ Features

  • ✌ Written TypeScript
  • βœ… Available in React
  • πŸ’¬ Possible Fine text alignment
  • πŸŒ€ Available Interactive motion
  • πŸ’… Can Custom each bubble chart object
  • 🌟 Can check the contents of the object as a tooltip

πŸ”§ Installation

npm install react-tooltip-bubble-chart #npm

πŸ“¦ Example

Example

import "./App.css";
import BubbleChart from "react-tooltip-bubble-chart";

function Example() {
  const bubbleData = [
    {
      fillColor: "rgb(52, 202, 173, 0.3)",
      id: 5,
      name: "Setting\nme",
      size: 50,
      dYdX1: { dy: -2, dx: -3 },
      dYdX2: { dy: 8, dx: -20 },
    },
    {
      fillColor: "rgb(52, 202, 173, 0.3)",
      id: 6,
      name: "Getting\nStart",
      size: 120,
      dYdX1: { dy: -2, dx: -4 },
    },
    {
      fillColor: "rgb(52, 202, 173, 0.3)",
      id: 7,
      name: "Setting\nme",
      size: 50,
      dYdX1: { dy: -2, dx: -3 },
      dYdX2: { dy: 8, dx: -20 },
    },
  ];

  return (
    <div>
      <BubbleChart
        bubblesData={bubbleData}
        width={700}
        height={470}
        textFillColor="#717C84"
        backgroundColor="white"
        minValue={1}
        maxValue={150}
        move={true}
      />
    </div>
  );
}

export default Example;

βœ” Bubble Chart DataType

export namespace BubbleChartTypes {
  export type Data = {
    fillColor: string;
    id: number;
    name: string;
    size: number;
    dYdX1: { dy: number; dx: number };
    dYdX2: { dy: number; dx: number };
    dYdX3: { dy: number; dx: number };
  };
}

πŸ‘€ Props

PropDescriptionTypeTest
bubblesDataAn array of text and setting values ​​for the bubble chartarraybubblesData[]
moveBubble chart animation settings dropdownbooleantrue
widthWidth of the entire area of ​​the bubble chartnumber700
heightHeight of the entire area of ​​the bubble chartnumber470
backgroundColorSet background color behind bubble chartstringwhite
textFillColorChange the color of the text inside the bubble chartstring#717C84
minValueBubble chart minimum weight valuenumber1
maxValueBubble chart maximum weight value callbacknumber150

β­• Test

If you need intuitive usage, you can try this library right away through Storybook. You can check the operation more intuitively. Please refer to the information below.

✨Awsome Storybook Page✨

If you want to run it yourself, follow the command below.

  cd /storybook && npm run storybook

πŸ“œ License

MIT License

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.1.0

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago