
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
react-sparklines-typescript-v2
Advanced tools
react-sparklines rewritten in typescript and modern react patterns
:heavy_exclamation_mark: Original Repo: https://github.com/borisyankov/react-sparklines - The original react-sparklines has not been updated for 3 years. This is a rewrite of the original library into Typescript and modern react classless components. The package is smaller and faster.
Live demos and docs: borisyankov.github.io/react-sparklines/
npm install react-sparklines-typescript-v2 --save
Import the Sparklines components that you need; for example to generate a simple chart:
import { Sparklines } from 'react-sparklines-typescript-v2';
...
<Sparklines data={[5, 10, 5, 20, 8, 15]} limit={5} width={100} height={20} margin={5}>
</Sparklines>
Sparklines component is a container with the following properties:
data - the data set used to build the sparkline
limit - optional, how many data points to display at once
width, height - dimensions of the generated sparkline in the SVG viewbox. This will be automatically scaled (i.e. responsive) inside the parent container by default.
svgWidth, svgHeight - If you want absolute dimensions instead of a responsive component set these attributes.
preserveAspectRatio - default: 'none', set this to modify how the sparkline should scale
margin - optional, offset the chart
min, max - optional, bound the chart
import { Sparklines, SparklinesLine } from 'react-sparklines-typescript-v2';
...
<Sparklines data={[5, 10, 5, 20]}>
<SparklinesLine color="blue" />
</Sparklines>
import { Sparklines, SparklinesBars } from 'react-sparklines-typescript-v2';
...
<Sparklines data={[5, 10, 5, 20]}>
<SparklinesBars />
</Sparklines>
import { Sparklines, SparklinesLine, SparklinesSpots } from 'react-sparklines-typescript-v2';
...
<Sparklines data={sampleData}>
<SparklinesLine style={{ fill: "none" }} />
<SparklinesSpots />
</Sparklines>
import { Sparklines, SparklinesLine, SparklinesReferenceLine, SparklinesReferenceLineTypes } from 'react-sparklines-typescript-v2';
...
<Sparklines data={sampleData}>
<SparklinesLine />
<SparklinesReferenceLine type={SparklinesReferenceLineTypes.mean} />
</Sparklines>
import { Sparklines, SparklinesLine, SparklinesNormalBand } from 'react-sparklines-typescript-v2';
...
<Sparklines data={sampleData}>
<SparklinesLine style={{ fill: "none" }}/>
<SparklinesNormalBand />
</Sparklines>
FAQs
react-sparklines rewritten in typescript and modern react patterns
The npm package react-sparklines-typescript-v2 receives a total of 38 weekly downloads. As such, react-sparklines-typescript-v2 popularity was classified as not popular.
We found that react-sparklines-typescript-v2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.