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

@ivantha/graphjs

v1.0.0

Published

A simple grammar to convert raw data into visual graphs

Downloads

7

Readme

GraphJS logo

GraphJS

Codacy Badge Build Status Coverage Status

A javascript library written in ES6 for parsing a simple grammar which is fully complient with C3.js.

Demo | API Documentation | Developer documentation | Contributing | Code of Conduct |

The GraphJS library is exported as a UMD module.

GraphJS is released under the MIT license & supports modern environments.

Gettings Started

Installation

In a browser:

<script src="graphjs.min.js"></script>

Using npm:

$ npm i --save @ivantha/graphjs

Usage

  1. Initialize a chart using the Graph class
let chart = new Graph("generate <CHART_TYPE> from <JSON_DATASOURCE>")

Chart type can be any one of,

  • LINE_CHART
  • SIMPLE_XY_LINE_CHART
  • STEP_CHART
  • BAR_CHART
  • PIE_CHART
  • COMBINATION_CHART
  • MULTIPLE_XY_LINE_CHART
  • AREA_CHART
  • STACKED_BAR_CHART
  • DONUT_CHART
  • SPLINE_CHART
  • LINE_CHART_WITH_REGIONS
  • STACKED_AREA_CHART
  • SCATTER_PLOT
  • GUAGE_CHART
  1. Modify your chart using the suitable grammar
chart.do("hide tooltip")
chart.do('set gridline x at 20 as another-x')
  1. Export the JSON string of the chart using,
let jsonOut = chart.generateJson()
  1. Generated JSON output is fully complient with the C3.js library
let chart = c3.generate(jsonOut)

Development

NPM scripts

  • npm run esdoc: Generate documentation
  • npm run webpack: Generate minified graphjs.min.js
  • npm run babel: Generate the compiled ES6 source files
  • npm run build: Build everything
  • npm run clean: Clean the build files
  • npm run test: Run all tests

Built With

Authors

Acknowledgments