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

@toog/react-funnel-pipeline

v0.2.2-1

Published

A lightweight component for rendering a basic funnel chart.

Downloads

107

Readme

react-funnel-pipeline

A lightweight component for rendering a basic funnel chart.

NPM JavaScript Style Guide

react-funnel-pipeline

Contents

Install

npm install --save react-funnel-pipeline

Peer Dependencies;

  • React v16 +

Usage

import React, { Component } from 'react'

import { FunnelChart } from 'react-funnel-pipeline'
import 'react-funnel-pipeline/dist/index.css'

class Example extends Component {
  render() {
    return (
      <FunnelChart
        data={[
          { name: 'Awareness', value: 252 },
          { name: 'Interest', value: 105 },
          { name: 'Consideration', value: 84 },
          { name: 'Evaluation', value: 72 },
          { name: 'Commitment', value: 19 },
          { name: 'Pre-sale', value: 0 },
          { name: 'Sale', value: 10 }
        ]}
      />
    )
  }
}

See the Examples for more info and advanced usage.

Build the Examples with npm install and then npm start to start the development server at http://localhost:3000.

Or view the online examples at https://darylbuckle.github.io/react-funnel-pipeline.

Props

| Property | Type | Default | Mandatory | Description | | --------------------- | ----------------------- | ------------------------------------------------------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | data | object[] | | true | The data to display in the Funnel Chart. Must be an array of objects that contain a minimum of 'name' (string) and 'value' (number). | | title | string | | false | Displays a title above the funnel chart. | | showValues | boolean | true | false | Whether to show the value within the chart segment. | | showNames | boolean | true | false | Whether to show the name of the segment within the chart segment. | | showRunningTotal | boolean | false | false | When this is true instead of showing the value in the segment it will show the running total of all values underneath it. | | pallette | string[] | ['#f14c14', '#f39c35', '#68BC00', '#1d7b63', '#4e97a8', '#4466a3'] | false | A list of hexadecimal colours as strings to use for the background colour of chart segments. | | chartWidth | number | | false | The maximum width of the chart. | | chartHeight | number | 500 | false | This is only used when 'heightRelativeToValue' is true. The height of the chart. | | heightRelativeToValue | boolean | false | false | When true each segment will have it's height relative to the value. IE segments with higher values will appear larger than those with smaller values. | | style | style object | | false | A React.CSSProperty to override styles for the chart. | | getRowStyle | func(row) | | false | A function which parses row data. Return a React.CSSProperty to override styles for that row. | | getRowNameStyle | func(row) | | false | A function which parses row data. Return a React.CSSProperty to override styles for that rows name. | | getRowValueStyle | func(row) | | false | A function which parses row data. Return a React.CSSProperty to override styles for that rows value. | | getTitleStyle | func(title) | | false | A function which parses the tiel data. Return a React.CSSProperty to override styles for that rows value. | | decorateValue | func(row, index, array) | | false | A function which decorates the value when rendering the row value. Return an object to override the value displayed on the row. The unaltered value is used in all other calculations. | | getToolTip | func(row) | | false | A function which parses row data. Return a string to override the tooltip for that row. | | onRowClick | func(row) | | false | Called when a row/segment is clicked. Parses the data of the row which was clicked on. | | funnelShape | 'standard' | 'flat' | 'standard' | false | Controls the shape of the final funnel segment, standard ends in a point, flat ends as a flat rectangle. |

|

License

MIT © DarylBuckle 2020