https://github.com/jkuri/react-realtime-chart

A lightweight, customizable time-series chart component for React applications based on WebGL.

https://github.com/jkuri/react-realtime-chart

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.1%) to scientific vocabulary

Keywords

chart d3 react realtime time-series webgl
Last synced: 5 months ago · JSON representation

Repository

A lightweight, customizable time-series chart component for React applications based on WebGL.

Basic Info
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
chart d3 react realtime time-series webgl
Created 10 months ago · Last pushed 6 months ago
Metadata Files
Readme License

README.md

React Realtime Chart

A lightweight, customizable real-time chart component for React applications based on WebGL.

Demo

Live Preview

Installation

bash npm install react-realtime-chart

Usage

```tsx import RealtimeChart, { type RealtimeChartData, type RealtimeChartOptions } from "react-realtime-chart"; import { useEffect, useState } from "react";

const randomInt = (min: number, max: number) => { return Math.floor(Math.random() * (max - min + 1)) + min; };

const generateRandomRealtimeData = (n = 10, step = 1, min = 0, max = 100, date = new Date()) => { return Array.from(Array(n).keys()) .map((_, i) => ({ date: new Date(date.getTime() - i * step * 1000), value: randomInt(min, max), })) .reverse(); };

function Demo() { const [data, setData] = useState([ [...generateRandomRealtimeData(120, 1, 10, 90)] ]);

const options: RealtimeChartOptions = { margin: { top: 10, right: 25, bottom: 25, left: 50 }, colors: ["#171717"], lines: [{ area: false }], yGrid: { min: 0, max: 100, color: "#09090B", opacity: 0.03, tickNumber: 5, tickFormat: (v) => ${v}%, tickPadding: 25, tickFontWeight: "normal", tickFontColor: "#171717", tickFontSize: 10, }, xGrid: { color: "#09090B", opacity: 0.03, tickNumber: 8, tickFontColor: "#171717", tickFontSize: 10, }, };

useEffect(() => { const interval = setInterval(() => { setData((prev) => { const data = [...prev]; data[0] = [...data[0], { date: new Date(), value: randomInt(10, 90) }]; return data; }); }, 1000);

return () => clearInterval(interval);

}, []);

return ; } ```

API Reference

RealtimeChart Props

| Prop | Type | Description | |------|------|-------------| | data | RealtimeChartData[][] | Array of data series to display on the chart | | options | RealtimeChartOptions | Configuration options for the chart |

RealtimeChartData

ts type RealtimeChartData = { date: Date; value: number; };

RealtimeChartOptions

ts type RealtimeChartOptions = { width?: number; // Chart width (defaults to container width) height?: number; // Chart height (defaults to container height) margin?: { // Chart margins top?: number; right?: number; bottom?: number; left?: number; }; fps?: number; // Frames per second for rendering (default: 24) timeSlots?: number; // Number of time slots to display (default: 60) lines?: RealtimeChartLineOptions[]; // Options for each line xGrid?: RealtimeChartGridOptions; // X-axis grid options yGrid?: RealtimeChartGridOptions; // Y-axis grid options colors?: string[]; // Array of colors for lines };

RealtimeChartLineOptions

ts type RealtimeChartLineOptions = { color?: string; // Line color opacity?: number; // Line opacity (0-1) lineWidth?: number; // Line width in pixels area?: boolean; // Whether to fill area under the line areaColor?: string; // Area fill color areaOpacity?: number; // Area fill opacity (0-1) curve?: string; // Curve type (linear, basis, cardinal, etc.) };

RealtimeChartGridOptions

ts type RealtimeChartGridOptions = { enable?: boolean; // Enable/disable grid color?: string; // Grid line color size?: number; // Grid line width dashed?: boolean; // Use dashed lines for grid opacity?: number; // Grid line opacity (0-1) ticks?: boolean; // Show tick marks tickNumber?: number; // Number of ticks to display tickPadding?: number; // Padding between tick and label tickFontSize?: number; // Tick label font size tickFontWeight?: string|number; // Tick label font weight tickFontColor?: string; // Tick label font color tickFontFamily?: string; // Tick label font family tickFontAnchor?: string; // Tick label text anchor min?: number | "auto"; // Minimum value (auto for data-based) max?: number | "auto"; // Maximum value (auto for data-based) tickValues?: string[]; // Custom tick values tickFormat?: string | Function; // Tick format function or string };

Features

  • Real-time data visualization with smooth animations and GPU acceleration (WebGL)
  • Customizable appearance (colors, line styles, grid, etc.)
  • Multiple data series support
  • Automatic scaling and time-based x-axis
  • Optimized rendering using WebGL for performance and GPU acceleration
  • Responsive design

License

MIT

Owner

  • Name: Jan Kuri
  • Login: jkuri
  • Kind: user
  • Location: Slovenia

GitHub Events

Total
  • Push event: 5
  • Create event: 3
Last Year
  • Push event: 5
  • Create event: 3

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 6
  • Total Committers: 1
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 6
  • Committers: 1
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jan Kuri j****8@g****m 6

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • npm 257 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 9
  • Total maintainers: 1
npmjs.org: react-realtime-chart

A lightweight, customizable real-time chart component for React applications based on WebGL

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 257 Last month
Rankings
Dependent repos count: 24.7%
Average: 30.2%
Dependent packages count: 35.7%
Maintainers (1)
Last synced: 6 months ago