Zurück zum Ranking

margelo/react-native-graph

TypeScriptmargelo.com

📈 Beautiful, high-performance Graphs and Charts for React Native built with Skia

animatedanimationbeautifulchartchartscryptographgraphslibrarylinegraphperformancereact
Sterne-Wachstum
Sterne
2.6k
Forks
136
Wochenwachstum
Issues
30
1k2k
Jan. 2023März 2024Mai 2025Juli 2026
Artefaktenpmnpm install react-native-graph
README
Nitro Modules

📈
react-native-graph

Beautiful, high-performance Graphs/Charts for React Native.

About

react-native-graph is a Line Graph implementation based on the high performance 2D graphics rendering engine "Skia". It's used in the Pink Panda Wallet app to power thousands of token graphs every day.

  • 🏎️ Faster and smoother than react-native-svg graphs
  • ⚡️ Native path interpolation in Skia
  • 🐎 Up to 120 FPS animations
  • 📈 Cubic bezier rendering for smoother edges
  • 👍 Smooth pan/scrubbing gesture
  • 💰 Made for crypto apps and Wallets
  • ❌ Does not block navigation, press or scroll animations

Installation

yarn add react-native-reanimated
yarn add react-native-gesture-handler
yarn add @shopify/react-native-skia
yarn add react-native-graph

Usage

function App() {
  const priceHistory = usePriceHistory('ethereum')

  return <LineGraph points={priceHistory} color="#4484B2" />
}

Configuration

animated

Whether to animate between data changes.

Animations are ran using the Skia animation system and are fully natively interpolated to ensure best possible performance.

If animated is false, a light-weight implementation of the graph renderer will be used, which is optimal for displaying a lot of graphs in large lists.

Example:

<LineGraph
  points={priceHistory}
  animated={true}
  color="#4484B2"
/>

enablePanGesture

Whether to enable the pan gesture.

Requires animated to be true.

There are three events fired when the user interacts with the graph:

  1. onGestureStart: Fired once the user presses and holds down on the graph. The pan gesture activates.
  2. onPointSelected: Fired for each point the user pans through. You can use this event to update labels or highlight selection in the graph.
  3. onGestureEnd: Fired once the user releases his finger and the pan gesture deactivates.

The pan gesture can be configured using these props:

  1. panGestureDelay: Set delay for the pan gesture to activate. Set to 0 to start immediately after touch. Defaults to 300.

Example:

<LineGraph
  points={priceHistory}
  animated={true}
  color="#4484B2"
  enablePanGesture={true}
  onGestureStart={() => hapticFeedback('impactLight')}
  onPointSelected={(p) => updatePriceTitle(p)}
  onGestureEnd={() => resetPriceTitle()}
/>

TopAxisLabel / BottomAxisLabel

Used to render labels above or below the Graph.

Requires animated to be true.

Usually this is used to render the maximum and minimum values of the Graph. You can get the maximum and minimum values from your graph points array, and smoothly animate the labels on the X axis accordingly.

Example:

<LineGraph
  points={priceHistory}
  animated={true}
  color="#4484B2"
  TopAxisLabel={() => <AxisLabel x={max.x} value={max.value} />}
  BottomAxisLabel={() => <AxisLabel x={min.x} value={min.value} />}
/>

Range

Used to define a range for the graph canvas

This range has to be bigger than the span of the provided data points. This feature can be used, e.g. if the graph should show a fixed timeframe, whether there's data for that period or not.



This example shows data in the timeframe between 01/01/2000 to 01/31/2000 and caps the value between 0 and 200:

<LineGraph
  points={priceHistory}
  animated={true}
  color="#4484B2"
  enablePanGesture={true}
  range={{
    x: {
      min: new Date(new Date(2000, 1, 1).getTime()),
      max: new Date(
        new Date(2000, 1, 1).getTime() +
        31 * 1000 * 60 * 60 * 24
      )
    },
    y: {
      min: 0,
      max: 200
    }
  }}
/>

SelectionDot

Used to render the selection dot.

Requires animated and enablePanGesture to be true.

If SelectionDot is missing or undefined, a default one is provided with an outer ring and light shadow.

Example:

<LineGraph
  points={priceHistory}
  animated={true}
  color="#4484B2"
  enablePanGesture={true}
  SelectionDot={CustomSelectionDot}
/>

See this example <SelectionDot /> component.

react-native-graph is sponsored by Pink Panda.

Download the Pink Panda mobile app to see react-native-graph in action!

Community Discord

Join the Margelo Community Discord to chat about react-native-graph or other Margelo libraries.

Adopting at scale

react-native-graph was built at Margelo, an elite app development agency. For enterprise support or other business inquiries, contact us at hello@margelo.com!

Thanks

Special thanks to William Candillon and Christian Falch for their amazing help and support for React Native Skia ❤️

Ähnliche Repositories
faressoft/terminalizer

🦄 Record your terminal and generate animated gif images or share a web player

JavaScriptnpmMIT Licenseterminalrecord
terminalizer.com
16.1k523
ptomasroos/react-native-scrollable-tab-view

Tabbed navigation that you can swipe between, each tab can have its own ScrollView and maintain its own scroll position between swipes. Pleasantly animated. Customizable tab bar

JavaScriptnpmreact-nativetabs
npmjs.com/package/react-native-scrollable-tab-view
6.9k2.2k
rsalmei/alive-progress

A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!

PythonPyPIMIT Licenseprogressbar
6.3k235
ibelick/motion-primitives

UI kit to make beautiful, animated interfaces, faster. Customizable. Open Source.

TypeScriptnpmMIT Licenseanimatedanimation
motion-primitives.com
5.7k221
react-native-modal/react-native-modal

An enhanced, animated, customizable Modal for React Native.

TypeScriptnpmMIT Licensereact-nativereact
5.7k656
christianloopp/komorebi

A beautiful and customizable wallpapers manager for Linux

ValaGNU General Public License v3.0desktoplinux
3.7k257
flesler/jquery.scrollTo

Lightweight, cross-browser and highly customizable animated scrolling with jQuery

JavaScriptnpmMIT Licensejqueryscrollto
demos.flesler.com/jquery/scrollTo/
3.7k996
cheesecakeufo/komorebi

A beautiful and customizable wallpapers manager for Linux

ValaGNU General Public License v3.0desktoplinux
3.5k245
sparrowcode/AlertKit

Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.

SwiftMIT Licensealertpopup
sparrowcode.io/frameworks
2.6k152
gorhom/react-native-animated-tabbar

A 60FPS animated tab bar with a variety of cool animation presets 😎

TypeScriptnpmMIT Licenseanimatedtabbar
1.8k130
marcbruederlin/particles.js

A lightweight, dependency-free and responsive javascript plugin for particle backgrounds.

JavaScriptnpmMIT Licenseparticlesparticle-backgrounds
marcbruederlin.github.io/particles.js/
1.7k209
glouw/paperview

A high performance X11 animated wallpaper setter

CMIT Licenseanimatedwallpaper
glouw.com/2020/08/02/Paperview.html
1.5k47