Giter VIP home page Giter VIP logo

charts-trial's Introduction

Multi Channel Random Data Charts

Tools

  • React
  • Typescript
  • Vite
  • framer-motion
  • react-icons
  • Tailwind.css

Usage

Control buttons

You can declare the channel count and control the iteration. When you click start, timer will start and the stop button will be available to click. Control Buttons

Chart

You can see the random data on the charts. You can click the save button and set name of the file and a json file will be downloaded. When you click to load button and select your file or drag & drop to over the button. Chart Component


Project Structure

Folder structure in src folder : Folder Structure

App.tsx

App component contains 4 state.

generatorInverval : interval for generating new random number count : count of channel(s) data: 2 dimensional array for storing data timer : timer for generating new random number App.tsx States

useEffect

this use effect is using for that when we change the count value then it will add or remove the channel App.tsx useEffect

Start,Stop and Reset Functions

This functions using for control buttons. ![[Pasted image 20231130124350.png]]


Chart.tsx

Chart code part 1 Chart code part 2 Chart component takes 2 argument as title and data and shows the data with other components


ItemChart.tsx

This component is the Bar of the BarChart. Alt text getRGB function returns a RGB value for background color of the bar. Its running like a hash function because its returns the same color for same value therefore when you upload a saved state, you can see the same chart.


DataControls.tsx

DataControls component is using for the save/load process. Data Control buttons for (save/load)

For more detail you can inspect the code , I added many comment lines

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.