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

react-native-touchable-graph

v0.0.15

Published

React Native component for touchable graph

Downloads

6

Readme

license Version

react-native-touchable-graph

React Native component for simply creating a graph, without any iOS or Android issue of touch.

Motivation

Victory Native is a great library, but there are tons of problems with the touch behaviour, because it is based on react-native-svg. The idea is to make a wrapper which replace the touchable svg element with react native Touchable component, so you are sure that it will work great both on Android and iOS.

Example app

Android example | Ios example :-------------------------:|:-------------------------: |

Installation

  1. Install library and react-native-svg

    npm i --save victory-native react-native-svg

    Then, if victory-native version >= 0.16.6

     npm i --save react-native-touchable-graph

    else

     npm i --save [email protected]
  2. Link native code for SVG

    react-native link react-native-svg

Usage

Use as follows:


import { VictoryAxis, VictoryBar, VictoryChart, VictoryArea } from 'victory-native'
import TouchableGraph from 'react-native-touchable-graph';

const data = [
  { x: 1, y: 13000 },
  { x: 2, y: 16500 },
  { x: 3, y: 14250 },
  { x: 4, y: 19000 }
];


<TouchableGraph
  onPressBar={(data) => { console.log(data) }}
  onPressTickAxis={(data) => { console.log(data) }}
  >
  <VictoryChart>
    <VictoryAxis
      crossAxis
      orientation="left"
    />
    <VictoryAxis 
      dependentAxis
      crossAxis
      orientation="bottom"
    />
    <VictoryBar
      data={data}
    />
    <VictoryArea
      data={data}
    />
  </VictoryChart>
</TouchableGraph>

Props

Bar props :

  • barStyle (Object) or (Function(barData, index)) - Bar style
  • onPressBar (Function(barData, index)) - Callback when a bar is tapped
  • renderBar (Function(barData, index)) - Custom bar
  • getBarDatum (Function(bars)) - Get Bars datum

Tick axis props :

  • tickAxisStyle (Object) or (Function(tickData, index)) - Tick axis style
  • tickAxisTextStyle (Object) or (Function(tickData, index)) - Tick axis text style
  • onPressTickAxis (Function(tickData, index)) - Callback when a tick axis is tapped
  • renderTickAxis (Function(tickData, index)) - Custom tickAxis
  • getTickAxisDatum (Function(ticks)) - Get Ticks axis datum

Other props :

  • renderLoading (Function()) - Render a loading view when initializing

Roadmap

Improve for :

  • VictoryAxis
  • VictoryBar
  • VictoryChart

Adapt it for :

  • VictoryArea
  • VictoryBoxPlot
  • VictoryCandlestick
  • VictoryErrorBar
  • VictoryPie
  • VictoryPolarAxis
  • VictoryScatter
  • VictoryStack
  • VictoryVoronoi

Others :

  • Example
  • Expo Example
  • Performance
  • Tests

Author

Hugo How-Choong

License

MIT