npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

infinity-trend

v0.0.3

Published

A React component designed for effortlessly creating smooth, responsive trend and line graphs.

Downloads

7

Readme

Graphing tools typically require significant expertise and time investment, particularly for complex data visualizations. For simpler tasks like crafting trend lines, this complexity can be overkill. Infinity Trend simplifies this process, offering a React component for creating smooth, responsive trend and line graphs with ease. It draws inspiration from the simplicity and functionality of react-trend, ensuring an intuitive and efficient user experience.

Why Infinity Trend?

  • Simplicity: Designed for ease of use, integrating seamlessly into your React applications.
  • Elegance: Produces clean, smooth trend lines that enhance the visual appeal of your projects.
  • Efficiency: Lightweight component, ensuring minimal impact on your application's performance.
  • Scalable. Uses SVG for sharp, scalable graphs. Will fill the parent container, or you can provide a fixed size.
  • Animatable. Support for on-mount animations where the trend graph draws from left to right.
  • Beautiful. Built-in gradient support, and customizable smoothing.
  • Tiny. Zero-dependency, gzips to <3kb.

Inspiration from the Industry

While "Infinity Trend" is designed to simplify the creation of elegant trend graphs, we draw inspiration from industry standards. Below are examples from well-known platforms that embody the sophistication and clarity we strive for:

GitHub Trend Example GitHub's approach to visualizing repository activity trends.

Twitter Analytics Trend Twitter's method of presenting analytics through trend graphs.

Infinity Trend Our approach to creating these graphs in a stunning and elegant manor.

These visualizations serve as benchmarks for the type of intuitive and straightforward graphs that "Infinity Trend" aims to enable developers to create with minimal effort.

Ideal Use Cases

  • Displaying user engagement trends over time.
  • Visualizing performance metrics in dashboards.
  • Enhancing reports with intuitive data trends.

Demo

Check out our playground to mess around with some graphs.


Get Started

Dive into the simplicity and elegance of Infinity Trend. Enhance your applications with meaningful trend graphs today. Contributions and feedback are welcome!

Installation

$ yarn add infinity-trend

# Alternatively:
$ npm i -S infinity-trend

UMD builds are also available via CDN and expose the component as Trend:

Quickstart

import Trend from 'infinity-trend';

// Simple example to get started
const MyComponent = () => <Trend data={[0, 10, 5, 22, 3.6, 11]} />;

API Reference

Basic Props

  • data (required): An array of y-axis values or objects with a value property. React Trend normalizes the data, ensuring even spacing.
  • width, height: Explicit dimensions for the SVG. Defaults to auto-sizing based on the parent container.
  • padding: Adjusts the space around the line to prevent cropping at high strokeWidth values. Default is 8.

Styling

  • SVG Props: Properties like stroke, strokeWidth, strokeOpacity, and others are passed directly to the SVG, allowing for extensive customization.
  • gradient: An array of color values for creating vertical gradients.

Animation

  • autoDraw: Animates the line drawing on mount. Customize with autoDrawDuration and autoDrawEasing.

Smoothing

  • smooth: Rounds out peaks for a smoother line. Adjust the curve with the radius property.

Examples

// Animated drawing with custom duration and easing
<Trend data={[120, 149, 193.4]} autoDraw autoDrawDuration={3000} autoDrawEasing="ease-in" />

// Gradient and smoothing for a visually appealing graph
<Trend data={[4, 6, 8]} gradient={['#0FF', '#F0F', '#FF0']} smooth radius={20} />