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

@wz-mobile/rn-gauge

v1.1.0

Published

🍩 Awesome smooth and beautiful animated gauge

Downloads

32

Readme

rn-gauge Known Vulnerabilities CodeQL semantic-release: angular

🍩 React Native Beautiful Gauge ✨

Performant, customizable, beautiful jauge component based on skia engine 🚀

alt text

Preview

Installation

yarn add @wz-mobile/rn-gauge

Get Started

import { Gauge } from '@wz-mobile/rn-gauge';

<Gauge
  emptyColor="#C1C1C1"
  colors={['cyan', 'magenta', 'yellow', 'red', 'white']}
  sweepAngle={250}
  strokeWidth={10}
  fillProgress={60}
  renderLabel={Label}
  size={200}
  thickness={60}
/>;

Features

  • Gradient Colors
  • Sweep Angle resizeable
  • Built on top of Skia
  • Written in TypeScript
  • Smooth Animated effect
  • Use your own needle component

Props

| Name | Type | Default value | Description | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------------------------------------------------------------- | | strokeWidth | number | | The external stroke width of the gauge | | thickness | number | 50 | Gauge thickness | | colors (required) | string[] | | Colors filling the gauge progress | | steps | number[] | | Steps as string array to display steps on the gauge | | emptyColor (required) | string | | Color to display the empty part of the gauge | | renderStep | (props: { getX: GetAxisValue; getY: GetAxisValue; step: number; index: number; radius: number; rotationAngle: number; }) => Element | | Render step function | | fillProgress (required) | number | | The progress value of the gauge. | | sweepAngle (required) | number | 250 | Sweep angle of gauge, default is 250 ( how wide is the gauge ) | | renderNeedle | (params: { getNeedleStyle: GetNeedleStyle; }) => ReactNode | | Render prop for needle component, default is null | | renderLabel (required) | () => ReactNode | | Method to render the label center of the gauge | | size (required) | number | | Size given to the component | | canvasStyle | StyleProp<ViewStyle> | | Custom Canvas style | | shadowProps | AnimatedProps<ShadowProps> | | Shadow props if wanted, could provide nice shadow effects | | springConfig | SpringConfig | | Spring config for fill progress animation | | showGaugeCenter | boolean | | Show gauge center |

Use your own needle component

This sample shows you how to use a custom needle component, it's recommended to set showGaugeCenter to true to fine tune the parameters passed to getNeedleStyle function.

const SimpleNeedle: GaugeProps['renderNeedle'] = ({ getNeedleStyle }) => (
  <>
    <Animated.View style={[getNeedleStyle(80, 80, 14.5, 0, -7.6)]}>
      <AnimatedImage
        style={{ width: 80, height: 80 }}
        resizeMode="contain"
        source={SimpleNeedleImage}
      />
    </Animated.View>
  </>
);

What is sweepAngle ?

alt text

Highly customizable

To Do

  • [ ] RTL Support

Full Sample

You can check full sample in App.tsx located in the example folder for more details about implementation.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT