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

cedchart

v1.0.7

Published

CedChart.js is a react-native module which render a scalable Line Chart

Downloads

5

Readme

CedChart.js

CedChart.js is a react-native module which renders a scalable Line Chart.

Table of Contents

  1. Description
  2. Installation
    1. Dependencies
  3. Usage
    1. Compulsory properties
    2. Color
    3. Second Color
  4. Contributing
  5. F.A.Q

Description

  • The x-axis can contain hourly, weekly or monthly values. The scale will adapt depending on the amount of data with more or less vetical strokes displaying.

  • The y-axis will always display 11 adaptive values corresponding to 0, 10, 20, 30, ... , 100% of the data's max value.

Installation

You can install the module through npm: https://www.npmjs.com/package/cedchart

run npm install cedchart

Usage

  • You implement the chart by calling <CedChart /> in your render()

Compulsory properties

  • Option 1 - You pass pre-fetched data to the Chart: You need 4 props: data, timeUnit, valUnit and period.

    • data must be an array of objects containing at least 2 different object with at least a time unit and a value unit. IMPORTANT: Your time unit must be of a Unix Time Stamp format with 10 digits (see Example below)
    • timeUnit and valUnit are just titles that need to match the names of your time and value names inside your data.
    • period will determine the format of the date. Please indicate 1d for 24-hour format, 1w for day-of-the-week format and 1m or 3m for mm/dd format. Warning: If you want 24-hour format, you also need to have a data array that corresponds to 24 hours worth of data. Same goes for other periods.

    Example:

    <CedChart 
        data={[
            {
              time: '1570522315',
              value: '0',
            },
            {
              time: '1570522215',
              value: '100',
            },
          ]}
        dataType = {"temperature"}  
        timeUnit = {"time"}
        valUnit = {"value"}
        period = {"1d"} 
    />

Color

One additional property for your Chart is color. You can choose between 6 colors:

  • red
  • green
  • blue
  • orange
  • purple
  • pink

If not specified, the default color is blue.

Example:

<CedChart
    data= {[...]}
    timeUnit= {"time"}
    valUnit= {"value"}
    color= {"red"}
/>

Second Color

Another additional property for your graph is secondColor. This allows you to have a custom gradient color different from the main line color. The same colors as color: are available.

If not specified, the default second color is the same as the main color.

Example:

<CedChart
    data= {[...]}
    timeUnit= {"time"}
    valUnit= {"value"}
    color="pink"
    secondColor="orange"
/>

Y Label

yLabel is an additional property to label the y-axis.

Example:

<CedChart
    data= {[...]}
    timeUnit= {"time"}
    valUnit= {"value"}
    yLabel= {"°C"}
/>

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. https://github.com/ThatFrenchComputerGuy/CedChartJs

FAQ

Can I change the aspect ratio of the chart ?

This Chart module has been thought to take the full width of the screen so please Full compatibility cannot be guaranteed if you change the width ratio.

The Chart should render nicely on any screen width so please open an issue stating your screen ratio if it does not.

You can adapt the height a little bit.

Can I load multiple graphs on the same screen ?

Yes you absolutely can.