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-range-chart

v1.1.0

Published

A slider chart component for React Native, enabling interactive range selection with a visually appealing chart interface

Downloads

667

Readme

react-native-range-chart

Description

react-native-range-chart is a versatile and customizable range slider component for React Native, which includes a range slider with one or two handles and an integrated column chart. The column heights represent the frequency of occurrences, making it easy to visualize data distribution within a defined range.

App Screenshot App Screenshot App Screenshot

Installation

To install the package, run:

npm i react-native-range-chart

Usage

Here’s a basic example of how to use the RangeChart component:

import RangeChart from 'react-native-range-chart';

const YourComponent = () => {
  const dataArray = [
    { value: 10, count: 2 },
    { value: 15, count: 5 },
    { value: 20, count: 3 },
    // More data points
  ];

  const handleRangeChange = (newRange) => {
    console.log('Selected Range:', newRange);
  };

  return (
    <RangeChart
      dataArray={dataArray}
      minRange={0}
      maxRange={30}
      maxHeight={200}
      containerWidth={350}
      compareWith="value"
      initialValues=[30,70]
      onRangeChange={handleRangeChange}
    />
  );
};

For a single-handle slider, set initialValues as e.g. [5]. For a double-handle slider, set initialValues as [4,7].

Props

| Prop | Type | Description | |-----------------|---------------|---------------------------------------------------------------------------------------------------| | dataArray | Array | Array of objects with data points, each containing a value to display on the chart and an occurrence count. | | minRange | Number | Minimum value for the range slider. | | maxRange | Number | Maximum value for the range slider. | | maxHeight | Number | Maximum height for the column chart, adjusting based on occurrence frequency. | | containerWidth | Number | Width of the chart container. | | compareWith | String | Key in the data array to compare values with. | | initialValues | Array | Initial values for the range slider; specify [5] for one handle, [5,10] for two handles. | | onRangeChange | Function | Callback function that returns the selected range. | | activeChartColor | String | Color used for active chart elements. default is #23527C | | inactiveChartColor | String | Color used for inactive chart elements. default is #BFBFBF | | sliderHandleBackgroundColor | String | Background color of the slider handle. default is #22527C | | sliderHandleTextColor | String | Text color on the slider handle. default is white | | activeBarColor | String | Color used for the active state of the bar. default is #22527C | | inActiveBarColor | String | Color used for the inactive state of the bar. default is #A7A7A7 |

License

This project is licensed under the MIT License.

Contact

For more information, please reach out to the developer at [email protected]